@chicken-ui/react 0.1.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/dist/components/Box/Box.d.mts +4 -0
- package/dist/components/Box/Box.d.ts +4 -0
- package/dist/components/Box/Box.js +74 -0
- package/dist/components/Box/Box.js.map +1 -0
- package/dist/components/Box/Box.mjs +56 -0
- package/dist/components/Box/Box.mjs.map +1 -0
- package/dist/components/Box/index.d.mts +11 -0
- package/dist/components/Box/index.d.ts +11 -0
- package/dist/components/Box/index.js +39 -0
- package/dist/components/Box/index.js.map +1 -0
- package/dist/components/Box/index.mjs +5 -0
- package/dist/components/Box/index.mjs.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.mts +12 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +12 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +75 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.mjs +57 -0
- package/dist/components/Breadcrumb/Breadcrumb.mjs.map +1 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.d.mts +16 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.d.ts +16 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.js +82 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.js.map +1 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.mjs +64 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.mjs.map +1 -0
- package/dist/components/Breadcrumb/BreadcrumbPresets.d.mts +16 -0
- package/dist/components/Breadcrumb/BreadcrumbPresets.d.ts +16 -0
- package/dist/components/Breadcrumb/BreadcrumbPresets.js +74 -0
- package/dist/components/Breadcrumb/BreadcrumbPresets.js.map +1 -0
- package/dist/components/Breadcrumb/BreadcrumbPresets.mjs +46 -0
- package/dist/components/Breadcrumb/BreadcrumbPresets.mjs.map +1 -0
- package/dist/components/Breadcrumb/index.d.mts +6 -0
- package/dist/components/Breadcrumb/index.d.ts +6 -0
- package/dist/components/Breadcrumb/index.js +45 -0
- package/dist/components/Breadcrumb/index.js.map +1 -0
- package/dist/components/Breadcrumb/index.mjs +9 -0
- package/dist/components/Breadcrumb/index.mjs.map +1 -0
- package/dist/components/Button/Button.d.mts +15 -0
- package/dist/components/Button/Button.d.ts +15 -0
- package/dist/components/Button/Button.js +102 -0
- package/dist/components/Button/Button.js.map +1 -0
- package/dist/components/Button/Button.mjs +84 -0
- package/dist/components/Button/Button.mjs.map +1 -0
- package/dist/components/Button/index.d.mts +4 -0
- package/dist/components/Button/index.d.ts +4 -0
- package/dist/components/Button/index.js +39 -0
- package/dist/components/Button/index.js.map +1 -0
- package/dist/components/Button/index.mjs +5 -0
- package/dist/components/Button/index.mjs.map +1 -0
- package/dist/components/Card/Card.d.mts +13 -0
- package/dist/components/Card/Card.d.ts +13 -0
- package/dist/components/Card/Card.js +90 -0
- package/dist/components/Card/Card.js.map +1 -0
- package/dist/components/Card/Card.mjs +72 -0
- package/dist/components/Card/Card.mjs.map +1 -0
- package/dist/components/Card/CardAction.d.mts +9 -0
- package/dist/components/Card/CardAction.d.ts +9 -0
- package/dist/components/Card/CardAction.js +69 -0
- package/dist/components/Card/CardAction.js.map +1 -0
- package/dist/components/Card/CardAction.mjs +51 -0
- package/dist/components/Card/CardAction.mjs.map +1 -0
- package/dist/components/Card/CardContent.d.mts +9 -0
- package/dist/components/Card/CardContent.d.ts +9 -0
- package/dist/components/Card/CardContent.js +69 -0
- package/dist/components/Card/CardContent.js.map +1 -0
- package/dist/components/Card/CardContent.mjs +51 -0
- package/dist/components/Card/CardContent.mjs.map +1 -0
- package/dist/components/Card/CardHeader.d.mts +9 -0
- package/dist/components/Card/CardHeader.d.ts +9 -0
- package/dist/components/Card/CardHeader.js +69 -0
- package/dist/components/Card/CardHeader.js.map +1 -0
- package/dist/components/Card/CardHeader.mjs +51 -0
- package/dist/components/Card/CardHeader.mjs.map +1 -0
- package/dist/components/Card/CardIcon.d.mts +11 -0
- package/dist/components/Card/CardIcon.d.ts +11 -0
- package/dist/components/Card/CardIcon.js +74 -0
- package/dist/components/Card/CardIcon.js.map +1 -0
- package/dist/components/Card/CardIcon.mjs +56 -0
- package/dist/components/Card/CardIcon.mjs.map +1 -0
- package/dist/components/Card/CardText.d.mts +9 -0
- package/dist/components/Card/CardText.d.ts +9 -0
- package/dist/components/Card/CardText.js +69 -0
- package/dist/components/Card/CardText.js.map +1 -0
- package/dist/components/Card/CardText.mjs +51 -0
- package/dist/components/Card/CardText.mjs.map +1 -0
- package/dist/components/Card/CardTitle.d.mts +15 -0
- package/dist/components/Card/CardTitle.d.ts +15 -0
- package/dist/components/Card/CardTitle.js +72 -0
- package/dist/components/Card/CardTitle.js.map +1 -0
- package/dist/components/Card/CardTitle.mjs +54 -0
- package/dist/components/Card/CardTitle.mjs.map +1 -0
- package/dist/components/Card/index.d.mts +11 -0
- package/dist/components/Card/index.d.ts +11 -0
- package/dist/components/Card/index.js +57 -0
- package/dist/components/Card/index.js.map +1 -0
- package/dist/components/Card/index.mjs +17 -0
- package/dist/components/Card/index.mjs.map +1 -0
- package/dist/components/Container/Container.d.mts +12 -0
- package/dist/components/Container/Container.d.ts +12 -0
- package/dist/components/Container/Container.js +94 -0
- package/dist/components/Container/Container.js.map +1 -0
- package/dist/components/Container/Container.mjs +76 -0
- package/dist/components/Container/Container.mjs.map +1 -0
- package/dist/components/Container/index.d.mts +4 -0
- package/dist/components/Container/index.d.ts +4 -0
- package/dist/components/Container/index.js +39 -0
- package/dist/components/Container/index.js.map +1 -0
- package/dist/components/Container/index.mjs +5 -0
- package/dist/components/Container/index.mjs.map +1 -0
- package/dist/components/Grid/Grid.d.mts +14 -0
- package/dist/components/Grid/Grid.d.ts +14 -0
- package/dist/components/Grid/Grid.js +110 -0
- package/dist/components/Grid/Grid.js.map +1 -0
- package/dist/components/Grid/Grid.mjs +96 -0
- package/dist/components/Grid/Grid.mjs.map +1 -0
- package/dist/components/Grid/index.d.mts +4 -0
- package/dist/components/Grid/index.d.ts +4 -0
- package/dist/components/Grid/index.js +39 -0
- package/dist/components/Grid/index.js.map +1 -0
- package/dist/components/Grid/index.mjs +5 -0
- package/dist/components/Grid/index.mjs.map +1 -0
- package/dist/components/HStack/HStack.d.mts +14 -0
- package/dist/components/HStack/HStack.d.ts +14 -0
- package/dist/components/HStack/HStack.js +111 -0
- package/dist/components/HStack/HStack.js.map +1 -0
- package/dist/components/HStack/HStack.mjs +97 -0
- package/dist/components/HStack/HStack.mjs.map +1 -0
- package/dist/components/HStack/index.d.mts +4 -0
- package/dist/components/HStack/index.d.ts +4 -0
- package/dist/components/HStack/index.js +39 -0
- package/dist/components/HStack/index.js.map +1 -0
- package/dist/components/HStack/index.mjs +5 -0
- package/dist/components/HStack/index.mjs.map +1 -0
- package/dist/components/NavBar/NavBar.context.d.mts +8 -0
- package/dist/components/NavBar/NavBar.context.d.ts +8 -0
- package/dist/components/NavBar/NavBar.context.js +44 -0
- package/dist/components/NavBar/NavBar.context.js.map +1 -0
- package/dist/components/NavBar/NavBar.context.mjs +17 -0
- package/dist/components/NavBar/NavBar.context.mjs.map +1 -0
- package/dist/components/NavBar/NavBar.d.mts +11 -0
- package/dist/components/NavBar/NavBar.d.ts +11 -0
- package/dist/components/NavBar/NavBar.js +81 -0
- package/dist/components/NavBar/NavBar.js.map +1 -0
- package/dist/components/NavBar/NavBar.mjs +63 -0
- package/dist/components/NavBar/NavBar.mjs.map +1 -0
- package/dist/components/NavBar/NavBarBrand.d.mts +9 -0
- package/dist/components/NavBar/NavBarBrand.d.ts +9 -0
- package/dist/components/NavBar/NavBarBrand.js +81 -0
- package/dist/components/NavBar/NavBarBrand.js.map +1 -0
- package/dist/components/NavBar/NavBarBrand.mjs +63 -0
- package/dist/components/NavBar/NavBarBrand.mjs.map +1 -0
- package/dist/components/NavBar/NavBarDropdown.d.mts +13 -0
- package/dist/components/NavBar/NavBarDropdown.d.ts +13 -0
- package/dist/components/NavBar/NavBarDropdown.js +102 -0
- package/dist/components/NavBar/NavBarDropdown.js.map +1 -0
- package/dist/components/NavBar/NavBarDropdown.mjs +87 -0
- package/dist/components/NavBar/NavBarDropdown.mjs.map +1 -0
- package/dist/components/NavBar/NavBarItem.d.mts +16 -0
- package/dist/components/NavBar/NavBarItem.d.ts +16 -0
- package/dist/components/NavBar/NavBarItem.js +93 -0
- package/dist/components/NavBar/NavBarItem.js.map +1 -0
- package/dist/components/NavBar/NavBarItem.mjs +75 -0
- package/dist/components/NavBar/NavBarItem.mjs.map +1 -0
- package/dist/components/NavBar/NavBarList.d.mts +11 -0
- package/dist/components/NavBar/NavBarList.d.ts +11 -0
- package/dist/components/NavBar/NavBarList.js +84 -0
- package/dist/components/NavBar/NavBarList.js.map +1 -0
- package/dist/components/NavBar/NavBarList.mjs +70 -0
- package/dist/components/NavBar/NavBarList.mjs.map +1 -0
- package/dist/components/NavBar/NavBarPreset.d.mts +26 -0
- package/dist/components/NavBar/NavBarPreset.d.ts +26 -0
- package/dist/components/NavBar/NavBarPreset.js +113 -0
- package/dist/components/NavBar/NavBarPreset.js.map +1 -0
- package/dist/components/NavBar/NavBarPreset.mjs +85 -0
- package/dist/components/NavBar/NavBarPreset.mjs.map +1 -0
- package/dist/components/NavBar/NavBarToggle.d.mts +13 -0
- package/dist/components/NavBar/NavBarToggle.d.ts +13 -0
- package/dist/components/NavBar/NavBarToggle.js +62 -0
- package/dist/components/NavBar/NavBarToggle.js.map +1 -0
- package/dist/components/NavBar/NavBarToggle.mjs +42 -0
- package/dist/components/NavBar/NavBarToggle.mjs.map +1 -0
- package/dist/components/NavBar/index.d.mts +10 -0
- package/dist/components/NavBar/index.d.ts +10 -0
- package/dist/components/NavBar/index.js +57 -0
- package/dist/components/NavBar/index.js.map +1 -0
- package/dist/components/NavBar/index.mjs +17 -0
- package/dist/components/NavBar/index.mjs.map +1 -0
- package/dist/components/Pill/Pill.d.mts +19 -0
- package/dist/components/Pill/Pill.d.ts +19 -0
- package/dist/components/Pill/Pill.js +117 -0
- package/dist/components/Pill/Pill.js.map +1 -0
- package/dist/components/Pill/Pill.mjs +99 -0
- package/dist/components/Pill/Pill.mjs.map +1 -0
- package/dist/components/Pill/index.d.mts +4 -0
- package/dist/components/Pill/index.d.ts +4 -0
- package/dist/components/Pill/index.js +39 -0
- package/dist/components/Pill/index.js.map +1 -0
- package/dist/components/Pill/index.mjs +5 -0
- package/dist/components/Pill/index.mjs.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.mts +24 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +24 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +118 -0
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.mjs +106 -0
- package/dist/components/SegmentedControl/SegmentedControl.mjs.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControlContext.d.mts +12 -0
- package/dist/components/SegmentedControl/SegmentedControlContext.d.ts +12 -0
- package/dist/components/SegmentedControl/SegmentedControlContext.js +36 -0
- package/dist/components/SegmentedControl/SegmentedControlContext.js.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControlContext.mjs +11 -0
- package/dist/components/SegmentedControl/SegmentedControlContext.mjs.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControlItem.d.mts +14 -0
- package/dist/components/SegmentedControl/SegmentedControlItem.d.ts +14 -0
- package/dist/components/SegmentedControl/SegmentedControlItem.js +111 -0
- package/dist/components/SegmentedControl/SegmentedControlItem.js.map +1 -0
- package/dist/components/SegmentedControl/SegmentedControlItem.mjs +93 -0
- package/dist/components/SegmentedControl/SegmentedControlItem.mjs.map +1 -0
- package/dist/components/SegmentedControl/index.d.mts +5 -0
- package/dist/components/SegmentedControl/index.d.ts +5 -0
- package/dist/components/SegmentedControl/index.js +42 -0
- package/dist/components/SegmentedControl/index.js.map +1 -0
- package/dist/components/SegmentedControl/index.mjs +7 -0
- package/dist/components/SegmentedControl/index.mjs.map +1 -0
- package/dist/components/TabBar/TabBar.d.mts +11 -0
- package/dist/components/TabBar/TabBar.d.ts +11 -0
- package/dist/components/TabBar/TabBar.js +85 -0
- package/dist/components/TabBar/TabBar.js.map +1 -0
- package/dist/components/TabBar/TabBar.mjs +67 -0
- package/dist/components/TabBar/TabBar.mjs.map +1 -0
- package/dist/components/TabBar/TabBarItem.d.mts +15 -0
- package/dist/components/TabBar/TabBarItem.d.ts +15 -0
- package/dist/components/TabBar/TabBarItem.js +89 -0
- package/dist/components/TabBar/TabBarItem.js.map +1 -0
- package/dist/components/TabBar/TabBarItem.mjs +71 -0
- package/dist/components/TabBar/TabBarItem.mjs.map +1 -0
- package/dist/components/TabBar/TabBarItemIcon.d.mts +9 -0
- package/dist/components/TabBar/TabBarItemIcon.d.ts +9 -0
- package/dist/components/TabBar/TabBarItemIcon.js +80 -0
- package/dist/components/TabBar/TabBarItemIcon.js.map +1 -0
- package/dist/components/TabBar/TabBarItemIcon.mjs +62 -0
- package/dist/components/TabBar/TabBarItemIcon.mjs.map +1 -0
- package/dist/components/TabBar/TabBarItemLabel.d.mts +9 -0
- package/dist/components/TabBar/TabBarItemLabel.d.ts +9 -0
- package/dist/components/TabBar/TabBarItemLabel.js +80 -0
- package/dist/components/TabBar/TabBarItemLabel.js.map +1 -0
- package/dist/components/TabBar/TabBarItemLabel.mjs +62 -0
- package/dist/components/TabBar/TabBarItemLabel.mjs.map +1 -0
- package/dist/components/TabBar/TabBarPreset.d.mts +21 -0
- package/dist/components/TabBar/TabBarPreset.d.ts +21 -0
- package/dist/components/TabBar/TabBarPreset.js +80 -0
- package/dist/components/TabBar/TabBarPreset.js.map +1 -0
- package/dist/components/TabBar/TabBarPreset.mjs +52 -0
- package/dist/components/TabBar/TabBarPreset.mjs.map +1 -0
- package/dist/components/TabBar/index.d.mts +8 -0
- package/dist/components/TabBar/index.d.ts +8 -0
- package/dist/components/TabBar/index.js +51 -0
- package/dist/components/TabBar/index.js.map +1 -0
- package/dist/components/TabBar/index.mjs +13 -0
- package/dist/components/TabBar/index.mjs.map +1 -0
- package/dist/components/VStack/VStack.d.mts +12 -0
- package/dist/components/VStack/VStack.d.ts +12 -0
- package/dist/components/VStack/VStack.js +95 -0
- package/dist/components/VStack/VStack.js.map +1 -0
- package/dist/components/VStack/VStack.mjs +81 -0
- package/dist/components/VStack/VStack.mjs.map +1 -0
- package/dist/components/VStack/index.d.mts +4 -0
- package/dist/components/VStack/index.d.ts +4 -0
- package/dist/components/VStack/index.js +39 -0
- package/dist/components/VStack/index.js.map +1 -0
- package/dist/components/VStack/index.mjs +5 -0
- package/dist/components/VStack/index.mjs.map +1 -0
- package/dist/components/index.d.mts +34 -0
- package/dist/components/index.d.ts +34 -0
- package/dist/components/index.js +45 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +13 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/core/Base/Base.d.mts +28 -0
- package/dist/core/Base/Base.d.ts +28 -0
- package/dist/core/Base/Base.js +127 -0
- package/dist/core/Base/Base.js.map +1 -0
- package/dist/core/Base/Base.mjs +112 -0
- package/dist/core/Base/Base.mjs.map +1 -0
- package/dist/core/Base/index.d.mts +3 -0
- package/dist/core/Base/index.d.ts +3 -0
- package/dist/core/Base/index.js +39 -0
- package/dist/core/Base/index.js.map +1 -0
- package/dist/core/Base/index.mjs +5 -0
- package/dist/core/Base/index.mjs.map +1 -0
- package/dist/core/Breakpoint/BreakpointType.d.mts +12 -0
- package/dist/core/Breakpoint/BreakpointType.d.ts +12 -0
- package/dist/core/Breakpoint/BreakpointType.js +17 -0
- package/dist/core/Breakpoint/BreakpointType.js.map +1 -0
- package/dist/core/Breakpoint/BreakpointType.mjs +1 -0
- package/dist/core/Breakpoint/BreakpointType.mjs.map +1 -0
- package/dist/core/Breakpoint/index.d.mts +2 -0
- package/dist/core/Breakpoint/index.d.ts +2 -0
- package/dist/core/Breakpoint/index.js +23 -0
- package/dist/core/Breakpoint/index.js.map +1 -0
- package/dist/core/Breakpoint/index.mjs +2 -0
- package/dist/core/Breakpoint/index.mjs.map +1 -0
- package/dist/core/Breakpoint/resolveResponsiveVars.d.mts +8 -0
- package/dist/core/Breakpoint/resolveResponsiveVars.d.ts +8 -0
- package/dist/core/Breakpoint/resolveResponsiveVars.js +81 -0
- package/dist/core/Breakpoint/resolveResponsiveVars.js.map +1 -0
- package/dist/core/Breakpoint/resolveResponsiveVars.mjs +57 -0
- package/dist/core/Breakpoint/resolveResponsiveVars.mjs.map +1 -0
- package/dist/core/Show/ShowAbove.d.mts +13 -0
- package/dist/core/Show/ShowAbove.d.ts +13 -0
- package/dist/core/Show/ShowAbove.js +33 -0
- package/dist/core/Show/ShowAbove.js.map +1 -0
- package/dist/core/Show/ShowAbove.mjs +13 -0
- package/dist/core/Show/ShowAbove.mjs.map +1 -0
- package/dist/core/Show/ShowBelow.d.mts +13 -0
- package/dist/core/Show/ShowBelow.d.ts +13 -0
- package/dist/core/Show/ShowBelow.js +33 -0
- package/dist/core/Show/ShowBelow.js.map +1 -0
- package/dist/core/Show/ShowBelow.mjs +13 -0
- package/dist/core/Show/ShowBelow.mjs.map +1 -0
- package/dist/core/Show/index.d.mts +4 -0
- package/dist/core/Show/index.d.ts +4 -0
- package/dist/core/Show/index.js +42 -0
- package/dist/core/Show/index.js.map +1 -0
- package/dist/core/Show/index.mjs +7 -0
- package/dist/core/Show/index.mjs.map +1 -0
- package/dist/core/Show/visibility.d.mts +9 -0
- package/dist/core/Show/visibility.d.ts +9 -0
- package/dist/core/Show/visibility.js +86 -0
- package/dist/core/Show/visibility.js.map +1 -0
- package/dist/core/Show/visibility.mjs +67 -0
- package/dist/core/Show/visibility.mjs.map +1 -0
- package/dist/core/SrOnly/SrOnly.d.mts +25 -0
- package/dist/core/SrOnly/SrOnly.d.ts +25 -0
- package/dist/core/SrOnly/SrOnly.js +91 -0
- package/dist/core/SrOnly/SrOnly.js.map +1 -0
- package/dist/core/SrOnly/SrOnly.mjs +71 -0
- package/dist/core/SrOnly/SrOnly.mjs.map +1 -0
- package/dist/core/SrOnly/index.d.mts +3 -0
- package/dist/core/SrOnly/index.d.ts +3 -0
- package/dist/core/SrOnly/index.js +33 -0
- package/dist/core/SrOnly/index.js.map +1 -0
- package/dist/core/SrOnly/index.mjs +7 -0
- package/dist/core/SrOnly/index.mjs.map +1 -0
- package/dist/core/Typography/Heading.d.mts +13 -0
- package/dist/core/Typography/Heading.d.ts +13 -0
- package/dist/core/Typography/Heading.js +79 -0
- package/dist/core/Typography/Heading.js.map +1 -0
- package/dist/core/Typography/Heading.mjs +61 -0
- package/dist/core/Typography/Heading.mjs.map +1 -0
- package/dist/core/Typography/Text.d.mts +14 -0
- package/dist/core/Typography/Text.d.ts +14 -0
- package/dist/core/Typography/Text.js +73 -0
- package/dist/core/Typography/Text.js.map +1 -0
- package/dist/core/Typography/Text.mjs +55 -0
- package/dist/core/Typography/Text.mjs.map +1 -0
- package/dist/core/Typography/index.d.mts +5 -0
- package/dist/core/Typography/index.d.ts +5 -0
- package/dist/core/Typography/index.js +42 -0
- package/dist/core/Typography/index.js.map +1 -0
- package/dist/core/Typography/index.mjs +7 -0
- package/dist/core/Typography/index.mjs.map +1 -0
- package/dist/core/index.d.mts +10 -0
- package/dist/core/index.d.ts +10 -0
- package/dist/core/index.js +31 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/index.mjs +6 -0
- package/dist/core/index.mjs.map +1 -0
- package/dist/index.d.mts +43 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +2680 -0
- package/dist/types/LightDark.types.d.mts +6 -0
- package/dist/types/LightDark.types.d.ts +6 -0
- package/dist/types/LightDark.types.js +17 -0
- package/dist/types/LightDark.types.js.map +1 -0
- package/dist/types/LightDark.types.mjs +1 -0
- package/dist/types/LightDark.types.mjs.map +1 -0
- package/dist/types/index.d.mts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +17 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/utils/PropToValue.d.mts +3 -0
- package/dist/utils/PropToValue.d.ts +3 -0
- package/dist/utils/PropToValue.js +36 -0
- package/dist/utils/PropToValue.js.map +1 -0
- package/dist/utils/PropToValue.mjs +12 -0
- package/dist/utils/PropToValue.mjs.map +1 -0
- package/dist/utils/index.d.mts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +23 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +2 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var ShowAbove_exports = {};
|
|
20
|
+
__export(ShowAbove_exports, {
|
|
21
|
+
default: () => ShowAbove
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ShowAbove_exports);
|
|
24
|
+
var import_visibility = require("./visibility");
|
|
25
|
+
function ShowAbove({
|
|
26
|
+
breakpoint,
|
|
27
|
+
display,
|
|
28
|
+
as,
|
|
29
|
+
children
|
|
30
|
+
}) {
|
|
31
|
+
return (0, import_visibility.renderVisibility)("above", breakpoint, children, display, as);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=ShowAbove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/core/Show/ShowAbove.tsx"],"sourcesContent":["import { CSSProperties, ElementType, ReactNode } from \"react\";\nimport { CkBreakpoint, renderVisibility } from \"./visibility\";\n\nexport type ShowAboveProps = {\n breakpoint: CkBreakpoint;\n display?: CSSProperties[\"display\"];\n as?: ElementType;\n children: ReactNode;\n};\n\nexport default function ShowAbove({\n breakpoint,\n display,\n as,\n children,\n}: ShowAboveProps) {\n return renderVisibility(\"above\", breakpoint, children, display, as);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA+C;AAShC,SAAR,UAA2B;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmB;AACjB,aAAO,oCAAiB,SAAS,YAAY,UAAU,SAAS,EAAE;AACpE;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { renderVisibility } from "./visibility";
|
|
2
|
+
function ShowAbove({
|
|
3
|
+
breakpoint,
|
|
4
|
+
display,
|
|
5
|
+
as,
|
|
6
|
+
children
|
|
7
|
+
}) {
|
|
8
|
+
return renderVisibility("above", breakpoint, children, display, as);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
ShowAbove as default
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=ShowAbove.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/core/Show/ShowAbove.tsx"],"sourcesContent":["import { CSSProperties, ElementType, ReactNode } from \"react\";\nimport { CkBreakpoint, renderVisibility } from \"./visibility\";\n\nexport type ShowAboveProps = {\n breakpoint: CkBreakpoint;\n display?: CSSProperties[\"display\"];\n as?: ElementType;\n children: ReactNode;\n};\n\nexport default function ShowAbove({\n breakpoint,\n display,\n as,\n children,\n}: ShowAboveProps) {\n return renderVisibility(\"above\", breakpoint, children, display, as);\n}\n"],"mappings":"AACA,SAAuB,wBAAwB;AAShC,SAAR,UAA2B;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmB;AACjB,SAAO,iBAAiB,SAAS,YAAY,UAAU,SAAS,EAAE;AACpE;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { CSSProperties, ElementType, ReactNode } from 'react';
|
|
3
|
+
import { CkBreakpoint } from './visibility.mjs';
|
|
4
|
+
|
|
5
|
+
type ShowBelowProps = {
|
|
6
|
+
breakpoint: CkBreakpoint;
|
|
7
|
+
display?: CSSProperties["display"];
|
|
8
|
+
as?: ElementType;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
declare function ShowBelow({ breakpoint, display, as, children, }: ShowBelowProps): react.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { type ShowBelowProps, ShowBelow as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { CSSProperties, ElementType, ReactNode } from 'react';
|
|
3
|
+
import { CkBreakpoint } from './visibility.js';
|
|
4
|
+
|
|
5
|
+
type ShowBelowProps = {
|
|
6
|
+
breakpoint: CkBreakpoint;
|
|
7
|
+
display?: CSSProperties["display"];
|
|
8
|
+
as?: ElementType;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
declare function ShowBelow({ breakpoint, display, as, children, }: ShowBelowProps): react.JSX.Element;
|
|
12
|
+
|
|
13
|
+
export { type ShowBelowProps, ShowBelow as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var ShowBelow_exports = {};
|
|
20
|
+
__export(ShowBelow_exports, {
|
|
21
|
+
default: () => ShowBelow
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ShowBelow_exports);
|
|
24
|
+
var import_visibility = require("./visibility");
|
|
25
|
+
function ShowBelow({
|
|
26
|
+
breakpoint,
|
|
27
|
+
display,
|
|
28
|
+
as,
|
|
29
|
+
children
|
|
30
|
+
}) {
|
|
31
|
+
return (0, import_visibility.renderVisibility)("below", breakpoint, children, display, as);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=ShowBelow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/core/Show/ShowBelow.tsx"],"sourcesContent":["import { CSSProperties, ElementType, ReactNode } from \"react\";\nimport { CkBreakpoint, renderVisibility } from \"./visibility\";\n\nexport type ShowBelowProps = {\n breakpoint: CkBreakpoint;\n display?: CSSProperties[\"display\"];\n as?: ElementType;\n children: ReactNode;\n};\n\nexport default function ShowBelow({\n breakpoint,\n display,\n as,\n children,\n}: ShowBelowProps) {\n return renderVisibility(\"below\", breakpoint, children, display, as);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,wBAA+C;AAShC,SAAR,UAA2B;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmB;AACjB,aAAO,oCAAiB,SAAS,YAAY,UAAU,SAAS,EAAE;AACpE;","names":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { renderVisibility } from "./visibility";
|
|
2
|
+
function ShowBelow({
|
|
3
|
+
breakpoint,
|
|
4
|
+
display,
|
|
5
|
+
as,
|
|
6
|
+
children
|
|
7
|
+
}) {
|
|
8
|
+
return renderVisibility("below", breakpoint, children, display, as);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
ShowBelow as default
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=ShowBelow.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/core/Show/ShowBelow.tsx"],"sourcesContent":["import { CSSProperties, ElementType, ReactNode } from \"react\";\nimport { CkBreakpoint, renderVisibility } from \"./visibility\";\n\nexport type ShowBelowProps = {\n breakpoint: CkBreakpoint;\n display?: CSSProperties[\"display\"];\n as?: ElementType;\n children: ReactNode;\n};\n\nexport default function ShowBelow({\n breakpoint,\n display,\n as,\n children,\n}: ShowBelowProps) {\n return renderVisibility(\"below\", breakpoint, children, display, as);\n}\n"],"mappings":"AACA,SAAuB,wBAAwB;AAShC,SAAR,UAA2B;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAmB;AACjB,SAAO,iBAAiB,SAAS,YAAY,UAAU,SAAS,EAAE;AACpE;","names":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var Show_exports = {};
|
|
30
|
+
__export(Show_exports, {
|
|
31
|
+
ShowAbove: () => import_ShowAbove.default,
|
|
32
|
+
ShowBelow: () => import_ShowBelow.default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Show_exports);
|
|
35
|
+
var import_ShowAbove = __toESM(require("./ShowAbove"));
|
|
36
|
+
var import_ShowBelow = __toESM(require("./ShowBelow"));
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
ShowAbove,
|
|
40
|
+
ShowBelow
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/core/Show/index.ts"],"sourcesContent":["export { default as ShowAbove } from \"./ShowAbove\";\nexport type { ShowAboveProps } from \"./ShowAbove\";\nexport { default as ShowBelow } from \"./ShowBelow\";\nexport type { ShowBelowProps } from \"./ShowBelow\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAqC;AAErC,uBAAqC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/core/Show/index.ts"],"sourcesContent":["export { default as ShowAbove } from \"./ShowAbove\";\nexport type { ShowAboveProps } from \"./ShowAbove\";\nexport { default as ShowBelow } from \"./ShowBelow\";\nexport type { ShowBelowProps } from \"./ShowBelow\";\n"],"mappings":"AAAA,SAAoB,WAAXA,gBAA4B;AAErC,SAAoB,WAAXA,gBAA4B;","names":["default"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, CSSProperties, ElementType } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const CK_BREAKPOINTS: readonly ["us", "xs", "sm", "md", "lg", "xl", "ul"];
|
|
5
|
+
type CkBreakpoint = (typeof CK_BREAKPOINTS)[number];
|
|
6
|
+
type VisibilityVariant = "above" | "below";
|
|
7
|
+
declare function renderVisibility(variant: VisibilityVariant, breakpoint: CkBreakpoint, children: ReactNode, display: CSSProperties["display"] | undefined, as: ElementType | undefined): react.JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { CK_BREAKPOINTS, type CkBreakpoint, renderVisibility };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, CSSProperties, ElementType } from 'react';
|
|
3
|
+
|
|
4
|
+
declare const CK_BREAKPOINTS: readonly ["us", "xs", "sm", "md", "lg", "xl", "ul"];
|
|
5
|
+
type CkBreakpoint = (typeof CK_BREAKPOINTS)[number];
|
|
6
|
+
type VisibilityVariant = "above" | "below";
|
|
7
|
+
declare function renderVisibility(variant: VisibilityVariant, breakpoint: CkBreakpoint, children: ReactNode, display: CSSProperties["display"] | undefined, as: ElementType | undefined): react.JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { CK_BREAKPOINTS, type CkBreakpoint, renderVisibility };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __export = (target, all) => {
|
|
21
|
+
for (var name in all)
|
|
22
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
23
|
+
};
|
|
24
|
+
var __copyProps = (to, from, except, desc) => {
|
|
25
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
+
for (let key of __getOwnPropNames(from))
|
|
27
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
28
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
29
|
+
}
|
|
30
|
+
return to;
|
|
31
|
+
};
|
|
32
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
+
var visibility_exports = {};
|
|
34
|
+
__export(visibility_exports, {
|
|
35
|
+
CK_BREAKPOINTS: () => CK_BREAKPOINTS,
|
|
36
|
+
renderVisibility: () => renderVisibility
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(visibility_exports);
|
|
39
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
40
|
+
var import_react = require("react");
|
|
41
|
+
const CK_BREAKPOINTS = [
|
|
42
|
+
"us",
|
|
43
|
+
"xs",
|
|
44
|
+
"sm",
|
|
45
|
+
"md",
|
|
46
|
+
"lg",
|
|
47
|
+
"xl",
|
|
48
|
+
"ul"
|
|
49
|
+
];
|
|
50
|
+
function renderVisibility(variant, breakpoint, children, display, as) {
|
|
51
|
+
const baseClassName = `ck-show-${variant}`;
|
|
52
|
+
const displayStyle = display ? { "--ck-show-display": display } : void 0;
|
|
53
|
+
const canClone = !as && (0, import_react.isValidElement)(children);
|
|
54
|
+
if (canClone) {
|
|
55
|
+
const child = children;
|
|
56
|
+
const mergedClassName = [child.props.className, baseClassName].filter(Boolean).join(" ");
|
|
57
|
+
const mergedStyle = __spreadValues(__spreadValues({}, displayStyle), child.props.style);
|
|
58
|
+
return (0, import_react.cloneElement)(child, {
|
|
59
|
+
className: mergedClassName,
|
|
60
|
+
style: mergedStyle,
|
|
61
|
+
"data-breakpoint": breakpoint
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const isAmbiguous = !as && import_react.Children.count(children) !== 1;
|
|
65
|
+
if (process.env.NODE_ENV !== "production" && isAmbiguous) {
|
|
66
|
+
console.warn(
|
|
67
|
+
`[ChickenUI] Show${variant === "above" ? "Above" : "Below"} attend un enfant unique pour \xE9viter d'ajouter un wrapper. Un <span> a \xE9t\xE9 ajout\xE9 automatiquement. Passez la prop "as" pour choisir la balise, ou fournissez un enfant React unique.`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
const Wrapper = as || "span";
|
|
71
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
72
|
+
Wrapper,
|
|
73
|
+
{
|
|
74
|
+
className: baseClassName,
|
|
75
|
+
style: displayStyle,
|
|
76
|
+
"data-breakpoint": breakpoint,
|
|
77
|
+
children
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
+
0 && (module.exports = {
|
|
83
|
+
CK_BREAKPOINTS,
|
|
84
|
+
renderVisibility
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=visibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/core/Show/visibility.tsx"],"sourcesContent":["import {\n CSSProperties,\n ElementType,\n ReactElement,\n ReactNode,\n cloneElement,\n isValidElement,\n Children,\n} from \"react\";\n\nexport const CK_BREAKPOINTS = [\n \"us\",\n \"xs\",\n \"sm\",\n \"md\",\n \"lg\",\n \"xl\",\n \"ul\",\n] as const;\nexport type CkBreakpoint = (typeof CK_BREAKPOINTS)[number];\n\ntype VisibilityVariant = \"above\" | \"below\";\n\nexport function renderVisibility(\n variant: VisibilityVariant,\n breakpoint: CkBreakpoint,\n children: ReactNode,\n display: CSSProperties[\"display\"] | undefined,\n as: ElementType | undefined,\n) {\n const baseClassName = `ck-show-${variant}`;\n const displayStyle = display\n ? ({ \"--ck-show-display\": display } as CSSProperties)\n : undefined;\n\n const canClone = !as && isValidElement(children);\n\n if (canClone) {\n const child = children as ReactElement<{\n className?: string;\n style?: CSSProperties;\n }>;\n const mergedClassName = [child.props.className, baseClassName]\n .filter(Boolean)\n .join(\" \");\n const mergedStyle = { ...displayStyle, ...child.props.style };\n return cloneElement(child, {\n className: mergedClassName,\n style: mergedStyle,\n \"data-breakpoint\": breakpoint,\n } as Partial<unknown>);\n }\n\n const isAmbiguous = !as && Children.count(children) !== 1;\n if (process.env.NODE_ENV !== \"production\" && isAmbiguous) {\n console.warn(\n `[ChickenUI] Show${variant === \"above\" ? \"Above\" : \"Below\"} attend un enfant unique pour éviter d'ajouter un wrapper. Un <span> a été ajouté automatiquement. Passez la prop \"as\" pour choisir la balise, ou fournissez un enfant React unique.`,\n );\n }\n\n const Wrapper = as || \"span\";\n return (\n <Wrapper\n className={baseClassName}\n style={displayStyle}\n data-breakpoint={breakpoint}\n >\n {children}\n </Wrapper>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA8DI;AA9DJ,mBAQO;AAEA,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKO,SAAS,iBACd,SACA,YACA,UACA,SACA,IACA;AACA,QAAM,gBAAgB,WAAW,OAAO;AACxC,QAAM,eAAe,UAChB,EAAE,qBAAqB,QAAQ,IAChC;AAEJ,QAAM,WAAW,CAAC,UAAM,6BAAe,QAAQ;AAE/C,MAAI,UAAU;AACZ,UAAM,QAAQ;AAId,UAAM,kBAAkB,CAAC,MAAM,MAAM,WAAW,aAAa,EAC1D,OAAO,OAAO,EACd,KAAK,GAAG;AACX,UAAM,cAAc,kCAAK,eAAiB,MAAM,MAAM;AACtD,eAAO,2BAAa,OAAO;AAAA,MACzB,WAAW;AAAA,MACX,OAAO;AAAA,MACP,mBAAmB;AAAA,IACrB,CAAqB;AAAA,EACvB;AAEA,QAAM,cAAc,CAAC,MAAM,sBAAS,MAAM,QAAQ,MAAM;AACxD,MAAI,QAAQ,IAAI,aAAa,gBAAgB,aAAa;AACxD,YAAQ;AAAA,MACN,mBAAmB,YAAY,UAAU,UAAU,OAAO;AAAA,IAC5D;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACtB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,OAAO;AAAA,MACP,mBAAiB;AAAA,MAEhB;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
|
+
import {
|
|
19
|
+
cloneElement,
|
|
20
|
+
isValidElement,
|
|
21
|
+
Children
|
|
22
|
+
} from "react";
|
|
23
|
+
const CK_BREAKPOINTS = [
|
|
24
|
+
"us",
|
|
25
|
+
"xs",
|
|
26
|
+
"sm",
|
|
27
|
+
"md",
|
|
28
|
+
"lg",
|
|
29
|
+
"xl",
|
|
30
|
+
"ul"
|
|
31
|
+
];
|
|
32
|
+
function renderVisibility(variant, breakpoint, children, display, as) {
|
|
33
|
+
const baseClassName = `ck-show-${variant}`;
|
|
34
|
+
const displayStyle = display ? { "--ck-show-display": display } : void 0;
|
|
35
|
+
const canClone = !as && isValidElement(children);
|
|
36
|
+
if (canClone) {
|
|
37
|
+
const child = children;
|
|
38
|
+
const mergedClassName = [child.props.className, baseClassName].filter(Boolean).join(" ");
|
|
39
|
+
const mergedStyle = __spreadValues(__spreadValues({}, displayStyle), child.props.style);
|
|
40
|
+
return cloneElement(child, {
|
|
41
|
+
className: mergedClassName,
|
|
42
|
+
style: mergedStyle,
|
|
43
|
+
"data-breakpoint": breakpoint
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const isAmbiguous = !as && Children.count(children) !== 1;
|
|
47
|
+
if (process.env.NODE_ENV !== "production" && isAmbiguous) {
|
|
48
|
+
console.warn(
|
|
49
|
+
`[ChickenUI] Show${variant === "above" ? "Above" : "Below"} attend un enfant unique pour \xE9viter d'ajouter un wrapper. Un <span> a \xE9t\xE9 ajout\xE9 automatiquement. Passez la prop "as" pour choisir la balise, ou fournissez un enfant React unique.`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
const Wrapper = as || "span";
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
Wrapper,
|
|
55
|
+
{
|
|
56
|
+
className: baseClassName,
|
|
57
|
+
style: displayStyle,
|
|
58
|
+
"data-breakpoint": breakpoint,
|
|
59
|
+
children
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
CK_BREAKPOINTS,
|
|
65
|
+
renderVisibility
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=visibility.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/core/Show/visibility.tsx"],"sourcesContent":["import {\n CSSProperties,\n ElementType,\n ReactElement,\n ReactNode,\n cloneElement,\n isValidElement,\n Children,\n} from \"react\";\n\nexport const CK_BREAKPOINTS = [\n \"us\",\n \"xs\",\n \"sm\",\n \"md\",\n \"lg\",\n \"xl\",\n \"ul\",\n] as const;\nexport type CkBreakpoint = (typeof CK_BREAKPOINTS)[number];\n\ntype VisibilityVariant = \"above\" | \"below\";\n\nexport function renderVisibility(\n variant: VisibilityVariant,\n breakpoint: CkBreakpoint,\n children: ReactNode,\n display: CSSProperties[\"display\"] | undefined,\n as: ElementType | undefined,\n) {\n const baseClassName = `ck-show-${variant}`;\n const displayStyle = display\n ? ({ \"--ck-show-display\": display } as CSSProperties)\n : undefined;\n\n const canClone = !as && isValidElement(children);\n\n if (canClone) {\n const child = children as ReactElement<{\n className?: string;\n style?: CSSProperties;\n }>;\n const mergedClassName = [child.props.className, baseClassName]\n .filter(Boolean)\n .join(\" \");\n const mergedStyle = { ...displayStyle, ...child.props.style };\n return cloneElement(child, {\n className: mergedClassName,\n style: mergedStyle,\n \"data-breakpoint\": breakpoint,\n } as Partial<unknown>);\n }\n\n const isAmbiguous = !as && Children.count(children) !== 1;\n if (process.env.NODE_ENV !== \"production\" && isAmbiguous) {\n console.warn(\n `[ChickenUI] Show${variant === \"above\" ? \"Above\" : \"Below\"} attend un enfant unique pour éviter d'ajouter un wrapper. Un <span> a été ajouté automatiquement. Passez la prop \"as\" pour choisir la balise, ou fournissez un enfant React unique.`,\n );\n }\n\n const Wrapper = as || \"span\";\n return (\n <Wrapper\n className={baseClassName}\n style={displayStyle}\n data-breakpoint={breakpoint}\n >\n {children}\n </Wrapper>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA8DI;AA9DJ;AAAA,EAKE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKO,SAAS,iBACd,SACA,YACA,UACA,SACA,IACA;AACA,QAAM,gBAAgB,WAAW,OAAO;AACxC,QAAM,eAAe,UAChB,EAAE,qBAAqB,QAAQ,IAChC;AAEJ,QAAM,WAAW,CAAC,MAAM,eAAe,QAAQ;AAE/C,MAAI,UAAU;AACZ,UAAM,QAAQ;AAId,UAAM,kBAAkB,CAAC,MAAM,MAAM,WAAW,aAAa,EAC1D,OAAO,OAAO,EACd,KAAK,GAAG;AACX,UAAM,cAAc,kCAAK,eAAiB,MAAM,MAAM;AACtD,WAAO,aAAa,OAAO;AAAA,MACzB,WAAW;AAAA,MACX,OAAO;AAAA,MACP,mBAAmB;AAAA,IACrB,CAAqB;AAAA,EACvB;AAEA,QAAM,cAAc,CAAC,MAAM,SAAS,MAAM,QAAQ,MAAM;AACxD,MAAI,QAAQ,IAAI,aAAa,gBAAgB,aAAa;AACxD,YAAQ;AAAA,MACN,mBAAmB,YAAY,UAAU,UAAU,OAAO;AAAA,IAC5D;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACtB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,OAAO;AAAA,MACP,mBAAiB;AAAA,MAEhB;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ElementType, ReactNode } from 'react';
|
|
3
|
+
import { CkBreakpoint } from '../Show/visibility.mjs';
|
|
4
|
+
|
|
5
|
+
/** Toujours caché visuellement, toujours lu par les lecteurs d'écran. */
|
|
6
|
+
type SrOnlyProps = {
|
|
7
|
+
as?: ElementType;
|
|
8
|
+
focusable?: boolean;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
declare function SrOnly({ as, focusable, children }: SrOnlyProps): react.JSX.Element;
|
|
12
|
+
type SrOnlyBelowProps = {
|
|
13
|
+
breakpoint: CkBreakpoint;
|
|
14
|
+
as?: ElementType;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
declare function SrOnlyBelow({ breakpoint, as, children }: SrOnlyBelowProps): react.JSX.Element;
|
|
18
|
+
type SrOnlyAboveProps = {
|
|
19
|
+
breakpoint: CkBreakpoint;
|
|
20
|
+
as?: ElementType;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
declare function SrOnlyAbove({ breakpoint, as, children }: SrOnlyAboveProps): react.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { SrOnly, SrOnlyAbove, type SrOnlyAboveProps, SrOnlyBelow, type SrOnlyBelowProps, type SrOnlyProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ElementType, ReactNode } from 'react';
|
|
3
|
+
import { CkBreakpoint } from '../Show/visibility.js';
|
|
4
|
+
|
|
5
|
+
/** Toujours caché visuellement, toujours lu par les lecteurs d'écran. */
|
|
6
|
+
type SrOnlyProps = {
|
|
7
|
+
as?: ElementType;
|
|
8
|
+
focusable?: boolean;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
};
|
|
11
|
+
declare function SrOnly({ as, focusable, children }: SrOnlyProps): react.JSX.Element;
|
|
12
|
+
type SrOnlyBelowProps = {
|
|
13
|
+
breakpoint: CkBreakpoint;
|
|
14
|
+
as?: ElementType;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
declare function SrOnlyBelow({ breakpoint, as, children }: SrOnlyBelowProps): react.JSX.Element;
|
|
18
|
+
type SrOnlyAboveProps = {
|
|
19
|
+
breakpoint: CkBreakpoint;
|
|
20
|
+
as?: ElementType;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
declare function SrOnlyAbove({ breakpoint, as, children }: SrOnlyAboveProps): react.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { SrOnly, SrOnlyAbove, type SrOnlyAboveProps, SrOnlyBelow, type SrOnlyBelowProps, type SrOnlyProps };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __export = (target, all) => {
|
|
24
|
+
for (var name in all)
|
|
25
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
+
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
+
var SrOnly_exports = {};
|
|
37
|
+
__export(SrOnly_exports, {
|
|
38
|
+
SrOnly: () => SrOnly,
|
|
39
|
+
SrOnlyAbove: () => SrOnlyAbove,
|
|
40
|
+
SrOnlyBelow: () => SrOnlyBelow
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(SrOnly_exports);
|
|
43
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
+
var import_react = require("react");
|
|
45
|
+
function mergeClone(children, as, className, extraProps = {}, wrapperLabel) {
|
|
46
|
+
const canClone = !as && (0, import_react.isValidElement)(children);
|
|
47
|
+
if (canClone) {
|
|
48
|
+
const child = children;
|
|
49
|
+
const mergedClassName = [child.props.className, className].filter(Boolean).join(" ");
|
|
50
|
+
return (0, import_react.cloneElement)(child, __spreadValues({
|
|
51
|
+
className: mergedClassName
|
|
52
|
+
}, extraProps));
|
|
53
|
+
}
|
|
54
|
+
const isAmbiguous = !as && import_react.Children.count(children) !== 1;
|
|
55
|
+
if (process.env.NODE_ENV !== "production" && isAmbiguous) {
|
|
56
|
+
console.warn(
|
|
57
|
+
`[ChickenUI] ${wrapperLabel} attend un enfant unique pour \xE9viter d'ajouter un wrapper. Un <span> a \xE9t\xE9 ajout\xE9 automatiquement. Passez la prop "as" pour choisir la balise, ou fournissez un enfant React unique.`
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
const Wrapper = as || "span";
|
|
61
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Wrapper, __spreadProps(__spreadValues({ className }, extraProps), { children }));
|
|
62
|
+
}
|
|
63
|
+
function SrOnly({ as, focusable, children }) {
|
|
64
|
+
const className = focusable ? "ck-sr-only ck-sr-only-focusable" : "ck-sr-only";
|
|
65
|
+
return mergeClone(children, as, className, {}, "SrOnly");
|
|
66
|
+
}
|
|
67
|
+
function SrOnlyBelow({ breakpoint, as, children }) {
|
|
68
|
+
return mergeClone(
|
|
69
|
+
children,
|
|
70
|
+
as,
|
|
71
|
+
"ck-sr-only-below",
|
|
72
|
+
{ "data-breakpoint": breakpoint },
|
|
73
|
+
"SrOnlyBelow"
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
function SrOnlyAbove({ breakpoint, as, children }) {
|
|
77
|
+
return mergeClone(
|
|
78
|
+
children,
|
|
79
|
+
as,
|
|
80
|
+
"ck-sr-only-above",
|
|
81
|
+
{ "data-breakpoint": breakpoint },
|
|
82
|
+
"SrOnlyAbove"
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
+
0 && (module.exports = {
|
|
87
|
+
SrOnly,
|
|
88
|
+
SrOnlyAbove,
|
|
89
|
+
SrOnlyBelow
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=SrOnly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/core/SrOnly/SrOnly.tsx"],"sourcesContent":["import {\n ElementType,\n ReactElement,\n ReactNode,\n cloneElement,\n isValidElement,\n Children,\n} from \"react\";\nimport { CkBreakpoint } from \"../Show/visibility\";\n\nfunction mergeClone(\n children: ReactNode,\n as: ElementType | undefined,\n className: string,\n extraProps: Record<string, unknown> = {},\n wrapperLabel: string,\n) {\n const canClone = !as && isValidElement(children);\n\n if (canClone) {\n const child = children as ReactElement<{ className?: string }>;\n const mergedClassName = [child.props.className, className]\n .filter(Boolean)\n .join(\" \");\n return cloneElement(child, {\n className: mergedClassName,\n ...extraProps,\n } as Partial<unknown>);\n }\n\n // Repli en wrapper : on n'avertit QUE si l'appelant a fourni plusieurs enfants\n // (cas ambigu), pas pour du texte brut ou un nombre (cas normal, seule option possible).\n const isAmbiguous = !as && Children.count(children) !== 1;\n if (process.env.NODE_ENV !== \"production\" && isAmbiguous) {\n console.warn(\n `[ChickenUI] ${wrapperLabel} attend un enfant unique pour éviter d'ajouter un wrapper. Un <span> a été ajouté automatiquement. Passez la prop \"as\" pour choisir la balise, ou fournissez un enfant React unique.`,\n );\n }\n\n const Wrapper = as || \"span\";\n return (\n <Wrapper className={className} {...extraProps}>\n {children}\n </Wrapper>\n );\n}\n\n/** Toujours caché visuellement, toujours lu par les lecteurs d'écran. */\nexport type SrOnlyProps = {\n as?: ElementType;\n focusable?: boolean;\n children: ReactNode;\n};\n\nexport function SrOnly({ as, focusable, children }: SrOnlyProps) {\n const className = focusable\n ? \"ck-sr-only ck-sr-only-focusable\"\n : \"ck-sr-only\";\n return mergeClone(children, as, className, {}, \"SrOnly\");\n}\n\nexport type SrOnlyBelowProps = {\n breakpoint: CkBreakpoint;\n as?: ElementType;\n children: ReactNode;\n};\n\nexport function SrOnlyBelow({ breakpoint, as, children }: SrOnlyBelowProps) {\n return mergeClone(\n children,\n as,\n \"ck-sr-only-below\",\n { \"data-breakpoint\": breakpoint },\n \"SrOnlyBelow\",\n );\n}\n\nexport type SrOnlyAboveProps = {\n breakpoint: CkBreakpoint;\n as?: ElementType;\n children: ReactNode;\n};\n\nexport function SrOnlyAbove({ breakpoint, as, children }: SrOnlyAboveProps) {\n return mergeClone(\n children,\n as,\n \"ck-sr-only-above\",\n { \"data-breakpoint\": breakpoint },\n \"SrOnlyAbove\",\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyCI;AAzCJ,mBAOO;AAGP,SAAS,WACP,UACA,IACA,WACA,aAAsC,CAAC,GACvC,cACA;AACA,QAAM,WAAW,CAAC,UAAM,6BAAe,QAAQ;AAE/C,MAAI,UAAU;AACZ,UAAM,QAAQ;AACd,UAAM,kBAAkB,CAAC,MAAM,MAAM,WAAW,SAAS,EACtD,OAAO,OAAO,EACd,KAAK,GAAG;AACX,eAAO,2BAAa,OAAO;AAAA,MACzB,WAAW;AAAA,OACR,WACgB;AAAA,EACvB;AAIA,QAAM,cAAc,CAAC,MAAM,sBAAS,MAAM,QAAQ,MAAM;AACxD,MAAI,QAAQ,IAAI,aAAa,gBAAgB,aAAa;AACxD,YAAQ;AAAA,MACN,eAAe,YAAY;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACtB,SACE,4CAAC,wCAAQ,aAA0B,aAAlC,EACE,WACH;AAEJ;AASO,SAAS,OAAO,EAAE,IAAI,WAAW,SAAS,GAAgB;AAC/D,QAAM,YAAY,YACd,oCACA;AACJ,SAAO,WAAW,UAAU,IAAI,WAAW,CAAC,GAAG,QAAQ;AACzD;AAQO,SAAS,YAAY,EAAE,YAAY,IAAI,SAAS,GAAqB;AAC1E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,mBAAmB,WAAW;AAAA,IAChC;AAAA,EACF;AACF;AAQO,SAAS,YAAY,EAAE,YAAY,IAAI,SAAS,GAAqB;AAC1E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,mBAAmB,WAAW;AAAA,IAChC;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { jsx } from "react/jsx-runtime";
|
|
21
|
+
import {
|
|
22
|
+
cloneElement,
|
|
23
|
+
isValidElement,
|
|
24
|
+
Children
|
|
25
|
+
} from "react";
|
|
26
|
+
function mergeClone(children, as, className, extraProps = {}, wrapperLabel) {
|
|
27
|
+
const canClone = !as && isValidElement(children);
|
|
28
|
+
if (canClone) {
|
|
29
|
+
const child = children;
|
|
30
|
+
const mergedClassName = [child.props.className, className].filter(Boolean).join(" ");
|
|
31
|
+
return cloneElement(child, __spreadValues({
|
|
32
|
+
className: mergedClassName
|
|
33
|
+
}, extraProps));
|
|
34
|
+
}
|
|
35
|
+
const isAmbiguous = !as && Children.count(children) !== 1;
|
|
36
|
+
if (process.env.NODE_ENV !== "production" && isAmbiguous) {
|
|
37
|
+
console.warn(
|
|
38
|
+
`[ChickenUI] ${wrapperLabel} attend un enfant unique pour \xE9viter d'ajouter un wrapper. Un <span> a \xE9t\xE9 ajout\xE9 automatiquement. Passez la prop "as" pour choisir la balise, ou fournissez un enfant React unique.`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
const Wrapper = as || "span";
|
|
42
|
+
return /* @__PURE__ */ jsx(Wrapper, __spreadProps(__spreadValues({ className }, extraProps), { children }));
|
|
43
|
+
}
|
|
44
|
+
function SrOnly({ as, focusable, children }) {
|
|
45
|
+
const className = focusable ? "ck-sr-only ck-sr-only-focusable" : "ck-sr-only";
|
|
46
|
+
return mergeClone(children, as, className, {}, "SrOnly");
|
|
47
|
+
}
|
|
48
|
+
function SrOnlyBelow({ breakpoint, as, children }) {
|
|
49
|
+
return mergeClone(
|
|
50
|
+
children,
|
|
51
|
+
as,
|
|
52
|
+
"ck-sr-only-below",
|
|
53
|
+
{ "data-breakpoint": breakpoint },
|
|
54
|
+
"SrOnlyBelow"
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
function SrOnlyAbove({ breakpoint, as, children }) {
|
|
58
|
+
return mergeClone(
|
|
59
|
+
children,
|
|
60
|
+
as,
|
|
61
|
+
"ck-sr-only-above",
|
|
62
|
+
{ "data-breakpoint": breakpoint },
|
|
63
|
+
"SrOnlyAbove"
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
SrOnly,
|
|
68
|
+
SrOnlyAbove,
|
|
69
|
+
SrOnlyBelow
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=SrOnly.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../lib/core/SrOnly/SrOnly.tsx"],"sourcesContent":["import {\n ElementType,\n ReactElement,\n ReactNode,\n cloneElement,\n isValidElement,\n Children,\n} from \"react\";\nimport { CkBreakpoint } from \"../Show/visibility\";\n\nfunction mergeClone(\n children: ReactNode,\n as: ElementType | undefined,\n className: string,\n extraProps: Record<string, unknown> = {},\n wrapperLabel: string,\n) {\n const canClone = !as && isValidElement(children);\n\n if (canClone) {\n const child = children as ReactElement<{ className?: string }>;\n const mergedClassName = [child.props.className, className]\n .filter(Boolean)\n .join(\" \");\n return cloneElement(child, {\n className: mergedClassName,\n ...extraProps,\n } as Partial<unknown>);\n }\n\n // Repli en wrapper : on n'avertit QUE si l'appelant a fourni plusieurs enfants\n // (cas ambigu), pas pour du texte brut ou un nombre (cas normal, seule option possible).\n const isAmbiguous = !as && Children.count(children) !== 1;\n if (process.env.NODE_ENV !== \"production\" && isAmbiguous) {\n console.warn(\n `[ChickenUI] ${wrapperLabel} attend un enfant unique pour éviter d'ajouter un wrapper. Un <span> a été ajouté automatiquement. Passez la prop \"as\" pour choisir la balise, ou fournissez un enfant React unique.`,\n );\n }\n\n const Wrapper = as || \"span\";\n return (\n <Wrapper className={className} {...extraProps}>\n {children}\n </Wrapper>\n );\n}\n\n/** Toujours caché visuellement, toujours lu par les lecteurs d'écran. */\nexport type SrOnlyProps = {\n as?: ElementType;\n focusable?: boolean;\n children: ReactNode;\n};\n\nexport function SrOnly({ as, focusable, children }: SrOnlyProps) {\n const className = focusable\n ? \"ck-sr-only ck-sr-only-focusable\"\n : \"ck-sr-only\";\n return mergeClone(children, as, className, {}, \"SrOnly\");\n}\n\nexport type SrOnlyBelowProps = {\n breakpoint: CkBreakpoint;\n as?: ElementType;\n children: ReactNode;\n};\n\nexport function SrOnlyBelow({ breakpoint, as, children }: SrOnlyBelowProps) {\n return mergeClone(\n children,\n as,\n \"ck-sr-only-below\",\n { \"data-breakpoint\": breakpoint },\n \"SrOnlyBelow\",\n );\n}\n\nexport type SrOnlyAboveProps = {\n breakpoint: CkBreakpoint;\n as?: ElementType;\n children: ReactNode;\n};\n\nexport function SrOnlyAbove({ breakpoint, as, children }: SrOnlyAboveProps) {\n return mergeClone(\n children,\n as,\n \"ck-sr-only-above\",\n { \"data-breakpoint\": breakpoint },\n \"SrOnlyAbove\",\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAyCI;AAzCJ;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,WACP,UACA,IACA,WACA,aAAsC,CAAC,GACvC,cACA;AACA,QAAM,WAAW,CAAC,MAAM,eAAe,QAAQ;AAE/C,MAAI,UAAU;AACZ,UAAM,QAAQ;AACd,UAAM,kBAAkB,CAAC,MAAM,MAAM,WAAW,SAAS,EACtD,OAAO,OAAO,EACd,KAAK,GAAG;AACX,WAAO,aAAa,OAAO;AAAA,MACzB,WAAW;AAAA,OACR,WACgB;AAAA,EACvB;AAIA,QAAM,cAAc,CAAC,MAAM,SAAS,MAAM,QAAQ,MAAM;AACxD,MAAI,QAAQ,IAAI,aAAa,gBAAgB,aAAa;AACxD,YAAQ;AAAA,MACN,eAAe,YAAY;AAAA,IAC7B;AAAA,EACF;AAEA,QAAM,UAAU,MAAM;AACtB,SACE,oBAAC,wCAAQ,aAA0B,aAAlC,EACE,WACH;AAEJ;AASO,SAAS,OAAO,EAAE,IAAI,WAAW,SAAS,GAAgB;AAC/D,QAAM,YAAY,YACd,oCACA;AACJ,SAAO,WAAW,UAAU,IAAI,WAAW,CAAC,GAAG,QAAQ;AACzD;AAQO,SAAS,YAAY,EAAE,YAAY,IAAI,SAAS,GAAqB;AAC1E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,mBAAmB,WAAW;AAAA,IAChC;AAAA,EACF;AACF;AAQO,SAAS,YAAY,EAAE,YAAY,IAAI,SAAS,GAAqB;AAC1E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,EAAE,mBAAmB,WAAW;AAAA,IAChC;AAAA,EACF;AACF;","names":[]}
|