@seed-design/react 2.6.1 → 3.0.1
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/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/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/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/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,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
4
3
|
import { datePicker } from "@seed-design/css/recipes/date-picker";
|
|
5
4
|
import { mergeProps } from "@seed-design/dom-utils";
|
|
6
5
|
import {
|
|
@@ -13,17 +12,20 @@ import {
|
|
|
13
12
|
type DatePickerVisibleRange,
|
|
14
13
|
type UseDatePickerProps,
|
|
15
14
|
} from "@seed-design/react-date-picker";
|
|
15
|
+
import { Popover as PopoverPrimitive, usePopoverContext } from "@seed-design/react-popover";
|
|
16
16
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
17
17
|
import clsx from "clsx";
|
|
18
18
|
import * as React from "react";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { Icon } from "../Icon";
|
|
19
|
+
import { ActionButton } from "../ActionButton/ActionButton";
|
|
20
|
+
import { Box, type BoxProps } from "../Box/Box";
|
|
21
|
+
import { Icon } from "../Icon/Icon";
|
|
23
22
|
|
|
24
|
-
// 44px × 7개 항목으로 308px viewport를 만들고, 336px 컨테이너 안에 중앙 정렬합니다.
|
|
25
|
-
|
|
26
|
-
const
|
|
23
|
+
// Month는 44px × 7개 항목으로 308px viewport를 만들고, 336px 컨테이너 안에 중앙 정렬합니다.
|
|
24
|
+
// Week는 Wheel Picker small 크기(36px × 5개 항목)를 popover 안에 그대로 사용합니다.
|
|
25
|
+
const MONTH_WHEEL_ITEM_SIZE = 44;
|
|
26
|
+
const MONTH_WHEEL_VISIBLE_ITEM_COUNT = 7;
|
|
27
|
+
const MONTH_WHEEL_SCROLL_FOG_SIZE = 102;
|
|
28
|
+
const WEEK_WHEEL_POPOVER_GUTTER = 4;
|
|
27
29
|
|
|
28
30
|
type DatePickerCssProperties = React.CSSProperties & {
|
|
29
31
|
"--seed-date-picker-continuous-spacer-height"?: string;
|
|
@@ -33,8 +35,17 @@ function getContinuousSpacerStyle(height: number): DatePickerCssProperties {
|
|
|
33
35
|
return { "--seed-date-picker-continuous-spacer-height": `${height}px` };
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
function composeRefs<T>(...refs: Array<React.Ref<T> | undefined>) {
|
|
39
|
+
return (value: T | null) => {
|
|
40
|
+
for (const ref of refs) {
|
|
41
|
+
if (typeof ref === "function") ref(value);
|
|
42
|
+
else if (ref) ref.current = value;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type DatePickerRootElementProps = PrimitiveProps &
|
|
48
|
+
Pick<BoxProps, "height" | "minHeight" | "maxHeight"> &
|
|
38
49
|
Omit<
|
|
39
50
|
React.HTMLAttributes<HTMLDivElement>,
|
|
40
51
|
"children" | "defaultValue" | "onChange" | "onValueChange"
|
|
@@ -66,75 +77,36 @@ type DatePickerCellCustomization =
|
|
|
66
77
|
renderDateCellSupplement?: never;
|
|
67
78
|
};
|
|
68
79
|
|
|
69
|
-
type
|
|
70
|
-
|
|
80
|
+
export type DatePickerRootProps = DatePickerBehaviorProps &
|
|
81
|
+
DatePickerRootElementProps &
|
|
82
|
+
DatePickerCellCustomization & {
|
|
83
|
+
/** Date Picker가 표시할 달력 레이아웃입니다. */
|
|
84
|
+
visibleRange: DatePickerVisibleRange;
|
|
85
|
+
|
|
86
|
+
/** Continuous 레이아웃에서 노출하고 이동할 수 있는 월 범위입니다. */
|
|
87
|
+
monthRange?: DatePickerMonthRange;
|
|
88
|
+
|
|
71
89
|
/** 날짜 이동과 포커스 action을 받는 ref입니다. */
|
|
72
90
|
actionsRef?: React.Ref<DatePickerActions>;
|
|
73
|
-
} & DatePickerCellCustomization;
|
|
74
|
-
|
|
75
|
-
type ContinuousSizeConstraint =
|
|
76
|
-
| (Required<Pick<StyleProps, "height">> & Pick<StyleProps, "minHeight" | "maxHeight">)
|
|
77
|
-
| (Required<Pick<StyleProps, "minHeight">> & Pick<StyleProps, "height" | "maxHeight">)
|
|
78
|
-
| (Required<Pick<StyleProps, "maxHeight">> & Pick<StyleProps, "height" | "minHeight">);
|
|
79
|
-
|
|
80
|
-
export type DatePickerProps = DatePickerSharedProps;
|
|
81
|
-
export type TwoMonthDatePickerProps = DatePickerSharedProps;
|
|
82
|
-
export type WeekDatePickerProps = DatePickerSharedProps;
|
|
83
|
-
type DatePickerPropsWithoutSize<Props = DatePickerSharedProps> = Props extends DatePickerSharedProps
|
|
84
|
-
? Omit<Props, "height" | "minHeight" | "maxHeight">
|
|
85
|
-
: never;
|
|
86
|
-
export type ContinuousDatePickerProps = DatePickerPropsWithoutSize &
|
|
87
|
-
ContinuousSizeConstraint & {
|
|
88
|
-
/**
|
|
89
|
-
* 노출하고 이동할 수 있는 월 범위입니다. 양끝 월을 포함합니다.
|
|
90
|
-
* 생략하면 `yearRange.start`의 1월부터 `yearRange.end`의 12월까지 노출합니다.
|
|
91
|
-
*/
|
|
92
|
-
monthRange?: DatePickerMonthRange;
|
|
93
|
-
};
|
|
94
91
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
monthRange?: DatePickerMonthRange;
|
|
98
|
-
};
|
|
92
|
+
children?: React.ReactNode;
|
|
93
|
+
};
|
|
99
94
|
|
|
100
|
-
type
|
|
101
|
-
|
|
95
|
+
type DatePickerContextValue = {
|
|
96
|
+
api: ReturnType<typeof useDatePicker>;
|
|
97
|
+
classNames: ReturnType<typeof datePicker>;
|
|
98
|
+
renderDateCellContent: DatePickerRootProps["renderDateCellContent"];
|
|
99
|
+
renderDateCellSupplement: DatePickerRootProps["renderDateCellSupplement"];
|
|
102
100
|
};
|
|
103
101
|
|
|
104
|
-
const
|
|
105
|
-
({ direction, ...props }, ref) => {
|
|
106
|
-
const path =
|
|
107
|
-
direction === "left"
|
|
108
|
-
? "M22.7931 13.0704C23.0788 13.3703 23.0672 13.8451 22.7673 14.1307L16.5875 20.0166L22.7672 25.9017C23.0672 26.1873 23.0788 26.6621 22.7931 26.962C22.5075 27.262 22.0327 27.2736 21.7328 26.9879L14.9828 20.5598C14.8341 20.4182 14.75 20.2219 14.75 20.0167C14.75 19.8114 14.8341 19.6151 14.9827 19.4736L21.7327 13.0446C22.0327 12.7589 22.5074 12.7704 22.7931 13.0704Z"
|
|
109
|
-
: "M17.2069 13.0704C16.9212 13.3703 16.9328 13.8451 17.2327 14.1307L23.4125 20.0166L17.2328 25.9017C16.9328 26.1873 16.9212 26.6621 17.2069 26.962C17.4925 27.262 17.9673 27.2736 18.2672 26.9879L25.0172 20.5598C25.1659 20.4182 25.25 20.2219 25.25 20.0167C25.25 19.8114 25.1659 19.6151 25.0173 19.4736L18.2673 13.0446C17.9673 12.7589 17.4926 12.7704 17.2069 13.0704Z";
|
|
110
|
-
|
|
111
|
-
return (
|
|
112
|
-
<svg ref={ref} {...props} viewBox="8 8 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
113
|
-
<path fillRule="evenodd" clipRule="evenodd" d={path} fill="currentColor" />
|
|
114
|
-
</svg>
|
|
115
|
-
);
|
|
116
|
-
},
|
|
117
|
-
);
|
|
118
|
-
NavigationChevronIcon.displayName = "NavigationChevronIcon";
|
|
102
|
+
const DatePickerContext = React.createContext<DatePickerContextValue | null>(null);
|
|
119
103
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
<svg ref={ref} {...props} viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
127
|
-
<path
|
|
128
|
-
fillRule="evenodd"
|
|
129
|
-
clipRule="evenodd"
|
|
130
|
-
d="M5.2453 7.74286C5.57141 7.4181 6.09905 7.41919 6.42381 7.7453L9.98736 11.3237L13.5808 7.77134C13.9081 7.44778 14.4357 7.45081 14.7593 7.77812C15.0829 8.10542 15.0798 8.63305 14.7525 8.95661L10.5686 13.0926C10.2422 13.4154 9.7162 13.4133 9.39228 13.088L5.24286 8.92137C4.9181 8.59526 4.91919 8.06762 5.2453 7.74286Z"
|
|
131
|
-
fill="currentColor"
|
|
132
|
-
transform={expanded ? "rotate(180 10 10)" : undefined}
|
|
133
|
-
/>
|
|
134
|
-
</svg>
|
|
135
|
-
),
|
|
136
|
-
);
|
|
137
|
-
HeaderChevronIcon.displayName = "HeaderChevronIcon";
|
|
104
|
+
function useDatePickerContext() {
|
|
105
|
+
const context = React.useContext(DatePickerContext);
|
|
106
|
+
if (!context)
|
|
107
|
+
throw new Error("DatePicker compound components must be used within DatePicker.Root");
|
|
108
|
+
return context;
|
|
109
|
+
}
|
|
138
110
|
|
|
139
111
|
function WeekdayRow({
|
|
140
112
|
api,
|
|
@@ -173,8 +145,8 @@ function DateCellView({
|
|
|
173
145
|
}: {
|
|
174
146
|
cell: DatePickerCell | null;
|
|
175
147
|
classNames: ReturnType<typeof datePicker>;
|
|
176
|
-
renderDateCellContent:
|
|
177
|
-
renderDateCellSupplement:
|
|
148
|
+
renderDateCellContent: DatePickerRootProps["renderDateCellContent"];
|
|
149
|
+
renderDateCellSupplement: DatePickerRootProps["renderDateCellSupplement"];
|
|
178
150
|
}) {
|
|
179
151
|
if (cell === null) {
|
|
180
152
|
return <Primitive.div role="gridcell" className={classNames.emptyCell} />;
|
|
@@ -214,8 +186,8 @@ function MonthView({
|
|
|
214
186
|
api: ReturnType<typeof useDatePicker>;
|
|
215
187
|
classNames: ReturnType<typeof datePicker>;
|
|
216
188
|
month: DatePickerMonth;
|
|
217
|
-
renderDateCellContent:
|
|
218
|
-
renderDateCellSupplement:
|
|
189
|
+
renderDateCellContent: DatePickerRootProps["renderDateCellContent"];
|
|
190
|
+
renderDateCellSupplement: DatePickerRootProps["renderDateCellSupplement"];
|
|
219
191
|
showWeekdays: boolean;
|
|
220
192
|
showMonthLabel: boolean;
|
|
221
193
|
renderHeader?: (labelId: string) => React.ReactNode;
|
|
@@ -267,56 +239,69 @@ function MonthView({
|
|
|
267
239
|
}
|
|
268
240
|
|
|
269
241
|
function NavigationButton({
|
|
270
|
-
|
|
242
|
+
icon,
|
|
271
243
|
className,
|
|
272
244
|
...props
|
|
273
245
|
}: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color"> & {
|
|
274
|
-
|
|
246
|
+
icon: React.ReactNode;
|
|
275
247
|
}) {
|
|
276
248
|
return (
|
|
277
249
|
<ActionButton {...props} variant="ghost" size="medium" layout="iconOnly" className={className}>
|
|
278
|
-
<Icon svg={
|
|
250
|
+
<Icon svg={icon} />
|
|
279
251
|
</ActionButton>
|
|
280
252
|
);
|
|
281
253
|
}
|
|
282
254
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
classNames: ReturnType<typeof datePicker>;
|
|
289
|
-
}) {
|
|
290
|
-
const previousDirection = api.isRtl ? "right" : "left";
|
|
291
|
-
const nextDirection = api.isRtl ? "left" : "right";
|
|
255
|
+
export interface DatePickerHeaderProps {
|
|
256
|
+
leftIcon: React.ReactNode;
|
|
257
|
+
rightIcon: React.ReactNode;
|
|
258
|
+
headerIcon: React.ReactNode;
|
|
259
|
+
}
|
|
292
260
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
<Primitive.div className={classNames.
|
|
306
|
-
<
|
|
307
|
-
{
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
{
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
261
|
+
export const DatePickerHeader = React.forwardRef<HTMLDivElement, DatePickerHeaderProps>(
|
|
262
|
+
({ leftIcon, rightIcon, headerIcon }, ref) => {
|
|
263
|
+
const { api, classNames } = useDatePickerContext();
|
|
264
|
+
// Week의 연·월 Wheel popover는 제목 버튼에 붙습니다.
|
|
265
|
+
const popover = usePopoverContext();
|
|
266
|
+
|
|
267
|
+
if (api.visibleRange === "continuous" || api.visibleRange === "twoMonths") return null;
|
|
268
|
+
|
|
269
|
+
const previousIcon = api.isRtl ? rightIcon : leftIcon;
|
|
270
|
+
const nextIcon = api.isRtl ? leftIcon : rightIcon;
|
|
271
|
+
|
|
272
|
+
return (
|
|
273
|
+
<Primitive.div ref={ref} className={classNames.header}>
|
|
274
|
+
<Primitive.button
|
|
275
|
+
ref={popover.refs.anchor}
|
|
276
|
+
{...api.monthYearButtonProps}
|
|
277
|
+
id={`${api.rootProps.id}-header-label`}
|
|
278
|
+
className={classNames.headerLabel}
|
|
279
|
+
>
|
|
280
|
+
<Primitive.span data-date-picker-header-label="">{api.headerLabel}</Primitive.span>
|
|
281
|
+
<Primitive.span
|
|
282
|
+
data-expanded={api.isWheelOpen ? "" : undefined}
|
|
283
|
+
className={classNames.headerChevron}
|
|
284
|
+
>
|
|
285
|
+
<Icon svg={headerIcon} />
|
|
286
|
+
</Primitive.span>
|
|
287
|
+
</Primitive.button>
|
|
288
|
+
<Primitive.div className={classNames.navigation}>
|
|
289
|
+
<NavigationButton
|
|
290
|
+
{...api.previousButtonProps}
|
|
291
|
+
icon={previousIcon}
|
|
292
|
+
className={classNames.navigationButton}
|
|
293
|
+
/>
|
|
294
|
+
<NavigationButton
|
|
295
|
+
{...api.nextButtonProps}
|
|
296
|
+
icon={nextIcon}
|
|
297
|
+
className={classNames.navigationButton}
|
|
298
|
+
/>
|
|
299
|
+
</Primitive.div>
|
|
316
300
|
</Primitive.div>
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
301
|
+
);
|
|
302
|
+
},
|
|
303
|
+
);
|
|
304
|
+
DatePickerHeader.displayName = "DatePickerHeader";
|
|
320
305
|
|
|
321
306
|
function TwoMonthHeader({
|
|
322
307
|
api,
|
|
@@ -324,12 +309,16 @@ function TwoMonthHeader({
|
|
|
324
309
|
label,
|
|
325
310
|
labelId,
|
|
326
311
|
position,
|
|
312
|
+
leftIcon,
|
|
313
|
+
rightIcon,
|
|
327
314
|
}: {
|
|
328
315
|
api: ReturnType<typeof useDatePicker>;
|
|
329
316
|
classNames: ReturnType<typeof datePicker>;
|
|
330
317
|
label: string;
|
|
331
318
|
labelId: string;
|
|
332
319
|
position: "first" | "last";
|
|
320
|
+
leftIcon: React.ReactNode;
|
|
321
|
+
rightIcon: React.ReactNode;
|
|
333
322
|
}) {
|
|
334
323
|
const isFirst = position === "first";
|
|
335
324
|
const direction = api.isRtl ? (isFirst ? "right" : "left") : isFirst ? "left" : "right";
|
|
@@ -342,7 +331,7 @@ function TwoMonthHeader({
|
|
|
342
331
|
</Primitive.div>
|
|
343
332
|
<NavigationButton
|
|
344
333
|
{...buttonProps}
|
|
345
|
-
|
|
334
|
+
icon={direction === "left" ? leftIcon : rightIcon}
|
|
346
335
|
data-placement={isFirst ? "start" : "end"}
|
|
347
336
|
className={classNames.twoMonthNavigationButton}
|
|
348
337
|
/>
|
|
@@ -350,52 +339,194 @@ function TwoMonthHeader({
|
|
|
350
339
|
);
|
|
351
340
|
}
|
|
352
341
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
<Primitive.div className={classNames.wheelContainer}>
|
|
362
|
-
<InternalWheelPickerRoot
|
|
363
|
-
{...api.wheelProps}
|
|
364
|
-
itemSize={WHEEL_ITEM_SIZE}
|
|
365
|
-
visibleItemCount={WHEEL_VISIBLE_ITEM_COUNT}
|
|
366
|
-
disabled={api.disabled}
|
|
367
|
-
readOnly={api.readOnly}
|
|
368
|
-
aria-label={api.headerLabel}
|
|
369
|
-
className={classNames.wheelView}
|
|
370
|
-
columnsClassName={classNames.wheelColumns}
|
|
371
|
-
scrollFogClassName={classNames.wheelScrollFog}
|
|
372
|
-
selectionIndicatorClassName={classNames.wheelSelectionIndicator}
|
|
373
|
-
fogSize={102}
|
|
374
|
-
>
|
|
375
|
-
<InternalWheelPickerColumn
|
|
376
|
-
aria-label={api.ariaLabels.yearWheel}
|
|
377
|
-
className={classNames.yearColumn}
|
|
378
|
-
itemClassName={classNames.wheelItem}
|
|
379
|
-
options={api.wheel.yearOptions}
|
|
380
|
-
value={api.wheel.yearValue}
|
|
381
|
-
onValueChange={api.wheel.onYearValueChange}
|
|
382
|
-
loop={false}
|
|
383
|
-
/>
|
|
384
|
-
<InternalWheelPickerColumn
|
|
385
|
-
aria-label={api.ariaLabels.monthWheel}
|
|
386
|
-
className={classNames.monthColumn}
|
|
387
|
-
itemClassName={classNames.wheelItem}
|
|
388
|
-
options={api.wheel.monthOptions}
|
|
389
|
-
value={api.wheel.monthValue}
|
|
390
|
-
onValueChange={api.wheel.onMonthValueChange}
|
|
391
|
-
loop
|
|
392
|
-
/>
|
|
393
|
-
</InternalWheelPickerRoot>
|
|
394
|
-
</Primitive.div>
|
|
395
|
-
);
|
|
342
|
+
export interface DatePickerWheelColumn {
|
|
343
|
+
id: "year" | "month";
|
|
344
|
+
"aria-label": string;
|
|
345
|
+
className: string;
|
|
346
|
+
options: readonly { value: string; label: React.ReactNode }[];
|
|
347
|
+
value: string;
|
|
348
|
+
onValueChange: (value: string) => void;
|
|
349
|
+
loop: boolean;
|
|
396
350
|
}
|
|
397
351
|
|
|
398
|
-
|
|
352
|
+
export interface DatePickerWheelRenderProps {
|
|
353
|
+
rootProps: React.HTMLAttributes<HTMLDivElement> & {
|
|
354
|
+
/** Month는 `medium`, Week popover는 `small` 크기를 사용합니다. */
|
|
355
|
+
size: "small" | "medium";
|
|
356
|
+
itemSize?: number;
|
|
357
|
+
visibleItemCount?: number;
|
|
358
|
+
disabled: boolean;
|
|
359
|
+
readOnly: boolean;
|
|
360
|
+
scrollFogSize?: number;
|
|
361
|
+
};
|
|
362
|
+
columns: readonly DatePickerWheelColumn[];
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export interface DatePickerWheelProps {
|
|
366
|
+
children: (props: DatePickerWheelRenderProps) => React.ReactNode;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export const DatePickerWheel = React.forwardRef<HTMLDivElement, DatePickerWheelProps>(
|
|
370
|
+
({ children }, ref) => {
|
|
371
|
+
const { api, classNames } = useDatePickerContext();
|
|
372
|
+
|
|
373
|
+
if (!api.isWheelOpen || api.visibleRange === "twoMonths" || api.visibleRange === "continuous") {
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
const columns: readonly DatePickerWheelColumn[] = [
|
|
378
|
+
{
|
|
379
|
+
id: "year",
|
|
380
|
+
"aria-label": api.ariaLabels.yearWheel,
|
|
381
|
+
className: classNames.yearColumn,
|
|
382
|
+
options: api.wheel.yearOptions,
|
|
383
|
+
value: api.wheel.yearValue,
|
|
384
|
+
onValueChange: api.wheel.onYearValueChange,
|
|
385
|
+
loop: false,
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
id: "month",
|
|
389
|
+
"aria-label": api.ariaLabels.monthWheel,
|
|
390
|
+
className: classNames.monthColumn,
|
|
391
|
+
options: api.wheel.monthOptions,
|
|
392
|
+
value: api.wheel.monthValue,
|
|
393
|
+
onValueChange: api.wheel.onMonthValueChange,
|
|
394
|
+
loop: true,
|
|
395
|
+
},
|
|
396
|
+
];
|
|
397
|
+
|
|
398
|
+
const sharedRootProps = {
|
|
399
|
+
...api.wheelProps,
|
|
400
|
+
disabled: api.disabled,
|
|
401
|
+
readOnly: api.readOnly,
|
|
402
|
+
"aria-label": api.headerLabel,
|
|
403
|
+
className: classNames.wheelView,
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
if (api.visibleRange === "week") {
|
|
407
|
+
// Popover가 Escape·바깥 누르기·상위 layer 닫힘과 focus 이동·복귀를 맡습니다.
|
|
408
|
+
return (
|
|
409
|
+
<PopoverPrimitive.Positioner className={classNames.wheelPositioner}>
|
|
410
|
+
<PopoverPrimitive.Content
|
|
411
|
+
ref={ref}
|
|
412
|
+
aria-labelledby={`${api.rootProps.id}-header-label`}
|
|
413
|
+
className={classNames.wheelPopover}
|
|
414
|
+
>
|
|
415
|
+
{children({ rootProps: { ...sharedRootProps, size: "small" }, columns })}
|
|
416
|
+
</PopoverPrimitive.Content>
|
|
417
|
+
</PopoverPrimitive.Positioner>
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
return (
|
|
422
|
+
<Primitive.div ref={ref} className={classNames.wheelContainer}>
|
|
423
|
+
{children({
|
|
424
|
+
rootProps: {
|
|
425
|
+
...sharedRootProps,
|
|
426
|
+
size: "medium",
|
|
427
|
+
itemSize: MONTH_WHEEL_ITEM_SIZE,
|
|
428
|
+
visibleItemCount: MONTH_WHEEL_VISIBLE_ITEM_COUNT,
|
|
429
|
+
scrollFogSize: MONTH_WHEEL_SCROLL_FOG_SIZE,
|
|
430
|
+
},
|
|
431
|
+
columns,
|
|
432
|
+
})}
|
|
433
|
+
</Primitive.div>
|
|
434
|
+
);
|
|
435
|
+
},
|
|
436
|
+
);
|
|
437
|
+
DatePickerWheel.displayName = "DatePickerWheel";
|
|
438
|
+
|
|
439
|
+
export interface DatePickerCalendarProps {
|
|
440
|
+
leftIcon: React.ReactNode;
|
|
441
|
+
rightIcon: React.ReactNode;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export const DatePickerCalendar = React.forwardRef<HTMLDivElement, DatePickerCalendarProps>(
|
|
445
|
+
({ leftIcon, rightIcon }, ref) => {
|
|
446
|
+
const { api, classNames, renderDateCellContent, renderDateCellSupplement } =
|
|
447
|
+
useDatePickerContext();
|
|
448
|
+
|
|
449
|
+
if (api.visibleRange === "continuous") {
|
|
450
|
+
return (
|
|
451
|
+
<Primitive.div
|
|
452
|
+
ref={composeRefs(ref, api.refs.continuousScroll)}
|
|
453
|
+
{...api.continuousScrollProps}
|
|
454
|
+
data-date-picker-continuous-scroll=""
|
|
455
|
+
className={classNames.continuousScroll}
|
|
456
|
+
>
|
|
457
|
+
<WeekdayRow api={api} classNames={classNames} semantic={false} />
|
|
458
|
+
<Primitive.div className={classNames.continuousContent}>
|
|
459
|
+
<Primitive.div
|
|
460
|
+
aria-hidden="true"
|
|
461
|
+
data-date-picker-continuous-spacer=""
|
|
462
|
+
className={classNames.continuousSpacer}
|
|
463
|
+
style={getContinuousSpacerStyle(api.virtual.topHeight)}
|
|
464
|
+
/>
|
|
465
|
+
{api.months.map((month) => (
|
|
466
|
+
<MonthView
|
|
467
|
+
key={month.key}
|
|
468
|
+
api={api}
|
|
469
|
+
classNames={classNames}
|
|
470
|
+
month={month}
|
|
471
|
+
renderDateCellContent={renderDateCellContent}
|
|
472
|
+
renderDateCellSupplement={renderDateCellSupplement}
|
|
473
|
+
showWeekdays={false}
|
|
474
|
+
showMonthLabel
|
|
475
|
+
monthRef={api.refs.continuousMonth(month.key)}
|
|
476
|
+
/>
|
|
477
|
+
))}
|
|
478
|
+
<Primitive.div
|
|
479
|
+
aria-hidden="true"
|
|
480
|
+
data-date-picker-continuous-spacer=""
|
|
481
|
+
className={classNames.continuousSpacer}
|
|
482
|
+
style={getContinuousSpacerStyle(api.virtual.bottomHeight)}
|
|
483
|
+
/>
|
|
484
|
+
</Primitive.div>
|
|
485
|
+
</Primitive.div>
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
return (
|
|
490
|
+
<Primitive.div
|
|
491
|
+
ref={ref}
|
|
492
|
+
data-wheel-open={api.isWheelOpen && api.visibleRange === "month" ? "" : undefined}
|
|
493
|
+
aria-hidden={api.isWheelOpen && api.visibleRange === "month" ? true : undefined}
|
|
494
|
+
className={classNames.months}
|
|
495
|
+
>
|
|
496
|
+
{api.months.map((month, index) => (
|
|
497
|
+
<MonthView
|
|
498
|
+
key={month.key}
|
|
499
|
+
api={api}
|
|
500
|
+
classNames={classNames}
|
|
501
|
+
month={month}
|
|
502
|
+
renderDateCellContent={renderDateCellContent}
|
|
503
|
+
renderDateCellSupplement={renderDateCellSupplement}
|
|
504
|
+
showWeekdays
|
|
505
|
+
showMonthLabel={false}
|
|
506
|
+
renderHeader={
|
|
507
|
+
api.visibleRange === "twoMonths"
|
|
508
|
+
? (labelId) => (
|
|
509
|
+
<TwoMonthHeader
|
|
510
|
+
api={api}
|
|
511
|
+
classNames={classNames}
|
|
512
|
+
label={month.label}
|
|
513
|
+
labelId={labelId}
|
|
514
|
+
position={index === 0 ? "first" : "last"}
|
|
515
|
+
leftIcon={leftIcon}
|
|
516
|
+
rightIcon={rightIcon}
|
|
517
|
+
/>
|
|
518
|
+
)
|
|
519
|
+
: undefined
|
|
520
|
+
}
|
|
521
|
+
/>
|
|
522
|
+
))}
|
|
523
|
+
</Primitive.div>
|
|
524
|
+
);
|
|
525
|
+
},
|
|
526
|
+
);
|
|
527
|
+
DatePickerCalendar.displayName = "DatePickerCalendar";
|
|
528
|
+
|
|
529
|
+
export const DatePickerRoot = React.forwardRef<HTMLDivElement, DatePickerRootProps>(
|
|
399
530
|
(props, forwardedRef) => {
|
|
400
531
|
const api = useDatePicker(props);
|
|
401
532
|
const [variantProps, otherProps] = datePicker.splitVariantProps(props);
|
|
@@ -404,6 +535,7 @@ const DatePickerImplementation = React.forwardRef<HTMLDivElement, DatePickerImpl
|
|
|
404
535
|
visibleRange: api.visibleRange,
|
|
405
536
|
});
|
|
406
537
|
const {
|
|
538
|
+
children,
|
|
407
539
|
renderDateCellContent,
|
|
408
540
|
renderDateCellSupplement,
|
|
409
541
|
actionsRef,
|
|
@@ -427,17 +559,20 @@ const DatePickerImplementation = React.forwardRef<HTMLDivElement, DatePickerImpl
|
|
|
427
559
|
className,
|
|
428
560
|
"aria-label": ariaLabel,
|
|
429
561
|
"aria-labelledby": ariaLabelledby,
|
|
430
|
-
|
|
562
|
+
height,
|
|
563
|
+
minHeight,
|
|
564
|
+
maxHeight,
|
|
565
|
+
...rootProps
|
|
431
566
|
} = otherProps;
|
|
432
|
-
const { style: styleProps, restProps: rootProps } = useStyleProps(styleAndRootProps);
|
|
433
|
-
const rootRef = React.useRef<HTMLDivElement | null>(null);
|
|
434
567
|
const hasContinuousSizeConstraint =
|
|
435
568
|
props.height !== undefined || props.minHeight !== undefined || props.maxHeight !== undefined;
|
|
436
569
|
|
|
437
570
|
React.useEffect(() => {
|
|
438
571
|
if (process.env.NODE_ENV === "production" || api.visibleRange !== "continuous") return;
|
|
439
572
|
if (!hasContinuousSizeConstraint) {
|
|
440
|
-
console.warn(
|
|
573
|
+
console.warn(
|
|
574
|
+
"DatePicker.Root: continuous에서는 height, minHeight 또는 maxHeight가 필요합니다.",
|
|
575
|
+
);
|
|
441
576
|
}
|
|
442
577
|
}, [api.visibleRange, hasContinuousSizeConstraint]);
|
|
443
578
|
|
|
@@ -446,130 +581,38 @@ const DatePickerImplementation = React.forwardRef<HTMLDivElement, DatePickerImpl
|
|
|
446
581
|
const rootAriaLabel = ariaLabelledby ? ariaLabel : (ariaLabel ?? api.ariaLabels.root);
|
|
447
582
|
|
|
448
583
|
return (
|
|
449
|
-
<
|
|
450
|
-
|
|
451
|
-
{...mergeProps(api.rootProps, rootProps)}
|
|
452
|
-
aria-label={rootAriaLabel}
|
|
453
|
-
aria-labelledby={ariaLabelledby}
|
|
454
|
-
className={clsx(classNames.root, className)}
|
|
455
|
-
style={styleProps}
|
|
584
|
+
<DatePickerContext.Provider
|
|
585
|
+
value={{ api, classNames, renderDateCellContent, renderDateCellSupplement }}
|
|
456
586
|
>
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
587
|
+
<PopoverPrimitive.Root
|
|
588
|
+
open={api.visibleRange === "week" && api.isWheelOpen}
|
|
589
|
+
// 바깥 누르기·Escape로 닫아도 제목 버튼으로 닫을 때처럼 고른 월을 반영합니다.
|
|
590
|
+
onOpenChange={(open) => {
|
|
591
|
+
if (!open) api.closeWheel();
|
|
592
|
+
}}
|
|
593
|
+
placement="bottom-start"
|
|
594
|
+
gutter={WEEK_WHEEL_POPOVER_GUTTER}
|
|
595
|
+
>
|
|
596
|
+
<Box
|
|
597
|
+
ref={composeRefs(forwardedRef, api.refs.root)}
|
|
598
|
+
{...mergeProps(api.rootProps, rootProps)}
|
|
599
|
+
aria-label={rootAriaLabel}
|
|
600
|
+
aria-labelledby={ariaLabelledby}
|
|
601
|
+
className={clsx(classNames.root, className)}
|
|
602
|
+
height={height}
|
|
603
|
+
minHeight={minHeight}
|
|
604
|
+
maxHeight={maxHeight}
|
|
463
605
|
>
|
|
464
|
-
|
|
465
|
-
<Primitive.
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
/>
|
|
472
|
-
{api.months.map((month) => (
|
|
473
|
-
<MonthView
|
|
474
|
-
key={month.key}
|
|
475
|
-
api={api}
|
|
476
|
-
classNames={classNames}
|
|
477
|
-
month={month}
|
|
478
|
-
renderDateCellContent={renderDateCellContent}
|
|
479
|
-
renderDateCellSupplement={renderDateCellSupplement}
|
|
480
|
-
showWeekdays={false}
|
|
481
|
-
showMonthLabel
|
|
482
|
-
monthRef={api.refs.continuousMonth(month.key)}
|
|
483
|
-
/>
|
|
484
|
-
))}
|
|
485
|
-
<Primitive.div
|
|
486
|
-
aria-hidden="true"
|
|
487
|
-
data-date-picker-continuous-spacer=""
|
|
488
|
-
className={classNames.continuousSpacer}
|
|
489
|
-
style={getContinuousSpacerStyle(api.virtual.bottomHeight)}
|
|
490
|
-
/>
|
|
491
|
-
</Primitive.div>
|
|
492
|
-
</Primitive.div>
|
|
493
|
-
) : (
|
|
494
|
-
<>
|
|
495
|
-
{api.visibleRange !== "twoMonths" && <Header api={api} classNames={classNames} />}
|
|
496
|
-
<Primitive.div
|
|
497
|
-
data-wheel-open={api.isWheelOpen && api.visibleRange !== "twoMonths" ? "" : undefined}
|
|
498
|
-
aria-hidden={api.isWheelOpen && api.visibleRange !== "twoMonths" ? true : undefined}
|
|
499
|
-
className={classNames.months}
|
|
500
|
-
>
|
|
501
|
-
{api.months.map((month, index) => (
|
|
502
|
-
<MonthView
|
|
503
|
-
key={month.key}
|
|
504
|
-
api={api}
|
|
505
|
-
classNames={classNames}
|
|
506
|
-
month={month}
|
|
507
|
-
renderDateCellContent={renderDateCellContent}
|
|
508
|
-
renderDateCellSupplement={renderDateCellSupplement}
|
|
509
|
-
showWeekdays
|
|
510
|
-
showMonthLabel={false}
|
|
511
|
-
renderHeader={
|
|
512
|
-
api.visibleRange === "twoMonths"
|
|
513
|
-
? (labelId) => (
|
|
514
|
-
<TwoMonthHeader
|
|
515
|
-
api={api}
|
|
516
|
-
classNames={classNames}
|
|
517
|
-
label={month.label}
|
|
518
|
-
labelId={labelId}
|
|
519
|
-
position={index === 0 ? "first" : "last"}
|
|
520
|
-
/>
|
|
521
|
-
)
|
|
522
|
-
: undefined
|
|
523
|
-
}
|
|
524
|
-
/>
|
|
525
|
-
))}
|
|
526
|
-
</Primitive.div>
|
|
527
|
-
{api.isWheelOpen && api.visibleRange !== "twoMonths" && (
|
|
528
|
-
<WheelView api={api} classNames={classNames} />
|
|
529
|
-
)}
|
|
530
|
-
</>
|
|
531
|
-
)}
|
|
532
|
-
<Primitive.span {...api.liveRegionProps} className={classNames.liveRegion}>
|
|
533
|
-
{api.headerLabel}
|
|
534
|
-
</Primitive.span>
|
|
535
|
-
</Primitive.div>
|
|
606
|
+
{children}
|
|
607
|
+
<Primitive.span {...api.liveRegionProps} className={classNames.liveRegion}>
|
|
608
|
+
{api.headerLabel}
|
|
609
|
+
</Primitive.span>
|
|
610
|
+
</Box>
|
|
611
|
+
</PopoverPrimitive.Root>
|
|
612
|
+
</DatePickerContext.Provider>
|
|
536
613
|
);
|
|
537
614
|
},
|
|
538
615
|
);
|
|
539
|
-
|
|
616
|
+
DatePickerRoot.displayName = "DatePickerRoot";
|
|
540
617
|
|
|
541
|
-
export
|
|
542
|
-
<DatePickerImplementation ref={ref} {...props} visibleRange="month" />
|
|
543
|
-
));
|
|
544
|
-
DatePicker.displayName = "DatePicker";
|
|
545
|
-
|
|
546
|
-
export const TwoMonthDatePicker = React.forwardRef<HTMLDivElement, TwoMonthDatePickerProps>(
|
|
547
|
-
(props, ref) => <DatePickerImplementation ref={ref} {...props} visibleRange="twoMonths" />,
|
|
548
|
-
);
|
|
549
|
-
TwoMonthDatePicker.displayName = "TwoMonthDatePicker";
|
|
550
|
-
|
|
551
|
-
export const WeekDatePicker = React.forwardRef<HTMLDivElement, WeekDatePickerProps>(
|
|
552
|
-
(props, ref) => <DatePickerImplementation ref={ref} {...props} visibleRange="week" />,
|
|
553
|
-
);
|
|
554
|
-
WeekDatePicker.displayName = "WeekDatePicker";
|
|
555
|
-
|
|
556
|
-
export const ContinuousDatePicker = React.forwardRef<HTMLDivElement, ContinuousDatePickerProps>(
|
|
557
|
-
(props, ref) => <DatePickerImplementation ref={ref} {...props} visibleRange="continuous" />,
|
|
558
|
-
);
|
|
559
|
-
ContinuousDatePicker.displayName = "ContinuousDatePicker";
|
|
560
|
-
|
|
561
|
-
export type {
|
|
562
|
-
DatePickerActions,
|
|
563
|
-
DatePickerAriaLabels,
|
|
564
|
-
DatePickerConstraint,
|
|
565
|
-
DatePickerConstraintContext,
|
|
566
|
-
DatePickerDate,
|
|
567
|
-
DatePickerMonthRange,
|
|
568
|
-
DatePickerMultipleProps,
|
|
569
|
-
DatePickerRangeProps,
|
|
570
|
-
DatePickerRangeValue,
|
|
571
|
-
DatePickerSelectionMode,
|
|
572
|
-
DatePickerSingleProps,
|
|
573
|
-
DatePickerValue,
|
|
574
|
-
DatePickerYearMonth,
|
|
575
|
-
} from "@seed-design/react-date-picker";
|
|
618
|
+
export type { DatePickerActions } from "@seed-design/react-date-picker";
|