@a-little-world/little-world-design-system 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +7 -0
- package/.storybook/main.ts +36 -0
- package/.storybook/preview-head.html +6 -0
- package/.storybook/preview.ts +15 -0
- package/.turbo/turbo-build.log +14 -0
- package/CHANGELOG.md +398 -0
- package/LICENSE +21 -0
- package/README.md +180 -0
- package/__mocks__/focus-trap-react.tsx +1 -0
- package/__mocks__/svg.tsx +6 -0
- package/dist/cjs/components/Accordion/Accordion.d.ts +15 -0
- package/dist/cjs/components/Accordion/Accordion.js +20 -0
- package/dist/cjs/components/Accordion/styles.d.ts +18 -0
- package/dist/cjs/components/Accordion/styles.js +100 -0
- package/dist/cjs/components/Button/Button.d.ts +9 -0
- package/dist/cjs/components/Button/Button.js +17 -0
- package/dist/cjs/components/Button/styles.d.ts +16 -0
- package/dist/cjs/components/Button/styles.js +313 -0
- package/dist/cjs/components/Card/Card.d.ts +11 -0
- package/dist/cjs/components/Card/Card.js +108 -0
- package/dist/cjs/components/Checkbox/Checkbox.d.ts +15 -0
- package/dist/cjs/components/Checkbox/Checkbox.js +24 -0
- package/dist/cjs/components/Checkbox/styles.d.ts +27 -0
- package/dist/cjs/components/Checkbox/styles.js +108 -0
- package/dist/cjs/components/CheckboxGrid/CheckboxGrid.d.ts +22 -0
- package/dist/cjs/components/CheckboxGrid/CheckboxGrid.js +73 -0
- package/dist/cjs/components/CheckboxGrid/styles.d.ts +64 -0
- package/dist/cjs/components/CheckboxGrid/styles.js +137 -0
- package/dist/cjs/components/Dropdown/Dropdown.d.ts +25 -0
- package/dist/cjs/components/Dropdown/Dropdown.js +70 -0
- package/dist/cjs/components/Dropdown/styles.d.ts +15 -0
- package/dist/cjs/components/Dropdown/styles.js +145 -0
- package/dist/cjs/components/Icon/Icon.d.ts +10 -0
- package/dist/cjs/components/Icon/Icon.js +82 -0
- package/dist/cjs/components/Icon/IconGradient.d.ts +4 -0
- package/dist/cjs/components/Icon/IconGradient.js +29 -0
- package/dist/cjs/components/Icon/createIconComponent.d.ts +10 -0
- package/dist/cjs/components/Icon/createIconComponent.js +31 -0
- package/dist/cjs/components/Icon/getDefaultIconProps.d.ts +2 -0
- package/dist/cjs/components/Icon/getDefaultIconProps.js +15 -0
- package/dist/cjs/components/Icon/index.d.ts +553 -0
- package/dist/cjs/components/Icon/index.js +342 -0
- package/dist/cjs/components/Illustrations/Illustration.d.ts +3 -0
- package/dist/cjs/components/Illustrations/Illustration.js +12 -0
- package/dist/cjs/components/Illustrations/createIllustrationComponent.d.ts +10 -0
- package/dist/cjs/components/Illustrations/createIllustrationComponent.js +23 -0
- package/dist/cjs/components/Illustrations/index.d.ts +152 -0
- package/dist/cjs/components/Illustrations/index.js +81 -0
- package/dist/cjs/components/InputError/InputError.d.ts +15 -0
- package/dist/cjs/components/InputError/InputError.js +79 -0
- package/dist/cjs/components/Label/Label.d.ts +10 -0
- package/dist/cjs/components/Label/Label.js +68 -0
- package/dist/cjs/components/Link/Link.d.ts +6 -0
- package/dist/cjs/components/Link/Link.js +48 -0
- package/dist/cjs/components/Link/styles.d.ts +22 -0
- package/dist/cjs/components/Link/styles.js +99 -0
- package/dist/cjs/components/Loading/Loading.d.ts +10 -0
- package/dist/cjs/components/Loading/Loading.js +27 -0
- package/dist/cjs/components/Loading/LoadingLogo.d.ts +8 -0
- package/dist/cjs/components/Loading/LoadingLogo.js +31 -0
- package/dist/cjs/components/Loading/styles.d.ts +15 -0
- package/dist/cjs/components/Loading/styles.js +107 -0
- package/dist/cjs/components/Modal/Modal.d.ts +20 -0
- package/dist/cjs/components/Modal/Modal.js +95 -0
- package/dist/cjs/components/Modal/styles.d.ts +4 -0
- package/dist/cjs/components/Modal/styles.js +102 -0
- package/dist/cjs/components/MultiCheckbox/MultiCheckbox.d.ts +15 -0
- package/dist/cjs/components/MultiCheckbox/MultiCheckbox.js +61 -0
- package/dist/cjs/components/MultiCheckbox/styles.d.ts +1 -0
- package/dist/cjs/components/MultiCheckbox/styles.js +15 -0
- package/dist/cjs/components/MultiDropdown/MultiDropdown.d.ts +28 -0
- package/dist/cjs/components/MultiDropdown/MultiDropdown.js +124 -0
- package/dist/cjs/components/MultiDropdown/styles.d.ts +7 -0
- package/dist/cjs/components/MultiDropdown/styles.js +44 -0
- package/dist/cjs/components/MultiSelection/MultiSelection.d.ts +16 -0
- package/dist/cjs/components/MultiSelection/MultiSelection.js +62 -0
- package/dist/cjs/components/MultiSelection/styles.d.ts +9 -0
- package/dist/cjs/components/MultiSelection/styles.js +99 -0
- package/dist/cjs/components/NavigationMenu/NavigationMenu.d.ts +35 -0
- package/dist/cjs/components/NavigationMenu/NavigationMenu.js +85 -0
- package/dist/cjs/components/NavigationMenu/styles.d.ts +81 -0
- package/dist/cjs/components/NavigationMenu/styles.js +296 -0
- package/dist/cjs/components/Popover/InfoPopover.d.ts +8 -0
- package/dist/cjs/components/Popover/InfoPopover.js +46 -0
- package/dist/cjs/components/Popover/Popover.d.ts +16 -0
- package/dist/cjs/components/Popover/Popover.js +61 -0
- package/dist/cjs/components/Popover/styles.d.ts +14 -0
- package/dist/cjs/components/Popover/styles.js +116 -0
- package/dist/cjs/components/ProgressBar/ProgressBar.d.ts +8 -0
- package/dist/cjs/components/ProgressBar/ProgressBar.js +85 -0
- package/dist/cjs/components/RadioGroup/RadioGroup.d.ts +16 -0
- package/dist/cjs/components/RadioGroup/RadioGroup.js +24 -0
- package/dist/cjs/components/RadioGroup/styles.d.ts +12 -0
- package/dist/cjs/components/RadioGroup/styles.js +126 -0
- package/dist/cjs/components/Separator/Separator.d.ts +11 -0
- package/dist/cjs/components/Separator/Separator.js +61 -0
- package/dist/cjs/components/Separator/styles.d.ts +6 -0
- package/dist/cjs/components/Separator/styles.js +57 -0
- package/dist/cjs/components/Slider/Slider.d.ts +12 -0
- package/dist/cjs/components/Slider/Slider.js +17 -0
- package/dist/cjs/components/Slider/styles.d.ts +6 -0
- package/dist/cjs/components/Slider/styles.js +57 -0
- package/dist/cjs/components/StarRating/StarRating.d.ts +22 -0
- package/dist/cjs/components/StarRating/StarRating.js +143 -0
- package/dist/cjs/components/StarRating/styles.d.ts +35 -0
- package/dist/cjs/components/StarRating/styles.js +104 -0
- package/dist/cjs/components/StatusMessage/StatusMessage.d.ts +4 -0
- package/dist/cjs/components/StatusMessage/StatusMessage.js +112 -0
- package/dist/cjs/components/Switch/Switch.d.ts +15 -0
- package/dist/cjs/components/Switch/Switch.js +19 -0
- package/dist/cjs/components/Switch/styles.d.ts +14 -0
- package/dist/cjs/components/Switch/styles.js +99 -0
- package/dist/cjs/components/Tags/Tags.d.ts +15 -0
- package/dist/cjs/components/Tags/Tags.js +17 -0
- package/dist/cjs/components/Tags/styles.d.ts +19 -0
- package/dist/cjs/components/Tags/styles.js +119 -0
- package/dist/cjs/components/Text/Text.d.ts +11 -0
- package/dist/cjs/components/Text/Text.js +13 -0
- package/dist/cjs/components/Text/styles.d.ts +8 -0
- package/dist/cjs/components/Text/styles.js +98 -0
- package/dist/cjs/components/Text/types.d.ts +8 -0
- package/dist/cjs/components/Text/types.js +2 -0
- package/dist/cjs/components/TextArea/TextArea.d.ts +19 -0
- package/dist/cjs/components/TextArea/TextArea.js +84 -0
- package/dist/cjs/components/TextArea/styles.d.ts +22 -0
- package/dist/cjs/components/TextArea/styles.js +81 -0
- package/dist/cjs/components/TextContent/TextContent.d.ts +28 -0
- package/dist/cjs/components/TextContent/TextContent.js +46 -0
- package/dist/cjs/components/TextContent/styles.d.ts +24 -0
- package/dist/cjs/components/TextContent/styles.js +75 -0
- package/dist/cjs/components/TextInput/TextInput.d.ts +8 -0
- package/dist/cjs/components/TextInput/TextInput.js +49 -0
- package/dist/cjs/components/TextInput/styles.d.ts +18 -0
- package/dist/cjs/components/TextInput/styles.js +150 -0
- package/dist/cjs/components/Toast/Toast.d.ts +5 -0
- package/dist/cjs/components/Toast/Toast.js +90 -0
- package/dist/cjs/components/Toast/styles.d.ts +27 -0
- package/dist/cjs/components/Toast/styles.js +164 -0
- package/dist/cjs/components/Tooltip/Tooltip.d.ts +9 -0
- package/dist/cjs/components/Tooltip/Tooltip.js +55 -0
- package/dist/cjs/components/Tooltip/styles.d.ts +2 -0
- package/dist/cjs/components/Tooltip/styles.js +24 -0
- package/dist/cjs/components/Widget/AttachmentWidget.d.ts +18 -0
- package/dist/cjs/components/Widget/AttachmentWidget.js +124 -0
- package/dist/cjs/components/Widget/CallWidget.d.ts +11 -0
- package/dist/cjs/components/Widget/CallWidget.js +84 -0
- package/dist/cjs/components/Widget/Widget.d.ts +26 -0
- package/dist/cjs/components/Widget/Widget.js +87 -0
- package/dist/cjs/globalStyles.d.ts +5 -0
- package/dist/cjs/globalStyles.js +66 -0
- package/dist/cjs/hooks/useAutosizeTextArea.d.ts +2 -0
- package/dist/cjs/hooks/useAutosizeTextArea.js +14 -0
- package/dist/cjs/index.d.ts +51 -0
- package/dist/cjs/index.js +139 -0
- package/dist/cjs/storybook/BreakpointDocumentation.d.ts +3 -0
- package/dist/cjs/storybook/BreakpointDocumentation.js +139 -0
- package/dist/cjs/storybook/Components.d.ts +2 -0
- package/dist/cjs/storybook/Components.js +30 -0
- package/dist/cjs/storybook/Documentation.d.ts +5 -0
- package/dist/cjs/storybook/Documentation.js +67 -0
- package/dist/cjs/storybook/RadiusDocumentation.d.ts +3 -0
- package/dist/cjs/storybook/RadiusDocumentation.js +150 -0
- package/dist/cjs/storybook/SpacingDocumentation.d.ts +3 -0
- package/dist/cjs/storybook/SpacingDocumentation.js +146 -0
- package/dist/cjs/theme/index.d.ts +17 -0
- package/dist/cjs/theme/index.js +90 -0
- package/dist/cjs/utils/animations.d.ts +12 -0
- package/dist/cjs/utils/animations.js +120 -0
- package/dist/cjs/utils/createReactSvg.d.ts +3 -0
- package/dist/cjs/utils/createReactSvg.js +77 -0
- package/dist/cjs/utils/parser.d.ts +12 -0
- package/dist/cjs/utils/parser.js +200 -0
- package/dist/cjs/utils/replaceUrlsWithAnchors.d.ts +6 -0
- package/dist/cjs/utils/replaceUrlsWithAnchors.js +32 -0
- package/dist/cjs/utils/status.d.ts +6 -0
- package/dist/cjs/utils/status.js +54 -0
- package/dist/cjs/utils/styles.d.ts +1 -0
- package/dist/cjs/utils/styles.js +5 -0
- package/dist/cjs/utils/types.d.ts +1 -0
- package/dist/cjs/utils/types.js +2 -0
- package/dist/esm/components/Accordion/Accordion.d.ts +15 -0
- package/dist/esm/components/Accordion/Accordion.js +14 -0
- package/dist/esm/components/Accordion/styles.d.ts +18 -0
- package/dist/esm/components/Accordion/styles.js +61 -0
- package/dist/esm/components/Button/Button.d.ts +9 -0
- package/dist/esm/components/Button/Button.js +10 -0
- package/dist/esm/components/Button/styles.d.ts +16 -0
- package/dist/esm/components/Button/styles.js +277 -0
- package/dist/esm/components/Card/Card.d.ts +11 -0
- package/dist/esm/components/Card/Card.js +66 -0
- package/dist/esm/components/Checkbox/Checkbox.d.ts +15 -0
- package/dist/esm/components/Checkbox/Checkbox.js +17 -0
- package/dist/esm/components/Checkbox/styles.d.ts +27 -0
- package/dist/esm/components/Checkbox/styles.js +69 -0
- package/dist/esm/components/CheckboxGrid/CheckboxGrid.d.ts +22 -0
- package/dist/esm/components/CheckboxGrid/CheckboxGrid.js +35 -0
- package/dist/esm/components/CheckboxGrid/styles.d.ts +64 -0
- package/dist/esm/components/CheckboxGrid/styles.js +98 -0
- package/dist/esm/components/Dropdown/Dropdown.d.ts +25 -0
- package/dist/esm/components/Dropdown/Dropdown.js +32 -0
- package/dist/esm/components/Dropdown/styles.d.ts +15 -0
- package/dist/esm/components/Dropdown/styles.js +106 -0
- package/dist/esm/components/Icon/Icon.d.ts +10 -0
- package/dist/esm/components/Icon/Icon.js +42 -0
- package/dist/esm/components/Icon/IconGradient.d.ts +4 -0
- package/dist/esm/components/Icon/IconGradient.js +24 -0
- package/dist/esm/components/Icon/createIconComponent.d.ts +10 -0
- package/dist/esm/components/Icon/createIconComponent.js +24 -0
- package/dist/esm/components/Icon/getDefaultIconProps.d.ts +2 -0
- package/dist/esm/components/Icon/getDefaultIconProps.js +11 -0
- package/dist/esm/components/Icon/index.d.ts +553 -0
- package/dist/esm/components/Icon/index.js +338 -0
- package/dist/esm/components/Illustrations/Illustration.d.ts +3 -0
- package/dist/esm/components/Illustrations/Illustration.js +5 -0
- package/dist/esm/components/Illustrations/createIllustrationComponent.d.ts +10 -0
- package/dist/esm/components/Illustrations/createIllustrationComponent.js +16 -0
- package/dist/esm/components/Illustrations/index.d.ts +152 -0
- package/dist/esm/components/Illustrations/index.js +78 -0
- package/dist/esm/components/InputError/InputError.d.ts +15 -0
- package/dist/esm/components/InputError/InputError.js +40 -0
- package/dist/esm/components/Label/Label.d.ts +10 -0
- package/dist/esm/components/Label/Label.js +30 -0
- package/dist/esm/components/Link/Link.d.ts +6 -0
- package/dist/esm/components/Link/Link.js +13 -0
- package/dist/esm/components/Link/styles.d.ts +22 -0
- package/dist/esm/components/Link/styles.js +63 -0
- package/dist/esm/components/Loading/Loading.d.ts +10 -0
- package/dist/esm/components/Loading/Loading.js +21 -0
- package/dist/esm/components/Loading/LoadingLogo.d.ts +8 -0
- package/dist/esm/components/Loading/LoadingLogo.js +26 -0
- package/dist/esm/components/Loading/styles.d.ts +15 -0
- package/dist/esm/components/Loading/styles.js +71 -0
- package/dist/esm/components/Modal/Modal.d.ts +20 -0
- package/dist/esm/components/Modal/Modal.js +59 -0
- package/dist/esm/components/Modal/styles.d.ts +4 -0
- package/dist/esm/components/Modal/styles.js +63 -0
- package/dist/esm/components/MultiCheckbox/MultiCheckbox.d.ts +15 -0
- package/dist/esm/components/MultiCheckbox/MultiCheckbox.js +23 -0
- package/dist/esm/components/MultiCheckbox/styles.d.ts +1 -0
- package/dist/esm/components/MultiCheckbox/styles.js +9 -0
- package/dist/esm/components/MultiDropdown/MultiDropdown.d.ts +28 -0
- package/dist/esm/components/MultiDropdown/MultiDropdown.js +86 -0
- package/dist/esm/components/MultiDropdown/styles.d.ts +7 -0
- package/dist/esm/components/MultiDropdown/styles.js +38 -0
- package/dist/esm/components/MultiSelection/MultiSelection.d.ts +16 -0
- package/dist/esm/components/MultiSelection/MultiSelection.js +24 -0
- package/dist/esm/components/MultiSelection/styles.d.ts +9 -0
- package/dist/esm/components/MultiSelection/styles.js +63 -0
- package/dist/esm/components/NavigationMenu/NavigationMenu.d.ts +35 -0
- package/dist/esm/components/NavigationMenu/NavigationMenu.js +40 -0
- package/dist/esm/components/NavigationMenu/styles.d.ts +81 -0
- package/dist/esm/components/NavigationMenu/styles.js +257 -0
- package/dist/esm/components/Popover/InfoPopover.d.ts +8 -0
- package/dist/esm/components/Popover/InfoPopover.js +8 -0
- package/dist/esm/components/Popover/Popover.d.ts +16 -0
- package/dist/esm/components/Popover/Popover.js +22 -0
- package/dist/esm/components/Popover/styles.d.ts +14 -0
- package/dist/esm/components/Popover/styles.js +80 -0
- package/dist/esm/components/ProgressBar/ProgressBar.d.ts +8 -0
- package/dist/esm/components/ProgressBar/ProgressBar.js +47 -0
- package/dist/esm/components/RadioGroup/RadioGroup.d.ts +16 -0
- package/dist/esm/components/RadioGroup/RadioGroup.js +19 -0
- package/dist/esm/components/RadioGroup/styles.d.ts +12 -0
- package/dist/esm/components/RadioGroup/styles.js +90 -0
- package/dist/esm/components/Separator/Separator.d.ts +11 -0
- package/dist/esm/components/Separator/Separator.js +23 -0
- package/dist/esm/components/Separator/styles.d.ts +6 -0
- package/dist/esm/components/Separator/styles.js +51 -0
- package/dist/esm/components/Slider/Slider.d.ts +12 -0
- package/dist/esm/components/Slider/Slider.js +12 -0
- package/dist/esm/components/Slider/styles.d.ts +6 -0
- package/dist/esm/components/Slider/styles.js +51 -0
- package/dist/esm/components/StarRating/StarRating.d.ts +22 -0
- package/dist/esm/components/StarRating/StarRating.js +107 -0
- package/dist/esm/components/StarRating/styles.d.ts +35 -0
- package/dist/esm/components/StarRating/styles.js +65 -0
- package/dist/esm/components/StatusMessage/StatusMessage.d.ts +4 -0
- package/dist/esm/components/StatusMessage/StatusMessage.js +74 -0
- package/dist/esm/components/Switch/Switch.d.ts +15 -0
- package/dist/esm/components/Switch/Switch.js +14 -0
- package/dist/esm/components/Switch/styles.d.ts +14 -0
- package/dist/esm/components/Switch/styles.js +63 -0
- package/dist/esm/components/Tags/Tags.d.ts +15 -0
- package/dist/esm/components/Tags/Tags.js +10 -0
- package/dist/esm/components/Tags/styles.d.ts +19 -0
- package/dist/esm/components/Tags/styles.js +80 -0
- package/dist/esm/components/Text/Text.d.ts +11 -0
- package/dist/esm/components/Text/Text.js +8 -0
- package/dist/esm/components/Text/styles.d.ts +8 -0
- package/dist/esm/components/Text/styles.js +62 -0
- package/dist/esm/components/Text/types.d.ts +8 -0
- package/dist/esm/components/Text/types.js +1 -0
- package/dist/esm/components/TextArea/TextArea.d.ts +19 -0
- package/dist/esm/components/TextArea/TextArea.js +45 -0
- package/dist/esm/components/TextArea/styles.d.ts +22 -0
- package/dist/esm/components/TextArea/styles.js +42 -0
- package/dist/esm/components/TextContent/TextContent.d.ts +28 -0
- package/dist/esm/components/TextContent/TextContent.js +40 -0
- package/dist/esm/components/TextContent/styles.d.ts +24 -0
- package/dist/esm/components/TextContent/styles.js +36 -0
- package/dist/esm/components/TextInput/TextInput.d.ts +8 -0
- package/dist/esm/components/TextInput/TextInput.js +42 -0
- package/dist/esm/components/TextInput/styles.d.ts +18 -0
- package/dist/esm/components/TextInput/styles.js +111 -0
- package/dist/esm/components/Toast/Toast.d.ts +5 -0
- package/dist/esm/components/Toast/Toast.js +54 -0
- package/dist/esm/components/Toast/styles.d.ts +27 -0
- package/dist/esm/components/Toast/styles.js +125 -0
- package/dist/esm/components/Tooltip/Tooltip.d.ts +9 -0
- package/dist/esm/components/Tooltip/Tooltip.js +16 -0
- package/dist/esm/components/Tooltip/styles.d.ts +2 -0
- package/dist/esm/components/Tooltip/styles.js +18 -0
- package/dist/esm/components/Widget/AttachmentWidget.d.ts +18 -0
- package/dist/esm/components/Widget/AttachmentWidget.js +85 -0
- package/dist/esm/components/Widget/CallWidget.d.ts +11 -0
- package/dist/esm/components/Widget/CallWidget.js +46 -0
- package/dist/esm/components/Widget/Widget.d.ts +26 -0
- package/dist/esm/components/Widget/Widget.js +46 -0
- package/dist/esm/globalStyles.d.ts +5 -0
- package/dist/esm/globalStyles.js +64 -0
- package/dist/esm/hooks/useAutosizeTextArea.d.ts +2 -0
- package/dist/esm/hooks/useAutosizeTextArea.js +12 -0
- package/dist/esm/index.d.ts +51 -0
- package/dist/esm/index.js +45 -0
- package/dist/esm/storybook/BreakpointDocumentation.d.ts +3 -0
- package/dist/esm/storybook/BreakpointDocumentation.js +101 -0
- package/dist/esm/storybook/Components.d.ts +2 -0
- package/dist/esm/storybook/Components.js +23 -0
- package/dist/esm/storybook/Documentation.d.ts +5 -0
- package/dist/esm/storybook/Documentation.js +62 -0
- package/dist/esm/storybook/RadiusDocumentation.d.ts +3 -0
- package/dist/esm/storybook/RadiusDocumentation.js +112 -0
- package/dist/esm/storybook/SpacingDocumentation.d.ts +3 -0
- package/dist/esm/storybook/SpacingDocumentation.js +108 -0
- package/dist/esm/theme/index.d.ts +17 -0
- package/dist/esm/theme/index.js +53 -0
- package/dist/esm/utils/animations.d.ts +12 -0
- package/dist/esm/utils/animations.js +117 -0
- package/dist/esm/utils/createReactSvg.d.ts +3 -0
- package/dist/esm/utils/createReactSvg.js +70 -0
- package/dist/esm/utils/parser.d.ts +12 -0
- package/dist/esm/utils/parser.js +195 -0
- package/dist/esm/utils/replaceUrlsWithAnchors.d.ts +6 -0
- package/dist/esm/utils/replaceUrlsWithAnchors.js +29 -0
- package/dist/esm/utils/status.d.ts +6 -0
- package/dist/esm/utils/status.js +49 -0
- package/dist/esm/utils/styles.d.ts +1 -0
- package/dist/esm/utils/styles.js +1 -0
- package/dist/esm/utils/types.d.ts +1 -0
- package/dist/esm/utils/types.js +1 -0
- package/jest.config.ts +30 -0
- package/package.json +98 -0
- package/src/components/Accordion/Accordion.stories.tsx +66 -0
- package/src/components/Accordion/Accordion.tsx +59 -0
- package/src/components/Accordion/styles.tsx +68 -0
- package/src/components/Button/Button.stories.tsx +119 -0
- package/src/components/Button/Button.tsx +59 -0
- package/src/components/Button/styles.tsx +313 -0
- package/src/components/Card/Card.stories.tsx +22 -0
- package/src/components/Card/Card.tsx +125 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +11 -0
- package/src/components/Checkbox/Checkbox.tsx +112 -0
- package/src/components/Checkbox/styles.tsx +96 -0
- package/src/components/CheckboxGrid/CheckboxGrid.stories.tsx +49 -0
- package/src/components/CheckboxGrid/CheckboxGrid.tsx +126 -0
- package/src/components/CheckboxGrid/styles.tsx +122 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +59 -0
- package/src/components/Dropdown/Dropdown.tsx +128 -0
- package/src/components/Dropdown/styles.tsx +120 -0
- package/src/components/Icon/Icon.stories.tsx +44 -0
- package/src/components/Icon/Icon.test.tsx +20 -0
- package/src/components/Icon/Icon.tsx +88 -0
- package/src/components/Icon/IconDocs.mdx +22 -0
- package/src/components/Icon/IconGradient.tsx +70 -0
- package/src/components/Icon/createIconComponent.tsx +63 -0
- package/src/components/Icon/getDefaultIconProps.ts +23 -0
- package/src/components/Icon/index.ts +499 -0
- package/src/components/Illustrations/Illustration.tsx +18 -0
- package/src/components/Illustrations/Illustrations.stories.tsx +53 -0
- package/src/components/Illustrations/createIllustrationComponent.tsx +39 -0
- package/src/components/Illustrations/index.ts +118 -0
- package/src/components/InputError/InputError.tsx +86 -0
- package/src/components/Label/Label.stories.tsx +18 -0
- package/src/components/Label/Label.tsx +76 -0
- package/src/components/Link/Link.stories.tsx +14 -0
- package/src/components/Link/Link.test.tsx +27 -0
- package/src/components/Link/Link.tsx +68 -0
- package/src/components/Link/styles.tsx +86 -0
- package/src/components/Loading/Loading.stories.tsx +26 -0
- package/src/components/Loading/Loading.tsx +65 -0
- package/src/components/Loading/LoadingLogo.tsx +141 -0
- package/src/components/Loading/styles.ts +95 -0
- package/src/components/Modal/Modal.stories.tsx +52 -0
- package/src/components/Modal/Modal.test.tsx +98 -0
- package/src/components/Modal/Modal.tsx +115 -0
- package/src/components/Modal/ModalDocs.mdx +21 -0
- package/src/components/Modal/styles.tsx +67 -0
- package/src/components/MultiCheckbox/MultiCheckbox.stories.tsx +24 -0
- package/src/components/MultiCheckbox/MultiCheckbox.tsx +73 -0
- package/src/components/MultiCheckbox/styles.tsx +10 -0
- package/src/components/MultiDropdown/MultiDropdown.stories.tsx +105 -0
- package/src/components/MultiDropdown/MultiDropdown.tsx +247 -0
- package/src/components/MultiDropdown/styles.tsx +45 -0
- package/src/components/MultiSelection/MultiSelection.stories.tsx +19 -0
- package/src/components/MultiSelection/MultiSelection.tsx +74 -0
- package/src/components/MultiSelection/styles.tsx +78 -0
- package/src/components/NavigationMenu/NavigationMenu.stories.tsx +108 -0
- package/src/components/NavigationMenu/NavigationMenu.tsx +151 -0
- package/src/components/NavigationMenu/styles.tsx +293 -0
- package/src/components/Popover/InfoPopover.tsx +40 -0
- package/src/components/Popover/Popover.stories.tsx +85 -0
- package/src/components/Popover/Popover.tsx +68 -0
- package/src/components/Popover/styles.tsx +109 -0
- package/src/components/ProgressBar/ProgressBar.stories.tsx +15 -0
- package/src/components/ProgressBar/ProgressBar.tsx +76 -0
- package/src/components/RadioGroup/RadioGroup.stories.tsx +42 -0
- package/src/components/RadioGroup/RadioGroup.tsx +91 -0
- package/src/components/RadioGroup/styles.tsx +100 -0
- package/src/components/Separator/Separator.stories.tsx +27 -0
- package/src/components/Separator/Separator.tsx +52 -0
- package/src/components/Separator/styles.tsx +57 -0
- package/src/components/Slider/Slider.stories.tsx +27 -0
- package/src/components/Slider/Slider.tsx +61 -0
- package/src/components/Slider/styles.tsx +57 -0
- package/src/components/StarRating/StarRating.stories.tsx +20 -0
- package/src/components/StarRating/StarRating.tsx +212 -0
- package/src/components/StarRating/styles.ts +76 -0
- package/src/components/StatusMessage/StatusMessage.stories.tsx +44 -0
- package/src/components/StatusMessage/StatusMessage.tsx +110 -0
- package/src/components/Switch/Switch.stories.tsx +12 -0
- package/src/components/Switch/Switch.tsx +83 -0
- package/src/components/Switch/styles.tsx +75 -0
- package/src/components/Tags/Tags.stories.tsx +44 -0
- package/src/components/Tags/Tags.tsx +68 -0
- package/src/components/Tags/styles.tsx +89 -0
- package/src/components/Text/Text.stories.tsx +288 -0
- package/src/components/Text/Text.tsx +58 -0
- package/src/components/Text/styles.tsx +75 -0
- package/src/components/Text/types.ts +9 -0
- package/src/components/Text/typography.mdx +91 -0
- package/src/components/TextArea/TextArea.stories.tsx +26 -0
- package/src/components/TextArea/TextArea.tsx +117 -0
- package/src/components/TextArea/styles.tsx +58 -0
- package/src/components/TextContent/TextContent.stories.tsx +54 -0
- package/src/components/TextContent/TextContent.tsx +154 -0
- package/src/components/TextContent/styles.tsx +47 -0
- package/src/components/TextInput/TextInput.stories.tsx +43 -0
- package/src/components/TextInput/TextInput.tsx +146 -0
- package/src/components/TextInput/styles.tsx +129 -0
- package/src/components/Toast/Toast.stories.tsx +55 -0
- package/src/components/Toast/Toast.tsx +139 -0
- package/src/components/Toast/styles.tsx +142 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +31 -0
- package/src/components/Tooltip/Tooltip.tsx +48 -0
- package/src/components/Tooltip/styles.tsx +20 -0
- package/src/components/Widget/AttachmentWidget.stories.tsx +14 -0
- package/src/components/Widget/AttachmentWidget.tsx +142 -0
- package/src/components/Widget/CallWidget.stories.tsx +38 -0
- package/src/components/Widget/CallWidget.tsx +114 -0
- package/src/components/Widget/Widget.stories.tsx +10 -0
- package/src/components/Widget/Widget.tsx +104 -0
- package/src/globalStyles.ts +68 -0
- package/src/hooks/useAutosizeTextArea.tsx +19 -0
- package/src/index.ts +107 -0
- package/src/setupTests.ts +8 -0
- package/src/storybook/BreakpointDocumentation.tsx +126 -0
- package/src/storybook/Components.tsx +29 -0
- package/src/storybook/Documentation.tsx +86 -0
- package/src/storybook/RadiusDocumentation.tsx +133 -0
- package/src/storybook/SpacingDocumentation.tsx +131 -0
- package/src/storybook/breakpoints.mdx +83 -0
- package/src/storybook/colors.mdx +118 -0
- package/src/storybook/radius.mdx +48 -0
- package/src/storybook/spacing.mdx +45 -0
- package/src/testUtils.tsx +49 -0
- package/src/theme/index.tsx +98 -0
- package/src/utils/animations.ts +129 -0
- package/src/utils/createReactSvg.tsx +140 -0
- package/src/utils/parser.mdx +41 -0
- package/src/utils/parser.test.tsx +542 -0
- package/src/utils/parser.tsx +333 -0
- package/src/utils/replaceUrlsWithAnchors.test.ts +42 -0
- package/src/utils/replaceUrlsWithAnchors.ts +32 -0
- package/src/utils/status.tsx +85 -0
- package/src/utils/styles.ts +1 -0
- package/src/utils/types.ts +1 -0
- package/tsconfig.json +34 -0
- package/tsconfig.test.json +16 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import Text from '../Text/Text';
|
|
5
|
+
import { TextTypes } from '@a-little-world/little-world-design-system-core';
|
|
6
|
+
|
|
7
|
+
export const INPUT_ERROR_CSS = css`
|
|
8
|
+
border: 1px solid ${({ theme }) => theme.color.border.error};
|
|
9
|
+
|
|
10
|
+
&:focus,
|
|
11
|
+
&:focus-visible {
|
|
12
|
+
outline: ${({ theme }) => theme.color.border.error} 1px auto;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
const ErrorText = styled(Text)<{
|
|
17
|
+
$top?: string;
|
|
18
|
+
$bottom?: string;
|
|
19
|
+
$right?: string;
|
|
20
|
+
$left?: string;
|
|
21
|
+
$textAlign: 'left' | 'center' | 'right';
|
|
22
|
+
$visible: boolean;
|
|
23
|
+
}>`
|
|
24
|
+
color: ${({ theme }) => theme.color.text.error};
|
|
25
|
+
visibility: hidden;
|
|
26
|
+
opacity: 0;
|
|
27
|
+
transition:
|
|
28
|
+
visibility 1s,
|
|
29
|
+
opacity 1s;
|
|
30
|
+
min-height: ${({ theme }) => theme.spacing.small};
|
|
31
|
+
padding-left: 1px;
|
|
32
|
+
text-align: ${({ $textAlign }) => $textAlign};
|
|
33
|
+
|
|
34
|
+
${({ $top, $bottom, $right, $left }) =>
|
|
35
|
+
($top || $right || $bottom || $left) &&
|
|
36
|
+
`
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: ${$top};
|
|
39
|
+
bottom: ${$bottom};
|
|
40
|
+
right: ${$right};
|
|
41
|
+
left: ${$left};
|
|
42
|
+
`};
|
|
43
|
+
|
|
44
|
+
${({ $visible }) =>
|
|
45
|
+
$visible &&
|
|
46
|
+
`
|
|
47
|
+
visibility: visible;
|
|
48
|
+
opacity: 1;
|
|
49
|
+
`};
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
type Props = {
|
|
53
|
+
children: React.ReactNode;
|
|
54
|
+
top?: string;
|
|
55
|
+
bottom?: string;
|
|
56
|
+
right?: string;
|
|
57
|
+
left?: string;
|
|
58
|
+
visible: boolean;
|
|
59
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
60
|
+
textType?: TextTypes;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const InputError: React.FC<Props> = ({
|
|
64
|
+
children,
|
|
65
|
+
top,
|
|
66
|
+
bottom,
|
|
67
|
+
right,
|
|
68
|
+
left,
|
|
69
|
+
textAlign = 'right',
|
|
70
|
+
textType = TextTypes.Body7,
|
|
71
|
+
visible,
|
|
72
|
+
}) => (
|
|
73
|
+
<ErrorText
|
|
74
|
+
type={textType}
|
|
75
|
+
$visible={visible}
|
|
76
|
+
$top={top}
|
|
77
|
+
$bottom={bottom}
|
|
78
|
+
$right={right}
|
|
79
|
+
$left={left}
|
|
80
|
+
$textAlign={textAlign}
|
|
81
|
+
>
|
|
82
|
+
{children}
|
|
83
|
+
</ErrorText>
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
export default InputError;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Label from './Label';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
component: Label,
|
|
6
|
+
title: 'Components/Label',
|
|
7
|
+
argTypes: {
|
|
8
|
+
text: { control: 'text' },
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Default = ({ text, ...args }) => {
|
|
13
|
+
return <Label {...args}>{text}</Label>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
Default.args = {
|
|
17
|
+
text: 'Default Label',
|
|
18
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as RadixLabel from '@radix-ui/react-label';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
|
|
5
|
+
import textParser from '../../utils/parser';
|
|
6
|
+
import Button, { ButtonSizes, ButtonVariations } from '../Button/Button';
|
|
7
|
+
import { QuestionIcon } from '../Icon';
|
|
8
|
+
import { BODY_5_CSS } from '../Text/styles';
|
|
9
|
+
import InfoPopover from '../Popover/InfoPopover';
|
|
10
|
+
|
|
11
|
+
const StyledLabel = styled(RadixLabel.Root)<{
|
|
12
|
+
$bold?: boolean;
|
|
13
|
+
$inline?: boolean;
|
|
14
|
+
$marginBottom?: string | number;
|
|
15
|
+
}>`
|
|
16
|
+
${BODY_5_CSS}
|
|
17
|
+
width: fit-content;
|
|
18
|
+
|
|
19
|
+
${({ $bold, $inline, $marginBottom, theme }) => css`
|
|
20
|
+
${$bold && 'font-weight: bold;'}
|
|
21
|
+
display: ${$inline ? 'inline-flex' : 'block'};
|
|
22
|
+
margin-bottom: ${$marginBottom ?? theme.spacing.xxsmall};
|
|
23
|
+
gap: ${theme.spacing.xxxsmall};
|
|
24
|
+
align-items: center;
|
|
25
|
+
`}
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const InfoPopoverTrigger = styled(Button)`
|
|
29
|
+
color: ${({ theme }) => theme.color.surface.bold};
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
type LabelProps = RadixLabel.LabelProps & {
|
|
33
|
+
bold?: boolean;
|
|
34
|
+
inline?: boolean;
|
|
35
|
+
marginBottom?: string | number;
|
|
36
|
+
tooltipText?: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const Label: React.FC<LabelProps> = ({
|
|
40
|
+
bold,
|
|
41
|
+
className,
|
|
42
|
+
children,
|
|
43
|
+
inline,
|
|
44
|
+
marginBottom,
|
|
45
|
+
asChild,
|
|
46
|
+
htmlFor,
|
|
47
|
+
tooltipText,
|
|
48
|
+
}) => {
|
|
49
|
+
return (
|
|
50
|
+
<StyledLabel
|
|
51
|
+
$bold={bold}
|
|
52
|
+
$inline={Boolean(inline || tooltipText)}
|
|
53
|
+
$marginBottom={inline ? '0px' : marginBottom}
|
|
54
|
+
className={className}
|
|
55
|
+
asChild={asChild}
|
|
56
|
+
htmlFor={htmlFor}
|
|
57
|
+
>
|
|
58
|
+
{typeof children === 'string' ? textParser(children) : children}
|
|
59
|
+
{tooltipText && (
|
|
60
|
+
<InfoPopover
|
|
61
|
+
trigger={
|
|
62
|
+
<InfoPopoverTrigger
|
|
63
|
+
variation={ButtonVariations.Icon}
|
|
64
|
+
size={ButtonSizes.Small}
|
|
65
|
+
>
|
|
66
|
+
<QuestionIcon label="questionIcon" />
|
|
67
|
+
</InfoPopoverTrigger>
|
|
68
|
+
}
|
|
69
|
+
text={tooltipText}
|
|
70
|
+
/>
|
|
71
|
+
)}
|
|
72
|
+
</StyledLabel>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default Label;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Link from './Link';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: Link,
|
|
7
|
+
title: 'Components/Link',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Default = args => <Link {...args}>Blah Blah</Link>;
|
|
11
|
+
|
|
12
|
+
Default.args = {
|
|
13
|
+
href: 'www.little-world.com',
|
|
14
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { render, renderWithUser, screen } from '../../testUtils';
|
|
5
|
+
import Link from './Link';
|
|
6
|
+
|
|
7
|
+
export const MOCK_TEXT = 'Great content';
|
|
8
|
+
export const MOCK_SLUG = '/home';
|
|
9
|
+
|
|
10
|
+
test('Link renders correctly when "href" provided', () => {
|
|
11
|
+
render(<Link href={MOCK_SLUG}>{MOCK_TEXT}</Link>);
|
|
12
|
+
const link = screen.getByRole('link');
|
|
13
|
+
expect(link.textContent).toEqual(MOCK_TEXT);
|
|
14
|
+
expect(link).toHaveAttribute('href', MOCK_SLUG);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test('Link on click should call function', async () => {
|
|
18
|
+
const onClick = jest.fn();
|
|
19
|
+
const { user } = renderWithUser(
|
|
20
|
+
<Link href={MOCK_SLUG} onClick={onClick}>
|
|
21
|
+
{MOCK_TEXT}
|
|
22
|
+
</Link>,
|
|
23
|
+
);
|
|
24
|
+
const link = screen.getByRole('link');
|
|
25
|
+
await user.click(link);
|
|
26
|
+
expect(onClick).toHaveBeenCalled();
|
|
27
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { LinkProps as RouterLinkProps } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
LinkBaseProps,
|
|
6
|
+
TextTypes,
|
|
7
|
+
} from '@a-little-world/little-world-design-system-core';
|
|
8
|
+
import { Anchor, AnchorText, RouterLink } from './styles';
|
|
9
|
+
|
|
10
|
+
export type LinkProps = Omit<RouterLinkProps, 'to'> & LinkBaseProps;
|
|
11
|
+
|
|
12
|
+
const Variants = {
|
|
13
|
+
href: Anchor,
|
|
14
|
+
to: RouterLink,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const Link = forwardRef<HTMLAnchorElement, LinkProps>(
|
|
18
|
+
(
|
|
19
|
+
{
|
|
20
|
+
active,
|
|
21
|
+
bold,
|
|
22
|
+
buttonAppearance,
|
|
23
|
+
buttonSize,
|
|
24
|
+
children,
|
|
25
|
+
className,
|
|
26
|
+
href,
|
|
27
|
+
onClick,
|
|
28
|
+
state,
|
|
29
|
+
style,
|
|
30
|
+
target,
|
|
31
|
+
to,
|
|
32
|
+
textType,
|
|
33
|
+
textDecoration = true,
|
|
34
|
+
...props
|
|
35
|
+
},
|
|
36
|
+
ref,
|
|
37
|
+
) => {
|
|
38
|
+
const Component = Variants[href ? 'href' : 'to'] as React.ElementType;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Component
|
|
42
|
+
{...(href ? { href } : { to })}
|
|
43
|
+
className={className}
|
|
44
|
+
ref={ref}
|
|
45
|
+
$active={active}
|
|
46
|
+
onClick={onClick}
|
|
47
|
+
$buttonAppearance={buttonAppearance}
|
|
48
|
+
$size={buttonSize}
|
|
49
|
+
state={state}
|
|
50
|
+
style={style}
|
|
51
|
+
target={target}
|
|
52
|
+
$textDecoration={textDecoration}
|
|
53
|
+
{...props}
|
|
54
|
+
>
|
|
55
|
+
<AnchorText
|
|
56
|
+
as="span"
|
|
57
|
+
$type={textType || TextTypes.Body5}
|
|
58
|
+
$bold={Boolean(bold)}
|
|
59
|
+
$center={false}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
</AnchorText>
|
|
63
|
+
</Component>
|
|
64
|
+
);
|
|
65
|
+
},
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export default Link;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Link } from 'react-router-dom';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { ButtonAppearance, ButtonSizes } from '../Button/Button';
|
|
5
|
+
import { PrimaryButtonCss, SecondaryButtonCss } from '../Button/styles';
|
|
6
|
+
import { StyledElement } from '../Text/styles';
|
|
7
|
+
|
|
8
|
+
export const LINK_HOVER_CSS = css`
|
|
9
|
+
transition: all 0.3s ease-in-out;
|
|
10
|
+
background: transparent;
|
|
11
|
+
|
|
12
|
+
// underline hover effect
|
|
13
|
+
&::before {
|
|
14
|
+
content: '';
|
|
15
|
+
background: currentColor;
|
|
16
|
+
display: block;
|
|
17
|
+
position: absolute;
|
|
18
|
+
bottom: -1px;
|
|
19
|
+
left: 0;
|
|
20
|
+
width: 0;
|
|
21
|
+
height: 1px;
|
|
22
|
+
transition: all 0.3s ease-in-out;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
const LINK_CSS = css<{
|
|
27
|
+
$color?: string;
|
|
28
|
+
$buttonAppearance?: ButtonAppearance;
|
|
29
|
+
$textDecoration: boolean;
|
|
30
|
+
}>`
|
|
31
|
+
position: relative;
|
|
32
|
+
display: inline-flex;
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
border: none;
|
|
35
|
+
|
|
36
|
+
> span {
|
|
37
|
+
color: currentColor;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
${({ theme, $buttonAppearance, $color, $textDecoration }) =>
|
|
41
|
+
$buttonAppearance
|
|
42
|
+
? css`
|
|
43
|
+
${$buttonAppearance === ButtonAppearance.Primary
|
|
44
|
+
? PrimaryButtonCss
|
|
45
|
+
: SecondaryButtonCss}
|
|
46
|
+
box-sizing: border-box;
|
|
47
|
+
align-items: center;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
`
|
|
50
|
+
: css`
|
|
51
|
+
color: ${$color || theme.color.text.link};
|
|
52
|
+
|
|
53
|
+
${$textDecoration && LINK_HOVER_CSS}
|
|
54
|
+
|
|
55
|
+
&:hover {
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
background-position: 0;
|
|
58
|
+
|
|
59
|
+
&::before {
|
|
60
|
+
width: 100%;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`}
|
|
64
|
+
`;
|
|
65
|
+
|
|
66
|
+
export const RouterLink = styled(Link)<{
|
|
67
|
+
$active?: boolean;
|
|
68
|
+
$color?: string;
|
|
69
|
+
$buttonAppearance?: ButtonAppearance;
|
|
70
|
+
$size?: keyof typeof ButtonSizes;
|
|
71
|
+
$textDecoration: boolean;
|
|
72
|
+
}>`
|
|
73
|
+
${LINK_CSS}
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
export const Anchor = styled.a<{
|
|
77
|
+
$active?: boolean;
|
|
78
|
+
$color?: string;
|
|
79
|
+
$buttonAppearance?: ButtonAppearance;
|
|
80
|
+
$size?: keyof typeof ButtonSizes;
|
|
81
|
+
$textDecoration: boolean;
|
|
82
|
+
}>`
|
|
83
|
+
${LINK_CSS}
|
|
84
|
+
`;
|
|
85
|
+
|
|
86
|
+
export const AnchorText = styled(StyledElement)``;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Loading, { LoadingSizes, LoadingType } from './Loading';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
component: Loading,
|
|
7
|
+
title: 'Components/Loading',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Default = args => (
|
|
11
|
+
<div>
|
|
12
|
+
<div>Love</div>
|
|
13
|
+
<Loading {...args} />
|
|
14
|
+
<div>Love</div>
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
Default.args = {
|
|
19
|
+
href: 'www.little-world.com',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const Logo = args => (
|
|
23
|
+
<div>
|
|
24
|
+
<Loading {...args} type={LoadingType.Logo} size={LoadingSizes.XXLarge} />
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
LoadingBaseProps,
|
|
4
|
+
LoadingSizes,
|
|
5
|
+
LoadingType,
|
|
6
|
+
} from '@a-little-world/little-world-design-system-core';
|
|
7
|
+
|
|
8
|
+
import { LoadingContainer, LoadingElement, LogoContainer } from './styles';
|
|
9
|
+
import LoadingLogo from './LoadingLogo';
|
|
10
|
+
|
|
11
|
+
// Re-export enum for easy access
|
|
12
|
+
export { LoadingSizes, LoadingType };
|
|
13
|
+
|
|
14
|
+
export const LOADING_RING_ID = 'loadingRing';
|
|
15
|
+
export const LOADING_LOGO_ID = 'loadingLogo';
|
|
16
|
+
|
|
17
|
+
export interface LoadingProps extends LoadingBaseProps {
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const Loading: React.FC<LoadingProps> = ({
|
|
22
|
+
align,
|
|
23
|
+
className,
|
|
24
|
+
color,
|
|
25
|
+
inline = false,
|
|
26
|
+
size = LoadingSizes.Small,
|
|
27
|
+
type = LoadingType.Ring,
|
|
28
|
+
}) => {
|
|
29
|
+
if (type === LoadingType.Logo) {
|
|
30
|
+
return (
|
|
31
|
+
<LoadingContainer
|
|
32
|
+
className={className}
|
|
33
|
+
$align={align}
|
|
34
|
+
$color={color}
|
|
35
|
+
$inline={inline}
|
|
36
|
+
$size={size}
|
|
37
|
+
$type={type}
|
|
38
|
+
data-testid={LOADING_LOGO_ID}
|
|
39
|
+
>
|
|
40
|
+
<LogoContainer $size={size}>
|
|
41
|
+
<LoadingLogo size={size} />
|
|
42
|
+
</LogoContainer>
|
|
43
|
+
</LoadingContainer>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<LoadingContainer
|
|
49
|
+
className={className}
|
|
50
|
+
$align={align}
|
|
51
|
+
$color={color}
|
|
52
|
+
$inline={inline}
|
|
53
|
+
$size={size}
|
|
54
|
+
$type={type}
|
|
55
|
+
data-testid={LOADING_RING_ID}
|
|
56
|
+
>
|
|
57
|
+
<LoadingElement $color={color} $size={size} />
|
|
58
|
+
<LoadingElement $color={color} $size={size} />
|
|
59
|
+
<LoadingElement $color={color} $size={size} />
|
|
60
|
+
<LoadingElement $color={color} $size={size} />
|
|
61
|
+
</LoadingContainer>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default Loading;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
LoadingDimensions,
|
|
5
|
+
LoadingSizes,
|
|
6
|
+
} from '@a-little-world/little-world-design-system-core';
|
|
7
|
+
|
|
8
|
+
export interface LoadingLogoProps {
|
|
9
|
+
size?: LoadingSizes;
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const LoadingLogo: React.FC<LoadingLogoProps> = ({
|
|
14
|
+
size = LoadingSizes.Small,
|
|
15
|
+
label = 'Loading logo',
|
|
16
|
+
}) => {
|
|
17
|
+
const dimension = LoadingDimensions[size];
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<svg
|
|
21
|
+
aria-label={label}
|
|
22
|
+
role="img"
|
|
23
|
+
fill="none"
|
|
24
|
+
focusable={false}
|
|
25
|
+
width={dimension}
|
|
26
|
+
height={dimension}
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
viewBox="-0.01 0 100.38 66.86"
|
|
29
|
+
>
|
|
30
|
+
<defs>
|
|
31
|
+
{/* Animated orange gradient – opacity wave left → right → left */}
|
|
32
|
+
<linearGradient
|
|
33
|
+
id="loadingOrangeGradient"
|
|
34
|
+
y1="35.21"
|
|
35
|
+
x2="80"
|
|
36
|
+
y2="35.21"
|
|
37
|
+
gradientUnits="userSpaceOnUse"
|
|
38
|
+
>
|
|
39
|
+
{/* Left edge – start already faint */}
|
|
40
|
+
<stop offset="0" stopColor="#d85509" stopOpacity="0.25">
|
|
41
|
+
<animate
|
|
42
|
+
attributeName="stop-opacity"
|
|
43
|
+
values="0.25;1;0.25"
|
|
44
|
+
dur="2s"
|
|
45
|
+
repeatCount="indefinite"
|
|
46
|
+
/>
|
|
47
|
+
</stop>
|
|
48
|
+
|
|
49
|
+
{/* Left/middle – start already faint */}
|
|
50
|
+
<stop offset="0.14" stopColor="#df6510" stopOpacity="0.25">
|
|
51
|
+
<animate
|
|
52
|
+
attributeName="stop-opacity"
|
|
53
|
+
values="0.25;1;0.25"
|
|
54
|
+
dur="2s"
|
|
55
|
+
begin="0.2s"
|
|
56
|
+
repeatCount="indefinite"
|
|
57
|
+
/>
|
|
58
|
+
</stop>
|
|
59
|
+
|
|
60
|
+
{/* Central overlap – start already faint */}
|
|
61
|
+
<stop offset="0.49" stopColor="#ed861f" stopOpacity="0.25">
|
|
62
|
+
<animate
|
|
63
|
+
attributeName="stop-opacity"
|
|
64
|
+
values="0.25;1;0.25"
|
|
65
|
+
dur="2s"
|
|
66
|
+
begin="0.4s"
|
|
67
|
+
repeatCount="indefinite"
|
|
68
|
+
/>
|
|
69
|
+
</stop>
|
|
70
|
+
|
|
71
|
+
{/* Right side – start already faint */}
|
|
72
|
+
<stop offset="0.67" stopColor="#f39325" stopOpacity="0.25">
|
|
73
|
+
<animate
|
|
74
|
+
attributeName="stop-opacity"
|
|
75
|
+
values="0.25;1;0.25"
|
|
76
|
+
dur="2s"
|
|
77
|
+
begin="0.6s"
|
|
78
|
+
repeatCount="indefinite"
|
|
79
|
+
/>
|
|
80
|
+
</stop>
|
|
81
|
+
</linearGradient>
|
|
82
|
+
|
|
83
|
+
{/* Animated blue gradient – same phased opacity wave */}
|
|
84
|
+
<linearGradient
|
|
85
|
+
id="loadingBlueGradient"
|
|
86
|
+
x1="20.41"
|
|
87
|
+
y1="31.58"
|
|
88
|
+
x2="100.41"
|
|
89
|
+
y2="31.58"
|
|
90
|
+
gradientUnits="userSpaceOnUse"
|
|
91
|
+
>
|
|
92
|
+
{/* Left blue */}
|
|
93
|
+
<stop offset="0.18" stopColor="#36a9e1" stopOpacity="0.4">
|
|
94
|
+
<animate
|
|
95
|
+
attributeName="stop-opacity"
|
|
96
|
+
values="0.25;1;0.25"
|
|
97
|
+
dur="2s"
|
|
98
|
+
repeatCount="indefinite"
|
|
99
|
+
/>
|
|
100
|
+
</stop>
|
|
101
|
+
|
|
102
|
+
{/* Central blue */}
|
|
103
|
+
<stop offset="0.56" stopColor="#1f8bcc" stopOpacity="0.4">
|
|
104
|
+
<animate
|
|
105
|
+
attributeName="stop-opacity"
|
|
106
|
+
values="0.25;1;0.25"
|
|
107
|
+
dur="2s"
|
|
108
|
+
begin="0.2s"
|
|
109
|
+
repeatCount="indefinite"
|
|
110
|
+
/>
|
|
111
|
+
</stop>
|
|
112
|
+
|
|
113
|
+
{/* Right blue */}
|
|
114
|
+
<stop offset="1" stopColor="#0063af" stopOpacity="0.4">
|
|
115
|
+
<animate
|
|
116
|
+
attributeName="stop-opacity"
|
|
117
|
+
values="0.25;1;0.25"
|
|
118
|
+
dur="2s"
|
|
119
|
+
begin="0.4s"
|
|
120
|
+
repeatCount="indefinite"
|
|
121
|
+
/>
|
|
122
|
+
</stop>
|
|
123
|
+
</linearGradient>
|
|
124
|
+
</defs>
|
|
125
|
+
|
|
126
|
+
{/* Blue shape */}
|
|
127
|
+
<path
|
|
128
|
+
fill="url(#loadingBlueGradient)"
|
|
129
|
+
d="M66.69,8.56H50.2a24.68,24.68,0,0,1,9.39,1.85c-.33.32-.65.65-1,1a1.38,1.38,0,0,0-.29,1.72c.17.35.38.68.57,1a8.33,8.33,0,0,0,1.66,1.94A1.61,1.61,0,0,1,61,17.68c-.09.36.12.71-.08,1,0,.06,0,.22.1.33.4.82.74,1,1.65.75a7.1,7.1,0,0,1,2.47-.17,1.76,1.76,0,0,1,1.56,1.05c.1.23.17.46.27.68a1.28,1.28,0,0,0,1.43.9,3,3,0,0,0,2.08-1.09c.25-.31.49-.64.73-1a24.69,24.69,0,0,1,2.5,21,2.7,2.7,0,0,0-.93-.46,1.74,1.74,0,0,1-1-2.71c.06-.1.14-.19.2-.3A1.19,1.19,0,0,0,72,36.37a6.42,6.42,0,0,0-.38-.53,1.24,1.24,0,0,0-2-.17A5.79,5.79,0,0,1,67.35,37c-.93.27-1.87.54-2.81.78a3.77,3.77,0,0,0-1.5.74,1.6,1.6,0,0,1-1.28.44,14.53,14.53,0,0,0-2.09-.23,3.28,3.28,0,0,0-3.29,1.45,2.3,2.3,0,0,1-1.84,1.15l-.22,0a1.23,1.23,0,0,0-.94,1.09,2.67,2.67,0,0,0,1.34,2.8,9.66,9.66,0,0,1,2.51,2.12,4.25,4.25,0,0,1,1.15,1.69c.33,1.14.28,1.77-.62,2.29a10.91,10.91,0,0,0-1.54,1.91A3.1,3.1,0,0,0,56,55.63c.16.58.28,1.17.4,1.75a24.84,24.84,0,0,1-6.2.79H29.8a24.81,24.81,0,1,1,0-49.61h3.92a29.6,29.6,0,0,1,16.48-5H29.8A29.77,29.77,0,0,0,6.94,52.45L4.83,66.86,15,59.22A29.61,29.61,0,0,0,29.8,63.16H50.2A29.79,29.79,0,0,0,66.69,8.56Z"
|
|
130
|
+
/>
|
|
131
|
+
|
|
132
|
+
{/* Orange shape */}
|
|
133
|
+
<path
|
|
134
|
+
fill="url(#loadingOrangeGradient)"
|
|
135
|
+
d="M91.65,12.29,93.45,0,84.26,6.89A29.57,29.57,0,0,0,70.61,3.57H50.2a29.79,29.79,0,0,0-16.48,54.6H50.2a24.79,24.79,0,0,1-23-34.09,2.36,2.36,0,0,0,.59.24,8,8,0,0,1,1,.33c0,.1,0,.13,0,.15a.87.87,0,0,0,.32,1.12,1.43,1.43,0,0,1,.31,2,3.33,3.33,0,0,1-.43.67,4.31,4.31,0,0,0-1,3.61,6.84,6.84,0,0,0,.34,1.42A2.43,2.43,0,0,0,29.59,35a2.32,2.32,0,0,0,2.1.06,3.41,3.41,0,0,1,.76-.26,1.15,1.15,0,0,1,1.41.62c.28.48.56,1,.83,1.46a20.21,20.21,0,0,0,2.55,3.91,2.13,2.13,0,0,1,.49,1.33,1.67,1.67,0,0,1-.56,1.14,13,13,0,0,0-1.77,2.23,1.35,1.35,0,0,0,0,1.58c.35.47.8.57,1.52.36A8.92,8.92,0,0,1,38,47.14a12.34,12.34,0,0,0,2.8-.82,3.68,3.68,0,0,0,2.33-2.56,9.66,9.66,0,0,0,.21-2.84c-.06-1-.09-2.09-.11-3.14a.81.81,0,0,1,.22-.52,7.71,7.71,0,0,1,1.26-1.1,6.71,6.71,0,0,0,1.38-1A1.51,1.51,0,0,0,46.61,34c0-.39,0-.78-.09-1.16-.07-.81-.16-1.61-.2-2.41a2.34,2.34,0,0,1,1.31-2.48,1,1,0,0,0,.61-1.12c-.15-1-.28-2-.49-3a14.88,14.88,0,0,1-.38-3,4.85,4.85,0,0,0-.07-.55h-.83c-.62,0-1.23,0-1.84,0-.4,0-.63-.35-.44-.63a3.46,3.46,0,0,0,.4-1.89,1,1,0,0,0-.81-1c-.61,0-1.22,0-1.83.05a8,8,0,0,1-1.09.08,1.47,1.47,0,0,1-.79-.3,6.3,6.3,0,0,1-1.86-2.58,13.63,13.63,0,0,1-.53-1.82s0-.05,0-.09A24.64,24.64,0,0,1,50.2,8.56H70.61a24.81,24.81,0,0,1,0,49.61H66.69a29.61,29.61,0,0,1-16.49,5H70.61a29.78,29.78,0,0,0,21-50.87Z"
|
|
136
|
+
/>
|
|
137
|
+
</svg>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export default LoadingLogo;
|