@seed-design/react 2.5.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Accordion/Accordion.cjs +2 -1
- package/lib/components/Accordion/Accordion.d.ts.map +1 -1
- package/lib/components/Accordion/Accordion.js +2 -1
- package/lib/components/ActionButton/ActionButton.cjs +1 -1
- package/lib/components/ActionButton/ActionButton.js +1 -1
- package/lib/components/AlertDialog/AlertDialog.cjs +34 -0
- package/lib/components/AlertDialog/AlertDialog.d.ts +51 -0
- package/lib/components/AlertDialog/AlertDialog.d.ts.map +1 -0
- package/lib/components/AlertDialog/AlertDialog.js +24 -0
- package/lib/components/AlertDialog/AlertDialog.namespace.cjs +22 -0
- package/lib/components/AlertDialog/AlertDialog.namespace.d.ts +2 -0
- package/lib/components/AlertDialog/AlertDialog.namespace.d.ts.map +1 -0
- package/lib/components/AlertDialog/AlertDialog.namespace.js +17 -0
- package/lib/components/AlertDialog/AlertDialog.test.d.ts +2 -0
- package/lib/components/AlertDialog/AlertDialog.test.d.ts.map +1 -0
- package/lib/components/AlertDialog/index.cjs +19 -0
- package/lib/components/AlertDialog/index.d.ts +3 -0
- package/lib/components/AlertDialog/index.d.ts.map +1 -0
- package/lib/components/AlertDialog/index.js +3 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplay.cjs +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplay.js +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplayItem.cjs +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplayItem.d.ts.map +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplayItem.js +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.cjs +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.js +1 -1
- package/lib/components/AttachmentDisplay/index.cjs +8 -0
- package/lib/components/AttachmentDisplay/index.d.ts +2 -0
- package/lib/components/AttachmentDisplay/index.d.ts.map +1 -1
- package/lib/components/AttachmentDisplay/index.js +2 -1
- package/lib/components/AttachmentInput/AttachmentInput.cjs +1 -1
- package/lib/components/AttachmentInput/AttachmentInput.js +1 -1
- package/lib/components/AttachmentInput/AttachmentInputDropzone.cjs +1 -1
- package/lib/components/AttachmentInput/AttachmentInputDropzone.js +1 -1
- package/lib/components/AttachmentInput/AttachmentInputItem.cjs +2 -2
- package/lib/components/AttachmentInput/AttachmentInputItem.d.ts.map +1 -1
- package/lib/components/AttachmentInput/AttachmentInputItem.js +2 -2
- package/lib/components/AttachmentInput/AttachmentInputTrigger.cjs +1 -1
- package/lib/components/AttachmentInput/AttachmentInputTrigger.js +1 -1
- package/lib/components/AttachmentInput/index.cjs +8 -0
- package/lib/components/AttachmentInput/index.d.ts +2 -0
- package/lib/components/AttachmentInput/index.d.ts.map +1 -1
- package/lib/components/AttachmentInput/index.js +2 -1
- package/lib/components/Badge/Badge.cjs +52 -10
- package/lib/components/Badge/Badge.d.ts +13 -4
- package/lib/components/Badge/Badge.d.ts.map +1 -1
- package/lib/components/Badge/Badge.js +49 -11
- package/lib/components/Badge/Badge.namespace.cjs +16 -0
- package/lib/components/Badge/Badge.namespace.d.ts +2 -0
- package/lib/components/Badge/Badge.namespace.d.ts.map +1 -0
- package/lib/components/Badge/Badge.namespace.js +11 -0
- package/lib/components/Badge/Badge.test.d.ts +2 -0
- package/lib/components/Badge/Badge.test.d.ts.map +1 -0
- package/lib/components/Badge/index.cjs +11 -1
- package/lib/components/Badge/index.d.ts +2 -1
- package/lib/components/Badge/index.d.ts.map +1 -1
- package/lib/components/Badge/index.js +3 -2
- package/lib/components/Box/Box.test.d.ts +2 -0
- package/lib/components/Box/Box.test.d.ts.map +1 -0
- package/lib/components/Checkbox/Checkbox.cjs +2 -2
- package/lib/components/Checkbox/Checkbox.d.ts +3 -1
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +2 -2
- package/lib/components/Checkbox/Checkbox.namespace.d.ts +1 -1
- package/lib/components/Checkbox/Checkbox.namespace.d.ts.map +1 -1
- package/lib/components/Checkbox/index.d.ts +1 -1
- package/lib/components/Checkbox/index.d.ts.map +1 -1
- package/lib/components/Chip/Chip.cjs +13 -5
- package/lib/components/Chip/Chip.d.ts +13 -2
- package/lib/components/Chip/Chip.d.ts.map +1 -1
- package/lib/components/Chip/Chip.js +10 -5
- package/lib/components/Chip/Chip.namespace.cjs +5 -2
- package/lib/components/Chip/Chip.namespace.d.ts +1 -1
- package/lib/components/Chip/Chip.namespace.d.ts.map +1 -1
- package/lib/components/Chip/Chip.namespace.js +6 -3
- package/lib/components/Chip/index.cjs +4 -1
- package/lib/components/Chip/index.d.ts +1 -1
- package/lib/components/Chip/index.d.ts.map +1 -1
- package/lib/components/Chip/index.js +2 -2
- package/lib/components/ChipTabs/ChipTabs.cjs +1 -1
- package/lib/components/ChipTabs/ChipTabs.js +1 -1
- package/lib/components/DatePicker/DatePicker.cjs +192 -190
- package/lib/components/DatePicker/DatePicker.d.ts +50 -21
- package/lib/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/lib/components/DatePicker/DatePicker.js +189 -187
- package/lib/components/DatePicker/DatePicker.namespace.cjs +16 -0
- package/lib/components/DatePicker/DatePicker.namespace.d.ts +2 -0
- package/lib/components/DatePicker/DatePicker.namespace.d.ts.map +1 -0
- package/lib/components/DatePicker/DatePicker.namespace.js +11 -0
- package/lib/components/DatePicker/index.cjs +11 -4
- package/lib/components/DatePicker/index.d.ts +3 -2
- package/lib/components/DatePicker/index.d.ts.map +1 -1
- package/lib/components/DatePicker/index.js +3 -2
- package/lib/components/Dialog/Dialog.cjs +84 -9
- package/lib/components/Dialog/Dialog.d.ts +21 -14
- package/lib/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.js +80 -9
- package/lib/components/Dialog/Dialog.namespace.cjs +2 -0
- package/lib/components/Dialog/Dialog.namespace.d.ts +1 -1
- package/lib/components/Dialog/Dialog.namespace.d.ts.map +1 -1
- package/lib/components/Dialog/Dialog.namespace.js +3 -1
- package/lib/components/Dialog/index.cjs +2 -0
- package/lib/components/Dialog/index.d.ts +1 -1
- package/lib/components/Dialog/index.d.ts.map +1 -1
- package/lib/components/Dialog/index.js +2 -2
- package/lib/components/HelpBubble/HelpBubble.cjs +18 -5
- package/lib/components/HelpBubble/HelpBubble.d.ts +5 -0
- package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
- package/lib/components/HelpBubble/HelpBubble.js +18 -5
- package/lib/components/HelpBubble/HelpBubble.test.d.ts +2 -0
- package/lib/components/HelpBubble/HelpBubble.test.d.ts.map +1 -0
- package/lib/components/ImageFrame/ImageFrame.cjs +5 -4
- package/lib/components/ImageFrame/ImageFrame.d.ts +2 -2
- package/lib/components/ImageFrame/ImageFrame.d.ts.map +1 -1
- package/lib/components/ImageFrame/ImageFrame.js +6 -5
- package/lib/components/List/List.cjs +14 -3
- package/lib/components/List/List.d.ts +15 -0
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.js +11 -4
- package/lib/components/List/List.namespace.cjs +4 -0
- package/lib/components/List/List.namespace.d.ts +1 -1
- package/lib/components/List/List.namespace.d.ts.map +1 -1
- package/lib/components/List/List.namespace.js +5 -1
- package/lib/components/List/index.cjs +4 -0
- package/lib/components/List/index.d.ts +1 -1
- package/lib/components/List/index.d.ts.map +1 -1
- package/lib/components/List/index.js +2 -2
- package/lib/components/Menu/Menu.cjs +3 -2
- package/lib/components/Menu/Menu.d.ts.map +1 -1
- package/lib/components/Menu/Menu.js +3 -2
- package/lib/components/MenuSheet/MenuSheet.cjs +4 -3
- package/lib/components/MenuSheet/MenuSheet.d.ts.map +1 -1
- package/lib/components/MenuSheet/MenuSheet.js +4 -3
- package/lib/components/NavigationMenu/NavigationMenu.cjs +4 -3
- package/lib/components/NavigationMenu/NavigationMenu.d.ts.map +1 -1
- package/lib/components/NavigationMenu/NavigationMenu.js +4 -3
- package/lib/components/PageBanner/PageBanner.cjs +3 -2
- package/lib/components/PageBanner/PageBanner.d.ts.map +1 -1
- package/lib/components/PageBanner/PageBanner.js +3 -2
- package/lib/components/{ContentDialog/ContentDialog.cjs → Popover/Popover.cjs} +61 -40
- package/lib/components/Popover/Popover.d.ts +69 -0
- package/lib/components/Popover/Popover.d.ts.map +1 -0
- package/lib/components/{ContentDialog/ContentDialog.js → Popover/Popover.js} +49 -29
- package/lib/components/Popover/Popover.namespace.cjs +26 -0
- package/lib/components/Popover/Popover.namespace.d.ts +2 -0
- package/lib/components/Popover/Popover.namespace.d.ts.map +1 -0
- package/lib/components/Popover/Popover.namespace.js +21 -0
- package/lib/components/Popover/Popover.test.d.ts +2 -0
- package/lib/components/Popover/Popover.test.d.ts.map +1 -0
- package/lib/components/Popover/index.cjs +23 -0
- package/lib/components/Popover/index.d.ts +3 -0
- package/lib/components/Popover/index.d.ts.map +1 -0
- package/lib/components/Popover/index.js +3 -0
- package/lib/components/QuantityPicker/QuantityPicker.d.ts.map +1 -1
- package/lib/components/RadioGroup/RadioGroup.cjs +2 -2
- package/lib/components/RadioGroup/RadioGroup.d.ts +2 -0
- package/lib/components/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/lib/components/RadioGroup/RadioGroup.js +2 -2
- package/lib/components/RadioGroup/RadioGroup.namespace.d.ts +1 -1
- package/lib/components/RadioGroup/RadioGroup.namespace.d.ts.map +1 -1
- package/lib/components/RadioGroup/index.d.ts +1 -1
- package/lib/components/RadioGroup/index.d.ts.map +1 -1
- package/lib/components/RadioGroupField/RadioGroupField.cjs +2 -2
- package/lib/components/RadioGroupField/RadioGroupField.d.ts +5 -1
- package/lib/components/RadioGroupField/RadioGroupField.d.ts.map +1 -1
- package/lib/components/RadioGroupField/RadioGroupField.js +2 -2
- package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts +1 -1
- package/lib/components/RadioGroupField/RadioGroupField.namespace.d.ts.map +1 -1
- package/lib/components/ReactionButton/ReactionButton.cjs +1 -1
- package/lib/components/ReactionButton/ReactionButton.js +1 -1
- package/lib/components/ResponsiveDialog/ResponsiveDialog.cjs +13 -13
- package/lib/components/ResponsiveDialog/ResponsiveDialog.d.ts +15 -15
- package/lib/components/ResponsiveDialog/ResponsiveDialog.d.ts.map +1 -1
- package/lib/components/ResponsiveDialog/ResponsiveDialog.js +13 -13
- package/lib/components/SegmentedControl/SegmentedControl.cjs +2 -1
- package/lib/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/lib/components/SegmentedControl/SegmentedControl.js +2 -1
- package/lib/components/Select/Select.cjs +5 -4
- package/lib/components/Select/Select.d.ts.map +1 -1
- package/lib/components/Select/Select.js +5 -4
- package/lib/components/SelectBox/CheckSelectBox.cjs +20 -6
- package/lib/components/SelectBox/CheckSelectBox.d.ts +7 -0
- package/lib/components/SelectBox/CheckSelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/CheckSelectBox.js +21 -7
- package/lib/components/SelectBox/RadioSelectBox.cjs +20 -6
- package/lib/components/SelectBox/RadioSelectBox.d.ts +7 -0
- package/lib/components/SelectBox/RadioSelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/RadioSelectBox.js +21 -7
- package/lib/components/SelectBox/SelectBox.test.d.ts +2 -0
- package/lib/components/SelectBox/SelectBox.test.d.ts.map +1 -0
- package/lib/components/SideNavigation/SideNavigation.cjs +2 -2
- package/lib/components/SideNavigation/SideNavigation.js +2 -2
- package/lib/components/SideNavigation/index.cjs +8 -0
- package/lib/components/SideNavigation/index.d.ts +1 -0
- package/lib/components/SideNavigation/index.d.ts.map +1 -1
- package/lib/components/SideNavigation/index.js +2 -1
- package/lib/components/SidePanel/SidePanel.d.ts +0 -12
- package/lib/components/SidePanel/SidePanel.d.ts.map +1 -1
- package/lib/components/Slider/Slider.cjs +1 -1
- package/lib/components/Slider/Slider.js +1 -1
- package/lib/components/Snackbar/Snackbar.cjs +2 -2
- package/lib/components/Snackbar/Snackbar.js +2 -2
- package/lib/components/Snackbar/useSnackbarAdapter.cjs +1 -1
- package/lib/components/Snackbar/useSnackbarAdapter.js +1 -1
- package/lib/components/Stack/Stack.cjs +0 -12
- package/lib/components/Stack/Stack.d.ts +0 -8
- package/lib/components/Stack/Stack.d.ts.map +1 -1
- package/lib/components/Stack/Stack.js +1 -12
- package/lib/components/Stack/index.cjs +0 -1
- package/lib/components/Stack/index.d.ts +1 -1
- package/lib/components/Stack/index.d.ts.map +1 -1
- package/lib/components/Stack/index.js +2 -2
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.cjs +3 -2
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts.map +1 -1
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.js +3 -2
- package/lib/components/Switch/Switch.cjs +3 -3
- package/lib/components/Switch/Switch.d.ts +5 -1
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.js +3 -3
- package/lib/components/Switch/Switch.namespace.d.ts +1 -1
- package/lib/components/Switch/Switch.namespace.d.ts.map +1 -1
- package/lib/components/Switch/index.d.ts +1 -1
- package/lib/components/Switch/index.d.ts.map +1 -1
- package/lib/components/TagGroup/TagGroup.d.ts.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.cjs +1 -1
- package/lib/components/ToggleButton/ToggleButton.js +1 -1
- package/lib/components/WheelPicker/WheelPicker.cjs +11 -12
- package/lib/components/WheelPicker/WheelPicker.d.ts +7 -2
- package/lib/components/WheelPicker/WheelPicker.d.ts.map +1 -1
- package/lib/components/WheelPicker/WheelPicker.js +11 -12
- package/lib/components/index.cjs +90 -94
- package/lib/components/index.d.ts +2 -12
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +17 -24
- package/lib/index.cjs +116 -94
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +20 -25
- package/lib/utils/styled.cjs +3 -2
- package/lib/utils/styled.d.ts +18 -11
- package/lib/utils/styled.d.ts.map +1 -1
- package/lib/utils/styled.js +3 -2
- package/lib/utils/withContentScale.cjs +30 -0
- package/lib/utils/withContentScale.d.ts +12 -0
- package/lib/utils/withContentScale.d.ts.map +1 -0
- package/lib/utils/withContentScale.js +27 -0
- package/lib/utils/withContentScale.test.d.ts +2 -0
- package/lib/utils/withContentScale.test.d.ts.map +1 -0
- package/package.json +9 -14
- package/src/components/Accordion/Accordion.tsx +3 -3
- package/src/components/AlertDialog/AlertDialog.namespace.ts +22 -0
- package/src/components/AlertDialog/AlertDialog.test.tsx +61 -0
- package/src/components/AlertDialog/AlertDialog.tsx +115 -0
- package/src/components/AlertDialog/index.ts +24 -0
- package/src/components/AttachmentDisplay/AttachmentDisplayItem.tsx +2 -0
- package/src/components/AttachmentDisplay/index.ts +10 -0
- package/src/components/AttachmentInput/AttachmentInputItem.tsx +2 -0
- package/src/components/AttachmentInput/index.ts +10 -0
- package/src/components/Badge/Badge.namespace.ts +10 -0
- package/src/components/Badge/Badge.test.tsx +56 -0
- package/src/components/Badge/Badge.tsx +82 -11
- package/src/components/Badge/index.ts +12 -1
- package/src/components/Box/Box.test.tsx +88 -0
- package/src/components/Checkbox/Checkbox.namespace.ts +1 -0
- package/src/components/Checkbox/Checkbox.tsx +3 -1
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Chip/Chip.namespace.ts +8 -2
- package/src/components/Chip/Chip.tsx +34 -7
- package/src/components/Chip/index.ts +8 -2
- package/src/components/DatePicker/DatePicker.namespace.ts +14 -0
- package/src/components/DatePicker/DatePicker.test.tsx +85 -276
- package/src/components/DatePicker/DatePicker.tsx +327 -284
- package/src/components/DatePicker/index.ts +25 -21
- package/src/components/Dialog/Dialog.namespace.ts +4 -0
- package/src/components/Dialog/Dialog.tsx +128 -10
- package/src/components/Dialog/index.ts +4 -5
- package/src/components/HelpBubble/HelpBubble.test.tsx +111 -0
- package/src/components/HelpBubble/HelpBubble.tsx +19 -3
- package/src/components/ImageFrame/ImageFrame.tsx +12 -4
- package/src/components/List/List.namespace.ts +8 -0
- package/src/components/List/List.tsx +43 -3
- package/src/components/List/index.ts +8 -0
- package/src/components/Menu/Menu.tsx +4 -3
- package/src/components/MenuSheet/MenuSheet.tsx +20 -17
- package/src/components/NavigationMenu/NavigationMenu.tsx +20 -17
- package/src/components/PageBanner/PageBanner.tsx +6 -3
- package/src/components/Popover/Popover.namespace.ts +30 -0
- package/src/components/Popover/Popover.test.tsx +222 -0
- package/src/components/Popover/Popover.tsx +282 -0
- package/src/components/Popover/index.ts +32 -0
- package/src/components/QuantityPicker/QuantityPicker.tsx +2 -0
- package/src/components/RadioGroup/RadioGroup.namespace.ts +1 -0
- package/src/components/RadioGroup/RadioGroup.tsx +2 -0
- package/src/components/RadioGroup/index.ts +1 -0
- package/src/components/RadioGroupField/RadioGroupField.namespace.ts +1 -0
- package/src/components/RadioGroupField/RadioGroupField.tsx +5 -3
- package/src/components/ResponsiveDialog/ResponsiveDialog.tsx +45 -48
- package/src/components/SegmentedControl/SegmentedControl.tsx +3 -3
- package/src/components/Select/Select.tsx +7 -6
- package/src/components/SelectBox/CheckSelectBox.tsx +28 -10
- package/src/components/SelectBox/RadioSelectBox.tsx +28 -10
- package/src/components/SelectBox/SelectBox.test.tsx +138 -0
- package/src/components/SideNavigation/index.ts +5 -0
- package/src/components/SidePanel/SidePanel.tsx +1 -16
- package/src/components/Stack/Stack.tsx +0 -12
- package/src/components/Stack/index.ts +1 -8
- package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx +20 -18
- package/src/components/Switch/Switch.namespace.ts +1 -0
- package/src/components/Switch/Switch.tsx +6 -3
- package/src/components/Switch/index.ts +1 -0
- package/src/components/TagGroup/TagGroup.tsx +2 -0
- package/src/components/WheelPicker/WheelPicker.test.tsx +53 -44
- package/src/components/WheelPicker/WheelPicker.tsx +24 -21
- package/src/components/index.ts +2 -12
- package/src/index.ts +25 -2
- package/src/utils/styled.tsx +72 -15
- package/src/utils/withContentScale.test.tsx +88 -0
- package/src/utils/withContentScale.tsx +48 -0
- package/lib/components/ActionChip/ActionChip.cjs +0 -15
- package/lib/components/ActionChip/ActionChip.d.ts +0 -23
- package/lib/components/ActionChip/ActionChip.d.ts.map +0 -1
- package/lib/components/ActionChip/ActionChip.js +0 -14
- package/lib/components/ActionChip/index.cjs +0 -3
- package/lib/components/ActionChip/index.d.ts +0 -2
- package/lib/components/ActionChip/index.d.ts.map +0 -1
- package/lib/components/ActionChip/index.js +0 -2
- package/lib/components/ActionSheet/ActionSheet.cjs +0 -72
- package/lib/components/ActionSheet/ActionSheet.d.ts +0 -113
- package/lib/components/ActionSheet/ActionSheet.d.ts.map +0 -1
- package/lib/components/ActionSheet/ActionSheet.js +0 -61
- package/lib/components/ActionSheet/ActionSheet.namespace.cjs +0 -23
- package/lib/components/ActionSheet/ActionSheet.namespace.d.ts +0 -2
- package/lib/components/ActionSheet/ActionSheet.namespace.d.ts.map +0 -1
- package/lib/components/ActionSheet/ActionSheet.namespace.js +0 -18
- package/lib/components/ActionSheet/index.cjs +0 -20
- package/lib/components/ActionSheet/index.d.ts +0 -3
- package/lib/components/ActionSheet/index.d.ts.map +0 -1
- package/lib/components/ActionSheet/index.js +0 -3
- package/lib/components/Columns/Columns.cjs +0 -38
- package/lib/components/Columns/Columns.d.ts +0 -22
- package/lib/components/Columns/Columns.d.ts.map +0 -1
- package/lib/components/Columns/Columns.js +0 -35
- package/lib/components/Columns/index.cjs +0 -4
- package/lib/components/Columns/index.d.ts +0 -2
- package/lib/components/Columns/index.d.ts.map +0 -1
- package/lib/components/Columns/index.js +0 -2
- package/lib/components/ContentDialog/ContentDialog.d.ts +0 -50
- package/lib/components/ContentDialog/ContentDialog.d.ts.map +0 -1
- package/lib/components/ContentDialog/ContentDialog.namespace.cjs +0 -24
- package/lib/components/ContentDialog/ContentDialog.namespace.d.ts +0 -2
- package/lib/components/ContentDialog/ContentDialog.namespace.d.ts.map +0 -1
- package/lib/components/ContentDialog/ContentDialog.namespace.js +0 -19
- package/lib/components/ContentDialog/index.cjs +0 -21
- package/lib/components/ContentDialog/index.d.ts +0 -3
- package/lib/components/ContentDialog/index.d.ts.map +0 -1
- package/lib/components/ContentDialog/index.js +0 -3
- package/lib/components/ControlChip/ControlChip.cjs +0 -15
- package/lib/components/ControlChip/ControlChip.d.ts +0 -28
- package/lib/components/ControlChip/ControlChip.d.ts.map +0 -1
- package/lib/components/ControlChip/ControlChip.js +0 -14
- package/lib/components/ControlChip/index.cjs +0 -3
- package/lib/components/ControlChip/index.d.ts +0 -2
- package/lib/components/ControlChip/index.d.ts.map +0 -1
- package/lib/components/ControlChip/index.js +0 -2
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +0 -77
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts +0 -122
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts.map +0 -1
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +0 -65
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.cjs +0 -24
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.d.ts +0 -2
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.d.ts.map +0 -1
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.namespace.js +0 -19
- package/lib/components/ExtendedActionSheet/index.cjs +0 -21
- package/lib/components/ExtendedActionSheet/index.d.ts +0 -3
- package/lib/components/ExtendedActionSheet/index.d.ts.map +0 -1
- package/lib/components/ExtendedActionSheet/index.js +0 -3
- package/lib/components/ExtendedFab/ExtendedFab.cjs +0 -16
- package/lib/components/ExtendedFab/ExtendedFab.d.ts +0 -13
- package/lib/components/ExtendedFab/ExtendedFab.d.ts.map +0 -1
- package/lib/components/ExtendedFab/ExtendedFab.js +0 -15
- package/lib/components/ExtendedFab/index.cjs +0 -3
- package/lib/components/ExtendedFab/index.d.ts +0 -2
- package/lib/components/ExtendedFab/index.d.ts.map +0 -1
- package/lib/components/ExtendedFab/index.js +0 -2
- package/lib/components/Fab/Fab.cjs +0 -13
- package/lib/components/Fab/Fab.d.ts +0 -13
- package/lib/components/Fab/Fab.d.ts.map +0 -1
- package/lib/components/Fab/Fab.js +0 -12
- package/lib/components/Fab/index.cjs +0 -3
- package/lib/components/Fab/index.d.ts +0 -2
- package/lib/components/Fab/index.d.ts.map +0 -1
- package/lib/components/Fab/index.js +0 -2
- package/lib/components/Inline/Inline.cjs +0 -23
- package/lib/components/Inline/Inline.d.ts +0 -12
- package/lib/components/Inline/Inline.d.ts.map +0 -1
- package/lib/components/Inline/Inline.js +0 -21
- package/lib/components/Inline/index.cjs +0 -3
- package/lib/components/Inline/index.d.ts +0 -2
- package/lib/components/Inline/index.d.ts.map +0 -1
- package/lib/components/Inline/index.js +0 -2
- package/lib/components/InlineBanner/InlineBanner.cjs +0 -39
- package/lib/components/InlineBanner/InlineBanner.d.ts +0 -59
- package/lib/components/InlineBanner/InlineBanner.d.ts.map +0 -1
- package/lib/components/InlineBanner/InlineBanner.js +0 -33
- package/lib/components/InlineBanner/InlineBanner.namespace.cjs +0 -18
- package/lib/components/InlineBanner/InlineBanner.namespace.d.ts +0 -2
- package/lib/components/InlineBanner/InlineBanner.namespace.d.ts.map +0 -1
- package/lib/components/InlineBanner/InlineBanner.namespace.js +0 -13
- package/lib/components/InlineBanner/index.cjs +0 -15
- package/lib/components/InlineBanner/index.d.ts +0 -3
- package/lib/components/InlineBanner/index.d.ts.map +0 -1
- package/lib/components/InlineBanner/index.js +0 -3
- package/lib/components/LinkContent/LinkContent.cjs +0 -14
- package/lib/components/LinkContent/LinkContent.d.ts +0 -14
- package/lib/components/LinkContent/LinkContent.d.ts.map +0 -1
- package/lib/components/LinkContent/LinkContent.js +0 -13
- package/lib/components/LinkContent/index.cjs +0 -3
- package/lib/components/LinkContent/index.d.ts +0 -2
- package/lib/components/LinkContent/index.d.ts.map +0 -1
- package/lib/components/LinkContent/index.js +0 -2
- package/lib/components/TimePicker/TimePicker.cjs +0 -97
- package/lib/components/TimePicker/TimePicker.d.ts +0 -28
- package/lib/components/TimePicker/TimePicker.d.ts.map +0 -1
- package/lib/components/TimePicker/TimePicker.js +0 -94
- package/lib/components/TimePicker/TimePicker.test.d.ts +0 -2
- package/lib/components/TimePicker/TimePicker.test.d.ts.map +0 -1
- package/lib/components/TimePicker/index.cjs +0 -3
- package/lib/components/TimePicker/index.d.ts +0 -2
- package/lib/components/TimePicker/index.d.ts.map +0 -1
- package/lib/components/TimePicker/index.js +0 -2
- package/lib/components/private/WheelPicker.cjs +0 -63
- package/lib/components/private/WheelPicker.d.ts +0 -16
- package/lib/components/private/WheelPicker.d.ts.map +0 -1
- package/lib/components/private/WheelPicker.js +0 -59
- package/lib/components/private/WheelPicker.test.d.ts +0 -2
- package/lib/components/private/WheelPicker.test.d.ts.map +0 -1
- package/lib/primitive.cjs +0 -154
- package/lib/primitive.d.ts +0 -18
- package/lib/primitive.d.ts.map +0 -1
- package/lib/primitive.js +0 -17
- package/src/components/ActionChip/ActionChip.tsx +0 -34
- package/src/components/ActionChip/index.ts +0 -4
- package/src/components/ActionSheet/ActionSheet.namespace.ts +0 -24
- package/src/components/ActionSheet/ActionSheet.tsx +0 -192
- package/src/components/ActionSheet/index.ts +0 -26
- package/src/components/Columns/Columns.tsx +0 -50
- package/src/components/Columns/index.ts +0 -1
- package/src/components/ContentDialog/ContentDialog.namespace.ts +0 -26
- package/src/components/ContentDialog/ContentDialog.tsx +0 -224
- package/src/components/ContentDialog/index.ts +0 -33
- package/src/components/ControlChip/ControlChip.tsx +0 -38
- package/src/components/ControlChip/index.ts +0 -5
- package/src/components/ExtendedActionSheet/ExtendedActionSheet.namespace.ts +0 -26
- package/src/components/ExtendedActionSheet/ExtendedActionSheet.tsx +0 -220
- package/src/components/ExtendedActionSheet/index.ts +0 -28
- package/src/components/ExtendedFab/ExtendedFab.tsx +0 -25
- package/src/components/ExtendedFab/index.ts +0 -4
- package/src/components/Fab/Fab.tsx +0 -21
- package/src/components/Fab/index.ts +0 -4
- package/src/components/Inline/Inline.tsx +0 -25
- package/src/components/Inline/index.ts +0 -1
- package/src/components/InlineBanner/InlineBanner.namespace.ts +0 -14
- package/src/components/InlineBanner/InlineBanner.tsx +0 -103
- package/src/components/InlineBanner/index.ts +0 -16
- package/src/components/LinkContent/LinkContent.tsx +0 -23
- package/src/components/LinkContent/index.ts +0 -4
- package/src/components/TimePicker/TimePicker.test.tsx +0 -166
- package/src/components/TimePicker/TimePicker.tsx +0 -163
- package/src/components/TimePicker/index.ts +0 -6
- package/src/components/private/WheelPicker.test.tsx +0 -55
- package/src/components/private/WheelPicker.tsx +0 -110
- package/src/primitive.ts +0 -17
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
export {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
2
|
+
DatePickerRoot,
|
|
3
|
+
DatePickerHeader,
|
|
4
|
+
DatePickerCalendar,
|
|
5
|
+
DatePickerWheel,
|
|
6
|
+
type DatePickerRootProps,
|
|
7
|
+
type DatePickerHeaderProps,
|
|
8
|
+
type DatePickerCalendarProps,
|
|
9
|
+
type DatePickerWheelProps,
|
|
10
|
+
type DatePickerWheelRenderProps,
|
|
11
|
+
type DatePickerWheelColumn,
|
|
9
12
|
type DatePickerCellContentRenderProps,
|
|
10
|
-
type
|
|
11
|
-
type DatePickerConstraintContext,
|
|
12
|
-
type DatePickerDate,
|
|
13
|
-
type DatePickerMonthRange,
|
|
14
|
-
type DatePickerMultipleProps,
|
|
15
|
-
type DatePickerProps,
|
|
16
|
-
type DatePickerRangeProps,
|
|
17
|
-
type DatePickerRangeValue,
|
|
18
|
-
type DatePickerSelectionMode,
|
|
19
|
-
type DatePickerSingleProps,
|
|
20
|
-
type DatePickerValue,
|
|
21
|
-
type DatePickerYearMonth,
|
|
22
|
-
type TwoMonthDatePickerProps,
|
|
23
|
-
type WeekDatePickerProps,
|
|
13
|
+
type DatePickerActions,
|
|
24
14
|
} from "./DatePicker";
|
|
25
15
|
|
|
16
|
+
export * as DatePicker from "./DatePicker.namespace";
|
|
17
|
+
|
|
26
18
|
export {
|
|
27
19
|
compareDates,
|
|
28
20
|
dateKey,
|
|
@@ -33,4 +25,16 @@ export {
|
|
|
33
25
|
maxSelectionCount,
|
|
34
26
|
rangeDayCountAtLeast,
|
|
35
27
|
rangeDayCountAtMost,
|
|
28
|
+
type DatePickerAriaLabels,
|
|
29
|
+
type DatePickerConstraint,
|
|
30
|
+
type DatePickerConstraintContext,
|
|
31
|
+
type DatePickerDate,
|
|
32
|
+
type DatePickerMonthRange,
|
|
33
|
+
type DatePickerMultipleProps,
|
|
34
|
+
type DatePickerRangeProps,
|
|
35
|
+
type DatePickerRangeValue,
|
|
36
|
+
type DatePickerSelectionMode,
|
|
37
|
+
type DatePickerSingleProps,
|
|
38
|
+
type DatePickerValue,
|
|
39
|
+
type DatePickerYearMonth,
|
|
36
40
|
} from "@seed-design/react-date-picker";
|
|
@@ -2,6 +2,7 @@ export {
|
|
|
2
2
|
DialogBackdrop as Backdrop,
|
|
3
3
|
DialogPositioner as Positioner,
|
|
4
4
|
DialogContent as Content,
|
|
5
|
+
DialogBody as Body,
|
|
5
6
|
DialogDescription as Description,
|
|
6
7
|
DialogFooter as Footer,
|
|
7
8
|
DialogHeader as Header,
|
|
@@ -9,9 +10,11 @@ export {
|
|
|
9
10
|
DialogTitle as Title,
|
|
10
11
|
DialogTrigger as Trigger,
|
|
11
12
|
DialogAction as Action,
|
|
13
|
+
DialogCloseButton as CloseButton,
|
|
12
14
|
type DialogBackdropProps as BackdropProps,
|
|
13
15
|
type DialogPositionerProps as PositionerProps,
|
|
14
16
|
type DialogContentProps as ContentProps,
|
|
17
|
+
type DialogBodyProps as BodyProps,
|
|
15
18
|
type DialogDescriptionProps as DescriptionProps,
|
|
16
19
|
type DialogFooterProps as FooterProps,
|
|
17
20
|
type DialogHeaderProps as HeaderProps,
|
|
@@ -19,4 +22,5 @@ export {
|
|
|
19
22
|
type DialogTitleProps as TitleProps,
|
|
20
23
|
type DialogTriggerProps as TriggerProps,
|
|
21
24
|
type DialogActionProps as ActionProps,
|
|
25
|
+
type DialogCloseButtonProps as CloseButtonProps,
|
|
22
26
|
} from "./Dialog";
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
import { composeRefs, useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
2
|
+
import { dialog, type DialogVariantProps } from "@seed-design/css/recipes/dialog";
|
|
3
|
+
import { dataAttr } from "@seed-design/dom-utils";
|
|
1
4
|
import { Dialog as DialogPrimitive } from "@seed-design/react-dialog";
|
|
2
5
|
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
3
|
-
import
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { createRenderTrackingContext } from "../../utils/createRenderTrackingContext";
|
|
4
9
|
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
10
|
+
import { useScaleFeedback } from "@seed-design/react-scale-feedback";
|
|
11
|
+
import { useStyleProps, withStyleProps, type StyleProps } from "../../utils/styled";
|
|
12
|
+
|
|
13
|
+
const { withContext, useClassNames, ClassNamesProvider } = createSlotRecipeContext(dialog);
|
|
5
14
|
|
|
6
|
-
const
|
|
15
|
+
const closeButtonTracker = createRenderTrackingContext("DialogCloseButton");
|
|
7
16
|
|
|
8
17
|
////////////////////////////////////////////////////////////////////////////////////
|
|
9
18
|
|
|
10
|
-
export interface DialogRootProps
|
|
19
|
+
export interface DialogRootProps
|
|
20
|
+
extends DialogVariantProps,
|
|
21
|
+
Omit<DialogPrimitive.RootProps, "role"> {
|
|
11
22
|
/**
|
|
12
23
|
* @default true
|
|
13
24
|
*/
|
|
@@ -18,12 +29,22 @@ export interface DialogRootProps extends DialogVariantProps, DialogPrimitive.Roo
|
|
|
18
29
|
unmountOnExit?: DialogPrimitive.RootProps["unmountOnExit"];
|
|
19
30
|
}
|
|
20
31
|
|
|
21
|
-
export
|
|
22
|
-
|
|
32
|
+
export function DialogRoot(props: DialogRootProps) {
|
|
33
|
+
const [variantProps, otherProps] = dialog.splitVariantProps({
|
|
23
34
|
lazyMount: true,
|
|
24
35
|
unmountOnExit: true,
|
|
25
|
-
|
|
26
|
-
});
|
|
36
|
+
...props,
|
|
37
|
+
});
|
|
38
|
+
const classNames = dialog(variantProps);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<ClassNamesProvider value={classNames}>
|
|
42
|
+
<closeButtonTracker.Provider>
|
|
43
|
+
<DialogPrimitive.Root {...otherProps} />
|
|
44
|
+
</closeButtonTracker.Provider>
|
|
45
|
+
</ClassNamesProvider>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
27
48
|
|
|
28
49
|
////////////////////////////////////////////////////////////////////////////////////
|
|
29
50
|
|
|
@@ -51,10 +72,12 @@ export const DialogBackdrop = withContext<HTMLDivElement, DialogBackdropProps>(
|
|
|
51
72
|
|
|
52
73
|
////////////////////////////////////////////////////////////////////////////////////
|
|
53
74
|
|
|
54
|
-
export interface DialogContentProps
|
|
75
|
+
export interface DialogContentProps
|
|
76
|
+
extends DialogPrimitive.ContentProps,
|
|
77
|
+
Pick<StyleProps, "width" | "maxWidth"> {}
|
|
55
78
|
|
|
56
79
|
export const DialogContent = withContext<HTMLDivElement, DialogContentProps>(
|
|
57
|
-
DialogPrimitive.Content,
|
|
80
|
+
withStyleProps(DialogPrimitive.Content),
|
|
58
81
|
"content",
|
|
59
82
|
);
|
|
60
83
|
|
|
@@ -62,7 +85,23 @@ export const DialogContent = withContext<HTMLDivElement, DialogContentProps>(
|
|
|
62
85
|
|
|
63
86
|
export interface DialogHeaderProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}
|
|
64
87
|
|
|
65
|
-
export const DialogHeader =
|
|
88
|
+
export const DialogHeader = React.forwardRef<HTMLDivElement, DialogHeaderProps>(
|
|
89
|
+
({ className, ...props }, ref) => {
|
|
90
|
+
const classNames = useClassNames();
|
|
91
|
+
const { isRendered } = closeButtonTracker.useRenderTracking();
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Primitive.div
|
|
95
|
+
ref={ref}
|
|
96
|
+
data-show-close-button={dataAttr(isRendered)}
|
|
97
|
+
className={clsx(classNames.header, className)}
|
|
98
|
+
{...props}
|
|
99
|
+
/>
|
|
100
|
+
);
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
DialogHeader.displayName = "DialogHeader";
|
|
66
105
|
|
|
67
106
|
////////////////////////////////////////////////////////////////////////////////////
|
|
68
107
|
|
|
@@ -84,6 +123,63 @@ export const DialogDescription = withContext<HTMLParagraphElement, DialogDescrip
|
|
|
84
123
|
|
|
85
124
|
////////////////////////////////////////////////////////////////////////////////////
|
|
86
125
|
|
|
126
|
+
export interface DialogBodyProps
|
|
127
|
+
extends PrimitiveProps,
|
|
128
|
+
Pick<StyleProps, "paddingX" | "minHeight" | "maxHeight" | "justifyContent" | "alignItems">,
|
|
129
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
130
|
+
|
|
131
|
+
export const DialogBody = React.forwardRef<HTMLDivElement, DialogBodyProps>(
|
|
132
|
+
(props, forwardedRef) => {
|
|
133
|
+
const classNames = useClassNames();
|
|
134
|
+
const { style, restProps } = useStyleProps(props);
|
|
135
|
+
const { className, ...otherProps } = restProps;
|
|
136
|
+
|
|
137
|
+
const ref = React.useRef<HTMLDivElement>(null);
|
|
138
|
+
const [scrolled, setScrolled] = React.useState(false);
|
|
139
|
+
const [overflowing, setOverflowing] = React.useState(false);
|
|
140
|
+
|
|
141
|
+
React.useEffect(() => {
|
|
142
|
+
const element = ref.current;
|
|
143
|
+
if (!element) return;
|
|
144
|
+
|
|
145
|
+
const check = () => {
|
|
146
|
+
setScrolled(element.scrollTop > 0);
|
|
147
|
+
// Subtract the current bottom padding so overflow detection stays independent
|
|
148
|
+
// of the padding we conditionally apply — otherwise that padding would count as
|
|
149
|
+
// overflow and the state would never settle (padding -> overflow -> padding...).
|
|
150
|
+
const paddingBottom = Number.parseFloat(getComputedStyle(element).paddingBottom) || 0;
|
|
151
|
+
setOverflowing(element.scrollHeight - paddingBottom > element.clientHeight);
|
|
152
|
+
};
|
|
153
|
+
check();
|
|
154
|
+
|
|
155
|
+
element.addEventListener("scroll", check);
|
|
156
|
+
|
|
157
|
+
const observer = new ResizeObserver(check);
|
|
158
|
+
observer.observe(element);
|
|
159
|
+
|
|
160
|
+
return () => {
|
|
161
|
+
element.removeEventListener("scroll", check);
|
|
162
|
+
observer.disconnect();
|
|
163
|
+
};
|
|
164
|
+
}, []);
|
|
165
|
+
|
|
166
|
+
return (
|
|
167
|
+
<Primitive.div
|
|
168
|
+
ref={composeRefs(ref, forwardedRef)}
|
|
169
|
+
data-scrolled={dataAttr(scrolled)}
|
|
170
|
+
data-overflow={dataAttr(overflowing)}
|
|
171
|
+
className={clsx(classNames.body, className)}
|
|
172
|
+
style={style}
|
|
173
|
+
{...otherProps}
|
|
174
|
+
/>
|
|
175
|
+
);
|
|
176
|
+
},
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
DialogBody.displayName = "DialogBody";
|
|
180
|
+
|
|
181
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
182
|
+
|
|
87
183
|
export interface DialogFooterProps extends PrimitiveProps, React.HTMLAttributes<HTMLDivElement> {}
|
|
88
184
|
|
|
89
185
|
export const DialogFooter = withContext<HTMLDivElement, DialogFooterProps>(Primitive.div, "footer");
|
|
@@ -93,3 +189,25 @@ export const DialogFooter = withContext<HTMLDivElement, DialogFooterProps>(Primi
|
|
|
93
189
|
export interface DialogActionProps extends DialogPrimitive.CloseButtonProps {}
|
|
94
190
|
|
|
95
191
|
export const DialogAction = DialogPrimitive.CloseButton;
|
|
192
|
+
|
|
193
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
194
|
+
|
|
195
|
+
export interface DialogCloseButtonProps extends DialogPrimitive.CloseButtonProps {}
|
|
196
|
+
|
|
197
|
+
export const DialogCloseButton = React.forwardRef<HTMLButtonElement, DialogCloseButtonProps>(
|
|
198
|
+
({ className, ...props }, ref) => {
|
|
199
|
+
const classNames = useClassNames();
|
|
200
|
+
const { trackRef } = closeButtonTracker.useRenderTracking();
|
|
201
|
+
const { scaleFeedbackRef, scaleFeedbackClassName } = useScaleFeedback();
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
<DialogPrimitive.CloseButton
|
|
205
|
+
ref={useComposedRefs(scaleFeedbackRef, ref, trackRef)}
|
|
206
|
+
className={clsx(classNames.closeButton, scaleFeedbackClassName, className)}
|
|
207
|
+
{...props}
|
|
208
|
+
/>
|
|
209
|
+
);
|
|
210
|
+
},
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
DialogCloseButton.displayName = "DialogCloseButton";
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
// NOTE: dialog naming is mid-rename; rootage/vars already use the new names, recipes and react components still use the old ones.
|
|
2
|
-
// Semantically (= snippet naming), this component is the AlertDialog:
|
|
3
|
-
// snippet AlertDialog → react Dialog → recipe "dialog" → vars alertDialog
|
|
4
|
-
// snippet Dialog → react ContentDialog → recipe "content-dialog" → vars dialog
|
|
5
|
-
|
|
6
1
|
export {
|
|
7
2
|
DialogBackdrop,
|
|
8
3
|
DialogPositioner,
|
|
9
4
|
DialogContent,
|
|
5
|
+
DialogBody,
|
|
10
6
|
DialogDescription,
|
|
11
7
|
DialogFooter,
|
|
12
8
|
DialogHeader,
|
|
@@ -14,9 +10,11 @@ export {
|
|
|
14
10
|
DialogTitle,
|
|
15
11
|
DialogTrigger,
|
|
16
12
|
DialogAction,
|
|
13
|
+
DialogCloseButton,
|
|
17
14
|
type DialogBackdropProps,
|
|
18
15
|
type DialogPositionerProps,
|
|
19
16
|
type DialogContentProps,
|
|
17
|
+
type DialogBodyProps,
|
|
20
18
|
type DialogDescriptionProps,
|
|
21
19
|
type DialogFooterProps,
|
|
22
20
|
type DialogHeaderProps,
|
|
@@ -24,6 +22,7 @@ export {
|
|
|
24
22
|
type DialogTitleProps,
|
|
25
23
|
type DialogTriggerProps,
|
|
26
24
|
type DialogActionProps,
|
|
25
|
+
type DialogCloseButtonProps,
|
|
27
26
|
} from "./Dialog";
|
|
28
27
|
|
|
29
28
|
export * as Dialog from "./Dialog.namespace";
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { act, render } from "@testing-library/react";
|
|
2
|
+
import { describe, expect, it } from "bun:test";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
HelpBubbleAnchor,
|
|
6
|
+
HelpBubbleBody,
|
|
7
|
+
HelpBubbleCloseButton,
|
|
8
|
+
HelpBubbleContent,
|
|
9
|
+
HelpBubbleDescription,
|
|
10
|
+
HelpBubblePositioner,
|
|
11
|
+
HelpBubbleRoot,
|
|
12
|
+
HelpBubbleTitle,
|
|
13
|
+
HelpBubbleTrigger,
|
|
14
|
+
type HelpBubbleRootProps,
|
|
15
|
+
} from "./HelpBubble";
|
|
16
|
+
|
|
17
|
+
// Flush microtasks so Floating UI position state settles.
|
|
18
|
+
// See: https://floating-ui.com/docs/react#testing
|
|
19
|
+
const waitForPositioning = () => act(async () => {});
|
|
20
|
+
|
|
21
|
+
// Flush rAF-deferred focus from FloatingFocusManager. happy-dom mocks rAF with
|
|
22
|
+
// setImmediate, so a short timer is needed for enqueueFocus() in @floating-ui/react
|
|
23
|
+
// to land.
|
|
24
|
+
const waitForFocus = () =>
|
|
25
|
+
act(async () => {
|
|
26
|
+
await new Promise((resolve) => setTimeout(resolve, 50));
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
function BasicHelpBubble(props: Omit<HelpBubbleRootProps, "children">) {
|
|
30
|
+
return (
|
|
31
|
+
<HelpBubbleRoot {...props}>
|
|
32
|
+
<HelpBubbleTrigger>Help</HelpBubbleTrigger>
|
|
33
|
+
<HelpBubblePositioner data-testid="positioner">
|
|
34
|
+
<HelpBubbleContent data-testid="content">
|
|
35
|
+
<HelpBubbleBody>
|
|
36
|
+
<HelpBubbleTitle>Title</HelpBubbleTitle>
|
|
37
|
+
<HelpBubbleDescription>Description</HelpBubbleDescription>
|
|
38
|
+
</HelpBubbleBody>
|
|
39
|
+
<HelpBubbleCloseButton>Close</HelpBubbleCloseButton>
|
|
40
|
+
</HelpBubbleContent>
|
|
41
|
+
</HelpBubblePositioner>
|
|
42
|
+
</HelpBubbleRoot>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
describe("HelpBubble", () => {
|
|
47
|
+
it("wires the trigger and the content as a dialog popup", async () => {
|
|
48
|
+
const { getByText, getByTestId, getByRole } = render(<BasicHelpBubble defaultOpen />);
|
|
49
|
+
await waitForPositioning();
|
|
50
|
+
|
|
51
|
+
expect(getByRole("dialog")).toBe(getByTestId("content"));
|
|
52
|
+
expect(getByText("Help")).toHaveAttribute("aria-controls", getByTestId("content").id);
|
|
53
|
+
expect(getByTestId("positioner")).not.toHaveAttribute("role");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("names and describes the content while keeping the title and description elements", async () => {
|
|
57
|
+
const { getByText, getByTestId } = render(<BasicHelpBubble defaultOpen />);
|
|
58
|
+
await waitForPositioning();
|
|
59
|
+
|
|
60
|
+
expect(getByText("Title").tagName).toBe("SPAN");
|
|
61
|
+
expect(getByText("Description").tagName).toBe("DIV");
|
|
62
|
+
expect(getByTestId("content")).toHaveAttribute("aria-labelledby", getByText("Title").id);
|
|
63
|
+
expect(getByTestId("content")).toHaveAttribute("aria-describedby", getByText("Description").id);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("leaves focus where the page put it when it opens", async () => {
|
|
67
|
+
const { getByTestId } = render(
|
|
68
|
+
<>
|
|
69
|
+
{/* biome-ignore lint/a11y/noAutofocus: reproduces a page that focuses a field on load */}
|
|
70
|
+
<input data-testid="field" autoFocus />
|
|
71
|
+
<BasicHelpBubble defaultOpen />
|
|
72
|
+
</>,
|
|
73
|
+
);
|
|
74
|
+
await waitForPositioning();
|
|
75
|
+
await waitForFocus();
|
|
76
|
+
|
|
77
|
+
expect(getByTestId("field")).toHaveFocus();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("stays open when the page focuses a field after it opens", async () => {
|
|
81
|
+
const { getByTestId, getByText } = render(
|
|
82
|
+
<>
|
|
83
|
+
<input data-testid="field" />
|
|
84
|
+
<BasicHelpBubble defaultOpen />
|
|
85
|
+
</>,
|
|
86
|
+
);
|
|
87
|
+
await waitForPositioning();
|
|
88
|
+
await waitForFocus();
|
|
89
|
+
|
|
90
|
+
act(() => getByTestId("field").focus());
|
|
91
|
+
await waitForFocus();
|
|
92
|
+
|
|
93
|
+
expect(getByTestId("field")).toHaveFocus();
|
|
94
|
+
expect(getByText("Help")).toHaveAttribute("aria-expanded", "true");
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("moves focus into the content when it opens against an anchor with autoFocus", async () => {
|
|
98
|
+
const { getByTestId } = render(
|
|
99
|
+
<HelpBubbleRoot defaultOpen autoFocus>
|
|
100
|
+
<HelpBubbleAnchor>Anchor</HelpBubbleAnchor>
|
|
101
|
+
<HelpBubblePositioner>
|
|
102
|
+
<HelpBubbleContent data-testid="content">Content</HelpBubbleContent>
|
|
103
|
+
</HelpBubblePositioner>
|
|
104
|
+
</HelpBubbleRoot>,
|
|
105
|
+
);
|
|
106
|
+
await waitForPositioning();
|
|
107
|
+
await waitForFocus();
|
|
108
|
+
|
|
109
|
+
expect(getByTestId("content")).toHaveFocus();
|
|
110
|
+
});
|
|
111
|
+
});
|
|
@@ -32,6 +32,11 @@ export interface HelpBubbleRootProps extends HelpBubbleVariantProps, PopoverPrim
|
|
|
32
32
|
* @default 14
|
|
33
33
|
*/
|
|
34
34
|
arrowPadding?: PopoverPrimitive.RootProps["arrowPadding"];
|
|
35
|
+
/**
|
|
36
|
+
* Whether to move focus into the content when it opens. Off by default so a bubble shown on page load keeps focus where the page put it; set `true` to follow the dialog pattern and move focus in.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
autoFocus?: PopoverPrimitive.RootProps["autoFocus"];
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
export const HelpBubbleRoot = withRootProvider<HelpBubbleRootProps>(PopoverPrimitive.Root, {
|
|
@@ -40,6 +45,7 @@ export const HelpBubbleRoot = withRootProvider<HelpBubbleRootProps>(PopoverPrimi
|
|
|
40
45
|
gutter: 4, // TODO: get value from rootage spec
|
|
41
46
|
overflowPadding: 16, // TODO: get value from rootage spec
|
|
42
47
|
arrowPadding: 14,
|
|
48
|
+
autoFocus: false,
|
|
43
49
|
},
|
|
44
50
|
});
|
|
45
51
|
|
|
@@ -79,7 +85,7 @@ export interface HelpBubbleContentProps
|
|
|
79
85
|
React.HTMLAttributes<HTMLDivElement> {}
|
|
80
86
|
|
|
81
87
|
export const HelpBubbleContent = withContext<HTMLDivElement, HelpBubbleContentProps>(
|
|
82
|
-
withStyleProps(withStateProps(
|
|
88
|
+
withStyleProps(withStateProps(PopoverPrimitive.Content)),
|
|
83
89
|
"content",
|
|
84
90
|
);
|
|
85
91
|
|
|
@@ -159,7 +165,12 @@ export interface HelpBubbleTitleProps
|
|
|
159
165
|
React.HTMLAttributes<HTMLSpanElement> {}
|
|
160
166
|
|
|
161
167
|
export const HelpBubbleTitle = withContext<HTMLSpanElement, HelpBubbleTitleProps>(
|
|
162
|
-
|
|
168
|
+
forwardRef<HTMLSpanElement, HelpBubbleTitleProps>((props, ref) => (
|
|
169
|
+
// An h2 is too noisy for something as small as a help bubble, so keep a plain span.
|
|
170
|
+
<PopoverPrimitive.Title asChild>
|
|
171
|
+
<Primitive.span ref={ref} {...props} />
|
|
172
|
+
</PopoverPrimitive.Title>
|
|
173
|
+
)),
|
|
163
174
|
"title",
|
|
164
175
|
);
|
|
165
176
|
|
|
@@ -168,6 +179,11 @@ export interface HelpBubbleDescriptionProps
|
|
|
168
179
|
React.HTMLAttributes<HTMLDivElement> {}
|
|
169
180
|
|
|
170
181
|
export const HelpBubbleDescription = withContext<HTMLDivElement, HelpBubbleDescriptionProps>(
|
|
171
|
-
|
|
182
|
+
forwardRef<HTMLDivElement, HelpBubbleDescriptionProps>((props, ref) => (
|
|
183
|
+
// A p is too noisy for something as small as a help bubble, so keep a plain div.
|
|
184
|
+
<PopoverPrimitive.Description asChild>
|
|
185
|
+
<Primitive.div ref={ref} {...props} />
|
|
186
|
+
</PopoverPrimitive.Description>
|
|
187
|
+
)),
|
|
172
188
|
"description",
|
|
173
189
|
);
|
|
@@ -21,7 +21,7 @@ import { useScaleFeedback } from "@seed-design/react-scale-feedback";
|
|
|
21
21
|
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
22
22
|
import type { DistributiveOmit } from "../../utils/styled";
|
|
23
23
|
import { AspectRatio, type AspectRatioProps } from "../AspectRatio/AspectRatio";
|
|
24
|
-
import {
|
|
24
|
+
import { BadgeLabel, BadgeRoot, type BadgeRootProps } from "../Badge/Badge";
|
|
25
25
|
import { Float, type FloatProps } from "../Float/Float";
|
|
26
26
|
import { Icon } from "../Icon/Icon";
|
|
27
27
|
import { InternalIcon } from "../private/Icon";
|
|
@@ -70,6 +70,8 @@ export const ImageFrame = React.forwardRef<HTMLDivElement, ImageFrameProps>(
|
|
|
70
70
|
const classNames = imageFrameRecipe(variantProps);
|
|
71
71
|
|
|
72
72
|
return (
|
|
73
|
+
// TODO: `asChild` arrives from `AspectRatioProps` but slots onto `Image.Root` below, so it
|
|
74
|
+
// never swaps this component's own element. Support it via `Slottable`, or omit it from the props.
|
|
73
75
|
<AspectRatio
|
|
74
76
|
ref={ref}
|
|
75
77
|
ratio={ratio}
|
|
@@ -119,11 +121,17 @@ ImageFrameFloater.displayName = "ImageFrameFloater";
|
|
|
119
121
|
|
|
120
122
|
////////////////////////////////////////////////////////////////////////////////////
|
|
121
123
|
|
|
122
|
-
export interface ImageFrameBadgeProps extends
|
|
124
|
+
export interface ImageFrameBadgeProps extends BadgeRootProps {}
|
|
123
125
|
|
|
124
126
|
export const ImageFrameBadge = React.forwardRef<HTMLSpanElement, ImageFrameBadgeProps>(
|
|
125
|
-
(props, ref) => {
|
|
126
|
-
return
|
|
127
|
+
({ children, ...props }, ref) => {
|
|
128
|
+
return (
|
|
129
|
+
// FIXME: `asChild` slots onto `BadgeLabel` below, not `BadgeRoot`, so the caller's element
|
|
130
|
+
// lands inside the badge without its class or ref. Route `children` through `Slottable`.
|
|
131
|
+
<BadgeRoot ref={ref} {...props}>
|
|
132
|
+
<BadgeLabel>{children}</BadgeLabel>
|
|
133
|
+
</BadgeRoot>
|
|
134
|
+
);
|
|
127
135
|
},
|
|
128
136
|
);
|
|
129
137
|
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export {
|
|
2
|
+
ListCheckItem as CheckItem,
|
|
3
|
+
ListRadioItem as RadioItem,
|
|
4
|
+
ListRadioRoot as RadioRoot,
|
|
5
|
+
ListSwitchItem as SwitchItem,
|
|
6
|
+
type ListCheckItemProps as CheckItemProps,
|
|
7
|
+
type ListRadioItemProps as RadioItemProps,
|
|
8
|
+
type ListRadioRootProps as RadioRootProps,
|
|
9
|
+
type ListSwitchItemProps as SwitchItemProps,
|
|
2
10
|
ListContent as Content,
|
|
3
11
|
ListDetail as Detail,
|
|
4
12
|
ListItem as Item,
|
|
@@ -6,10 +6,13 @@ import { forwardRef } from "react";
|
|
|
6
6
|
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
7
7
|
import { handleRadius, withStyleProps, type StyleProps } from "../../utils/styled";
|
|
8
8
|
import { VStack, type VStackProps } from "../Stack";
|
|
9
|
-
import { useCheckboxContext } from "@seed-design/react-checkbox";
|
|
9
|
+
import { Checkbox as CheckboxPrimitive, useCheckboxContext } from "@seed-design/react-checkbox";
|
|
10
10
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
11
|
-
import {
|
|
12
|
-
|
|
11
|
+
import {
|
|
12
|
+
RadioGroup as RadioGroupPrimitive,
|
|
13
|
+
useRadioGroupItemContext,
|
|
14
|
+
} from "@seed-design/react-radio-group";
|
|
15
|
+
import { Switch as SwitchPrimitive, useSwitchContext } from "@seed-design/react-switch";
|
|
13
16
|
|
|
14
17
|
const { withContext, withProvider } = createSlotRecipeContext(listItem);
|
|
15
18
|
const withStateProps = createWithStateProps([
|
|
@@ -55,6 +58,43 @@ export const ListItem = withProvider<HTMLLIElement, ListItemProps>(
|
|
|
55
58
|
"root",
|
|
56
59
|
);
|
|
57
60
|
|
|
61
|
+
export interface ListCheckItemProps
|
|
62
|
+
extends ListItemVariantProps,
|
|
63
|
+
Pick<StyleProps, "alignItems">,
|
|
64
|
+
CheckboxPrimitive.RootProps {}
|
|
65
|
+
|
|
66
|
+
export const ListCheckItem = withProvider<HTMLLabelElement, ListCheckItemProps>(
|
|
67
|
+
withStyleProps(CheckboxPrimitive.Root),
|
|
68
|
+
"root",
|
|
69
|
+
);
|
|
70
|
+
ListCheckItem.displayName = "List.CheckItem";
|
|
71
|
+
|
|
72
|
+
export interface ListRadioRootProps extends RadioGroupPrimitive.RootProps {}
|
|
73
|
+
|
|
74
|
+
export const ListRadioRoot = RadioGroupPrimitive.Root;
|
|
75
|
+
|
|
76
|
+
export interface ListRadioItemProps
|
|
77
|
+
extends ListItemVariantProps,
|
|
78
|
+
Pick<StyleProps, "alignItems">,
|
|
79
|
+
RadioGroupPrimitive.ItemProps {}
|
|
80
|
+
|
|
81
|
+
export const ListRadioItem = withProvider<HTMLLabelElement, ListRadioItemProps>(
|
|
82
|
+
withStyleProps(RadioGroupPrimitive.Item),
|
|
83
|
+
"root",
|
|
84
|
+
);
|
|
85
|
+
ListRadioItem.displayName = "List.RadioItem";
|
|
86
|
+
|
|
87
|
+
export interface ListSwitchItemProps
|
|
88
|
+
extends ListItemVariantProps,
|
|
89
|
+
Pick<StyleProps, "alignItems">,
|
|
90
|
+
SwitchPrimitive.RootProps {}
|
|
91
|
+
|
|
92
|
+
export const ListSwitchItem = withProvider<HTMLLabelElement, ListSwitchItemProps>(
|
|
93
|
+
withStyleProps(SwitchPrimitive.Root),
|
|
94
|
+
"root",
|
|
95
|
+
);
|
|
96
|
+
ListSwitchItem.displayName = "List.SwitchItem";
|
|
97
|
+
|
|
58
98
|
export interface ListContentProps
|
|
59
99
|
extends PrimitiveProps,
|
|
60
100
|
Pick<StyleProps, "gap" | "pr" | "paddingRight">,
|
|
@@ -8,6 +8,7 @@ import clsx from "clsx";
|
|
|
8
8
|
import * as React from "react";
|
|
9
9
|
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
10
10
|
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
11
|
+
import { withContentScale } from "../../utils/withContentScale";
|
|
11
12
|
|
|
12
13
|
const { ClassNamesProvider, withContext, useClassNames } = createSlotRecipeContext(menu);
|
|
13
14
|
const {
|
|
@@ -107,8 +108,8 @@ export const MenuGroupLabel = withContext<HTMLDivElement, MenuGroupLabelProps>(
|
|
|
107
108
|
|
|
108
109
|
export interface MenuItemProps extends MenuItemVariantProps, MenuPrimitive.ItemProps {}
|
|
109
110
|
|
|
110
|
-
export const MenuItem =
|
|
111
|
-
({ className: propClassName, ...props }, ref) => {
|
|
111
|
+
export const MenuItem = withContentScale(
|
|
112
|
+
React.forwardRef<HTMLDivElement, MenuItemProps>(({ className: propClassName, ...props }, ref) => {
|
|
112
113
|
const [variantProps, otherProps] = menuItem.splitVariantProps(props);
|
|
113
114
|
const parentProps = useItemProps();
|
|
114
115
|
|
|
@@ -123,7 +124,7 @@ export const MenuItem = React.forwardRef<HTMLDivElement, MenuItemProps>(
|
|
|
123
124
|
/>
|
|
124
125
|
</ItemClassNamesProvider>
|
|
125
126
|
);
|
|
126
|
-
},
|
|
127
|
+
}),
|
|
127
128
|
);
|
|
128
129
|
MenuItem.displayName = "MenuItem";
|
|
129
130
|
|