(props: {
isOpen: boolean;
size: 'S' | 'M' | 'L' | 'XL';
setButtonHasFocus: (hasFocus: boolean) => void;
})
| 314 | } |
| 315 | |
| 316 | export function CalendarButton(props: { |
| 317 | isOpen: boolean; |
| 318 | size: 'S' | 'M' | 'L' | 'XL'; |
| 319 | setButtonHasFocus: (hasFocus: boolean) => void; |
| 320 | }): ReactElement { |
| 321 | let buttonRef = useRef<HTMLButtonElement>(null); |
| 322 | let {isOpen, size, setButtonHasFocus} = props; |
| 323 | return ( |
| 324 | <Button |
| 325 | ref={buttonRef} |
| 326 | // Prevent press scale from sticking while DatePicker is open. |
| 327 | // @ts-ignore |
| 328 | isPressed={false} |
| 329 | onFocusChange={setButtonHasFocus} |
| 330 | style={pressScale(buttonRef)} |
| 331 | className={renderProps => |
| 332 | inputButton({ |
| 333 | ...renderProps, |
| 334 | size, |
| 335 | isOpen |
| 336 | }) |
| 337 | }> |
| 338 | <Provider |
| 339 | values={[ |
| 340 | [ |
| 341 | IconContext, |
| 342 | { |
| 343 | styles: style({ |
| 344 | '--iconPrimary': { |
| 345 | type: 'fill', |
| 346 | value: 'currentColor' |
| 347 | }, |
| 348 | size: fontRelative(14) |
| 349 | }) |
| 350 | } |
| 351 | ] |
| 352 | ]}> |
| 353 | <CalendarIcon /> |
| 354 | </Provider> |
| 355 | </Button> |
| 356 | ); |
| 357 | } |
nothing calls this directly
no test coverage detected