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,31 @@
|
|
|
1
|
+
import Avatar from "./Avatar";
|
|
2
|
+
import { avatarShape, avatarSize } from ".";
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/Avatar",
|
|
5
|
+
component: Avatar,
|
|
6
|
+
};
|
|
7
|
+
var Template = function (args) { return <Avatar {...args}/>; };
|
|
8
|
+
export var _Avatar = Template.bind({});
|
|
9
|
+
_Avatar.args = {
|
|
10
|
+
image: "/images/avatar.png",
|
|
11
|
+
shape: "square",
|
|
12
|
+
size: "md",
|
|
13
|
+
className: "",
|
|
14
|
+
icon: "user",
|
|
15
|
+
};
|
|
16
|
+
_Avatar.argTypes = {
|
|
17
|
+
shape: {
|
|
18
|
+
control: {
|
|
19
|
+
type: "select",
|
|
20
|
+
labels: Object.keys(avatarShape),
|
|
21
|
+
},
|
|
22
|
+
options: Object.keys(avatarShape),
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
control: {
|
|
26
|
+
type: "select",
|
|
27
|
+
labels: Object.keys(avatarSize),
|
|
28
|
+
},
|
|
29
|
+
options: Object.keys(avatarSize),
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import Avatar from "./Avatar";
|
|
4
|
+
jest.mock("../Icons/LUIcon", function () { return ({
|
|
5
|
+
__esModule: true,
|
|
6
|
+
default: jest.fn(function (_a) {
|
|
7
|
+
var icon = _a.icon, className = _a.className;
|
|
8
|
+
return (_jsx("div", { "data-testid": "mock-luIcon", className: className, children: icon || "user" }));
|
|
9
|
+
}),
|
|
10
|
+
}); });
|
|
11
|
+
// Mock Next.js Image component
|
|
12
|
+
jest.mock("next/image", function () { return ({
|
|
13
|
+
__esModule: true,
|
|
14
|
+
default: function (_a) {
|
|
15
|
+
var src = _a.src, alt = _a.alt;
|
|
16
|
+
return (
|
|
17
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
18
|
+
_jsx("img", { src: src, alt: alt }));
|
|
19
|
+
},
|
|
20
|
+
}); });
|
|
21
|
+
describe("Avatar Component", function () {
|
|
22
|
+
it("renders image when image prop is provided", function () {
|
|
23
|
+
render(_jsx(Avatar, { image: "/images/avatar.png" }));
|
|
24
|
+
var avatarImage = screen.getByRole("img", { name: /avatar/i });
|
|
25
|
+
expect(avatarImage).toBeInTheDocument();
|
|
26
|
+
expect(avatarImage).toHaveAttribute("src", "/images/avatar.png");
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
it("renders icon when no image is provided", function () {
|
|
30
|
+
render(_jsx(Avatar, {}));
|
|
31
|
+
var icon = screen.getByTestId("lu-icon");
|
|
32
|
+
expect(icon).toBeInTheDocument();
|
|
33
|
+
});
|
|
34
|
+
it("applies shape and size class names correctly", function () {
|
|
35
|
+
render(_jsx(Avatar, { image: "/images/avatar.png", shape: "square", size: "lg" }));
|
|
36
|
+
var avatarWrapper = screen.getByTestId("lu-avatar");
|
|
37
|
+
expect(avatarWrapper).toHaveClass("rounded-none");
|
|
38
|
+
expect(avatarWrapper).toHaveClass("w-[42px]");
|
|
39
|
+
expect(avatarWrapper).toHaveClass("h-[42px]");
|
|
40
|
+
});
|
|
41
|
+
it("applies additional class names", function () {
|
|
42
|
+
render(_jsx(Avatar, { image: "/images/avatar.png", className: "custom-class" }));
|
|
43
|
+
var avatarWrapper = screen.getByTestId("lu-avatar");
|
|
44
|
+
expect(avatarWrapper).toHaveClass("custom-class");
|
|
45
|
+
});
|
|
46
|
+
it("renders the correct icon when image is not provided", function () {
|
|
47
|
+
render(_jsx(Avatar, { icon: "user" }));
|
|
48
|
+
var icon = screen.getByTestId("lu-icon");
|
|
49
|
+
expect(icon).toBeInTheDocument();
|
|
50
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import Avatar from "./Avatar";
|
|
3
|
+
jest.mock("../Icons/LUIcon", function () { return ({
|
|
4
|
+
__esModule: true,
|
|
5
|
+
default: jest.fn(function (_a) {
|
|
6
|
+
var icon = _a.icon, className = _a.className;
|
|
7
|
+
return (<div data-testid="mock-luIcon" className={className}>
|
|
8
|
+
{icon || "user"}
|
|
9
|
+
</div>);
|
|
10
|
+
}),
|
|
11
|
+
}); });
|
|
12
|
+
// Mock Next.js Image component
|
|
13
|
+
jest.mock("next/image", function () { return ({
|
|
14
|
+
__esModule: true,
|
|
15
|
+
default: function (_a) {
|
|
16
|
+
var src = _a.src, alt = _a.alt;
|
|
17
|
+
return (
|
|
18
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
19
|
+
<img src={src} alt={alt}/>);
|
|
20
|
+
},
|
|
21
|
+
}); });
|
|
22
|
+
describe("Avatar Component", function () {
|
|
23
|
+
it("renders image when image prop is provided", function () {
|
|
24
|
+
render(<Avatar image="/images/avatar.png"/>);
|
|
25
|
+
var avatarImage = screen.getByRole("img", { name: /avatar/i });
|
|
26
|
+
expect(avatarImage).toBeInTheDocument();
|
|
27
|
+
expect(avatarImage).toHaveAttribute("src", "/images/avatar.png");
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
it("renders icon when no image is provided", function () {
|
|
31
|
+
render(<Avatar />);
|
|
32
|
+
var icon = screen.getByTestId("lu-icon");
|
|
33
|
+
expect(icon).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
|
+
it("applies shape and size class names correctly", function () {
|
|
36
|
+
render(<Avatar image="/images/avatar.png" shape="square" size="lg"/>);
|
|
37
|
+
var avatarWrapper = screen.getByTestId("lu-avatar");
|
|
38
|
+
expect(avatarWrapper).toHaveClass("rounded-none");
|
|
39
|
+
expect(avatarWrapper).toHaveClass("w-[42px]");
|
|
40
|
+
expect(avatarWrapper).toHaveClass("h-[42px]");
|
|
41
|
+
});
|
|
42
|
+
it("applies additional class names", function () {
|
|
43
|
+
render(<Avatar image="/images/avatar.png" className="custom-class"/>);
|
|
44
|
+
var avatarWrapper = screen.getByTestId("lu-avatar");
|
|
45
|
+
expect(avatarWrapper).toHaveClass("custom-class");
|
|
46
|
+
});
|
|
47
|
+
it("renders the correct icon when image is not provided", function () {
|
|
48
|
+
render(<Avatar icon="user"/>);
|
|
49
|
+
var icon = screen.getByTestId("lu-icon");
|
|
50
|
+
expect(icon).toBeInTheDocument();
|
|
51
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const avatarSize: {
|
|
2
|
+
sm: string;
|
|
3
|
+
md: string;
|
|
4
|
+
lg: string;
|
|
5
|
+
xl: string;
|
|
6
|
+
"2xl": string;
|
|
7
|
+
"3xl": string;
|
|
8
|
+
"4xl": string;
|
|
9
|
+
"5xl": string;
|
|
10
|
+
"6xl": string;
|
|
11
|
+
"7xl": string;
|
|
12
|
+
huge: string;
|
|
13
|
+
massive: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const avatarPadding: {
|
|
16
|
+
sm: string;
|
|
17
|
+
md: string;
|
|
18
|
+
lg: string;
|
|
19
|
+
xl: string;
|
|
20
|
+
"2xl": string;
|
|
21
|
+
"3xl": string;
|
|
22
|
+
"4xl": string;
|
|
23
|
+
"5xl": string;
|
|
24
|
+
"6xl": string;
|
|
25
|
+
"7xl": string;
|
|
26
|
+
huge: string;
|
|
27
|
+
massive: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const avatarShape: {
|
|
30
|
+
square: string;
|
|
31
|
+
circle: string;
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export var avatarSize = {
|
|
2
|
+
sm: "w-[30px] h-[30px]", //TODO: Change to hand coded values
|
|
3
|
+
md: "w-8 h-8",
|
|
4
|
+
lg: "w-[42px] h-[42px]",
|
|
5
|
+
xl: "w-[52px] h-[52px]",
|
|
6
|
+
"2xl": "w-16 h-16",
|
|
7
|
+
"3xl": "w-[76px] h-[76px]",
|
|
8
|
+
"4xl": "w-24 h-24",
|
|
9
|
+
"5xl": "w-[116px] h-[116px]",
|
|
10
|
+
"6xl": "w-32 h-32",
|
|
11
|
+
"7xl": "w-36 h-36",
|
|
12
|
+
huge: "w-40 h-40",
|
|
13
|
+
massive: "w-[200px] h-[200px]",
|
|
14
|
+
};
|
|
15
|
+
export var avatarPadding = {
|
|
16
|
+
sm: "p-2",
|
|
17
|
+
md: "p-2",
|
|
18
|
+
lg: "p-3",
|
|
19
|
+
xl: "p-4",
|
|
20
|
+
"2xl": "p-5",
|
|
21
|
+
"3xl": "p-6",
|
|
22
|
+
"4xl": "p-8",
|
|
23
|
+
"5xl": "p-10",
|
|
24
|
+
"6xl": "p-10",
|
|
25
|
+
"7xl": "p-10",
|
|
26
|
+
huge: "p-10",
|
|
27
|
+
massive: "p-10",
|
|
28
|
+
};
|
|
29
|
+
export var avatarShape = {
|
|
30
|
+
square: "rounded-none",
|
|
31
|
+
circle: "rounded-full",
|
|
32
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { avatarShape, avatarSize } from ".";
|
|
2
|
+
type avatarSize = keyof typeof avatarSize;
|
|
3
|
+
type avatarShape = keyof typeof avatarShape;
|
|
4
|
+
export interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
image?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
shape?: avatarShape;
|
|
8
|
+
size?: avatarSize;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { buttonShapes, buttonSizes, buttonColors } from "./index";
|
|
3
|
+
var Button = function (_a) {
|
|
4
|
+
var _b = _a.color, color = _b === void 0 ? "primary" : _b, startIcon = _a.startIcon, endIcon = _a.endIcon, onClick = _a.onClick, _c = _a.shape, shape = _c === void 0 ? "rounded-none" : _c, _d = _a.size, size = _d === void 0 ? "sm" : _d, className = _a.className, children = _a.children;
|
|
5
|
+
return (_jsxs("button", { className: "flex items-center ".concat(buttonShapes[shape], " ").concat(buttonColors[color], " ").concat(className, " ").concat(buttonSizes[size]), onClick: onClick, children: [startIcon && _jsxs("span", { "data-testid": "start-icon", children: [" ", startIcon, " "] }), children, endIcon && _jsxs("span", { "data-testid": "end-icon", children: [" ", endIcon, " "] })] }));
|
|
6
|
+
};
|
|
7
|
+
export default Button;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { buttonShapes, buttonSizes, buttonColors } from "./index";
|
|
2
|
+
var Button = function (_a) {
|
|
3
|
+
var _b = _a.color, color = _b === void 0 ? "primary" : _b, startIcon = _a.startIcon, endIcon = _a.endIcon, onClick = _a.onClick, _c = _a.shape, shape = _c === void 0 ? "rounded-none" : _c, _d = _a.size, size = _d === void 0 ? "sm" : _d, className = _a.className, children = _a.children;
|
|
4
|
+
return (<button className={"flex items-center ".concat(buttonShapes[shape], " ").concat(buttonColors[color], " ").concat(className, " ").concat(buttonSizes[size])} onClick={onClick}>
|
|
5
|
+
{startIcon && <span data-testid="start-icon"> {startIcon} </span>}
|
|
6
|
+
{children}
|
|
7
|
+
{endIcon && <span data-testid="end-icon"> {endIcon} </span>}
|
|
8
|
+
</button>);
|
|
9
|
+
};
|
|
10
|
+
export default Button;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Meta } from "@storybook/react";
|
|
2
|
+
import { ButtonProps } from "./type";
|
|
2
3
|
declare const _default: Meta;
|
|
3
4
|
export default _default;
|
|
4
|
-
export declare const _Button: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer,
|
|
5
|
+
export declare const _Button: import("@storybook/core/csf").AnnotatedStoryFn<import("@storybook/react").ReactRenderer, ButtonProps>;
|
|
@@ -0,0 +1,56 @@
|
|
|
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 { buttonShapes, buttonSizes, buttonColors } from ".";
|
|
14
|
+
import Button from "./Button";
|
|
15
|
+
export default {
|
|
16
|
+
title: "Components/Button/Button",
|
|
17
|
+
component: Button,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
};
|
|
20
|
+
var Template = function (args) { return _jsx(Button, __assign({}, args)); };
|
|
21
|
+
export var _Button = Template.bind({});
|
|
22
|
+
_Button.args = {
|
|
23
|
+
children: "Button Text",
|
|
24
|
+
};
|
|
25
|
+
_Button.argTypes = {
|
|
26
|
+
color: {
|
|
27
|
+
control: {
|
|
28
|
+
type: "select",
|
|
29
|
+
labels: Object.keys(buttonColors),
|
|
30
|
+
},
|
|
31
|
+
options: Object.keys(buttonColors),
|
|
32
|
+
},
|
|
33
|
+
startIcon: {
|
|
34
|
+
control: false,
|
|
35
|
+
description: "Start icon (React component)",
|
|
36
|
+
},
|
|
37
|
+
endIcon: {
|
|
38
|
+
control: false,
|
|
39
|
+
description: "End icon (React component)",
|
|
40
|
+
},
|
|
41
|
+
shape: {
|
|
42
|
+
control: {
|
|
43
|
+
type: "select",
|
|
44
|
+
labels: Object.keys(buttonShapes),
|
|
45
|
+
},
|
|
46
|
+
options: Object.keys(buttonShapes),
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
control: {
|
|
50
|
+
type: "select",
|
|
51
|
+
labels: Object.keys(buttonSizes),
|
|
52
|
+
},
|
|
53
|
+
options: Object.keys(buttonSizes),
|
|
54
|
+
description: "Select the size of the button",
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { buttonShapes, buttonSizes, buttonColors } from ".";
|
|
2
|
+
import Button from "./Button";
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/Button/Button",
|
|
5
|
+
component: Button,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
};
|
|
8
|
+
var Template = function (args) { return <Button {...args}></Button>; };
|
|
9
|
+
export var _Button = Template.bind({});
|
|
10
|
+
_Button.args = {
|
|
11
|
+
children: "Button Text",
|
|
12
|
+
};
|
|
13
|
+
_Button.argTypes = {
|
|
14
|
+
color: {
|
|
15
|
+
control: {
|
|
16
|
+
type: "select",
|
|
17
|
+
labels: Object.keys(buttonColors),
|
|
18
|
+
},
|
|
19
|
+
options: Object.keys(buttonColors),
|
|
20
|
+
},
|
|
21
|
+
startIcon: {
|
|
22
|
+
control: false,
|
|
23
|
+
description: "Start icon (React component)",
|
|
24
|
+
},
|
|
25
|
+
endIcon: {
|
|
26
|
+
control: false,
|
|
27
|
+
description: "End icon (React component)",
|
|
28
|
+
},
|
|
29
|
+
shape: {
|
|
30
|
+
control: {
|
|
31
|
+
type: "select",
|
|
32
|
+
labels: Object.keys(buttonShapes),
|
|
33
|
+
},
|
|
34
|
+
options: Object.keys(buttonShapes),
|
|
35
|
+
},
|
|
36
|
+
size: {
|
|
37
|
+
control: {
|
|
38
|
+
type: "select",
|
|
39
|
+
labels: Object.keys(buttonSizes),
|
|
40
|
+
},
|
|
41
|
+
options: Object.keys(buttonSizes),
|
|
42
|
+
description: "Select the size of the button",
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
3
|
+
import Button from "./Button";
|
|
4
|
+
import { buttonColors, buttonShapes, buttonSizes } from ".";
|
|
5
|
+
import { Dummy_label } from "../../utils/constants";
|
|
6
|
+
describe("Button Component", function () {
|
|
7
|
+
it("renders default button component", function () {
|
|
8
|
+
render(_jsx(Button, { children: Dummy_label }));
|
|
9
|
+
var buttonElement = screen.getByRole("button", { name: Dummy_label });
|
|
10
|
+
expect(buttonElement).toBeInTheDocument();
|
|
11
|
+
expect(buttonElement).toHaveClass(buttonColors["primary"], buttonShapes["rounded-none"], buttonSizes["sm"]);
|
|
12
|
+
});
|
|
13
|
+
it("renders button with a custom label", function () {
|
|
14
|
+
render(_jsx(Button, { children: Dummy_label }));
|
|
15
|
+
expect(screen.getByRole("button", { name: Dummy_label })).toBeInTheDocument();
|
|
16
|
+
});
|
|
17
|
+
it("calls onClick handler when clicked", function () {
|
|
18
|
+
var handleClick = jest.fn();
|
|
19
|
+
render(_jsx(Button, { onClick: handleClick, children: "Click" }));
|
|
20
|
+
fireEvent.click(screen.getByRole("button"));
|
|
21
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
22
|
+
});
|
|
23
|
+
it("renders startIcon when provided", function () {
|
|
24
|
+
render(_jsx(Button, { startIcon: _jsx("span", { children: "*" }), children: Dummy_label }));
|
|
25
|
+
expect(screen.getByTestId("start-icon")).toBeInTheDocument();
|
|
26
|
+
});
|
|
27
|
+
it("renders endIcon when provided", function () {
|
|
28
|
+
render(_jsx(Button, { endIcon: _jsx("span", { children: "*" }), children: Dummy_label }));
|
|
29
|
+
expect(screen.getByTestId("end-icon")).toBeInTheDocument();
|
|
30
|
+
});
|
|
31
|
+
it("applies correct color, shape, and size classes", function () {
|
|
32
|
+
render(_jsx(Button, { color: "primary", shape: "rounded-lg", size: "lg", children: Dummy_label }));
|
|
33
|
+
var buttonElement = screen.getByRole("button");
|
|
34
|
+
expect(buttonElement).toHaveClass(buttonColors["primary"], buttonShapes["rounded-lg"], buttonSizes["lg"]);
|
|
35
|
+
});
|
|
36
|
+
it("applies additional className when provided", function () {
|
|
37
|
+
render(_jsx(Button, { className: "custom-class", children: Dummy_label }));
|
|
38
|
+
expect(screen.getByRole("button")).toHaveClass("custom-class");
|
|
39
|
+
});
|
|
40
|
+
it("renders without crashing when no props are provided", function () {
|
|
41
|
+
render(_jsx(Button, { children: Dummy_label }));
|
|
42
|
+
expect(screen.getByRole("button")).toBeInTheDocument();
|
|
43
|
+
});
|
|
44
|
+
it("renders button with both startIcon and endIcon", function () {
|
|
45
|
+
render(_jsx(Button, { startIcon: _jsx("span", { children: "*" }), endIcon: _jsx("span", { children: "*" }), children: Dummy_label }));
|
|
46
|
+
expect(screen.getByTestId("start-icon")).toBeInTheDocument();
|
|
47
|
+
expect(screen.getByTestId("end-icon")).toBeInTheDocument();
|
|
48
|
+
});
|
|
49
|
+
it("does not render startIcon when not provided", function () {
|
|
50
|
+
render(_jsx(Button, { children: Dummy_label }));
|
|
51
|
+
expect(screen.queryByTestId("start-icon")).not.toBeInTheDocument();
|
|
52
|
+
});
|
|
53
|
+
it("does not render endIcon when not provided", function () {
|
|
54
|
+
render(_jsx(Button, { children: Dummy_label }));
|
|
55
|
+
expect(screen.queryByTestId("end-icon")).not.toBeInTheDocument();
|
|
56
|
+
});
|
|
57
|
+
it("renders correctly without a className prop", function () {
|
|
58
|
+
render(_jsx(Button, { children: Dummy_label }));
|
|
59
|
+
var buttonElement = screen.getByRole("button");
|
|
60
|
+
expect(buttonElement).not.toHaveClass("custom-class");
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
2
|
+
import Button from "./Button";
|
|
3
|
+
import { buttonColors, buttonShapes, buttonSizes } from ".";
|
|
4
|
+
import { Dummy_label } from "../../utils/constants";
|
|
5
|
+
describe("Button Component", function () {
|
|
6
|
+
it("renders default button component", function () {
|
|
7
|
+
render(<Button>{Dummy_label}</Button>);
|
|
8
|
+
var buttonElement = screen.getByRole("button", { name: Dummy_label });
|
|
9
|
+
expect(buttonElement).toBeInTheDocument();
|
|
10
|
+
expect(buttonElement).toHaveClass(buttonColors["primary"], buttonShapes["rounded-none"], buttonSizes["sm"]);
|
|
11
|
+
});
|
|
12
|
+
it("renders button with a custom label", function () {
|
|
13
|
+
render(<Button>{Dummy_label}</Button>);
|
|
14
|
+
expect(screen.getByRole("button", { name: Dummy_label })).toBeInTheDocument();
|
|
15
|
+
});
|
|
16
|
+
it("calls onClick handler when clicked", function () {
|
|
17
|
+
var handleClick = jest.fn();
|
|
18
|
+
render(<Button onClick={handleClick}>Click</Button>);
|
|
19
|
+
fireEvent.click(screen.getByRole("button"));
|
|
20
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
21
|
+
});
|
|
22
|
+
it("renders startIcon when provided", function () {
|
|
23
|
+
render(<Button startIcon={<span>*</span>}>{Dummy_label}</Button>);
|
|
24
|
+
expect(screen.getByTestId("start-icon")).toBeInTheDocument();
|
|
25
|
+
});
|
|
26
|
+
it("renders endIcon when provided", function () {
|
|
27
|
+
render(<Button endIcon={<span>*</span>}>{Dummy_label}</Button>);
|
|
28
|
+
expect(screen.getByTestId("end-icon")).toBeInTheDocument();
|
|
29
|
+
});
|
|
30
|
+
it("applies correct color, shape, and size classes", function () {
|
|
31
|
+
render(<Button color="primary" shape="rounded-lg" size="lg">
|
|
32
|
+
{Dummy_label}
|
|
33
|
+
</Button>);
|
|
34
|
+
var buttonElement = screen.getByRole("button");
|
|
35
|
+
expect(buttonElement).toHaveClass(buttonColors["primary"], buttonShapes["rounded-lg"], buttonSizes["lg"]);
|
|
36
|
+
});
|
|
37
|
+
it("applies additional className when provided", function () {
|
|
38
|
+
render(<Button className="custom-class">{Dummy_label}</Button>);
|
|
39
|
+
expect(screen.getByRole("button")).toHaveClass("custom-class");
|
|
40
|
+
});
|
|
41
|
+
it("renders without crashing when no props are provided", function () {
|
|
42
|
+
render(<Button>{Dummy_label}</Button>);
|
|
43
|
+
expect(screen.getByRole("button")).toBeInTheDocument();
|
|
44
|
+
});
|
|
45
|
+
it("renders button with both startIcon and endIcon", function () {
|
|
46
|
+
render(<Button startIcon={<span>*</span>} endIcon={<span>*</span>}>
|
|
47
|
+
{Dummy_label}
|
|
48
|
+
</Button>);
|
|
49
|
+
expect(screen.getByTestId("start-icon")).toBeInTheDocument();
|
|
50
|
+
expect(screen.getByTestId("end-icon")).toBeInTheDocument();
|
|
51
|
+
});
|
|
52
|
+
it("does not render startIcon when not provided", function () {
|
|
53
|
+
render(<Button>{Dummy_label}</Button>);
|
|
54
|
+
expect(screen.queryByTestId("start-icon")).not.toBeInTheDocument();
|
|
55
|
+
});
|
|
56
|
+
it("does not render endIcon when not provided", function () {
|
|
57
|
+
render(<Button>{Dummy_label}</Button>);
|
|
58
|
+
expect(screen.queryByTestId("end-icon")).not.toBeInTheDocument();
|
|
59
|
+
});
|
|
60
|
+
it("renders correctly without a className prop", function () {
|
|
61
|
+
render(<Button>{Dummy_label}</Button>);
|
|
62
|
+
var buttonElement = screen.getByRole("button");
|
|
63
|
+
expect(buttonElement).not.toHaveClass("custom-class");
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { buttonColors, buttonShapes, iconButtonSize } from ".";
|
|
3
|
+
import LUIcon from "../Icons/LUIcon";
|
|
4
|
+
var IconButton = function (_a) {
|
|
5
|
+
var _b = _a.color, color = _b === void 0 ? "primary" : _b, onClick = _a.onClick, _c = _a.shape, shape = _c === void 0 ? "rounded-none" : _c, _d = _a.size, size = _d === void 0 ? "sm" : _d, className = _a.className, _e = _a.icon, icon = _e === void 0 ? _jsx(LUIcon, { icon: "chart-simple", size: "xs" }) : _e;
|
|
6
|
+
return (_jsx("button", { className: "flex items-center ".concat(buttonShapes[shape], " ").concat(buttonColors[color], " ").concat(className, " ").concat(iconButtonSize[size]), onClick: onClick, children: icon && icon }));
|
|
7
|
+
};
|
|
8
|
+
export default IconButton;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { buttonColors, buttonShapes, iconButtonSize } from ".";
|
|
2
|
+
import LUIcon from "../Icons/LUIcon";
|
|
3
|
+
var IconButton = function (_a) {
|
|
4
|
+
var _b = _a.color, color = _b === void 0 ? "primary" : _b, onClick = _a.onClick, _c = _a.shape, shape = _c === void 0 ? "rounded-none" : _c, _d = _a.size, size = _d === void 0 ? "sm" : _d, className = _a.className, _e = _a.icon, icon = _e === void 0 ? <LUIcon icon="chart-simple" size="xs"/> : _e;
|
|
5
|
+
return (<button className={"flex items-center ".concat(buttonShapes[shape], " ").concat(buttonColors[color], " ").concat(className, " ").concat(iconButtonSize[size])} onClick={onClick}>
|
|
6
|
+
{icon && icon}
|
|
7
|
+
</button>);
|
|
8
|
+
};
|
|
9
|
+
export default IconButton;
|
|
@@ -0,0 +1,53 @@
|
|
|
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 { buttonColors, buttonShapes, iconButtonSize } from ".";
|
|
14
|
+
import LUIcon from "../Icons/LUIcon";
|
|
15
|
+
import IconButton from "./IconButton";
|
|
16
|
+
export default {
|
|
17
|
+
title: "Components/Button/IconButton",
|
|
18
|
+
component: IconButton,
|
|
19
|
+
tags: ["autodocs"],
|
|
20
|
+
};
|
|
21
|
+
var Template = function (args) { return (_jsx(IconButton, __assign({ icon: _jsx(LUIcon, { icon: "chart-simple", size: "xs" }) }, args))); };
|
|
22
|
+
export var _IconButton = Template.bind({});
|
|
23
|
+
_IconButton.args = {
|
|
24
|
+
icon: _jsx(LUIcon, { icon: "chart-simple", size: "xs" }),
|
|
25
|
+
};
|
|
26
|
+
_IconButton.argTypes = {
|
|
27
|
+
color: {
|
|
28
|
+
control: {
|
|
29
|
+
type: "select",
|
|
30
|
+
labels: Object.keys(buttonColors),
|
|
31
|
+
},
|
|
32
|
+
options: Object.keys(buttonColors),
|
|
33
|
+
},
|
|
34
|
+
shape: {
|
|
35
|
+
control: {
|
|
36
|
+
type: "select",
|
|
37
|
+
labels: Object.keys(buttonShapes),
|
|
38
|
+
},
|
|
39
|
+
options: Object.keys(buttonShapes),
|
|
40
|
+
},
|
|
41
|
+
size: {
|
|
42
|
+
control: {
|
|
43
|
+
type: "select",
|
|
44
|
+
labels: Object.keys(iconButtonSize),
|
|
45
|
+
},
|
|
46
|
+
options: Object.keys(iconButtonSize),
|
|
47
|
+
description: "Select the size of the button",
|
|
48
|
+
},
|
|
49
|
+
icon: {
|
|
50
|
+
control: false,
|
|
51
|
+
description: "Icon (React component)",
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { buttonColors, buttonShapes, iconButtonSize } from ".";
|
|
2
|
+
import LUIcon from "../Icons/LUIcon";
|
|
3
|
+
import IconButton from "./IconButton";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/Button/IconButton",
|
|
6
|
+
component: IconButton,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
};
|
|
9
|
+
var Template = function (args) { return (<IconButton icon={<LUIcon icon="chart-simple" size="xs"/>} {...args}/>); };
|
|
10
|
+
export var _IconButton = Template.bind({});
|
|
11
|
+
_IconButton.args = {
|
|
12
|
+
icon: <LUIcon icon="chart-simple" size="xs"/>,
|
|
13
|
+
};
|
|
14
|
+
_IconButton.argTypes = {
|
|
15
|
+
color: {
|
|
16
|
+
control: {
|
|
17
|
+
type: "select",
|
|
18
|
+
labels: Object.keys(buttonColors),
|
|
19
|
+
},
|
|
20
|
+
options: Object.keys(buttonColors),
|
|
21
|
+
},
|
|
22
|
+
shape: {
|
|
23
|
+
control: {
|
|
24
|
+
type: "select",
|
|
25
|
+
labels: Object.keys(buttonShapes),
|
|
26
|
+
},
|
|
27
|
+
options: Object.keys(buttonShapes),
|
|
28
|
+
},
|
|
29
|
+
size: {
|
|
30
|
+
control: {
|
|
31
|
+
type: "select",
|
|
32
|
+
labels: Object.keys(iconButtonSize),
|
|
33
|
+
},
|
|
34
|
+
options: Object.keys(iconButtonSize),
|
|
35
|
+
description: "Select the size of the button",
|
|
36
|
+
},
|
|
37
|
+
icon: {
|
|
38
|
+
control: false,
|
|
39
|
+
description: "Icon (React component)",
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
3
|
+
import { buttonColors, buttonShapes, iconButtonSize } from ".";
|
|
4
|
+
import LUIcon from "../Icons/LUIcon";
|
|
5
|
+
import IconButton from "./IconButton";
|
|
6
|
+
describe("Icon Button Component", function () {
|
|
7
|
+
it("renders icon button with required icon prop", function () {
|
|
8
|
+
render(_jsx(IconButton, { icon: _jsx(LUIcon, { icon: "chart-simple", size: "xs" }) }));
|
|
9
|
+
expect(screen.getByRole("button")).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
it("calls onClick handler when clicked", function () {
|
|
12
|
+
var handleClick = jest.fn();
|
|
13
|
+
render(_jsx(IconButton, { onClick: handleClick, icon: _jsx(LUIcon, { icon: "chart-simple", size: "xs" }) }));
|
|
14
|
+
fireEvent.click(screen.getByRole("button"));
|
|
15
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
16
|
+
});
|
|
17
|
+
it("applies correct color, shape, and size classes", function () {
|
|
18
|
+
render(_jsx(IconButton, { color: "primary", shape: "rounded-lg", size: "lg", icon: _jsx(LUIcon, { icon: "chart-simple", size: "xs" }) }));
|
|
19
|
+
var buttonElement = screen.getByRole("button");
|
|
20
|
+
expect(buttonElement).toHaveClass(buttonColors["primary"], buttonShapes["rounded-lg"], iconButtonSize["lg"]);
|
|
21
|
+
});
|
|
22
|
+
it("applies additional className when provided", function () {
|
|
23
|
+
render(_jsx(IconButton, { className: "custom-class", icon: _jsx(LUIcon, { icon: "chart-simple", size: "xs" }) }));
|
|
24
|
+
expect(screen.getByRole("button")).toHaveClass("custom-class");
|
|
25
|
+
});
|
|
26
|
+
it("renders without crashing when all required props are provided", function () {
|
|
27
|
+
render(_jsx(IconButton, { icon: _jsx(LUIcon, { icon: "chart-simple", size: "xs" }) }));
|
|
28
|
+
expect(screen.getByRole("button")).toBeInTheDocument();
|
|
29
|
+
});
|
|
30
|
+
});
|