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