@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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { act, renderHook } from "@testing-library/react";
|
|
2
|
+
import { beforeEach, describe, expect, it, mock } from "bun:test";
|
|
3
|
+
|
|
4
|
+
import { useBreakpointValue } from "./useBreakpointValue";
|
|
5
|
+
|
|
6
|
+
type ChangeHandler = (e: { matches: boolean }) => void;
|
|
7
|
+
|
|
8
|
+
let currentWidth = 0;
|
|
9
|
+
const entries = new Map<string, { minWidth: number; handlers: Set<ChangeHandler> }>();
|
|
10
|
+
|
|
11
|
+
function mockMatchMedia(query: string) {
|
|
12
|
+
const match = query.match(/min-width:\s*(\d+)px/);
|
|
13
|
+
const minWidth = match ? Number(match[1]) : 0;
|
|
14
|
+
const entry = entries.get(query) ?? { minWidth, handlers: new Set<ChangeHandler>() };
|
|
15
|
+
entries.set(query, entry);
|
|
16
|
+
return {
|
|
17
|
+
get matches() {
|
|
18
|
+
return currentWidth >= entry.minWidth;
|
|
19
|
+
},
|
|
20
|
+
media: query,
|
|
21
|
+
addEventListener(_: string, handler: ChangeHandler) {
|
|
22
|
+
entry.handlers.add(handler);
|
|
23
|
+
},
|
|
24
|
+
removeEventListener(_: string, handler: ChangeHandler) {
|
|
25
|
+
entry.handlers.delete(handler);
|
|
26
|
+
},
|
|
27
|
+
onchange: null,
|
|
28
|
+
addListener: mock(),
|
|
29
|
+
removeListener: mock(),
|
|
30
|
+
dispatchEvent: () => false,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function setViewport(minWidthPx: number) {
|
|
35
|
+
currentWidth = minWidthPx;
|
|
36
|
+
for (const [, entry] of entries) {
|
|
37
|
+
const nowMatches = currentWidth >= entry.minWidth;
|
|
38
|
+
for (const handler of entry.handlers) {
|
|
39
|
+
handler({ matches: nowMatches });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
beforeEach(() => {
|
|
45
|
+
currentWidth = 0;
|
|
46
|
+
entries.clear();
|
|
47
|
+
window.matchMedia = mockMatchMedia as unknown as typeof window.matchMedia;
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
describe("useBreakpointValue", () => {
|
|
51
|
+
it("passes through a single value", () => {
|
|
52
|
+
const { result } = renderHook(() => useBreakpointValue(42));
|
|
53
|
+
expect(result.current).toBe(42);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("passes through a string value", () => {
|
|
57
|
+
const { result } = renderHook(() => useBreakpointValue("hello"));
|
|
58
|
+
expect(result.current).toBe("hello");
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("resolves base value at base breakpoint", () => {
|
|
62
|
+
const { result } = renderHook(() => useBreakpointValue({ base: 1, md: 2, xl: 4 }));
|
|
63
|
+
expect(result.current).toBe(1);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("falls back to base when current breakpoint has no value", () => {
|
|
67
|
+
currentWidth = 480; // sm
|
|
68
|
+
const { result } = renderHook(() => useBreakpointValue({ base: 1, md: 2 }));
|
|
69
|
+
// sm is not defined, falls back to base
|
|
70
|
+
expect(result.current).toBe(1);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("resolves md value at md breakpoint", () => {
|
|
74
|
+
currentWidth = 768;
|
|
75
|
+
const { result } = renderHook(() => useBreakpointValue({ base: 1, md: 2, xl: 4 }));
|
|
76
|
+
expect(result.current).toBe(2);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
it("falls back to md at lg when lg is not defined", () => {
|
|
80
|
+
currentWidth = 1280; // lg
|
|
81
|
+
const { result } = renderHook(() => useBreakpointValue({ base: 1, md: 2, xl: 4 }));
|
|
82
|
+
// lg not defined, falls back to md
|
|
83
|
+
expect(result.current).toBe(2);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("resolves xl value at xl breakpoint", () => {
|
|
87
|
+
currentWidth = 1440;
|
|
88
|
+
const { result } = renderHook(() => useBreakpointValue({ base: 1, md: 2, xl: 4 }));
|
|
89
|
+
expect(result.current).toBe(4);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("updates when viewport changes", () => {
|
|
93
|
+
const { result } = renderHook(() => useBreakpointValue({ base: "compact", md: "full" }));
|
|
94
|
+
expect(result.current).toBe("compact");
|
|
95
|
+
|
|
96
|
+
act(() => setViewport(768));
|
|
97
|
+
expect(result.current).toBe("full");
|
|
98
|
+
|
|
99
|
+
act(() => setViewport(0));
|
|
100
|
+
expect(result.current).toBe("compact");
|
|
101
|
+
});
|
|
102
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Breakpoint, breakpointNames } from "@seed-design/css/breakpoints";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
|
|
4
|
+
import type { ResponsiveValue } from "../types/responsive";
|
|
5
|
+
import { isResponsiveObject } from "../types/responsive";
|
|
6
|
+
import { type UseBreakpointOptions, useBreakpoint } from "./useBreakpoint";
|
|
7
|
+
|
|
8
|
+
export function resolveResponsiveValue<T>(
|
|
9
|
+
values: { [K in Breakpoint]?: T },
|
|
10
|
+
breakpoint: Breakpoint,
|
|
11
|
+
): T | undefined {
|
|
12
|
+
const idx = breakpointNames.indexOf(breakpoint);
|
|
13
|
+
for (let i = idx; i >= 0; i--) {
|
|
14
|
+
const val = values[breakpointNames[i]];
|
|
15
|
+
|
|
16
|
+
if (val !== undefined) return val;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function useBreakpointValue<T>(
|
|
23
|
+
values: ResponsiveValue<T>,
|
|
24
|
+
options?: UseBreakpointOptions,
|
|
25
|
+
): T | undefined {
|
|
26
|
+
const breakpoint = useBreakpoint(options);
|
|
27
|
+
|
|
28
|
+
return useMemo(() => {
|
|
29
|
+
if (!isResponsiveObject(values)) return values;
|
|
30
|
+
|
|
31
|
+
return resolveResponsiveValue(values, breakpoint);
|
|
32
|
+
}, [values, breakpoint]);
|
|
33
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export * from "./components";
|
|
2
2
|
|
|
3
|
+
export type { ResponsiveValue, UnwrapResponsive, BreakpointThreshold } from "./types/responsive";
|
|
4
|
+
|
|
5
|
+
export { useBreakpoint } from "./hooks/useBreakpoint";
|
|
6
|
+
export type { UseBreakpointOptions } from "./hooks/useBreakpoint";
|
|
7
|
+
export { useBreakpointValue } from "./hooks/useBreakpointValue";
|
|
8
|
+
export { BreakpointProvider } from "./providers/BreakpointProvider";
|
|
9
|
+
export type { BreakpointProviderProps } from "./providers/BreakpointProvider";
|
|
10
|
+
|
|
3
11
|
// unstable_StyleProps is unstable and will be changed or removed without prior notice
|
|
4
12
|
export type { StyleProps as unstable_StyleProps } from "./utils/styled";
|
package/src/primitive.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
export * from "@seed-design/react-attachment-display";
|
|
1
2
|
export * from "@seed-design/react-avatar";
|
|
2
3
|
export * from "@seed-design/react-checkbox";
|
|
3
4
|
export * from "@seed-design/react-dialog";
|
|
5
|
+
export * from "@seed-design/react-file-upload";
|
|
6
|
+
export * from "@seed-design/react-middle-truncate";
|
|
7
|
+
export * from "@seed-design/react-navigation-menu";
|
|
4
8
|
export * from "@seed-design/react-popover";
|
|
5
9
|
export * from "@seed-design/react-progress";
|
|
6
10
|
export * from "@seed-design/react-pull-to-refresh";
|
|
7
11
|
export * from "@seed-design/react-radio-group";
|
|
12
|
+
export * from "@seed-design/react-side-navigation";
|
|
8
13
|
export * from "@seed-design/react-slider";
|
|
9
14
|
export * from "@seed-design/react-snackbar";
|
|
10
15
|
export * from "@seed-design/react-switch";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type Breakpoint, breakpointNames, mediaQueries } from "@seed-design/css/breakpoints";
|
|
2
|
+
|
|
3
|
+
type Listener = () => void;
|
|
4
|
+
|
|
5
|
+
const thresholds = breakpointNames.filter(
|
|
6
|
+
(name): name is Exclude<Breakpoint, "base"> => name !== "base",
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
let listeners: Set<Listener> | null = null;
|
|
10
|
+
let mediaQueryLists: MediaQueryList[] | null = null;
|
|
11
|
+
let currentBreakpoint: Breakpoint = "base";
|
|
12
|
+
|
|
13
|
+
function computeBreakpoint(): Breakpoint {
|
|
14
|
+
if (!mediaQueryLists) return "base";
|
|
15
|
+
for (let i = thresholds.length - 1; i >= 0; i--) {
|
|
16
|
+
if (mediaQueryLists[i].matches) return thresholds[i];
|
|
17
|
+
}
|
|
18
|
+
return "base";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function handleChange() {
|
|
22
|
+
const next = computeBreakpoint();
|
|
23
|
+
if (next !== currentBreakpoint) {
|
|
24
|
+
currentBreakpoint = next;
|
|
25
|
+
for (const fn of listeners ?? []) fn();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function init() {
|
|
30
|
+
mediaQueryLists = thresholds.map((name) => window.matchMedia(mediaQueries[name]));
|
|
31
|
+
currentBreakpoint = computeBreakpoint();
|
|
32
|
+
for (const mql of mediaQueryLists) {
|
|
33
|
+
mql.addEventListener("change", handleChange);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function teardown() {
|
|
38
|
+
if (mediaQueryLists) {
|
|
39
|
+
for (const mql of mediaQueryLists) {
|
|
40
|
+
mql.removeEventListener("change", handleChange);
|
|
41
|
+
}
|
|
42
|
+
mediaQueryLists = null;
|
|
43
|
+
}
|
|
44
|
+
currentBreakpoint = "base";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function subscribe(listener: Listener): () => void {
|
|
48
|
+
if (!listeners) {
|
|
49
|
+
listeners = new Set();
|
|
50
|
+
init();
|
|
51
|
+
}
|
|
52
|
+
listeners.add(listener);
|
|
53
|
+
|
|
54
|
+
return () => {
|
|
55
|
+
listeners?.delete(listener);
|
|
56
|
+
if (listeners?.size === 0) {
|
|
57
|
+
teardown();
|
|
58
|
+
listeners = null;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function getSnapshot(): Breakpoint {
|
|
64
|
+
return currentBreakpoint;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function getServerSnapshot(): Breakpoint {
|
|
68
|
+
return "base";
|
|
69
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Breakpoint } from "@seed-design/css/breakpoints";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
import { useMemo, useSyncExternalStore } from "react";
|
|
4
|
+
|
|
5
|
+
import { BreakpointContext } from "../hooks/useBreakpoint";
|
|
6
|
+
import * as store from "../primitives/breakpoint-store";
|
|
7
|
+
|
|
8
|
+
export interface BreakpointProviderProps {
|
|
9
|
+
defaultBreakpoint?: Breakpoint;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function BreakpointProvider({
|
|
14
|
+
defaultBreakpoint = "base",
|
|
15
|
+
children,
|
|
16
|
+
}: BreakpointProviderProps) {
|
|
17
|
+
const breakpoint = useSyncExternalStore(
|
|
18
|
+
store.subscribe,
|
|
19
|
+
store.getSnapshot,
|
|
20
|
+
() => defaultBreakpoint,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const value = useMemo(() => ({ breakpoint, defaultBreakpoint }), [breakpoint, defaultBreakpoint]);
|
|
24
|
+
|
|
25
|
+
return <BreakpointContext.Provider value={value}>{children}</BreakpointContext.Provider>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Breakpoint } from "@seed-design/css/breakpoints";
|
|
2
|
+
|
|
3
|
+
// Before: `T | { [K in Breakpoint]?: T }`
|
|
4
|
+
// When T is an object (e.g. ButtonProps), union excess property check is weak
|
|
5
|
+
// and allows mixing T's keys with Breakpoint keys without error.
|
|
6
|
+
// The intersection with `never`-mapped keys forces TypeScript to reject the mix.
|
|
7
|
+
type ResponsiveObject<T> = { [K in Breakpoint]?: T } & (T extends object
|
|
8
|
+
? { [K in Exclude<keyof T & string, Breakpoint>]?: never }
|
|
9
|
+
: {});
|
|
10
|
+
|
|
11
|
+
export type ResponsiveValue<T> = T | ResponsiveObject<T>;
|
|
12
|
+
|
|
13
|
+
export type UnwrapResponsive<T> = T extends ResponsiveValue<infer U> ? U : T;
|
|
14
|
+
|
|
15
|
+
export type BreakpointThreshold = Exclude<Breakpoint, "base">;
|
|
16
|
+
|
|
17
|
+
export function isResponsiveObject<T>(value: ResponsiveValue<T>): value is ResponsiveObject<T> {
|
|
18
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createContext, useCallback, useContext, useMemo, useState } from "react";
|
|
2
|
+
|
|
3
|
+
interface RenderTrackingContextValue {
|
|
4
|
+
/** Whether the tracked sibling element is currently rendered. */
|
|
5
|
+
isRendered: boolean;
|
|
6
|
+
/** Ref callback the tracked element composes onto its node to register that it is rendered. */
|
|
7
|
+
trackRef: (node: HTMLElement | null) => void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Tracks whether an optional sub-component is rendered, so a sibling slot can emit a
|
|
12
|
+
* styling-only data-attribute (e.g. `data-show-close-button`, `data-has-overlay`).
|
|
13
|
+
*
|
|
14
|
+
* This lives in the styled `@seed-design/react` layer on purpose: the attribute exists
|
|
15
|
+
* solely to drive a `@seed-design/css` selector, so the styled layer — which already holds
|
|
16
|
+
* the version contract with css — owns it, rather than leaking a css↔headless contract.
|
|
17
|
+
*
|
|
18
|
+
* Unrelated to `@seed-design/react-presence`: that handles enter/exit animation, whereas
|
|
19
|
+
* this only records whether a sibling is in the tree.
|
|
20
|
+
*/
|
|
21
|
+
export function createRenderTrackingContext(name: string) {
|
|
22
|
+
const RenderTrackingContext = createContext<RenderTrackingContextValue | null>(null);
|
|
23
|
+
|
|
24
|
+
function Provider({ children }: { children: React.ReactNode }) {
|
|
25
|
+
const [isRendered, setIsRendered] = useState(false);
|
|
26
|
+
const trackRef = useCallback((node: HTMLElement | null) => {
|
|
27
|
+
setIsRendered(!!node);
|
|
28
|
+
}, []);
|
|
29
|
+
|
|
30
|
+
const value = useMemo<RenderTrackingContextValue>(
|
|
31
|
+
() => ({ isRendered, trackRef }),
|
|
32
|
+
[isRendered, trackRef],
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<RenderTrackingContext.Provider value={value}>{children}</RenderTrackingContext.Provider>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
Provider.displayName = `${name}RenderTrackingProvider`;
|
|
40
|
+
|
|
41
|
+
function useRenderTracking() {
|
|
42
|
+
const context = useContext(RenderTrackingContext);
|
|
43
|
+
if (context === null) {
|
|
44
|
+
throw new Error(`use${name}RenderTracking must be used within ${name}RenderTrackingProvider`);
|
|
45
|
+
}
|
|
46
|
+
return context;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return { Provider, useRenderTracking };
|
|
50
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the SVG path for a HelpBubble arrow tip given its measured size.
|
|
3
|
+
* Shared by HelpBubble (dialog) and HelpBubbleTooltip (tooltip) so the arrow
|
|
4
|
+
* geometry stays in a single place.
|
|
5
|
+
*/
|
|
6
|
+
export const getHelpBubbleArrowTipPath = (width: number, height: number, tipRadius: number) =>
|
|
7
|
+
`M0,0
|
|
8
|
+
H${width}
|
|
9
|
+
L${width / 2 + tipRadius},${height - tipRadius}
|
|
10
|
+
Q${width / 2},${height} ${width / 2 - tipRadius},${height - tipRadius}
|
|
11
|
+
Z`;
|