@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,151 @@
|
|
|
1
|
+
import * as RadixNavigationMenu from '@radix-ui/react-navigation-menu';
|
|
2
|
+
import React, { HTMLProps, PropsWithChildren, ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Logo } from '../Icon';
|
|
5
|
+
import { LinkProps } from '../Link/Link';
|
|
6
|
+
import {
|
|
7
|
+
Callout,
|
|
8
|
+
CalloutHeading,
|
|
9
|
+
CalloutText,
|
|
10
|
+
ContentList,
|
|
11
|
+
ListItemHeading,
|
|
12
|
+
ListItemLink,
|
|
13
|
+
ListItemText,
|
|
14
|
+
MenuTriggerIcon,
|
|
15
|
+
NavMenuContent,
|
|
16
|
+
NavMenuIndicator,
|
|
17
|
+
NavMenuIndicatorArrow,
|
|
18
|
+
NavMenuLink,
|
|
19
|
+
NavMenuList,
|
|
20
|
+
NavMenuRoot,
|
|
21
|
+
NavMenuTrigger,
|
|
22
|
+
NavMenuViewport,
|
|
23
|
+
ViewportPosition,
|
|
24
|
+
} from './styles';
|
|
25
|
+
|
|
26
|
+
export enum MenuContentLayout {
|
|
27
|
+
callout = 'callout',
|
|
28
|
+
calloutWithList = 'calloutWithList',
|
|
29
|
+
oneColumn = 'oneColumn',
|
|
30
|
+
twoColumns = 'twoColumns',
|
|
31
|
+
threeColumns = 'threeColumns',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface NavigationMenuContentItemProps extends HTMLProps<HTMLAnchorElement> {
|
|
35
|
+
active?: boolean;
|
|
36
|
+
title?: string;
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
}
|
|
39
|
+
const NavigationMenuContentItem = React.forwardRef<
|
|
40
|
+
HTMLAnchorElement,
|
|
41
|
+
NavigationMenuContentItemProps
|
|
42
|
+
>(({ active, className, children, title, ...props }, forwardedRef) => (
|
|
43
|
+
<li>
|
|
44
|
+
<RadixNavigationMenu.Link asChild active={active}>
|
|
45
|
+
<ListItemLink
|
|
46
|
+
className={className}
|
|
47
|
+
{...(props as LinkProps)}
|
|
48
|
+
ref={forwardedRef}
|
|
49
|
+
textDecoration={false}
|
|
50
|
+
active={active}
|
|
51
|
+
>
|
|
52
|
+
<ListItemHeading tag="h3">{title}</ListItemHeading>
|
|
53
|
+
<ListItemText className="ListItemText">{children}</ListItemText>
|
|
54
|
+
</ListItemLink>
|
|
55
|
+
</RadixNavigationMenu.Link>
|
|
56
|
+
</li>
|
|
57
|
+
));
|
|
58
|
+
|
|
59
|
+
const NavigationMenuList = NavMenuList;
|
|
60
|
+
const NavigationMenuItem = RadixNavigationMenu.Item;
|
|
61
|
+
const NavigationMenuLink = (
|
|
62
|
+
props: LinkProps & RadixNavigationMenu.NavigationMenuLinkProps,
|
|
63
|
+
) => (
|
|
64
|
+
<RadixNavigationMenu.Link asChild>
|
|
65
|
+
<NavMenuLink {...props} textDecoration={false}>
|
|
66
|
+
{props.children}
|
|
67
|
+
</NavMenuLink>
|
|
68
|
+
</RadixNavigationMenu.Link>
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
const NavigationMenuTrigger = ({ children }: PropsWithChildren) => (
|
|
72
|
+
<NavMenuTrigger>
|
|
73
|
+
{children}
|
|
74
|
+
<MenuTriggerIcon width={12} height={12} label="menu trigger icon" />
|
|
75
|
+
</NavMenuTrigger>
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
interface CalloutProps {
|
|
79
|
+
heading: string;
|
|
80
|
+
description: string;
|
|
81
|
+
link: string;
|
|
82
|
+
Icon?: any;
|
|
83
|
+
to?: string;
|
|
84
|
+
href?: string;
|
|
85
|
+
}
|
|
86
|
+
const NavigationMenuCallout = ({
|
|
87
|
+
heading,
|
|
88
|
+
description,
|
|
89
|
+
Icon,
|
|
90
|
+
to,
|
|
91
|
+
href,
|
|
92
|
+
}: CalloutProps) => (
|
|
93
|
+
<li style={{ gridRow: 'span 3' }}>
|
|
94
|
+
<RadixNavigationMenu.Link asChild>
|
|
95
|
+
<Callout to={to} href={href}>
|
|
96
|
+
{Icon ? (
|
|
97
|
+
<Icon width="48px" height="48px" label="Callout Icon" />
|
|
98
|
+
) : (
|
|
99
|
+
<Logo
|
|
100
|
+
width="48px"
|
|
101
|
+
height="48px"
|
|
102
|
+
color="white"
|
|
103
|
+
label="Little World Icon"
|
|
104
|
+
/>
|
|
105
|
+
)}
|
|
106
|
+
<CalloutHeading>{heading}</CalloutHeading>
|
|
107
|
+
<CalloutText>{description}</CalloutText>
|
|
108
|
+
</Callout>
|
|
109
|
+
</RadixNavigationMenu.Link>
|
|
110
|
+
</li>
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const NavigationMenuContent = ({
|
|
114
|
+
layout,
|
|
115
|
+
children,
|
|
116
|
+
}: PropsWithChildren<{
|
|
117
|
+
layout: keyof typeof MenuContentLayout;
|
|
118
|
+
}>) => (
|
|
119
|
+
<NavMenuContent>
|
|
120
|
+
<ContentList $layout={layout}>{children}</ContentList>
|
|
121
|
+
</NavMenuContent>
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const NavigationMenu = ({
|
|
125
|
+
children,
|
|
126
|
+
withShadow,
|
|
127
|
+
}: PropsWithChildren<{
|
|
128
|
+
withShadow?: boolean;
|
|
129
|
+
}>) => (
|
|
130
|
+
<NavMenuRoot>
|
|
131
|
+
<NavigationMenuList $withShadow={withShadow}>
|
|
132
|
+
{children}
|
|
133
|
+
<NavMenuIndicator>
|
|
134
|
+
<NavMenuIndicatorArrow />
|
|
135
|
+
</NavMenuIndicator>
|
|
136
|
+
</NavigationMenuList>
|
|
137
|
+
<ViewportPosition>
|
|
138
|
+
<NavMenuViewport />
|
|
139
|
+
</ViewportPosition>
|
|
140
|
+
</NavMenuRoot>
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
export {
|
|
144
|
+
NavigationMenu,
|
|
145
|
+
NavigationMenuItem,
|
|
146
|
+
NavigationMenuTrigger,
|
|
147
|
+
NavigationMenuContent,
|
|
148
|
+
NavigationMenuCallout,
|
|
149
|
+
NavigationMenuLink,
|
|
150
|
+
NavigationMenuContentItem,
|
|
151
|
+
};
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import * as RadixNavigationMenu from '@radix-ui/react-navigation-menu';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
enterFromLeft,
|
|
6
|
+
enterFromRight,
|
|
7
|
+
exitToLeft,
|
|
8
|
+
exitToRight,
|
|
9
|
+
scaleIn,
|
|
10
|
+
scaleOut,
|
|
11
|
+
} from '../../utils/animations';
|
|
12
|
+
import { ChevronDownIcon } from '../Icon';
|
|
13
|
+
import Link from '../Link/Link';
|
|
14
|
+
import Text from '../Text/Text';
|
|
15
|
+
|
|
16
|
+
export const MenuTriggerIcon = styled(ChevronDownIcon)`
|
|
17
|
+
position: relative;
|
|
18
|
+
color: ${({ theme }) => theme.color.text.primary};
|
|
19
|
+
top: 1px;
|
|
20
|
+
transition: transform 250ms ease;
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
export const NavMenuRoot = styled(RadixNavigationMenu.Root)`
|
|
24
|
+
position: relative;
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
z-index: 1000;
|
|
28
|
+
|
|
29
|
+
&[data-state='open'] > ${MenuTriggerIcon} {
|
|
30
|
+
transform: rotate(-180deg);
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
export const NavMenuList = styled(RadixNavigationMenu.List)<{
|
|
35
|
+
$withShadow?: boolean;
|
|
36
|
+
}>`
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
background-color: ${({ theme }) => theme.color.surface.primary};
|
|
41
|
+
padding: ${({ theme }) => theme.spacing.xxsmall};
|
|
42
|
+
border-radius: ${({ theme }) => theme.radius.xxsmall};
|
|
43
|
+
list-style: none;
|
|
44
|
+
margin: 0;
|
|
45
|
+
gap: ${({ theme }) => theme.spacing.xxsmall};
|
|
46
|
+
|
|
47
|
+
${({ theme, $withShadow }) =>
|
|
48
|
+
$withShadow && `box-shadow: 0 2px 10px ${theme.color.surface.secondary};`}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const MENU_ITEM_CSS = css`
|
|
52
|
+
gap: ${({ theme }) => theme.spacing.xxsmall};
|
|
53
|
+
padding: ${({ theme }) => `${theme.spacing.xsmall}`};
|
|
54
|
+
outline: none;
|
|
55
|
+
user-select: none;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
line-height: 1;
|
|
58
|
+
font-size: 15px;
|
|
59
|
+
border-radius: ${({ theme }) => theme.radius.xxxsmall};
|
|
60
|
+
color: ${({ theme }) => theme.color.text.primary};
|
|
61
|
+
|
|
62
|
+
&:focus {
|
|
63
|
+
box-shadow: 0 0 0 2px ${({ theme }) => theme.color.surface.secondary};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&:hover {
|
|
67
|
+
background-color: ${({ theme }) => theme.color.surface.secondary};
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
export const NavMenuLink = styled(Link)`
|
|
72
|
+
display: block;
|
|
73
|
+
text-decoration: none;
|
|
74
|
+
|
|
75
|
+
${MENU_ITEM_CSS}
|
|
76
|
+
${({ active, theme }) =>
|
|
77
|
+
active &&
|
|
78
|
+
`
|
|
79
|
+
box-shadow: 0 0 0 2px ${theme.color.border.bold};
|
|
80
|
+
`}
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
export const NavMenuTrigger = styled(RadixNavigationMenu.Trigger)`
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: space-between;
|
|
87
|
+
${MENU_ITEM_CSS}
|
|
88
|
+
`;
|
|
89
|
+
|
|
90
|
+
export const NavMenuContent = styled(RadixNavigationMenu.Content)`
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 0;
|
|
93
|
+
left: 0;
|
|
94
|
+
width: 100%;
|
|
95
|
+
animation-duration: 250ms;
|
|
96
|
+
animation-timing-function: ease;
|
|
97
|
+
z-index: 200;
|
|
98
|
+
|
|
99
|
+
&[data-motion='from-start'] {
|
|
100
|
+
animation-name: ${enterFromLeft};
|
|
101
|
+
}
|
|
102
|
+
&[data-motion='from-end'] {
|
|
103
|
+
animation-name: ${enterFromRight};
|
|
104
|
+
}
|
|
105
|
+
&[data-motion='to-start'] {
|
|
106
|
+
animation-name: ${exitToLeft};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&[data-motion='to-end'] {
|
|
110
|
+
animation-name: ${exitToRight};
|
|
111
|
+
}
|
|
112
|
+
`;
|
|
113
|
+
|
|
114
|
+
export const NavMenuIndicator = styled(RadixNavigationMenu.Indicator)`
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: flex-end;
|
|
117
|
+
justify-content: center;
|
|
118
|
+
height: 10px;
|
|
119
|
+
top: 100%;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
z-index: 1;
|
|
122
|
+
transition:
|
|
123
|
+
width,
|
|
124
|
+
transform 250ms ease;
|
|
125
|
+
|
|
126
|
+
&[data-state='visible'] {
|
|
127
|
+
animation: fadeIn 200ms ease forward;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&[data-state='hidden'] {
|
|
131
|
+
animation: fadeOut 200ms ease forward;
|
|
132
|
+
}
|
|
133
|
+
`;
|
|
134
|
+
|
|
135
|
+
export const NavMenuIndicatorArrow = styled.div`
|
|
136
|
+
position: relative;
|
|
137
|
+
top: 70%;
|
|
138
|
+
background-color: white;
|
|
139
|
+
width: 10px;
|
|
140
|
+
height: 10px;
|
|
141
|
+
transform: rotate(45deg);
|
|
142
|
+
border-top-left-radius: 2px;
|
|
143
|
+
`;
|
|
144
|
+
|
|
145
|
+
export const ViewportPosition = styled.div`
|
|
146
|
+
position: absolute;
|
|
147
|
+
display: flex;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
width: 100%;
|
|
150
|
+
top: 100%;
|
|
151
|
+
left: 0;
|
|
152
|
+
perspective: 2000px;
|
|
153
|
+
`;
|
|
154
|
+
|
|
155
|
+
export const NavMenuViewport = styled(RadixNavigationMenu.Viewport)`
|
|
156
|
+
position: relative;
|
|
157
|
+
transform-origin: top center;
|
|
158
|
+
margin-top: 10px;
|
|
159
|
+
width: 100%;
|
|
160
|
+
background-color: ${({ theme }) => theme.color.surface.primary};
|
|
161
|
+
border-radius: 6px;
|
|
162
|
+
overflow: hidden;
|
|
163
|
+
box-shadow:
|
|
164
|
+
hsl(206 22% 7% / 35%) 0px 10px 38px -10px,
|
|
165
|
+
hsl(206 22% 7% / 20%) 0px 10px 20px -15px;
|
|
166
|
+
|
|
167
|
+
transition:
|
|
168
|
+
width,
|
|
169
|
+
height,
|
|
170
|
+
300ms ease;
|
|
171
|
+
height: var(--radix-navigation-menu-viewport-height);
|
|
172
|
+
|
|
173
|
+
&[data-state='open'] {
|
|
174
|
+
animation: ${scaleIn} 200ms ease;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&[data-state='closed'] {
|
|
178
|
+
animation: ${scaleOut} 200ms ease;
|
|
179
|
+
}
|
|
180
|
+
`;
|
|
181
|
+
|
|
182
|
+
export const ContentList = styled.ul<{ $layout: string }>`
|
|
183
|
+
display: grid;
|
|
184
|
+
padding: 22px;
|
|
185
|
+
margin: 0;
|
|
186
|
+
column-gap: 10px;
|
|
187
|
+
list-style: none;
|
|
188
|
+
gap: ${({ theme }) => theme.spacing.xxxsmall};
|
|
189
|
+
|
|
190
|
+
${({ $layout }) => {
|
|
191
|
+
if ($layout === 'callout')
|
|
192
|
+
return css`
|
|
193
|
+
width: 100%;
|
|
194
|
+
grid-template-columns: 1fr;
|
|
195
|
+
`;
|
|
196
|
+
|
|
197
|
+
if ($layout === 'calloutWithList')
|
|
198
|
+
return css`
|
|
199
|
+
width: 100%;
|
|
200
|
+
grid-template-columns: 0.75fr 1fr;
|
|
201
|
+
`;
|
|
202
|
+
|
|
203
|
+
if ($layout === 'oneColumn')
|
|
204
|
+
return css`
|
|
205
|
+
width: 100%;
|
|
206
|
+
grid-auto-flow: column;
|
|
207
|
+
grid-template-rows: repeat(1, 1fr);
|
|
208
|
+
`;
|
|
209
|
+
|
|
210
|
+
if ($layout === 'twoColumns')
|
|
211
|
+
return css`
|
|
212
|
+
width: 100%;
|
|
213
|
+
grid-auto-flow: column;
|
|
214
|
+
grid-template-rows: repeat(3, 1fr);
|
|
215
|
+
`;
|
|
216
|
+
|
|
217
|
+
if ($layout === 'threeColumns')
|
|
218
|
+
return css`
|
|
219
|
+
width: 100%;
|
|
220
|
+
grid-auto-flow: column;
|
|
221
|
+
grid-template-rows: repeat(2, 1fr);
|
|
222
|
+
`;
|
|
223
|
+
}}
|
|
224
|
+
`;
|
|
225
|
+
|
|
226
|
+
export const ListItemLink = styled(Link)`
|
|
227
|
+
display: block;
|
|
228
|
+
outline: none;
|
|
229
|
+
text-decoration: none;
|
|
230
|
+
user-select: none;
|
|
231
|
+
padding: 12px;
|
|
232
|
+
border-radius: 6px;
|
|
233
|
+
font-size: 15px;
|
|
234
|
+
line-height: 1;
|
|
235
|
+
|
|
236
|
+
&:focus {
|
|
237
|
+
box-shadow: 0 0 0 2px ${({ theme }) => theme.color.surface.secondary};
|
|
238
|
+
}
|
|
239
|
+
&:hover {
|
|
240
|
+
background-color: ${({ theme }) => theme.color.surface.secondary};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
${({ active, theme }) =>
|
|
244
|
+
active &&
|
|
245
|
+
`
|
|
246
|
+
box-shadow: 0 0 0 2px ${theme.color.border.bold};
|
|
247
|
+
`}
|
|
248
|
+
`;
|
|
249
|
+
|
|
250
|
+
export const ListItemHeading = styled(Text)`
|
|
251
|
+
font-weight: 500;
|
|
252
|
+
line-height: 1.2;
|
|
253
|
+
margin-bottom: 5px;
|
|
254
|
+
`;
|
|
255
|
+
|
|
256
|
+
export const ListItemText = styled(Text)`
|
|
257
|
+
color: ${({ theme }) => theme.color.text.primary};
|
|
258
|
+
line-height: 1.4;
|
|
259
|
+
font-weight: initial;
|
|
260
|
+
`;
|
|
261
|
+
|
|
262
|
+
export const Callout = styled(Link)`
|
|
263
|
+
display: flex;
|
|
264
|
+
justify-content: flex-end;
|
|
265
|
+
flex-direction: column;
|
|
266
|
+
width: 100%;
|
|
267
|
+
height: 100%;
|
|
268
|
+
background: ${({ theme }) =>
|
|
269
|
+
`linear-gradient(135deg, ${theme.color.text.primary} 0%, ${theme.color.border.bold} 100%)`};
|
|
270
|
+
border-radius: 6px;
|
|
271
|
+
padding: 25px;
|
|
272
|
+
text-decoration: none;
|
|
273
|
+
outline: none;
|
|
274
|
+
user-select: none;
|
|
275
|
+
grid-row: 1 / -1; /* Span all rows */
|
|
276
|
+
|
|
277
|
+
&:focus {
|
|
278
|
+
box-shadow: 0 0 0 2px ${({ theme }) => theme.color.text.primary};
|
|
279
|
+
}
|
|
280
|
+
`;
|
|
281
|
+
|
|
282
|
+
export const CalloutHeading = styled(Text)`
|
|
283
|
+
color: ${({ theme }) => theme.color.text.reversed};
|
|
284
|
+
font-size: 18px;
|
|
285
|
+
font-weight: 500;
|
|
286
|
+
line-height: 1.2;
|
|
287
|
+
`;
|
|
288
|
+
|
|
289
|
+
export const CalloutText = styled(Text)`
|
|
290
|
+
color: ${({ theme }) => theme.color.text.reversed};
|
|
291
|
+
font-size: 14px;
|
|
292
|
+
line-height: 1.3;
|
|
293
|
+
`;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PopoverContentProps, PopoverProps } from '@radix-ui/react-popover';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import Popover, { PopoverSizes } from './Popover';
|
|
5
|
+
import Text from '../Text/Text';
|
|
6
|
+
import { TextTypes } from '@a-little-world/little-world-design-system-core';
|
|
7
|
+
|
|
8
|
+
type Props = {
|
|
9
|
+
text: string;
|
|
10
|
+
trigger?: React.ReactNode;
|
|
11
|
+
} & PopoverProps &
|
|
12
|
+
PopoverContentProps;
|
|
13
|
+
|
|
14
|
+
const DEFAULT_SIDE_OFFSET = 4; //px
|
|
15
|
+
|
|
16
|
+
const InfoPopover: React.FC<Props> = ({
|
|
17
|
+
defaultOpen,
|
|
18
|
+
open,
|
|
19
|
+
side = 'top',
|
|
20
|
+
sideOffset = DEFAULT_SIDE_OFFSET,
|
|
21
|
+
trigger,
|
|
22
|
+
text,
|
|
23
|
+
...rest
|
|
24
|
+
}) => (
|
|
25
|
+
<Popover
|
|
26
|
+
asTooltip
|
|
27
|
+
defaultOpen={defaultOpen}
|
|
28
|
+
open={open}
|
|
29
|
+
side={side}
|
|
30
|
+
sideOffset={sideOffset}
|
|
31
|
+
showCloseButton
|
|
32
|
+
trigger={trigger}
|
|
33
|
+
width={PopoverSizes.Large}
|
|
34
|
+
{...rest}
|
|
35
|
+
>
|
|
36
|
+
<Text type={TextTypes.Body5}>{text}</Text>
|
|
37
|
+
</Popover>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export default InfoPopover;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import Button, { ButtonVariations } from '../Button/Button';
|
|
5
|
+
import { DotsIcon, QuestionIcon } from '../Icon';
|
|
6
|
+
import Modal from '../Modal/Modal';
|
|
7
|
+
import Popover from './Popover';
|
|
8
|
+
import InfoPopover from './InfoPopover';
|
|
9
|
+
|
|
10
|
+
const StyledOption = styled(Button)`
|
|
11
|
+
font-size: 16px;
|
|
12
|
+
font-weight: normal;
|
|
13
|
+
justify-content: flex-start;
|
|
14
|
+
|
|
15
|
+
&:not(:last-of-type) {
|
|
16
|
+
margin-bottom: 16px;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
component: Popover,
|
|
22
|
+
title: 'Components/Popover',
|
|
23
|
+
argTypes: {
|
|
24
|
+
open: { control: 'boolean' },
|
|
25
|
+
side: { control: 'select', options: ['top', 'left', 'right', 'bottom'] },
|
|
26
|
+
children: { control: 'text' },
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Default = ({ children, ...args }) => {
|
|
31
|
+
const [open, setOpen] = useState(false);
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
<Popover
|
|
35
|
+
showCloseButton={false}
|
|
36
|
+
trigger={
|
|
37
|
+
<Button variation={ButtonVariations.Icon}>
|
|
38
|
+
<DotsIcon label="dotsIcon" />
|
|
39
|
+
</Button>
|
|
40
|
+
}
|
|
41
|
+
{...args}
|
|
42
|
+
>
|
|
43
|
+
{children || (
|
|
44
|
+
<>
|
|
45
|
+
<StyledOption
|
|
46
|
+
variation={ButtonVariations.Inline}
|
|
47
|
+
onClick={() => setOpen(true)}
|
|
48
|
+
>
|
|
49
|
+
Open Modal
|
|
50
|
+
</StyledOption>
|
|
51
|
+
<StyledOption variation={ButtonVariations.Inline}>
|
|
52
|
+
Unmatch
|
|
53
|
+
</StyledOption>
|
|
54
|
+
</>
|
|
55
|
+
)}
|
|
56
|
+
</Popover>
|
|
57
|
+
<Modal open={open} onClose={() => setOpen(false)}>
|
|
58
|
+
Modal Open
|
|
59
|
+
</Modal>
|
|
60
|
+
</>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const InfoPopoverComponent = args => {
|
|
65
|
+
return (
|
|
66
|
+
<InfoPopover
|
|
67
|
+
trigger={
|
|
68
|
+
<Button variation={ButtonVariations.Icon}>
|
|
69
|
+
<QuestionIcon label="questionIcon" />
|
|
70
|
+
</Button>
|
|
71
|
+
}
|
|
72
|
+
{...args}
|
|
73
|
+
/>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
InfoPopoverComponent.args = {
|
|
78
|
+
text: 'Ein Avatar ist ein gezeichnetes Profilbild, das du an Stelle eines echten Fotos von dir verwenden kannst. Um den Avatar dir ähnlich aussehen zu lassen, kannst du Merkmale wie Geschlecht, Nase, Haare, Augen etc. anpassen. Probier es doch einfach mal aus! Deinen Avatar kannst du später jederzeit wieder ändern.',
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
InfoPopoverComponent.argTypes = {
|
|
82
|
+
open: { control: 'boolean' },
|
|
83
|
+
text: { control: 'text' },
|
|
84
|
+
side: { control: 'select', options: ['top', 'left', 'right', 'bottom'] },
|
|
85
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as RadixPopover from '@radix-ui/react-popover';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import Button, { ButtonVariations } from '../Button/Button';
|
|
5
|
+
import { CloseIcon } from '../Icon';
|
|
6
|
+
import {
|
|
7
|
+
PopoverRoot,
|
|
8
|
+
StyledPopoverArrow,
|
|
9
|
+
StyledPopoverClose,
|
|
10
|
+
StyledPopoverContent,
|
|
11
|
+
} from './styles';
|
|
12
|
+
|
|
13
|
+
export enum PopoverSizes {
|
|
14
|
+
Small = '160px',
|
|
15
|
+
Medium = '240px',
|
|
16
|
+
Large = '360px',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type PopoverProps = {
|
|
20
|
+
asTooltip?: boolean;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
showCloseButton?: boolean;
|
|
23
|
+
trigger?: React.ReactNode;
|
|
24
|
+
width?: PopoverSizes;
|
|
25
|
+
} & RadixPopover.PopoverProps &
|
|
26
|
+
RadixPopover.PopoverContentProps;
|
|
27
|
+
|
|
28
|
+
const DEFAULT_SIDE_OFFSET = 4; //px
|
|
29
|
+
|
|
30
|
+
const Popover: React.FC<PopoverProps> = ({
|
|
31
|
+
asTooltip,
|
|
32
|
+
defaultOpen,
|
|
33
|
+
children,
|
|
34
|
+
onFocusOutside,
|
|
35
|
+
open,
|
|
36
|
+
side,
|
|
37
|
+
sideOffset = DEFAULT_SIDE_OFFSET,
|
|
38
|
+
showCloseButton,
|
|
39
|
+
trigger,
|
|
40
|
+
width = PopoverSizes.Small,
|
|
41
|
+
}) => (
|
|
42
|
+
<PopoverRoot defaultOpen={defaultOpen} open={open}>
|
|
43
|
+
{trigger && <RadixPopover.Trigger asChild>{trigger}</RadixPopover.Trigger>}
|
|
44
|
+
<RadixPopover.Portal>
|
|
45
|
+
<StyledPopoverContent
|
|
46
|
+
side={side}
|
|
47
|
+
sideOffset={sideOffset}
|
|
48
|
+
$asTooltip={asTooltip}
|
|
49
|
+
$width={width}
|
|
50
|
+
$extraPaddingTop={Boolean(!asTooltip && showCloseButton)}
|
|
51
|
+
collisionPadding={DEFAULT_SIDE_OFFSET}
|
|
52
|
+
onFocusOutside={onFocusOutside}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
{showCloseButton && (
|
|
56
|
+
<StyledPopoverClose asChild $asTooltip={asTooltip}>
|
|
57
|
+
<Button variation={ButtonVariations.Icon}>
|
|
58
|
+
<CloseIcon label="popover close" width={12} height={12} />
|
|
59
|
+
</Button>
|
|
60
|
+
</StyledPopoverClose>
|
|
61
|
+
)}
|
|
62
|
+
<StyledPopoverArrow $asTooltip={asTooltip} />
|
|
63
|
+
</StyledPopoverContent>
|
|
64
|
+
</RadixPopover.Portal>
|
|
65
|
+
</PopoverRoot>
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export default Popover;
|