@seed-design/react 1.2.15 → 2.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 +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 +3 -2
- package/lib/components/ImageFrame/ImageFrame.d.ts +3 -8
- package/lib/components/ImageFrame/ImageFrame.d.ts.map +1 -1
- package/lib/components/ImageFrame/ImageFrame.js +3 -2
- 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/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 +25 -23
- 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/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,342 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SideNavigation as SideNavigationPrimitive,
|
|
3
|
+
SideNavigationItemProvider as ItemProviderPrimitive,
|
|
4
|
+
useCollapsibleContext,
|
|
5
|
+
useSideNavigationContext,
|
|
6
|
+
useSideNavigationItem,
|
|
7
|
+
useSideNavigationItemContext,
|
|
8
|
+
type UseSideNavigationItemProps,
|
|
9
|
+
type SideNavigationProviderProps as SideNavigationProviderPrimitiveProps,
|
|
10
|
+
} from "@seed-design/react-side-navigation";
|
|
11
|
+
import {
|
|
12
|
+
sideNavigation,
|
|
13
|
+
type SideNavigationVariantProps,
|
|
14
|
+
} from "@seed-design/css/recipes/side-navigation";
|
|
15
|
+
import {
|
|
16
|
+
sideNavigationInset,
|
|
17
|
+
type SideNavigationInsetVariantProps,
|
|
18
|
+
} from "@seed-design/css/recipes/side-navigation-inset";
|
|
19
|
+
import {
|
|
20
|
+
sideNavigationMenuItem,
|
|
21
|
+
type SideNavigationMenuItemVariantProps,
|
|
22
|
+
} from "@seed-design/css/recipes/side-navigation-menu-item";
|
|
23
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
24
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
25
|
+
import { createRecipeContext } from "../../utils/createRecipeContext";
|
|
26
|
+
import { InternalIcon, type InternalIconProps } from "../private/Icon";
|
|
27
|
+
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
28
|
+
import { mediaQueries } from "@seed-design/css/breakpoints";
|
|
29
|
+
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
30
|
+
import React from "react";
|
|
31
|
+
import clsx from "clsx";
|
|
32
|
+
import { dataAttr } from "@seed-design/dom-utils";
|
|
33
|
+
|
|
34
|
+
const { withProvider, withContext, useClassNames } = createSlotRecipeContext(sideNavigation);
|
|
35
|
+
const { ClassNamesProvider: ItemClassNamesProvider, withContext: withItemContext } =
|
|
36
|
+
createSlotRecipeContext(sideNavigationMenuItem);
|
|
37
|
+
const { withContext: withInsetContext } = createRecipeContext(sideNavigationInset);
|
|
38
|
+
|
|
39
|
+
const withSideNavigationStateProps = createWithStateProps([useSideNavigationContext]);
|
|
40
|
+
const withItemStateProps = createWithStateProps([
|
|
41
|
+
useSideNavigationContext,
|
|
42
|
+
{ useContext: useSideNavigationItemContext, strict: false },
|
|
43
|
+
]);
|
|
44
|
+
const withItemSlotCollapsibleStateProps = createWithStateProps([
|
|
45
|
+
useSideNavigationContext,
|
|
46
|
+
{ useContext: useSideNavigationItemContext, strict: false },
|
|
47
|
+
{ useContext: useCollapsibleContext, strict: false },
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
51
|
+
|
|
52
|
+
function ResponsiveCollapseEffect() {
|
|
53
|
+
const { setCollapsed } = useSideNavigationContext();
|
|
54
|
+
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
const mql = window.matchMedia(mediaQueries.lg);
|
|
57
|
+
|
|
58
|
+
const handler = (e: MediaQueryListEvent) => {
|
|
59
|
+
setCollapsed(!e.matches);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
mql.addEventListener("change", handler);
|
|
63
|
+
return () => mql.removeEventListener("change", handler);
|
|
64
|
+
}, [setCollapsed]);
|
|
65
|
+
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface SideNavigationProviderProps extends SideNavigationProviderPrimitiveProps {}
|
|
70
|
+
|
|
71
|
+
export function SideNavigationProvider(props: SideNavigationProviderProps) {
|
|
72
|
+
return (
|
|
73
|
+
<SideNavigationPrimitive.Provider {...props}>
|
|
74
|
+
<ResponsiveCollapseEffect />
|
|
75
|
+
{props.children}
|
|
76
|
+
</SideNavigationPrimitive.Provider>
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
SideNavigationProvider.displayName = "SideNavigationProvider";
|
|
81
|
+
|
|
82
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
83
|
+
|
|
84
|
+
export interface SideNavigationRootProps
|
|
85
|
+
extends SideNavigationVariantProps,
|
|
86
|
+
SideNavigationPrimitive.RootProps {}
|
|
87
|
+
|
|
88
|
+
export const SideNavigationRoot = withProvider<HTMLElement, SideNavigationRootProps>(
|
|
89
|
+
SideNavigationPrimitive.Root,
|
|
90
|
+
"root",
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
SideNavigationRoot.displayName = "SideNavigationRoot";
|
|
94
|
+
|
|
95
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
96
|
+
|
|
97
|
+
export interface SideNavigationHeaderProps
|
|
98
|
+
extends PrimitiveProps,
|
|
99
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
100
|
+
|
|
101
|
+
export const SideNavigationHeader = withContext<HTMLDivElement, SideNavigationHeaderProps>(
|
|
102
|
+
withSideNavigationStateProps(Primitive.div),
|
|
103
|
+
"header",
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
SideNavigationHeader.displayName = "SideNavigationHeader";
|
|
107
|
+
|
|
108
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
109
|
+
|
|
110
|
+
export interface SideNavigationContentProps
|
|
111
|
+
extends PrimitiveProps,
|
|
112
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
113
|
+
|
|
114
|
+
export const SideNavigationContent = React.forwardRef<HTMLDivElement, SideNavigationContentProps>(
|
|
115
|
+
({ className, ...props }, forwardedRef) => {
|
|
116
|
+
const classNames = useClassNames();
|
|
117
|
+
const { stateProps } = useSideNavigationContext();
|
|
118
|
+
const ref = React.useRef<HTMLDivElement>(null);
|
|
119
|
+
const [scrolled, setScrolled] = React.useState(false);
|
|
120
|
+
|
|
121
|
+
React.useEffect(() => {
|
|
122
|
+
const element = ref.current;
|
|
123
|
+
if (!element) return;
|
|
124
|
+
|
|
125
|
+
const check = () => setScrolled(element.scrollTop > 0);
|
|
126
|
+
check();
|
|
127
|
+
|
|
128
|
+
element.addEventListener("scroll", check);
|
|
129
|
+
|
|
130
|
+
const observer = new ResizeObserver(check);
|
|
131
|
+
observer.observe(element);
|
|
132
|
+
|
|
133
|
+
return () => {
|
|
134
|
+
element.removeEventListener("scroll", check);
|
|
135
|
+
observer.disconnect();
|
|
136
|
+
};
|
|
137
|
+
}, []);
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<Primitive.div
|
|
141
|
+
ref={composeRefs(ref, forwardedRef)}
|
|
142
|
+
className={clsx(classNames.content, className)}
|
|
143
|
+
{...{ "data-scrolled": dataAttr(scrolled) }}
|
|
144
|
+
{...stateProps}
|
|
145
|
+
{...props}
|
|
146
|
+
/>
|
|
147
|
+
);
|
|
148
|
+
},
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
SideNavigationContent.displayName = "SideNavigationContent";
|
|
152
|
+
|
|
153
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
154
|
+
|
|
155
|
+
export interface SideNavigationFooterProps
|
|
156
|
+
extends PrimitiveProps,
|
|
157
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
158
|
+
|
|
159
|
+
export const SideNavigationFooter = withContext<HTMLDivElement, SideNavigationFooterProps>(
|
|
160
|
+
withSideNavigationStateProps(Primitive.div),
|
|
161
|
+
"footer",
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
SideNavigationFooter.displayName = "SideNavigationFooter";
|
|
165
|
+
|
|
166
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
167
|
+
|
|
168
|
+
export interface SideNavigationGroupProps
|
|
169
|
+
extends PrimitiveProps,
|
|
170
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
171
|
+
|
|
172
|
+
export const SideNavigationGroup = withContext<HTMLDivElement, SideNavigationGroupProps>(
|
|
173
|
+
withSideNavigationStateProps(Primitive.div),
|
|
174
|
+
"group",
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
SideNavigationGroup.displayName = "SideNavigationGroup";
|
|
178
|
+
|
|
179
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
180
|
+
|
|
181
|
+
export interface SideNavigationGroupLabelProps
|
|
182
|
+
extends PrimitiveProps,
|
|
183
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
184
|
+
|
|
185
|
+
export const SideNavigationGroupLabel = withContext<HTMLDivElement, SideNavigationGroupLabelProps>(
|
|
186
|
+
withSideNavigationStateProps(Primitive.div),
|
|
187
|
+
"groupLabel",
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
SideNavigationGroupLabel.displayName = "SideNavigationGroupLabel";
|
|
191
|
+
|
|
192
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
193
|
+
|
|
194
|
+
export interface SideNavigationItemProps
|
|
195
|
+
extends SideNavigationMenuItemVariantProps,
|
|
196
|
+
UseSideNavigationItemProps,
|
|
197
|
+
PrimitiveProps,
|
|
198
|
+
React.HTMLAttributes<HTMLButtonElement> {}
|
|
199
|
+
|
|
200
|
+
export const SideNavigationItem = React.forwardRef<HTMLButtonElement, SideNavigationItemProps>(
|
|
201
|
+
({ current, disabled, className, ...props }, ref) => {
|
|
202
|
+
const [variantProps, restProps] = sideNavigationMenuItem.splitVariantProps(props);
|
|
203
|
+
const classNames = sideNavigationMenuItem(variantProps);
|
|
204
|
+
|
|
205
|
+
const { stateProps: sideNavStateProps } = useSideNavigationContext();
|
|
206
|
+
const api = useSideNavigationItem({ current, disabled });
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<ItemProviderPrimitive value={api}>
|
|
210
|
+
<ItemClassNamesProvider value={classNames}>
|
|
211
|
+
<Primitive.button
|
|
212
|
+
className={clsx(classNames.root, className)}
|
|
213
|
+
ref={ref}
|
|
214
|
+
{...restProps}
|
|
215
|
+
{...sideNavStateProps}
|
|
216
|
+
{...api.rootProps}
|
|
217
|
+
/>
|
|
218
|
+
</ItemClassNamesProvider>
|
|
219
|
+
</ItemProviderPrimitive>
|
|
220
|
+
);
|
|
221
|
+
},
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
SideNavigationItem.displayName = "SideNavigationItem";
|
|
225
|
+
|
|
226
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
227
|
+
|
|
228
|
+
export interface SideNavigationItemLabelProps
|
|
229
|
+
extends PrimitiveProps,
|
|
230
|
+
React.HTMLAttributes<HTMLSpanElement> {}
|
|
231
|
+
|
|
232
|
+
export const SideNavigationItemLabel = withItemContext<
|
|
233
|
+
HTMLSpanElement,
|
|
234
|
+
SideNavigationItemLabelProps
|
|
235
|
+
>(withItemStateProps(Primitive.span), "label");
|
|
236
|
+
|
|
237
|
+
SideNavigationItemLabel.displayName = "SideNavigationItemLabel";
|
|
238
|
+
|
|
239
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
240
|
+
|
|
241
|
+
export interface SideNavigationItemPrefixIconProps extends InternalIconProps {}
|
|
242
|
+
|
|
243
|
+
export const SideNavigationItemPrefixIcon = withItemContext<
|
|
244
|
+
SVGSVGElement,
|
|
245
|
+
SideNavigationItemPrefixIconProps
|
|
246
|
+
>(withItemStateProps(InternalIcon), "prefixIcon");
|
|
247
|
+
|
|
248
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
249
|
+
|
|
250
|
+
export interface SideNavigationItemSuffixIconProps extends InternalIconProps {}
|
|
251
|
+
|
|
252
|
+
export const SideNavigationItemSuffixIcon = withItemContext<
|
|
253
|
+
SVGSVGElement,
|
|
254
|
+
SideNavigationItemSuffixIconProps
|
|
255
|
+
>(withItemSlotCollapsibleStateProps(InternalIcon), "suffixIcon");
|
|
256
|
+
|
|
257
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
258
|
+
|
|
259
|
+
export interface SideNavigationItemCollapsibleRootProps
|
|
260
|
+
extends SideNavigationMenuItemVariantProps,
|
|
261
|
+
SideNavigationPrimitive.ItemCollapsibleRootProps {}
|
|
262
|
+
|
|
263
|
+
export const SideNavigationItemCollapsibleRoot = React.forwardRef<
|
|
264
|
+
HTMLDivElement,
|
|
265
|
+
SideNavigationItemCollapsibleRootProps
|
|
266
|
+
>(({ children, ...props }, ref) => {
|
|
267
|
+
const [variantProps, restProps] = sideNavigationMenuItem.splitVariantProps(props);
|
|
268
|
+
const classNames = sideNavigationMenuItem(variantProps);
|
|
269
|
+
|
|
270
|
+
return (
|
|
271
|
+
<ItemClassNamesProvider value={classNames}>
|
|
272
|
+
<SideNavigationPrimitive.ItemCollapsibleRoot ref={ref} {...restProps}>
|
|
273
|
+
{children}
|
|
274
|
+
</SideNavigationPrimitive.ItemCollapsibleRoot>
|
|
275
|
+
</ItemClassNamesProvider>
|
|
276
|
+
);
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
SideNavigationItemCollapsibleRoot.displayName = "SideNavigationItemCollapsibleRoot";
|
|
280
|
+
|
|
281
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
282
|
+
|
|
283
|
+
export interface SideNavigationItemCollapsibleTriggerProps
|
|
284
|
+
extends UseSideNavigationItemProps,
|
|
285
|
+
SideNavigationPrimitive.ItemCollapsibleTriggerProps {}
|
|
286
|
+
|
|
287
|
+
export const SideNavigationItemCollapsibleTrigger = React.forwardRef<
|
|
288
|
+
HTMLButtonElement,
|
|
289
|
+
SideNavigationItemCollapsibleTriggerProps
|
|
290
|
+
>(({ current, disabled, className, ...props }, ref) => {
|
|
291
|
+
const classNames = sideNavigationMenuItem();
|
|
292
|
+
const { stateProps: sideNavStateProps } = useSideNavigationContext();
|
|
293
|
+
const api = useSideNavigationItem({ current, disabled });
|
|
294
|
+
|
|
295
|
+
return (
|
|
296
|
+
<ItemProviderPrimitive value={api}>
|
|
297
|
+
<SideNavigationPrimitive.ItemCollapsibleTrigger
|
|
298
|
+
ref={ref}
|
|
299
|
+
className={clsx(classNames.root, className)}
|
|
300
|
+
{...sideNavStateProps}
|
|
301
|
+
{...api.stateProps}
|
|
302
|
+
{...props}
|
|
303
|
+
/>
|
|
304
|
+
</ItemProviderPrimitive>
|
|
305
|
+
);
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
SideNavigationItemCollapsibleTrigger.displayName = "SideNavigationItemCollapsibleTrigger";
|
|
309
|
+
|
|
310
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
311
|
+
|
|
312
|
+
export interface SideNavigationItemCollapsibleContentProps
|
|
313
|
+
extends SideNavigationPrimitive.ItemCollapsibleContentProps {}
|
|
314
|
+
|
|
315
|
+
export const SideNavigationItemCollapsibleContent = withItemContext<
|
|
316
|
+
HTMLDivElement,
|
|
317
|
+
SideNavigationItemCollapsibleContentProps
|
|
318
|
+
>(SideNavigationPrimitive.ItemCollapsibleContent, "panel");
|
|
319
|
+
|
|
320
|
+
SideNavigationItemCollapsibleContent.displayName = "SideNavigationItemCollapsibleContent";
|
|
321
|
+
|
|
322
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
323
|
+
|
|
324
|
+
export interface SideNavigationTriggerProps extends SideNavigationPrimitive.TriggerProps {}
|
|
325
|
+
|
|
326
|
+
export const SideNavigationTrigger = withContext<HTMLButtonElement, SideNavigationTriggerProps>(
|
|
327
|
+
SideNavigationPrimitive.Trigger,
|
|
328
|
+
"trigger",
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
SideNavigationTrigger.displayName = "SideNavigationTrigger";
|
|
332
|
+
|
|
333
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
334
|
+
|
|
335
|
+
export interface SideNavigationInsetProps
|
|
336
|
+
extends SideNavigationInsetVariantProps,
|
|
337
|
+
PrimitiveProps,
|
|
338
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
339
|
+
|
|
340
|
+
export const SideNavigationInset = withInsetContext<HTMLDivElement, SideNavigationInsetProps>(
|
|
341
|
+
Primitive.div,
|
|
342
|
+
);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export {
|
|
2
|
+
SideNavigationRoot,
|
|
3
|
+
SideNavigationHeader,
|
|
4
|
+
SideNavigationContent,
|
|
5
|
+
SideNavigationFooter,
|
|
6
|
+
SideNavigationGroup,
|
|
7
|
+
SideNavigationGroupLabel,
|
|
8
|
+
SideNavigationItem,
|
|
9
|
+
SideNavigationItemLabel,
|
|
10
|
+
SideNavigationItemPrefixIcon,
|
|
11
|
+
SideNavigationItemSuffixIcon,
|
|
12
|
+
SideNavigationItemCollapsibleRoot,
|
|
13
|
+
SideNavigationItemCollapsibleTrigger,
|
|
14
|
+
SideNavigationItemCollapsibleContent,
|
|
15
|
+
SideNavigationTrigger,
|
|
16
|
+
SideNavigationInset,
|
|
17
|
+
type SideNavigationRootProps,
|
|
18
|
+
type SideNavigationHeaderProps,
|
|
19
|
+
type SideNavigationContentProps,
|
|
20
|
+
type SideNavigationFooterProps,
|
|
21
|
+
type SideNavigationGroupProps,
|
|
22
|
+
type SideNavigationGroupLabelProps,
|
|
23
|
+
type SideNavigationItemProps,
|
|
24
|
+
type SideNavigationItemLabelProps,
|
|
25
|
+
type SideNavigationItemPrefixIconProps,
|
|
26
|
+
type SideNavigationItemSuffixIconProps,
|
|
27
|
+
type SideNavigationItemCollapsibleRootProps,
|
|
28
|
+
type SideNavigationItemCollapsibleTriggerProps,
|
|
29
|
+
type SideNavigationItemCollapsibleContentProps,
|
|
30
|
+
type SideNavigationTriggerProps,
|
|
31
|
+
type SideNavigationInsetProps,
|
|
32
|
+
} from "./SideNavigation";
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
SideNavigationProvider,
|
|
36
|
+
type SideNavigationProviderProps,
|
|
37
|
+
} from "./SideNavigation";
|
|
38
|
+
|
|
39
|
+
export * as SideNavigation from "./SideNavigation.namespace";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export {
|
|
2
|
+
SidePanelBackdrop as Backdrop,
|
|
3
|
+
SidePanelBody as Body,
|
|
4
|
+
SidePanelContent as Content,
|
|
5
|
+
SidePanelDescription as Description,
|
|
6
|
+
SidePanelFooter as Footer,
|
|
7
|
+
SidePanelHeader as Header,
|
|
8
|
+
SidePanelPositioner as Positioner,
|
|
9
|
+
SidePanelRoot as Root,
|
|
10
|
+
SidePanelTitle as Title,
|
|
11
|
+
SidePanelTrigger as Trigger,
|
|
12
|
+
SidePanelCloseButton as CloseButton,
|
|
13
|
+
type SidePanelBackdropProps as BackdropProps,
|
|
14
|
+
type SidePanelBodyProps as BodyProps,
|
|
15
|
+
type SidePanelContentProps as ContentProps,
|
|
16
|
+
type SidePanelDescriptionProps as DescriptionProps,
|
|
17
|
+
type SidePanelFooterProps as FooterProps,
|
|
18
|
+
type SidePanelHeaderProps as HeaderProps,
|
|
19
|
+
type SidePanelPositionerProps as PositionerProps,
|
|
20
|
+
type SidePanelRootProps as RootProps,
|
|
21
|
+
type SidePanelTitleProps as TitleProps,
|
|
22
|
+
type SidePanelTriggerProps as TriggerProps,
|
|
23
|
+
type SidePanelCloseButtonProps as CloseButtonProps,
|
|
24
|
+
} from "./SidePanel";
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { sidePanel, type SidePanelVariantProps } from "@seed-design/css/recipes/side-panel";
|
|
2
|
+
import { Drawer } from "@seed-design/react-drawer";
|
|
3
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
4
|
+
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
5
|
+
import { dataAttr } from "@seed-design/dom-utils";
|
|
6
|
+
import clsx from "clsx";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { createRenderTrackingContext } from "../../utils/createRenderTrackingContext";
|
|
9
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
10
|
+
import { useStyleProps, withStyleProps, type StyleProps } from "../../utils/styled";
|
|
11
|
+
|
|
12
|
+
const { withContext, useClassNames, ClassNamesProvider } = createSlotRecipeContext(sidePanel);
|
|
13
|
+
|
|
14
|
+
const closeButtonTracker = createRenderTrackingContext("SidePanelCloseButton");
|
|
15
|
+
|
|
16
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
17
|
+
|
|
18
|
+
export interface SidePanelRootProps
|
|
19
|
+
extends SidePanelVariantProps,
|
|
20
|
+
Pick<
|
|
21
|
+
Drawer.RootProps,
|
|
22
|
+
| "children"
|
|
23
|
+
| "open"
|
|
24
|
+
| "defaultOpen"
|
|
25
|
+
| "onOpenChange"
|
|
26
|
+
| "modal"
|
|
27
|
+
| "dismissible"
|
|
28
|
+
| "closeOnEscape"
|
|
29
|
+
| "closeOnInteractOutside"
|
|
30
|
+
| "lazyMount"
|
|
31
|
+
| "unmountOnExit"
|
|
32
|
+
| "onAnimationEnd"
|
|
33
|
+
> {
|
|
34
|
+
/** Direction the side panel slides in from. @default "right" */
|
|
35
|
+
direction?: "left" | "right";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function SidePanelRoot(props: SidePanelRootProps) {
|
|
39
|
+
const [variantProps, otherProps] = sidePanel.splitVariantProps({
|
|
40
|
+
direction: "right" as const,
|
|
41
|
+
lazyMount: true,
|
|
42
|
+
unmountOnExit: true,
|
|
43
|
+
...props,
|
|
44
|
+
});
|
|
45
|
+
const classNames = sidePanel(variantProps);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<ClassNamesProvider value={classNames}>
|
|
49
|
+
<closeButtonTracker.Provider>
|
|
50
|
+
<Drawer.Root {...otherProps} />
|
|
51
|
+
</closeButtonTracker.Provider>
|
|
52
|
+
</ClassNamesProvider>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
57
|
+
|
|
58
|
+
export interface SidePanelTriggerProps extends Drawer.TriggerProps {}
|
|
59
|
+
|
|
60
|
+
export const SidePanelTrigger = Drawer.Trigger;
|
|
61
|
+
|
|
62
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
63
|
+
|
|
64
|
+
export interface SidePanelPositionerProps extends Drawer.PositionerProps {}
|
|
65
|
+
|
|
66
|
+
export const SidePanelPositioner = withContext<HTMLDivElement, SidePanelPositionerProps>(
|
|
67
|
+
Drawer.Positioner,
|
|
68
|
+
"positioner",
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
72
|
+
|
|
73
|
+
export interface SidePanelBackdropProps extends Drawer.BackdropProps {}
|
|
74
|
+
|
|
75
|
+
export const SidePanelBackdrop = withContext<HTMLDivElement, SidePanelBackdropProps>(
|
|
76
|
+
Drawer.Backdrop,
|
|
77
|
+
"backdrop",
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
81
|
+
|
|
82
|
+
export interface SidePanelContentProps
|
|
83
|
+
extends Drawer.ContentProps,
|
|
84
|
+
Pick<StyleProps, "width" | "maxWidth"> {}
|
|
85
|
+
|
|
86
|
+
export const SidePanelContent = withContext<HTMLDivElement, SidePanelContentProps>(
|
|
87
|
+
withStyleProps(Drawer.Content),
|
|
88
|
+
"content",
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
92
|
+
|
|
93
|
+
export interface SidePanelHeaderProps extends Drawer.HeaderProps {}
|
|
94
|
+
|
|
95
|
+
export const SidePanelHeader = React.forwardRef<HTMLDivElement, SidePanelHeaderProps>(
|
|
96
|
+
({ className, ...props }, ref) => {
|
|
97
|
+
const classNames = useClassNames();
|
|
98
|
+
const { isRendered } = closeButtonTracker.useRenderTracking();
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<Drawer.Header
|
|
102
|
+
ref={ref}
|
|
103
|
+
data-show-close-button={dataAttr(isRendered)}
|
|
104
|
+
className={clsx(classNames.header, className)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
);
|
|
108
|
+
},
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
SidePanelHeader.displayName = "SidePanelHeader";
|
|
112
|
+
|
|
113
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
114
|
+
|
|
115
|
+
export interface SidePanelTitleProps extends Drawer.TitleProps {}
|
|
116
|
+
|
|
117
|
+
export const SidePanelTitle = withContext<HTMLHeadingElement, SidePanelTitleProps>(
|
|
118
|
+
Drawer.Title,
|
|
119
|
+
"title",
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
SidePanelTitle.displayName = "SidePanelTitle";
|
|
123
|
+
|
|
124
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
125
|
+
|
|
126
|
+
export interface SidePanelDescriptionProps extends Drawer.DescriptionProps {}
|
|
127
|
+
|
|
128
|
+
export const SidePanelDescription = withContext<HTMLParagraphElement, SidePanelDescriptionProps>(
|
|
129
|
+
Drawer.Description,
|
|
130
|
+
"description",
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
SidePanelDescription.displayName = "SidePanelDescription";
|
|
134
|
+
|
|
135
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
136
|
+
|
|
137
|
+
export interface SidePanelBodyProps
|
|
138
|
+
extends PrimitiveProps,
|
|
139
|
+
Pick<
|
|
140
|
+
StyleProps,
|
|
141
|
+
"paddingX" | "height" | "maxHeight" | "minHeight" | "justifyContent" | "alignItems"
|
|
142
|
+
>,
|
|
143
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
144
|
+
|
|
145
|
+
export const SidePanelBody = React.forwardRef<HTMLDivElement, SidePanelBodyProps>(
|
|
146
|
+
(props, forwardedRef) => {
|
|
147
|
+
const classNames = useClassNames();
|
|
148
|
+
const { style, restProps } = useStyleProps(props);
|
|
149
|
+
const { className, ...otherProps } = restProps;
|
|
150
|
+
|
|
151
|
+
const ref = React.useRef<HTMLDivElement>(null);
|
|
152
|
+
const [scrolled, setScrolled] = React.useState(false);
|
|
153
|
+
|
|
154
|
+
React.useEffect(() => {
|
|
155
|
+
const element = ref.current;
|
|
156
|
+
if (!element) return;
|
|
157
|
+
|
|
158
|
+
const check = () => setScrolled(element.scrollTop > 0);
|
|
159
|
+
check();
|
|
160
|
+
|
|
161
|
+
element.addEventListener("scroll", check);
|
|
162
|
+
|
|
163
|
+
const observer = new ResizeObserver(check);
|
|
164
|
+
observer.observe(element);
|
|
165
|
+
|
|
166
|
+
return () => {
|
|
167
|
+
element.removeEventListener("scroll", check);
|
|
168
|
+
observer.disconnect();
|
|
169
|
+
};
|
|
170
|
+
}, []);
|
|
171
|
+
|
|
172
|
+
return (
|
|
173
|
+
<Primitive.div
|
|
174
|
+
ref={composeRefs(ref, forwardedRef)}
|
|
175
|
+
className={clsx(classNames.body, className)}
|
|
176
|
+
style={style}
|
|
177
|
+
{...{ "data-scrolled": dataAttr(scrolled) }}
|
|
178
|
+
{...otherProps}
|
|
179
|
+
/>
|
|
180
|
+
);
|
|
181
|
+
},
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
SidePanelBody.displayName = "SidePanelBody";
|
|
185
|
+
|
|
186
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
187
|
+
|
|
188
|
+
export interface SidePanelFooterProps
|
|
189
|
+
extends PrimitiveProps,
|
|
190
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
191
|
+
|
|
192
|
+
export const SidePanelFooter = withContext<HTMLDivElement, SidePanelFooterProps>(
|
|
193
|
+
Primitive.div,
|
|
194
|
+
"footer",
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
198
|
+
|
|
199
|
+
export interface SidePanelCloseButtonProps extends Drawer.CloseButtonProps {}
|
|
200
|
+
|
|
201
|
+
export const SidePanelCloseButton = React.forwardRef<HTMLButtonElement, SidePanelCloseButtonProps>(
|
|
202
|
+
({ className, ...props }, ref) => {
|
|
203
|
+
const classNames = useClassNames();
|
|
204
|
+
const { trackRef } = closeButtonTracker.useRenderTracking();
|
|
205
|
+
|
|
206
|
+
return (
|
|
207
|
+
<Drawer.CloseButton
|
|
208
|
+
ref={composeRefs(ref, trackRef)}
|
|
209
|
+
className={clsx(classNames.closeButton, className)}
|
|
210
|
+
{...props}
|
|
211
|
+
/>
|
|
212
|
+
);
|
|
213
|
+
},
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
SidePanelCloseButton.displayName = "SidePanelCloseButton";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export {
|
|
2
|
+
SidePanelBackdrop,
|
|
3
|
+
SidePanelBody,
|
|
4
|
+
SidePanelContent,
|
|
5
|
+
SidePanelDescription,
|
|
6
|
+
SidePanelFooter,
|
|
7
|
+
SidePanelHeader,
|
|
8
|
+
SidePanelPositioner,
|
|
9
|
+
SidePanelRoot,
|
|
10
|
+
SidePanelTitle,
|
|
11
|
+
SidePanelTrigger,
|
|
12
|
+
SidePanelCloseButton,
|
|
13
|
+
type SidePanelBackdropProps,
|
|
14
|
+
type SidePanelBodyProps,
|
|
15
|
+
type SidePanelContentProps,
|
|
16
|
+
type SidePanelDescriptionProps,
|
|
17
|
+
type SidePanelFooterProps,
|
|
18
|
+
type SidePanelHeaderProps,
|
|
19
|
+
type SidePanelPositionerProps,
|
|
20
|
+
type SidePanelRootProps,
|
|
21
|
+
type SidePanelTitleProps,
|
|
22
|
+
type SidePanelTriggerProps,
|
|
23
|
+
type SidePanelCloseButtonProps,
|
|
24
|
+
} from "./SidePanel";
|
|
25
|
+
|
|
26
|
+
export * as SidePanel from "./SidePanel.namespace";
|
|
@@ -67,12 +67,10 @@ export const SnackbarPrefixIcon = withContext<HTMLDivElement, SnackbarPrefixIcon
|
|
|
67
67
|
|
|
68
68
|
////////////////////////////////////////////////////////////////////////////////////
|
|
69
69
|
|
|
70
|
-
export interface SnackbarActionButtonProps
|
|
71
|
-
extends PrimitiveProps,
|
|
72
|
-
React.HTMLAttributes<HTMLButtonElement> {}
|
|
70
|
+
export interface SnackbarActionButtonProps extends SnackbarPrimitive.ActionButtonProps {}
|
|
73
71
|
|
|
74
72
|
export const SnackbarActionButton = withContext<HTMLButtonElement, SnackbarActionButtonProps>(
|
|
75
|
-
|
|
73
|
+
SnackbarPrimitive.ActionButton,
|
|
76
74
|
"actionButton",
|
|
77
75
|
);
|
|
78
76
|
|