@seed-design/react 1.2.15 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Accordion/Accordion.cjs +42 -0
- package/lib/components/Accordion/Accordion.d.ts +35 -0
- package/lib/components/Accordion/Accordion.d.ts.map +1 -0
- package/lib/components/Accordion/Accordion.js +32 -0
- package/lib/components/Accordion/Accordion.namespace.cjs +22 -0
- package/lib/components/Accordion/Accordion.namespace.d.ts +2 -0
- package/lib/components/Accordion/Accordion.namespace.d.ts.map +1 -0
- package/lib/components/Accordion/Accordion.namespace.js +17 -0
- package/lib/components/Accordion/index.cjs +19 -0
- package/lib/components/Accordion/index.d.ts +3 -0
- package/lib/components/Accordion/index.d.ts.map +1 -0
- package/lib/components/Accordion/index.js +3 -0
- package/lib/components/ActionButton/ActionButton.cjs +1 -1
- package/lib/components/ActionButton/ActionButton.d.ts +1 -1
- package/lib/components/ActionButton/ActionButton.d.ts.map +1 -1
- package/lib/components/ActionButton/ActionButton.js +1 -1
- package/lib/components/ActionSheet/ActionSheet.cjs +12 -12
- package/lib/components/ActionSheet/ActionSheet.d.ts +22 -22
- package/lib/components/ActionSheet/ActionSheet.js +12 -12
- package/lib/components/Article/Article.d.ts +2 -3
- package/lib/components/Article/Article.d.ts.map +1 -1
- package/lib/components/AspectRatio/AspectRatio.d.ts +2 -2
- package/lib/components/AspectRatio/AspectRatio.d.ts.map +1 -1
- package/lib/components/AttachmentDisplay/AttachmentDisplay.cjs +63 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplay.d.ts +43 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplay.d.ts.map +1 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplay.js +49 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplay.namespace.cjs +37 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplay.namespace.d.ts +5 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplay.namespace.d.ts.map +1 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplay.namespace.js +32 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplayItem.cjs +110 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplayItem.d.ts +30 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplayItem.d.ts.map +1 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplayItem.js +100 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.cjs +50 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.d.ts +18 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.d.ts.map +1 -0
- package/lib/components/AttachmentDisplay/AttachmentDisplayTrigger.js +45 -0
- package/lib/components/AttachmentDisplay/index.cjs +34 -0
- package/lib/components/AttachmentDisplay/index.d.ts +6 -0
- package/lib/components/AttachmentDisplay/index.d.ts.map +1 -0
- package/lib/components/AttachmentDisplay/index.js +5 -0
- package/lib/components/AttachmentInput/AttachmentInput.cjs +37 -0
- package/lib/components/AttachmentInput/AttachmentInput.d.ts +23 -0
- package/lib/components/AttachmentInput/AttachmentInput.d.ts.map +1 -0
- package/lib/components/AttachmentInput/AttachmentInput.js +30 -0
- package/lib/components/AttachmentInput/AttachmentInput.namespace.cjs +35 -0
- package/lib/components/AttachmentInput/AttachmentInput.namespace.d.ts +6 -0
- package/lib/components/AttachmentInput/AttachmentInput.namespace.d.ts.map +1 -0
- package/lib/components/AttachmentInput/AttachmentInput.namespace.js +30 -0
- package/lib/components/AttachmentInput/AttachmentInput.test.d.ts +2 -0
- package/lib/components/AttachmentInput/AttachmentInput.test.d.ts.map +1 -0
- package/lib/components/AttachmentInput/AttachmentInputDropzone.cjs +12 -0
- package/lib/components/AttachmentInput/AttachmentInputDropzone.d.ts +9 -0
- package/lib/components/AttachmentInput/AttachmentInputDropzone.d.ts.map +1 -0
- package/lib/components/AttachmentInput/AttachmentInputDropzone.js +10 -0
- package/lib/components/AttachmentInput/AttachmentInputItem.cjs +138 -0
- package/lib/components/AttachmentInput/AttachmentInputItem.d.ts +36 -0
- package/lib/components/AttachmentInput/AttachmentInputItem.d.ts.map +1 -0
- package/lib/components/AttachmentInput/AttachmentInputItem.js +126 -0
- package/lib/components/AttachmentInput/AttachmentInputTrigger.cjs +54 -0
- package/lib/components/AttachmentInput/AttachmentInputTrigger.d.ts +21 -0
- package/lib/components/AttachmentInput/AttachmentInputTrigger.d.ts.map +1 -0
- package/lib/components/AttachmentInput/AttachmentInputTrigger.js +49 -0
- package/lib/components/AttachmentInput/index.cjs +32 -0
- package/lib/components/AttachmentInput/index.d.ts +7 -0
- package/lib/components/AttachmentInput/index.d.ts.map +1 -0
- package/lib/components/AttachmentInput/index.js +6 -0
- package/lib/components/BottomSheet/BottomSheet.cjs +36 -9
- package/lib/components/BottomSheet/BottomSheet.d.ts +2 -7
- package/lib/components/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/components/BottomSheet/BottomSheet.js +35 -9
- package/lib/components/Box/Box.cjs +10 -3
- package/lib/components/Box/Box.d.ts +4 -2
- package/lib/components/Box/Box.d.ts.map +1 -1
- package/lib/components/Box/Box.js +10 -3
- package/lib/components/Checkbox/Checkbox.cjs +2 -6
- package/lib/components/Checkbox/Checkbox.d.ts +1 -7
- package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +2 -6
- package/lib/components/Chip/Chip.cjs +1 -1
- package/lib/components/Chip/Chip.js +1 -1
- package/lib/components/ChipTabs/ChipTabs.cjs +0 -1
- package/lib/components/ChipTabs/ChipTabs.d.ts.map +1 -1
- package/lib/components/ChipTabs/ChipTabs.js +0 -1
- package/lib/components/Columns/Columns.d.ts +4 -4
- package/lib/components/Columns/Columns.d.ts.map +1 -1
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.cjs +13 -13
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.d.ts +24 -24
- package/lib/components/ExtendedActionSheet/ExtendedActionSheet.js +13 -13
- package/lib/components/FieldButton/FieldButton.cjs +22 -3
- package/lib/components/FieldButton/FieldButton.d.ts +3 -2
- package/lib/components/FieldButton/FieldButton.d.ts.map +1 -1
- package/lib/components/FieldButton/FieldButton.js +23 -3
- package/lib/components/Flex/Flex.d.ts +5 -3
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Footer/Footer.namespace.cjs +11 -0
- package/lib/components/Footer/Footer.namespace.d.ts +2 -0
- package/lib/components/Footer/Footer.namespace.d.ts.map +1 -0
- package/lib/components/Footer/Footer.namespace.js +6 -0
- package/lib/components/Footer/FooterLinkText.cjs +23 -0
- package/lib/components/Footer/FooterLinkText.d.ts +7 -0
- package/lib/components/Footer/FooterLinkText.d.ts.map +1 -0
- package/lib/components/Footer/FooterLinkText.js +20 -0
- package/lib/components/Footer/index.cjs +10 -0
- package/lib/components/Footer/index.d.ts +3 -0
- package/lib/components/Footer/index.d.ts.map +1 -0
- package/lib/components/Footer/index.js +3 -0
- package/lib/components/Grid/Grid.cjs +7 -2
- package/lib/components/Grid/Grid.d.ts +7 -5
- package/lib/components/Grid/Grid.d.ts.map +1 -1
- package/lib/components/Grid/Grid.js +7 -2
- package/lib/components/GridItem/GridItem.d.ts +3 -2
- package/lib/components/GridItem/GridItem.d.ts.map +1 -1
- package/lib/components/HelpBubble/HelpBubble.cjs +4 -7
- package/lib/components/HelpBubble/HelpBubble.d.ts.map +1 -1
- package/lib/components/HelpBubble/HelpBubble.js +4 -7
- package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.cjs +64 -0
- package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.d.ts +60 -0
- package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.d.ts.map +1 -0
- package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.js +52 -0
- package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.namespace.cjs +23 -0
- package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.namespace.d.ts +2 -0
- package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.namespace.d.ts.map +1 -0
- package/lib/components/HelpBubbleTooltip/HelpBubbleTooltip.namespace.js +18 -0
- package/lib/components/HelpBubbleTooltip/index.cjs +20 -0
- package/lib/components/HelpBubbleTooltip/index.d.ts +3 -0
- package/lib/components/HelpBubbleTooltip/index.d.ts.map +1 -0
- package/lib/components/HelpBubbleTooltip/index.js +3 -0
- package/lib/components/Icon/Icon.d.ts +2 -1
- package/lib/components/Icon/Icon.d.ts.map +1 -1
- package/lib/components/ImageFrame/ImageFrame.cjs +10 -10
- package/lib/components/ImageFrame/ImageFrame.d.ts +3 -11
- package/lib/components/ImageFrame/ImageFrame.d.ts.map +1 -1
- package/lib/components/ImageFrame/ImageFrame.js +10 -10
- package/lib/components/Inline/Inline.d.ts +2 -2
- package/lib/components/Inline/Inline.d.ts.map +1 -1
- package/lib/components/Layout/Layout.cjs +12 -0
- package/lib/components/Layout/Layout.d.ts +10 -0
- package/lib/components/Layout/Layout.d.ts.map +1 -0
- package/lib/components/Layout/Layout.js +10 -0
- package/lib/components/Layout/Layout.namespace.cjs +14 -0
- package/lib/components/Layout/Layout.namespace.d.ts +2 -0
- package/lib/components/Layout/Layout.namespace.d.ts.map +1 -0
- package/lib/components/Layout/Layout.namespace.js +9 -0
- package/lib/components/Layout/index.cjs +11 -0
- package/lib/components/Layout/index.d.ts +3 -0
- package/lib/components/Layout/index.d.ts.map +1 -0
- package/lib/components/Layout/index.js +3 -0
- package/lib/components/List/List.cjs +1 -1
- package/lib/components/List/List.d.ts +1 -1
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.js +1 -1
- package/lib/components/Menu/Menu.cjs +76 -0
- package/lib/components/Menu/Menu.d.ts +42 -0
- package/lib/components/Menu/Menu.d.ts.map +1 -0
- package/lib/components/Menu/Menu.js +62 -0
- package/lib/components/Menu/Menu.namespace.cjs +24 -0
- package/lib/components/Menu/Menu.namespace.d.ts +2 -0
- package/lib/components/Menu/Menu.namespace.d.ts.map +1 -0
- package/lib/components/Menu/Menu.namespace.js +19 -0
- package/lib/components/Menu/index.cjs +21 -0
- package/lib/components/Menu/index.d.ts +3 -0
- package/lib/components/Menu/index.d.ts.map +1 -0
- package/lib/components/Menu/index.js +3 -0
- package/lib/components/MenuSheet/MenuSheet.cjs +48 -0
- package/lib/components/MenuSheet/MenuSheet.d.ts +96 -0
- package/lib/components/MenuSheet/MenuSheet.d.ts.map +1 -1
- package/lib/components/MenuSheet/MenuSheet.js +48 -0
- package/lib/components/NavigationMenu/NavigationMenu.cjs +76 -0
- package/lib/components/NavigationMenu/NavigationMenu.d.ts +42 -0
- package/lib/components/NavigationMenu/NavigationMenu.d.ts.map +1 -0
- package/lib/components/NavigationMenu/NavigationMenu.js +62 -0
- package/lib/components/NavigationMenu/NavigationMenu.namespace.cjs +24 -0
- package/lib/components/NavigationMenu/NavigationMenu.namespace.d.ts +2 -0
- package/lib/components/NavigationMenu/NavigationMenu.namespace.d.ts.map +1 -0
- package/lib/components/NavigationMenu/NavigationMenu.namespace.js +19 -0
- package/lib/components/NavigationMenu/index.cjs +21 -0
- package/lib/components/NavigationMenu/index.d.ts +3 -0
- package/lib/components/NavigationMenu/index.d.ts.map +1 -0
- package/lib/components/NavigationMenu/index.js +3 -0
- package/lib/components/RadioGroup/RadioGroup.cjs +1 -1
- package/lib/components/RadioGroup/RadioGroup.js +1 -1
- package/lib/components/ResponsivePair/ResponsivePair.cjs +8 -5
- package/lib/components/ResponsivePair/ResponsivePair.d.ts +3 -2
- package/lib/components/ResponsivePair/ResponsivePair.d.ts.map +1 -1
- package/lib/components/ResponsivePair/ResponsivePair.js +8 -5
- package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.cjs +184 -0
- package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.d.ts +65 -0
- package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.d.ts.map +1 -0
- package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.js +170 -0
- package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.namespace.cjs +24 -0
- package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.namespace.d.ts +2 -0
- package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.namespace.d.ts.map +1 -0
- package/lib/components/ResponsiveSidePanel/ResponsiveSidePanel.namespace.js +19 -0
- package/lib/components/ResponsiveSidePanel/index.cjs +22 -0
- package/lib/components/ResponsiveSidePanel/index.d.ts +3 -0
- package/lib/components/ResponsiveSidePanel/index.d.ts.map +1 -0
- package/lib/components/ResponsiveSidePanel/index.js +3 -0
- package/lib/components/ScrollFog/ScrollFog.cjs +1 -2
- package/lib/components/ScrollFog/ScrollFog.d.ts.map +1 -1
- package/lib/components/ScrollFog/ScrollFog.js +4 -5
- package/lib/components/SelectBox/CheckSelectBox.cjs +2 -2
- package/lib/components/SelectBox/CheckSelectBox.d.ts +1 -1
- package/lib/components/SelectBox/CheckSelectBox.d.ts.map +1 -1
- package/lib/components/SelectBox/CheckSelectBox.js +1 -1
- package/lib/components/SideNavigation/SideNavigation.cjs +175 -0
- package/lib/components/SideNavigation/SideNavigation.d.ts +59 -0
- package/lib/components/SideNavigation/SideNavigation.d.ts.map +1 -0
- package/lib/components/SideNavigation/SideNavigation.js +157 -0
- package/lib/components/SideNavigation/SideNavigation.namespace.cjs +28 -0
- package/lib/components/SideNavigation/SideNavigation.namespace.d.ts +3 -0
- package/lib/components/SideNavigation/SideNavigation.namespace.d.ts.map +1 -0
- package/lib/components/SideNavigation/SideNavigation.namespace.js +23 -0
- package/lib/components/SideNavigation/index.cjs +25 -0
- package/lib/components/SideNavigation/index.d.ts +4 -0
- package/lib/components/SideNavigation/index.d.ts.map +1 -0
- package/lib/components/SideNavigation/index.js +3 -0
- package/lib/components/SidePanel/SidePanel.cjs +100 -0
- package/lib/components/SidePanel/SidePanel.d.ts +41 -0
- package/lib/components/SidePanel/SidePanel.d.ts.map +1 -0
- package/lib/components/SidePanel/SidePanel.js +87 -0
- package/lib/components/SidePanel/SidePanel.namespace.cjs +23 -0
- package/lib/components/SidePanel/SidePanel.namespace.d.ts +2 -0
- package/lib/components/SidePanel/SidePanel.namespace.d.ts.map +1 -0
- package/lib/components/SidePanel/SidePanel.namespace.js +18 -0
- package/lib/components/SidePanel/index.cjs +20 -0
- package/lib/components/SidePanel/index.d.ts +3 -0
- package/lib/components/SidePanel/index.d.ts.map +1 -0
- package/lib/components/SidePanel/index.js +3 -0
- package/lib/components/Slider/Slider.cjs +2 -2
- package/lib/components/Slider/Slider.js +2 -2
- package/lib/components/Snackbar/Snackbar.cjs +2 -2
- package/lib/components/Snackbar/Snackbar.d.ts +1 -1
- package/lib/components/Snackbar/Snackbar.d.ts.map +1 -1
- package/lib/components/Snackbar/Snackbar.js +2 -2
- package/lib/components/Stack/Stack.d.ts +4 -6
- package/lib/components/Stack/Stack.d.ts.map +1 -1
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.cjs +123 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts +60 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.d.ts.map +1 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.js +104 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.cjs +29 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.d.ts +2 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.d.ts.map +1 -0
- package/lib/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.js +24 -0
- package/lib/components/SwipeableMenuSheet/index.cjs +26 -0
- package/lib/components/SwipeableMenuSheet/index.d.ts +3 -0
- package/lib/components/SwipeableMenuSheet/index.d.ts.map +1 -0
- package/lib/components/SwipeableMenuSheet/index.js +3 -0
- package/lib/components/Switch/Switch.cjs +1 -5
- package/lib/components/Switch/Switch.d.ts +1 -7
- package/lib/components/Switch/Switch.d.ts.map +1 -1
- package/lib/components/Switch/Switch.js +1 -5
- package/lib/components/TagGroup/TagGroup.cjs +1 -1
- package/lib/components/TagGroup/TagGroup.js +1 -1
- package/lib/components/TextField/TextField.cjs +1 -1
- package/lib/components/TextField/TextField.js +1 -1
- package/lib/components/index.cjs +249 -0
- package/lib/components/index.d.ts +12 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +30 -1
- package/lib/components/private/useDismissible.d.ts +6 -6
- package/lib/hooks/useBreakpoint.cjs +15 -0
- package/lib/hooks/useBreakpoint.d.ts +12 -0
- package/lib/hooks/useBreakpoint.d.ts.map +1 -0
- package/lib/hooks/useBreakpoint.js +13 -0
- package/lib/hooks/useBreakpoint.test.d.ts +2 -0
- package/lib/hooks/useBreakpoint.test.d.ts.map +1 -0
- package/lib/hooks/useBreakpointValue.cjs +23 -0
- package/lib/hooks/useBreakpointValue.d.ts +8 -0
- package/lib/hooks/useBreakpointValue.d.ts.map +1 -0
- package/lib/hooks/useBreakpointValue.js +22 -0
- package/lib/hooks/useBreakpointValue.test.d.ts +2 -0
- package/lib/hooks/useBreakpointValue.test.d.ts.map +1 -0
- package/lib/index.cjs +255 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +33 -1
- package/lib/primitive.cjs +45 -0
- package/lib/primitive.d.ts +5 -0
- package/lib/primitive.d.ts.map +1 -1
- package/lib/primitive.js +5 -0
- package/lib/primitives/breakpoint-store.cjs +52 -0
- package/lib/primitives/breakpoint-store.d.ts +7 -0
- package/lib/primitives/breakpoint-store.d.ts.map +1 -0
- package/lib/primitives/breakpoint-store.js +50 -0
- package/lib/providers/BreakpointProvider.cjs +20 -0
- package/lib/providers/BreakpointProvider.d.ts +8 -0
- package/lib/providers/BreakpointProvider.d.ts.map +1 -0
- package/lib/providers/BreakpointProvider.js +19 -0
- package/lib/types/responsive.cjs +7 -0
- package/lib/types/responsive.d.ts +12 -0
- package/lib/types/responsive.d.ts.map +1 -0
- package/lib/types/responsive.js +7 -0
- package/lib/utils/createRenderTrackingContext.cjs +45 -0
- package/lib/utils/createRenderTrackingContext.d.ts +28 -0
- package/lib/utils/createRenderTrackingContext.d.ts.map +1 -0
- package/lib/utils/createRenderTrackingContext.js +44 -0
- package/lib/utils/getHelpBubbleArrowTipPath.cjs +14 -0
- package/lib/utils/getHelpBubbleArrowTipPath.d.ts +7 -0
- package/lib/utils/getHelpBubbleArrowTipPath.d.ts.map +1 -0
- package/lib/utils/getHelpBubbleArrowTipPath.js +14 -0
- package/lib/utils/styled.cjs +49 -75
- package/lib/utils/styled.d.ts +180 -62
- package/lib/utils/styled.d.ts.map +1 -1
- package/lib/utils/styled.js +49 -76
- package/package.json +33 -26
- package/src/components/Accordion/Accordion.namespace.ts +22 -0
- package/src/components/Accordion/Accordion.tsx +119 -0
- package/src/components/Accordion/index.ts +24 -0
- package/src/components/ActionButton/ActionButton.tsx +1 -1
- package/src/components/ActionSheet/ActionSheet.tsx +22 -22
- package/src/components/Article/Article.tsx +1 -1
- package/src/components/AspectRatio/AspectRatio.tsx +2 -2
- package/src/components/AttachmentDisplay/AttachmentDisplay.namespace.ts +57 -0
- package/src/components/AttachmentDisplay/AttachmentDisplay.tsx +165 -0
- package/src/components/AttachmentDisplay/AttachmentDisplayItem.tsx +204 -0
- package/src/components/AttachmentDisplay/AttachmentDisplayTrigger.tsx +82 -0
- package/src/components/AttachmentDisplay/index.ts +59 -0
- package/src/components/AttachmentInput/AttachmentInput.namespace.ts +54 -0
- package/src/components/AttachmentInput/AttachmentInput.test.tsx +161 -0
- package/src/components/AttachmentInput/AttachmentInput.tsx +77 -0
- package/src/components/AttachmentInput/AttachmentInputDropzone.tsx +25 -0
- package/src/components/AttachmentInput/AttachmentInputItem.tsx +246 -0
- package/src/components/AttachmentInput/AttachmentInputTrigger.tsx +85 -0
- package/src/components/AttachmentInput/index.ts +56 -0
- package/src/components/BottomSheet/BottomSheet.tsx +51 -22
- package/src/components/Box/Box.tsx +30 -7
- package/src/components/Checkbox/Checkbox.tsx +3 -31
- package/src/components/ChipTabs/ChipTabs.tsx +0 -6
- package/src/components/Columns/Columns.tsx +4 -3
- package/src/components/ExtendedActionSheet/ExtendedActionSheet.tsx +24 -24
- package/src/components/FieldButton/FieldButton.tsx +36 -8
- package/src/components/Flex/Flex.tsx +5 -3
- package/src/components/Footer/Footer.namespace.ts +4 -0
- package/src/components/Footer/FooterLinkText.tsx +23 -0
- package/src/components/Footer/index.ts +3 -0
- package/src/components/Grid/Grid.tsx +15 -8
- package/src/components/GridItem/GridItem.tsx +3 -2
- package/src/components/HelpBubble/HelpBubble.tsx +2 -5
- package/src/components/HelpBubbleTooltip/HelpBubbleTooltip.namespace.ts +24 -0
- package/src/components/HelpBubbleTooltip/HelpBubbleTooltip.tsx +169 -0
- package/src/components/HelpBubbleTooltip/index.ts +26 -0
- package/src/components/Icon/Icon.tsx +2 -1
- package/src/components/ImageFrame/ImageFrame.test.tsx +1 -3
- package/src/components/ImageFrame/ImageFrame.tsx +29 -35
- package/src/components/Inline/Inline.tsx +2 -1
- package/src/components/Layout/Layout.namespace.ts +6 -0
- package/src/components/Layout/Layout.tsx +21 -0
- package/src/components/Layout/index.ts +8 -0
- package/src/components/List/List.tsx +5 -1
- package/src/components/Menu/Menu.namespace.ts +26 -0
- package/src/components/Menu/Menu.tsx +157 -0
- package/src/components/Menu/index.ts +28 -0
- package/src/components/MenuSheet/MenuSheet.tsx +96 -0
- package/src/components/NavigationMenu/NavigationMenu.namespace.ts +26 -0
- package/src/components/NavigationMenu/NavigationMenu.tsx +172 -0
- package/src/components/NavigationMenu/index.ts +28 -0
- package/src/components/ResponsivePair/ResponsivePair.tsx +13 -7
- package/src/components/ResponsiveSidePanel/ResponsiveSidePanel.namespace.ts +26 -0
- package/src/components/ResponsiveSidePanel/ResponsiveSidePanel.tsx +316 -0
- package/src/components/ResponsiveSidePanel/index.ts +29 -0
- package/src/components/ScrollFog/ScrollFog.tsx +2 -11
- package/src/components/SelectBox/CheckSelectBox.tsx +1 -1
- package/src/components/SideNavigation/SideNavigation.namespace.ts +37 -0
- package/src/components/SideNavigation/SideNavigation.tsx +342 -0
- package/src/components/SideNavigation/index.ts +39 -0
- package/src/components/SidePanel/SidePanel.namespace.ts +24 -0
- package/src/components/SidePanel/SidePanel.tsx +216 -0
- package/src/components/SidePanel/index.ts +26 -0
- package/src/components/Snackbar/Snackbar.tsx +2 -4
- package/src/components/Stack/Stack.tsx +4 -3
- package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.namespace.ts +36 -0
- package/src/components/SwipeableMenuSheet/SwipeableMenuSheet.tsx +269 -0
- package/src/components/SwipeableMenuSheet/index.ts +38 -0
- package/src/components/Switch/Switch.tsx +3 -26
- package/src/components/index.ts +12 -0
- package/src/hooks/useBreakpoint.test.tsx +94 -0
- package/src/hooks/useBreakpoint.ts +24 -0
- package/src/hooks/useBreakpointValue.test.tsx +102 -0
- package/src/hooks/useBreakpointValue.ts +33 -0
- package/src/index.ts +8 -0
- package/src/primitive.ts +5 -0
- package/src/primitives/breakpoint-store.ts +69 -0
- package/src/providers/BreakpointProvider.tsx +26 -0
- package/src/types/responsive.ts +19 -0
- package/src/utils/createRenderTrackingContext.tsx +50 -0
- package/src/utils/getHelpBubbleArrowTipPath.ts +11 -0
- package/src/utils/styled.tsx +387 -268
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { DistributiveOmit } from "../../utils/styled";
|
|
2
3
|
import { Flex, type FlexProps } from "../Flex";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* @deprecated Use `VStack` instead.
|
|
6
7
|
*/
|
|
7
|
-
export
|
|
8
|
+
export type StackProps = DistributiveOmit<FlexProps, "flexDirection">;
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* @deprecated Use `VStack` instead.
|
|
@@ -13,13 +14,13 @@ export const Stack = React.forwardRef<HTMLDivElement, StackProps>((props, ref) =
|
|
|
13
14
|
return <Flex ref={ref} display="flex" flexDirection="column" {...props} />;
|
|
14
15
|
});
|
|
15
16
|
|
|
16
|
-
export
|
|
17
|
+
export type VStackProps = DistributiveOmit<FlexProps, "flexDirection">;
|
|
17
18
|
|
|
18
19
|
export const VStack = React.forwardRef<HTMLDivElement, VStackProps>((props, ref) => {
|
|
19
20
|
return <Flex ref={ref} display="flex" flexDirection="column" {...props} />;
|
|
20
21
|
});
|
|
21
22
|
|
|
22
|
-
export
|
|
23
|
+
export type HStackProps = DistributiveOmit<FlexProps, "flexDirection">;
|
|
23
24
|
|
|
24
25
|
export const HStack = React.forwardRef<HTMLDivElement, HStackProps>((props, ref) => {
|
|
25
26
|
return <Flex ref={ref} display="flex" flexDirection="row" {...props} />;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export {
|
|
2
|
+
SwipeableMenuSheetBackdrop as Backdrop,
|
|
3
|
+
SwipeableMenuSheetPositioner as Positioner,
|
|
4
|
+
SwipeableMenuSheetContent as Content,
|
|
5
|
+
SwipeableMenuSheetHandle as Handle,
|
|
6
|
+
SwipeableMenuSheetCloseButton as CloseButton,
|
|
7
|
+
SwipeableMenuSheetHeader as Header,
|
|
8
|
+
SwipeableMenuSheetRoot as Root,
|
|
9
|
+
SwipeableMenuSheetTitle as Title,
|
|
10
|
+
SwipeableMenuSheetDescription as Description,
|
|
11
|
+
SwipeableMenuSheetTrigger as Trigger,
|
|
12
|
+
SwipeableMenuSheetList as List,
|
|
13
|
+
SwipeableMenuSheetGroup as Group,
|
|
14
|
+
SwipeableMenuSheetFooter as Footer,
|
|
15
|
+
SwipeableMenuSheetItem as Item,
|
|
16
|
+
SwipeableMenuSheetItemContent as ItemContent,
|
|
17
|
+
SwipeableMenuSheetItemLabel as ItemLabel,
|
|
18
|
+
SwipeableMenuSheetItemDescription as ItemDescription,
|
|
19
|
+
type SwipeableMenuSheetBackdropProps as BackdropProps,
|
|
20
|
+
type SwipeableMenuSheetPositionerProps as PositionerProps,
|
|
21
|
+
type SwipeableMenuSheetContentProps as ContentProps,
|
|
22
|
+
type SwipeableMenuSheetHandleProps as HandleProps,
|
|
23
|
+
type SwipeableMenuSheetCloseButtonProps as CloseButtonProps,
|
|
24
|
+
type SwipeableMenuSheetHeaderProps as HeaderProps,
|
|
25
|
+
type SwipeableMenuSheetRootProps as RootProps,
|
|
26
|
+
type SwipeableMenuSheetTitleProps as TitleProps,
|
|
27
|
+
type SwipeableMenuSheetDescriptionProps as DescriptionProps,
|
|
28
|
+
type SwipeableMenuSheetTriggerProps as TriggerProps,
|
|
29
|
+
type SwipeableMenuSheetListProps as ListProps,
|
|
30
|
+
type SwipeableMenuSheetGroupProps as GroupProps,
|
|
31
|
+
type SwipeableMenuSheetFooterProps as FooterProps,
|
|
32
|
+
type SwipeableMenuSheetItemProps as ItemProps,
|
|
33
|
+
type SwipeableMenuSheetItemContentProps as ItemContentProps,
|
|
34
|
+
type SwipeableMenuSheetItemLabelProps as ItemLabelProps,
|
|
35
|
+
type SwipeableMenuSheetItemDescriptionProps as ItemDescriptionProps,
|
|
36
|
+
} from "./SwipeableMenuSheet";
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { bottomSheetHandle } from "@seed-design/css/recipes/bottom-sheet-handle";
|
|
2
|
+
import { menuSheet, type MenuSheetVariantProps } from "@seed-design/css/recipes/menu-sheet";
|
|
3
|
+
import {
|
|
4
|
+
menuSheetItem,
|
|
5
|
+
type MenuSheetItemVariantProps,
|
|
6
|
+
} from "@seed-design/css/recipes/menu-sheet-item";
|
|
7
|
+
import { Drawer } from "@seed-design/react-drawer";
|
|
8
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
9
|
+
import clsx from "clsx";
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
12
|
+
|
|
13
|
+
const { withContext, useClassNames, ClassNamesProvider } = createSlotRecipeContext(menuSheet);
|
|
14
|
+
const {
|
|
15
|
+
PropsProvider: ItemPropsProvider,
|
|
16
|
+
useProps: useItemProps,
|
|
17
|
+
withContext: withItemContext,
|
|
18
|
+
ClassNamesProvider: ItemClassNamesProvider,
|
|
19
|
+
} = createSlotRecipeContext(menuSheetItem);
|
|
20
|
+
|
|
21
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
22
|
+
|
|
23
|
+
// Allowlist only the Drawer props that fit a bottom menu sheet, so the public surface
|
|
24
|
+
// stays stable if Drawer changes or its implementation is swapped later. Intentionally
|
|
25
|
+
// left out: `direction` (forced "bottom" below so the bottom-only recipe transform holds),
|
|
26
|
+
// `dismissible` (no default close button → would trap users), and `modal` (omitted so it
|
|
27
|
+
// stays at Drawer's default `true`, keeping the focus trap and aria-modal contract on the
|
|
28
|
+
// action list).
|
|
29
|
+
export interface SwipeableMenuSheetRootProps
|
|
30
|
+
extends MenuSheetVariantProps,
|
|
31
|
+
Pick<
|
|
32
|
+
Drawer.RootProps,
|
|
33
|
+
| "children"
|
|
34
|
+
| "open"
|
|
35
|
+
| "defaultOpen"
|
|
36
|
+
| "onOpenChange"
|
|
37
|
+
| "closeOnEscape"
|
|
38
|
+
| "closeOnInteractOutside"
|
|
39
|
+
| "lazyMount"
|
|
40
|
+
| "unmountOnExit"
|
|
41
|
+
| "onAnimationEnd"
|
|
42
|
+
> {}
|
|
43
|
+
|
|
44
|
+
// Forces `direction="bottom"` so the bottom-only recipe transform isn't broken.
|
|
45
|
+
export function SwipeableMenuSheetRoot(props: SwipeableMenuSheetRootProps) {
|
|
46
|
+
const [variantProps, otherProps] = menuSheet.splitVariantProps({
|
|
47
|
+
lazyMount: true,
|
|
48
|
+
unmountOnExit: true,
|
|
49
|
+
...props,
|
|
50
|
+
});
|
|
51
|
+
const classNames = menuSheet(variantProps);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<ClassNamesProvider value={classNames}>
|
|
55
|
+
<Drawer.Root {...otherProps} direction="bottom" />
|
|
56
|
+
</ClassNamesProvider>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
61
|
+
|
|
62
|
+
export interface SwipeableMenuSheetTriggerProps extends Drawer.TriggerProps {}
|
|
63
|
+
|
|
64
|
+
export const SwipeableMenuSheetTrigger = Drawer.Trigger;
|
|
65
|
+
|
|
66
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
67
|
+
|
|
68
|
+
export interface SwipeableMenuSheetPositionerProps extends Drawer.PositionerProps {}
|
|
69
|
+
|
|
70
|
+
export const SwipeableMenuSheetPositioner = withContext<
|
|
71
|
+
HTMLDivElement,
|
|
72
|
+
SwipeableMenuSheetPositionerProps
|
|
73
|
+
>(Drawer.Positioner, "positioner");
|
|
74
|
+
|
|
75
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
76
|
+
|
|
77
|
+
export interface SwipeableMenuSheetBackdropProps extends Drawer.BackdropProps {}
|
|
78
|
+
|
|
79
|
+
export const SwipeableMenuSheetBackdrop = withContext<
|
|
80
|
+
HTMLDivElement,
|
|
81
|
+
SwipeableMenuSheetBackdropProps
|
|
82
|
+
>(Drawer.Backdrop, "backdrop");
|
|
83
|
+
|
|
84
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
85
|
+
|
|
86
|
+
export interface SwipeableMenuSheetContentProps
|
|
87
|
+
extends Drawer.ContentProps,
|
|
88
|
+
Pick<MenuSheetItemVariantProps, "labelAlign"> {}
|
|
89
|
+
|
|
90
|
+
export const SwipeableMenuSheetContent = React.forwardRef<
|
|
91
|
+
HTMLDivElement,
|
|
92
|
+
SwipeableMenuSheetContentProps
|
|
93
|
+
>(({ className, ...props }, ref) => {
|
|
94
|
+
const [variantProps, otherProps] = menuSheetItem.splitVariantProps(props);
|
|
95
|
+
const classNames = useClassNames();
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<ItemPropsProvider value={variantProps}>
|
|
99
|
+
<Drawer.Content ref={ref} className={clsx(classNames.content, className)} {...otherProps} />
|
|
100
|
+
</ItemPropsProvider>
|
|
101
|
+
);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
SwipeableMenuSheetContent.displayName = "SwipeableMenuSheetContent";
|
|
105
|
+
|
|
106
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
107
|
+
|
|
108
|
+
// `preventCycle` only applies when snap points are configured, and
|
|
109
|
+
// SwipeableMenuSheet omits snap points from its Root API.
|
|
110
|
+
export interface SwipeableMenuSheetHandleProps
|
|
111
|
+
extends PrimitiveProps,
|
|
112
|
+
Omit<Drawer.HandleProps, "preventCycle"> {}
|
|
113
|
+
|
|
114
|
+
export const SwipeableMenuSheetHandle = React.forwardRef<
|
|
115
|
+
HTMLDivElement,
|
|
116
|
+
SwipeableMenuSheetHandleProps
|
|
117
|
+
>(({ className, ...props }, ref) => {
|
|
118
|
+
const classNames = bottomSheetHandle();
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<Drawer.Handle ref={ref} className={clsx(classNames.root, className)} {...props}>
|
|
122
|
+
<Primitive.div aria-hidden="true" className={classNames.touchArea} />
|
|
123
|
+
</Drawer.Handle>
|
|
124
|
+
);
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
SwipeableMenuSheetHandle.displayName = "SwipeableMenuSheetHandle";
|
|
128
|
+
|
|
129
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
130
|
+
|
|
131
|
+
export interface SwipeableMenuSheetHeaderProps extends Drawer.HeaderProps {}
|
|
132
|
+
|
|
133
|
+
export const SwipeableMenuSheetHeader = withContext<HTMLDivElement, SwipeableMenuSheetHeaderProps>(
|
|
134
|
+
Drawer.Header,
|
|
135
|
+
"header",
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
139
|
+
|
|
140
|
+
export interface SwipeableMenuSheetTitleProps extends Drawer.TitleProps {}
|
|
141
|
+
|
|
142
|
+
export const SwipeableMenuSheetTitle = withContext<
|
|
143
|
+
HTMLHeadingElement,
|
|
144
|
+
SwipeableMenuSheetTitleProps
|
|
145
|
+
>(Drawer.Title, "title");
|
|
146
|
+
|
|
147
|
+
SwipeableMenuSheetTitle.displayName = "SwipeableMenuSheetTitle";
|
|
148
|
+
|
|
149
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
150
|
+
|
|
151
|
+
export interface SwipeableMenuSheetDescriptionProps extends Drawer.DescriptionProps {}
|
|
152
|
+
|
|
153
|
+
export const SwipeableMenuSheetDescription = withContext<
|
|
154
|
+
HTMLParagraphElement,
|
|
155
|
+
SwipeableMenuSheetDescriptionProps
|
|
156
|
+
>(Drawer.Description, "description");
|
|
157
|
+
|
|
158
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
159
|
+
|
|
160
|
+
export interface SwipeableMenuSheetListProps
|
|
161
|
+
extends PrimitiveProps,
|
|
162
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
163
|
+
|
|
164
|
+
export const SwipeableMenuSheetList = withContext<HTMLDivElement, SwipeableMenuSheetListProps>(
|
|
165
|
+
Primitive.div,
|
|
166
|
+
"list",
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
170
|
+
|
|
171
|
+
export interface SwipeableMenuSheetGroupProps
|
|
172
|
+
extends PrimitiveProps,
|
|
173
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
174
|
+
Pick<MenuSheetItemVariantProps, "labelAlign"> {}
|
|
175
|
+
|
|
176
|
+
export const SwipeableMenuSheetGroup = React.forwardRef<
|
|
177
|
+
HTMLDivElement,
|
|
178
|
+
SwipeableMenuSheetGroupProps
|
|
179
|
+
>(({ className, ...props }, ref) => {
|
|
180
|
+
const [variantProps, otherProps] = menuSheetItem.splitVariantProps(props);
|
|
181
|
+
const parentProps = useItemProps();
|
|
182
|
+
const classNames = useClassNames();
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<ItemPropsProvider value={{ ...parentProps, ...variantProps }}>
|
|
186
|
+
<Primitive.div className={clsx(classNames.group, className)} ref={ref} {...otherProps} />
|
|
187
|
+
</ItemPropsProvider>
|
|
188
|
+
);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
SwipeableMenuSheetGroup.displayName = "SwipeableMenuSheetGroup";
|
|
192
|
+
|
|
193
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
194
|
+
|
|
195
|
+
export interface SwipeableMenuSheetItemProps
|
|
196
|
+
extends PrimitiveProps,
|
|
197
|
+
MenuSheetItemVariantProps,
|
|
198
|
+
React.HTMLAttributes<HTMLButtonElement> {}
|
|
199
|
+
|
|
200
|
+
export const SwipeableMenuSheetItem = React.forwardRef<
|
|
201
|
+
HTMLButtonElement,
|
|
202
|
+
SwipeableMenuSheetItemProps
|
|
203
|
+
>(({ className: propClassName, ...props }, ref) => {
|
|
204
|
+
const [variantProps, otherProps] = menuSheetItem.splitVariantProps(props);
|
|
205
|
+
const parentProps = useItemProps();
|
|
206
|
+
const classNames = menuSheetItem({ ...parentProps, ...variantProps });
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<ItemClassNamesProvider value={classNames}>
|
|
210
|
+
<Primitive.button
|
|
211
|
+
ref={ref}
|
|
212
|
+
className={clsx(classNames.root, propClassName)}
|
|
213
|
+
{...otherProps}
|
|
214
|
+
/>
|
|
215
|
+
</ItemClassNamesProvider>
|
|
216
|
+
);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
SwipeableMenuSheetItem.displayName = "SwipeableMenuSheetItem";
|
|
220
|
+
|
|
221
|
+
export interface SwipeableMenuSheetItemContentProps
|
|
222
|
+
extends PrimitiveProps,
|
|
223
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
224
|
+
|
|
225
|
+
export const SwipeableMenuSheetItemContent = withItemContext<
|
|
226
|
+
HTMLDivElement,
|
|
227
|
+
SwipeableMenuSheetItemContentProps
|
|
228
|
+
>(Primitive.div, "content");
|
|
229
|
+
|
|
230
|
+
export interface SwipeableMenuSheetItemLabelProps
|
|
231
|
+
extends PrimitiveProps,
|
|
232
|
+
React.HTMLAttributes<HTMLSpanElement> {}
|
|
233
|
+
|
|
234
|
+
export const SwipeableMenuSheetItemLabel = withItemContext<
|
|
235
|
+
HTMLSpanElement,
|
|
236
|
+
SwipeableMenuSheetItemLabelProps
|
|
237
|
+
>(Primitive.span, "label");
|
|
238
|
+
|
|
239
|
+
export interface SwipeableMenuSheetItemDescriptionProps
|
|
240
|
+
extends PrimitiveProps,
|
|
241
|
+
React.HTMLAttributes<HTMLSpanElement> {}
|
|
242
|
+
|
|
243
|
+
export const SwipeableMenuSheetItemDescription = withItemContext<
|
|
244
|
+
HTMLSpanElement,
|
|
245
|
+
SwipeableMenuSheetItemDescriptionProps
|
|
246
|
+
>(Primitive.span, "description");
|
|
247
|
+
|
|
248
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
249
|
+
|
|
250
|
+
export interface SwipeableMenuSheetFooterProps
|
|
251
|
+
extends PrimitiveProps,
|
|
252
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
253
|
+
|
|
254
|
+
export const SwipeableMenuSheetFooter = withContext<HTMLDivElement, SwipeableMenuSheetFooterProps>(
|
|
255
|
+
Primitive.div,
|
|
256
|
+
"footer",
|
|
257
|
+
);
|
|
258
|
+
|
|
259
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
260
|
+
|
|
261
|
+
export interface SwipeableMenuSheetCloseButtonProps extends Drawer.CloseButtonProps {}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Visible button that closes the swipeable menu sheet.
|
|
265
|
+
*/
|
|
266
|
+
export const SwipeableMenuSheetCloseButton = withContext<
|
|
267
|
+
HTMLButtonElement,
|
|
268
|
+
SwipeableMenuSheetCloseButtonProps
|
|
269
|
+
>(Drawer.CloseButton, "closeButton");
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export {
|
|
2
|
+
SwipeableMenuSheetBackdrop,
|
|
3
|
+
SwipeableMenuSheetPositioner,
|
|
4
|
+
SwipeableMenuSheetContent,
|
|
5
|
+
SwipeableMenuSheetHandle,
|
|
6
|
+
SwipeableMenuSheetCloseButton,
|
|
7
|
+
SwipeableMenuSheetHeader,
|
|
8
|
+
SwipeableMenuSheetRoot,
|
|
9
|
+
SwipeableMenuSheetTitle,
|
|
10
|
+
SwipeableMenuSheetDescription,
|
|
11
|
+
SwipeableMenuSheetTrigger,
|
|
12
|
+
SwipeableMenuSheetList,
|
|
13
|
+
SwipeableMenuSheetGroup,
|
|
14
|
+
SwipeableMenuSheetFooter,
|
|
15
|
+
SwipeableMenuSheetItem,
|
|
16
|
+
SwipeableMenuSheetItemContent,
|
|
17
|
+
SwipeableMenuSheetItemLabel,
|
|
18
|
+
SwipeableMenuSheetItemDescription,
|
|
19
|
+
type SwipeableMenuSheetBackdropProps,
|
|
20
|
+
type SwipeableMenuSheetPositionerProps,
|
|
21
|
+
type SwipeableMenuSheetContentProps,
|
|
22
|
+
type SwipeableMenuSheetHandleProps,
|
|
23
|
+
type SwipeableMenuSheetCloseButtonProps,
|
|
24
|
+
type SwipeableMenuSheetHeaderProps,
|
|
25
|
+
type SwipeableMenuSheetRootProps,
|
|
26
|
+
type SwipeableMenuSheetTitleProps,
|
|
27
|
+
type SwipeableMenuSheetDescriptionProps,
|
|
28
|
+
type SwipeableMenuSheetTriggerProps,
|
|
29
|
+
type SwipeableMenuSheetListProps,
|
|
30
|
+
type SwipeableMenuSheetGroupProps,
|
|
31
|
+
type SwipeableMenuSheetFooterProps,
|
|
32
|
+
type SwipeableMenuSheetItemProps,
|
|
33
|
+
type SwipeableMenuSheetItemContentProps,
|
|
34
|
+
type SwipeableMenuSheetItemLabelProps,
|
|
35
|
+
type SwipeableMenuSheetItemDescriptionProps,
|
|
36
|
+
} from "./SwipeableMenuSheet";
|
|
37
|
+
|
|
38
|
+
export * as SwipeableMenuSheet from "./SwipeableMenuSheet.namespace";
|
|
@@ -18,38 +18,15 @@ const withStateProps = createWithStateProps([useSwitchContext]);
|
|
|
18
18
|
|
|
19
19
|
////////////////////////////////////////////////////////////////////////////////////
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Use `16` or `32` instead of `small` or `medium`.
|
|
23
|
-
*/
|
|
24
|
-
type SwitchVariantDeprecatedSizeProps = "small" | "medium";
|
|
25
|
-
|
|
26
21
|
export interface SwitchRootProps
|
|
27
|
-
extends
|
|
22
|
+
extends SwitchVariantProps,
|
|
28
23
|
Omit<SwitchmarkVariantProps, "size">,
|
|
29
|
-
SwitchPrimitive.RootProps {
|
|
30
|
-
size?: SwitchVariantProps["size"] | SwitchVariantDeprecatedSizeProps;
|
|
31
|
-
}
|
|
24
|
+
SwitchPrimitive.RootProps {}
|
|
32
25
|
|
|
33
26
|
export const SwitchRoot = React.forwardRef<HTMLLabelElement, SwitchRootProps>(
|
|
34
27
|
({ className, ...props }, ref) => {
|
|
35
|
-
if (
|
|
36
|
-
process.env.NODE_ENV !== "production" &&
|
|
37
|
-
(props.size === "small" || props.size === "medium")
|
|
38
|
-
) {
|
|
39
|
-
console.warn(
|
|
40
|
-
`[SEED Design System] Switch size='${props.size}' is deprecated and will be removed in @seed-design/react@2.0.0. Use size='${props.size === "small" ? "16" : "32"}' instead.`,
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
28
|
const [{ switch: switchVariantProps, switchmark: switchmarkVariantProps }, otherProps] =
|
|
45
|
-
splitMultipleVariantsProps(
|
|
46
|
-
{
|
|
47
|
-
...props,
|
|
48
|
-
// TODO: replace this mapping completely
|
|
49
|
-
size: props.size === "small" ? "16" : props.size === "medium" ? "32" : props.size,
|
|
50
|
-
},
|
|
51
|
-
{ switchmark, switch: switchStyle },
|
|
52
|
-
);
|
|
29
|
+
splitMultipleVariantsProps(props, { switchmark, switch: switchStyle });
|
|
53
30
|
|
|
54
31
|
const classNames = switchStyle(switchVariantProps);
|
|
55
32
|
|
package/src/components/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./Accordion";
|
|
1
2
|
export * from "./ActionButton";
|
|
2
3
|
export * from "./ActionChip";
|
|
3
4
|
export * from "./ActionSheet";
|
|
@@ -26,23 +27,30 @@ export * from "./Fab";
|
|
|
26
27
|
export * from "./Field";
|
|
27
28
|
export * from "./FieldButton";
|
|
28
29
|
export * from "./Fieldset";
|
|
30
|
+
export * from "./AttachmentDisplay";
|
|
31
|
+
export * from "./AttachmentInput";
|
|
29
32
|
export * from "./Flex";
|
|
30
33
|
export * from "./Float";
|
|
31
34
|
export * from "./FloatingActionButton";
|
|
35
|
+
export * from "./Footer";
|
|
32
36
|
export * from "./Grid";
|
|
33
37
|
export * from "./GridItem";
|
|
34
38
|
export * from "./HelpBubble";
|
|
39
|
+
export * from "./HelpBubbleTooltip";
|
|
35
40
|
export * from "./Icon";
|
|
36
41
|
export * from "./IdentityPlaceholder";
|
|
37
42
|
export * from "./ImageFrame";
|
|
38
43
|
export * from "./Inline";
|
|
39
44
|
export * from "./InlineBanner";
|
|
45
|
+
export * from "./Layout";
|
|
40
46
|
export * from "./LinkContent";
|
|
41
47
|
export * from "./List";
|
|
42
48
|
export * from "./LoadingIndicator";
|
|
43
49
|
export * from "./MannerTemp";
|
|
44
50
|
export * from "./MannerTempBadge";
|
|
51
|
+
export * from "./Menu";
|
|
45
52
|
export * from "./MenuSheet";
|
|
53
|
+
export * from "./NavigationMenu";
|
|
46
54
|
export * from "./NotificationBadge";
|
|
47
55
|
export * from "./PageBanner";
|
|
48
56
|
export * from "./Portal";
|
|
@@ -52,13 +60,17 @@ export * from "./RadioGroup";
|
|
|
52
60
|
export * from "./RadioGroupField";
|
|
53
61
|
export * from "./ReactionButton";
|
|
54
62
|
export * from "./ResponsivePair";
|
|
63
|
+
export * from "./ResponsiveSidePanel";
|
|
55
64
|
export * from "./ScrollFog";
|
|
56
65
|
export * from "./SegmentedControl";
|
|
57
66
|
export * from "./SelectBox";
|
|
67
|
+
export * from "./SideNavigation";
|
|
68
|
+
export * from "./SidePanel";
|
|
58
69
|
export * from "./Skeleton";
|
|
59
70
|
export * from "./Slider";
|
|
60
71
|
export * from "./Snackbar";
|
|
61
72
|
export * from "./Stack";
|
|
73
|
+
export * from "./SwipeableMenuSheet";
|
|
62
74
|
export * from "./Switch";
|
|
63
75
|
export * from "./Tabs";
|
|
64
76
|
export * from "./TagGroup";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { act, renderHook } from "@testing-library/react";
|
|
2
|
+
import { beforeEach, describe, expect, it, mock } from "bun:test";
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { BreakpointProvider } from "../providers/BreakpointProvider";
|
|
6
|
+
import { useBreakpoint } from "./useBreakpoint";
|
|
7
|
+
|
|
8
|
+
type ChangeHandler = (e: { matches: boolean }) => void;
|
|
9
|
+
|
|
10
|
+
let currentWidth = 0;
|
|
11
|
+
const entries = new Map<string, { minWidth: number; handlers: Set<ChangeHandler> }>();
|
|
12
|
+
|
|
13
|
+
function mockMatchMedia(query: string) {
|
|
14
|
+
const match = query.match(/min-width:\s*(\d+)px/);
|
|
15
|
+
const minWidth = match ? Number(match[1]) : 0;
|
|
16
|
+
const entry = entries.get(query) ?? { minWidth, handlers: new Set<ChangeHandler>() };
|
|
17
|
+
entries.set(query, entry);
|
|
18
|
+
return {
|
|
19
|
+
get matches() {
|
|
20
|
+
return currentWidth >= entry.minWidth;
|
|
21
|
+
},
|
|
22
|
+
media: query,
|
|
23
|
+
addEventListener(_: string, handler: ChangeHandler) {
|
|
24
|
+
entry.handlers.add(handler);
|
|
25
|
+
},
|
|
26
|
+
removeEventListener(_: string, handler: ChangeHandler) {
|
|
27
|
+
entry.handlers.delete(handler);
|
|
28
|
+
},
|
|
29
|
+
onchange: null,
|
|
30
|
+
addListener: mock(),
|
|
31
|
+
removeListener: mock(),
|
|
32
|
+
dispatchEvent: () => false,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function setViewport(minWidthPx: number) {
|
|
37
|
+
currentWidth = minWidthPx;
|
|
38
|
+
for (const [, entry] of entries) {
|
|
39
|
+
const nowMatches = currentWidth >= entry.minWidth;
|
|
40
|
+
for (const handler of entry.handlers) {
|
|
41
|
+
handler({ matches: nowMatches });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
beforeEach(() => {
|
|
47
|
+
currentWidth = 0;
|
|
48
|
+
entries.clear();
|
|
49
|
+
window.matchMedia = mockMatchMedia as unknown as typeof window.matchMedia;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe("useBreakpoint", () => {
|
|
53
|
+
it("returns 'base' when no media query matches", () => {
|
|
54
|
+
const { result } = renderHook(() => useBreakpoint());
|
|
55
|
+
expect(result.current).toBe("base");
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("returns 'md' when viewport is 768px", () => {
|
|
59
|
+
currentWidth = 768;
|
|
60
|
+
const { result } = renderHook(() => useBreakpoint());
|
|
61
|
+
expect(result.current).toBe("md");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("returns the largest matching breakpoint", () => {
|
|
65
|
+
currentWidth = 1440;
|
|
66
|
+
const { result } = renderHook(() => useBreakpoint());
|
|
67
|
+
expect(result.current).toBe("xl");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("updates when viewport changes", () => {
|
|
71
|
+
const { result } = renderHook(() => useBreakpoint());
|
|
72
|
+
expect(result.current).toBe("base");
|
|
73
|
+
|
|
74
|
+
act(() => setViewport(768));
|
|
75
|
+
expect(result.current).toBe("md");
|
|
76
|
+
|
|
77
|
+
act(() => setViewport(1280));
|
|
78
|
+
expect(result.current).toBe("lg");
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("respects defaultBreakpoint option", () => {
|
|
82
|
+
const { result } = renderHook(() => useBreakpoint({ defaultBreakpoint: "lg" }));
|
|
83
|
+
expect(result.current).toBe("base");
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("uses BreakpointProvider context when wrapped", () => {
|
|
87
|
+
currentWidth = 768;
|
|
88
|
+
const wrapper = ({ children }: { children: React.ReactNode }) => (
|
|
89
|
+
<BreakpointProvider>{children}</BreakpointProvider>
|
|
90
|
+
);
|
|
91
|
+
const { result } = renderHook(() => useBreakpoint(), { wrapper });
|
|
92
|
+
expect(result.current).toBe("md");
|
|
93
|
+
});
|
|
94
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Breakpoint } from "@seed-design/css/breakpoints";
|
|
2
|
+
import { createContext, useContext, useSyncExternalStore } from "react";
|
|
3
|
+
|
|
4
|
+
import * as store from "../primitives/breakpoint-store";
|
|
5
|
+
|
|
6
|
+
export interface UseBreakpointOptions {
|
|
7
|
+
defaultBreakpoint?: Breakpoint;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface BreakpointContextValue {
|
|
11
|
+
breakpoint: Breakpoint;
|
|
12
|
+
defaultBreakpoint: Breakpoint;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const BreakpointContext = createContext<BreakpointContextValue | null>(null);
|
|
16
|
+
|
|
17
|
+
export function useBreakpoint(options?: UseBreakpointOptions): Breakpoint {
|
|
18
|
+
const ctx = useContext(BreakpointContext);
|
|
19
|
+
const defaultBp = options?.defaultBreakpoint ?? ctx?.defaultBreakpoint ?? "base";
|
|
20
|
+
|
|
21
|
+
const storeBreakpoint = useSyncExternalStore(store.subscribe, store.getSnapshot, () => defaultBp);
|
|
22
|
+
|
|
23
|
+
return ctx ? ctx.breakpoint : storeBreakpoint;
|
|
24
|
+
}
|