@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
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { selectBox } from "@seed-design/css/recipes/select-box";
|
|
2
|
+
import { SCALE_FEEDBACK_CLASS_NAME } from "@seed-design/css/scale-feedback";
|
|
3
|
+
import { RadioGroup as RadioGroupPrimitive } from "@seed-design/react-radio-group";
|
|
4
|
+
import { render } from "@testing-library/react";
|
|
5
|
+
import { describe, expect, it } from "bun:test";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { CheckSelectBoxLabel, CheckSelectBoxRoot } from "./CheckSelectBox";
|
|
8
|
+
import { RadioSelectBoxItem, RadioSelectBoxLabel } from "./RadioSelectBox";
|
|
9
|
+
|
|
10
|
+
const classNames = selectBox({ layout: "horizontal" });
|
|
11
|
+
|
|
12
|
+
// The footer provider only wraps the children when the footer collapses, so every case below
|
|
13
|
+
// runs against both `footerVisibility` branches — the default one is where the provider used to
|
|
14
|
+
// hide the `Slottable` from `Slot`.
|
|
15
|
+
const footerVisibilities = ["when-selected", "always"] as const;
|
|
16
|
+
|
|
17
|
+
describe("CheckSelectBoxRoot", () => {
|
|
18
|
+
for (const footerVisibility of footerVisibilities) {
|
|
19
|
+
describe(`footerVisibility="${footerVisibility}"`, () => {
|
|
20
|
+
it("renders a label carrying the recipe and scale feedback classes", () => {
|
|
21
|
+
const ref = React.createRef<HTMLLabelElement>();
|
|
22
|
+
const { container } = render(
|
|
23
|
+
<CheckSelectBoxRoot footerVisibility={footerVisibility} ref={ref}>
|
|
24
|
+
<CheckSelectBoxLabel>label</CheckSelectBoxLabel>
|
|
25
|
+
</CheckSelectBoxRoot>,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const root = container.firstElementChild;
|
|
29
|
+
|
|
30
|
+
expect(root?.tagName).toBe("LABEL");
|
|
31
|
+
expect(root).toHaveClass(classNames.root);
|
|
32
|
+
expect(root).toHaveClass(SCALE_FEEDBACK_CLASS_NAME);
|
|
33
|
+
expect(ref.current).toBe(root as HTMLLabelElement);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("makes the content scale box the element's only child", () => {
|
|
37
|
+
const { container } = render(
|
|
38
|
+
<CheckSelectBoxRoot footerVisibility={footerVisibility}>
|
|
39
|
+
<CheckSelectBoxLabel>label</CheckSelectBoxLabel>
|
|
40
|
+
</CheckSelectBoxRoot>,
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const root = container.firstElementChild;
|
|
44
|
+
|
|
45
|
+
expect(root?.childNodes.length).toBe(1);
|
|
46
|
+
expect(root?.firstElementChild).toHaveClass("seed-content-scale");
|
|
47
|
+
expect(root?.firstElementChild?.textContent).toBe("label");
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it("renders the asChild element as the root and wraps its children in the box", () => {
|
|
51
|
+
const ref = React.createRef<HTMLLabelElement>();
|
|
52
|
+
const childRef = React.createRef<HTMLElement>();
|
|
53
|
+
const { container } = render(
|
|
54
|
+
<CheckSelectBoxRoot asChild footerVisibility={footerVisibility} ref={ref}>
|
|
55
|
+
<article className="consumer" ref={childRef}>
|
|
56
|
+
<CheckSelectBoxLabel>label</CheckSelectBoxLabel>
|
|
57
|
+
</article>
|
|
58
|
+
</CheckSelectBoxRoot>,
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const root = container.firstElementChild;
|
|
62
|
+
|
|
63
|
+
expect(container.childNodes.length).toBe(1);
|
|
64
|
+
expect(root?.tagName).toBe("ARTICLE");
|
|
65
|
+
expect(root).toHaveClass("consumer");
|
|
66
|
+
expect(root).toHaveClass(classNames.root);
|
|
67
|
+
expect(root).toHaveClass(SCALE_FEEDBACK_CLASS_NAME);
|
|
68
|
+
expect(ref.current).toBe(root as HTMLLabelElement);
|
|
69
|
+
expect(childRef.current).toBe(root as HTMLElement);
|
|
70
|
+
expect(root?.childNodes.length).toBe(1);
|
|
71
|
+
expect(root?.firstElementChild).toHaveClass("seed-content-scale");
|
|
72
|
+
expect(root?.firstElementChild?.textContent).toBe("label");
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe("RadioSelectBoxItem", () => {
|
|
79
|
+
const renderItem = (ui: React.ReactNode) =>
|
|
80
|
+
render(<RadioGroupPrimitive.Root defaultValue="a">{ui}</RadioGroupPrimitive.Root>);
|
|
81
|
+
|
|
82
|
+
for (const footerVisibility of footerVisibilities) {
|
|
83
|
+
describe(`footerVisibility="${footerVisibility}"`, () => {
|
|
84
|
+
it("renders a label carrying the recipe and scale feedback classes", () => {
|
|
85
|
+
const ref = React.createRef<HTMLLabelElement>();
|
|
86
|
+
const { container } = renderItem(
|
|
87
|
+
<RadioSelectBoxItem footerVisibility={footerVisibility} ref={ref} value="a">
|
|
88
|
+
<RadioSelectBoxLabel>label</RadioSelectBoxLabel>
|
|
89
|
+
</RadioSelectBoxItem>,
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const root = container.querySelector("label");
|
|
93
|
+
|
|
94
|
+
expect(root).toHaveClass(classNames.root);
|
|
95
|
+
expect(root).toHaveClass(SCALE_FEEDBACK_CLASS_NAME);
|
|
96
|
+
expect(ref.current).toBe(root as HTMLLabelElement);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("makes the content scale box the element's only child", () => {
|
|
100
|
+
const { container } = renderItem(
|
|
101
|
+
<RadioSelectBoxItem footerVisibility={footerVisibility} value="a">
|
|
102
|
+
<RadioSelectBoxLabel>label</RadioSelectBoxLabel>
|
|
103
|
+
</RadioSelectBoxItem>,
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const root = container.querySelector("label");
|
|
107
|
+
|
|
108
|
+
expect(root?.childNodes.length).toBe(1);
|
|
109
|
+
expect(root?.firstElementChild).toHaveClass("seed-content-scale");
|
|
110
|
+
expect(root?.firstElementChild?.textContent).toBe("label");
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it("renders the asChild element as the root and wraps its children in the box", () => {
|
|
114
|
+
const ref = React.createRef<HTMLLabelElement>();
|
|
115
|
+
const childRef = React.createRef<HTMLElement>();
|
|
116
|
+
const { container } = renderItem(
|
|
117
|
+
<RadioSelectBoxItem asChild footerVisibility={footerVisibility} ref={ref} value="a">
|
|
118
|
+
<article className="consumer" ref={childRef}>
|
|
119
|
+
<RadioSelectBoxLabel>label</RadioSelectBoxLabel>
|
|
120
|
+
</article>
|
|
121
|
+
</RadioSelectBoxItem>,
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const root = container.querySelector("article");
|
|
125
|
+
|
|
126
|
+
expect(container.querySelector("label")).toBeNull();
|
|
127
|
+
expect(root).toHaveClass("consumer");
|
|
128
|
+
expect(root).toHaveClass(classNames.root);
|
|
129
|
+
expect(root).toHaveClass(SCALE_FEEDBACK_CLASS_NAME);
|
|
130
|
+
expect(ref.current).toBe(root as HTMLLabelElement);
|
|
131
|
+
expect(childRef.current).toBe(root as HTMLElement);
|
|
132
|
+
expect(root?.childNodes.length).toBe(1);
|
|
133
|
+
expect(root?.firstElementChild).toHaveClass("seed-content-scale");
|
|
134
|
+
expect(root?.firstElementChild?.textContent).toBe("label");
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
});
|
|
@@ -138,22 +138,7 @@ SidePanelDescription.displayName = "SidePanelDescription";
|
|
|
138
138
|
export interface SidePanelBodyProps
|
|
139
139
|
extends PrimitiveProps,
|
|
140
140
|
Pick<StyleProps, "paddingX" | "justifyContent" | "alignItems">,
|
|
141
|
-
React.HTMLAttributes<HTMLDivElement> {
|
|
142
|
-
/**
|
|
143
|
-
* @deprecated SEED React 3.0.0에서 제거됩니다. Side Panel 본문은 항상 헤더와 푸터를 제외한 남은 높이를 채우므로 이 prop은 효과가 없습니다. 콘텐츠의 높이를 지정하려면 본문 안에 `Box`를 두고 `height`를 지정하세요.
|
|
144
|
-
*/
|
|
145
|
-
height?: StyleProps["height"];
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* @deprecated SEED React 3.0.0에서 제거됩니다. Side Panel 본문은 항상 헤더와 푸터를 제외한 남은 높이를 채우므로, 남은 높이보다 큰 값을 주면 푸터가 패널 밖으로 밀려납니다. 콘텐츠의 최소 높이를 지정하려면 본문 안에 `Box`를 두고 `minHeight`를 지정하세요.
|
|
149
|
-
*/
|
|
150
|
-
minHeight?: StyleProps["minHeight"];
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @deprecated SEED React 3.0.0에서 제거됩니다. Side Panel 본문은 항상 헤더와 푸터를 제외한 남은 높이를 채우므로, 남은 높이보다 작은 값을 주면 푸터가 패널 중간에 뜹니다. 콘텐츠의 최대 높이를 지정하려면 본문 안에 `Box`를 두고 `maxHeight`를 지정하세요.
|
|
154
|
-
*/
|
|
155
|
-
maxHeight?: StyleProps["maxHeight"];
|
|
156
|
-
}
|
|
141
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
157
142
|
|
|
158
143
|
export const SidePanelBody = React.forwardRef<HTMLDivElement, SidePanelBodyProps>(
|
|
159
144
|
(props, forwardedRef) => {
|
|
@@ -2,18 +2,6 @@ import * as React from "react";
|
|
|
2
2
|
import type { DistributiveOmit } from "../../utils/styled";
|
|
3
3
|
import { Flex, type FlexProps } from "../Flex";
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated Use `VStack` instead.
|
|
7
|
-
*/
|
|
8
|
-
export type StackProps = DistributiveOmit<FlexProps, "flexDirection">;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Use `VStack` instead.
|
|
12
|
-
*/
|
|
13
|
-
export const Stack = React.forwardRef<HTMLDivElement, StackProps>((props, ref) => {
|
|
14
|
-
return <Flex ref={ref} display="flex" flexDirection="column" {...props} />;
|
|
15
|
-
});
|
|
16
|
-
|
|
17
5
|
export type VStackProps = DistributiveOmit<FlexProps, "flexDirection">;
|
|
18
6
|
|
|
19
7
|
export const VStack = React.forwardRef<HTMLDivElement, VStackProps>((props, ref) => {
|
|
@@ -9,6 +9,7 @@ import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
|
9
9
|
import clsx from "clsx";
|
|
10
10
|
import * as React from "react";
|
|
11
11
|
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
12
|
+
import { withContentScale } from "../../utils/withContentScale";
|
|
12
13
|
import { withScaleFeedback } from "../../utils/withScaleFeedback";
|
|
13
14
|
|
|
14
15
|
const { withContext, useClassNames, ClassNamesProvider } = createSlotRecipeContext(menuSheet);
|
|
@@ -198,24 +199,25 @@ export interface SwipeableMenuSheetItemProps
|
|
|
198
199
|
MenuSheetItemVariantProps,
|
|
199
200
|
React.HTMLAttributes<HTMLButtonElement> {}
|
|
200
201
|
|
|
201
|
-
export const SwipeableMenuSheetItem =
|
|
202
|
-
HTMLButtonElement,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
202
|
+
export const SwipeableMenuSheetItem = withContentScale(
|
|
203
|
+
React.forwardRef<HTMLButtonElement, SwipeableMenuSheetItemProps>(
|
|
204
|
+
({ className: propClassName, ...props }, ref) => {
|
|
205
|
+
const [variantProps, otherProps] = menuSheetItem.splitVariantProps(props);
|
|
206
|
+
const parentProps = useItemProps();
|
|
207
|
+
const classNames = menuSheetItem({ ...parentProps, ...variantProps });
|
|
208
|
+
|
|
209
|
+
return (
|
|
210
|
+
<ItemClassNamesProvider value={classNames}>
|
|
211
|
+
<Primitive.button
|
|
212
|
+
ref={ref}
|
|
213
|
+
className={clsx(classNames.root, propClassName)}
|
|
214
|
+
{...otherProps}
|
|
215
|
+
/>
|
|
216
|
+
</ItemClassNamesProvider>
|
|
217
|
+
);
|
|
218
|
+
},
|
|
219
|
+
),
|
|
220
|
+
);
|
|
219
221
|
|
|
220
222
|
SwipeableMenuSheetItem.displayName = "SwipeableMenuSheetItem";
|
|
221
223
|
|
|
@@ -24,8 +24,10 @@ export interface SwitchRootProps
|
|
|
24
24
|
Omit<SwitchmarkVariantProps, "size">,
|
|
25
25
|
SwitchPrimitive.RootProps {}
|
|
26
26
|
|
|
27
|
-
export
|
|
28
|
-
|
|
27
|
+
export interface SwitchRootPrimitiveProps extends SwitchPrimitive.RootProps {}
|
|
28
|
+
|
|
29
|
+
export const SwitchRoot = Object.assign(
|
|
30
|
+
React.forwardRef<HTMLLabelElement, SwitchRootProps>(({ className, ...props }, ref) => {
|
|
29
31
|
const [{ switch: switchVariantProps, switchmark: switchmarkVariantProps }, otherProps] =
|
|
30
32
|
splitMultipleVariantsProps(props, { switchmark, switch: switchStyle });
|
|
31
33
|
|
|
@@ -42,7 +44,8 @@ export const SwitchRoot = React.forwardRef<HTMLLabelElement, SwitchRootProps>(
|
|
|
42
44
|
</ClassNamesProvider>
|
|
43
45
|
</ControlPropsProvider>
|
|
44
46
|
);
|
|
45
|
-
},
|
|
47
|
+
}),
|
|
48
|
+
{ Primitive: SwitchPrimitive.Root },
|
|
46
49
|
);
|
|
47
50
|
SwitchRoot.displayName = "SwitchRoot";
|
|
48
51
|
|
|
@@ -29,6 +29,8 @@ export const TagGroupRoot = forwardRef<HTMLSpanElement, TagGroupRootProps>(
|
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
31
|
<PropsProvider value={tagGroupItemVariantProps}>
|
|
32
|
+
{/* TODO: `asChild` cannot work here — inserting separators turns `children` into several
|
|
33
|
+
elements, which `Slot` refuses. Route them through `Slottable`, or drop `asChild`. */}
|
|
32
34
|
<Primitive.span ref={ref} className={clsx(classNames.root, className)} {...otherProps}>
|
|
33
35
|
{Children.toArray(children)
|
|
34
36
|
// putting something other than TagGroupItem in TagGroupRoot is not a good idea,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { fireEvent, render } from "@testing-library/react";
|
|
2
2
|
import { describe, expect, it, mock, spyOn } from "bun:test";
|
|
3
|
-
import type * as React from "react";
|
|
4
3
|
import { BottomSheet } from "../BottomSheet";
|
|
5
4
|
import { WheelPicker } from "./index";
|
|
6
5
|
|
|
@@ -32,39 +31,38 @@ describe("WheelPicker", () => {
|
|
|
32
31
|
);
|
|
33
32
|
|
|
34
33
|
expect(getByRole("group")).toHaveStyle({
|
|
35
|
-
"--seed-wheel-picker-
|
|
36
|
-
"--seed-wheel-picker-
|
|
37
|
-
"--seed-wheel-picker-
|
|
38
|
-
"--seed-wheel-picker-
|
|
39
|
-
"--seed-wheel-picker-
|
|
34
|
+
"--seed-wheel-picker-item-size": "44px",
|
|
35
|
+
"--seed-wheel-picker-visible-item-count": "5",
|
|
36
|
+
"--seed-wheel-picker-viewport-size": "220px",
|
|
37
|
+
"--seed-wheel-picker-center-offset": "88px",
|
|
38
|
+
"--seed-wheel-picker-scroll-fog-max-height": "132px",
|
|
40
39
|
});
|
|
41
40
|
expect(getByRole("group")).toHaveClass(
|
|
42
|
-
"seed-wheel-
|
|
43
|
-
"seed-wheel-
|
|
41
|
+
"seed-wheel-picker__root",
|
|
42
|
+
"seed-wheel-picker__root--size_medium",
|
|
44
43
|
);
|
|
45
|
-
expect(getByRole("group")).not.toHaveClass("seed-wheel-picker__root");
|
|
46
44
|
expect(container.querySelector("[data-wheel-picker-scroll-fog]")).toHaveClass(
|
|
47
|
-
"seed-wheel-
|
|
45
|
+
"seed-wheel-picker__scrollFog",
|
|
48
46
|
);
|
|
49
47
|
expect(container.querySelector("[data-wheel-picker-columns]")).toHaveClass(
|
|
50
|
-
"seed-wheel-
|
|
48
|
+
"seed-wheel-picker__columns",
|
|
51
49
|
);
|
|
52
|
-
expect(getByRole("spinbutton")).toHaveClass("seed-wheel-
|
|
50
|
+
expect(getByRole("spinbutton")).toHaveClass("seed-wheel-picker__column");
|
|
53
51
|
expect(container.querySelector('[data-wheel-picker-value="a"]')).toHaveClass(
|
|
54
|
-
"seed-wheel-
|
|
52
|
+
"seed-wheel-picker__item",
|
|
55
53
|
);
|
|
56
54
|
expect(container.querySelector("[data-wheel-picker-item-label]")).toHaveClass(
|
|
57
|
-
"seed-wheel-
|
|
55
|
+
"seed-wheel-picker__itemLabel",
|
|
58
56
|
);
|
|
59
57
|
expect(container.querySelector("[data-wheel-picker-indicator]")).toHaveClass(
|
|
60
|
-
"seed-wheel-
|
|
58
|
+
"seed-wheel-picker__selectionIndicator",
|
|
61
59
|
);
|
|
62
60
|
const scrollFog = container.querySelector<HTMLElement>("[data-wheel-picker-scroll-fog]");
|
|
63
61
|
expect(scrollFog?.style.getPropertyValue("--scroll-fog-size-top")).toBe(
|
|
64
|
-
"var(--seed-wheel-picker-
|
|
62
|
+
"var(--seed-wheel-picker-scroll-fog-size)",
|
|
65
63
|
);
|
|
66
64
|
expect(scrollFog?.style.getPropertyValue("--scroll-fog-size-bottom")).toBe(
|
|
67
|
-
"var(--seed-wheel-picker-
|
|
65
|
+
"var(--seed-wheel-picker-scroll-fog-size)",
|
|
68
66
|
);
|
|
69
67
|
});
|
|
70
68
|
|
|
@@ -76,15 +74,15 @@ describe("WheelPicker", () => {
|
|
|
76
74
|
);
|
|
77
75
|
|
|
78
76
|
expect(getByRole("group")).toHaveStyle({
|
|
79
|
-
"--seed-wheel-picker-
|
|
80
|
-
"--seed-wheel-picker-
|
|
81
|
-
"--seed-wheel-picker-
|
|
82
|
-
"--seed-wheel-picker-
|
|
83
|
-
"--seed-wheel-picker-
|
|
77
|
+
"--seed-wheel-picker-item-size": "36px",
|
|
78
|
+
"--seed-wheel-picker-visible-item-count": "5",
|
|
79
|
+
"--seed-wheel-picker-viewport-size": "180px",
|
|
80
|
+
"--seed-wheel-picker-center-offset": "72px",
|
|
81
|
+
"--seed-wheel-picker-scroll-fog-max-height": "108px",
|
|
84
82
|
});
|
|
85
|
-
expect(getByRole("group")).toHaveClass("seed-wheel-
|
|
83
|
+
expect(getByRole("group")).toHaveClass("seed-wheel-picker__root--size_small");
|
|
86
84
|
expect(container.querySelector("[data-wheel-picker-item-label]")).toHaveClass(
|
|
87
|
-
"seed-wheel-
|
|
85
|
+
"seed-wheel-picker__itemLabel--size_small",
|
|
88
86
|
);
|
|
89
87
|
});
|
|
90
88
|
|
|
@@ -101,14 +99,14 @@ describe("WheelPicker", () => {
|
|
|
101
99
|
);
|
|
102
100
|
|
|
103
101
|
expect(getByRole("group")).toHaveStyle({
|
|
104
|
-
"--seed-wheel-picker-
|
|
105
|
-
"--seed-wheel-picker-
|
|
106
|
-
"--seed-wheel-picker-
|
|
107
|
-
"--seed-wheel-picker-
|
|
108
|
-
"--seed-wheel-picker-
|
|
102
|
+
"--seed-wheel-picker-item-size": "56px",
|
|
103
|
+
"--seed-wheel-picker-visible-item-count": "7",
|
|
104
|
+
"--seed-wheel-picker-viewport-size": "392px",
|
|
105
|
+
"--seed-wheel-picker-center-offset": "168px",
|
|
106
|
+
"--seed-wheel-picker-scroll-fog-max-height": "168px",
|
|
109
107
|
});
|
|
110
108
|
expect(container.querySelector("[data-wheel-picker-item-label]")).toHaveClass(
|
|
111
|
-
"seed-wheel-
|
|
109
|
+
"seed-wheel-picker__itemLabel--size_small",
|
|
112
110
|
);
|
|
113
111
|
});
|
|
114
112
|
|
|
@@ -120,8 +118,8 @@ describe("WheelPicker", () => {
|
|
|
120
118
|
);
|
|
121
119
|
|
|
122
120
|
expect(getByRole("group")).toHaveStyle({
|
|
123
|
-
"--seed-wheel-picker-
|
|
124
|
-
"--seed-wheel-picker-
|
|
121
|
+
"--seed-wheel-picker-viewport-size": "396px",
|
|
122
|
+
"--seed-wheel-picker-scroll-fog-max-height": "132px",
|
|
125
123
|
});
|
|
126
124
|
});
|
|
127
125
|
|
|
@@ -148,7 +146,7 @@ describe("WheelPicker", () => {
|
|
|
148
146
|
);
|
|
149
147
|
|
|
150
148
|
expect(getByText("A")).toHaveAttribute("data-custom-label");
|
|
151
|
-
expect(getByText("A").parentElement).toHaveClass("seed-wheel-
|
|
149
|
+
expect(getByText("A").parentElement).toHaveClass("seed-wheel-picker__item");
|
|
152
150
|
expect(container.querySelector("[data-wheel-picker-item-label]")).not.toBeInTheDocument();
|
|
153
151
|
});
|
|
154
152
|
|
|
@@ -165,7 +163,7 @@ describe("WheelPicker", () => {
|
|
|
165
163
|
</WheelPicker.Root>,
|
|
166
164
|
);
|
|
167
165
|
|
|
168
|
-
expect(getByText("A")).toHaveClass("seed-wheel-
|
|
166
|
+
expect(getByText("A")).toHaveClass("seed-wheel-picker__itemLabel");
|
|
169
167
|
expect(getByText("A")).toHaveAttribute("data-wheel-picker-item-label");
|
|
170
168
|
expect(getByText("A")).toHaveAttribute("data-reused-label");
|
|
171
169
|
});
|
|
@@ -208,18 +206,29 @@ describe("WheelPicker", () => {
|
|
|
208
206
|
);
|
|
209
207
|
});
|
|
210
208
|
|
|
211
|
-
it("
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
209
|
+
it("readOnly는 포커스를 유지하면서 스크롤·클릭·키보드 값 변경을 막는다", () => {
|
|
210
|
+
const onValueChange = mock(() => {});
|
|
211
|
+
const { container, getByRole } = render(
|
|
212
|
+
<WheelPicker.Root aria-label="휠 피커" readOnly>
|
|
213
|
+
<WheelPicker.Column
|
|
214
|
+
aria-label="문자"
|
|
215
|
+
options={options}
|
|
216
|
+
defaultValue="a"
|
|
217
|
+
onValueChange={onValueChange}
|
|
218
|
+
/>
|
|
219
|
+
</WheelPicker.Root>,
|
|
219
220
|
);
|
|
221
|
+
const column = getByRole("spinbutton");
|
|
222
|
+
|
|
223
|
+
expect(getByRole("group")).toHaveAttribute("data-readonly");
|
|
224
|
+
expect(column).toHaveAttribute("aria-readonly", "true");
|
|
225
|
+
expect(column).toHaveAttribute("tabindex", "0");
|
|
226
|
+
|
|
227
|
+
fireEvent.keyDown(column, { key: "ArrowDown" });
|
|
228
|
+
fireEvent.click(container.querySelector('[data-wheel-picker-value="b"]')!);
|
|
220
229
|
|
|
221
|
-
expect(
|
|
222
|
-
expect(
|
|
230
|
+
expect(column).toHaveAttribute("aria-valuetext", "A");
|
|
231
|
+
expect(onValueChange).not.toHaveBeenCalled();
|
|
223
232
|
});
|
|
224
233
|
|
|
225
234
|
it("BottomSheet 안에서 컬럼을 스크롤할 때 시트 드래그를 시작하지 않는다", () => {
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
wheelPickerPublic,
|
|
5
|
-
type WheelPickerPublicVariantProps,
|
|
6
|
-
} from "@seed-design/css/recipes/wheel-picker-public";
|
|
3
|
+
import { wheelPicker, type WheelPickerVariantProps } from "@seed-design/css/recipes/wheel-picker";
|
|
7
4
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
8
5
|
import {
|
|
9
6
|
WheelPicker as WheelPickerPrimitive,
|
|
@@ -12,25 +9,25 @@ import {
|
|
|
12
9
|
import clsx from "clsx";
|
|
13
10
|
import * as React from "react";
|
|
14
11
|
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
15
|
-
import { ScrollFog } from "../ScrollFog/ScrollFog";
|
|
12
|
+
import { ScrollFog, type ScrollFogProps } from "../ScrollFog/ScrollFog";
|
|
16
13
|
|
|
17
14
|
const DEFAULT_ITEM_SIZE = {
|
|
18
15
|
small: 36,
|
|
19
16
|
medium: 44,
|
|
20
17
|
} as const;
|
|
21
18
|
const DEFAULT_VISIBLE_ITEM_COUNT = 5;
|
|
22
|
-
const { ClassNamesProvider, useClassNames } = createSlotRecipeContext(
|
|
19
|
+
const { ClassNamesProvider, useClassNames } = createSlotRecipeContext(wheelPicker);
|
|
23
20
|
|
|
24
21
|
type WheelPickerCssProperties = React.CSSProperties & {
|
|
25
|
-
"--seed-wheel-picker-
|
|
26
|
-
"--seed-wheel-picker-
|
|
27
|
-
"--seed-wheel-picker-
|
|
28
|
-
"--seed-wheel-picker-
|
|
29
|
-
"--seed-wheel-picker-
|
|
22
|
+
"--seed-wheel-picker-item-size"?: string;
|
|
23
|
+
"--seed-wheel-picker-visible-item-count"?: number;
|
|
24
|
+
"--seed-wheel-picker-viewport-size"?: string;
|
|
25
|
+
"--seed-wheel-picker-center-offset"?: string;
|
|
26
|
+
"--seed-wheel-picker-scroll-fog-max-height"?: string;
|
|
30
27
|
};
|
|
31
28
|
|
|
32
29
|
export interface WheelPickerRootProps
|
|
33
|
-
extends
|
|
30
|
+
extends WheelPickerVariantProps,
|
|
34
31
|
Omit<
|
|
35
32
|
WheelPickerPrimitive.RootProps,
|
|
36
33
|
"asChild" | "children" | "disabled" | "itemSize" | "readOnly" | "visibleItemCount"
|
|
@@ -41,6 +38,12 @@ export interface WheelPickerRootProps
|
|
|
41
38
|
/** 모든 컬럼의 포커스와 값 변경을 막습니다. */
|
|
42
39
|
disabled?: boolean;
|
|
43
40
|
|
|
41
|
+
/** 모든 컬럼의 포커스는 유지하면서 스크롤·클릭·키보드 값 변경을 막습니다. */
|
|
42
|
+
readOnly?: boolean;
|
|
43
|
+
|
|
44
|
+
/** Scroll Fog가 위아래에서 차지하는 크기입니다. */
|
|
45
|
+
scrollFogSize?: ScrollFogProps["size"];
|
|
46
|
+
|
|
44
47
|
/**
|
|
45
48
|
* 한 항목의 높이입니다. 지정하지 않으면 `size`의 기본 높이를 사용합니다.
|
|
46
49
|
*/
|
|
@@ -55,11 +58,12 @@ export interface WheelPickerRootProps
|
|
|
55
58
|
|
|
56
59
|
export const WheelPickerRoot = React.forwardRef<HTMLDivElement, WheelPickerRootProps>(
|
|
57
60
|
(props, ref) => {
|
|
58
|
-
const [variantProps, otherProps] =
|
|
61
|
+
const [variantProps, otherProps] = wheelPicker.splitVariantProps(props);
|
|
59
62
|
const {
|
|
60
63
|
children,
|
|
61
64
|
className,
|
|
62
65
|
itemSize: itemSizeProp,
|
|
66
|
+
scrollFogSize = "var(--seed-wheel-picker-scroll-fog-size)",
|
|
63
67
|
style,
|
|
64
68
|
visibleItemCount = DEFAULT_VISIBLE_ITEM_COUNT,
|
|
65
69
|
...rootProps
|
|
@@ -67,14 +71,14 @@ export const WheelPickerRoot = React.forwardRef<HTMLDivElement, WheelPickerRootP
|
|
|
67
71
|
const size = variantProps.size ?? "medium";
|
|
68
72
|
const itemSize = itemSizeProp ?? DEFAULT_ITEM_SIZE[size];
|
|
69
73
|
const centerOffset = ((visibleItemCount - 1) / 2) * itemSize;
|
|
70
|
-
const classNames =
|
|
74
|
+
const classNames = wheelPicker({ size });
|
|
71
75
|
const wheelPickerStyle: WheelPickerCssProperties = {
|
|
72
76
|
...style,
|
|
73
|
-
"--seed-wheel-picker-
|
|
74
|
-
"--seed-wheel-picker-
|
|
75
|
-
"--seed-wheel-picker-
|
|
76
|
-
"--seed-wheel-picker-
|
|
77
|
-
"--seed-wheel-picker-
|
|
77
|
+
"--seed-wheel-picker-item-size": `${itemSize}px`,
|
|
78
|
+
"--seed-wheel-picker-visible-item-count": visibleItemCount,
|
|
79
|
+
"--seed-wheel-picker-viewport-size": `${itemSize * visibleItemCount}px`,
|
|
80
|
+
"--seed-wheel-picker-center-offset": `${centerOffset}px`,
|
|
81
|
+
"--seed-wheel-picker-scroll-fog-max-height": `${itemSize * 3}px`,
|
|
78
82
|
};
|
|
79
83
|
|
|
80
84
|
return (
|
|
@@ -86,7 +90,6 @@ export const WheelPickerRoot = React.forwardRef<HTMLDivElement, WheelPickerRootP
|
|
|
86
90
|
style={wheelPickerStyle}
|
|
87
91
|
visibleItemCount={visibleItemCount}
|
|
88
92
|
{...rootProps}
|
|
89
|
-
readOnly={false}
|
|
90
93
|
>
|
|
91
94
|
<Primitive.div
|
|
92
95
|
aria-hidden
|
|
@@ -96,7 +99,7 @@ export const WheelPickerRoot = React.forwardRef<HTMLDivElement, WheelPickerRootP
|
|
|
96
99
|
<ScrollFog
|
|
97
100
|
className={classNames.scrollFog}
|
|
98
101
|
placement={["top", "bottom"]}
|
|
99
|
-
size=
|
|
102
|
+
size={scrollFogSize}
|
|
100
103
|
hideScrollBar
|
|
101
104
|
data-wheel-picker-scroll-fog=""
|
|
102
105
|
>
|
package/src/components/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export * from "./Accordion";
|
|
2
2
|
export * from "./ActionButton";
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./ActionSheet";
|
|
3
|
+
export * from "./AlertDialog";
|
|
5
4
|
export * from "./Article";
|
|
6
5
|
export * from "./AspectRatio";
|
|
7
6
|
export * from "./Avatar";
|
|
@@ -13,19 +12,13 @@ export * from "./Celsius";
|
|
|
13
12
|
export * from "./Checkbox";
|
|
14
13
|
export * from "./Chip";
|
|
15
14
|
export * from "./ChipTabs";
|
|
16
|
-
export * from "./Columns";
|
|
17
15
|
export * from "./ConsistentWidth";
|
|
18
|
-
export * from "./ContentDialog";
|
|
19
16
|
export * from "./ContentPlaceholder";
|
|
20
17
|
export * from "./ContextualFloatingButton";
|
|
21
|
-
export * from "./ControlChip";
|
|
22
18
|
export * from "./Count";
|
|
23
19
|
export * from "./DatePicker";
|
|
24
20
|
export * from "./Dialog";
|
|
25
21
|
export * from "./Divider";
|
|
26
|
-
export * from "./ExtendedActionSheet";
|
|
27
|
-
export * from "./ExtendedFab";
|
|
28
|
-
export * from "./Fab";
|
|
29
22
|
export * from "./Field";
|
|
30
23
|
export * from "./FieldButton";
|
|
31
24
|
export * from "./Fieldset";
|
|
@@ -42,10 +35,7 @@ export * from "./HelpBubbleTooltip";
|
|
|
42
35
|
export * from "./Icon";
|
|
43
36
|
export * from "./IdentityPlaceholder";
|
|
44
37
|
export * from "./ImageFrame";
|
|
45
|
-
export * from "./Inline";
|
|
46
|
-
export * from "./InlineBanner";
|
|
47
38
|
export * from "./Layout";
|
|
48
|
-
export * from "./LinkContent";
|
|
49
39
|
export * from "./List";
|
|
50
40
|
export * from "./LoadingIndicator";
|
|
51
41
|
export * from "./MannerTemp";
|
|
@@ -55,6 +45,7 @@ export * from "./MenuSheet";
|
|
|
55
45
|
export * from "./NavigationMenu";
|
|
56
46
|
export * from "./NotificationBadge";
|
|
57
47
|
export * from "./PageBanner";
|
|
48
|
+
export * from "./Popover";
|
|
58
49
|
export * from "./Portal";
|
|
59
50
|
export * from "./ProgressCircle";
|
|
60
51
|
export * from "./PullToRefresh";
|
|
@@ -81,7 +72,6 @@ export * from "./Tabs";
|
|
|
81
72
|
export * from "./TagGroup";
|
|
82
73
|
export * from "./Text";
|
|
83
74
|
export * from "./TextField";
|
|
84
|
-
export * from "./TimePicker";
|
|
85
75
|
export * from "./ToggleButton";
|
|
86
76
|
export * from "./VisuallyHidden";
|
|
87
77
|
export * from "./WheelPicker";
|