@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,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import AttachmentWidget from './AttachmentWidget';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Components/Widget/Attachment',
|
|
7
|
+
component: AttachmentWidget,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Default = args => <AttachmentWidget {...args} />;
|
|
11
|
+
|
|
12
|
+
Default.args = {
|
|
13
|
+
imageSrc: 'https://patenmatch.de/_next/static/media/3.7cbb6de2.webp',
|
|
14
|
+
};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { useTheme } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { AttachmentIcon, CameraIcon, DownloadIcon } from '../Icon';
|
|
5
|
+
import Modal from '../Modal/Modal';
|
|
6
|
+
import Text from '../Text/Text';
|
|
7
|
+
import Widget, { Preview, WidgetProps, WidgetSizes } from './Widget';
|
|
8
|
+
|
|
9
|
+
export const ImageSizes = {
|
|
10
|
+
xsmall: '72px',
|
|
11
|
+
small: '128px',
|
|
12
|
+
medium: '154px',
|
|
13
|
+
large: '180px',
|
|
14
|
+
flex: '100%',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const WidgetContainer = styled.div`
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
width: 100%;
|
|
21
|
+
max-width: ${WidgetSizes.Large};
|
|
22
|
+
height: auto;
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
const ContentContainer = styled.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
width: 100%;
|
|
29
|
+
gap: ${({ theme }) => theme.spacing.xxsmall};
|
|
30
|
+
padding: ${({ theme }) => theme.spacing.xxsmall};
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
const AttachmentDownload = styled.a`
|
|
34
|
+
display: inline-flex;
|
|
35
|
+
color: ${({ theme }) => theme.color.text.primary};
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
gap: ${({ theme }) => theme.spacing.xxsmall};
|
|
39
|
+
text-align: left;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
width: 100%;
|
|
42
|
+
text-decoration: none;
|
|
43
|
+
`;
|
|
44
|
+
|
|
45
|
+
const ImageButton = styled.button`
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
padding: 0;
|
|
48
|
+
background: none;
|
|
49
|
+
border: none;
|
|
50
|
+
font-size: 1rem;
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
const Image = styled.img`
|
|
54
|
+
background-size: cover;
|
|
55
|
+
background-position: center;
|
|
56
|
+
border-radius: ${({ theme }) => theme.radius.small};
|
|
57
|
+
display: flex;
|
|
58
|
+
align-items: end;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
width: 100%;
|
|
61
|
+
height: auto;
|
|
62
|
+
object-fit: cover;
|
|
63
|
+
max-height: 100%;
|
|
64
|
+
max-width: 920px;
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
const Caption = styled(Text)`
|
|
68
|
+
padding: 0 ${({ theme }) => theme.spacing.xxxsmall};
|
|
69
|
+
margin-top: ${({ theme }) => theme.spacing.xxxsmall};
|
|
70
|
+
margin-bottom: ${({ theme }) => theme.spacing.xxxxsmall};
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
interface AttachmentWidgetProps extends Omit<WidgetProps, 'children'> {
|
|
74
|
+
attachmentTitle?: string;
|
|
75
|
+
attachmentLink?: string;
|
|
76
|
+
caption?: string;
|
|
77
|
+
imageSrc?: string;
|
|
78
|
+
isPreview?: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const AttachmentWidget = ({
|
|
82
|
+
attachmentTitle,
|
|
83
|
+
attachmentLink,
|
|
84
|
+
caption,
|
|
85
|
+
imageSrc,
|
|
86
|
+
isPreview,
|
|
87
|
+
}: AttachmentWidgetProps) => {
|
|
88
|
+
const theme = useTheme();
|
|
89
|
+
const defaultTitle = imageSrc ? 'Photo' : 'File';
|
|
90
|
+
const title = attachmentTitle || defaultTitle;
|
|
91
|
+
const [viewImage, setViewImage] = React.useState(false);
|
|
92
|
+
|
|
93
|
+
if (isPreview)
|
|
94
|
+
return (
|
|
95
|
+
<Preview>
|
|
96
|
+
{imageSrc ? (
|
|
97
|
+
<CameraIcon label={'attachment icon'} width={16} />
|
|
98
|
+
) : (
|
|
99
|
+
<AttachmentIcon label={'attachment icon'} width={12} />
|
|
100
|
+
)}
|
|
101
|
+
<Text disableParser>{title}</Text>
|
|
102
|
+
</Preview>
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<WidgetContainer>
|
|
107
|
+
<Widget width={WidgetSizes.Large} padding={imageSrc && '0px'}>
|
|
108
|
+
{imageSrc ? (
|
|
109
|
+
<>
|
|
110
|
+
<Modal open={viewImage} onClose={() => setViewImage(false)}>
|
|
111
|
+
<Image src={imageSrc} alt={title} />
|
|
112
|
+
</Modal>
|
|
113
|
+
<ImageButton onClick={() => setViewImage(true)}>
|
|
114
|
+
<Image src={imageSrc} alt={title} />
|
|
115
|
+
</ImageButton>
|
|
116
|
+
</>
|
|
117
|
+
) : (
|
|
118
|
+
<ContentContainer>
|
|
119
|
+
<AttachmentIcon
|
|
120
|
+
label={'attachment icon'}
|
|
121
|
+
width={20}
|
|
122
|
+
height={20}
|
|
123
|
+
color={theme.color.text.tertiary}
|
|
124
|
+
/>
|
|
125
|
+
<AttachmentDownload href={attachmentLink} download target="_blank">
|
|
126
|
+
<Text disableParser>{title}</Text>
|
|
127
|
+
<DownloadIcon
|
|
128
|
+
label={'download icon'}
|
|
129
|
+
width={20}
|
|
130
|
+
height={20}
|
|
131
|
+
color={theme.color.text.title}
|
|
132
|
+
/>
|
|
133
|
+
</AttachmentDownload>
|
|
134
|
+
</ContentContainer>
|
|
135
|
+
)}
|
|
136
|
+
</Widget>
|
|
137
|
+
{caption && <Caption>{caption}</Caption>}
|
|
138
|
+
</WidgetContainer>
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export default AttachmentWidget;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import textParser from '../../utils/parser';
|
|
4
|
+
import CallWidget from './CallWidget';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Widget/Call',
|
|
8
|
+
component: CallWidget,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Default = args => <CallWidget {...args} />;
|
|
12
|
+
|
|
13
|
+
Default.args = {
|
|
14
|
+
header: 'Call',
|
|
15
|
+
description: '120 minutes',
|
|
16
|
+
isOutgoing: true,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const Missed = args => (
|
|
20
|
+
<CallWidget header="Missed Call" isMissed description="Tap to call back" />
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export const WithParser = args => (
|
|
24
|
+
<>
|
|
25
|
+
{textParser(
|
|
26
|
+
'<CallWidget { "header": "Call", "description": "20 mins", "isMissed": false }></CallWidget>',
|
|
27
|
+
{
|
|
28
|
+
customElements: [
|
|
29
|
+
{
|
|
30
|
+
tag: 'CallWidget',
|
|
31
|
+
Component: CallWidget,
|
|
32
|
+
props: { isOutgoing: true, returnCallLink: 'www.google.com' },
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
)}
|
|
37
|
+
</>
|
|
38
|
+
);
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css, useTheme } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { CallIncomingIcon, CallOutgoingIcon } from '../Icon';
|
|
5
|
+
import Text from '../Text/Text';
|
|
6
|
+
import Widget, { Preview, WidgetProps, WidgetSizes } from './Widget';
|
|
7
|
+
|
|
8
|
+
const CallDescription = styled(Text)`
|
|
9
|
+
color: ${({ theme }) => theme.color.text.secondary};
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
const CallButton = styled.button`
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
text-align: left;
|
|
16
|
+
width: 100%;
|
|
17
|
+
gap: ${({ theme }) => theme.spacing.xsmall};
|
|
18
|
+
border-radius: ${({ theme }) => theme.radius.small};
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
text-decoration: none;
|
|
21
|
+
color: ${({ theme }) => theme.color.text.primary};
|
|
22
|
+
background: none;
|
|
23
|
+
border: none;
|
|
24
|
+
padding: 0;
|
|
25
|
+
margin: 0;
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
const CallInfo = styled.div<{ $isPreview?: boolean }>`
|
|
29
|
+
${({ $isPreview }) =>
|
|
30
|
+
!$isPreview &&
|
|
31
|
+
css`
|
|
32
|
+
margin-right: ${({ theme }) => theme.spacing.xsmall};
|
|
33
|
+
`}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
const CallIcon = ({
|
|
37
|
+
isPreview,
|
|
38
|
+
isOutgoing,
|
|
39
|
+
isMissed,
|
|
40
|
+
}: {
|
|
41
|
+
isPreview?: boolean;
|
|
42
|
+
isOutgoing?: boolean;
|
|
43
|
+
isMissed?: boolean;
|
|
44
|
+
}) => {
|
|
45
|
+
const theme = useTheme();
|
|
46
|
+
|
|
47
|
+
return isOutgoing ? (
|
|
48
|
+
<CallOutgoingIcon
|
|
49
|
+
label={''}
|
|
50
|
+
width={isPreview ? 12 : 20}
|
|
51
|
+
height={isPreview ? 12 : 20}
|
|
52
|
+
borderColor={theme.color.surface.secondary}
|
|
53
|
+
color={isMissed ? theme.color.status.error : theme.color.text.primary}
|
|
54
|
+
circular={!isPreview}
|
|
55
|
+
/>
|
|
56
|
+
) : (
|
|
57
|
+
<CallIncomingIcon
|
|
58
|
+
label={''}
|
|
59
|
+
width={isPreview ? 12 : 20}
|
|
60
|
+
height={isPreview ? 12 : 20}
|
|
61
|
+
borderColor={theme.color.surface.secondary}
|
|
62
|
+
color={isMissed ? theme.color.status.error : theme.color.text.primary}
|
|
63
|
+
circular={!isPreview}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
interface CallWidgetProps extends Omit<WidgetProps, 'children'> {
|
|
69
|
+
description: string;
|
|
70
|
+
isPreview?: boolean;
|
|
71
|
+
isMissed?: boolean;
|
|
72
|
+
isOutgoing?: boolean;
|
|
73
|
+
onReturnCall?: () => void;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const CallWidget = ({
|
|
77
|
+
description,
|
|
78
|
+
header,
|
|
79
|
+
isMissed,
|
|
80
|
+
isOutgoing,
|
|
81
|
+
isPreview,
|
|
82
|
+
onReturnCall,
|
|
83
|
+
...widgetProps
|
|
84
|
+
}: CallWidgetProps) => {
|
|
85
|
+
if (isPreview)
|
|
86
|
+
return (
|
|
87
|
+
<Preview>
|
|
88
|
+
<CallIcon
|
|
89
|
+
isMissed={isMissed}
|
|
90
|
+
isOutgoing={isOutgoing}
|
|
91
|
+
isPreview={isPreview}
|
|
92
|
+
/>
|
|
93
|
+
<Text>{header}</Text>
|
|
94
|
+
</Preview>
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<Widget width={WidgetSizes.Medium} {...widgetProps}>
|
|
99
|
+
<CallButton onClick={onReturnCall}>
|
|
100
|
+
<CallIcon isMissed={isMissed} isOutgoing={isOutgoing} />
|
|
101
|
+
<CallInfo>
|
|
102
|
+
<Text bold>{header}</Text>
|
|
103
|
+
{!isPreview && (
|
|
104
|
+
<CallDescription disableParser>
|
|
105
|
+
{description || 'N/A'}
|
|
106
|
+
</CallDescription>
|
|
107
|
+
)}
|
|
108
|
+
</CallInfo>
|
|
109
|
+
</CallButton>
|
|
110
|
+
</Widget>
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export default CallWidget;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { ValueOf } from '../../utils/types';
|
|
5
|
+
import { TextTypes } from '@a-little-world/little-world-design-system-core';
|
|
6
|
+
import {
|
|
7
|
+
WidgetDimensions,
|
|
8
|
+
WidgetSizes,
|
|
9
|
+
} from '@a-little-world/little-world-design-system-core';
|
|
10
|
+
|
|
11
|
+
export { WidgetSizes };
|
|
12
|
+
|
|
13
|
+
const StyledWidget = styled.div<{
|
|
14
|
+
$borderColor?: string;
|
|
15
|
+
$height?: string;
|
|
16
|
+
$width?: WidgetSizes;
|
|
17
|
+
$padding?: string;
|
|
18
|
+
}>`
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
border-radius: ${({ theme }) => theme.radius.medium};
|
|
22
|
+
background: rgba(0, 0, 0, 0.1);
|
|
23
|
+
box-shadow: 0px 1px 15px 1px rgba(0, 0, 0, 0.05);
|
|
24
|
+
width: 100%;
|
|
25
|
+
max-width: ${({ $width }) => ($width ? WidgetDimensions[$width] : '100%')};
|
|
26
|
+
height: ${({ $height }) => $height || 'auto'};
|
|
27
|
+
padding: ${({ theme, $padding }) => $padding || theme.spacing.xxsmall};
|
|
28
|
+
`;
|
|
29
|
+
|
|
30
|
+
const StyledWidgetHeader = styled.h3<{ $color?: string }>`
|
|
31
|
+
color: ${({ $color, theme }) => $color || theme.color.text.primary};
|
|
32
|
+
font-size: ${TextTypes.Heading4};
|
|
33
|
+
margin-bottom: ${({ theme }) => theme.spacing.xsmall};
|
|
34
|
+
text-align: center;
|
|
35
|
+
`;
|
|
36
|
+
|
|
37
|
+
export interface WidgetProps {
|
|
38
|
+
borderColor?: string;
|
|
39
|
+
children: React.ReactNode;
|
|
40
|
+
className?: string;
|
|
41
|
+
height?: string;
|
|
42
|
+
width?: ValueOf<typeof WidgetSizes>;
|
|
43
|
+
header?: string | React.ReactNode;
|
|
44
|
+
footer?: string | React.ReactNode;
|
|
45
|
+
padding?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const WidgetHeader: React.FC<{
|
|
49
|
+
align?: string;
|
|
50
|
+
children: React.ReactNode;
|
|
51
|
+
textColor?: string;
|
|
52
|
+
}> = ({ children, textColor }) => (
|
|
53
|
+
<StyledWidgetHeader $color={textColor}>{children}</StyledWidgetHeader>
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const Footer = styled.div<{ $align?: string }>`
|
|
57
|
+
display: flex;
|
|
58
|
+
order: 1;
|
|
59
|
+
margin-top: auto;
|
|
60
|
+
width: 100%;
|
|
61
|
+
gap: ${({ theme }) => theme.spacing.xxsmall};
|
|
62
|
+
|
|
63
|
+
${({ $align }) =>
|
|
64
|
+
$align &&
|
|
65
|
+
css`
|
|
66
|
+
justify-content: ${$align};
|
|
67
|
+
`};
|
|
68
|
+
`;
|
|
69
|
+
|
|
70
|
+
export const WidgetFooter: React.FC<{
|
|
71
|
+
align?: string;
|
|
72
|
+
children: React.ReactNode;
|
|
73
|
+
}> = ({ children, align }) => <Footer $align={align}>{children}</Footer>;
|
|
74
|
+
|
|
75
|
+
export const Preview = styled.div`
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: ${({ theme }) => theme.spacing.xxsmall};
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
const Widget: React.FC<WidgetProps> = ({
|
|
82
|
+
borderColor,
|
|
83
|
+
children,
|
|
84
|
+
className,
|
|
85
|
+
footer,
|
|
86
|
+
header,
|
|
87
|
+
height,
|
|
88
|
+
padding,
|
|
89
|
+
width,
|
|
90
|
+
}) => (
|
|
91
|
+
<StyledWidget
|
|
92
|
+
className={className}
|
|
93
|
+
$borderColor={borderColor}
|
|
94
|
+
$height={height}
|
|
95
|
+
$padding={padding}
|
|
96
|
+
$width={width}
|
|
97
|
+
>
|
|
98
|
+
{header && <WidgetHeader>{header}</WidgetHeader>}
|
|
99
|
+
{children}
|
|
100
|
+
{footer && <WidgetFooter>{footer}</WidgetFooter>}
|
|
101
|
+
</StyledWidget>
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
export default Widget;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// globalStyles.js
|
|
2
|
+
import { createGlobalStyle } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { ThemeWeb } from '@a-little-world/little-world-design-system-core';
|
|
5
|
+
|
|
6
|
+
const GlobalStyle = createGlobalStyle<{ theme: ThemeWeb }>`
|
|
7
|
+
html {
|
|
8
|
+
background: ${({ theme }) => theme.color.surface.background};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
body {
|
|
12
|
+
padding: 0;
|
|
13
|
+
margin: 0;
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
overflow-x: hidden;
|
|
16
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
17
|
+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
18
|
+
sans-serif;
|
|
19
|
+
-webkit-font-smoothing: antialiased;
|
|
20
|
+
-moz-osx-font-smoothing: grayscale;
|
|
21
|
+
color: ${({ theme }) => theme.color.text.primary};
|
|
22
|
+
background: ${({ theme }) => theme.color.surface.background};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
code {
|
|
26
|
+
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
|
27
|
+
monospace;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
button {
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
padding: 0;
|
|
33
|
+
background: none;
|
|
34
|
+
border: none;
|
|
35
|
+
font-size: 1rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
p {
|
|
39
|
+
margin: 0;
|
|
40
|
+
padding: 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
h1,
|
|
44
|
+
h2,
|
|
45
|
+
h3,
|
|
46
|
+
h4,
|
|
47
|
+
h5 {
|
|
48
|
+
margin: 0;
|
|
49
|
+
font-weight: normal;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
ul {
|
|
53
|
+
margin-block-end: 0;
|
|
54
|
+
margin-block-start: 0;
|
|
55
|
+
list-style-type: none;
|
|
56
|
+
padding-inline-start: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
* {
|
|
60
|
+
box-sizing: border-box;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
::placeholder {
|
|
64
|
+
color: ${({ theme }) => theme.color.text.tertiary};
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
export default GlobalStyle;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
// Updates the height of a <textarea> when the value changes.
|
|
4
|
+
const useAutosizeTextArea = (
|
|
5
|
+
textAreaRef: HTMLTextAreaElement | null,
|
|
6
|
+
value: string,
|
|
7
|
+
expandable?: boolean,
|
|
8
|
+
) => {
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (textAreaRef && expandable) {
|
|
11
|
+
textAreaRef.style.height = '0px';
|
|
12
|
+
const scrollHeight = textAreaRef.scrollHeight;
|
|
13
|
+
|
|
14
|
+
textAreaRef.style.height = scrollHeight + 'px';
|
|
15
|
+
}
|
|
16
|
+
}, [textAreaRef, value]);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default useAutosizeTextArea;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import 'styled-components';
|
|
2
|
+
import { ThemeWeb } from '@a-little-world/little-world-design-system-core';
|
|
3
|
+
|
|
4
|
+
declare module 'styled-components' {
|
|
5
|
+
export interface DefaultTheme extends ThemeWeb {}
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
default as Accordion,
|
|
10
|
+
AccordionContent,
|
|
11
|
+
} from './components/Accordion/Accordion';
|
|
12
|
+
export {
|
|
13
|
+
default as Button,
|
|
14
|
+
ButtonAppearance,
|
|
15
|
+
ButtonSizes,
|
|
16
|
+
ButtonVariations,
|
|
17
|
+
} from './components/Button/Button';
|
|
18
|
+
export { OPTION_BUTTON_CSS } from './components/Button/styles';
|
|
19
|
+
export {
|
|
20
|
+
default as Card,
|
|
21
|
+
CardContent,
|
|
22
|
+
CardDimensions,
|
|
23
|
+
CardSizes,
|
|
24
|
+
CardFooter,
|
|
25
|
+
CardHeader,
|
|
26
|
+
} from './components/Card/Card';
|
|
27
|
+
export { default as Checkbox } from './components/Checkbox/Checkbox';
|
|
28
|
+
export { default as CheckboxGrid } from './components/CheckboxGrid/CheckboxGrid';
|
|
29
|
+
export { default as Dropdown } from './components/Dropdown/Dropdown';
|
|
30
|
+
|
|
31
|
+
export { default as MultiDropdown } from './components/MultiDropdown/MultiDropdown';
|
|
32
|
+
export * from './components/Icon';
|
|
33
|
+
export * from './components/Illustrations';
|
|
34
|
+
export { default as InputError } from './components/InputError/InputError';
|
|
35
|
+
export { default as Label } from './components/Label/Label';
|
|
36
|
+
export { default as Link } from './components/Link/Link';
|
|
37
|
+
export { default as Loading, LoadingSizes } from './components/Loading/Loading';
|
|
38
|
+
export { default as Modal } from './components/Modal/Modal';
|
|
39
|
+
export { default as MultiCheckbox } from './components/MultiCheckbox/MultiCheckbox';
|
|
40
|
+
export { default as MultiSelection } from './components/MultiSelection/MultiSelection';
|
|
41
|
+
export {
|
|
42
|
+
NavigationMenu,
|
|
43
|
+
NavigationMenuCallout,
|
|
44
|
+
NavigationMenuContent,
|
|
45
|
+
NavigationMenuContentItem,
|
|
46
|
+
NavigationMenuItem,
|
|
47
|
+
NavigationMenuLink,
|
|
48
|
+
NavigationMenuTrigger,
|
|
49
|
+
MenuContentLayout,
|
|
50
|
+
} from './components/NavigationMenu/NavigationMenu';
|
|
51
|
+
export { default as ProgressBar } from './components/ProgressBar/ProgressBar';
|
|
52
|
+
export { default as Popover } from './components/Popover/Popover';
|
|
53
|
+
export { default as InfoPopover } from './components/Popover/InfoPopover';
|
|
54
|
+
export { default as RadioGroup } from './components/RadioGroup/RadioGroup';
|
|
55
|
+
export { default as Separator } from './components/Separator/Separator';
|
|
56
|
+
export { default as Slider } from './components/Slider/Slider';
|
|
57
|
+
export {
|
|
58
|
+
default as StarRating,
|
|
59
|
+
StarRatingSizes,
|
|
60
|
+
} from './components/StarRating/StarRating';
|
|
61
|
+
export { default as StatusMessage } from './components/StatusMessage/StatusMessage';
|
|
62
|
+
export { default as Switch } from './components/Switch/Switch';
|
|
63
|
+
export { default as Tags, Tag } from './components/Tags/Tags';
|
|
64
|
+
export { default as Text } from './components/Text/Text';
|
|
65
|
+
|
|
66
|
+
export {
|
|
67
|
+
default as TextArea,
|
|
68
|
+
TextAreaSize,
|
|
69
|
+
} from './components/TextArea/TextArea';
|
|
70
|
+
export {
|
|
71
|
+
default as TextContent,
|
|
72
|
+
ContentTypes,
|
|
73
|
+
} from './components/TextContent/TextContent';
|
|
74
|
+
export {
|
|
75
|
+
default as TextInput,
|
|
76
|
+
InputHeight,
|
|
77
|
+
InputWidth,
|
|
78
|
+
} from './components/TextInput/TextInput';
|
|
79
|
+
export { default as Toast } from './components/Toast/Toast';
|
|
80
|
+
export { ToastProvider, ToastViewport } from './components/Toast/styles';
|
|
81
|
+
export { default as Tooltip } from './components/Tooltip/Tooltip';
|
|
82
|
+
export { default as CallWidget } from './components/Widget/CallWidget';
|
|
83
|
+
export { default as Widget, WidgetSizes } from './components/Widget/Widget';
|
|
84
|
+
export { default as AttachmentWidget } from './components/Widget/AttachmentWidget';
|
|
85
|
+
|
|
86
|
+
export { CustomThemeProvider, themeContext } from './theme';
|
|
87
|
+
export { default as GlobalStyles } from './globalStyles';
|
|
88
|
+
export { default as textParser } from './utils/parser';
|
|
89
|
+
export { pixelate } from './utils/styles';
|
|
90
|
+
|
|
91
|
+
// types
|
|
92
|
+
export type { TextStyle } from './components/Text/types';
|
|
93
|
+
export type {
|
|
94
|
+
ThemeWeb,
|
|
95
|
+
ToastBaseProps,
|
|
96
|
+
} from '@a-little-world/little-world-design-system-core';
|
|
97
|
+
|
|
98
|
+
// export core elements
|
|
99
|
+
export {
|
|
100
|
+
Gradients,
|
|
101
|
+
StatusTypes,
|
|
102
|
+
TagSizes,
|
|
103
|
+
TagAppearance,
|
|
104
|
+
TextTypes,
|
|
105
|
+
ThemeVariants,
|
|
106
|
+
tokensPixelated as tokens,
|
|
107
|
+
} from '@a-little-world/little-world-design-system-core';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Polyfill for TextEncoder in Node.js environment
|
|
2
|
+
if (typeof global.TextEncoder === 'undefined') {
|
|
3
|
+
const { TextEncoder, TextDecoder } = require('util');
|
|
4
|
+
global.TextEncoder = TextEncoder;
|
|
5
|
+
global.TextDecoder = TextDecoder;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
import '@testing-library/jest-dom';
|