(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 | // oxlint-disable react/react-compiler |
| 324 | return ( |
| 325 | <Button |
| 326 | ref={buttonRef} |
| 327 | // Prevent press scale from sticking while DatePicker is open. |
| 328 | // @ts-ignore |
| 329 | isPressed={false} |
| 330 | onFocusChange={setButtonHasFocus} |
| 331 | style={pressScale(buttonRef)} |
| 332 | className={renderProps => |
| 333 | inputButton({ |
| 334 | ...renderProps, |
| 335 | size, |
| 336 | isOpen |
| 337 | }) |
| 338 | }> |
| 339 | <Provider |
| 340 | values={[ |
| 341 | [ |
| 342 | IconContext, |
| 343 | { |
| 344 | styles: style({ |
| 345 | '--iconPrimary': { |
| 346 | type: 'fill', |
| 347 | value: 'currentColor' |
| 348 | }, |
| 349 | size: fontRelative(14) |
| 350 | }) |
| 351 | } |
| 352 | ] |
| 353 | ]}> |
| 354 | <CalendarIcon /> |
| 355 | </Provider> |
| 356 | </Button> |
| 357 | ); |
| 358 | // oxlint-enable react/react-compiler |
| 359 | } |
nothing calls this directly
no test coverage detected