@seed-design/react 2.5.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Accordion/Accordion.cjs +2 -1
- package/lib/components/Accordion/Accordion.d.ts.map +1 -1
- package/lib/components/Accordion/Accordion.js +2 -1
- package/lib/components/ActionButton/ActionButton.cjs +1 -1
- package/lib/components/ActionButton/ActionButton.js +1 -1
- package/lib/components/AlertDialog/AlertDialog.cjs +34 -0
- package/lib/components/AlertDialog/AlertDialog.d.ts +51 -0
- package/lib/components/AlertDialog/AlertDialog.d.ts.map +1 -0
- package/lib/components/AlertDialog/AlertDialog.js +24 -0
- package/lib/components/AlertDialog/AlertDialog.namespace.cjs +22 -0
- package/lib/components/AlertDialog/AlertDialog.namespace.d.ts +2 -0
- package/lib/components/AlertDialog/AlertDialog.namespace.d.ts.map +1 -0
- package/lib/components/AlertDialog/AlertDialog.namespace.js +17 -0
- package/lib/components/AlertDialog/AlertDialog.test.d.ts +2 -0
- package/lib/components/AlertDialog/AlertDialog.test.d.ts.map +1 -0
- package/lib/components/AlertDialog/index.cjs +19 -0
- package/lib/components/AlertDialog/index.d.ts +3 -0
- package/lib/components/AlertDialog/index.d.ts.map +1 -0
- package/lib/components/AlertDialog/index.js +3 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplay.cjs +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplay.js +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplayItem.cjs +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplayItem.d.ts.map +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplayItem.js +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.cjs +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.js +1 -1
- package/lib/components/AttachmentDisplay/index.cjs +8 -0
- package/lib/components/AttachmentDisplay/index.d.ts +2 -0
- package/lib/components/AttachmentDisplay/index.d.ts.map +1 -1
- package/lib/components/AttachmentDisplay/index.js +2 -1
- package/lib/components/AttachmentInput/AttachmentInput.cjs +1 -1
- package/lib/components/AttachmentInput/AttachmentInput.js +1 -1
- package/lib/components/AttachmentInput/AttachmentInputDropzone.cjs +1 -1
- package/lib/components/AttachmentInput/AttachmentInputDropzone.js +1 -1
- package/lib/components/AttachmentInput/AttachmentInputItem.cjs +2 -2
- package/lib/components/AttachmentInput/AttachmentInputItem.d.ts.map +1 -1
- package/lib/components/AttachmentInput/AttachmentInputItem.js +2 -2
- package/lib/components/AttachmentInput/AttachmentInputTrigger.cjs +1 -1
- package/lib/components/AttachmentInput/AttachmentInputTrigger.js +1 -1
- package/lib/components/AttachmentInput/index.cjs +8 -0
- package/lib/components/AttachmentInput/index.d.ts +2 -0
- package/lib/components/AttachmentInput/index.d.ts.map +1 -1
- package/lib/components/AttachmentInput/index.js +2 -1
- package/lib/components/Badge/Badge.cjs +52 -10
- package/lib/components/Badge/Badge.d.ts +13 -4
- package/lib/components/Badge/Badge.d.ts.map +1 -1
- package/lib/components/Badge/Badge.js +49 -11
- package/lib/components/Badge/Badge.namespace.cjs +16 -0
- package/lib/components/Badge/Badge.namespace.d.ts +2 -0
- package/lib/components/Badge/Badge.namespace.d.ts.map +1 -0
- package/lib/components/Badge/Badge.namespace.js +11 -0
- package/lib/components/Badge/Badge.test.d.ts +2 -0
- package/lib/components/Badge/Badge.test.d.ts.map +1 -0
- package/lib/components/Badge/index.cjs +11 -1
- package/lib/components/Badge/index.d.ts +2 -1
- package/lib/components/Badge/index.d.ts.map +1 -1
- package/lib/components/Badge/index.js +3 -2
- package/lib/components/Box/Box.test.d.ts +2 -0
- package/lib/components/Box/Box.test.d.ts.map +1 -0
- package/lib/components/Checkbox/Checkbox.cjs +2 -2
- package/lib/components/Checkbox/Checkbox.d.ts +3 -1
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +2 -2
- package/lib/components/Checkbox/Checkbox.namespace.d.ts +1 -1
- package/lib/components/Checkbox/Checkbox.namespace.d.ts.map +1 -1
- package/lib/components/Checkbox/index.d.ts +1 -1
- package/lib/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/Chip/Chip.cjs +13 -5
- package/lib/components/Chip/Chip.d.ts +13 -2
- package/lib/components/Chip/Chip.d.ts.map +1 -1
- package/lib/components/Chip/Chip.js +10 -5
- package/lib/components/Chip/Chip.namespace.cjs +5 -2
- package/lib/components/Chip/Chip.namespace.d.ts +1 -1
- package/lib/components/Chip/Chip.namespace.d.ts.map +1 -1
- package/lib/components/Chip/Chip.namespace.js +6 -3
- package/lib/components/Chip/index.cjs +4 -1
- package/lib/components/Chip/index.d.ts +1 -1
- package/lib/components/Chip/index.d.ts.map +1 -1
- package/lib/components/Chip/index.js +2 -2
- package/lib/components/ChipTabs/ChipTabs.cjs +1 -1
- package/lib/components/ChipTabs/ChipTabs.js +1 -1
- package/lib/components/DatePicker/DatePicker.cjs +192 -190
- package/lib/components/DatePicker/DatePicker.d.ts +50 -21
- package/lib/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/lib/components/DatePicker/DatePicker.js +189 -187
- package/lib/components/DatePicker/DatePicker.namespace.cjs +16 -0
- package/lib/components/DatePicker/DatePicker.namespace.d.ts +2 -0
- package/lib/components/DatePicker/DatePicker.namespace.d.ts.map +1 -0
- package/lib/components/DatePicker/DatePicker.namespace.js +11 -0
- package/lib/components/DatePicker/index.cjs +11 -4
- package/lib/components/DatePicker/index.d.ts +3 -2
- package/lib/components/DatePicker/index.d.ts.map +1 -1
- package/lib/components/DatePicker/index.js +3 -2
- package/lib/components/Dialog/Dialog.cjs +84 -9
- package/lib/components/Dialog/Dialog.d.ts +21 -14
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.js +80 -9
- package/lib/components/Dialog/Dialog.namespace.cjs +2 -0
- package/lib/components/Dialog/Dialog.namespace.d.ts +1 -1
- package/lib/components/Dialog/Dialog.namespace.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.namespace.js +3 -1
- package/lib/components/Dialog/index.cjs +2 -0
- package/lib/components/Dialog/index.d.ts +1 -1
- package/lib/components/Dialog/index.d.ts.map +1 -1
- package/lib/components/Dialog/index.js +2 -2
- package/lib/components/HelpBubble/HelpBubble.cjs +18 -5
- package/lib/components/HelpBubble/HelpBubble.d.ts +5 -0
- package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
- package/lib/components/HelpBubble/HelpBubble.js +18 -5
- package/lib/components/HelpBubble/HelpBubble.test.d.ts +2 -0
- package/lib/components/HelpBubble/HelpBubble.test.d.ts.map +1 -0
- package/lib/components/ImageFrame/ImageFrame.cjs +5 -4
- package/lib/components/ImageFrame/ImageFrame.d.ts +2 -2
- package/lib/components/ImageFrame/ImageFrame.d.ts.map +1 -1
- package/lib/components/ImageFrame/ImageFrame.js +6 -5
- package/lib/components/List/List.cjs +14 -3
- package/lib/components/List/List.d.ts +15 -0
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.js +11 -4
- package/lib/components/List/List.namespace.cjs +4 -0
- package/lib/components/List/List.namespace.d.ts +1 -1
- package/lib/components/List/List.namespace.d.ts.map +1 -1
- package/lib/components/List/List.namespace.js +5 -1
- package/lib/components/List/index.cjs +4 -0
- package/lib/components/List/index.d.ts +1 -1
- package/lib/components/List/index.d.ts.map +1 -1
- package/lib/components/List/index.js +2 -2
- package/lib/components/Menu/Menu.cjs +3 -2
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +3 -2
- package/lib/components/MenuSheet/MenuSheet.cjs +4 -3
- package/lib/components/MenuSheet/MenuSheet.d.ts.map +1 -1
- package/lib/components/MenuSheet/MenuSheet.js +4 -3
- package/lib/components/NavigationMenu/NavigationMenu.cjs +4 -3
- package/lib/components/NavigationMenu/NavigationMenu.d.ts.map +1 -1
- package/lib/components/NavigationMenu/NavigationMenu.js +4 -3
- package/lib/components/PageBanner/PageBanner.cjs +3 -2
- package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
- package/lib/components/PageBanner/PageBanner.js +3 -2
- package/lib/components/{ContentDialog/ContentDialog.cjs → Popover/Popover.cjs} +61 -40
- package/lib/components/Popover/Popover.d.ts +69 -0
- package/lib/components/Popover/Popover.d.ts.map +1 -0
- package/lib/components/{ContentDialog/ContentDialog.js → Popover/Popover.js} +49 -29
- package/lib/components/Popover/Popover.namespace.cjs +26 -0
- package/lib/components/Popover/Popover.namespace.d.ts +2 -0
- package/lib/components/Popover/Popover.namespace.d.ts.map +1 -0
- package/lib/components/Popover/Popover.namespace.js +21 -0
- package/lib/components/Popover/Popover.test.d.ts +2 -0
- package/lib/components/Popover/Popover.test.d.ts.map +1 -0
- package/lib/components/Popover/index.cjs +23 -0
- package/lib/components/Popover/index.d.ts +3 -0
- package/lib/components/Popover/index.d.ts.map +1 -0
- package/lib/components/Popover/index.js +3 -0
- package/lib/components/QuantityPicker/QuantityPicker.d.ts.map +1 -1
- package/lib/components/RadioGroup/RadioGroup.cjs +2 -2
- package/lib/components/RadioGroup/RadioGroup.d.ts +2 -0
- package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/lib/components/RadioGroup/RadioGroup.js +2 -2
- package/lib/components/RadioGroup/RadioGroup.namespace.d.ts +1 -1
- package/lib/components/RadioGroup/RadioGroup.namespace.d.ts.map +1 -1
- package/lib/components/RadioGroup/index.d.ts +1 -1
- package/lib/components/RadioGroup/index.d.ts.map +1 -1
- package/lib/components/RadioGroupField/RadioGroupField.cjs +2 -2
- package/lib/components/RadioGroupField/RadioGroupField.d.ts +5 -1
- package/lib/components/RadioGroupField/RadioGroupField.d.ts.map +1 -1
- package/lib/components/RadioGroupField/RadioGroupField.js +2 -2
- package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts +1 -1
- package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts.map +1 -1
- package/lib/components/ReactionButton/ReactionButton.cjs +1 -1
- package/lib/components/ReactionButton/ReactionButton.js +1 -1
- package/lib/components/ResponsiveDialog/ResponsiveDialog.cjs +13 -13
- package/lib/components/ResponsiveDialog/ResponsiveDialog.d.ts +15 -15
- package/lib/components/ResponsiveDialog/ResponsiveDialog.d.ts.map +1 -1
- package/lib/components/ResponsiveDialog/ResponsiveDialog.js +13 -13
- package/lib/components/SegmentedControl/SegmentedControl.cjs +2 -1
- package/lib/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/lib/components/SegmentedControl/SegmentedControl.js +2 -1
- package/lib/components/Select/Select.cjs +5 -4
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +5 -4
- package/lib/components/SelectBox/CheckSelectBox.cjs +20 -6
- package/lib/components/SelectBox/CheckSelectBox.d.ts +7 -0
- package/lib/components/SelectBox/CheckSelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/CheckSelectBox.js +21 -7
- package/lib/components/SelectBox/RadioSelectBox.cjs +20 -6
- package/lib/components/SelectBox/RadioSelectBox.d.ts +7 -0
- package/lib/components/SelectBox/RadioSelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/RadioSelectBox.js +21 -7
- package/lib/components/SelectBox/SelectBox.test.d.ts +2 -0
- package/lib/components/SelectBox/SelectBox.test.d.ts.map +1 -0
- package/lib/components/SideNavigation/SideNavigation.cjs +2 -2
- package/lib/components/SideNavigation/SideNavigation.js +2 -2
- package/lib/components/SideNavigation/index.cjs +8 -0
- package/lib/components/SideNavigation/index.d.ts +1 -0
- package/lib/components/SideNavigation/index.d.ts.map +1 -1
- package/lib/components/SideNavigation/index.js +2 -1
- package/lib/components/SidePanel/SidePanel.d.ts +0 -12
- package/lib/components/SidePanel/SidePanel.d.ts.map +1 -1
- package/lib/components/Slider/Slider.cjs +1 -1
- package/lib/components/Slider/Slider.js +1 -1
- package/lib/components/Snackbar/Snackbar.cjs +2 -2
- package/lib/components/Snackbar/Snackbar.js +2 -2
- package/lib/components/Snackbar/useSnackbarAdapter.cjs +1 -1
- package/lib/components/Snackbar/useSnackbarAdapter.js +1 -1
- package/lib/components/Stack/Stack.cjs +0 -12
- package/lib/components/Stack/Stack.d.ts +0 -8
- package/lib/components/Stack/Stack.d.ts.map +1 -1
- package/lib/components/Stack/Stack.js +1 -12
- package/lib/components/Stack/index.cjs +0 -1
- package/lib/components/Stack/index.d.ts +1 -1
- package/lib/components/Stack/index.d.ts.map +1 -1
- package/lib/components/Stack/index.js +2 -2
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.cjs +3 -2
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts.map +1 -1
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.js +3 -2
- package/lib/components/Switch/Switch.cjs +3 -3
- package/lib/components/Switch/Switch.d.ts +5 -1
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.js +3 -3
- package/lib/components/Switch/Switch.namespace.d.ts +1 -1
- package/lib/components/Switch/Switch.namespace.d.ts.map +1 -1
- package/lib/components/Switch/index.d.ts +1 -1
- package/lib/components/Switch/index.d.ts.map +1 -1
- package/lib/components/TagGroup/TagGroup.d.ts.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.cjs +1 -1
- package/lib/components/ToggleButton/ToggleButton.js +1 -1
- package/lib/components/WheelPicker/WheelPicker.cjs +11 -12
- package/lib/components/WheelPicker/WheelPicker.d.ts +7 -2
- package/lib/components/WheelPicker/WheelPicker.d.ts.map +1 -1
- package/lib/components/WheelPicker/WheelPicker.js +11 -12
- package/lib/components/index.cjs +90 -94
- package/lib/components/index.d.ts +2 -12
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +17 -24
- package/lib/index.cjs +116 -94
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +20 -25
- package/lib/utils/styled.cjs +3 -2
- package/lib/utils/styled.d.ts +18 -11
- package/lib/utils/styled.d.ts.map +1 -1
- package/lib/utils/styled.js +3 -2
- package/lib/utils/withContentScale.cjs +30 -0
- package/lib/utils/withContentScale.d.ts +12 -0
- package/lib/utils/withContentScale.d.ts.map +1 -0
- package/lib/utils/withContentScale.js +27 -0
- package/lib/utils/withContentScale.test.d.ts +2 -0
- package/lib/utils/withContentScale.test.d.ts.map +1 -0
- package/package.json +9 -14
- package/src/components/Accordion/Accordion.tsx +3 -3
- package/src/components/AlertDialog/AlertDialog.namespace.ts +22 -0
- package/src/components/AlertDialog/AlertDialog.test.tsx +61 -0
- package/src/components/AlertDialog/AlertDialog.tsx +115 -0
- package/src/components/AlertDialog/index.ts +24 -0
- package/src/components/AttachmentDisplay/AttachmentDisplayItem.tsx +2 -0
- package/src/components/AttachmentDisplay/index.ts +10 -0
- package/src/components/AttachmentInput/AttachmentInputItem.tsx +2 -0
- package/src/components/AttachmentInput/index.ts +10 -0
- package/src/components/Badge/Badge.namespace.ts +10 -0
- package/src/components/Badge/Badge.test.tsx +56 -0
- package/src/components/Badge/Badge.tsx +82 -11
- package/src/components/Badge/index.ts +12 -1
- package/src/components/Box/Box.test.tsx +88 -0
- package/src/components/Checkbox/Checkbox.namespace.ts +1 -0
- package/src/components/Checkbox/Checkbox.tsx +3 -1
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Chip/Chip.namespace.ts +8 -2
- package/src/components/Chip/Chip.tsx +34 -7
- package/src/components/Chip/index.ts +8 -2
- package/src/components/DatePicker/DatePicker.namespace.ts +14 -0
- package/src/components/DatePicker/DatePicker.test.tsx +85 -276
- package/src/components/DatePicker/DatePicker.tsx +327 -284
- package/src/components/DatePicker/index.ts +25 -21
- package/src/components/Dialog/Dialog.namespace.ts +4 -0
- package/src/components/Dialog/Dialog.tsx +128 -10
- package/src/components/Dialog/index.ts +4 -5
- package/src/components/HelpBubble/HelpBubble.test.tsx +111 -0
- package/src/components/HelpBubble/HelpBubble.tsx +19 -3
- package/src/components/ImageFrame/ImageFrame.tsx +12 -4
- package/src/components/List/List.namespace.ts +8 -0
- package/src/components/List/List.tsx +43 -3
- package/src/components/List/index.ts +8 -0
- package/src/components/Menu/Menu.tsx +4 -3
- package/src/components/MenuSheet/MenuSheet.tsx +20 -17
- package/src/components/NavigationMenu/NavigationMenu.tsx +20 -17
- package/src/components/PageBanner/PageBanner.tsx +6 -3
- package/src/components/Popover/Popover.namespace.ts +30 -0
- package/src/components/Popover/Popover.test.tsx +222 -0
- package/src/components/Popover/Popover.tsx +282 -0
- package/src/components/Popover/index.ts +32 -0
- package/src/components/QuantityPicker/QuantityPicker.tsx +2 -0
- package/src/components/RadioGroup/RadioGroup.namespace.ts +1 -0
- package/src/components/RadioGroup/RadioGroup.tsx +2 -0
- package/src/components/RadioGroup/index.ts +1 -0
- package/src/components/RadioGroupField/RadioGroupField.namespace.ts +1 -0
- package/src/components/RadioGroupField/RadioGroupField.tsx +5 -3
- package/src/components/ResponsiveDialog/ResponsiveDialog.tsx +45 -48
- package/src/components/SegmentedControl/SegmentedControl.tsx +3 -3
- package/src/components/Select/Select.tsx +7 -6
- package/src/components/SelectBox/CheckSelectBox.tsx +28 -10
- package/src/components/SelectBox/RadioSelectBox.tsx +28 -10
- package/src/components/SelectBox/SelectBox.test.tsx +138 -0
- package/src/components/SideNavigation/index.ts +5 -0
- package/src/components/SidePanel/SidePanel.tsx +1 -16
- package/src/components/Stack/Stack.tsx +0 -12
- package/src/components/Stack/index.ts +1 -8
- package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx +20 -18
- package/src/components/Switch/Switch.namespace.ts +1 -0
- package/src/components/Switch/Switch.tsx +6 -3
- package/src/components/Switch/index.ts +1 -0
- package/src/components/TagGroup/TagGroup.tsx +2 -0
- package/src/components/WheelPicker/WheelPicker.test.tsx +53 -44
- package/src/components/WheelPicker/WheelPicker.tsx +24 -21
- package/src/components/index.ts +2 -12
- package/src/index.ts +25 -2
- package/src/utils/styled.tsx +72 -15
- package/src/utils/withContentScale.test.tsx +88 -0
- package/src/utils/withContentScale.tsx +48 -0
- package/lib/components/ActionChip/ActionChip.cjs +0 -15
- package/lib/components/ActionChip/ActionChip.d.ts +0 -23
- package/lib/components/ActionChip/ActionChip.d.ts.map +0 -1
- package/lib/components/ActionChip/ActionChip.js +0 -14
- package/lib/components/ActionChip/index.cjs +0 -3
- package/lib/components/ActionChip/index.d.ts +0 -2
- package/lib/components/ActionChip/index.d.ts.map +0 -1
- package/lib/components/ActionChip/index.js +0 -2
- package/lib/components/ActionSheet/ActionSheet.cjs +0 -72
- package/lib/components/ActionSheet/ActionSheet.d.ts +0 -113
- package/lib/components/ActionSheet/ActionSheet.d.ts.map +0 -1
- package/lib/components/ActionSheet/ActionSheet.js +0 -61
- package/lib/components/ActionSheet/ActionSheet.namespace.cjs +0 -23
- package/lib/components/ActionSheet/ActionSheet.namespace.d.ts +0 -2
- package/lib/components/ActionSheet/ActionSheet.namespace.d.ts.map +0 -1
- package/lib/components/ActionSheet/ActionSheet.namespace.js +0 -18
- package/lib/components/ActionSheet/index.cjs +0 -20
- package/lib/components/ActionSheet/index.d.ts +0 -3
- package/lib/components/ActionSheet/index.d.ts.map +0 -1
- package/lib/components/ActionSheet/index.js +0 -3
- package/lib/components/Columns/Columns.cjs +0 -38
- package/lib/components/Columns/Columns.d.ts +0 -22
- package/lib/components/Columns/Columns.d.ts.map +0 -1
- package/lib/components/Columns/Columns.js +0 -35
- package/lib/components/Columns/index.cjs +0 -4
- package/lib/components/Columns/index.d.ts +0 -2
- package/lib/components/Columns/index.d.ts.map +0 -1
- package/lib/components/Columns/index.js +0 -2
- package/lib/components/ContentDialog/ContentDialog.d.ts +0 -50
- package/lib/components/ContentDialog/ContentDialog.d.ts.map +0 -1
- package/lib/components/ContentDialog/ContentDialog.namespace.cjs +0 -24
- package/lib/components/ContentDialog/ContentDialog.namespace.d.ts +0 -2
- package/lib/components/ContentDialog/ContentDialog.namespace.d.ts.map +0 -1
- package/lib/components/ContentDialog/ContentDialog.namespace.js +0 -19
- package/lib/components/ContentDialog/index.cjs +0 -21
- package/lib/components/ContentDialog/index.d.ts +0 -3
- package/lib/components/ContentDialog/index.d.ts.map +0 -1
- package/lib/components/ContentDialog/index.js +0 -3
- package/lib/components/ControlChip/ControlChip.cjs +0 -15
- package/lib/components/ControlChip/ControlChip.d.ts +0 -28
- package/lib/components/ControlChip/ControlChip.d.ts.map +0 -1
- package/lib/components/ControlChip/ControlChip.js +0 -14
- package/lib/components/ControlChip/index.cjs +0 -3
- package/lib/components/ControlChip/index.d.ts +0 -2
- package/lib/components/ControlChip/index.d.ts.map +0 -1
- package/lib/components/ControlChip/index.js +0 -2
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +0 -77
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts +0 -122
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts.map +0 -1
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +0 -65
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.cjs +0 -24
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.d.ts +0 -2
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.d.ts.map +0 -1
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.js +0 -19
- package/lib/components/ExtendedActionSheet/index.cjs +0 -21
- package/lib/components/ExtendedActionSheet/index.d.ts +0 -3
- package/lib/components/ExtendedActionSheet/index.d.ts.map +0 -1
- package/lib/components/ExtendedActionSheet/index.js +0 -3
- package/lib/components/ExtendedFab/ExtendedFab.cjs +0 -16
- package/lib/components/ExtendedFab/ExtendedFab.d.ts +0 -13
- package/lib/components/ExtendedFab/ExtendedFab.d.ts.map +0 -1
- package/lib/components/ExtendedFab/ExtendedFab.js +0 -15
- package/lib/components/ExtendedFab/index.cjs +0 -3
- package/lib/components/ExtendedFab/index.d.ts +0 -2
- package/lib/components/ExtendedFab/index.d.ts.map +0 -1
- package/lib/components/ExtendedFab/index.js +0 -2
- package/lib/components/Fab/Fab.cjs +0 -13
- package/lib/components/Fab/Fab.d.ts +0 -13
- package/lib/components/Fab/Fab.d.ts.map +0 -1
- package/lib/components/Fab/Fab.js +0 -12
- package/lib/components/Fab/index.cjs +0 -3
- package/lib/components/Fab/index.d.ts +0 -2
- package/lib/components/Fab/index.d.ts.map +0 -1
- package/lib/components/Fab/index.js +0 -2
- package/lib/components/Inline/Inline.cjs +0 -23
- package/lib/components/Inline/Inline.d.ts +0 -12
- package/lib/components/Inline/Inline.d.ts.map +0 -1
- package/lib/components/Inline/Inline.js +0 -21
- package/lib/components/Inline/index.cjs +0 -3
- package/lib/components/Inline/index.d.ts +0 -2
- package/lib/components/Inline/index.d.ts.map +0 -1
- package/lib/components/Inline/index.js +0 -2
- package/lib/components/InlineBanner/InlineBanner.cjs +0 -39
- package/lib/components/InlineBanner/InlineBanner.d.ts +0 -59
- package/lib/components/InlineBanner/InlineBanner.d.ts.map +0 -1
- package/lib/components/InlineBanner/InlineBanner.js +0 -33
- package/lib/components/InlineBanner/InlineBanner.namespace.cjs +0 -18
- package/lib/components/InlineBanner/InlineBanner.namespace.d.ts +0 -2
- package/lib/components/InlineBanner/InlineBanner.namespace.d.ts.map +0 -1
- package/lib/components/InlineBanner/InlineBanner.namespace.js +0 -13
- package/lib/components/InlineBanner/index.cjs +0 -15
- package/lib/components/InlineBanner/index.d.ts +0 -3
- package/lib/components/InlineBanner/index.d.ts.map +0 -1
- package/lib/components/InlineBanner/index.js +0 -3
- package/lib/components/LinkContent/LinkContent.cjs +0 -14
- package/lib/components/LinkContent/LinkContent.d.ts +0 -14
- package/lib/components/LinkContent/LinkContent.d.ts.map +0 -1
- package/lib/components/LinkContent/LinkContent.js +0 -13
- package/lib/components/LinkContent/index.cjs +0 -3
- package/lib/components/LinkContent/index.d.ts +0 -2
- package/lib/components/LinkContent/index.d.ts.map +0 -1
- package/lib/components/LinkContent/index.js +0 -2
- package/lib/components/TimePicker/TimePicker.cjs +0 -97
- package/lib/components/TimePicker/TimePicker.d.ts +0 -28
- package/lib/components/TimePicker/TimePicker.d.ts.map +0 -1
- package/lib/components/TimePicker/TimePicker.js +0 -94
- package/lib/components/TimePicker/TimePicker.test.d.ts +0 -2
- package/lib/components/TimePicker/TimePicker.test.d.ts.map +0 -1
- package/lib/components/TimePicker/index.cjs +0 -3
- package/lib/components/TimePicker/index.d.ts +0 -2
- package/lib/components/TimePicker/index.d.ts.map +0 -1
- package/lib/components/TimePicker/index.js +0 -2
- package/lib/components/private/WheelPicker.cjs +0 -63
- package/lib/components/private/WheelPicker.d.ts +0 -16
- package/lib/components/private/WheelPicker.d.ts.map +0 -1
- package/lib/components/private/WheelPicker.js +0 -59
- package/lib/components/private/WheelPicker.test.d.ts +0 -2
- package/lib/components/private/WheelPicker.test.d.ts.map +0 -1
- package/lib/primitive.cjs +0 -154
- package/lib/primitive.d.ts +0 -18
- package/lib/primitive.d.ts.map +0 -1
- package/lib/primitive.js +0 -17
- package/src/components/ActionChip/ActionChip.tsx +0 -34
- package/src/components/ActionChip/index.ts +0 -4
- package/src/components/ActionSheet/ActionSheet.namespace.ts +0 -24
- package/src/components/ActionSheet/ActionSheet.tsx +0 -192
- package/src/components/ActionSheet/index.ts +0 -26
- package/src/components/Columns/Columns.tsx +0 -50
- package/src/components/Columns/index.ts +0 -1
- package/src/components/ContentDialog/ContentDialog.namespace.ts +0 -26
- package/src/components/ContentDialog/ContentDialog.tsx +0 -224
- package/src/components/ContentDialog/index.ts +0 -33
- package/src/components/ControlChip/ControlChip.tsx +0 -38
- package/src/components/ControlChip/index.ts +0 -5
- package/src/components/ExtendedActionSheet/ExtendedActionSheet.namespace.ts +0 -26
- package/src/components/ExtendedActionSheet/ExtendedActionSheet.tsx +0 -220
- package/src/components/ExtendedActionSheet/index.ts +0 -28
- package/src/components/ExtendedFab/ExtendedFab.tsx +0 -25
- package/src/components/ExtendedFab/index.ts +0 -4
- package/src/components/Fab/Fab.tsx +0 -21
- package/src/components/Fab/index.ts +0 -4
- package/src/components/Inline/Inline.tsx +0 -25
- package/src/components/Inline/index.ts +0 -1
- package/src/components/InlineBanner/InlineBanner.namespace.ts +0 -14
- package/src/components/InlineBanner/InlineBanner.tsx +0 -103
- package/src/components/InlineBanner/index.ts +0 -16
- package/src/components/LinkContent/LinkContent.tsx +0 -23
- package/src/components/LinkContent/index.ts +0 -4
- package/src/components/TimePicker/TimePicker.test.tsx +0 -166
- package/src/components/TimePicker/TimePicker.tsx +0 -163
- package/src/components/TimePicker/index.ts +0 -6
- package/src/components/private/WheelPicker.test.tsx +0 -55
- package/src/components/private/WheelPicker.tsx +0 -110
- package/src/primitive.ts +0 -17
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { act, fireEvent, render
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
ContinuousDatePicker,
|
|
6
|
-
DatePicker,
|
|
7
|
-
type DatePickerActions,
|
|
8
|
-
TwoMonthDatePicker,
|
|
9
|
-
WeekDatePicker,
|
|
10
|
-
} from "./DatePicker";
|
|
1
|
+
import { act, fireEvent, render } from "@testing-library/react";
|
|
2
|
+
import userEvent from "@testing-library/user-event";
|
|
3
|
+
import { describe, expect, it } from "bun:test";
|
|
4
|
+
import { DatePicker } from "./index";
|
|
11
5
|
|
|
12
6
|
const commonProps = {
|
|
13
7
|
today: { year: 2026, month: 7, day: 30 },
|
|
@@ -15,290 +9,105 @@ const commonProps = {
|
|
|
15
9
|
defaultViewDate: { year: 2026, month: 7, day: 1 },
|
|
16
10
|
} as const;
|
|
17
11
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
const leftIcon = <svg data-icon="left" />;
|
|
13
|
+
const rightIcon = <svg data-icon="right" />;
|
|
14
|
+
const headerIcon = <svg data-icon="down" />;
|
|
21
15
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
expect(getByRole("group")).toHaveAccessibleName("Select date");
|
|
29
|
-
|
|
30
|
-
rerender(<DatePicker {...commonProps} ariaLabels={{ root: "예약 날짜 선택" }} />);
|
|
31
|
-
expect(getByRole("group")).toHaveAccessibleName("예약 날짜 선택");
|
|
32
|
-
|
|
33
|
-
rerender(
|
|
34
|
-
<DatePicker
|
|
35
|
-
{...commonProps}
|
|
36
|
-
aria-label="체크인 날짜 선택"
|
|
37
|
-
ariaLabels={{ root: "예약 날짜 선택" }}
|
|
38
|
-
/>,
|
|
39
|
-
);
|
|
40
|
-
expect(getByRole("group")).toHaveAccessibleName("체크인 날짜 선택");
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it("날짜를 선택하고 onValueChange를 호출한다", () => {
|
|
44
|
-
const onValueChange = mock(() => {});
|
|
45
|
-
const { getByRole } = render(<DatePicker {...commonProps} onValueChange={onValueChange} />);
|
|
46
|
-
|
|
47
|
-
fireEvent.click(getByRole("button", { name: /2026년 7월 15일/ }));
|
|
48
|
-
|
|
49
|
-
expect(onValueChange).toHaveBeenCalledWith({ year: 2026, month: 7, day: 15 });
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it("renderDateCellContent는 SEED가 소유한 날짜 버튼 안의 콘텐츠만 교체한다", () => {
|
|
53
|
-
const { getByRole } = render(
|
|
54
|
-
<DatePicker
|
|
55
|
-
{...commonProps}
|
|
56
|
-
renderDateCellContent={({ formattedDay, date }) => (
|
|
57
|
-
<>
|
|
58
|
-
<span>{formattedDay}</span>
|
|
59
|
-
<span>{date.day === 15 ? "12만원" : "예약 가능"}</span>
|
|
60
|
-
</>
|
|
61
|
-
)}
|
|
62
|
-
/>,
|
|
63
|
-
);
|
|
64
|
-
const dateButton = getByRole("button", { name: /2026년 7월 15일/ });
|
|
65
|
-
|
|
66
|
-
expect(dateButton).toHaveTextContent("15");
|
|
67
|
-
expect(dateButton).toHaveTextContent("12만원");
|
|
68
|
-
expect(dateButton.closest('[role="gridcell"]')).not.toBeNull();
|
|
69
|
-
expect(dateButton.querySelector("[data-date-picker-day]")).toBeNull();
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it("renderDateCellSupplement는 기본 날짜 숫자 아래에 콘텐츠를 추가한다", () => {
|
|
73
|
-
const { getByRole } = render(
|
|
74
|
-
<DatePicker
|
|
75
|
-
{...commonProps}
|
|
76
|
-
renderDateCellSupplement={({ date }) => (
|
|
77
|
-
<span>{date.day === 15 ? "12만원" : "예약 가능"}</span>
|
|
78
|
-
)}
|
|
79
|
-
/>,
|
|
80
|
-
);
|
|
81
|
-
const dateButton = getByRole("button", { name: /2026년 7월 15일/ });
|
|
82
|
-
|
|
83
|
-
expect(dateButton).toHaveTextContent("15");
|
|
84
|
-
expect(dateButton).toHaveTextContent("12만원");
|
|
85
|
-
expect(dateButton.querySelector("[data-date-picker-day]")).toHaveTextContent("15");
|
|
16
|
+
// Popover는 layer 등록과 focus 이동·복귀를 다음 tick 이후에 처리합니다.
|
|
17
|
+
const settle = () =>
|
|
18
|
+
act(async () => {
|
|
19
|
+
const { promise, resolve } = Promise.withResolvers<void>();
|
|
20
|
+
setTimeout(resolve, 50);
|
|
21
|
+
await promise;
|
|
86
22
|
});
|
|
87
23
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
24
|
+
describe("DatePicker compound components", () => {
|
|
25
|
+
it("package compound가 달력 DOM과 wheel adapter contract를 소유한다", () => {
|
|
26
|
+
let wheelRenderProps: DatePicker.WheelRenderProps | undefined;
|
|
27
|
+
const { getByRole, queryByRole } = render(
|
|
28
|
+
<DatePicker.Root {...commonProps} visibleRange="month">
|
|
29
|
+
<DatePicker.Header leftIcon={leftIcon} rightIcon={rightIcon} headerIcon={headerIcon} />
|
|
30
|
+
<DatePicker.Calendar leftIcon={leftIcon} rightIcon={rightIcon} />
|
|
31
|
+
<DatePicker.Wheel>
|
|
32
|
+
{(props) => {
|
|
33
|
+
wheelRenderProps = props;
|
|
34
|
+
return <div data-wheel-adapter="" />;
|
|
35
|
+
}}
|
|
36
|
+
</DatePicker.Wheel>
|
|
37
|
+
</DatePicker.Root>,
|
|
96
38
|
);
|
|
97
|
-
const unavailable = getByRole("button", { name: /2026년 7월 9일/ });
|
|
98
|
-
|
|
99
|
-
expect(unavailable).toHaveAttribute("aria-disabled", "true");
|
|
100
|
-
expect(unavailable).not.toBeDisabled();
|
|
101
|
-
fireEvent.click(unavailable);
|
|
102
|
-
expect(onValueChange).not.toHaveBeenCalled();
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it("읽기 전용 Range 시작일의 상태와 접근성 이름을 노출하고 값 변경을 막는다", () => {
|
|
106
|
-
const onValueChange = mock(() => {});
|
|
107
|
-
const { getByRole } = render(
|
|
108
|
-
<DatePicker
|
|
109
|
-
{...commonProps}
|
|
110
|
-
selectionMode="range"
|
|
111
|
-
rangeStartReadOnly
|
|
112
|
-
defaultValue={{
|
|
113
|
-
start: { year: 2026, month: 7, day: 7 },
|
|
114
|
-
end: { year: 2026, month: 7, day: 9 },
|
|
115
|
-
}}
|
|
116
|
-
onValueChange={onValueChange}
|
|
117
|
-
/>,
|
|
118
|
-
);
|
|
119
|
-
const start = getByRole("button", { name: /2026년 7월 7일.*읽기 전용 시작일/ });
|
|
120
|
-
|
|
121
|
-
expect(start).toHaveAttribute("data-range-start-readonly");
|
|
122
|
-
expect(start.closest('[role="gridcell"]')).toHaveAttribute("data-range-start-readonly");
|
|
123
|
-
expect(start).toHaveAttribute("aria-disabled", "true");
|
|
124
|
-
expect(start).not.toBeDisabled();
|
|
125
39
|
|
|
126
|
-
|
|
127
|
-
expect(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
expect(onValueChange).toHaveBeenCalledWith({
|
|
131
|
-
start: { year: 2026, month: 7, day: 7 },
|
|
132
|
-
end: { year: 2026, month: 7, day: 12 },
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
it("날짜 셀 render prop에 읽기 전용 Range 시작일 상태를 전달한다", () => {
|
|
137
|
-
const { getByRole } = render(
|
|
138
|
-
<DatePicker
|
|
139
|
-
{...commonProps}
|
|
140
|
-
selectionMode="range"
|
|
141
|
-
rangeStartReadOnly
|
|
142
|
-
defaultValue={{ start: { year: 2026, month: 7, day: 7 } }}
|
|
143
|
-
renderDateCellSupplement={({ isRangeStartReadOnly }) => (
|
|
144
|
-
<span>{isRangeStartReadOnly ? "고정" : "변경 가능"}</span>
|
|
145
|
-
)}
|
|
146
|
-
/>,
|
|
147
|
-
);
|
|
148
|
-
|
|
149
|
-
expect(getByRole("button", { name: /2026년 7월 7일.*읽기 전용 시작일/ })).toHaveTextContent(
|
|
150
|
-
"고정",
|
|
151
|
-
);
|
|
152
|
-
expect(getByRole("button", { name: /2026년 7월 8일/ })).toHaveTextContent("변경 가능");
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
it("월·연도 제목을 누르면 Wheel Picker로 전환한다", () => {
|
|
156
|
-
const { getByRole, getAllByRole, queryByRole } = render(<DatePicker {...commonProps} />);
|
|
40
|
+
expect(getByRole("grid")).toHaveAccessibleName("2026년 7월");
|
|
41
|
+
expect(
|
|
42
|
+
getByRole("button", { name: "이전 달" }).querySelector('[data-icon="left"]'),
|
|
43
|
+
).not.toBeNull();
|
|
157
44
|
|
|
158
|
-
const grid = getByRole("grid");
|
|
159
|
-
expect(grid).toBeInTheDocument();
|
|
160
45
|
fireEvent.click(getByRole("button", { name: "2026년 7월" }));
|
|
161
46
|
|
|
162
47
|
expect(queryByRole("grid")).not.toBeInTheDocument();
|
|
163
|
-
expect(
|
|
164
|
-
expect(
|
|
165
|
-
expect(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
expect(wheelRoot).toBeInstanceOf(HTMLElement);
|
|
170
|
-
if (!(wheelRoot instanceof HTMLElement))
|
|
171
|
-
throw new Error("Wheel Picker 루트를 찾지 못했습니다.");
|
|
172
|
-
expect(wheelRoot.style.getPropertyValue("--seed-wheel-picker-item-size")).toBe("44px");
|
|
173
|
-
expect(wheelRoot.style.getPropertyValue("--seed-wheel-picker-visible-item-count")).toBe("7");
|
|
174
|
-
expect(wheelRoot.style.getPropertyValue("--seed-wheel-picker-viewport-size")).toBe("308px");
|
|
175
|
-
expect(wheelRoot.querySelector("[data-wheel-picker-scroll-fog]")).toHaveStyle({
|
|
176
|
-
"--scroll-fog-size-top": "102px",
|
|
177
|
-
"--scroll-fog-size-bottom": "102px",
|
|
48
|
+
expect(document.querySelector("[data-wheel-adapter]")).toBeInTheDocument();
|
|
49
|
+
expect(wheelRenderProps?.columns.map((column) => column.id)).toEqual(["year", "month"]);
|
|
50
|
+
expect(wheelRenderProps?.rootProps).toMatchObject({
|
|
51
|
+
itemSize: 44,
|
|
52
|
+
visibleItemCount: 7,
|
|
53
|
+
scrollFogSize: 102,
|
|
178
54
|
});
|
|
179
|
-
expect(
|
|
180
|
-
getByRole("button", { name: "2026년 7월" }).querySelector("[data-date-picker-header-label]"),
|
|
181
|
-
).toBeInTheDocument();
|
|
182
55
|
});
|
|
183
56
|
|
|
184
|
-
it("
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
const headerIcon = getByRole("button", { name: "2026년 7월" }).querySelector("svg");
|
|
188
|
-
const previousIcon = getByRole("button", { name: "이전 달" }).querySelector("svg");
|
|
189
|
-
const nextIcon = getByRole("button", { name: "다음 달" }).querySelector("svg");
|
|
190
|
-
|
|
191
|
-
for (const icon of [headerIcon, previousIcon, nextIcon]) {
|
|
192
|
-
expect(icon).toHaveClass("seed-icon");
|
|
193
|
-
expect(icon).toHaveAttribute("aria-hidden", "true");
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
it("레이아웃별 공개 컴포넌트가 고정된 달력 범위를 렌더링한다", () => {
|
|
198
|
-
const twoMonths = render(<TwoMonthDatePicker {...commonProps} />);
|
|
199
|
-
expect(twoMonths.getAllByRole("grid")).toHaveLength(2);
|
|
200
|
-
twoMonths.unmount();
|
|
201
|
-
|
|
202
|
-
const week = render(<WeekDatePicker {...commonProps} />);
|
|
203
|
-
expect(week.getByRole("grid").querySelectorAll('[role="row"]')).toHaveLength(2);
|
|
204
|
-
week.unmount();
|
|
205
|
-
|
|
206
|
-
const continuous = render(<ContinuousDatePicker {...commonProps} height="400px" />);
|
|
207
|
-
expect(continuous.getByRole("group")).toHaveAttribute("data-visible-range", "continuous");
|
|
208
|
-
const spacers = continuous.container.querySelectorAll<HTMLElement>(
|
|
209
|
-
"[data-date-picker-continuous-spacer]",
|
|
210
|
-
);
|
|
211
|
-
expect(spacers).toHaveLength(2);
|
|
212
|
-
for (const spacer of spacers) {
|
|
213
|
-
expect(spacer.style.getPropertyValue("--seed-date-picker-continuous-spacer-height")).toMatch(
|
|
214
|
-
/px$/,
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
it("ContinuousDatePicker는 monthRange에 포함된 월만 노출한다", () => {
|
|
220
|
-
const { getAllByRole, queryByRole } = render(
|
|
221
|
-
<ContinuousDatePicker
|
|
222
|
-
{...commonProps}
|
|
223
|
-
defaultViewDate={{ year: 2026, month: 12, day: 1 }}
|
|
224
|
-
monthRange={{
|
|
225
|
-
start: { year: 2026, month: 12 },
|
|
226
|
-
end: { year: 2027, month: 1 },
|
|
227
|
-
}}
|
|
228
|
-
height="400px"
|
|
229
|
-
/>,
|
|
230
|
-
);
|
|
231
|
-
|
|
232
|
-
expect(getAllByRole("grid")).toHaveLength(2);
|
|
233
|
-
expect(queryByRole("grid", { name: "2026년 11월" })).not.toBeInTheDocument();
|
|
234
|
-
expect(queryByRole("grid", { name: "2026년 12월" })).toBeInTheDocument();
|
|
235
|
-
expect(queryByRole("grid", { name: "2027년 1월" })).toBeInTheDocument();
|
|
236
|
-
expect(queryByRole("grid", { name: "2027년 2월" })).not.toBeInTheDocument();
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
it("navigateToDate는 외부 포커스를 유지하고 오늘을 다음 tab 진입점으로 지정한다", () => {
|
|
240
|
-
const actionsRef = React.createRef<DatePickerActions>();
|
|
241
|
-
const { getByRole } = render(
|
|
242
|
-
<>
|
|
243
|
-
<button type="button" onClick={() => actionsRef.current?.navigateToDate(commonProps.today)}>
|
|
244
|
-
오늘로 이동
|
|
245
|
-
</button>
|
|
246
|
-
<DatePicker {...commonProps} actionsRef={actionsRef} />
|
|
247
|
-
</>,
|
|
248
|
-
);
|
|
249
|
-
const todayButton = getByRole("button", { name: "오늘로 이동" });
|
|
250
|
-
|
|
251
|
-
expect(actionsRef.current).not.toBeNull();
|
|
252
|
-
todayButton.focus();
|
|
253
|
-
fireEvent.click(todayButton);
|
|
254
|
-
|
|
255
|
-
expect(document.activeElement).toBe(todayButton);
|
|
256
|
-
expect(getByRole("button", { name: /2026년 7월 30일/ }).getAttribute("tabindex")).toBe("0");
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
it("focusDate는 다른 달로 이동한 뒤 대상 날짜 셀에 DOM 포커스를 둔다", async () => {
|
|
260
|
-
const actionsRef = React.createRef<DatePickerActions>();
|
|
261
|
-
const onViewDateChange = mock(() => {});
|
|
57
|
+
it("week는 달력을 유지한 채 제목에 붙은 popover에 small wheel을 열고, 닫으면 고른 연도를 반영한다", async () => {
|
|
58
|
+
const user = userEvent.setup();
|
|
59
|
+
let wheelRenderProps: DatePicker.WheelRenderProps | undefined;
|
|
262
60
|
const { getByRole } = render(
|
|
263
|
-
<DatePicker {...commonProps}
|
|
61
|
+
<DatePicker.Root {...commonProps} visibleRange="week">
|
|
62
|
+
<DatePicker.Header leftIcon={leftIcon} rightIcon={rightIcon} headerIcon={headerIcon} />
|
|
63
|
+
<DatePicker.Wheel>
|
|
64
|
+
{(props) => {
|
|
65
|
+
wheelRenderProps = props;
|
|
66
|
+
return <button type="button" data-wheel-adapter="" />;
|
|
67
|
+
}}
|
|
68
|
+
</DatePicker.Wheel>
|
|
69
|
+
<DatePicker.Calendar leftIcon={leftIcon} rightIcon={rightIcon} />
|
|
70
|
+
</DatePicker.Root>,
|
|
264
71
|
);
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
72
|
+
const label = getByRole("button", { expanded: false });
|
|
73
|
+
await settle();
|
|
74
|
+
|
|
75
|
+
await user.click(label);
|
|
76
|
+
await settle();
|
|
77
|
+
|
|
78
|
+
expect(getByRole("grid")).toBeInTheDocument();
|
|
79
|
+
expect(wheelRenderProps?.rootProps.size).toBe("small");
|
|
80
|
+
const dialog = getByRole("dialog");
|
|
81
|
+
expect(dialog).toHaveAccessibleName(label.textContent ?? "");
|
|
82
|
+
expect(dialog).toContainElement(document.querySelector("[data-wheel-adapter]"));
|
|
83
|
+
expect(dialog).toHaveFocus();
|
|
84
|
+
|
|
85
|
+
act(() => wheelRenderProps?.columns[0]?.onValueChange("2027"));
|
|
86
|
+
await user.keyboard("{Escape}");
|
|
87
|
+
await settle();
|
|
88
|
+
|
|
89
|
+
expect(document.querySelector("[data-wheel-adapter]")).not.toBeInTheDocument();
|
|
90
|
+
expect(label).toHaveTextContent("2027년");
|
|
91
|
+
expect(label).toHaveFocus();
|
|
92
|
+
|
|
93
|
+
await user.click(label);
|
|
94
|
+
await settle();
|
|
95
|
+
expect(label).toHaveAttribute("aria-expanded", "true");
|
|
96
|
+
await user.click(document.body);
|
|
97
|
+
await settle();
|
|
98
|
+
expect(label).toHaveAttribute("aria-expanded", "false");
|
|
275
99
|
});
|
|
276
100
|
|
|
277
|
-
it("
|
|
278
|
-
const actionsRef = React.createRef<DatePickerActions>();
|
|
101
|
+
it("RTL에서는 semantic navigation에 맞춰 좌우 아이콘을 바꾼다", () => {
|
|
279
102
|
const { getByRole } = render(
|
|
280
|
-
|
|
281
|
-
<
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
<button type="button" onClick={() => actionsRef.current?.focusDate(commonProps.today)}>
|
|
285
|
-
오늘에 포커스
|
|
286
|
-
</button>
|
|
287
|
-
<DatePicker {...commonProps} actionsRef={actionsRef} />
|
|
288
|
-
</>,
|
|
103
|
+
<DatePicker.Root {...commonProps} locale="ar" visibleRange="month">
|
|
104
|
+
<DatePicker.Header leftIcon={leftIcon} rightIcon={rightIcon} headerIcon={headerIcon} />
|
|
105
|
+
<DatePicker.Calendar leftIcon={leftIcon} rightIcon={rightIcon} />
|
|
106
|
+
</DatePicker.Root>,
|
|
289
107
|
);
|
|
290
|
-
const navigateButton = getByRole("button", { name: "오늘로 이동" });
|
|
291
|
-
const focusButton = getByRole("button", { name: "오늘에 포커스" });
|
|
292
108
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
focusButton.focus();
|
|
298
|
-
fireEvent.click(focusButton);
|
|
299
|
-
|
|
300
|
-
await waitFor(() => {
|
|
301
|
-
expect(document.activeElement).toBe(getByRole("button", { name: /2026년 7월 30일/ }));
|
|
302
|
-
});
|
|
109
|
+
expect(
|
|
110
|
+
getByRole("button", { name: "Previous month" }).querySelector('[data-icon="right"]'),
|
|
111
|
+
).not.toBeNull();
|
|
303
112
|
});
|
|
304
113
|
});
|