linkedunion-design-kit 1.5.2 → 1.5.3
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/app/layout.d.ts +1 -1
- package/dist/app/layout.js +7 -11
- package/dist/app/layout.jsx +13 -0
- package/dist/app/page.js +4 -10
- package/dist/app/page.jsx +71 -0
- package/dist/build/types/app/layout.d.ts +12 -0
- package/dist/build/types/app/layout.js +22 -0
- package/dist/build/types/app/page.d.ts +12 -0
- package/dist/build/types/app/page.js +22 -0
- package/dist/index.d.ts +13 -12
- package/dist/index.js +13 -30
- package/dist/jest.config.js +15 -21
- package/dist/jest.setup.d.ts +0 -1
- package/dist/jest.setup.js +3 -12
- package/dist/src/components/Accordion/Accordion.d.ts +5 -0
- package/dist/src/components/Accordion/Accordion.js +7 -0
- package/dist/{components/Color/TextColor/TextColor.stories.d.ts → src/components/Accordion/Accordion.stories.d.ts} +2 -2
- package/dist/src/components/Accordion/Accordion.stories.js +32 -0
- package/dist/src/components/Accordion/EditorAccordion.d.ts +5 -0
- package/dist/src/components/Accordion/EditorAccordion.js +7 -0
- package/dist/src/components/Accordion/EditorAccordion.stories.d.ts +6 -0
- package/dist/src/components/Accordion/EditorAccordion.stories.js +33 -0
- package/dist/src/components/Accordion/type.d.ts +5 -0
- package/dist/{components → src/components}/Avatar/Avatar.d.ts +1 -1
- package/dist/src/components/Avatar/Avatar.js +12 -0
- package/dist/src/components/Avatar/Avatar.jsx +17 -0
- package/dist/src/components/Avatar/Avatar.stories.js +43 -0
- package/dist/src/components/Avatar/Avatar.stories.jsx +31 -0
- package/dist/src/components/Avatar/Avatar.test.js +50 -0
- package/dist/src/components/Avatar/Avatar.test.jsx +51 -0
- package/dist/src/components/Avatar/index.d.ts +32 -0
- package/dist/src/components/Avatar/index.js +32 -0
- package/dist/src/components/Avatar/type.d.ts +11 -0
- package/dist/src/components/Button/Button.d.ts +3 -0
- package/dist/src/components/Button/Button.js +7 -0
- package/dist/src/components/Button/Button.jsx +10 -0
- package/dist/{components → src/components}/Button/Button.stories.d.ts +2 -1
- package/dist/src/components/Button/Button.stories.js +56 -0
- package/dist/src/components/Button/Button.stories.jsx +44 -0
- package/dist/src/components/Button/Button.test.js +62 -0
- package/dist/src/components/Button/Button.test.jsx +65 -0
- package/dist/src/components/Button/IconButton.d.ts +3 -0
- package/dist/src/components/Button/IconButton.js +8 -0
- package/dist/src/components/Button/IconButton.jsx +9 -0
- package/dist/src/components/Button/IconButton.stories.d.ts +4 -0
- package/dist/src/components/Button/IconButton.stories.js +53 -0
- package/dist/src/components/Button/IconButton.stories.jsx +41 -0
- package/dist/src/components/Button/IconButton.test.js +30 -0
- package/dist/src/components/Button/IconButton.test.jsx +29 -0
- package/dist/src/components/Button/index.d.ts +39 -0
- package/dist/src/components/Button/index.js +39 -0
- package/dist/src/components/Button/type.d.ts +25 -0
- package/dist/src/components/ColorPicker/ColorPicker.d.ts +3 -0
- package/dist/src/components/ColorPicker/ColorPicker.js +27 -0
- package/dist/src/components/ColorPicker/ColorPicker.jsx +34 -0
- package/dist/src/components/ColorPicker/ColorPicker.stories.d.ts +5 -0
- package/dist/src/components/ColorPicker/ColorPicker.stories.js +24 -0
- package/dist/src/components/ColorPicker/ColorPicker.stories.jsx +12 -0
- package/dist/src/components/ColorPicker/type.d.ts +4 -0
- package/dist/src/components/Colors/color.d.ts +4 -0
- package/dist/src/components/Colors/color.js +6 -0
- package/dist/src/components/Colors/color.jsx +5 -0
- package/dist/src/components/Colors/color.stories.d.ts +7 -0
- package/dist/src/components/Colors/color.stories.js +32 -0
- package/dist/src/components/Colors/color.stories.jsx +20 -0
- package/dist/src/components/Colors/color.test.js +24 -0
- package/dist/src/components/Colors/color.test.jsx +23 -0
- package/dist/src/components/EditorTooltip/EditorTooltip.d.ts +4 -0
- package/dist/src/components/EditorTooltip/EditorTooltip.js +9 -0
- package/dist/src/components/EditorTooltip/EditorTooltip.jsx +18 -0
- package/dist/src/components/EditorTooltip/EditorTooltip.stories.d.ts +6 -0
- package/dist/src/components/EditorTooltip/EditorTooltip.stories.js +24 -0
- package/dist/src/components/EditorTooltip/EditorTooltip.stories.jsx +12 -0
- package/dist/src/components/EditorTooltip/type.d.ts +3 -0
- package/dist/{components → src/components}/Icons/IconList.test.js +18 -20
- package/dist/src/components/Icons/IconList.test.jsx +57 -0
- package/dist/src/components/Icons/IconView.js +8 -0
- package/dist/src/components/Icons/IconView.jsx +25 -0
- package/dist/{components → src/components}/Icons/IconView.stories.js +6 -9
- package/dist/src/components/Icons/IconView.stories.jsx +8 -0
- package/dist/src/components/Icons/LUIcon.d.ts +3 -0
- package/dist/src/components/Icons/LUIcon.js +32 -0
- package/dist/src/components/Icons/LUIcon.jsx +31 -0
- package/dist/src/components/Icons/LUIcon.stories.js +44 -0
- package/dist/src/components/Icons/LUIcon.stories.jsx +32 -0
- package/dist/src/components/Icons/SingleIcon.test.js +67 -0
- package/dist/src/components/Icons/SingleIcon.test.jsx +55 -0
- package/dist/src/components/Icons/index.d.ts +16 -0
- package/dist/src/components/Icons/index.js +16 -0
- package/dist/src/components/Icons/type.d.ts +8 -0
- package/dist/src/components/Icons/type.js +1 -0
- package/dist/src/components/ImageUploader/ImageUploader.stories.d.ts +6 -0
- package/dist/src/components/ImageUploader/ImageUploader.stories.js +18 -0
- package/dist/src/components/ImageUploader/type.d.ts +8 -0
- package/dist/src/components/ImageUploader/type.js +1 -0
- package/dist/src/components/Images/LuImage.d.ts +3 -0
- package/dist/{components/Typography/Body/Body.js → src/components/Images/LuImage.js} +8 -9
- package/dist/src/components/Images/LuImage.jsx +19 -0
- package/dist/src/components/Images/LuImage.stories.d.ts +6 -0
- package/dist/src/components/Images/LuImage.stories.js +166 -0
- package/dist/src/components/Images/LuImage.stories.jsx +154 -0
- package/dist/src/components/Images/LuImage.test.d.ts +1 -0
- package/dist/src/components/Images/LuImage.test.js +56 -0
- package/dist/src/components/Images/LuImage.test.jsx +44 -0
- package/dist/src/components/Images/index.d.ts +19 -0
- package/dist/src/components/Images/index.js +19 -0
- package/dist/src/components/Images/type.d.ts +7 -0
- package/dist/src/components/Images/type.js +1 -0
- package/dist/src/components/Input/Input.d.ts +3 -0
- package/dist/{components/Typography/Headings/Headings.js → src/components/Input/Input.js} +6 -9
- package/dist/src/components/Input/Input.jsx +19 -0
- package/dist/src/components/Input/Input.stories.d.ts +5 -0
- package/dist/src/components/Input/Input.stories.js +30 -0
- package/dist/src/components/Input/Input.stories.jsx +18 -0
- package/dist/src/components/Input/index.d.ts +10 -0
- package/dist/src/components/Input/index.js +10 -0
- package/dist/src/components/Input/type.d.ts +8 -0
- package/dist/src/components/Input/type.js +1 -0
- package/dist/src/components/Label/Label.d.ts +3 -0
- package/dist/{components/Typography/Display/Display.js → src/components/Label/Label.js} +6 -9
- package/dist/src/components/Label/Label.jsx +19 -0
- package/dist/src/components/Label/Label.stories.d.ts +5 -0
- package/dist/src/components/Label/Label.stories.js +36 -0
- package/dist/src/components/Label/Label.stories.jsx +24 -0
- package/dist/src/components/Label/index.d.ts +4 -0
- package/dist/src/components/Label/index.js +5 -0
- package/dist/src/components/Label/type.d.ts +9 -0
- package/dist/src/components/Label/type.js +1 -0
- package/dist/src/components/MediaCard/Card.d.ts +3 -0
- package/dist/src/components/MediaCard/Card.js +45 -0
- package/dist/src/components/MediaCard/Card.jsx +36 -0
- package/dist/src/components/MediaCard/Card.stories.js +57 -0
- package/dist/src/components/MediaCard/Card.stories.jsx +56 -0
- package/dist/src/components/MediaCard/Card.test.js +28 -0
- package/dist/src/components/MediaCard/Card.test.jsx +27 -0
- package/dist/{components → src/components}/MediaCard/ContactProfile/ContactProfile.d.ts +1 -1
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.js +27 -0
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.jsx +22 -0
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.test.d.ts +1 -0
- package/dist/src/components/MediaCard/ContactProfile/ContactProfile.test.js +61 -0
- package/dist/{components/MediaCard/ContactProfile/ContactProfile.test.js → src/components/MediaCard/ContactProfile/ContactProfile.test.jsx} +16 -13
- package/dist/{components → src/components}/MediaCard/ContactProfile/ContactProfileTheme1.d.ts +1 -1
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.js +8 -0
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.jsx +28 -0
- package/dist/{components → src/components}/MediaCard/ContactProfile/ContactProfileTheme1.test.js +15 -38
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme1.test.jsx +87 -0
- package/dist/{components → src/components}/MediaCard/ContactProfile/ContactProfileTheme2.d.ts +1 -1
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.js +8 -0
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.jsx +24 -0
- package/dist/{components → src/components}/MediaCard/ContactProfile/ContactProfileTheme2.test.js +15 -38
- package/dist/src/components/MediaCard/ContactProfile/ContactProfileTheme2.test.jsx +87 -0
- package/dist/{components → src/components}/MediaCard/PostByCategory/PostByCategory.d.ts +1 -1
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.js +31 -0
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.jsx +24 -0
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.test.d.ts +1 -0
- package/dist/src/components/MediaCard/PostByCategory/PostByCategory.test.js +62 -0
- package/dist/{components/MediaCard/PostByCategory/PostByCategory.test.js → src/components/MediaCard/PostByCategory/PostByCategory.test.jsx} +17 -13
- package/dist/{components → src/components}/MediaCard/PostByCategory/PostByCategoryTheme1.d.ts +1 -1
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.js +8 -0
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.jsx +26 -0
- package/dist/{components → src/components}/MediaCard/PostByCategory/PostByCategoryTheme1.test.js +15 -38
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme1.test.jsx +87 -0
- package/dist/{components → src/components}/MediaCard/PostByCategory/PostByCategoryTheme2.d.ts +1 -1
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.js +8 -0
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.jsx +24 -0
- package/dist/{components → src/components}/MediaCard/PostByCategory/PostByCategoryTheme2.test.js +16 -39
- package/dist/src/components/MediaCard/PostByCategory/PostByCategoryTheme2.test.jsx +87 -0
- package/dist/{components → src/components}/MediaCard/index.js +2 -5
- package/dist/src/components/MediaCard/type.d.ts +26 -0
- package/dist/src/components/MediaCard/type.js +1 -0
- package/dist/src/components/Switch/Switch.d.ts +3 -0
- package/dist/src/components/Switch/Switch.js +7 -0
- package/dist/src/components/Switch/Switch.jsx +6 -0
- package/dist/src/components/Switch/Switch.stories.d.ts +5 -0
- package/dist/src/components/Switch/Switch.stories.js +44 -0
- package/dist/src/components/Switch/Switch.stories.jsx +32 -0
- package/dist/src/components/Switch/type.d.ts +5 -0
- package/dist/src/components/Switch/type.js +1 -0
- package/dist/src/components/Title/Title.js +8 -0
- package/dist/src/components/Title/Title.jsx +8 -0
- package/dist/src/components/Title/Title.module.css +43 -0
- package/dist/{components → src/components}/Title/Title.stories.js +9 -15
- package/dist/src/components/Title/Title.stories.jsx +37 -0
- package/dist/src/components/Title/Title.test.d.ts +1 -0
- package/dist/src/components/Title/Title.test.js +25 -0
- package/dist/src/components/Title/Title.test.jsx +24 -0
- package/dist/src/components/Typography/Typography.d.ts +3 -0
- package/dist/src/components/Typography/Typography.js +29 -0
- package/dist/src/components/Typography/Typography.jsx +19 -0
- package/dist/src/components/Typography/Typography.stories.d.ts +5 -0
- package/dist/src/components/Typography/Typography.stories.js +37 -0
- package/dist/src/components/Typography/Typography.stories.jsx +25 -0
- package/dist/src/components/Typography/type.d.ts +7 -0
- package/dist/src/components/Typography/type.js +1 -0
- package/dist/src/components/ui/accordion.d.ts +7 -0
- package/dist/src/components/ui/accordion.js +43 -0
- package/dist/src/components/ui/button.d.ts +10 -0
- package/dist/src/components/ui/button.js +54 -0
- package/dist/src/components/ui/button.jsx +43 -0
- package/dist/src/components/ui/imageUploader.d.ts +3 -0
- package/dist/src/components/ui/imageUploader.js +68 -0
- package/dist/src/components/ui/input.d.ts +3 -0
- package/dist/src/components/ui/input.js +29 -0
- package/dist/src/components/ui/input.jsx +18 -0
- package/dist/src/components/ui/label.d.ts +12 -0
- package/dist/src/components/ui/label.js +41 -0
- package/dist/src/components/ui/label.jsx +30 -0
- package/dist/src/components/ui/switch.d.ts +22 -0
- package/dist/src/components/ui/switch.js +70 -0
- package/dist/src/components/ui/switch.jsx +61 -0
- package/dist/src/components/ui/tooltip.d.ts +7 -0
- package/dist/src/components/ui/tooltip.js +42 -0
- package/dist/src/components/ui/tooltip.jsx +38 -0
- package/dist/src/components/ui/typography.d.ts +26 -0
- package/dist/src/components/ui/typography.js +65 -0
- package/dist/src/components/ui/typography.jsx +56 -0
- package/dist/src/lib/utils.d.ts +2 -0
- package/dist/src/lib/utils.js +9 -0
- package/dist/src/utils/colors.d.ts +70 -0
- package/dist/src/utils/colors.js +70 -0
- package/dist/{utils → src/utils}/constants.d.ts +2 -0
- package/dist/src/utils/constants.js +4 -0
- package/dist/src/utils/enums.d.ts +9 -0
- package/dist/src/utils/enums.js +11 -0
- package/dist/{utils → src/utils}/iconList.js +1 -4
- package/dist/src/utils/index.d.ts +18 -0
- package/dist/src/utils/index.js +20 -0
- package/dist/styles/global.css +2719 -4132
- package/dist/tailwind.config.js +10 -178
- package/package.json +19 -7
- package/dist/.next/types/app/page.d.ts +0 -8
- package/dist/.next/types/app/page.js +0 -57
- package/dist/app/scripts.d.ts +0 -2
- package/dist/app/scripts.js +0 -16
- package/dist/components/Avatar/Avatar.js +0 -15
- package/dist/components/Avatar/Avatar.stories.js +0 -52
- package/dist/components/Avatar/Avatar.test.js +0 -54
- package/dist/components/Border/BorderRadius/BorderRadius.d.ts +0 -2
- package/dist/components/Border/BorderRadius/BorderRadius.js +0 -11
- package/dist/components/Border/BorderRadius/BorderRadius.stories.d.ts +0 -4
- package/dist/components/Border/BorderRadius/BorderRadius.stories.js +0 -38
- package/dist/components/Border/BorderRadius/BorderRadius.test.js +0 -25
- package/dist/components/Border/BorderRadius/BorderRadiusTable.d.ts +0 -1
- package/dist/components/Border/BorderRadius/BorderRadiusTable.js +0 -9
- package/dist/components/Border/BorderRadius/BorderRadiusView.d.ts +0 -2
- package/dist/components/Border/BorderRadius/BorderRadiusView.js +0 -9
- package/dist/components/Border/BorderWidth/BorderWidth.d.ts +0 -2
- package/dist/components/Border/BorderWidth/BorderWidth.js +0 -11
- package/dist/components/Border/BorderWidth/BorderWidth.stories.d.ts +0 -4
- package/dist/components/Border/BorderWidth/BorderWidth.stories.js +0 -38
- package/dist/components/Border/BorderWidth/BorderWidth.test.js +0 -25
- package/dist/components/Border/BorderWidth/BorderWidthTable.d.ts +0 -1
- package/dist/components/Border/BorderWidth/BorderWidthTable.js +0 -9
- package/dist/components/Border/BorderWidth/ViewBorderWidth.d.ts +0 -2
- package/dist/components/Border/BorderWidth/ViewBorderWidth.js +0 -9
- package/dist/components/Button/Button.d.ts +0 -3
- package/dist/components/Button/Button.js +0 -22
- package/dist/components/Button/Button.stories.js +0 -160
- package/dist/components/Button/Button.test.d.ts +0 -1
- package/dist/components/Button/Button.test.js +0 -54
- package/dist/components/Button/index.d.ts +0 -4
- package/dist/components/Button/index.js +0 -8
- package/dist/components/Color/BackgroundColor/BackgroundColor.d.ts +0 -2
- package/dist/components/Color/BackgroundColor/BackgroundColor.js +0 -9
- package/dist/components/Color/BackgroundColor/BackgroundColor.stories.d.ts +0 -10
- package/dist/components/Color/BackgroundColor/BackgroundColor.stories.js +0 -103
- package/dist/components/Color/BackgroundColor/BackgroundColor.test.js +0 -17
- package/dist/components/Color/BackgroundColor/index.d.ts +0 -7
- package/dist/components/Color/BackgroundColor/index.js +0 -18
- package/dist/components/Color/Color.test.d.ts +0 -1
- package/dist/components/Color/Color.test.js +0 -38
- package/dist/components/Color/TextColor/TextColor.d.ts +0 -3
- package/dist/components/Color/TextColor/TextColor.js +0 -9
- package/dist/components/Color/TextColor/TextColor.stories.js +0 -35
- package/dist/components/Color/TextColor/TextColor.test.d.ts +0 -1
- package/dist/components/Color/TextColor/TextColor.test.js +0 -43
- package/dist/components/Icons/IconView.js +0 -11
- package/dist/components/Icons/LUIcon.d.ts +0 -3
- package/dist/components/Icons/LUIcon.js +0 -11
- package/dist/components/Icons/LUIcon.stories.js +0 -56
- package/dist/components/Icons/SingleIcon.test.js +0 -53
- package/dist/components/Images/LuImage.d.ts +0 -3
- package/dist/components/Images/LuImage.js +0 -14
- package/dist/components/Images/LuImage.stories.d.ts +0 -4
- package/dist/components/Images/LuImage.stories.js +0 -53
- package/dist/components/Images/LuImage.test.d.ts +0 -1
- package/dist/components/Images/LuImage.test.js +0 -68
- package/dist/components/MediaCard/Card.d.ts +0 -3
- package/dist/components/MediaCard/Card.js +0 -48
- package/dist/components/MediaCard/Card.stories.js +0 -61
- package/dist/components/MediaCard/Card.test.js +0 -33
- package/dist/components/MediaCard/ContactProfile/ContactProfile.js +0 -27
- package/dist/components/MediaCard/ContactProfile/ContactProfileTheme1.js +0 -16
- package/dist/components/MediaCard/ContactProfile/ContactProfileTheme2.js +0 -16
- package/dist/components/MediaCard/PostByCategory/PostByCategory.js +0 -27
- package/dist/components/MediaCard/PostByCategory/PostByCategoryTheme1.js +0 -16
- package/dist/components/MediaCard/PostByCategory/PostByCategoryTheme2.js +0 -16
- package/dist/components/MediaCard/card.module.css +0 -52
- package/dist/components/Size/MinWidthHeight.d.ts +0 -3
- package/dist/components/Size/MinWidthHeight.js +0 -8
- package/dist/components/Size/MinWidthHeight.stories.d.ts +0 -5
- package/dist/components/Size/MinWidthHeight.stories.js +0 -46
- package/dist/components/Size/MinWidthHeight.test.d.ts +0 -1
- package/dist/components/Size/MinWidthHeight.test.js +0 -34
- package/dist/components/Size/Size.d.ts +0 -4
- package/dist/components/Size/Size.js +0 -10
- package/dist/components/Size/Size.stories.d.ts +0 -6
- package/dist/components/Size/Size.stories.js +0 -35
- package/dist/components/Size/Size.test.d.ts +0 -1
- package/dist/components/Size/Size.test.js +0 -73
- package/dist/components/Size/WidthAndHeight.test.d.ts +0 -1
- package/dist/components/Size/WidthAndHeight.test.js +0 -34
- package/dist/components/Size/WidthHeight.d.ts +0 -3
- package/dist/components/Size/WidthHeight.js +0 -8
- package/dist/components/Size/WidthHeight.stories.d.ts +0 -5
- package/dist/components/Size/WidthHeight.stories.js +0 -46
- package/dist/components/Spacing/Margin/Margin.d.ts +0 -1
- package/dist/components/Spacing/Margin/Margin.js +0 -9
- package/dist/components/Spacing/Margin/MarginBottom.d.ts +0 -1
- package/dist/components/Spacing/Margin/MarginBottom.js +0 -9
- package/dist/components/Spacing/Margin/MarginLeft.d.ts +0 -1
- package/dist/components/Spacing/Margin/MarginLeft.js +0 -9
- package/dist/components/Spacing/Margin/MarginRight.d.ts +0 -1
- package/dist/components/Spacing/Margin/MarginRight.js +0 -9
- package/dist/components/Spacing/Margin/MarginToken.d.ts +0 -1
- package/dist/components/Spacing/Margin/MarginToken.js +0 -16
- package/dist/components/Spacing/Margin/MarginToken.stories.d.ts +0 -4
- package/dist/components/Spacing/Margin/MarginToken.stories.js +0 -22
- package/dist/components/Spacing/Margin/MarginToken.test.js +0 -22
- package/dist/components/Spacing/Margin/MarginTop.d.ts +0 -1
- package/dist/components/Spacing/Margin/MarginTop.js +0 -9
- package/dist/components/Spacing/Margin/MarginX.d.ts +0 -1
- package/dist/components/Spacing/Margin/MarginX.js +0 -9
- package/dist/components/Spacing/Margin/MarginY.d.ts +0 -1
- package/dist/components/Spacing/Margin/MarginY.js +0 -9
- package/dist/components/Spacing/Padding/Padding.d.ts +0 -1
- package/dist/components/Spacing/Padding/Padding.js +0 -9
- package/dist/components/Spacing/Padding/PaddingBottom.d.ts +0 -1
- package/dist/components/Spacing/Padding/PaddingBottom.js +0 -9
- package/dist/components/Spacing/Padding/PaddingLeft.d.ts +0 -1
- package/dist/components/Spacing/Padding/PaddingLeft.js +0 -9
- package/dist/components/Spacing/Padding/PaddingRight.d.ts +0 -1
- package/dist/components/Spacing/Padding/PaddingRight.js +0 -9
- package/dist/components/Spacing/Padding/PaddingToken.d.ts +0 -1
- package/dist/components/Spacing/Padding/PaddingToken.js +0 -16
- package/dist/components/Spacing/Padding/PaddingToken.stories.d.ts +0 -4
- package/dist/components/Spacing/Padding/PaddingToken.stories.js +0 -22
- package/dist/components/Spacing/Padding/PaddingToken.test.js +0 -22
- package/dist/components/Spacing/Padding/PaddingTop.d.ts +0 -1
- package/dist/components/Spacing/Padding/PaddingTop.js +0 -9
- package/dist/components/Spacing/Padding/PaddingX.d.ts +0 -1
- package/dist/components/Spacing/Padding/PaddingX.js +0 -9
- package/dist/components/Spacing/Padding/PaddingY.d.ts +0 -1
- package/dist/components/Spacing/Padding/PaddingY.js +0 -9
- package/dist/components/Title/Title.js +0 -13
- package/dist/components/Title/Title.module.css +0 -56
- package/dist/components/Title/Title.test.js +0 -30
- package/dist/components/Typography/Body/Body.d.ts +0 -3
- package/dist/components/Typography/Body/Body.stories.d.ts +0 -6
- package/dist/components/Typography/Body/Body.stories.js +0 -75
- package/dist/components/Typography/Body/body.test.d.ts +0 -1
- package/dist/components/Typography/Body/body.test.js +0 -49
- package/dist/components/Typography/Body/index.d.ts +0 -14
- package/dist/components/Typography/Body/index.js +0 -53
- package/dist/components/Typography/Body/type.d.ts +0 -7
- package/dist/components/Typography/Body/type.js +0 -2
- package/dist/components/Typography/Display/Display.d.ts +0 -3
- package/dist/components/Typography/Display/Display.stories.d.ts +0 -6
- package/dist/components/Typography/Display/Display.stories.js +0 -79
- package/dist/components/Typography/Display/Display.test.d.ts +0 -1
- package/dist/components/Typography/Display/Display.test.js +0 -49
- package/dist/components/Typography/Display/index.d.ts +0 -38
- package/dist/components/Typography/Display/index.js +0 -64
- package/dist/components/Typography/Display/type.d.ts +0 -8
- package/dist/components/Typography/Display/type.js +0 -2
- package/dist/components/Typography/Headings/Heading.test.d.ts +0 -1
- package/dist/components/Typography/Headings/Heading.test.js +0 -49
- package/dist/components/Typography/Headings/Headings.d.ts +0 -3
- package/dist/components/Typography/Headings/Headings.stories.d.ts +0 -6
- package/dist/components/Typography/Headings/Headings.stories.js +0 -69
- package/dist/components/Typography/Headings/index.d.ts +0 -21
- package/dist/components/Typography/Headings/index.js +0 -71
- package/dist/components/Typography/Headings/type.d.ts +0 -6
- package/dist/components/Typography/Headings/type.js +0 -2
- package/dist/components/Typography/Typography.css +0 -3016
- package/dist/components/Typography/Typography.d.ts +0 -2
- package/dist/components/Typography/Typography.js +0 -9
- package/dist/components/Typography/Typography.stories.d.ts +0 -5
- package/dist/components/Typography/Typography.stories.js +0 -87
- package/dist/components/Typography/Typography.test.d.ts +0 -1
- package/dist/components/Typography/Typography.test.js +0 -42
- package/dist/global/components/Table/Table.d.ts +0 -14
- package/dist/global/components/Table/Table.js +0 -14
- package/dist/utils/colors.d.ts +0 -7
- package/dist/utils/colors.js +0 -10
- package/dist/utils/constants.js +0 -5
- package/dist/utils/enums.d.ts +0 -60
- package/dist/utils/enums.js +0 -69
- package/dist/utils/index.d.ts +0 -1448
- package/dist/utils/index.js +0 -1597
- /package/dist/{components/Avatar/Avatar.test.d.ts → src/components/Accordion/type.js} +0 -0
- /package/dist/{components → src/components}/Avatar/Avatar.stories.d.ts +0 -0
- /package/dist/{components/Border/BorderRadius/BorderRadius.test.d.ts → src/components/Avatar/Avatar.test.d.ts} +0 -0
- /package/dist/{components/Border/BorderWidth/BorderWidth.test.d.ts → src/components/Avatar/type.js} +0 -0
- /package/dist/{components/Color/BackgroundColor/BackgroundColor.test.d.ts → src/components/Button/Button.test.d.ts} +0 -0
- /package/dist/{components/Icons/IconList.test.d.ts → src/components/Button/IconButton.test.d.ts} +0 -0
- /package/dist/{components/Icons/SingleIcon.test.d.ts → src/components/Button/type.js} +0 -0
- /package/dist/{components/MediaCard/ContactProfile/ContactProfile.test.d.ts → src/components/ColorPicker/type.js} +0 -0
- /package/dist/{components/MediaCard/PostByCategory/PostByCategory.test.d.ts → src/components/Colors/color.test.d.ts} +0 -0
- /package/dist/{components/Spacing/Margin/MarginToken.test.d.ts → src/components/EditorTooltip/type.js} +0 -0
- /package/dist/{components/Spacing/Padding/PaddingToken.test.d.ts → src/components/Icons/IconList.test.d.ts} +0 -0
- /package/dist/{components → src/components}/Icons/IconView.d.ts +0 -0
- /package/dist/{components → src/components}/Icons/IconView.stories.d.ts +0 -0
- /package/dist/{components → src/components}/Icons/LUIcon.stories.d.ts +0 -0
- /package/dist/{components/Title/Title.test.d.ts → src/components/Icons/SingleIcon.test.d.ts} +0 -0
- /package/dist/{components → src/components}/MediaCard/Card.stories.d.ts +0 -0
- /package/dist/{components → src/components}/MediaCard/Card.test.d.ts +0 -0
- /package/dist/{components → src/components}/MediaCard/ContactProfile/ContactProfileTheme1.test.d.ts +0 -0
- /package/dist/{components → src/components}/MediaCard/ContactProfile/ContactProfileTheme2.test.d.ts +0 -0
- /package/dist/{components → src/components}/MediaCard/PostByCategory/PostByCategoryTheme1.test.d.ts +0 -0
- /package/dist/{components → src/components}/MediaCard/PostByCategory/PostByCategoryTheme2.test.d.ts +0 -0
- /package/dist/{components → src/components}/MediaCard/index.d.ts +0 -0
- /package/dist/{components → src/components}/Title/Title.d.ts +0 -0
- /package/dist/{components → src/components}/Title/Title.stories.d.ts +0 -0
- /package/dist/{utils → src/utils}/iconList.d.ts +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import { Dummy_Title } from "../../utils/constants";
|
|
3
|
+
import Title from "./Title";
|
|
4
|
+
describe("Title Component", function () {
|
|
5
|
+
it("renders with default props", function () {
|
|
6
|
+
render(<Title />);
|
|
7
|
+
expect(screen.getByText(Dummy_Title)).toBeInTheDocument();
|
|
8
|
+
});
|
|
9
|
+
it("renders with custom children", function () {
|
|
10
|
+
var customText = "Custom Title";
|
|
11
|
+
render(<Title>{customText}</Title>);
|
|
12
|
+
expect(screen.getByText(customText)).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
it("applies custom className", function () {
|
|
15
|
+
var customClass = "custom-class";
|
|
16
|
+
render(<Title className={customClass}/>);
|
|
17
|
+
var titleElement = screen.getByText(Dummy_Title);
|
|
18
|
+
expect(titleElement).toHaveClass("main-title custom-class");
|
|
19
|
+
});
|
|
20
|
+
it("renders without crashing", function () {
|
|
21
|
+
var container = render(<Title />).container;
|
|
22
|
+
expect(container).toBeDefined();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { Typography as ShadTypography } from "../ui/typography";
|
|
25
|
+
var Typography = function (_a) {
|
|
26
|
+
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
|
27
|
+
return (_jsx(ShadTypography, __assign({ className: className }, props, { children: children })));
|
|
28
|
+
};
|
|
29
|
+
export default Typography;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { Typography as ShadTypography } from "../ui/typography";
|
|
13
|
+
var Typography = function (_a) {
|
|
14
|
+
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
|
15
|
+
return (<ShadTypography className={className} {...props}>
|
|
16
|
+
{children}
|
|
17
|
+
</ShadTypography>);
|
|
18
|
+
};
|
|
19
|
+
export default Typography;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Meta } from "@storybook/react";
|
|
2
|
+
import { TypographyInterface } from "./type";
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const _Typography: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, TypographyInterface>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import Typography from "./Typography";
|
|
14
|
+
import { variant } from "../ui/typography";
|
|
15
|
+
import { Dummy_Para } from "../../utils/constants";
|
|
16
|
+
export default {
|
|
17
|
+
title: "Components/Typography",
|
|
18
|
+
component: Typography,
|
|
19
|
+
tags: ["autodocs"],
|
|
20
|
+
};
|
|
21
|
+
var Template = function (args) { return (_jsx(Typography, __assign({}, args))); };
|
|
22
|
+
export var _Typography = Template.bind({});
|
|
23
|
+
_Typography.args = {
|
|
24
|
+
children: Dummy_Para,
|
|
25
|
+
variant: "b4",
|
|
26
|
+
};
|
|
27
|
+
_Typography.argTypes = {
|
|
28
|
+
variant: {
|
|
29
|
+
control: { type: "select" },
|
|
30
|
+
options: Object.keys(variant),
|
|
31
|
+
description: "Typography Variant",
|
|
32
|
+
table: {
|
|
33
|
+
defaultValue: { summary: "b4" },
|
|
34
|
+
type: { summary: "string" },
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Typography from "./Typography";
|
|
2
|
+
import { variant } from "../ui/typography";
|
|
3
|
+
import { Dummy_Para } from "../../utils/constants";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/Typography",
|
|
6
|
+
component: Typography,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
};
|
|
9
|
+
var Template = function (args) { return (<Typography {...args}></Typography>); };
|
|
10
|
+
export var _Typography = Template.bind({});
|
|
11
|
+
_Typography.args = {
|
|
12
|
+
children: Dummy_Para,
|
|
13
|
+
variant: "b4",
|
|
14
|
+
};
|
|
15
|
+
_Typography.argTypes = {
|
|
16
|
+
variant: {
|
|
17
|
+
control: { type: "select" },
|
|
18
|
+
options: Object.keys(variant),
|
|
19
|
+
description: "Typography Variant",
|
|
20
|
+
table: {
|
|
21
|
+
defaultValue: { summary: "b4" },
|
|
22
|
+
type: { summary: "string" },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
import { typographyVariants } from "../ui/typography";
|
|
3
|
+
export interface TypographyInterface {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
variant?: Exclude<VariantProps<typeof typographyVariants>["variant"], null>;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
3
|
+
declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
25
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
26
|
+
import { cn } from "../../lib/utils";
|
|
27
|
+
function Accordion(_a) {
|
|
28
|
+
var props = __rest(_a, []);
|
|
29
|
+
return _jsx(AccordionPrimitive.Root, __assign({ "data-slot": "accordion" }, props));
|
|
30
|
+
}
|
|
31
|
+
function AccordionItem(_a) {
|
|
32
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
33
|
+
return (_jsx(AccordionPrimitive.Item, __assign({ "data-slot": "accordion-item", className: cn("!border-b last:!border-b-0", className) }, props)));
|
|
34
|
+
}
|
|
35
|
+
function AccordionTrigger(_a) {
|
|
36
|
+
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
37
|
+
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, __assign({ "data-slot": "accordion-trigger", className: cn("focus-visible:border-ring focus-visible:ring-ring/50 !flex !flex-1 !items-start !justify-between gap-4 !rounded-md !py-2 !text-left !text-base !font-medium transition-all outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180", className) }, props, { children: [children, _jsx(ChevronDownIcon, { className: "!text-muted-foreground pointer-events-none !size-6 shrink-0 translate-y-0.5 transition-transform duration-200" })] })) }));
|
|
38
|
+
}
|
|
39
|
+
function AccordionContent(_a) {
|
|
40
|
+
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
41
|
+
return (_jsx(AccordionPrimitive.Content, __assign({ "data-slot": "accordion-content", className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm" }, props, { children: _jsx("div", { className: cn("pt-0 pb-4", className), children: children }) })));
|
|
42
|
+
}
|
|
43
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
25
|
+
import { cva } from "class-variance-authority";
|
|
26
|
+
import { cn } from "../../lib/utils";
|
|
27
|
+
var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
28
|
+
variants: {
|
|
29
|
+
variant: {
|
|
30
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
31
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
32
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
33
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
34
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
35
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
36
|
+
},
|
|
37
|
+
size: {
|
|
38
|
+
default: "h-9 !px-4 !py-2 has-[>svg]:px-3",
|
|
39
|
+
sm: "h-8 rounded-md gap-1.5 !px-3 has-[>svg]:px-2.5",
|
|
40
|
+
lg: "h-10 rounded-md !px-6 has-[>svg]:px-4",
|
|
41
|
+
icon: "size-9",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
defaultVariants: {
|
|
45
|
+
variant: "default",
|
|
46
|
+
size: "default",
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
function Button(_a) {
|
|
50
|
+
var className = _a.className, variant = _a.variant, size = _a.size, _b = _a.asChild, asChild = _b === void 0 ? false : _b, props = __rest(_a, ["className", "variant", "size", "asChild"]);
|
|
51
|
+
var Comp = asChild ? Slot : "button";
|
|
52
|
+
return (_jsx(Comp, __assign({ "data-slot": "button", className: cn(buttonVariants({ variant: variant, size: size, className: className })) }, props)));
|
|
53
|
+
}
|
|
54
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
14
|
+
import { cva } from "class-variance-authority";
|
|
15
|
+
import { cn } from "../../lib/utils";
|
|
16
|
+
var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
17
|
+
variants: {
|
|
18
|
+
variant: {
|
|
19
|
+
default: "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
|
|
20
|
+
destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
21
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
22
|
+
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
|
|
23
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
24
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
28
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
29
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
30
|
+
icon: "size-9",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: "default",
|
|
35
|
+
size: "default",
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
function Button(_a) {
|
|
39
|
+
var className = _a.className, variant = _a.variant, size = _a.size, _b = _a.asChild, asChild = _b === void 0 ? false : _b, props = __rest(_a, ["className", "variant", "size", "asChild"]);
|
|
40
|
+
var Comp = asChild ? Slot : "button";
|
|
41
|
+
return (<Comp data-slot="button" className={cn(buttonVariants({ variant: variant, size: size, className: className }))} {...props}/>);
|
|
42
|
+
}
|
|
43
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { useState, useEffect } from "react";
|
|
15
|
+
import { useDropzone } from "react-dropzone";
|
|
16
|
+
import { Button } from "../../components/ui/button";
|
|
17
|
+
import { cn } from "../../lib/utils";
|
|
18
|
+
import LUIcon from "../Icons/LUIcon";
|
|
19
|
+
import Typography from "../Typography/Typography";
|
|
20
|
+
import LuImage from "../Images/LuImage";
|
|
21
|
+
var ImageUploader = function (_a) {
|
|
22
|
+
var value = _a.value, onChange = _a.onChange, required = _a.required, className = _a.className, _b = _a.maxFileSizeMB, maxFileSizeMB = _b === void 0 ? 6 : _b, _c = _a.acceptedTypes, acceptedTypes = _c === void 0 ? ["image/png", "image/jpeg", "image/jpg", "image/svg+xml"] : _c;
|
|
23
|
+
var _d = useState(null), preview = _d[0], setPreview = _d[1];
|
|
24
|
+
var _e = useState(""), fileError = _e[0], setFileError = _e[1];
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
if (value && typeof value === "string") {
|
|
27
|
+
setPreview(value);
|
|
28
|
+
}
|
|
29
|
+
else if (value instanceof File) {
|
|
30
|
+
setPreview(URL.createObjectURL(value));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
setPreview(null);
|
|
34
|
+
}
|
|
35
|
+
}, [value]);
|
|
36
|
+
var onDrop = function (acceptedFiles) {
|
|
37
|
+
var file = acceptedFiles[0];
|
|
38
|
+
if (!file)
|
|
39
|
+
return;
|
|
40
|
+
if (!acceptedTypes.includes(file.type)) {
|
|
41
|
+
setFileError("Only JPEG, PNG, JPG, and SVG files are supported.");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
var sizeMB = file.size / 1024 / 1024;
|
|
45
|
+
if (sizeMB > maxFileSizeMB) {
|
|
46
|
+
setFileError("File size exceeds ".concat(maxFileSizeMB, "MB."));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
var previewUrl = URL.createObjectURL(file);
|
|
50
|
+
setPreview(previewUrl);
|
|
51
|
+
setFileError("");
|
|
52
|
+
onChange(previewUrl, file);
|
|
53
|
+
};
|
|
54
|
+
var removeFile = function () {
|
|
55
|
+
setPreview(null);
|
|
56
|
+
setFileError("");
|
|
57
|
+
onChange(null, null);
|
|
58
|
+
};
|
|
59
|
+
var _f = useDropzone({
|
|
60
|
+
onDrop: onDrop,
|
|
61
|
+
multiple: false,
|
|
62
|
+
accept: {
|
|
63
|
+
"image/*": acceptedTypes,
|
|
64
|
+
},
|
|
65
|
+
}), getRootProps = _f.getRootProps, getInputProps = _f.getInputProps;
|
|
66
|
+
return (_jsxs("div", { className: cn("flex flex-col items-center", className), children: [_jsx("div", __assign({}, getRootProps(), { className: cn("!border !border-dashed !border-neutral-300 !rounded-lg cursor-pointer w-64 !p-2"), children: _jsxs("div", { className: "min-h-40 flex items-center justify-center bg-neutral-100 !rounded-lg", children: [_jsx("input", __assign({}, getInputProps())), preview ? (_jsx("div", { className: "relative w-full h-40 !mx-auto overflow-hidden", children: _jsx(LuImage, { src: preview, alt: "Uploaded", className: "aspect-square object-contain", fill: true }) })) : (_jsxs("div", { className: "text-center text-sm text-muted-foreground", children: [_jsx(LUIcon, { icon: "upload", size: "lg", className: "!mx-auto !mb-4" }), _jsx(Typography, { variant: "b4", className: "!px-1", children: "Choose a file or drag & drop it here" }), _jsx("p", { className: "text-xs text-muted-foreground", children: "JPEG, PNG, and SVG formats" })] }))] }) })), fileError && (_jsx("p", { className: "text-sm text-danger-500 text-center mt-2", children: fileError })), required && !preview && !fileError && (_jsx("p", { className: "text-sm text-danger-500 text-center", children: "Image is required." })), preview && (_jsx(Button, { variant: "link", onClick: removeFile, className: "!mt-2 text-sm text-neutral-700", children: "Remove Image" }))] }));
|
|
67
|
+
};
|
|
68
|
+
export default ImageUploader;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { cn } from "../../lib/utils";
|
|
25
|
+
function Input(_a) {
|
|
26
|
+
var className = _a.className, type = _a.type, props = __rest(_a, ["className", "type"]);
|
|
27
|
+
return (_jsx("input", __assign({ type: type, "data-slot": "input", className: cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 border bg-transparent !px-3 !py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:shadow-outline-primary focus-visible:outline-none", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className) }, props)));
|
|
28
|
+
}
|
|
29
|
+
export { Input };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import { cn } from "../../lib/utils";
|
|
14
|
+
function Input(_a) {
|
|
15
|
+
var className = _a.className, type = _a.type, props = __rest(_a, ["className", "type"]);
|
|
16
|
+
return (<input type={type} data-slot="input" className={cn("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 border bg-transparent !px-3 !py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:shadow-outline-primary focus-visible:outline-none", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className)} {...props}/>);
|
|
17
|
+
}
|
|
18
|
+
export { Input };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
export declare const variant: {
|
|
5
|
+
default: string;
|
|
6
|
+
editorLabel: string;
|
|
7
|
+
};
|
|
8
|
+
declare const labelVariants: (props?: ({
|
|
9
|
+
variant?: "default" | "editorLabel" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
declare function Label({ className, variant, ...props }: React.ComponentProps<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { Label, labelVariants };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
25
|
+
import { cva } from "class-variance-authority";
|
|
26
|
+
import { cn } from "../../lib/utils";
|
|
27
|
+
export var variant = {
|
|
28
|
+
default: "!text-base leading-none !font-medium",
|
|
29
|
+
editorLabel: "!text-lg !font-medium leading-[1.5] !mb-1",
|
|
30
|
+
};
|
|
31
|
+
var labelVariants = cva("flex items-center !gap-2 select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", {
|
|
32
|
+
variants: { variant: variant },
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: "default",
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
function Label(_a) {
|
|
38
|
+
var className = _a.className, variant = _a.variant, props = __rest(_a, ["className", "variant"]);
|
|
39
|
+
return (_jsx(LabelPrimitive.Root, __assign({ "data-slot": "label", className: cn(labelVariants({ variant: variant, className: className })) }, props)));
|
|
40
|
+
}
|
|
41
|
+
export { Label, labelVariants };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
14
|
+
import { cva } from "class-variance-authority";
|
|
15
|
+
import { cn } from "../../lib/utils";
|
|
16
|
+
export var variant = {
|
|
17
|
+
default: "!text-base leading-none !font-medium",
|
|
18
|
+
editorLabel: "!text-lg !font-medium leading-[1.5] !mb-1",
|
|
19
|
+
};
|
|
20
|
+
var labelVariants = cva("flex items-center !gap-2 select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50", {
|
|
21
|
+
variants: { variant: variant },
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "default",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
function Label(_a) {
|
|
27
|
+
var className = _a.className, variant = _a.variant, props = __rest(_a, ["className", "variant"]);
|
|
28
|
+
return (<LabelPrimitive.Root data-slot="label" className={cn(labelVariants({ variant: variant, className: className }))} {...props}/>);
|
|
29
|
+
}
|
|
30
|
+
export { Label, labelVariants };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
3
|
+
import { type VariantProps } from "class-variance-authority";
|
|
4
|
+
export declare const size: {
|
|
5
|
+
sm: string;
|
|
6
|
+
md: string;
|
|
7
|
+
lg: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const variant: {
|
|
10
|
+
default: string;
|
|
11
|
+
primary: string;
|
|
12
|
+
success: string;
|
|
13
|
+
danger: string;
|
|
14
|
+
};
|
|
15
|
+
declare const switchVariants: (props?: ({
|
|
16
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
17
|
+
variant?: "default" | "primary" | "success" | "danger" | null | undefined;
|
|
18
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
19
|
+
export interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, VariantProps<typeof switchVariants> {
|
|
20
|
+
}
|
|
21
|
+
declare function Switch({ className, size, variant, ...props }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export { Switch };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
25
|
+
import { cva } from "class-variance-authority";
|
|
26
|
+
import { cn } from "../../lib/utils";
|
|
27
|
+
export var size = {
|
|
28
|
+
sm: "h-4 w-6",
|
|
29
|
+
md: "w-12 h-6", // default
|
|
30
|
+
lg: "h-6 w-14",
|
|
31
|
+
};
|
|
32
|
+
export var variant = {
|
|
33
|
+
default: "data-[state=checked]:bg-primary-500 data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 focus-visible:ring-ring/50 focus-visible:border-ring",
|
|
34
|
+
primary: "data-[state=checked]:bg-primary-500 data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 focus-visible:ring-ring/50 focus-visible:border-ring",
|
|
35
|
+
success: "data-[state=checked]:bg-success-500 data-[state=unchecked]:bg-input focus-visible:ring-green-500",
|
|
36
|
+
danger: "data-[state=checked]:bg-danger-500 data-[state=unchecked]:bg-input focus-visible:ring-red-500",
|
|
37
|
+
};
|
|
38
|
+
var switchVariants = cva("peer inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", {
|
|
39
|
+
variants: {
|
|
40
|
+
size: size,
|
|
41
|
+
variant: variant,
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: {
|
|
44
|
+
size: "md",
|
|
45
|
+
variant: "default",
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
var thumbVariants = cva("pointer-events-none block rounded-full ring-0 transition-transform", {
|
|
49
|
+
variants: {
|
|
50
|
+
size: {
|
|
51
|
+
sm: "size-3",
|
|
52
|
+
md: "size-4", // default
|
|
53
|
+
lg: "size-5",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
defaultVariants: {
|
|
57
|
+
size: "md",
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
// Define translate distance for each size
|
|
61
|
+
var thumbTranslateVariants = {
|
|
62
|
+
sm: "data-[state=checked]:translate-x-3",
|
|
63
|
+
md: "data-[state=checked]:translate-x-7",
|
|
64
|
+
lg: "data-[state=checked]:translate-x-9",
|
|
65
|
+
};
|
|
66
|
+
function Switch(_a) {
|
|
67
|
+
var className = _a.className, size = _a.size, variant = _a.variant, props = __rest(_a, ["className", "size", "variant"]);
|
|
68
|
+
return (_jsx(SwitchPrimitive.Root, __assign({ "data-slot": "switch", className: cn(switchVariants({ size: size, variant: variant }), className) }, props, { children: _jsx(SwitchPrimitive.Thumb, { "data-slot": "switch-thumb", className: cn(thumbVariants({ size: size }), size ? thumbTranslateVariants[size] : "", "data-[state=unchecked]:translate-x-0 bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground") }) })));
|
|
69
|
+
}
|
|
70
|
+
export { Switch };
|