@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,38 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
import Button from '../Button/Button';
|
|
3
|
+
import { DROPDOWN_MAX_WIDTH } from '../Dropdown/styles';
|
|
4
|
+
export const MultiDropdownWrapper = styled.div ``;
|
|
5
|
+
export const AddMore = styled.div `
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: ${({ theme }) => theme.spacing.xxsmall};
|
|
9
|
+
`;
|
|
10
|
+
export const AddMoreButton = styled(Button) `
|
|
11
|
+
color: ${({ theme }) => theme.color.text.highlight};
|
|
12
|
+
|
|
13
|
+
&:disabled {
|
|
14
|
+
color: ${({ theme }) => theme.color.text.disabled};
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
export const Segment = styled.section `
|
|
18
|
+
display: grid;
|
|
19
|
+
max-width: calc(
|
|
20
|
+
${DROPDOWN_MAX_WIDTH} * 2 + ${({ theme }) => theme.spacing.small}
|
|
21
|
+
);
|
|
22
|
+
grid-template-columns: ${({ $locked, theme }) => $locked
|
|
23
|
+
? 'repeat(2, minmax(0, 1fr))'
|
|
24
|
+
: `repeat(2, minmax(0, 1fr)) minmax(
|
|
25
|
+
${theme.spacing.medium},
|
|
26
|
+
auto
|
|
27
|
+
)`};
|
|
28
|
+
align-items: start;
|
|
29
|
+
gap: ${({ theme }) => theme.spacing.small};
|
|
30
|
+
margin-bottom: ${({ theme }) => theme.spacing.xxsmall};
|
|
31
|
+
`;
|
|
32
|
+
export const DeleteButton = styled(Button) `
|
|
33
|
+
top: ${({ theme }) => theme.spacing.xxsmall};
|
|
34
|
+
margin-left: calc(
|
|
35
|
+
${({ theme }) => theme.spacing.xxsmall} -
|
|
36
|
+
${({ theme }) => theme.spacing.small}
|
|
37
|
+
);
|
|
38
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
error?: string;
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
labelTooltip?: string;
|
|
7
|
+
options: {
|
|
8
|
+
tag: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}[];
|
|
11
|
+
preSelected?: string[];
|
|
12
|
+
onSelection: (selected: string[]) => void;
|
|
13
|
+
withBackground?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare const MultiSelection: React.FC<Props>;
|
|
16
|
+
export default MultiSelection;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { MultiSelectionWrapper, Options, Option } from './styles';
|
|
3
|
+
import Label from '../Label/Label';
|
|
4
|
+
import InputError from '../InputError/InputError';
|
|
5
|
+
const MultiSelection = ({ error, label, labelTooltip, id, options, preSelected = [], onSelection, withBackground = true, }) => {
|
|
6
|
+
const [selected, setSelected] = useState([]);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setSelected(preSelected);
|
|
9
|
+
}, [JSON.stringify([preSelected])]);
|
|
10
|
+
const handleOnClick = (newSelection) => {
|
|
11
|
+
setSelected(newSelection);
|
|
12
|
+
onSelection(newSelection);
|
|
13
|
+
};
|
|
14
|
+
return (React.createElement(MultiSelectionWrapper, null,
|
|
15
|
+
label && (React.createElement(Label, { bold: true, htmlFor: id, tooltipText: labelTooltip }, label)),
|
|
16
|
+
React.createElement(Options, { "$hasError": Boolean(error), "$withBackground": withBackground }, options.map(option => {
|
|
17
|
+
const isSelected = selected?.some(el => el === option.value);
|
|
18
|
+
return (React.createElement(Option, { key: option.value, "$selected": isSelected, "$withBackground": withBackground, onClick: () => handleOnClick(isSelected
|
|
19
|
+
? selected.filter(el => el !== option.value)
|
|
20
|
+
: [...selected, option.value]), type: "button" }, option.tag));
|
|
21
|
+
})),
|
|
22
|
+
React.createElement(InputError, { visible: Boolean(error) }, error)));
|
|
23
|
+
};
|
|
24
|
+
export default MultiSelection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const MultiSelectionWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
export declare const Options: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
|
+
$hasError: boolean;
|
|
4
|
+
$withBackground: boolean;
|
|
5
|
+
}>> & string;
|
|
6
|
+
export declare const Option: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
7
|
+
$selected: boolean;
|
|
8
|
+
$withBackground: boolean;
|
|
9
|
+
}>> & string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { INPUT_ERROR_CSS } from '../InputError/InputError';
|
|
3
|
+
export const MultiSelectionWrapper = styled.div `
|
|
4
|
+
width: 100%:
|
|
5
|
+
`;
|
|
6
|
+
export const Options = styled.div `
|
|
7
|
+
display: flex;
|
|
8
|
+
border-radius: 15px;
|
|
9
|
+
align-items: center;
|
|
10
|
+
text-align: center;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
gap: ${({ theme }) => theme.spacing.xxsmall};
|
|
13
|
+
padding: 0px;
|
|
14
|
+
margin-bottom: ${({ theme }) => theme.spacing.xxsmall};
|
|
15
|
+
white-space: pre-line;
|
|
16
|
+
|
|
17
|
+
${({ theme, $withBackground }) => $withBackground &&
|
|
18
|
+
css `
|
|
19
|
+
background: ${theme.color.surface.secondary};
|
|
20
|
+
border: 1px solid ${theme.color.border.subtle};
|
|
21
|
+
padding: ${theme.spacing.xxsmall};
|
|
22
|
+
|
|
23
|
+
@media (min-width: ${theme.breakpoints.small}) {
|
|
24
|
+
padding: ${theme.spacing.small};
|
|
25
|
+
}
|
|
26
|
+
`}
|
|
27
|
+
|
|
28
|
+
${({ $hasError }) => $hasError && INPUT_ERROR_CSS}
|
|
29
|
+
`;
|
|
30
|
+
export const Option = styled.button `
|
|
31
|
+
font-family: 'Signika Negative';
|
|
32
|
+
color: ${({ theme, $selected, $withBackground }) => $withBackground || $selected
|
|
33
|
+
? theme.color.text.primary
|
|
34
|
+
: theme.color.text.disabled};
|
|
35
|
+
background: ${({ theme }) => theme.color.surface.primary};
|
|
36
|
+
border-radius: 10px;
|
|
37
|
+
box-shadow: 0px 1px 5px rgba(0, 0, 0, 0.03);
|
|
38
|
+
border-radius: 1000px;
|
|
39
|
+
border: 2px solid
|
|
40
|
+
${({ theme, $withBackground }) => $withBackground
|
|
41
|
+
? theme.color.border.reversed
|
|
42
|
+
: theme.color.border.subtle};
|
|
43
|
+
padding: ${({ theme }) => `${theme.spacing.xxxsmall} ${theme.spacing.xsmall}`};
|
|
44
|
+
min-width: 60px;
|
|
45
|
+
height: 33px;
|
|
46
|
+
|
|
47
|
+
&:hover {
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
${({ theme }) => css `
|
|
52
|
+
@media (min-width: ${theme.breakpoints.small}) {
|
|
53
|
+
padding: ${theme.spacing.xxsmall} ${theme.spacing.small};
|
|
54
|
+
min-width: 80px;
|
|
55
|
+
height: 45px;
|
|
56
|
+
}
|
|
57
|
+
`}
|
|
58
|
+
|
|
59
|
+
${({ $selected, theme }) => $selected &&
|
|
60
|
+
css `
|
|
61
|
+
border-color: ${theme.color.border.selected};
|
|
62
|
+
`}
|
|
63
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as RadixNavigationMenu from '@radix-ui/react-navigation-menu';
|
|
2
|
+
import React, { HTMLProps, PropsWithChildren, ReactNode } from 'react';
|
|
3
|
+
import { LinkProps } from '../Link/Link';
|
|
4
|
+
export declare enum MenuContentLayout {
|
|
5
|
+
callout = "callout",
|
|
6
|
+
calloutWithList = "calloutWithList",
|
|
7
|
+
oneColumn = "oneColumn",
|
|
8
|
+
twoColumns = "twoColumns",
|
|
9
|
+
threeColumns = "threeColumns"
|
|
10
|
+
}
|
|
11
|
+
interface NavigationMenuContentItemProps extends HTMLProps<HTMLAnchorElement> {
|
|
12
|
+
active?: boolean;
|
|
13
|
+
title?: string;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
declare const NavigationMenuContentItem: React.ForwardRefExoticComponent<Omit<NavigationMenuContentItemProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
17
|
+
declare const NavigationMenuItem: React.ForwardRefExoticComponent<RadixNavigationMenu.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
18
|
+
declare const NavigationMenuLink: (props: LinkProps & RadixNavigationMenu.NavigationMenuLinkProps) => React.JSX.Element;
|
|
19
|
+
declare const NavigationMenuTrigger: ({ children }: PropsWithChildren) => React.JSX.Element;
|
|
20
|
+
interface CalloutProps {
|
|
21
|
+
heading: string;
|
|
22
|
+
description: string;
|
|
23
|
+
link: string;
|
|
24
|
+
Icon?: any;
|
|
25
|
+
to?: string;
|
|
26
|
+
href?: string;
|
|
27
|
+
}
|
|
28
|
+
declare const NavigationMenuCallout: ({ heading, description, Icon, to, href, }: CalloutProps) => React.JSX.Element;
|
|
29
|
+
declare const NavigationMenuContent: ({ layout, children, }: PropsWithChildren<{
|
|
30
|
+
layout: keyof typeof MenuContentLayout;
|
|
31
|
+
}>) => React.JSX.Element;
|
|
32
|
+
declare const NavigationMenu: ({ children, withShadow, }: PropsWithChildren<{
|
|
33
|
+
withShadow?: boolean;
|
|
34
|
+
}>) => React.JSX.Element;
|
|
35
|
+
export { NavigationMenu, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuCallout, NavigationMenuLink, NavigationMenuContentItem, };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as RadixNavigationMenu from '@radix-ui/react-navigation-menu';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Logo } from '../Icon';
|
|
4
|
+
import { Callout, CalloutHeading, CalloutText, ContentList, ListItemHeading, ListItemLink, ListItemText, MenuTriggerIcon, NavMenuContent, NavMenuIndicator, NavMenuIndicatorArrow, NavMenuLink, NavMenuList, NavMenuRoot, NavMenuTrigger, NavMenuViewport, ViewportPosition, } from './styles';
|
|
5
|
+
export var MenuContentLayout;
|
|
6
|
+
(function (MenuContentLayout) {
|
|
7
|
+
MenuContentLayout["callout"] = "callout";
|
|
8
|
+
MenuContentLayout["calloutWithList"] = "calloutWithList";
|
|
9
|
+
MenuContentLayout["oneColumn"] = "oneColumn";
|
|
10
|
+
MenuContentLayout["twoColumns"] = "twoColumns";
|
|
11
|
+
MenuContentLayout["threeColumns"] = "threeColumns";
|
|
12
|
+
})(MenuContentLayout || (MenuContentLayout = {}));
|
|
13
|
+
const NavigationMenuContentItem = React.forwardRef(({ active, className, children, title, ...props }, forwardedRef) => (React.createElement("li", null,
|
|
14
|
+
React.createElement(RadixNavigationMenu.Link, { asChild: true, active: active },
|
|
15
|
+
React.createElement(ListItemLink, { className: className, ...props, ref: forwardedRef, textDecoration: false, active: active },
|
|
16
|
+
React.createElement(ListItemHeading, { tag: "h3" }, title),
|
|
17
|
+
React.createElement(ListItemText, { className: "ListItemText" }, children))))));
|
|
18
|
+
const NavigationMenuList = NavMenuList;
|
|
19
|
+
const NavigationMenuItem = RadixNavigationMenu.Item;
|
|
20
|
+
const NavigationMenuLink = (props) => (React.createElement(RadixNavigationMenu.Link, { asChild: true },
|
|
21
|
+
React.createElement(NavMenuLink, { ...props, textDecoration: false }, props.children)));
|
|
22
|
+
const NavigationMenuTrigger = ({ children }) => (React.createElement(NavMenuTrigger, null,
|
|
23
|
+
children,
|
|
24
|
+
React.createElement(MenuTriggerIcon, { width: 12, height: 12, label: "menu trigger icon" })));
|
|
25
|
+
const NavigationMenuCallout = ({ heading, description, Icon, to, href, }) => (React.createElement("li", { style: { gridRow: 'span 3' } },
|
|
26
|
+
React.createElement(RadixNavigationMenu.Link, { asChild: true },
|
|
27
|
+
React.createElement(Callout, { to: to, href: href },
|
|
28
|
+
Icon ? (React.createElement(Icon, { width: "48px", height: "48px", label: "Callout Icon" })) : (React.createElement(Logo, { width: "48px", height: "48px", color: "white", label: "Little World Icon" })),
|
|
29
|
+
React.createElement(CalloutHeading, null, heading),
|
|
30
|
+
React.createElement(CalloutText, null, description)))));
|
|
31
|
+
const NavigationMenuContent = ({ layout, children, }) => (React.createElement(NavMenuContent, null,
|
|
32
|
+
React.createElement(ContentList, { "$layout": layout }, children)));
|
|
33
|
+
const NavigationMenu = ({ children, withShadow, }) => (React.createElement(NavMenuRoot, null,
|
|
34
|
+
React.createElement(NavigationMenuList, { "$withShadow": withShadow },
|
|
35
|
+
children,
|
|
36
|
+
React.createElement(NavMenuIndicator, null,
|
|
37
|
+
React.createElement(NavMenuIndicatorArrow, null))),
|
|
38
|
+
React.createElement(ViewportPosition, null,
|
|
39
|
+
React.createElement(NavMenuViewport, null))));
|
|
40
|
+
export { NavigationMenu, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuCallout, NavigationMenuLink, NavigationMenuContentItem, };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import * as RadixNavigationMenu from '@radix-ui/react-navigation-menu';
|
|
2
|
+
export declare const MenuTriggerIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("@a-little-world/little-world-design-system-core").IconBaseProps, "children"> & import("react").SVGProps<SVGElement> & {
|
|
3
|
+
gradient?: import("@a-little-world/little-world-design-system-core").Gradients;
|
|
4
|
+
} & {
|
|
5
|
+
style?: import("react").CSSProperties;
|
|
6
|
+
color?: string;
|
|
7
|
+
}, never>> & string & Omit<{
|
|
8
|
+
({ backgroundColor, borderColor, circular, className, color, gradient, height, label, labelVisible, style, width, }: import("../Icon/Icon").IconSvgProps & {
|
|
9
|
+
style?: import("react").CSSProperties;
|
|
10
|
+
color?: string;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
}, keyof import("react").Component<any, {}, any>>;
|
|
14
|
+
export declare const NavMenuRoot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<RadixNavigationMenu.NavigationMenuProps & import("react").RefAttributes<HTMLElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<RadixNavigationMenu.NavigationMenuProps & import("react").RefAttributes<HTMLElement>>, keyof import("react").Component<any, {}, any>>;
|
|
15
|
+
export declare const NavMenuList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<RadixNavigationMenu.NavigationMenuListProps & import("react").RefAttributes<HTMLUListElement>, {
|
|
16
|
+
$withShadow?: boolean;
|
|
17
|
+
}>> & string & Omit<import("react").ForwardRefExoticComponent<RadixNavigationMenu.NavigationMenuListProps & import("react").RefAttributes<HTMLUListElement>>, keyof import("react").Component<any, {}, any>>;
|
|
18
|
+
export declare const NavMenuLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("react-router-dom").LinkProps, "to"> & import("@a-little-world/little-world-design-system-core").LinkBaseProps & import("react").RefAttributes<HTMLAnchorElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("react-router-dom").LinkProps, "to"> & import("@a-little-world/little-world-design-system-core").LinkBaseProps & import("react").RefAttributes<HTMLAnchorElement>>, keyof import("react").Component<any, {}, any>>;
|
|
19
|
+
export declare const NavMenuTrigger: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<RadixNavigationMenu.NavigationMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<RadixNavigationMenu.NavigationMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
20
|
+
export declare const NavMenuContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<RadixNavigationMenu.NavigationMenuContentProps & import("react").RefAttributes<HTMLDivElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<RadixNavigationMenu.NavigationMenuContentProps & import("react").RefAttributes<HTMLDivElement>>, keyof import("react").Component<any, {}, any>>;
|
|
21
|
+
export declare const NavMenuIndicator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<RadixNavigationMenu.NavigationMenuIndicatorProps & import("react").RefAttributes<HTMLDivElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<RadixNavigationMenu.NavigationMenuIndicatorProps & import("react").RefAttributes<HTMLDivElement>>, keyof import("react").Component<any, {}, any>>;
|
|
22
|
+
export declare const NavMenuIndicatorArrow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
23
|
+
export declare const ViewportPosition: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
24
|
+
export declare const NavMenuViewport: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<RadixNavigationMenu.NavigationMenuViewportProps & import("react").RefAttributes<HTMLDivElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<RadixNavigationMenu.NavigationMenuViewportProps & import("react").RefAttributes<HTMLDivElement>>, keyof import("react").Component<any, {}, any>>;
|
|
25
|
+
export declare const ContentList: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {
|
|
26
|
+
$layout: string;
|
|
27
|
+
}>> & string;
|
|
28
|
+
export declare const ListItemLink: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("react-router-dom").LinkProps, "to"> & import("@a-little-world/little-world-design-system-core").LinkBaseProps & import("react").RefAttributes<HTMLAnchorElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("react-router-dom").LinkProps, "to"> & import("@a-little-world/little-world-design-system-core").LinkBaseProps & import("react").RefAttributes<HTMLAnchorElement>>, keyof import("react").Component<any, {}, any>>;
|
|
29
|
+
export declare const ListItemHeading: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
30
|
+
className?: string;
|
|
31
|
+
disableParser?: boolean;
|
|
32
|
+
id?: string;
|
|
33
|
+
style?: import("react").CSSProperties;
|
|
34
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
35
|
+
}, never>> & string & Omit<({ bold, center, children, color, className, disableParser, id, style, tag, type, }: import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
36
|
+
className?: string;
|
|
37
|
+
disableParser?: boolean;
|
|
38
|
+
id?: string;
|
|
39
|
+
style?: import("react").CSSProperties;
|
|
40
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
41
|
+
}) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
42
|
+
export declare const ListItemText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
43
|
+
className?: string;
|
|
44
|
+
disableParser?: boolean;
|
|
45
|
+
id?: string;
|
|
46
|
+
style?: import("react").CSSProperties;
|
|
47
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
48
|
+
}, never>> & string & Omit<({ bold, center, children, color, className, disableParser, id, style, tag, type, }: import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
49
|
+
className?: string;
|
|
50
|
+
disableParser?: boolean;
|
|
51
|
+
id?: string;
|
|
52
|
+
style?: import("react").CSSProperties;
|
|
53
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
54
|
+
}) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
55
|
+
export declare const Callout: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("react-router-dom").LinkProps, "to"> & import("@a-little-world/little-world-design-system-core").LinkBaseProps & import("react").RefAttributes<HTMLAnchorElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("react-router-dom").LinkProps, "to"> & import("@a-little-world/little-world-design-system-core").LinkBaseProps & import("react").RefAttributes<HTMLAnchorElement>>, keyof import("react").Component<any, {}, any>>;
|
|
56
|
+
export declare const CalloutHeading: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
57
|
+
className?: string;
|
|
58
|
+
disableParser?: boolean;
|
|
59
|
+
id?: string;
|
|
60
|
+
style?: import("react").CSSProperties;
|
|
61
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
62
|
+
}, never>> & string & Omit<({ bold, center, children, color, className, disableParser, id, style, tag, type, }: import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
63
|
+
className?: string;
|
|
64
|
+
disableParser?: boolean;
|
|
65
|
+
id?: string;
|
|
66
|
+
style?: import("react").CSSProperties;
|
|
67
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
68
|
+
}) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
69
|
+
export declare const CalloutText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
70
|
+
className?: string;
|
|
71
|
+
disableParser?: boolean;
|
|
72
|
+
id?: string;
|
|
73
|
+
style?: import("react").CSSProperties;
|
|
74
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
75
|
+
}, never>> & string & Omit<({ bold, center, children, color, className, disableParser, id, style, tag, type, }: import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
76
|
+
className?: string;
|
|
77
|
+
disableParser?: boolean;
|
|
78
|
+
id?: string;
|
|
79
|
+
style?: import("react").CSSProperties;
|
|
80
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
81
|
+
}) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import * as RadixNavigationMenu from '@radix-ui/react-navigation-menu';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { enterFromLeft, enterFromRight, exitToLeft, exitToRight, scaleIn, scaleOut, } from '../../utils/animations';
|
|
4
|
+
import { ChevronDownIcon } from '../Icon';
|
|
5
|
+
import Link from '../Link/Link';
|
|
6
|
+
import Text from '../Text/Text';
|
|
7
|
+
export const MenuTriggerIcon = styled(ChevronDownIcon) `
|
|
8
|
+
position: relative;
|
|
9
|
+
color: ${({ theme }) => theme.color.text.primary};
|
|
10
|
+
top: 1px;
|
|
11
|
+
transition: transform 250ms ease;
|
|
12
|
+
`;
|
|
13
|
+
export const NavMenuRoot = styled(RadixNavigationMenu.Root) `
|
|
14
|
+
position: relative;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
z-index: 1000;
|
|
18
|
+
|
|
19
|
+
&[data-state='open'] > ${MenuTriggerIcon} {
|
|
20
|
+
transform: rotate(-180deg);
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
export const NavMenuList = styled(RadixNavigationMenu.List) `
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
align-items: center;
|
|
27
|
+
background-color: ${({ theme }) => theme.color.surface.primary};
|
|
28
|
+
padding: ${({ theme }) => theme.spacing.xxsmall};
|
|
29
|
+
border-radius: ${({ theme }) => theme.radius.xxsmall};
|
|
30
|
+
list-style: none;
|
|
31
|
+
margin: 0;
|
|
32
|
+
gap: ${({ theme }) => theme.spacing.xxsmall};
|
|
33
|
+
|
|
34
|
+
${({ theme, $withShadow }) => $withShadow && `box-shadow: 0 2px 10px ${theme.color.surface.secondary};`}
|
|
35
|
+
`;
|
|
36
|
+
const MENU_ITEM_CSS = css `
|
|
37
|
+
gap: ${({ theme }) => theme.spacing.xxsmall};
|
|
38
|
+
padding: ${({ theme }) => `${theme.spacing.xsmall}`};
|
|
39
|
+
outline: none;
|
|
40
|
+
user-select: none;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
line-height: 1;
|
|
43
|
+
font-size: 15px;
|
|
44
|
+
border-radius: ${({ theme }) => theme.radius.xxxsmall};
|
|
45
|
+
color: ${({ theme }) => theme.color.text.primary};
|
|
46
|
+
|
|
47
|
+
&:focus {
|
|
48
|
+
box-shadow: 0 0 0 2px ${({ theme }) => theme.color.surface.secondary};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:hover {
|
|
52
|
+
background-color: ${({ theme }) => theme.color.surface.secondary};
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
export const NavMenuLink = styled(Link) `
|
|
56
|
+
display: block;
|
|
57
|
+
text-decoration: none;
|
|
58
|
+
|
|
59
|
+
${MENU_ITEM_CSS}
|
|
60
|
+
${({ active, theme }) => active &&
|
|
61
|
+
`
|
|
62
|
+
box-shadow: 0 0 0 2px ${theme.color.border.bold};
|
|
63
|
+
`}
|
|
64
|
+
`;
|
|
65
|
+
export const NavMenuTrigger = styled(RadixNavigationMenu.Trigger) `
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
${MENU_ITEM_CSS}
|
|
70
|
+
`;
|
|
71
|
+
export const NavMenuContent = styled(RadixNavigationMenu.Content) `
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: 0;
|
|
74
|
+
left: 0;
|
|
75
|
+
width: 100%;
|
|
76
|
+
animation-duration: 250ms;
|
|
77
|
+
animation-timing-function: ease;
|
|
78
|
+
z-index: 200;
|
|
79
|
+
|
|
80
|
+
&[data-motion='from-start'] {
|
|
81
|
+
animation-name: ${enterFromLeft};
|
|
82
|
+
}
|
|
83
|
+
&[data-motion='from-end'] {
|
|
84
|
+
animation-name: ${enterFromRight};
|
|
85
|
+
}
|
|
86
|
+
&[data-motion='to-start'] {
|
|
87
|
+
animation-name: ${exitToLeft};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&[data-motion='to-end'] {
|
|
91
|
+
animation-name: ${exitToRight};
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
export const NavMenuIndicator = styled(RadixNavigationMenu.Indicator) `
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: flex-end;
|
|
97
|
+
justify-content: center;
|
|
98
|
+
height: 10px;
|
|
99
|
+
top: 100%;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
z-index: 1;
|
|
102
|
+
transition:
|
|
103
|
+
width,
|
|
104
|
+
transform 250ms ease;
|
|
105
|
+
|
|
106
|
+
&[data-state='visible'] {
|
|
107
|
+
animation: fadeIn 200ms ease forward;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&[data-state='hidden'] {
|
|
111
|
+
animation: fadeOut 200ms ease forward;
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
export const NavMenuIndicatorArrow = styled.div `
|
|
115
|
+
position: relative;
|
|
116
|
+
top: 70%;
|
|
117
|
+
background-color: white;
|
|
118
|
+
width: 10px;
|
|
119
|
+
height: 10px;
|
|
120
|
+
transform: rotate(45deg);
|
|
121
|
+
border-top-left-radius: 2px;
|
|
122
|
+
`;
|
|
123
|
+
export const ViewportPosition = styled.div `
|
|
124
|
+
position: absolute;
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
width: 100%;
|
|
128
|
+
top: 100%;
|
|
129
|
+
left: 0;
|
|
130
|
+
perspective: 2000px;
|
|
131
|
+
`;
|
|
132
|
+
export const NavMenuViewport = styled(RadixNavigationMenu.Viewport) `
|
|
133
|
+
position: relative;
|
|
134
|
+
transform-origin: top center;
|
|
135
|
+
margin-top: 10px;
|
|
136
|
+
width: 100%;
|
|
137
|
+
background-color: ${({ theme }) => theme.color.surface.primary};
|
|
138
|
+
border-radius: 6px;
|
|
139
|
+
overflow: hidden;
|
|
140
|
+
box-shadow:
|
|
141
|
+
hsl(206 22% 7% / 35%) 0px 10px 38px -10px,
|
|
142
|
+
hsl(206 22% 7% / 20%) 0px 10px 20px -15px;
|
|
143
|
+
|
|
144
|
+
transition:
|
|
145
|
+
width,
|
|
146
|
+
height,
|
|
147
|
+
300ms ease;
|
|
148
|
+
height: var(--radix-navigation-menu-viewport-height);
|
|
149
|
+
|
|
150
|
+
&[data-state='open'] {
|
|
151
|
+
animation: ${scaleIn} 200ms ease;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&[data-state='closed'] {
|
|
155
|
+
animation: ${scaleOut} 200ms ease;
|
|
156
|
+
}
|
|
157
|
+
`;
|
|
158
|
+
export const ContentList = styled.ul `
|
|
159
|
+
display: grid;
|
|
160
|
+
padding: 22px;
|
|
161
|
+
margin: 0;
|
|
162
|
+
column-gap: 10px;
|
|
163
|
+
list-style: none;
|
|
164
|
+
gap: ${({ theme }) => theme.spacing.xxxsmall};
|
|
165
|
+
|
|
166
|
+
${({ $layout }) => {
|
|
167
|
+
if ($layout === 'callout')
|
|
168
|
+
return css `
|
|
169
|
+
width: 100%;
|
|
170
|
+
grid-template-columns: 1fr;
|
|
171
|
+
`;
|
|
172
|
+
if ($layout === 'calloutWithList')
|
|
173
|
+
return css `
|
|
174
|
+
width: 100%;
|
|
175
|
+
grid-template-columns: 0.75fr 1fr;
|
|
176
|
+
`;
|
|
177
|
+
if ($layout === 'oneColumn')
|
|
178
|
+
return css `
|
|
179
|
+
width: 100%;
|
|
180
|
+
grid-auto-flow: column;
|
|
181
|
+
grid-template-rows: repeat(1, 1fr);
|
|
182
|
+
`;
|
|
183
|
+
if ($layout === 'twoColumns')
|
|
184
|
+
return css `
|
|
185
|
+
width: 100%;
|
|
186
|
+
grid-auto-flow: column;
|
|
187
|
+
grid-template-rows: repeat(3, 1fr);
|
|
188
|
+
`;
|
|
189
|
+
if ($layout === 'threeColumns')
|
|
190
|
+
return css `
|
|
191
|
+
width: 100%;
|
|
192
|
+
grid-auto-flow: column;
|
|
193
|
+
grid-template-rows: repeat(2, 1fr);
|
|
194
|
+
`;
|
|
195
|
+
}}
|
|
196
|
+
`;
|
|
197
|
+
export const ListItemLink = styled(Link) `
|
|
198
|
+
display: block;
|
|
199
|
+
outline: none;
|
|
200
|
+
text-decoration: none;
|
|
201
|
+
user-select: none;
|
|
202
|
+
padding: 12px;
|
|
203
|
+
border-radius: 6px;
|
|
204
|
+
font-size: 15px;
|
|
205
|
+
line-height: 1;
|
|
206
|
+
|
|
207
|
+
&:focus {
|
|
208
|
+
box-shadow: 0 0 0 2px ${({ theme }) => theme.color.surface.secondary};
|
|
209
|
+
}
|
|
210
|
+
&:hover {
|
|
211
|
+
background-color: ${({ theme }) => theme.color.surface.secondary};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
${({ active, theme }) => active &&
|
|
215
|
+
`
|
|
216
|
+
box-shadow: 0 0 0 2px ${theme.color.border.bold};
|
|
217
|
+
`}
|
|
218
|
+
`;
|
|
219
|
+
export const ListItemHeading = styled(Text) `
|
|
220
|
+
font-weight: 500;
|
|
221
|
+
line-height: 1.2;
|
|
222
|
+
margin-bottom: 5px;
|
|
223
|
+
`;
|
|
224
|
+
export const ListItemText = styled(Text) `
|
|
225
|
+
color: ${({ theme }) => theme.color.text.primary};
|
|
226
|
+
line-height: 1.4;
|
|
227
|
+
font-weight: initial;
|
|
228
|
+
`;
|
|
229
|
+
export const Callout = styled(Link) `
|
|
230
|
+
display: flex;
|
|
231
|
+
justify-content: flex-end;
|
|
232
|
+
flex-direction: column;
|
|
233
|
+
width: 100%;
|
|
234
|
+
height: 100%;
|
|
235
|
+
background: ${({ theme }) => `linear-gradient(135deg, ${theme.color.text.primary} 0%, ${theme.color.border.bold} 100%)`};
|
|
236
|
+
border-radius: 6px;
|
|
237
|
+
padding: 25px;
|
|
238
|
+
text-decoration: none;
|
|
239
|
+
outline: none;
|
|
240
|
+
user-select: none;
|
|
241
|
+
grid-row: 1 / -1; /* Span all rows */
|
|
242
|
+
|
|
243
|
+
&:focus {
|
|
244
|
+
box-shadow: 0 0 0 2px ${({ theme }) => theme.color.text.primary};
|
|
245
|
+
}
|
|
246
|
+
`;
|
|
247
|
+
export const CalloutHeading = styled(Text) `
|
|
248
|
+
color: ${({ theme }) => theme.color.text.reversed};
|
|
249
|
+
font-size: 18px;
|
|
250
|
+
font-weight: 500;
|
|
251
|
+
line-height: 1.2;
|
|
252
|
+
`;
|
|
253
|
+
export const CalloutText = styled(Text) `
|
|
254
|
+
color: ${({ theme }) => theme.color.text.reversed};
|
|
255
|
+
font-size: 14px;
|
|
256
|
+
line-height: 1.3;
|
|
257
|
+
`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PopoverContentProps, PopoverProps } from '@radix-ui/react-popover';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type Props = {
|
|
4
|
+
text: string;
|
|
5
|
+
trigger?: React.ReactNode;
|
|
6
|
+
} & PopoverProps & PopoverContentProps;
|
|
7
|
+
declare const InfoPopover: React.FC<Props>;
|
|
8
|
+
export default InfoPopover;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Popover, { PopoverSizes } from './Popover';
|
|
3
|
+
import Text from '../Text/Text';
|
|
4
|
+
import { TextTypes } from '@a-little-world/little-world-design-system-core';
|
|
5
|
+
const DEFAULT_SIDE_OFFSET = 4; //px
|
|
6
|
+
const InfoPopover = ({ defaultOpen, open, side = 'top', sideOffset = DEFAULT_SIDE_OFFSET, trigger, text, ...rest }) => (React.createElement(Popover, { asTooltip: true, defaultOpen: defaultOpen, open: open, side: side, sideOffset: sideOffset, showCloseButton: true, trigger: trigger, width: PopoverSizes.Large, ...rest },
|
|
7
|
+
React.createElement(Text, { type: TextTypes.Body5 }, text)));
|
|
8
|
+
export default InfoPopover;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as RadixPopover from '@radix-ui/react-popover';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare enum PopoverSizes {
|
|
4
|
+
Small = "160px",
|
|
5
|
+
Medium = "240px",
|
|
6
|
+
Large = "360px"
|
|
7
|
+
}
|
|
8
|
+
type PopoverProps = {
|
|
9
|
+
asTooltip?: boolean;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
showCloseButton?: boolean;
|
|
12
|
+
trigger?: React.ReactNode;
|
|
13
|
+
width?: PopoverSizes;
|
|
14
|
+
} & RadixPopover.PopoverProps & RadixPopover.PopoverContentProps;
|
|
15
|
+
declare const Popover: React.FC<PopoverProps>;
|
|
16
|
+
export default Popover;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as RadixPopover from '@radix-ui/react-popover';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Button, { ButtonVariations } from '../Button/Button';
|
|
4
|
+
import { CloseIcon } from '../Icon';
|
|
5
|
+
import { PopoverRoot, StyledPopoverArrow, StyledPopoverClose, StyledPopoverContent, } from './styles';
|
|
6
|
+
export var PopoverSizes;
|
|
7
|
+
(function (PopoverSizes) {
|
|
8
|
+
PopoverSizes["Small"] = "160px";
|
|
9
|
+
PopoverSizes["Medium"] = "240px";
|
|
10
|
+
PopoverSizes["Large"] = "360px";
|
|
11
|
+
})(PopoverSizes || (PopoverSizes = {}));
|
|
12
|
+
const DEFAULT_SIDE_OFFSET = 4; //px
|
|
13
|
+
const Popover = ({ asTooltip, defaultOpen, children, onFocusOutside, open, side, sideOffset = DEFAULT_SIDE_OFFSET, showCloseButton, trigger, width = PopoverSizes.Small, }) => (React.createElement(PopoverRoot, { defaultOpen: defaultOpen, open: open },
|
|
14
|
+
trigger && React.createElement(RadixPopover.Trigger, { asChild: true }, trigger),
|
|
15
|
+
React.createElement(RadixPopover.Portal, null,
|
|
16
|
+
React.createElement(StyledPopoverContent, { side: side, sideOffset: sideOffset, "$asTooltip": asTooltip, "$width": width, "$extraPaddingTop": Boolean(!asTooltip && showCloseButton), collisionPadding: DEFAULT_SIDE_OFFSET, onFocusOutside: onFocusOutside },
|
|
17
|
+
children,
|
|
18
|
+
showCloseButton && (React.createElement(StyledPopoverClose, { asChild: true, "$asTooltip": asTooltip },
|
|
19
|
+
React.createElement(Button, { variation: ButtonVariations.Icon },
|
|
20
|
+
React.createElement(CloseIcon, { label: "popover close", width: 12, height: 12 })))),
|
|
21
|
+
React.createElement(StyledPopoverArrow, { "$asTooltip": asTooltip })))));
|
|
22
|
+
export default Popover;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PopoverSizes } from './Popover';
|
|
2
|
+
export declare const PopoverRoot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@radix-ui/react-popover").PopoverProps, never>> & string & Omit<import("react").FC<import("@radix-ui/react-popover").PopoverProps>, keyof import("react").Component<any, {}, any>>;
|
|
3
|
+
export declare const POPOVER_CONTENT_CSS: import("styled-components").RuleSet<object>;
|
|
4
|
+
export declare const StyledPopoverContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("@radix-ui/react-popover").PopoverContentProps & import("react").RefAttributes<HTMLDivElement>, {
|
|
5
|
+
$asTooltip?: boolean;
|
|
6
|
+
$extraPaddingTop: boolean;
|
|
7
|
+
$width: PopoverSizes;
|
|
8
|
+
}>> & string & Omit<import("react").ForwardRefExoticComponent<import("@radix-ui/react-popover").PopoverContentProps & import("react").RefAttributes<HTMLDivElement>>, keyof import("react").Component<any, {}, any>>;
|
|
9
|
+
export declare const StyledPopoverClose: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("@radix-ui/react-popover").PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>, {
|
|
10
|
+
$asTooltip?: boolean;
|
|
11
|
+
}>> & string & Omit<import("react").ForwardRefExoticComponent<import("@radix-ui/react-popover").PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
12
|
+
export declare const StyledPopoverArrow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("@radix-ui/react-popover").PopoverArrowProps & import("react").RefAttributes<SVGSVGElement>, {
|
|
13
|
+
$asTooltip?: boolean;
|
|
14
|
+
}>> & string & Omit<import("react").ForwardRefExoticComponent<import("@radix-ui/react-popover").PopoverArrowProps & import("react").RefAttributes<SVGSVGElement>>, keyof import("react").Component<any, {}, any>>;
|