@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,277 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { ButtonAppearance, ButtonSizes, ButtonVariations, } from '@a-little-world/little-world-design-system-core';
|
|
3
|
+
import { LINK_HOVER_CSS } from '../Link/styles';
|
|
4
|
+
export const OPTION_BUTTON_CSS = css `
|
|
5
|
+
font-family:
|
|
6
|
+
-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
|
7
|
+
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
8
|
+
background: ${({ $backgroundColor, theme }) => $backgroundColor || theme.color.surface.secondary};
|
|
9
|
+
border: 1px solid ${({ theme }) => theme.color.border.subtle};
|
|
10
|
+
color: ${({ $color, theme }) => $color || theme.color.text.primary};
|
|
11
|
+
border-radius: 15px;
|
|
12
|
+
font-weight: 700;
|
|
13
|
+
width: 100%;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
flex: 1;
|
|
17
|
+
padding: ${({ theme }) => theme.spacing.xsmall};
|
|
18
|
+
gap: ${({ theme }) => theme.spacing.xxxsmall};
|
|
19
|
+
max-width: 144px;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
font-weight: normal;
|
|
23
|
+
flex-shrink: 0;
|
|
24
|
+
min-height: 69px;
|
|
25
|
+
|
|
26
|
+
&:not(:disabled):hover {
|
|
27
|
+
filter: brightness(95%);
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
box-shadow:
|
|
30
|
+
0 0 10px 1px rgb(0 0 0 / 11%),
|
|
31
|
+
0 0 8px 3px rgb(255 255 255 / 15%);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
${({ $appearance, $backgroundColor, $color, theme }) => $appearance === ButtonAppearance.Secondary &&
|
|
35
|
+
css `
|
|
36
|
+
color: ${$color || theme.color.text.button};
|
|
37
|
+
background: ${$backgroundColor || theme.color.gradient.blue10};
|
|
38
|
+
`}
|
|
39
|
+
`;
|
|
40
|
+
const StandardButtonCss = css `
|
|
41
|
+
font-weight: 700;
|
|
42
|
+
border-radius: 90px;
|
|
43
|
+
padding: ${({ theme }) => `${theme.spacing.xsmall} ${theme.spacing.small}`};
|
|
44
|
+
height: 49px;
|
|
45
|
+
max-width: 480px;
|
|
46
|
+
gap: ${({ theme }) => theme.spacing.xxxxsmall};
|
|
47
|
+
|
|
48
|
+
${({ $size }) => {
|
|
49
|
+
if ($size === ButtonSizes.Small || !$size) {
|
|
50
|
+
return `min-width: 110px;`;
|
|
51
|
+
}
|
|
52
|
+
if ($size === ButtonSizes.Medium) {
|
|
53
|
+
return `min-width: 160px;`;
|
|
54
|
+
}
|
|
55
|
+
if ($size === ButtonSizes.Large) {
|
|
56
|
+
return `min-width: 240px;`;
|
|
57
|
+
}
|
|
58
|
+
if ($size === ButtonSizes.Stretch) {
|
|
59
|
+
return `width: 100%;`;
|
|
60
|
+
}
|
|
61
|
+
}}
|
|
62
|
+
`;
|
|
63
|
+
export const PrimaryButtonCss = css `
|
|
64
|
+
${StandardButtonCss}
|
|
65
|
+
|
|
66
|
+
color: ${({ theme }) => theme.color.text.button};
|
|
67
|
+
border: none;
|
|
68
|
+
background: ${({ theme, $backgroundColor }) => $backgroundColor || theme.color.gradient.orange10};
|
|
69
|
+
transition:
|
|
70
|
+
background-color 0.5s ease,
|
|
71
|
+
filter 0.5s ease,
|
|
72
|
+
border-color 0.5s ease,
|
|
73
|
+
color 0.5s ease,
|
|
74
|
+
0.4s;
|
|
75
|
+
|
|
76
|
+
&:not(:disabled):hover {
|
|
77
|
+
filter: brightness(80%);
|
|
78
|
+
transition:
|
|
79
|
+
background-color 0.5s ease,
|
|
80
|
+
filter 0.5s ease,
|
|
81
|
+
border-color 0.5s ease,
|
|
82
|
+
color 0.5s ease,
|
|
83
|
+
0.4s;
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
86
|
+
export const SecondaryButtonCss = css `
|
|
87
|
+
${StandardButtonCss}
|
|
88
|
+
|
|
89
|
+
${({ $color, $backgroundColor, theme }) => `
|
|
90
|
+
border: 2px solid ${$color || theme.color.border.bold};
|
|
91
|
+
background-color: ${$backgroundColor || 'transparent'};
|
|
92
|
+
color: ${$color || theme.color.text.heading};
|
|
93
|
+
transition: background-color 0.5s ease, filter 0.5s ease,
|
|
94
|
+
border-color 0.5s ease, color 0.5s ease, 0.4s;
|
|
95
|
+
|
|
96
|
+
&:not(:disabled):hover {
|
|
97
|
+
background: ${$color || theme.color.text.heading};
|
|
98
|
+
color: ${theme.color.text.control};
|
|
99
|
+
border-color: ${$color || theme.color.border.bold};
|
|
100
|
+
transition: background-color 0.5s ease, filter 0.5s ease,
|
|
101
|
+
border-color 0.5s ease, color 0.5s ease, 0.4s;
|
|
102
|
+
}
|
|
103
|
+
`}
|
|
104
|
+
`;
|
|
105
|
+
export const StyledButton = styled.button `
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
position: relative;
|
|
108
|
+
color: ${({ $color }) => $color || 'currentColor'};
|
|
109
|
+
font-family: 'Signika Negative';
|
|
110
|
+
font-size: 1rem;
|
|
111
|
+
display: flex;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
align-items: center;
|
|
114
|
+
box-sizing: border-box;
|
|
115
|
+
transition:
|
|
116
|
+
background-color 0.5s ease,
|
|
117
|
+
filter 0.5s ease,
|
|
118
|
+
border-color 0.5s ease,
|
|
119
|
+
color 0.5s ease,
|
|
120
|
+
0.4s;
|
|
121
|
+
|
|
122
|
+
&:not(:disabled):hover {
|
|
123
|
+
transition:
|
|
124
|
+
background-color 0.5s ease,
|
|
125
|
+
filter 0.5s ease,
|
|
126
|
+
border-color 0.5s ease,
|
|
127
|
+
color 0.5s ease,
|
|
128
|
+
0.4s;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
& > * {
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&:disabled {
|
|
136
|
+
background: ${({ theme }) => theme.color.surface.disabled};
|
|
137
|
+
border-color: ${({ theme }) => theme.color.border.disabled};
|
|
138
|
+
color: ${({ theme }) => theme.color.text.disabled};
|
|
139
|
+
cursor: not-allowed;
|
|
140
|
+
|
|
141
|
+
& > * {
|
|
142
|
+
cursor: not-allowed;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
${({ $appearance, $backgroundColor, $borderColor, $size, $variation, theme, }) => {
|
|
147
|
+
if ($variation === ButtonVariations.Basic) {
|
|
148
|
+
if ($appearance === ButtonAppearance.Primary)
|
|
149
|
+
return PrimaryButtonCss;
|
|
150
|
+
if ($appearance === ButtonAppearance.Secondary)
|
|
151
|
+
return SecondaryButtonCss;
|
|
152
|
+
}
|
|
153
|
+
if ($variation === ButtonVariations.Option)
|
|
154
|
+
return OPTION_BUTTON_CSS;
|
|
155
|
+
let CIRCLE_DIMENSIONS;
|
|
156
|
+
switch ($size) {
|
|
157
|
+
case ButtonSizes.Small:
|
|
158
|
+
CIRCLE_DIMENSIONS = css `
|
|
159
|
+
width: 28px;
|
|
160
|
+
height: 28px;
|
|
161
|
+
`;
|
|
162
|
+
break;
|
|
163
|
+
case ButtonSizes.Medium:
|
|
164
|
+
CIRCLE_DIMENSIONS = css `
|
|
165
|
+
width: 36px;
|
|
166
|
+
height: 36px;
|
|
167
|
+
`;
|
|
168
|
+
break;
|
|
169
|
+
default:
|
|
170
|
+
case ButtonSizes.Large:
|
|
171
|
+
CIRCLE_DIMENSIONS = css `
|
|
172
|
+
width: 44px;
|
|
173
|
+
height: 44px;
|
|
174
|
+
`;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
if ($variation === ButtonVariations.Circle)
|
|
178
|
+
return css `
|
|
179
|
+
border: 1px solid ${$borderColor || $backgroundColor || 'currentColor'};
|
|
180
|
+
background: ${$backgroundColor || 'transparent'};
|
|
181
|
+
border-radius: 50%;
|
|
182
|
+
padding: 0;
|
|
183
|
+
transition: opacity 0.5s ease;
|
|
184
|
+
${CIRCLE_DIMENSIONS}
|
|
185
|
+
|
|
186
|
+
&:not(:disabled):hover {
|
|
187
|
+
transition: opacity 0.3s ease;
|
|
188
|
+
opacity: 0.6;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
${CIRCLE_DIMENSIONS}
|
|
192
|
+
`;
|
|
193
|
+
let ICON_DIMENSIONS;
|
|
194
|
+
switch ($size) {
|
|
195
|
+
case ButtonSizes.Small:
|
|
196
|
+
ICON_DIMENSIONS = css `
|
|
197
|
+
width: 16px;
|
|
198
|
+
height: 16px;
|
|
199
|
+
`;
|
|
200
|
+
break;
|
|
201
|
+
case ButtonSizes.Medium:
|
|
202
|
+
ICON_DIMENSIONS = css `
|
|
203
|
+
width: 24px;
|
|
204
|
+
height: 24px;
|
|
205
|
+
`;
|
|
206
|
+
break;
|
|
207
|
+
case ButtonSizes.Large:
|
|
208
|
+
ICON_DIMENSIONS = css `
|
|
209
|
+
width: 32px;
|
|
210
|
+
height: 32px;
|
|
211
|
+
`;
|
|
212
|
+
break;
|
|
213
|
+
default:
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
if ($variation === ButtonVariations.Icon) {
|
|
217
|
+
return css `
|
|
218
|
+
background: ${$backgroundColor || 'transparent'};
|
|
219
|
+
border-radius: ${theme.radius.xxxsmall};
|
|
220
|
+
width: auto;
|
|
221
|
+
min-width: 0;
|
|
222
|
+
height: fit-content;
|
|
223
|
+
transition: background 0.5s ease;
|
|
224
|
+
|
|
225
|
+
&:has(> svg:first-child) {
|
|
226
|
+
width: fit-content;
|
|
227
|
+
padding: ${!$size || $size === ButtonSizes.Small
|
|
228
|
+
? theme.spacing.xxxsmall
|
|
229
|
+
: theme.spacing.xxsmall};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&:not(:disabled):has(> svg:first-child):hover {
|
|
233
|
+
transition: background 0.3s ease;
|
|
234
|
+
background: ${theme.color.surface.secondary};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&:not(:disabled):hover {
|
|
238
|
+
svg {
|
|
239
|
+
opacity: 0.5;
|
|
240
|
+
transition: opacity 0.5s ease;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
svg {
|
|
245
|
+
transition: opacity 0.5s ease;
|
|
246
|
+
${ICON_DIMENSIONS}
|
|
247
|
+
}
|
|
248
|
+
`;
|
|
249
|
+
}
|
|
250
|
+
if ($variation === ButtonVariations.Inline)
|
|
251
|
+
return css `
|
|
252
|
+
display: inline-flex;
|
|
253
|
+
border: none;
|
|
254
|
+
border-radius: 0px;
|
|
255
|
+
height: auto;
|
|
256
|
+
width: auto;
|
|
257
|
+
gap: ${({ theme }) => theme.spacing.xxxsmall};
|
|
258
|
+
padding: ${({ theme }) => theme.spacing.xxxxsmall} 0;
|
|
259
|
+
transition: all 0.3s ease-in-out;
|
|
260
|
+
background: transparent;
|
|
261
|
+
|
|
262
|
+
&:disabled {
|
|
263
|
+
background: transparent;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
${LINK_HOVER_CSS}
|
|
267
|
+
|
|
268
|
+
&:not(:disabled):hover {
|
|
269
|
+
background-position: 0;
|
|
270
|
+
|
|
271
|
+
&::before {
|
|
272
|
+
width: 100%;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
`;
|
|
276
|
+
}}
|
|
277
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CardBaseProps, CardContentProps, CardDimensions, CardFooterProps, CardHeaderProps, CardSizes } from '@a-little-world/little-world-design-system-core';
|
|
3
|
+
export { CardSizes, CardDimensions };
|
|
4
|
+
export declare const CardContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, CardContentProps>> & string;
|
|
5
|
+
type CardProps = CardBaseProps & {
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const CardHeader: React.FC<CardHeaderProps>;
|
|
9
|
+
export declare const CardFooter: React.FC<CardFooterProps>;
|
|
10
|
+
declare const Card: React.FC<CardProps>;
|
|
11
|
+
export default Card;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { CardDimensions, CardSizes, } from '@a-little-world/little-world-design-system-core';
|
|
4
|
+
import Text from '../Text/Text';
|
|
5
|
+
import { TextTypes } from '@a-little-world/little-world-design-system-core';
|
|
6
|
+
import { pixelate } from '../../utils/styles';
|
|
7
|
+
export { CardSizes, CardDimensions };
|
|
8
|
+
const StyledCard = styled.div `
|
|
9
|
+
border-radius: ${({ theme }) => theme.radius.small};
|
|
10
|
+
background: ${({ theme }) => theme.color.surface.primary};
|
|
11
|
+
border: 1px solid
|
|
12
|
+
${({ theme, $borderColor }) => $borderColor || theme.color.border.subtle};
|
|
13
|
+
box-shadow: 0px 1px 25px 1px rgba(0, 0, 0, 0.05);
|
|
14
|
+
width: 100%;
|
|
15
|
+
max-width: 100%;
|
|
16
|
+
max-height: 100%;
|
|
17
|
+
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
padding: ${({ theme }) => theme.spacing.small};
|
|
21
|
+
|
|
22
|
+
@media (min-width: ${({ theme }) => theme.breakpoints.small}) {
|
|
23
|
+
border-radius: ${({ theme }) => theme.radius.xxlarge};
|
|
24
|
+
padding: ${({ $width, theme }) => $width === pixelate(CardDimensions[CardSizes.Small])
|
|
25
|
+
? theme.spacing.medium
|
|
26
|
+
: theme.spacing.large};
|
|
27
|
+
|
|
28
|
+
${({ $width }) => $width &&
|
|
29
|
+
css `
|
|
30
|
+
width: ${pixelate(CardDimensions[$width])};
|
|
31
|
+
`}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
${({ $height }) => $height &&
|
|
35
|
+
css `
|
|
36
|
+
height: ${$height};
|
|
37
|
+
`}
|
|
38
|
+
`;
|
|
39
|
+
const StyledCardHeader = styled(Text) `
|
|
40
|
+
margin-bottom: ${({ theme }) => theme.spacing.small};
|
|
41
|
+
`;
|
|
42
|
+
export const CardContent = styled.div `
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
align-items: ${({ align }) => align || 'center'};
|
|
46
|
+
gap: ${({ gap, theme }) => gap || theme.spacing.small};
|
|
47
|
+
text-align: ${({ textAlign }) => textAlign || 'left'};
|
|
48
|
+
margin-bottom: ${({ marginBottom, theme }) => marginBottom || theme.spacing.small};
|
|
49
|
+
overflow: scroll;
|
|
50
|
+
`;
|
|
51
|
+
const Footer = styled.div `
|
|
52
|
+
display: flex;
|
|
53
|
+
order: 1;
|
|
54
|
+
margin-top: auto;
|
|
55
|
+
width: 100%;
|
|
56
|
+
gap: ${({ theme }) => theme.spacing.small};
|
|
57
|
+
|
|
58
|
+
${({ $align }) => $align &&
|
|
59
|
+
css `
|
|
60
|
+
justify-content: ${$align};
|
|
61
|
+
`};
|
|
62
|
+
`;
|
|
63
|
+
export const CardHeader = ({ children, textColor, textType, }) => (React.createElement(StyledCardHeader, { type: textType || TextTypes.Heading4, center: true, color: textColor }, children));
|
|
64
|
+
export const CardFooter = ({ children, align }) => (React.createElement(Footer, { "$align": align }, children));
|
|
65
|
+
const Card = ({ borderColor, children, className, height, width, }) => (React.createElement(StyledCard, { className: className, "$borderColor": borderColor, "$height": height, "$width": width }, children));
|
|
66
|
+
export default Card;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CheckboxProps as RadixCheckboxProps } from '@radix-ui/react-checkbox';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type CheckboxProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
color?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
inputRef?: React.RefObject<HTMLButtonElement>;
|
|
9
|
+
label?: string;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
} & RadixCheckboxProps;
|
|
13
|
+
export declare const CheckboxButton: React.FC<CheckboxProps>;
|
|
14
|
+
declare const Checkbox: React.FC<CheckboxProps>;
|
|
15
|
+
export default Checkbox;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CheckIcon } from '../Icon';
|
|
3
|
+
import InputError from '../InputError/InputError';
|
|
4
|
+
import { CheckboxButtonContainer, CheckboxContainer, CheckboxIndicator, CheckboxRoot, CheckboxWrapper, NonInteractiveCheckbox, StyledLabel, } from './styles';
|
|
5
|
+
export const CheckboxButton = ({ checked, className, color, error, id, inputRef, label, onCheckedChange, value, ...rest }) => (React.createElement(CheckboxButtonContainer, { className: className, ref: inputRef, id: id, checked: checked, onCheckedChange: onCheckedChange, value: value, "$hasError": Boolean(error), ...rest },
|
|
6
|
+
React.createElement(NonInteractiveCheckbox, { "$color": color, checked: checked }, checked && React.createElement(CheckIcon, { label: "check icon", width: 10 })),
|
|
7
|
+
label && (React.createElement(StyledLabel, { htmlFor: id, inline: true }, label))));
|
|
8
|
+
const Checkbox = ({ checked, className, color, error, required = true, id, inputRef, label, onCheckedChange, readOnly, value, ...rest }) => {
|
|
9
|
+
return (React.createElement(CheckboxWrapper, { className: className },
|
|
10
|
+
React.createElement(CheckboxContainer, null,
|
|
11
|
+
readOnly ? (React.createElement(NonInteractiveCheckbox, { "$color": color, checked: checked }, checked && React.createElement(CheckIcon, { label: "check icon", width: 10 }))) : (React.createElement(CheckboxRoot, { ref: inputRef, id: id, checked: checked, onCheckedChange: onCheckedChange, value: value, "$hasError": Boolean(error), "$color": color, ...rest },
|
|
12
|
+
React.createElement(CheckboxIndicator, null,
|
|
13
|
+
React.createElement(CheckIcon, { label: "check icon", width: 10 })))),
|
|
14
|
+
label && (React.createElement(StyledLabel, { htmlFor: id, inline: true }, label))),
|
|
15
|
+
required && (React.createElement(InputError, { visible: Boolean(error), textAlign: "left" }, error))));
|
|
16
|
+
};
|
|
17
|
+
export default Checkbox;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Checkbox from '@radix-ui/react-checkbox';
|
|
2
|
+
export declare const CheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const CheckboxButtonContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Checkbox.CheckboxProps & import("react").RefAttributes<HTMLButtonElement>, {
|
|
4
|
+
$hasError?: boolean;
|
|
5
|
+
}>> & string & Omit<import("react").ForwardRefExoticComponent<Checkbox.CheckboxProps & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
6
|
+
export declare const CheckboxContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
+
export declare const CheckboxRoot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Checkbox.CheckboxProps & import("react").RefAttributes<HTMLButtonElement>, {
|
|
8
|
+
$hasError?: boolean;
|
|
9
|
+
$color?: string;
|
|
10
|
+
checked: Checkbox.CheckboxProps["checked"];
|
|
11
|
+
}>> & string & Omit<import("react").ForwardRefExoticComponent<Checkbox.CheckboxProps & import("react").RefAttributes<HTMLButtonElement>>, keyof import("react").Component<any, {}, any>>;
|
|
12
|
+
export declare const NonInteractiveCheckbox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
13
|
+
$color?: string;
|
|
14
|
+
checked: Checkbox.CheckboxProps["checked"];
|
|
15
|
+
}>> & string;
|
|
16
|
+
export declare const CheckboxIndicator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Checkbox.CheckboxIndicatorProps & import("react").RefAttributes<HTMLSpanElement>, never>> & string & Omit<import("react").ForwardRefExoticComponent<Checkbox.CheckboxIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>, keyof import("react").Component<any, {}, any>>;
|
|
17
|
+
export declare const StyledLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@radix-ui/react-label").LabelProps & {
|
|
18
|
+
bold?: boolean;
|
|
19
|
+
inline?: boolean;
|
|
20
|
+
marginBottom?: string | number;
|
|
21
|
+
tooltipText?: string;
|
|
22
|
+
}, never>> & string & Omit<import("react").FC<import("@radix-ui/react-label").LabelProps & {
|
|
23
|
+
bold?: boolean;
|
|
24
|
+
inline?: boolean;
|
|
25
|
+
marginBottom?: string | number;
|
|
26
|
+
tooltipText?: string;
|
|
27
|
+
}>, keyof import("react").Component<any, {}, any>>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as Checkbox from '@radix-ui/react-checkbox';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import Label from '../Label/Label';
|
|
4
|
+
const ITEM_WIDTH = '16px';
|
|
5
|
+
export const CheckboxWrapper = styled.div ``;
|
|
6
|
+
export const CheckboxButtonContainer = styled(Checkbox.Root) `
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
padding: ${({ theme }) => theme.spacing.xxsmall};
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
border: 1px solid
|
|
12
|
+
${({ theme, checked, $hasError }) => checked
|
|
13
|
+
? $hasError
|
|
14
|
+
? theme.color.border.error
|
|
15
|
+
: theme.color.border.selected
|
|
16
|
+
: theme.color.border.subtle};
|
|
17
|
+
border-radius: ${({ theme }) => theme.radius.xxsmall};
|
|
18
|
+
background: ${({ checked, $hasError, theme }) => checked
|
|
19
|
+
? $hasError
|
|
20
|
+
? theme.color.surface.error
|
|
21
|
+
: theme.color.surface.accent
|
|
22
|
+
: theme.color.surface.secondary};
|
|
23
|
+
|
|
24
|
+
label {
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
export const CheckboxContainer = styled.div `
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
margin: ${({ theme }) => theme.spacing.xxxxsmall} 0;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
`;
|
|
34
|
+
const CHECKBOX_STYLES = css `
|
|
35
|
+
all: unset;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
background: ${({ theme }) => theme.color.surface.primary};
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
border: 1px solid ${({ theme }) => theme.color.border.contrast};
|
|
40
|
+
color: ${({ theme }) => theme.color.text.primary};
|
|
41
|
+
width: ${ITEM_WIDTH};
|
|
42
|
+
height: ${ITEM_WIDTH};
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
border-color: ${({ $hasError, theme }) => $hasError ? theme.color.border.error : theme.color.border.contrast};
|
|
47
|
+
|
|
48
|
+
${({ $color, checked, theme }) => $color &&
|
|
49
|
+
checked &&
|
|
50
|
+
css `
|
|
51
|
+
background: ${$color};
|
|
52
|
+
border-color: ${$color};
|
|
53
|
+
color: ${theme.color.text.reversed};
|
|
54
|
+
`}
|
|
55
|
+
`;
|
|
56
|
+
export const CheckboxRoot = styled(Checkbox.Root) `
|
|
57
|
+
${CHECKBOX_STYLES}
|
|
58
|
+
`;
|
|
59
|
+
export const NonInteractiveCheckbox = styled.div `
|
|
60
|
+
${CHECKBOX_STYLES}
|
|
61
|
+
`;
|
|
62
|
+
export const CheckboxIndicator = styled(Checkbox.Indicator) `
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
`;
|
|
67
|
+
export const StyledLabel = styled(Label) `
|
|
68
|
+
margin-left: ${({ theme }) => theme.spacing.xxsmall};
|
|
69
|
+
`;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type SelectedType = {
|
|
3
|
+
[x: string]: string[];
|
|
4
|
+
};
|
|
5
|
+
type CheckboxGridProps = {
|
|
6
|
+
columnHeadings: string[];
|
|
7
|
+
rowHeadings: string[];
|
|
8
|
+
highlightCells: SelectedType;
|
|
9
|
+
checkboxesByColumn: {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
key: string;
|
|
13
|
+
}[][];
|
|
14
|
+
onSelection: (selected: SelectedType) => void;
|
|
15
|
+
preSelected?: SelectedType;
|
|
16
|
+
legendText?: string;
|
|
17
|
+
error?: string;
|
|
18
|
+
name: string;
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
};
|
|
21
|
+
declare const CheckboxGrid: React.FC<CheckboxGridProps>;
|
|
22
|
+
export default CheckboxGrid;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { useTheme } from 'styled-components';
|
|
3
|
+
import InputError from '../InputError/InputError';
|
|
4
|
+
import Text from '../Text/Text';
|
|
5
|
+
import { BelowGrid, CheckboxGridWrapper, ColumnHeading, Grid, Legend, RowHeading, ScrollableWrapper, Square, StyledCheckbox, } from './styles';
|
|
6
|
+
const CheckboxGrid = ({ columnHeadings, error, highlightCells, legendText, rowHeadings, checkboxesByColumn, preSelected, onSelection, name, readOnly, }) => {
|
|
7
|
+
const theme = useTheme();
|
|
8
|
+
const [selected, setSelected] = useState(preSelected || {});
|
|
9
|
+
const onSelect = ({ key, state, value, }) => {
|
|
10
|
+
const oldValues = selected[key] || [];
|
|
11
|
+
const newValues = state
|
|
12
|
+
? [...oldValues, value]
|
|
13
|
+
: oldValues.filter(el => el !== value);
|
|
14
|
+
const newTotalSelection = { ...selected, [key]: newValues };
|
|
15
|
+
setSelected(newTotalSelection);
|
|
16
|
+
onSelection(newTotalSelection);
|
|
17
|
+
};
|
|
18
|
+
return (React.createElement(CheckboxGridWrapper, null,
|
|
19
|
+
React.createElement(Grid, { "$columns": columnHeadings.length, "$rows": rowHeadings.length, "$hasError": !!error },
|
|
20
|
+
React.createElement(React.Fragment, null,
|
|
21
|
+
React.createElement(ColumnHeading, { tag: "span", bold: true, index: 0 }, columnHeadings[0]),
|
|
22
|
+
rowHeadings.map((row, index) => (React.createElement(RowHeading, { tag: "span", key: row, index: index }, row))),
|
|
23
|
+
React.createElement(ScrollableWrapper, null,
|
|
24
|
+
columnHeadings.slice(1).map((column, index) => (React.createElement(ColumnHeading, { key: column, tag: "span", bold: true, index: index + 1 }, column))),
|
|
25
|
+
checkboxesByColumn.map((column, columnIndex) => column.map(({ value, key }, rowIndex) => {
|
|
26
|
+
return (React.createElement(StyledCheckbox, { key: key + value + rowIndex, checked: selected[key]?.includes(value), name: name, onCheckedChange: state => onSelect({ value, key, state }), value: value, color: theme.color.surface.selected, "$row": rowIndex + 2, "$column": columnIndex + 2, "$highlight": !!highlightCells?.[key]?.includes(value), readOnly: readOnly }));
|
|
27
|
+
}))))),
|
|
28
|
+
React.createElement(BelowGrid, null,
|
|
29
|
+
legendText && highlightCells && (React.createElement(Legend, null,
|
|
30
|
+
React.createElement(Square, null),
|
|
31
|
+
React.createElement(Text, { tag: "span" }, "="),
|
|
32
|
+
React.createElement(Text, { tag: "span" }, legendText))),
|
|
33
|
+
React.createElement(InputError, { visible: Boolean(error) }, error))));
|
|
34
|
+
};
|
|
35
|
+
export default CheckboxGrid;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export declare const CheckboxGridWrapper: 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 Grid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
|
+
$columns: number;
|
|
4
|
+
$rows: number;
|
|
5
|
+
$hasError: boolean;
|
|
6
|
+
}>> & string;
|
|
7
|
+
export declare const ColumnHeading: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
8
|
+
className?: string;
|
|
9
|
+
disableParser?: boolean;
|
|
10
|
+
id?: string;
|
|
11
|
+
style?: import("react").CSSProperties;
|
|
12
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
13
|
+
}, {
|
|
14
|
+
index: number;
|
|
15
|
+
}>> & string & Omit<({ bold, center, children, color, className, disableParser, id, style, tag, type, }: import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
16
|
+
className?: string;
|
|
17
|
+
disableParser?: boolean;
|
|
18
|
+
id?: string;
|
|
19
|
+
style?: import("react").CSSProperties;
|
|
20
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
21
|
+
}) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
22
|
+
export declare const RowHeading: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
23
|
+
className?: string;
|
|
24
|
+
disableParser?: boolean;
|
|
25
|
+
id?: string;
|
|
26
|
+
style?: import("react").CSSProperties;
|
|
27
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
28
|
+
}, {
|
|
29
|
+
index: number;
|
|
30
|
+
}>> & string & Omit<({ bold, center, children, color, className, disableParser, id, style, tag, type, }: import("@a-little-world/little-world-design-system-core").TextBaseProps & {
|
|
31
|
+
className?: string;
|
|
32
|
+
disableParser?: boolean;
|
|
33
|
+
id?: string;
|
|
34
|
+
style?: import("react").CSSProperties;
|
|
35
|
+
tag?: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "li" | "label" | "span" | "strong" | "div";
|
|
36
|
+
}) => import("react").JSX.Element, keyof import("react").Component<any, {}, any>>;
|
|
37
|
+
export declare const ScrollableWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
38
|
+
export declare const StyledCheckbox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<{
|
|
39
|
+
className?: string;
|
|
40
|
+
color?: string;
|
|
41
|
+
error?: string;
|
|
42
|
+
id?: string;
|
|
43
|
+
inputRef?: React.RefObject<HTMLButtonElement>;
|
|
44
|
+
label?: string;
|
|
45
|
+
readOnly?: boolean;
|
|
46
|
+
required?: boolean;
|
|
47
|
+
} & import("@radix-ui/react-checkbox").CheckboxProps, {
|
|
48
|
+
checked: boolean;
|
|
49
|
+
$row: number;
|
|
50
|
+
$column: number;
|
|
51
|
+
$highlight: boolean;
|
|
52
|
+
}>> & string & Omit<import("react").FC<{
|
|
53
|
+
className?: string;
|
|
54
|
+
color?: string;
|
|
55
|
+
error?: string;
|
|
56
|
+
id?: string;
|
|
57
|
+
inputRef?: React.RefObject<HTMLButtonElement>;
|
|
58
|
+
label?: string;
|
|
59
|
+
readOnly?: boolean;
|
|
60
|
+
required?: boolean;
|
|
61
|
+
} & import("@radix-ui/react-checkbox").CheckboxProps>, keyof import("react").Component<any, {}, any>>;
|
|
62
|
+
export declare const BelowGrid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
63
|
+
export declare const Legend: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
64
|
+
export declare const Square: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|