@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,161 @@
|
|
|
1
|
+
import { render } from "@testing-library/react";
|
|
2
|
+
import { describe, expect, it } from "bun:test";
|
|
3
|
+
import type { ReactElement } from "react";
|
|
4
|
+
|
|
5
|
+
import { Field } from "@seed-design/react-field";
|
|
6
|
+
import { AttachmentInputRoot, AttachmentInputHiddenInput } from "./AttachmentInput";
|
|
7
|
+
|
|
8
|
+
function setUp(jsx: ReactElement) {
|
|
9
|
+
return render(jsx);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
describe("AttachmentInput", () => {
|
|
13
|
+
describe("props merging", () => {
|
|
14
|
+
describe("AttachmentInputHiddenInput", () => {
|
|
15
|
+
it("should merge props from AttachmentInputRoot", () => {
|
|
16
|
+
const { getByTestId } = setUp(
|
|
17
|
+
<AttachmentInputRoot name="attachment">
|
|
18
|
+
<AttachmentInputHiddenInput data-testid="hidden-input" />
|
|
19
|
+
</AttachmentInputRoot>,
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const input = getByTestId("hidden-input") as HTMLInputElement;
|
|
23
|
+
expect(input.getAttribute("name")).toBe("attachment");
|
|
24
|
+
expect(input.getAttribute("type")).toBe("file");
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("should merge props from Field context", () => {
|
|
28
|
+
const { getByTestId } = setUp(
|
|
29
|
+
<Field.Root required invalid disabled name="field-attachment">
|
|
30
|
+
<AttachmentInputRoot>
|
|
31
|
+
<AttachmentInputHiddenInput data-testid="hidden-input" />
|
|
32
|
+
</AttachmentInputRoot>
|
|
33
|
+
</Field.Root>,
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const input = getByTestId("hidden-input") as HTMLInputElement;
|
|
37
|
+
expect(input.getAttribute("name")).toBe("field-attachment");
|
|
38
|
+
expect(input.getAttribute("aria-required")).toBe("true");
|
|
39
|
+
expect(input.getAttribute("aria-invalid")).toBe("true");
|
|
40
|
+
expect(input).toBeDisabled();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("should prioritize direct props over context props", () => {
|
|
44
|
+
const { getByTestId } = setUp(
|
|
45
|
+
<Field.Root name="field-name">
|
|
46
|
+
<AttachmentInputRoot>
|
|
47
|
+
<AttachmentInputHiddenInput name="direct-name" data-testid="hidden-input" />
|
|
48
|
+
</AttachmentInputRoot>
|
|
49
|
+
</Field.Root>,
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const input = getByTestId("hidden-input") as HTMLInputElement;
|
|
53
|
+
expect(input.getAttribute("name")).toBe("direct-name");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("should get id from Field context", () => {
|
|
57
|
+
const { getByTestId } = setUp(
|
|
58
|
+
<Field.Root>
|
|
59
|
+
<AttachmentInputRoot>
|
|
60
|
+
<AttachmentInputHiddenInput data-testid="hidden-input" />
|
|
61
|
+
</AttachmentInputRoot>
|
|
62
|
+
</Field.Root>,
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const input = getByTestId("hidden-input") as HTMLInputElement;
|
|
66
|
+
expect(input.getAttribute("id")).toBeTruthy();
|
|
67
|
+
expect(input.getAttribute("id")).toContain("field:");
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it("should have no id without Field context", () => {
|
|
71
|
+
const { getByTestId } = setUp(
|
|
72
|
+
<AttachmentInputRoot>
|
|
73
|
+
<AttachmentInputHiddenInput data-testid="hidden-input" />
|
|
74
|
+
</AttachmentInputRoot>,
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const input = getByTestId("hidden-input") as HTMLInputElement;
|
|
78
|
+
expect(input.getAttribute("id")).toBeNull();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("should connect aria-describedby when Field has Description", () => {
|
|
82
|
+
const { getByTestId } = setUp(
|
|
83
|
+
<Field.Root>
|
|
84
|
+
<AttachmentInputRoot>
|
|
85
|
+
<AttachmentInputHiddenInput data-testid="hidden-input" />
|
|
86
|
+
</AttachmentInputRoot>
|
|
87
|
+
<Field.Description>Upload your files</Field.Description>
|
|
88
|
+
</Field.Root>,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
const input = getByTestId("hidden-input") as HTMLInputElement;
|
|
92
|
+
expect(input.getAttribute("aria-describedby")).toBeTruthy();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it("should connect aria-describedby when Field has ErrorMessage", () => {
|
|
96
|
+
const { getByTestId } = setUp(
|
|
97
|
+
<Field.Root invalid>
|
|
98
|
+
<AttachmentInputRoot>
|
|
99
|
+
<AttachmentInputHiddenInput data-testid="hidden-input" />
|
|
100
|
+
</AttachmentInputRoot>
|
|
101
|
+
<Field.ErrorMessage>File too large</Field.ErrorMessage>
|
|
102
|
+
</Field.Root>,
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const input = getByTestId("hidden-input") as HTMLInputElement;
|
|
106
|
+
expect(input.getAttribute("aria-describedby")).toBeTruthy();
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
describe("Complex prop merging scenarios", () => {
|
|
111
|
+
it("should handle nested Field and AttachmentInput contexts", () => {
|
|
112
|
+
const { getByTestId } = setUp(
|
|
113
|
+
<Field.Root required name="attachment" invalid>
|
|
114
|
+
<Field.Label>Attachment</Field.Label>
|
|
115
|
+
<AttachmentInputRoot>
|
|
116
|
+
<AttachmentInputHiddenInput data-testid="hidden-input" />
|
|
117
|
+
</AttachmentInputRoot>
|
|
118
|
+
<Field.Description>Max 10MB</Field.Description>
|
|
119
|
+
</Field.Root>,
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const input = getByTestId("hidden-input") as HTMLInputElement;
|
|
123
|
+
expect(input.getAttribute("name")).toBe("attachment");
|
|
124
|
+
expect(input.getAttribute("aria-required")).toBe("true");
|
|
125
|
+
expect(input.getAttribute("aria-invalid")).toBe("true");
|
|
126
|
+
expect(input.getAttribute("aria-describedby")).toBeTruthy();
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it("should let Field disabled override AttachmentInput enabled", () => {
|
|
130
|
+
const { getByTestId } = setUp(
|
|
131
|
+
<Field.Root disabled>
|
|
132
|
+
<AttachmentInputRoot>
|
|
133
|
+
<AttachmentInputHiddenInput data-testid="hidden-input" />
|
|
134
|
+
</AttachmentInputRoot>
|
|
135
|
+
</Field.Root>,
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
const input = getByTestId("hidden-input") as HTMLInputElement;
|
|
139
|
+
expect(input).toBeDisabled();
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it("should not put aria-readonly on the hidden input even when Field is read-only", () => {
|
|
143
|
+
// aria-readonly is invalid on <input type="file"> per ARIA 1.2 — it's only valid on
|
|
144
|
+
// textbox/spinbutton/checkbox/switch/slider/etc. Field spreads aria-readonly to every
|
|
145
|
+
// child input, so AttachmentInputHiddenInput has to strip it.
|
|
146
|
+
const { getByTestId } = setUp(
|
|
147
|
+
<Field.Root readOnly>
|
|
148
|
+
<AttachmentInputRoot>
|
|
149
|
+
<AttachmentInputHiddenInput data-testid="hidden-input" />
|
|
150
|
+
</AttachmentInputRoot>
|
|
151
|
+
</Field.Root>,
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
const input = getByTestId("hidden-input") as HTMLInputElement;
|
|
155
|
+
expect(input.getAttribute("aria-readonly")).toBeNull();
|
|
156
|
+
// hidden input itself stays enabled so the form value is preserved when read-only
|
|
157
|
+
expect(input.disabled).toBe(false);
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {
|
|
5
|
+
attachmentInput,
|
|
6
|
+
type AttachmentInputVariantProps,
|
|
7
|
+
} from "@seed-design/css/recipes/attachment-input";
|
|
8
|
+
import {
|
|
9
|
+
FileUpload as FileUploadPrimitive,
|
|
10
|
+
useFileUploadContext,
|
|
11
|
+
} from "@seed-design/react-file-upload";
|
|
12
|
+
|
|
13
|
+
import { useFieldContext } from "@seed-design/react-field";
|
|
14
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
15
|
+
import { mergeProps } from "@seed-design/dom-utils";
|
|
16
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
17
|
+
import { createWithStateProps } from "../../utils/createWithStateProps";
|
|
18
|
+
|
|
19
|
+
export const { withProvider, withContext } = createSlotRecipeContext(attachmentInput);
|
|
20
|
+
|
|
21
|
+
const withStateProps = createWithStateProps([useFileUploadContext]);
|
|
22
|
+
|
|
23
|
+
export interface AttachmentInputRootProps
|
|
24
|
+
extends AttachmentInputVariantProps,
|
|
25
|
+
FileUploadPrimitive.RootProps {}
|
|
26
|
+
|
|
27
|
+
export const AttachmentInputRoot = withProvider<HTMLDivElement, AttachmentInputRootProps>(
|
|
28
|
+
FileUploadPrimitive.Root,
|
|
29
|
+
"root",
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export interface AttachmentInputContainerProps
|
|
33
|
+
extends PrimitiveProps,
|
|
34
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
35
|
+
|
|
36
|
+
export const AttachmentInputContainer = withContext<HTMLDivElement, AttachmentInputContainerProps>(
|
|
37
|
+
withStateProps(Primitive.div),
|
|
38
|
+
"container",
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export interface AttachmentInputHiddenInputProps extends FileUploadPrimitive.HiddenInputProps {}
|
|
42
|
+
|
|
43
|
+
export const AttachmentInputHiddenInput = React.forwardRef<
|
|
44
|
+
HTMLInputElement,
|
|
45
|
+
AttachmentInputHiddenInputProps
|
|
46
|
+
>((props, ref) => {
|
|
47
|
+
const fileUploadContext = useFileUploadContext();
|
|
48
|
+
const fieldContext = useFieldContext({ strict: false });
|
|
49
|
+
|
|
50
|
+
const mergedProps = mergeProps(
|
|
51
|
+
fieldContext ? fieldContext.inputAriaAttributes : {},
|
|
52
|
+
fileUploadContext.hiddenInputProps,
|
|
53
|
+
fieldContext ? fieldContext.inputProps : {},
|
|
54
|
+
props,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
// aria-readonly is invalid on <input type="file"> per ARIA 1.2 (only valid on
|
|
58
|
+
// textbox/spinbutton/checkbox/switch/slider/etc), but Field spreads it onto every
|
|
59
|
+
// child input. Strip it here so we keep Field's other aria attributes intact.
|
|
60
|
+
const { "aria-readonly": _ariaReadOnly, ...rest } = mergedProps;
|
|
61
|
+
|
|
62
|
+
return <FileUploadPrimitive.HiddenInput ref={ref} {...rest} />;
|
|
63
|
+
});
|
|
64
|
+
AttachmentInputHiddenInput.displayName = "AttachmentInputHiddenInput";
|
|
65
|
+
|
|
66
|
+
export interface AttachmentInputItemGroupProps
|
|
67
|
+
extends PrimitiveProps,
|
|
68
|
+
React.HTMLAttributes<HTMLUListElement> {}
|
|
69
|
+
|
|
70
|
+
export const AttachmentInputItemGroup = withContext<
|
|
71
|
+
HTMLUListElement,
|
|
72
|
+
AttachmentInputItemGroupProps
|
|
73
|
+
>(withStateProps(Primitive.ul), "itemGroup");
|
|
74
|
+
|
|
75
|
+
export interface AttachmentInputContextProps extends FileUploadPrimitive.ContextProps {}
|
|
76
|
+
|
|
77
|
+
export const AttachmentInputContext = FileUploadPrimitive.Context;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
import { FileUpload as FileUploadPrimitive } from "@seed-design/react-file-upload";
|
|
5
|
+
|
|
6
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
7
|
+
import { withContext } from "./AttachmentInput";
|
|
8
|
+
|
|
9
|
+
export interface AttachmentInputDropzoneProps
|
|
10
|
+
extends PrimitiveProps,
|
|
11
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
12
|
+
|
|
13
|
+
export const AttachmentInputDropzone = withContext<HTMLDivElement, AttachmentInputDropzoneProps>(
|
|
14
|
+
FileUploadPrimitive.Dropzone,
|
|
15
|
+
"dropzone",
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export interface AttachmentInputDropzoneLabelProps
|
|
19
|
+
extends PrimitiveProps,
|
|
20
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
21
|
+
|
|
22
|
+
export const AttachmentInputDropzoneLabel = withContext<
|
|
23
|
+
HTMLDivElement,
|
|
24
|
+
AttachmentInputDropzoneLabelProps
|
|
25
|
+
>(Primitive.div, "dropzoneLabel");
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {
|
|
5
|
+
attachmentInputItem,
|
|
6
|
+
type AttachmentInputItemVariantProps,
|
|
7
|
+
} from "@seed-design/css/recipes/attachment-input-item";
|
|
8
|
+
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
9
|
+
import { dataAttr } from "@seed-design/dom-utils";
|
|
10
|
+
import {
|
|
11
|
+
FileUpload as FileUploadPrimitive,
|
|
12
|
+
FileUploadItemProvider,
|
|
13
|
+
useFileUploadContext,
|
|
14
|
+
useFileUploadItem,
|
|
15
|
+
useFileUploadItemContext,
|
|
16
|
+
type FileEntry,
|
|
17
|
+
splitFileName,
|
|
18
|
+
} from "@seed-design/react-file-upload";
|
|
19
|
+
import { MiddleTruncate } from "@seed-design/react-middle-truncate";
|
|
20
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
21
|
+
import clsx from "clsx";
|
|
22
|
+
import { createRenderTrackingContext } from "../../utils/createRenderTrackingContext";
|
|
23
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
24
|
+
|
|
25
|
+
const { useClassNames, ClassNamesProvider, withContext } =
|
|
26
|
+
createSlotRecipeContext(attachmentInputItem);
|
|
27
|
+
|
|
28
|
+
const overlayTracker = createRenderTrackingContext("AttachmentInputItemOverlay");
|
|
29
|
+
|
|
30
|
+
export interface AttachmentInputItemProps
|
|
31
|
+
extends AttachmentInputItemVariantProps,
|
|
32
|
+
PrimitiveProps,
|
|
33
|
+
React.LiHTMLAttributes<HTMLLIElement> {
|
|
34
|
+
fileEntry: FileEntry;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const AttachmentInputItem = React.forwardRef<HTMLLIElement, AttachmentInputItemProps>(
|
|
38
|
+
({ className, fileEntry, ...props }, ref) => {
|
|
39
|
+
const { acceptType, stateProps } = useFileUploadContext();
|
|
40
|
+
const api = useFileUploadItem(fileEntry);
|
|
41
|
+
|
|
42
|
+
const [variantProps, otherProps] = attachmentInputItem.splitVariantProps({
|
|
43
|
+
type: acceptType,
|
|
44
|
+
...props,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const classNames = attachmentInputItem(variantProps);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<ClassNamesProvider value={classNames}>
|
|
51
|
+
<FileUploadItemProvider value={api}>
|
|
52
|
+
<overlayTracker.Provider>
|
|
53
|
+
<Primitive.li
|
|
54
|
+
ref={ref}
|
|
55
|
+
className={clsx(classNames.root, className)}
|
|
56
|
+
{...stateProps}
|
|
57
|
+
{...otherProps}
|
|
58
|
+
/>
|
|
59
|
+
</overlayTracker.Provider>
|
|
60
|
+
</FileUploadItemProvider>
|
|
61
|
+
</ClassNamesProvider>
|
|
62
|
+
);
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
AttachmentInputItem.displayName = "AttachmentInputItem";
|
|
66
|
+
|
|
67
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
68
|
+
|
|
69
|
+
export interface AttachmentInputItemNameProps
|
|
70
|
+
extends PrimitiveProps,
|
|
71
|
+
FileUploadPrimitive.ItemNameProps {}
|
|
72
|
+
|
|
73
|
+
export const AttachmentInputItemName = React.forwardRef<
|
|
74
|
+
HTMLSpanElement,
|
|
75
|
+
AttachmentInputItemNameProps
|
|
76
|
+
>(({ className, children, ...props }, ref) => {
|
|
77
|
+
const classNames = useClassNames();
|
|
78
|
+
const { file } = useFileUploadItemContext();
|
|
79
|
+
const { extension } = splitFileName(file.name);
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<FileUploadPrimitive.ItemName ref={ref} className={clsx(classNames.name, className)} {...props}>
|
|
83
|
+
{children ?? (
|
|
84
|
+
<MiddleTruncate maxLines={2} {...{ end: extension.length }}>
|
|
85
|
+
{file.name}
|
|
86
|
+
</MiddleTruncate>
|
|
87
|
+
)}
|
|
88
|
+
</FileUploadPrimitive.ItemName>
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
AttachmentInputItemName.displayName = "AttachmentInputItemName";
|
|
92
|
+
|
|
93
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
94
|
+
|
|
95
|
+
export interface AttachmentInputItemSizeProps extends FileUploadPrimitive.ItemSizeProps {}
|
|
96
|
+
|
|
97
|
+
export const AttachmentInputItemSize = React.forwardRef<
|
|
98
|
+
HTMLSpanElement,
|
|
99
|
+
AttachmentInputItemSizeProps
|
|
100
|
+
>(({ className, ...props }, ref) => {
|
|
101
|
+
const classNames = useClassNames();
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<FileUploadPrimitive.ItemSize
|
|
105
|
+
ref={ref}
|
|
106
|
+
className={clsx(classNames.size, className)}
|
|
107
|
+
{...props}
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
AttachmentInputItemSize.displayName = "AttachmentInputItemSize";
|
|
112
|
+
|
|
113
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
114
|
+
|
|
115
|
+
export interface AttachmentInputItemRemoveButtonProps
|
|
116
|
+
extends FileUploadPrimitive.ItemRemoveButtonProps {}
|
|
117
|
+
|
|
118
|
+
export const AttachmentInputItemRemoveButton = withContext<
|
|
119
|
+
HTMLButtonElement,
|
|
120
|
+
AttachmentInputItemRemoveButtonProps
|
|
121
|
+
>(FileUploadPrimitive.ItemRemoveButton, "removeButton");
|
|
122
|
+
|
|
123
|
+
export interface AttachmentInputItemImageProps extends FileUploadPrimitive.ItemImageProps {}
|
|
124
|
+
|
|
125
|
+
export const AttachmentInputItemImage = withContext<
|
|
126
|
+
HTMLImageElement,
|
|
127
|
+
AttachmentInputItemImageProps
|
|
128
|
+
>(FileUploadPrimitive.ItemImage, "image");
|
|
129
|
+
|
|
130
|
+
export interface AttachmentInputItemThumbnailProps
|
|
131
|
+
extends PrimitiveProps,
|
|
132
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
133
|
+
|
|
134
|
+
// when actual thumbnail implementation happens, this will likely need a dedicated headless component
|
|
135
|
+
export const AttachmentInputItemThumbnail = React.forwardRef<
|
|
136
|
+
HTMLDivElement,
|
|
137
|
+
AttachmentInputItemThumbnailProps
|
|
138
|
+
>(({ className, ...props }, ref) => {
|
|
139
|
+
const classNames = useClassNames();
|
|
140
|
+
const { stateProps } = useFileUploadContext();
|
|
141
|
+
const { isRendered } = overlayTracker.useRenderTracking();
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<Primitive.div
|
|
145
|
+
ref={ref}
|
|
146
|
+
data-has-overlay={dataAttr(isRendered)}
|
|
147
|
+
{...stateProps}
|
|
148
|
+
className={clsx(classNames.thumbnail, className)}
|
|
149
|
+
{...props}
|
|
150
|
+
/>
|
|
151
|
+
);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
AttachmentInputItemThumbnail.displayName = "AttachmentInputItemThumbnail";
|
|
155
|
+
|
|
156
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
157
|
+
|
|
158
|
+
export interface AttachmentInputItemBadgeProps
|
|
159
|
+
extends PrimitiveProps,
|
|
160
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
161
|
+
|
|
162
|
+
export const AttachmentInputItemBadge = React.forwardRef<
|
|
163
|
+
HTMLDivElement,
|
|
164
|
+
AttachmentInputItemBadgeProps
|
|
165
|
+
>(({ className, children, ...props }, ref) => {
|
|
166
|
+
const classNames = useClassNames();
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<Primitive.div ref={ref} className={clsx(classNames.badge, className)} {...props}>
|
|
170
|
+
<Primitive.span className={classNames.badgeLabel}>{children}</Primitive.span>
|
|
171
|
+
</Primitive.div>
|
|
172
|
+
);
|
|
173
|
+
});
|
|
174
|
+
AttachmentInputItemBadge.displayName = "AttachmentInputItemBadge";
|
|
175
|
+
|
|
176
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
177
|
+
|
|
178
|
+
export interface AttachmentInputItemActionButtonProps
|
|
179
|
+
extends PrimitiveProps,
|
|
180
|
+
React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
181
|
+
|
|
182
|
+
export const AttachmentInputItemActionButton = React.forwardRef<
|
|
183
|
+
HTMLButtonElement,
|
|
184
|
+
AttachmentInputItemActionButtonProps
|
|
185
|
+
>(({ className, ...props }, ref) => {
|
|
186
|
+
const classNames = useClassNames();
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<Primitive.button
|
|
190
|
+
type="button"
|
|
191
|
+
ref={ref}
|
|
192
|
+
className={clsx(classNames.actionButton, className)}
|
|
193
|
+
{...props}
|
|
194
|
+
/>
|
|
195
|
+
);
|
|
196
|
+
});
|
|
197
|
+
AttachmentInputItemActionButton.displayName = "AttachmentInputItemActionButton";
|
|
198
|
+
|
|
199
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
200
|
+
|
|
201
|
+
export interface AttachmentInputItemBackdropProps extends FileUploadPrimitive.ItemBackdropProps {}
|
|
202
|
+
|
|
203
|
+
export const AttachmentInputItemBackdrop = React.forwardRef<
|
|
204
|
+
HTMLDivElement,
|
|
205
|
+
AttachmentInputItemBackdropProps
|
|
206
|
+
>(({ className, ...props }, ref) => {
|
|
207
|
+
const classNames = useClassNames();
|
|
208
|
+
const { trackRef } = overlayTracker.useRenderTracking();
|
|
209
|
+
|
|
210
|
+
return (
|
|
211
|
+
<FileUploadPrimitive.ItemBackdrop
|
|
212
|
+
ref={composeRefs(ref, trackRef)}
|
|
213
|
+
className={clsx(classNames.backdrop, className)}
|
|
214
|
+
{...props}
|
|
215
|
+
/>
|
|
216
|
+
);
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
AttachmentInputItemBackdrop.displayName = "AttachmentInputItemBackdrop";
|
|
220
|
+
|
|
221
|
+
////////////////////////////////////////////////////////////////////////////////////
|
|
222
|
+
|
|
223
|
+
export interface AttachmentInputItemMetadataProps
|
|
224
|
+
extends PrimitiveProps,
|
|
225
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
226
|
+
|
|
227
|
+
export const AttachmentInputItemMetadata = React.forwardRef<
|
|
228
|
+
HTMLDivElement,
|
|
229
|
+
AttachmentInputItemMetadataProps
|
|
230
|
+
>(({ className, ...props }, ref) => {
|
|
231
|
+
const classNames = useClassNames();
|
|
232
|
+
const { stateProps } = useFileUploadContext();
|
|
233
|
+
const { isRendered } = overlayTracker.useRenderTracking();
|
|
234
|
+
|
|
235
|
+
return (
|
|
236
|
+
<Primitive.div
|
|
237
|
+
ref={ref}
|
|
238
|
+
data-has-overlay={dataAttr(isRendered)}
|
|
239
|
+
{...stateProps}
|
|
240
|
+
className={clsx(classNames.metadata, className)}
|
|
241
|
+
{...props}
|
|
242
|
+
/>
|
|
243
|
+
);
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
AttachmentInputItemMetadata.displayName = "AttachmentInputItemMetadata";
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import {
|
|
5
|
+
attachmentInputTrigger,
|
|
6
|
+
type AttachmentInputTriggerVariantProps,
|
|
7
|
+
} from "@seed-design/css/recipes/attachment-input-trigger";
|
|
8
|
+
import {
|
|
9
|
+
FileUpload as FileUploadPrimitive,
|
|
10
|
+
useFileUploadContext,
|
|
11
|
+
type FileAcceptType,
|
|
12
|
+
} from "@seed-design/react-file-upload";
|
|
13
|
+
|
|
14
|
+
import { Primitive, type PrimitiveProps } from "@seed-design/react-primitive";
|
|
15
|
+
import { mergeProps } from "@seed-design/dom-utils";
|
|
16
|
+
import clsx from "clsx";
|
|
17
|
+
import { InternalIcon } from "../private/Icon";
|
|
18
|
+
import { createSlotRecipeContext } from "../../utils/createSlotRecipeContext";
|
|
19
|
+
|
|
20
|
+
const { withProvider, useClassNames } = createSlotRecipeContext(attachmentInputTrigger);
|
|
21
|
+
|
|
22
|
+
export interface AttachmentInputTriggerProps
|
|
23
|
+
extends AttachmentInputTriggerVariantProps,
|
|
24
|
+
PrimitiveProps,
|
|
25
|
+
React.ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
26
|
+
|
|
27
|
+
export const AttachmentInputTrigger = withProvider<HTMLButtonElement, AttachmentInputTriggerProps>(
|
|
28
|
+
FileUploadPrimitive.Trigger,
|
|
29
|
+
"root",
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export type AttachmentInputTriggerIconProps = React.SVGAttributes<SVGElement> & {
|
|
33
|
+
[K in NonNullable<FileAcceptType>]?: React.ReactNode;
|
|
34
|
+
} & {
|
|
35
|
+
general: React.ReactNode;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const AttachmentInputTriggerIcon = React.forwardRef<
|
|
39
|
+
SVGSVGElement,
|
|
40
|
+
AttachmentInputTriggerIconProps
|
|
41
|
+
>(({ image, general, ...props }, ref) => {
|
|
42
|
+
const { acceptType, stateProps } = useFileUploadContext();
|
|
43
|
+
const classNames = useClassNames();
|
|
44
|
+
|
|
45
|
+
const mergedProps = mergeProps(
|
|
46
|
+
stateProps,
|
|
47
|
+
{ className: classNames.icon },
|
|
48
|
+
props as React.HTMLAttributes<HTMLElement>,
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// 이거 Icon으로 교체. classNames가 불필요해질 수 있음 (onlyIcon으로 대체)
|
|
52
|
+
|
|
53
|
+
if (acceptType === "image" && image) {
|
|
54
|
+
return <InternalIcon svg={image} ref={ref} {...mergedProps} />;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return <InternalIcon svg={general} ref={ref} {...mergedProps} />;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export interface AttachmentInputTriggerItemCountProps
|
|
61
|
+
extends PrimitiveProps,
|
|
62
|
+
React.HTMLAttributes<HTMLDivElement> {}
|
|
63
|
+
|
|
64
|
+
export const AttachmentInputTriggerItemCount = React.forwardRef<
|
|
65
|
+
HTMLDivElement,
|
|
66
|
+
AttachmentInputTriggerItemCountProps
|
|
67
|
+
>(({ className, ...otherProps }, ref) => {
|
|
68
|
+
const classNames = useClassNames();
|
|
69
|
+
const { currentFileEntryCount, maxFiles, stateProps } = useFileUploadContext();
|
|
70
|
+
|
|
71
|
+
return (
|
|
72
|
+
<Primitive.div className={clsx(classNames.itemCountArea, className)} ref={ref} {...otherProps}>
|
|
73
|
+
<span
|
|
74
|
+
{...(currentFileEntryCount === 0 && { "data-empty": true })}
|
|
75
|
+
className={classNames.itemCount}
|
|
76
|
+
{...stateProps}
|
|
77
|
+
>
|
|
78
|
+
{currentFileEntryCount}
|
|
79
|
+
</span>
|
|
80
|
+
<span className={classNames.maxItemCount} {...stateProps}>
|
|
81
|
+
/{maxFiles}
|
|
82
|
+
</span>
|
|
83
|
+
</Primitive.div>
|
|
84
|
+
);
|
|
85
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export {
|
|
2
|
+
AttachmentInputContainer,
|
|
3
|
+
AttachmentInputHiddenInput,
|
|
4
|
+
AttachmentInputItemGroup,
|
|
5
|
+
AttachmentInputRoot,
|
|
6
|
+
type AttachmentInputContainerProps,
|
|
7
|
+
type AttachmentInputHiddenInputProps,
|
|
8
|
+
type AttachmentInputItemGroupProps,
|
|
9
|
+
type AttachmentInputRootProps,
|
|
10
|
+
} from "./AttachmentInput";
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
AttachmentInputContext,
|
|
14
|
+
type AttachmentInputContextProps,
|
|
15
|
+
} from "./AttachmentInput";
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
AttachmentInputDropzone,
|
|
19
|
+
AttachmentInputDropzoneLabel,
|
|
20
|
+
type AttachmentInputDropzoneLabelProps,
|
|
21
|
+
type AttachmentInputDropzoneProps,
|
|
22
|
+
} from "./AttachmentInputDropzone";
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
AttachmentInputItem,
|
|
26
|
+
AttachmentInputItemActionButton,
|
|
27
|
+
AttachmentInputItemBackdrop,
|
|
28
|
+
AttachmentInputItemBadge,
|
|
29
|
+
AttachmentInputItemImage,
|
|
30
|
+
AttachmentInputItemMetadata,
|
|
31
|
+
AttachmentInputItemName,
|
|
32
|
+
AttachmentInputItemRemoveButton,
|
|
33
|
+
AttachmentInputItemSize,
|
|
34
|
+
AttachmentInputItemThumbnail,
|
|
35
|
+
type AttachmentInputItemActionButtonProps,
|
|
36
|
+
type AttachmentInputItemBackdropProps,
|
|
37
|
+
type AttachmentInputItemBadgeProps,
|
|
38
|
+
type AttachmentInputItemImageProps,
|
|
39
|
+
type AttachmentInputItemMetadataProps,
|
|
40
|
+
type AttachmentInputItemNameProps,
|
|
41
|
+
type AttachmentInputItemProps,
|
|
42
|
+
type AttachmentInputItemRemoveButtonProps,
|
|
43
|
+
type AttachmentInputItemSizeProps,
|
|
44
|
+
type AttachmentInputItemThumbnailProps,
|
|
45
|
+
} from "./AttachmentInputItem";
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
AttachmentInputTrigger,
|
|
49
|
+
AttachmentInputTriggerIcon,
|
|
50
|
+
AttachmentInputTriggerItemCount,
|
|
51
|
+
type AttachmentInputTriggerIconProps,
|
|
52
|
+
type AttachmentInputTriggerItemCountProps,
|
|
53
|
+
type AttachmentInputTriggerProps,
|
|
54
|
+
} from "./AttachmentInputTrigger";
|
|
55
|
+
|
|
56
|
+
export * as AttachmentInput from "./AttachmentInput.namespace";
|