@ssa-ui-kit/core 0.0.1-alpha
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.js +4 -0
- package/.storybook/main.ts +43 -0
- package/.storybook/preview.tsx +22 -0
- package/.storybook/style.css +31 -0
- package/custom-shots/components-popover--hint-opened__[w1920px].png +0 -0
- package/customTest.tsx +46 -0
- package/dist/components/AccordionGroup/Accordion.d.ts +2 -0
- package/dist/components/AccordionGroup/AccordionContent.d.ts +9 -0
- package/dist/components/AccordionGroup/AccordionContext.d.ts +7 -0
- package/dist/components/AccordionGroup/AccordionGroup.d.ts +2 -0
- package/dist/components/AccordionGroup/AccordionTitle.d.ts +2 -0
- package/dist/components/AccordionGroup/index.d.ts +5 -0
- package/dist/components/AccordionGroup/stories/helpers.d.ts +12 -0
- package/dist/components/AccordionGroup/styles.d.ts +21 -0
- package/dist/components/AccordionGroup/types.d.ts +44 -0
- package/dist/components/Avatar/Avatar.d.ts +10 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Badge/Badge.d.ts +4 -0
- package/dist/components/Badge/BadgeBase.d.ts +7 -0
- package/dist/components/Badge/helpers.d.ts +16 -0
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/Badge/styles.d.ts +3 -0
- package/dist/components/Badge/types.d.ts +8 -0
- package/dist/components/Button/Button.d.ts +4 -0
- package/dist/components/Button/ButtonBase.d.ts +5 -0
- package/dist/components/Button/ButtonText.d.ts +6 -0
- package/dist/components/Button/fixtures.d.ts +85 -0
- package/dist/components/Button/helpers.d.ts +12 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/styles.d.ts +12 -0
- package/dist/components/Button/types.d.ts +36 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +2 -0
- package/dist/components/ButtonGroup/helpers.d.ts +2 -0
- package/dist/components/ButtonGroup/index.d.ts +2 -0
- package/dist/components/ButtonGroup/styles.d.ts +2 -0
- package/dist/components/ButtonGroup/types.d.ts +11 -0
- package/dist/components/Card/Card.d.ts +3 -0
- package/dist/components/Card/CardBase.d.ts +8 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Card/types.d.ts +8 -0
- package/dist/components/CardContent/CardContent.d.ts +12 -0
- package/dist/components/CardContent/CardContentBase.d.ts +8 -0
- package/dist/components/CardContent/index.d.ts +1 -0
- package/dist/components/CardHeader/CardHeader.d.ts +9 -0
- package/dist/components/CardHeader/CardHeaderBase.d.ts +9 -0
- package/dist/components/CardHeader/index.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/Checkbox/CheckboxBase.d.ts +4 -0
- package/dist/components/Checkbox/index.d.ts +3 -0
- package/dist/components/Checkbox/styles.d.ts +5 -0
- package/dist/components/Checkbox/types.d.ts +21 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +4 -0
- package/dist/components/ColorPicker/index.d.ts +1 -0
- package/dist/components/ColorPicker/styles.d.ts +7 -0
- package/dist/components/ColorPicker/types.d.ts +9 -0
- package/dist/components/Dropdown/Dropdown.context.d.ts +5 -0
- package/dist/components/Dropdown/Dropdown.d.ts +4 -0
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/Dropdown/types.d.ts +16 -0
- package/dist/components/DropdownArrow/DropdownArrow.d.ts +10 -0
- package/dist/components/DropdownArrow/index.d.ts +1 -0
- package/dist/components/DropdownBase/DropdownBase.d.ts +7 -0
- package/dist/components/DropdownBase/index.d.ts +1 -0
- package/dist/components/DropdownOption/DropdownOption.d.ts +18 -0
- package/dist/components/DropdownOption/index.d.ts +1 -0
- package/dist/components/DropdownOptions/DropdownOptions.d.ts +3 -0
- package/dist/components/DropdownOptions/index.d.ts +2 -0
- package/dist/components/DropdownOptions/types.d.ts +8 -0
- package/dist/components/DropdownToggle/DropdownToggle.d.ts +8 -0
- package/dist/components/DropdownToggle/index.d.ts +1 -0
- package/dist/components/DropdownToggle/types.d.ts +20 -0
- package/dist/components/Form/Form.d.ts +7 -0
- package/dist/components/Form/index.d.ts +1 -0
- package/dist/components/FormAction/FormAction.d.ts +7 -0
- package/dist/components/FormAction/index.d.ts +1 -0
- package/dist/components/FormCheckbox/FormCheckbox.d.ts +4 -0
- package/dist/components/FormCheckbox/index.d.ts +1 -0
- package/dist/components/FormCheckbox/types.d.ts +6 -0
- package/dist/components/FormGroup/FormGroup.d.ts +7 -0
- package/dist/components/FormGroup/index.d.ts +1 -0
- package/dist/components/FormHelperText/FormHelperText.d.ts +3 -0
- package/dist/components/FormHelperText/FormHelperTextBase.d.ts +7 -0
- package/dist/components/FormHelperText/index.d.ts +1 -0
- package/dist/components/FormHelperText/types.d.ts +8 -0
- package/dist/components/FormRadioGroup/FormRadioGroup.d.ts +4 -0
- package/dist/components/FormRadioGroup/index.d.ts +1 -0
- package/dist/components/FormRadioGroup/types.d.ts +7 -0
- package/dist/components/Icon/Icon.d.ts +3 -0
- package/dist/components/Icon/icons/Archive.d.ts +2 -0
- package/dist/components/Icon/icons/ArrowDown.d.ts +2 -0
- package/dist/components/Icon/icons/ArrowUp.d.ts +2 -0
- package/dist/components/Icon/icons/Attention.d.ts +2 -0
- package/dist/components/Icon/icons/Bin.d.ts +2 -0
- package/dist/components/Icon/icons/Calendar.d.ts +2 -0
- package/dist/components/Icon/icons/CarrotDown.d.ts +2 -0
- package/dist/components/Icon/icons/CarrotLeft.d.ts +2 -0
- package/dist/components/Icon/icons/CarrotRight.d.ts +2 -0
- package/dist/components/Icon/icons/CarrotUp.d.ts +2 -0
- package/dist/components/Icon/icons/Change.d.ts +2 -0
- package/dist/components/Icon/icons/Check.d.ts +2 -0
- package/dist/components/Icon/icons/CheckCircle.d.ts +2 -0
- package/dist/components/Icon/icons/Circle.d.ts +2 -0
- package/dist/components/Icon/icons/Copy.d.ts +2 -0
- package/dist/components/Icon/icons/Cross.d.ts +2 -0
- package/dist/components/Icon/icons/Diet.d.ts +2 -0
- package/dist/components/Icon/icons/Filter.d.ts +2 -0
- package/dist/components/Icon/icons/Home.d.ts +2 -0
- package/dist/components/Icon/icons/Information.d.ts +2 -0
- package/dist/components/Icon/icons/Invisible.d.ts +2 -0
- package/dist/components/Icon/icons/LogOut.d.ts +2 -0
- package/dist/components/Icon/icons/Measurements.d.ts +2 -0
- package/dist/components/Icon/icons/Minus.d.ts +2 -0
- package/dist/components/Icon/icons/More.d.ts +2 -0
- package/dist/components/Icon/icons/MoreVertical.d.ts +2 -0
- package/dist/components/Icon/icons/Notification.d.ts +2 -0
- package/dist/components/Icon/icons/Plus.d.ts +2 -0
- package/dist/components/Icon/icons/RadioOn.d.ts +2 -0
- package/dist/components/Icon/icons/Search.d.ts +2 -0
- package/dist/components/Icon/icons/Settings.d.ts +2 -0
- package/dist/components/Icon/icons/Sleep.d.ts +2 -0
- package/dist/components/Icon/icons/Stats.d.ts +2 -0
- package/dist/components/Icon/icons/Trainings.d.ts +2 -0
- package/dist/components/Icon/icons/Union.d.ts +2 -0
- package/dist/components/Icon/icons/User.d.ts +2 -0
- package/dist/components/Icon/icons/Visible.d.ts +2 -0
- package/dist/components/Icon/icons/Warning.d.ts +2 -0
- package/dist/components/Icon/icons/iconsList.d.ts +1 -0
- package/dist/components/Icon/icons/index.d.ts +3 -0
- package/dist/components/Icon/index.d.ts +2 -0
- package/dist/components/Icon/types.d.ts +15 -0
- package/dist/components/Indicator/Indicator.d.ts +3 -0
- package/dist/components/Indicator/IndicatorBase.d.ts +8 -0
- package/dist/components/Indicator/index.d.ts +1 -0
- package/dist/components/Indicator/types.d.ts +9 -0
- package/dist/components/Input/Input.d.ts +4 -0
- package/dist/components/Input/InputBase.d.ts +5 -0
- package/dist/components/Input/InputGroup.d.ts +7 -0
- package/dist/components/Input/InputStatusError.d.ts +6 -0
- package/dist/components/Input/InputStatusSuccess.d.ts +6 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Input/styles.d.ts +8 -0
- package/dist/components/Input/types.d.ts +31 -0
- package/dist/components/Label/Label.d.ts +3 -0
- package/dist/components/Label/LabelBase.d.ts +5 -0
- package/dist/components/Label/index.d.ts +1 -0
- package/dist/components/Label/types.d.ts +8 -0
- package/dist/components/LargeTab/LargeTab.d.ts +3 -0
- package/dist/components/LargeTab/LargeTabBase.d.ts +6 -0
- package/dist/components/LargeTab/index.d.ts +1 -0
- package/dist/components/LargeTab/styles.d.ts +3 -0
- package/dist/components/Link/Link.d.ts +2 -0
- package/dist/components/Link/Link.types.d.ts +5 -0
- package/dist/components/Link/LinkBase.d.ts +5 -0
- package/dist/components/Link/index.d.ts +1 -0
- package/dist/components/Modal/Modal.context.d.ts +3 -0
- package/dist/components/Modal/Modal.d.ts +3 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Modal/types.d.ts +8 -0
- package/dist/components/ModalContent/ModalContent.d.ts +3 -0
- package/dist/components/ModalContent/index.d.ts +1 -0
- package/dist/components/ModalDialog/ModalDialog.d.ts +3 -0
- package/dist/components/ModalDialog/index.d.ts +1 -0
- package/dist/components/ModalDialog/types.d.ts +7 -0
- package/dist/components/ModalDismissButton/ModalDismissButton.d.ts +5 -0
- package/dist/components/ModalDismissButton/index.d.ts +1 -0
- package/dist/components/ModalOpenButton/ModalOpenButton.d.ts +5 -0
- package/dist/components/ModalOpenButton/index.d.ts +1 -0
- package/dist/components/MultipleDropdown/MultipleDropdown.context.d.ts +6 -0
- package/dist/components/MultipleDropdown/MultipleDropdown.d.ts +5 -0
- package/dist/components/MultipleDropdown/index.d.ts +1 -0
- package/dist/components/MultipleDropdown/types.d.ts +19 -0
- package/dist/components/MultipleDropdown/utils.d.ts +7 -0
- package/dist/components/MultipleDropdownNotification/MultipleDropdownNotification.d.ts +8 -0
- package/dist/components/MultipleDropdownNotification/index.d.ts +1 -0
- package/dist/components/MultipleDropdownOptions/MultipleDropdownOptions.d.ts +3 -0
- package/dist/components/MultipleDropdownOptions/index.d.ts +2 -0
- package/dist/components/MultipleDropdownOptions/types.d.ts +7 -0
- package/dist/components/Popover/Popover.d.ts +5 -0
- package/dist/components/Popover/Popover.e2e.d.ts +1 -0
- package/dist/components/Popover/PopoverClose.d.ts +2 -0
- package/dist/components/Popover/PopoverContent.d.ts +2 -0
- package/dist/components/Popover/PopoverDescription.d.ts +2 -0
- package/dist/components/Popover/PopoverHeading.d.ts +2 -0
- package/dist/components/Popover/PopoverTrigger.d.ts +4 -0
- package/dist/components/Popover/hooks/usePopover.d.ts +2 -0
- package/dist/components/Popover/hooks/usePopoverContext.d.ts +4 -0
- package/dist/components/Popover/index.d.ts +6 -0
- package/dist/components/Popover/stories/StoryComponent.d.ts +1 -0
- package/dist/components/Popover/types.d.ts +32 -0
- package/dist/components/Progress/Progress.d.ts +3 -0
- package/dist/components/Progress/index.d.ts +1 -0
- package/dist/components/Progress/types.d.ts +8 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +3 -0
- package/dist/components/ProgressBar/index.d.ts +1 -0
- package/dist/components/ProgressBar/styles.d.ts +3 -0
- package/dist/components/ProgressBar/types.d.ts +7 -0
- package/dist/components/ProgressCircle/ProgressCircle.d.ts +3 -0
- package/dist/components/ProgressCircle/ProgressCircleBase.d.ts +11 -0
- package/dist/components/ProgressCircle/ProgressCircleInner.d.ts +7 -0
- package/dist/components/ProgressCircle/ProgressCircleOuter.d.ts +7 -0
- package/dist/components/ProgressCircle/index.d.ts +1 -0
- package/dist/components/ProgressCircle/styles.d.ts +3 -0
- package/dist/components/ProgressCircle/types.d.ts +8 -0
- package/dist/components/ProgressLegend/ProgressLegend.d.ts +3 -0
- package/dist/components/ProgressLegend/index.d.ts +1 -0
- package/dist/components/ProgressLegend/types.d.ts +11 -0
- package/dist/components/ProgressLegendItem/ProgressLegendItem.d.ts +3 -0
- package/dist/components/ProgressLegendItem/index.d.ts +1 -0
- package/dist/components/ProgressLegendItem/types.d.ts +7 -0
- package/dist/components/ProgressVertical/ProgressVertical.d.ts +3 -0
- package/dist/components/ProgressVertical/index.d.ts +1 -0
- package/dist/components/ProgressVertical/types.d.ts +8 -0
- package/dist/components/Radio/Radio.d.ts +3 -0
- package/dist/components/Radio/RadioBase.d.ts +3 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/Radio/types.d.ts +11 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/components/RadioGroup/RadioGroupBase.d.ts +5 -0
- package/dist/components/RadioGroup/index.d.ts +1 -0
- package/dist/components/RadioGroup/types.d.ts +10 -0
- package/dist/components/ResponsiveImage/ResponsiveImage.d.ts +10 -0
- package/dist/components/ResponsiveImage/index.d.ts +1 -0
- package/dist/components/ResponsiveImage/types.d.ts +7 -0
- package/dist/components/Step/Step.context.d.ts +10 -0
- package/dist/components/Step/Step.d.ts +12 -0
- package/dist/components/Step/index.d.ts +2 -0
- package/dist/components/StepConnector/StepConnector.d.ts +2 -0
- package/dist/components/StepConnector/index.d.ts +1 -0
- package/dist/components/StepConnector/style.d.ts +3 -0
- package/dist/components/StepLabel/StepLabel.d.ts +10 -0
- package/dist/components/StepLabel/index.d.ts +1 -0
- package/dist/components/StepLabel/styles.d.ts +5 -0
- package/dist/components/Stepper/Stepper.context.d.ts +5 -0
- package/dist/components/Stepper/Stepper.d.ts +3 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Stepper/types.d.ts +15 -0
- package/dist/components/Switch/Switch.d.ts +3 -0
- package/dist/components/Switch/SwitchBase.d.ts +6 -0
- package/dist/components/Switch/SwitchContext.d.ts +11 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/types.d.ts +4 -0
- package/dist/components/Tab/Tab.d.ts +3 -0
- package/dist/components/Tab/TabBase.d.ts +6 -0
- package/dist/components/Tab/index.d.ts +1 -0
- package/dist/components/TabBar/TabBar.d.ts +10 -0
- package/dist/components/TabBar/TabBarContext.d.ts +8 -0
- package/dist/components/TabBar/index.d.ts +2 -0
- package/dist/components/TabBar/stories/helpers.d.ts +26 -0
- package/dist/components/TabBar/types.d.ts +29 -0
- package/dist/components/Table/Table.d.ts +7 -0
- package/dist/components/Table/index.d.ts +1 -0
- package/dist/components/Table/stories/SortableTable.d.ts +4 -0
- package/dist/components/Table/stories/consts.d.ts +2 -0
- package/dist/components/Table/stories/mock.d.ts +10 -0
- package/dist/components/Table/stories/types.d.ts +6 -0
- package/dist/components/Table/stories/utils.d.ts +1 -0
- package/dist/components/TableBody/TableBody.d.ts +7 -0
- package/dist/components/TableBody/index.d.ts +1 -0
- package/dist/components/TableCell/TableCell.d.ts +9 -0
- package/dist/components/TableCell/index.d.ts +1 -0
- package/dist/components/TableHead/TableHead.d.ts +7 -0
- package/dist/components/TableHead/index.d.ts +1 -0
- package/dist/components/TableRow/TableRow.d.ts +7 -0
- package/dist/components/TableRow/index.d.ts +1 -0
- package/dist/components/Tag/Tag.d.ts +3 -0
- package/dist/components/Tag/index.d.ts +1 -0
- package/dist/components/Tag/styles.d.ts +17 -0
- package/dist/components/Tag/types.d.ts +7 -0
- package/dist/components/TextField/TextField.d.ts +3 -0
- package/dist/components/TextField/index.d.ts +1 -0
- package/dist/components/TextField/types.d.ts +19 -0
- package/dist/components/Textarea/Textarea.d.ts +3 -0
- package/dist/components/Textarea/TextareaBase.d.ts +5 -0
- package/dist/components/Textarea/index.d.ts +1 -0
- package/dist/components/Textarea/types.d.ts +13 -0
- package/dist/components/Tooltip/ProgressChartTooltip.d.ts +2 -0
- package/dist/components/Tooltip/SimpleChartTooltip.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +3 -0
- package/dist/components/Tooltip/TooltipArrow.d.ts +2 -0
- package/dist/components/Tooltip/TooltipContentBase.d.ts +5 -0
- package/dist/components/Tooltip/index.d.ts +5 -0
- package/dist/components/Tooltip/styles.d.ts +3 -0
- package/dist/components/Tooltip/types.d.ts +58 -0
- package/dist/components/Tooltip/useTooltip.d.ts +2 -0
- package/dist/components/Tooltip/useTooltipContext.d.ts +4 -0
- package/dist/components/Tooltip/utils.d.ts +2 -0
- package/dist/components/TooltipContent/TooltipContent.d.ts +4 -0
- package/dist/components/TooltipContent/index.d.ts +1 -0
- package/dist/components/TooltipTrigger/TooltipTrigger.d.ts +4 -0
- package/dist/components/TooltipTrigger/index.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +4 -0
- package/dist/components/Typography/index.d.ts +1 -0
- package/dist/components/Typography/styles.d.ts +17 -0
- package/dist/components/Typography/types.d.ts +12 -0
- package/dist/components/Wrapper/Wrapper.d.ts +11 -0
- package/dist/components/Wrapper/index.d.ts +1 -0
- package/dist/consts.d.ts +18 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/injectGlobal.d.ts +1 -0
- package/dist/styles/global.d.ts +10 -0
- package/dist/styles/safari-focus-outline.d.ts +6 -0
- package/dist/themes/main.d.ts +3 -0
- package/dist/types/emotion.d.ts +126 -0
- package/dist/types/global.d.ts +16 -0
- package/jest-setup.ts +17 -0
- package/lostpixel.config.ts +26 -0
- package/package.json +79 -0
- package/playwright.config.ts +7 -0
- package/src/components/AccordionGroup/Accordion.tsx +30 -0
- package/src/components/AccordionGroup/AccordionContent.tsx +21 -0
- package/src/components/AccordionGroup/AccordionContext.tsx +66 -0
- package/src/components/AccordionGroup/AccordionGroup.spec.tsx +191 -0
- package/src/components/AccordionGroup/AccordionGroup.tsx +71 -0
- package/src/components/AccordionGroup/AccordionTitle.tsx +39 -0
- package/src/components/AccordionGroup/index.ts +8 -0
- package/src/components/AccordionGroup/stories/AccordionGroup.stories.tsx +107 -0
- package/src/components/AccordionGroup/stories/helpers.tsx +86 -0
- package/src/components/AccordionGroup/styles.ts +120 -0
- package/src/components/AccordionGroup/types.ts +54 -0
- package/src/components/Avatar/Avatar.tsx +15 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Badge/Badge.spec.tsx +113 -0
- package/src/components/Badge/Badge.stories.tsx +156 -0
- package/src/components/Badge/Badge.tsx +45 -0
- package/src/components/Badge/BadgeBase.tsx +19 -0
- package/src/components/Badge/helpers.ts +49 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/Badge/styles.ts +20 -0
- package/src/components/Badge/types.ts +7 -0
- package/src/components/Button/Button.spec.tsx +529 -0
- package/src/components/Button/Button.stories.tsx +124 -0
- package/src/components/Button/Button.tsx +121 -0
- package/src/components/Button/ButtonBase.tsx +14 -0
- package/src/components/Button/ButtonText.tsx +67 -0
- package/src/components/Button/fixtures.ts +165 -0
- package/src/components/Button/helpers.ts +30 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Button/styles.ts +168 -0
- package/src/components/Button/types.ts +48 -0
- package/src/components/ButtonGroup/ButtonGroup.spec.tsx +37 -0
- package/src/components/ButtonGroup/ButtonGroup.stories.tsx +42 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +39 -0
- package/src/components/ButtonGroup/helpers.ts +7 -0
- package/src/components/ButtonGroup/index.ts +2 -0
- package/src/components/ButtonGroup/styles.ts +53 -0
- package/src/components/ButtonGroup/types.ts +13 -0
- package/src/components/Card/Card.spec.tsx +94 -0
- package/src/components/Card/Card.stories.tsx +253 -0
- package/src/components/Card/Card.tsx +13 -0
- package/src/components/Card/CardBase.tsx +20 -0
- package/src/components/Card/index.ts +2 -0
- package/src/components/Card/types.ts +8 -0
- package/src/components/CardContent/CardContent.tsx +17 -0
- package/src/components/CardContent/CardContentBase.tsx +12 -0
- package/src/components/CardContent/index.ts +1 -0
- package/src/components/CardHeader/CardHeader.tsx +26 -0
- package/src/components/CardHeader/CardHeaderBase.tsx +21 -0
- package/src/components/CardHeader/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.spec.tsx +193 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +93 -0
- package/src/components/Checkbox/Checkbox.tsx +77 -0
- package/src/components/Checkbox/CheckboxBase.tsx +71 -0
- package/src/components/Checkbox/index.ts +3 -0
- package/src/components/Checkbox/styles.tsx +70 -0
- package/src/components/Checkbox/types.ts +26 -0
- package/src/components/ColorPicker/ColorPicker.spec.tsx +58 -0
- package/src/components/ColorPicker/ColorPicker.stories.tsx +48 -0
- package/src/components/ColorPicker/ColorPicker.tsx +47 -0
- package/src/components/ColorPicker/index.ts +1 -0
- package/src/components/ColorPicker/styles.ts +14 -0
- package/src/components/ColorPicker/types.ts +21 -0
- package/src/components/Dropdown/Dropdown.context.ts +16 -0
- package/src/components/Dropdown/Dropdown.spec.tsx +326 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +155 -0
- package/src/components/Dropdown/Dropdown.tsx +135 -0
- package/src/components/Dropdown/index.ts +1 -0
- package/src/components/Dropdown/types.ts +17 -0
- package/src/components/DropdownArrow/DropdownArrow.tsx +17 -0
- package/src/components/DropdownArrow/index.ts +1 -0
- package/src/components/DropdownBase/DropdownBase.tsx +10 -0
- package/src/components/DropdownBase/index.ts +1 -0
- package/src/components/DropdownOption/DropdownOption.tsx +56 -0
- package/src/components/DropdownOption/index.ts +1 -0
- package/src/components/DropdownOptions/DropdownOptions.tsx +102 -0
- package/src/components/DropdownOptions/index.ts +2 -0
- package/src/components/DropdownOptions/types.ts +9 -0
- package/src/components/DropdownToggle/DropdownToggle.tsx +147 -0
- package/src/components/DropdownToggle/index.ts +1 -0
- package/src/components/DropdownToggle/types.ts +22 -0
- package/src/components/Form/Form.stories.mdx +118 -0
- package/src/components/Form/Form.stories.tsx +432 -0
- package/src/components/Form/Form.tsx +9 -0
- package/src/components/Form/index.ts +1 -0
- package/src/components/FormAction/FormAction.tsx +8 -0
- package/src/components/FormAction/index.ts +1 -0
- package/src/components/FormCheckbox/FormCheckbox.tsx +33 -0
- package/src/components/FormCheckbox/index.ts +1 -0
- package/src/components/FormCheckbox/types.ts +10 -0
- package/src/components/FormGroup/FormGroup.tsx +15 -0
- package/src/components/FormGroup/index.ts +1 -0
- package/src/components/FormHelperText/FormHelperText.tsx +18 -0
- package/src/components/FormHelperText/FormHelperTextBase.tsx +22 -0
- package/src/components/FormHelperText/index.ts +1 -0
- package/src/components/FormHelperText/types.ts +8 -0
- package/src/components/FormRadioGroup/FormRadioGroup.spec.tsx +74 -0
- package/src/components/FormRadioGroup/FormRadioGroup.stories.tsx +90 -0
- package/src/components/FormRadioGroup/FormRadioGroup.tsx +35 -0
- package/src/components/FormRadioGroup/index.ts +1 -0
- package/src/components/FormRadioGroup/types.ts +12 -0
- package/src/components/Icon/Icon.tsx +7 -0
- package/src/components/Icon/Icons.spec.tsx +63 -0
- package/src/components/Icon/Icons.stories.tsx +56 -0
- package/src/components/Icon/icons/Archive.tsx +35 -0
- package/src/components/Icon/icons/ArrowDown.tsx +26 -0
- package/src/components/Icon/icons/ArrowUp.tsx +26 -0
- package/src/components/Icon/icons/Attention.tsx +22 -0
- package/src/components/Icon/icons/Bin.tsx +28 -0
- package/src/components/Icon/icons/Calendar.tsx +16 -0
- package/src/components/Icon/icons/CarrotDown.tsx +20 -0
- package/src/components/Icon/icons/CarrotLeft.tsx +20 -0
- package/src/components/Icon/icons/CarrotRight.tsx +20 -0
- package/src/components/Icon/icons/CarrotUp.tsx +20 -0
- package/src/components/Icon/icons/Change.tsx +16 -0
- package/src/components/Icon/icons/Check.tsx +20 -0
- package/src/components/Icon/icons/CheckCircle.tsx +26 -0
- package/src/components/Icon/icons/Circle.tsx +22 -0
- package/src/components/Icon/icons/Copy.tsx +23 -0
- package/src/components/Icon/icons/Cross.tsx +27 -0
- package/src/components/Icon/icons/Diet.tsx +16 -0
- package/src/components/Icon/icons/Filter.tsx +18 -0
- package/src/components/Icon/icons/Home.tsx +16 -0
- package/src/components/Icon/icons/Information.tsx +24 -0
- package/src/components/Icon/icons/Invisible.tsx +55 -0
- package/src/components/Icon/icons/LogOut.tsx +21 -0
- package/src/components/Icon/icons/Measurements.tsx +18 -0
- package/src/components/Icon/icons/Minus.tsx +20 -0
- package/src/components/Icon/icons/More.tsx +24 -0
- package/src/components/Icon/icons/MoreVertical.tsx +15 -0
- package/src/components/Icon/icons/Notification.tsx +18 -0
- package/src/components/Icon/icons/Plus.tsx +27 -0
- package/src/components/Icon/icons/RadioOn.tsx +23 -0
- package/src/components/Icon/icons/Search.tsx +18 -0
- package/src/components/Icon/icons/Settings.tsx +24 -0
- package/src/components/Icon/icons/Sleep.tsx +20 -0
- package/src/components/Icon/icons/Stats.tsx +20 -0
- package/src/components/Icon/icons/Trainings.tsx +16 -0
- package/src/components/Icon/icons/Union.tsx +19 -0
- package/src/components/Icon/icons/User.tsx +34 -0
- package/src/components/Icon/icons/Visible.tsx +27 -0
- package/src/components/Icon/icons/Warning.tsx +22 -0
- package/src/components/Icon/icons/iconsList.tsx +49 -0
- package/src/components/Icon/icons/index.tsx +103 -0
- package/src/components/Icon/index.ts +2 -0
- package/src/components/Icon/types.ts +18 -0
- package/src/components/Indicator/Indicator.spec.tsx +67 -0
- package/src/components/Indicator/Indicator.stories.tsx +106 -0
- package/src/components/Indicator/Indicator.tsx +86 -0
- package/src/components/Indicator/IndicatorBase.tsx +27 -0
- package/src/components/Indicator/index.ts +1 -0
- package/src/components/Indicator/types.ts +9 -0
- package/src/components/Input/Input.spec.tsx +95 -0
- package/src/components/Input/Input.stories.tsx +215 -0
- package/src/components/Input/Input.tsx +70 -0
- package/src/components/Input/InputBase.tsx +42 -0
- package/src/components/Input/InputGroup.tsx +12 -0
- package/src/components/Input/InputStatusError.tsx +20 -0
- package/src/components/Input/InputStatusSuccess.tsx +16 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/Input/styles.ts +111 -0
- package/src/components/Input/types.ts +35 -0
- package/src/components/Label/Label.spec.tsx +57 -0
- package/src/components/Label/Label.tsx +20 -0
- package/src/components/Label/LabelBase.tsx +14 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Label/types.ts +9 -0
- package/src/components/LargeTab/LargeTab.tsx +38 -0
- package/src/components/LargeTab/LargeTabBase.tsx +39 -0
- package/src/components/LargeTab/index.ts +1 -0
- package/src/components/LargeTab/styles.ts +17 -0
- package/src/components/Link/Link.tsx +10 -0
- package/src/components/Link/Link.types.ts +4 -0
- package/src/components/Link/LinkBase.ts +5 -0
- package/src/components/Link/index.tsx +1 -0
- package/src/components/Modal/Modal.context.tsx +9 -0
- package/src/components/Modal/Modal.spec.tsx +154 -0
- package/src/components/Modal/Modal.stories.tsx +98 -0
- package/src/components/Modal/Modal.tsx +12 -0
- package/src/components/Modal/index.ts +2 -0
- package/src/components/Modal/types.ts +8 -0
- package/src/components/ModalContent/ModalContent.tsx +21 -0
- package/src/components/ModalContent/index.ts +1 -0
- package/src/components/ModalDialog/ModalDialog.tsx +67 -0
- package/src/components/ModalDialog/index.ts +1 -0
- package/src/components/ModalDialog/types.ts +6 -0
- package/src/components/ModalDismissButton/ModalDismissButton.tsx +15 -0
- package/src/components/ModalDismissButton/index.ts +1 -0
- package/src/components/ModalOpenButton/ModalOpenButton.tsx +15 -0
- package/src/components/ModalOpenButton/index.ts +1 -0
- package/src/components/MultipleDropdown/MultipleDropdown.context.ts +20 -0
- package/src/components/MultipleDropdown/MultipleDropdown.spec.tsx +381 -0
- package/src/components/MultipleDropdown/MultipleDropdown.stories.tsx +206 -0
- package/src/components/MultipleDropdown/MultipleDropdown.tsx +217 -0
- package/src/components/MultipleDropdown/index.ts +1 -0
- package/src/components/MultipleDropdown/types.ts +20 -0
- package/src/components/MultipleDropdown/utils.ts +32 -0
- package/src/components/MultipleDropdownNotification/MultipleDropdownNotification.tsx +13 -0
- package/src/components/MultipleDropdownNotification/index.ts +1 -0
- package/src/components/MultipleDropdownOptions/MultipleDropdownOptions.tsx +156 -0
- package/src/components/MultipleDropdownOptions/index.ts +2 -0
- package/src/components/MultipleDropdownOptions/types.ts +7 -0
- package/src/components/Popover/Popover.e2e.ts +26 -0
- package/src/components/Popover/Popover.spec.tsx +17 -0
- package/src/components/Popover/Popover.tsx +21 -0
- package/src/components/Popover/PopoverClose.tsx +21 -0
- package/src/components/Popover/PopoverContent.tsx +37 -0
- package/src/components/Popover/PopoverDescription.tsx +21 -0
- package/src/components/Popover/PopoverHeading.tsx +25 -0
- package/src/components/Popover/PopoverTrigger.tsx +47 -0
- package/src/components/Popover/hooks/usePopover.tsx +84 -0
- package/src/components/Popover/hooks/usePopoverContext.tsx +16 -0
- package/src/components/Popover/index.ts +6 -0
- package/src/components/Popover/stories/Popover.stories.tsx +18 -0
- package/src/components/Popover/stories/StoryComponent.tsx +39 -0
- package/src/components/Popover/types.ts +42 -0
- package/src/components/Progress/Progress.spec.tsx +85 -0
- package/src/components/Progress/Progress.stories.tsx +234 -0
- package/src/components/Progress/Progress.tsx +7 -0
- package/src/components/Progress/index.ts +1 -0
- package/src/components/Progress/types.ts +5 -0
- package/src/components/ProgressBar/ProgressBar.tsx +68 -0
- package/src/components/ProgressBar/index.ts +1 -0
- package/src/components/ProgressBar/styles.ts +15 -0
- package/src/components/ProgressBar/types.ts +7 -0
- package/src/components/ProgressCircle/ProgressCircle.spec.tsx +37 -0
- package/src/components/ProgressCircle/ProgressCircle.stories.tsx +96 -0
- package/src/components/ProgressCircle/ProgressCircle.tsx +60 -0
- package/src/components/ProgressCircle/ProgressCircleBase.tsx +45 -0
- package/src/components/ProgressCircle/ProgressCircleInner.tsx +16 -0
- package/src/components/ProgressCircle/ProgressCircleOuter.tsx +14 -0
- package/src/components/ProgressCircle/index.ts +1 -0
- package/src/components/ProgressCircle/styles.ts +20 -0
- package/src/components/ProgressCircle/types.ts +7 -0
- package/src/components/ProgressLegend/ProgressLegend.tsx +41 -0
- package/src/components/ProgressLegend/index.ts +1 -0
- package/src/components/ProgressLegend/types.ts +12 -0
- package/src/components/ProgressLegendItem/ProgressLegendItem.tsx +52 -0
- package/src/components/ProgressLegendItem/index.ts +1 -0
- package/src/components/ProgressLegendItem/types.ts +6 -0
- package/src/components/ProgressVertical/ProgressVertical.tsx +23 -0
- package/src/components/ProgressVertical/index.ts +1 -0
- package/src/components/ProgressVertical/types.ts +5 -0
- package/src/components/Radio/Radio.spec.tsx +234 -0
- package/src/components/Radio/Radio.stories.tsx +52 -0
- package/src/components/Radio/Radio.tsx +56 -0
- package/src/components/Radio/RadioBase.tsx +36 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/Radio/types.ts +11 -0
- package/src/components/RadioGroup/RadioGroup.spec.tsx +116 -0
- package/src/components/RadioGroup/RadioGroup.stories.tsx +84 -0
- package/src/components/RadioGroup/RadioGroup.tsx +49 -0
- package/src/components/RadioGroup/RadioGroupBase.tsx +3 -0
- package/src/components/RadioGroup/index.ts +1 -0
- package/src/components/RadioGroup/types.ts +10 -0
- package/src/components/ResponsiveImage/ResponsiveImage.spec.tsx +43 -0
- package/src/components/ResponsiveImage/ResponsiveImage.stories.tsx +33 -0
- package/src/components/ResponsiveImage/ResponsiveImage.tsx +14 -0
- package/src/components/ResponsiveImage/index.tsx +1 -0
- package/src/components/ResponsiveImage/types.ts +7 -0
- package/src/components/Step/Step.context.ts +21 -0
- package/src/components/Step/Step.tsx +58 -0
- package/src/components/Step/index.ts +2 -0
- package/src/components/StepConnector/StepConnector.tsx +34 -0
- package/src/components/StepConnector/index.ts +1 -0
- package/src/components/StepConnector/style.ts +24 -0
- package/src/components/StepLabel/StepLabel.tsx +65 -0
- package/src/components/StepLabel/index.ts +1 -0
- package/src/components/StepLabel/styles.ts +38 -0
- package/src/components/Stepper/Stepper.context.ts +16 -0
- package/src/components/Stepper/Stepper.spec.tsx +128 -0
- package/src/components/Stepper/Stepper.stories.tsx +292 -0
- package/src/components/Stepper/Stepper.tsx +49 -0
- package/src/components/Stepper/index.ts +5 -0
- package/src/components/Stepper/types.ts +17 -0
- package/src/components/Switch/Switch.spec.tsx +181 -0
- package/src/components/Switch/Switch.stories.tsx +64 -0
- package/src/components/Switch/Switch.tsx +21 -0
- package/src/components/Switch/SwitchBase.tsx +62 -0
- package/src/components/Switch/SwitchContext.tsx +38 -0
- package/src/components/Switch/index.ts +6 -0
- package/src/components/Switch/types.ts +4 -0
- package/src/components/Tab/Tab.tsx +31 -0
- package/src/components/Tab/TabBase.tsx +31 -0
- package/src/components/Tab/index.ts +1 -0
- package/src/components/TabBar/TabBar.spec.tsx +290 -0
- package/src/components/TabBar/TabBar.tsx +43 -0
- package/src/components/TabBar/TabBarContext.tsx +43 -0
- package/src/components/TabBar/index.ts +6 -0
- package/src/components/TabBar/stories/TimePeriodTabBar.stories.tsx +84 -0
- package/src/components/TabBar/stories/WeekTabBar.stories.tsx +136 -0
- package/src/components/TabBar/stories/helpers.tsx +69 -0
- package/src/components/TabBar/types.ts +39 -0
- package/src/components/Table/Table.spec.tsx +86 -0
- package/src/components/Table/Table.tsx +13 -0
- package/src/components/Table/index.ts +1 -0
- package/src/components/Table/stories/SortableTable.tsx +78 -0
- package/src/components/Table/stories/Table.stories.tsx +94 -0
- package/src/components/Table/stories/consts.ts +6 -0
- package/src/components/Table/stories/mock.ts +16 -0
- package/src/components/Table/stories/types.ts +9 -0
- package/src/components/Table/stories/utils.ts +2 -0
- package/src/components/TableBody/TableBody.tsx +8 -0
- package/src/components/TableBody/index.ts +1 -0
- package/src/components/TableCell/TableCell.tsx +16 -0
- package/src/components/TableCell/index.ts +1 -0
- package/src/components/TableHead/TableHead.tsx +15 -0
- package/src/components/TableHead/index.ts +1 -0
- package/src/components/TableRow/TableRow.tsx +12 -0
- package/src/components/TableRow/index.ts +1 -0
- package/src/components/Tag/Tag.spec.tsx +121 -0
- package/src/components/Tag/Tag.stories.tsx +96 -0
- package/src/components/Tag/Tag.tsx +47 -0
- package/src/components/Tag/index.ts +1 -0
- package/src/components/Tag/styles.ts +123 -0
- package/src/components/Tag/types.ts +7 -0
- package/src/components/TextField/TextField.spec.tsx +171 -0
- package/src/components/TextField/TextField.stories.tsx +221 -0
- package/src/components/TextField/TextField.tsx +61 -0
- package/src/components/TextField/index.ts +1 -0
- package/src/components/TextField/types.ts +20 -0
- package/src/components/Textarea/Textarea.spec.tsx +56 -0
- package/src/components/Textarea/Textarea.stories.tsx +58 -0
- package/src/components/Textarea/Textarea.tsx +35 -0
- package/src/components/Textarea/TextareaBase.tsx +44 -0
- package/src/components/Textarea/index.ts +1 -0
- package/src/components/Textarea/types.ts +15 -0
- package/src/components/Tooltip/ProgressChartTooltip.tsx +48 -0
- package/src/components/Tooltip/SimpleChartTooltip.tsx +20 -0
- package/src/components/Tooltip/Tooltip.spec.tsx +305 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +160 -0
- package/src/components/Tooltip/Tooltip.tsx +22 -0
- package/src/components/Tooltip/TooltipArrow.tsx +26 -0
- package/src/components/Tooltip/TooltipContentBase.tsx +9 -0
- package/src/components/Tooltip/index.ts +5 -0
- package/src/components/Tooltip/styles.ts +16 -0
- package/src/components/Tooltip/types.ts +88 -0
- package/src/components/Tooltip/useTooltip.tsx +74 -0
- package/src/components/Tooltip/useTooltipContext.tsx +16 -0
- package/src/components/Tooltip/utils.tsx +8 -0
- package/src/components/TooltipContent/TooltipContent.tsx +49 -0
- package/src/components/TooltipContent/index.ts +1 -0
- package/src/components/TooltipTrigger/TooltipTrigger.tsx +21 -0
- package/src/components/TooltipTrigger/index.ts +1 -0
- package/src/components/Typography/Typography.spec.tsx +259 -0
- package/src/components/Typography/Typography.stories.tsx +68 -0
- package/src/components/Typography/Typography.tsx +52 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/Typography/styles.ts +85 -0
- package/src/components/Typography/types.ts +22 -0
- package/src/components/Wrapper/Wrapper.spec.tsx +15 -0
- package/src/components/Wrapper/Wrapper.tsx +19 -0
- package/src/components/Wrapper/index.ts +1 -0
- package/src/consts.ts +18 -0
- package/src/index.ts +85 -0
- package/src/injectGlobal.ts +41 -0
- package/src/styles/global.ts +91 -0
- package/src/styles/safari-focus-outline.ts +37 -0
- package/src/styles/styles.spec.tsx +42 -0
- package/src/themes/main.ts +116 -0
- package/src/types/emotion.d.ts +7 -0
- package/src/types/emotion.ts +132 -0
- package/src/types/global.d.ts +7 -0
- package/src/types/global.ts +19 -0
- package/storybook-static/106.778a645c.iframe.bundle.js +44 -0
- package/storybook-static/106.778a645c.iframe.bundle.js.map +1 -0
- package/storybook-static/138.8c2d65fc.iframe.bundle.js +402 -0
- package/storybook-static/138.8c2d65fc.iframe.bundle.js.LICENSE.txt +64 -0
- package/storybook-static/138.8c2d65fc.iframe.bundle.js.map +1 -0
- package/storybook-static/147.4bde027d.iframe.bundle.js +1 -0
- package/storybook-static/162.50651ae2.iframe.bundle.js +1 -0
- package/storybook-static/17.5d9bd250.iframe.bundle.js +1 -0
- package/storybook-static/291.09d4c667.iframe.bundle.js +1 -0
- package/storybook-static/306.af359eab.iframe.bundle.js +6 -0
- package/storybook-static/306.af359eab.iframe.bundle.js.LICENSE.txt +8 -0
- package/storybook-static/306.af359eab.iframe.bundle.js.map +1 -0
- package/storybook-static/362.4cbbd69f.iframe.bundle.js +1 -0
- package/storybook-static/420.42d7bc14.iframe.bundle.js +1 -0
- package/storybook-static/576.29e7ae1a.iframe.bundle.js +1 -0
- package/storybook-static/577.1d2cbd23.iframe.bundle.js +1 -0
- package/storybook-static/710.062ccd5f.iframe.bundle.js +1 -0
- package/storybook-static/768.33e53fd0.iframe.bundle.js +1 -0
- package/storybook-static/828.5ae0e882.iframe.bundle.js +1 -0
- package/storybook-static/829.683a9f42.iframe.bundle.js +133 -0
- package/storybook-static/829.683a9f42.iframe.bundle.js.map +1 -0
- package/storybook-static/866.50e11952.iframe.bundle.js +1 -0
- package/storybook-static/92.83dcbe4b.iframe.bundle.js +1 -0
- package/storybook-static/945.3489a74d.iframe.bundle.js +1 -0
- package/storybook-static/958.d966bb86.iframe.bundle.js +1 -0
- package/storybook-static/components-Badge-Badge-stories.f86fca97.iframe.bundle.js +1 -0
- package/storybook-static/components-Button-Button-stories.f9b820e6.iframe.bundle.js +1 -0
- package/storybook-static/components-Card-Card-stories.53c865e0.iframe.bundle.js +1 -0
- package/storybook-static/components-Checkbox-Checkbox-stories.831f01fd.iframe.bundle.js +1 -0
- package/storybook-static/components-ColorPicker-ColorPicker-stories.2ab41812.iframe.bundle.js +1 -0
- package/storybook-static/components-Dropdown-Dropdown-stories.7167f777.iframe.bundle.js +1 -0
- package/storybook-static/components-Form-Form-stories-mdx.9836b75e.iframe.bundle.js +2 -0
- package/storybook-static/components-Form-Form-stories-mdx.9836b75e.iframe.bundle.js.LICENSE.txt +9 -0
- package/storybook-static/components-Form-Form-stories.3de6bf7e.iframe.bundle.js +1 -0
- package/storybook-static/components-FormRadioGroup-FormRadioGroup-stories.0502eda0.iframe.bundle.js +1 -0
- package/storybook-static/components-Icon-Icons-stories.1acf0324.iframe.bundle.js +1 -0
- package/storybook-static/components-Input-Input-stories.6eb48766.iframe.bundle.js +1 -0
- package/storybook-static/components-Modal-Modal-stories.86f65df0.iframe.bundle.js +1 -0
- package/storybook-static/components-Progress-Progress-stories.77e171cd.iframe.bundle.js +1 -0
- package/storybook-static/components-ProgressCircle-ProgressCircle-stories.859f52ec.iframe.bundle.js +1 -0
- package/storybook-static/components-Radio-Radio-stories.71a0eb7a.iframe.bundle.js +1 -0
- package/storybook-static/components-RadioGroup-RadioGroup-stories.c5e954b8.iframe.bundle.js +1 -0
- package/storybook-static/components-ResponsiveImage-ResponsiveImage-stories.0865df1e.iframe.bundle.js +1 -0
- package/storybook-static/components-Stepper-Stepper-stories.7627cd7c.iframe.bundle.js +1 -0
- package/storybook-static/components-Switch-Switch-stories.a4a76d7f.iframe.bundle.js +1 -0
- package/storybook-static/components-TabBar-stories-TimePeriodTabBar-stories.70f1a14c.iframe.bundle.js +1 -0
- package/storybook-static/components-TabBar-stories-WeekTabBar-stories.9e080c9e.iframe.bundle.js +1 -0
- package/storybook-static/components-Table-Table-stories.f316f6a3.iframe.bundle.js +1 -0
- package/storybook-static/components-Tag-Tag-stories.4f4974ab.iframe.bundle.js +1 -0
- package/storybook-static/components-TextField-TextField-stories.af04f7d8.iframe.bundle.js +1 -0
- package/storybook-static/components-Textarea-Textarea-stories.90376002.iframe.bundle.js +1 -0
- package/storybook-static/components-Tooltip-Tooltip-stories.63785818.iframe.bundle.js +1 -0
- package/storybook-static/components-Typography-Typography-stories.3cdf669d.iframe.bundle.js +1 -0
- package/storybook-static/favicon.svg +7 -0
- package/storybook-static/iframe.html +355 -0
- package/storybook-static/index.html +126 -0
- package/storybook-static/index.json +1 -0
- package/storybook-static/main.4d06409e.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -0
- package/storybook-static/runtime~main.dcd9f3c1.iframe.bundle.js +1 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +4 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js.map +7 -0
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js +13 -0
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-backgrounds-3/manager-bundle.js.map +7 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +117 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +18 -0
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js.map +7 -0
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js +4 -0
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-measure-6/manager-bundle.js.map +7 -0
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js +4 -0
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-outline-7/manager-bundle.js.map +7 -0
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js +4 -0
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-toolbars-5/manager-bundle.js.map +7 -0
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js +4 -0
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/essentials-viewport-4/manager-bundle.js.map +7 -0
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js +28 -0
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/interactions-8/manager-bundle.js.map +7 -0
- package/storybook-static/sb-addons/links-0/manager-bundle.js +4 -0
- package/storybook-static/sb-addons/links-0/manager-bundle.js.LEGAL.txt +0 -0
- package/storybook-static/sb-addons/links-0/manager-bundle.js.map +7 -0
- package/storybook-static/sb-common-assets/fonts.css +31 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/sb-manager/GlobalScrollAreaStyles-DZEYMYDM-UAEZM2KF.js +7 -0
- package/storybook-static/sb-manager/OverlayScrollbars-OGE3XJTA-T3S33YR7.js +1 -0
- package/storybook-static/sb-manager/WithTooltip-I4CCNYWD-ZW5IOTVO.js +1 -0
- package/storybook-static/sb-manager/chunk-3FAXWWKG.js +15 -0
- package/storybook-static/sb-manager/chunk-AA6TEL5N.js +207 -0
- package/storybook-static/sb-manager/chunk-AM2ZNZZH.js +136 -0
- package/storybook-static/sb-manager/chunk-AS2AMEUR.js +1 -0
- package/storybook-static/sb-manager/chunk-FPTBIX6P.js +403 -0
- package/storybook-static/sb-manager/chunk-IPZYHIL3.js +7 -0
- package/storybook-static/sb-manager/chunk-QPL63VNK.js +1 -0
- package/storybook-static/sb-manager/chunk-R5BIZIS3.js +1 -0
- package/storybook-static/sb-manager/formatter-OJ5LH2CX-IQX6U4TO.js +156 -0
- package/storybook-static/sb-manager/globals.js +1 -0
- package/storybook-static/sb-manager/index.js +1 -0
- package/storybook-static/sb-manager/runtime.js +1 -0
- package/storybook-static/sb-manager/syntaxhighlighter-SIPZPD4I-WOB5MYBW.js +1 -0
- package/storybook-static/sb-preview/globals.js +1 -0
- package/storybook-static/sb-preview/runtime.js +105 -0
- package/storybook-static/stories.json +1 -0
- package/tasks/create.js +45 -0
- package/tasks/firebase-import-meal-nutrients.js +66 -0
- package/tsbuildcache +1 -0
- package/tsconfig.build.json +44 -0
- package/tsconfig.json +20 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/webpack.config.js +26 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Theme } from '@emotion/react';
|
|
2
|
+
export declare const pink: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const yellow: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const yellowWarm: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const green: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const turquoise: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
7
|
+
export declare const purple: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
8
|
+
export declare const blue: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
9
|
+
export declare const blueLight: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
10
|
+
export declare const blueLightDarker: (theme: Theme) => import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Theme, SerializedStyles } from '@emotion/react';
|
|
3
|
+
type OutlineFn = (theme: Theme, color?: keyof Theme['colors'], borderRadius?: string, borderStyle?: React.CSSProperties['borderStyle']) => SerializedStyles;
|
|
4
|
+
export declare const focusOutline: OutlineFn;
|
|
5
|
+
export declare const outlineStyles: OutlineFn;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type RGBString = `rgb${string}`;
|
|
3
|
+
type MakeColors<T extends Array<string>> = {
|
|
4
|
+
[K in T[number]]?: RGBString;
|
|
5
|
+
};
|
|
6
|
+
type Colors = MakeColors<[
|
|
7
|
+
'black25',
|
|
8
|
+
'black45',
|
|
9
|
+
'white',
|
|
10
|
+
'white60',
|
|
11
|
+
'white80',
|
|
12
|
+
'white30',
|
|
13
|
+
'dark',
|
|
14
|
+
'greyLighter',
|
|
15
|
+
'greySelectedMenuItem',
|
|
16
|
+
'greyFocused',
|
|
17
|
+
'greyFocused40',
|
|
18
|
+
'grey',
|
|
19
|
+
'grey20',
|
|
20
|
+
'grey40',
|
|
21
|
+
'greyShadow24',
|
|
22
|
+
'greyDarker',
|
|
23
|
+
'greyDarker60',
|
|
24
|
+
'greyDarker80',
|
|
25
|
+
'greyDarker14',
|
|
26
|
+
'greyDark',
|
|
27
|
+
'greyDisabled',
|
|
28
|
+
'greyDisabledCheckbox',
|
|
29
|
+
'greyButtonGradient',
|
|
30
|
+
'greyButtonGradientLight',
|
|
31
|
+
'greyBackground',
|
|
32
|
+
'greyBackgroundLight',
|
|
33
|
+
'greyPopoverLight',
|
|
34
|
+
'greyGraphite',
|
|
35
|
+
'greyGraphite70',
|
|
36
|
+
'greyShadow',
|
|
37
|
+
'greyOutline',
|
|
38
|
+
'greyShadowHover',
|
|
39
|
+
'greyDropdownMain',
|
|
40
|
+
'greyDropdownFocused',
|
|
41
|
+
'greyDropdownText',
|
|
42
|
+
'greyArrowSidebar',
|
|
43
|
+
'greyFilterIcon',
|
|
44
|
+
'greyCancelClearButton',
|
|
45
|
+
'redLighter',
|
|
46
|
+
'redLighter40',
|
|
47
|
+
'red',
|
|
48
|
+
'red40',
|
|
49
|
+
'greenLighter',
|
|
50
|
+
'greenLighter20',
|
|
51
|
+
'greenLighter40',
|
|
52
|
+
'greenLighter60',
|
|
53
|
+
'green',
|
|
54
|
+
'green20',
|
|
55
|
+
'green40',
|
|
56
|
+
'green60',
|
|
57
|
+
'greenMint',
|
|
58
|
+
'greenDark',
|
|
59
|
+
'pink',
|
|
60
|
+
'pink20',
|
|
61
|
+
'pinkDark',
|
|
62
|
+
'pinkDarker',
|
|
63
|
+
'pinkShadow40',
|
|
64
|
+
'pinkLighter',
|
|
65
|
+
'pinkLighter20',
|
|
66
|
+
'pinkLighter40',
|
|
67
|
+
'yellow',
|
|
68
|
+
'yellow20',
|
|
69
|
+
'yellowLighter',
|
|
70
|
+
'yellowLighter20',
|
|
71
|
+
'yellowLighter40',
|
|
72
|
+
'yellowWarm',
|
|
73
|
+
'yellowWarm20',
|
|
74
|
+
'yellowWarm40',
|
|
75
|
+
'turquoise',
|
|
76
|
+
'turquoise20',
|
|
77
|
+
'turquoiseShadow40',
|
|
78
|
+
'turquoiseLighter',
|
|
79
|
+
'turquoiseLighter20',
|
|
80
|
+
'turquoiseLighter40',
|
|
81
|
+
'purple',
|
|
82
|
+
'purple20',
|
|
83
|
+
'purpleLighter',
|
|
84
|
+
'purpleLighter20',
|
|
85
|
+
'purpleLighter40',
|
|
86
|
+
'purpleDark',
|
|
87
|
+
'purpleDark40',
|
|
88
|
+
'blue',
|
|
89
|
+
'blue20',
|
|
90
|
+
'blueDark',
|
|
91
|
+
'blueLightDarker',
|
|
92
|
+
'blueDropdownWithSelectedItems',
|
|
93
|
+
'blueDropdownWithSelectedItemsBorder',
|
|
94
|
+
'blueLighter',
|
|
95
|
+
'blueLighter20',
|
|
96
|
+
'blueLighter40',
|
|
97
|
+
'blueLight',
|
|
98
|
+
'blueLight20',
|
|
99
|
+
'blueLightDarker40',
|
|
100
|
+
'blueLightLighter',
|
|
101
|
+
'blueLightLighter20',
|
|
102
|
+
'blueLightLighter40',
|
|
103
|
+
'blueNotification',
|
|
104
|
+
'blueNotification40',
|
|
105
|
+
'blueButtonHoverGradientFrom',
|
|
106
|
+
'blueButtonHoverGradientTo',
|
|
107
|
+
'blueButtonActive',
|
|
108
|
+
'blueRoyal'
|
|
109
|
+
]>;
|
|
110
|
+
export type ColorsKeys = keyof Colors;
|
|
111
|
+
type MediaQueryString = `@media${string}`;
|
|
112
|
+
export interface Theme {
|
|
113
|
+
colors: Colors;
|
|
114
|
+
mediaQueries: {
|
|
115
|
+
xs: MediaQueryString;
|
|
116
|
+
sm: MediaQueryString;
|
|
117
|
+
md: MediaQueryString;
|
|
118
|
+
lg: MediaQueryString;
|
|
119
|
+
xlg: MediaQueryString;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export interface CommonProps {
|
|
123
|
+
as?: React.ElementType;
|
|
124
|
+
className?: string;
|
|
125
|
+
}
|
|
126
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Theme, SerializedStyles, Interpolation } from '@emotion/react';
|
|
2
|
+
export interface MainSizes {
|
|
3
|
+
small: SerializedStyles;
|
|
4
|
+
medium: SerializedStyles;
|
|
5
|
+
large: SerializedStyles;
|
|
6
|
+
}
|
|
7
|
+
export interface MainColors {
|
|
8
|
+
pink: Interpolation<Theme>;
|
|
9
|
+
yellow: Interpolation<Theme>;
|
|
10
|
+
yellowWarm: Interpolation<Theme>;
|
|
11
|
+
green: Interpolation<Theme>;
|
|
12
|
+
turquoise: Interpolation<Theme>;
|
|
13
|
+
purple: Interpolation<Theme>;
|
|
14
|
+
blueLight: Interpolation<Theme>;
|
|
15
|
+
blue: Interpolation<Theme>;
|
|
16
|
+
}
|
package/jest-setup.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/extend-expect';
|
|
2
|
+
import { createSerializer, matchers } from '@emotion/jest';
|
|
3
|
+
|
|
4
|
+
import { initRender } from './customTest';
|
|
5
|
+
import theme from '@themes/main';
|
|
6
|
+
|
|
7
|
+
const customRender = initRender(theme);
|
|
8
|
+
|
|
9
|
+
declare global {
|
|
10
|
+
// eslint-disable-next-line no-var
|
|
11
|
+
var render: typeof customRender;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
global.render = customRender;
|
|
15
|
+
|
|
16
|
+
expect.addSnapshotSerializer(createSerializer());
|
|
17
|
+
expect.extend(matchers);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { baseConfig } from '../../lostpixel.base.config';
|
|
2
|
+
import { SCREEN_SIZES } from './src/consts';
|
|
3
|
+
import { CustomProjectConfig } from 'lost-pixel';
|
|
4
|
+
|
|
5
|
+
const breakpoints = Object.keys(SCREEN_SIZES).map(Number);
|
|
6
|
+
|
|
7
|
+
const coreConfig: Partial<CustomProjectConfig> & {
|
|
8
|
+
storybookShots: {
|
|
9
|
+
breakpoints: number[];
|
|
10
|
+
};
|
|
11
|
+
} = {
|
|
12
|
+
storybookShots: {
|
|
13
|
+
storybookUrl: './packages/core/storybook-static',
|
|
14
|
+
breakpoints,
|
|
15
|
+
// https://docs.lost-pixel.com/user-docs/api-reference/mask
|
|
16
|
+
mask: [{ selector: '.lostpixel-ignore' }],
|
|
17
|
+
},
|
|
18
|
+
// @cspell:disable-next-line
|
|
19
|
+
lostPixelProjectId: 'clldrwk2t4dkena0e4nu2rikp',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const config: Partial<CustomProjectConfig> & {
|
|
23
|
+
storybookShots: {
|
|
24
|
+
breakpoints: number[];
|
|
25
|
+
};
|
|
26
|
+
} = Object.assign({}, baseConfig, coreConfig);
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ssa-ui-kit/core",
|
|
3
|
+
"version": "0.0.1-alpha",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"private": false,
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"author": "SSA Group",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"description": "SSA UI Kit",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"react",
|
|
13
|
+
"SSA UI Kit",
|
|
14
|
+
"ui"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/ssagroup/ui-kit.git",
|
|
19
|
+
"directory": "packages/core"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@emotion/jest": "^11.11.0",
|
|
23
|
+
"@nivo/line": "0.83.0",
|
|
24
|
+
"@playwright/test": "^1.37.1",
|
|
25
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
26
|
+
"@types/testing-library__jest-dom": "^5.14.6",
|
|
27
|
+
"@types/uuid": "^9.0.3",
|
|
28
|
+
"resolve-tspaths": "^0.8.16",
|
|
29
|
+
"storybook-addon-pseudo-states": "^2.1.0",
|
|
30
|
+
"terser-webpack-plugin": "^5.3.9",
|
|
31
|
+
"webpack": "^5.85.0"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@emotion/core": "^11.0.0",
|
|
35
|
+
"@emotion/css": "^11.11.2",
|
|
36
|
+
"@emotion/react": "^11.11.1",
|
|
37
|
+
"@emotion/styled": "^11.11.0",
|
|
38
|
+
"@floating-ui/react": "0.25.4",
|
|
39
|
+
"dotenv": "^16.0.3",
|
|
40
|
+
"js-tokens": "^4.0.0",
|
|
41
|
+
"loose-envify": "^1.4.0",
|
|
42
|
+
"scheduler": "^0.23.0",
|
|
43
|
+
"uuid": "^9.0.0",
|
|
44
|
+
"@ssa-ui-kit/utils": "^0.0.1-alpha",
|
|
45
|
+
"@ssa-ui-kit/hooks": "^0.0.1-alpha"
|
|
46
|
+
},
|
|
47
|
+
"browserslist": [
|
|
48
|
+
">0.1%",
|
|
49
|
+
"not dead",
|
|
50
|
+
"not op_mini all"
|
|
51
|
+
],
|
|
52
|
+
"peerDependencies": {
|
|
53
|
+
"@emotion/core": "^11.0.0",
|
|
54
|
+
"@emotion/css": "^11.11.0",
|
|
55
|
+
"@emotion/react": "^11.10.5",
|
|
56
|
+
"@emotion/styled": "^11.10.5",
|
|
57
|
+
"react": "18.x",
|
|
58
|
+
"react-dom": "18.x",
|
|
59
|
+
"react-hook-form": "^7.46.1"
|
|
60
|
+
},
|
|
61
|
+
"peerDependenciesMeta": {
|
|
62
|
+
"@types/react": {
|
|
63
|
+
"optional": true
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"scripts": {
|
|
67
|
+
"test": "jest -i --no-cache",
|
|
68
|
+
"build": "webpack --mode=production --node-env=production && tsc --build --force ./tsconfig.build.json && resolve-tspaths -p ./tsconfig.build.json",
|
|
69
|
+
"sb:dev": "storybook dev -p 6006",
|
|
70
|
+
"sb:build": "storybook build",
|
|
71
|
+
"test:e2e": "pnpm exec playwright test --project=chromium",
|
|
72
|
+
"test:e2e:ui": "pnpm exec playwright test --project=chromium --ui",
|
|
73
|
+
"test:e2e:debug": "pnpm exec playwright test --project=chromium --debug",
|
|
74
|
+
"ts-show-config-build": "tsc --showConfig -p ./tsconfig.build.json",
|
|
75
|
+
"ts-show-config": "tsc --showConfig -p ./tsconfig.json",
|
|
76
|
+
"ts-check": "tsc --noEmit -p ./tsconfig.json",
|
|
77
|
+
"ts-check-build": "tsc -p ./tsconfig.build.json"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import CardBase from '@components/Card/CardBase';
|
|
2
|
+
import { AccordionViewProps } from './types';
|
|
3
|
+
import { wrapperStyles } from './styles';
|
|
4
|
+
|
|
5
|
+
export const Accordion = ({
|
|
6
|
+
title,
|
|
7
|
+
isOpened,
|
|
8
|
+
ariaControls,
|
|
9
|
+
id,
|
|
10
|
+
size = 'empty',
|
|
11
|
+
renderTitle,
|
|
12
|
+
renderContent,
|
|
13
|
+
onClick,
|
|
14
|
+
...rest
|
|
15
|
+
}: AccordionViewProps) => (
|
|
16
|
+
<CardBase
|
|
17
|
+
role="region"
|
|
18
|
+
tabIndex={0}
|
|
19
|
+
title={title}
|
|
20
|
+
css={wrapperStyles[size]}
|
|
21
|
+
{...rest}>
|
|
22
|
+
{renderTitle({ id, isOpened, title, size, ariaControls, onClick })}
|
|
23
|
+
{renderContent({
|
|
24
|
+
id: `${ariaControls}`,
|
|
25
|
+
isOpened,
|
|
26
|
+
size,
|
|
27
|
+
...{ ['aria-labelledby']: `${id}` },
|
|
28
|
+
})}
|
|
29
|
+
</CardBase>
|
|
30
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import CardContent from '@components/CardContent';
|
|
2
|
+
import { RenderContentProps } from './types';
|
|
3
|
+
import { createContentStyles } from './styles';
|
|
4
|
+
import { useTheme } from '@emotion/react';
|
|
5
|
+
|
|
6
|
+
export const AccordionContent = ({
|
|
7
|
+
isOpened,
|
|
8
|
+
children,
|
|
9
|
+
size = 'empty',
|
|
10
|
+
...rest
|
|
11
|
+
}: RenderContentProps & {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}) => {
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
const styles = createContentStyles(theme, isOpened);
|
|
16
|
+
return (
|
|
17
|
+
<CardContent css={styles[size]} {...rest}>
|
|
18
|
+
{children}
|
|
19
|
+
</CardContent>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { createContext, useState, useContext } from 'react';
|
|
2
|
+
import { AccordionProps, IAccordionGroupContext } from './types';
|
|
3
|
+
|
|
4
|
+
export const AccordionGroupContext = createContext<IAccordionGroupContext>(
|
|
5
|
+
{} as IAccordionGroupContext,
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
export const useAccordionGroupContext = () => useContext(AccordionGroupContext);
|
|
9
|
+
|
|
10
|
+
const useAccordionGroup = (): IAccordionGroupContext => {
|
|
11
|
+
const [openedAccordions, setOpenedAccordions] = useState<AccordionProps[]>(
|
|
12
|
+
[],
|
|
13
|
+
);
|
|
14
|
+
const [stayOpen, setStayOpen] = useState<boolean>(false);
|
|
15
|
+
|
|
16
|
+
const toggleOpenedAccordion = (accordion: AccordionProps) => {
|
|
17
|
+
const isOpened = !!openedAccordions.find(
|
|
18
|
+
(activeAccordion) => activeAccordion.id === accordion.id,
|
|
19
|
+
);
|
|
20
|
+
if (stayOpen) {
|
|
21
|
+
const newOpenedAccordions = isOpened
|
|
22
|
+
? openedAccordions.filter(
|
|
23
|
+
(activeAccordion) => activeAccordion.id !== accordion.id,
|
|
24
|
+
)
|
|
25
|
+
: openedAccordions.concat([accordion]);
|
|
26
|
+
setOpenedAccordions(newOpenedAccordions);
|
|
27
|
+
} else {
|
|
28
|
+
setOpenedAccordions(isOpened ? [] : [accordion]);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
openedAccordions,
|
|
34
|
+
stayOpen,
|
|
35
|
+
setOpenedAccordions,
|
|
36
|
+
toggleOpenedAccordion,
|
|
37
|
+
setStayOpen,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const AccordionGroupContextProvider = ({
|
|
42
|
+
children,
|
|
43
|
+
}: {
|
|
44
|
+
children: React.ReactNode;
|
|
45
|
+
}) => {
|
|
46
|
+
const {
|
|
47
|
+
openedAccordions,
|
|
48
|
+
stayOpen,
|
|
49
|
+
setOpenedAccordions,
|
|
50
|
+
toggleOpenedAccordion,
|
|
51
|
+
setStayOpen,
|
|
52
|
+
} = useAccordionGroup();
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<AccordionGroupContext.Provider
|
|
56
|
+
value={{
|
|
57
|
+
openedAccordions,
|
|
58
|
+
stayOpen,
|
|
59
|
+
setOpenedAccordions,
|
|
60
|
+
toggleOpenedAccordion,
|
|
61
|
+
setStayOpen,
|
|
62
|
+
}}>
|
|
63
|
+
{children}
|
|
64
|
+
</AccordionGroupContext.Provider>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { within } from '@testing-library/dom';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { screen } from '@testing-library/dom';
|
|
4
|
+
|
|
5
|
+
import { AccordionGroupContextProvider } from './AccordionContext';
|
|
6
|
+
import { AccordionSize } from './types';
|
|
7
|
+
import { AccordionTemplate } from './stories/helpers';
|
|
8
|
+
|
|
9
|
+
interface AccordionTest {
|
|
10
|
+
id: string;
|
|
11
|
+
ariaControls: string;
|
|
12
|
+
title: string;
|
|
13
|
+
text: string;
|
|
14
|
+
opened: boolean;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface ComponentAccordionTests {
|
|
18
|
+
(
|
|
19
|
+
describeBlockName: string,
|
|
20
|
+
size: AccordionSize,
|
|
21
|
+
getAccordionText: (accordion: AccordionTest) => string,
|
|
22
|
+
): void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const ACCORDIONS_COUNT = 3;
|
|
26
|
+
const accordions: Array<AccordionTest> = [
|
|
27
|
+
{
|
|
28
|
+
id: 'first',
|
|
29
|
+
ariaControls: 'first-panel',
|
|
30
|
+
title: 'Basic',
|
|
31
|
+
opened: false,
|
|
32
|
+
text: 'BasicCarrot upLorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend, dui in commodo porttitor, neque metus lobortis sem, at suscipit arcu ligula non enim.',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'second',
|
|
36
|
+
ariaControls: 'second-panel',
|
|
37
|
+
title: 'Advanced',
|
|
38
|
+
opened: true,
|
|
39
|
+
text: 'AdvancedCarrot downLorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend, dui in commodo porttitor, neque metus lobortis sem, at suscipit arcu ligula non enim.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 'third',
|
|
43
|
+
ariaControls: 'third-panel',
|
|
44
|
+
title: 'Indicator',
|
|
45
|
+
opened: false,
|
|
46
|
+
text: 'BasicCarrot upLorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris eleifend, dui in commodo porttitor, neque metus lobortis sem, at suscipit arcu ligula non enim.',
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
const componentAccordionTests: ComponentAccordionTests = (
|
|
51
|
+
describeBlockName,
|
|
52
|
+
size,
|
|
53
|
+
getAccordionText,
|
|
54
|
+
) => {
|
|
55
|
+
const checkAccordionPanel = (
|
|
56
|
+
accordion: AccordionTest,
|
|
57
|
+
accordionEl: HTMLElement,
|
|
58
|
+
) => {
|
|
59
|
+
expect(accordionEl).toHaveAttribute('id', accordion.id);
|
|
60
|
+
expect(accordionEl).toHaveAttribute(
|
|
61
|
+
'aria-controls',
|
|
62
|
+
accordion.ariaControls,
|
|
63
|
+
);
|
|
64
|
+
expect(accordionEl).toHaveTextContent('BasicCarrot down');
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
describe(describeBlockName, () => {
|
|
68
|
+
function setup(params: Parameters<typeof AccordionTemplate>[0] = {}) {
|
|
69
|
+
return {
|
|
70
|
+
user: userEvent.setup(),
|
|
71
|
+
...render(
|
|
72
|
+
<AccordionGroupContextProvider>
|
|
73
|
+
<AccordionTemplate size={size} {...params} />
|
|
74
|
+
</AccordionGroupContextProvider>,
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
it('Renders AccordionGroup', () => {
|
|
80
|
+
const { getByTestId } = setup();
|
|
81
|
+
const accordionListElement = getByTestId('accordion-group');
|
|
82
|
+
const accordionEls = within(accordionListElement).getAllByRole('region');
|
|
83
|
+
|
|
84
|
+
expect(accordionEls.length).toBe(ACCORDIONS_COUNT);
|
|
85
|
+
expect(screen.getAllByRole('region').length).toBe(ACCORDIONS_COUNT);
|
|
86
|
+
|
|
87
|
+
for (let i = 0; i < accordions.length - 1; ++i) {
|
|
88
|
+
const accordion = accordions[i];
|
|
89
|
+
const accordionGroupEl = accordionEls[i];
|
|
90
|
+
const accordionTitleEl = within(accordionEls[i]).getByTestId(
|
|
91
|
+
'accordion-title',
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
expect(accordionTitleEl).toHaveAttribute('id', accordion.id);
|
|
95
|
+
expect(accordionTitleEl).toHaveAttribute(
|
|
96
|
+
'aria-expanded',
|
|
97
|
+
`${accordion.opened}`,
|
|
98
|
+
);
|
|
99
|
+
expect(accordionGroupEl).toHaveAttribute('tabindex', '0');
|
|
100
|
+
expect(accordionTitleEl).toHaveAttribute(
|
|
101
|
+
'aria-controls',
|
|
102
|
+
accordion.ariaControls,
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const textContents = getAccordionText(accordion);
|
|
106
|
+
|
|
107
|
+
expect(accordionGroupEl).toHaveTextContent(textContents);
|
|
108
|
+
expect(accordionGroupEl.getAttribute('title')).toEqual(accordion.title);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("Marks an accordion #1 as active and accordion #2 as inactive when they're clicked [accordionStayOpen = true]", async () => {
|
|
113
|
+
const { user } = setup();
|
|
114
|
+
let accordionListElement = screen.getByTestId('accordion-group');
|
|
115
|
+
const chapterTitle = accordionListElement.querySelectorAll('button');
|
|
116
|
+
|
|
117
|
+
await user.click(chapterTitle[0]);
|
|
118
|
+
await user.click(chapterTitle[1]);
|
|
119
|
+
|
|
120
|
+
accordionListElement = screen.getByTestId('accordion-group');
|
|
121
|
+
const accordionEls = within(accordionListElement).getAllByRole('region');
|
|
122
|
+
|
|
123
|
+
for (let i = 0; i < accordions.length; ++i) {
|
|
124
|
+
const accordion = accordions[i];
|
|
125
|
+
const accordionGroupEl = accordionEls[i];
|
|
126
|
+
const accordionTitleEl = within(accordionEls[i]).getByTestId(
|
|
127
|
+
'accordion-title',
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
if (i === 0) {
|
|
131
|
+
expect(accordionTitleEl).toHaveAttribute('aria-expanded', 'true');
|
|
132
|
+
|
|
133
|
+
checkAccordionPanel(accordion, accordionTitleEl);
|
|
134
|
+
} else {
|
|
135
|
+
expect(accordionTitleEl).toHaveAttribute('aria-expanded', 'false');
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
expect(accordionTitleEl).toHaveAttribute('id', accordion.id);
|
|
139
|
+
expect(accordionGroupEl).toHaveAttribute('tabindex', '0');
|
|
140
|
+
expect(accordionTitleEl).toHaveAttribute(
|
|
141
|
+
'aria-controls',
|
|
142
|
+
accordions[i].ariaControls,
|
|
143
|
+
);
|
|
144
|
+
expect(accordionGroupEl.getAttribute('title')).toEqual(accordion.title);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('Marks an accordion #1 as active and accordion #2 as inactive when clicked on accordion #1 [accordionStayOpen = false]', async () => {
|
|
149
|
+
const { user } = setup({ accordionsStayOpen: false });
|
|
150
|
+
const accordionListElement = screen.getByTestId('accordion-group');
|
|
151
|
+
const chapterTitle = accordionListElement.querySelectorAll('button');
|
|
152
|
+
|
|
153
|
+
await user.click(chapterTitle[0]);
|
|
154
|
+
|
|
155
|
+
const accordionEls = within(accordionListElement).getAllByRole('region');
|
|
156
|
+
|
|
157
|
+
for (let i = 0; i < accordions.length; ++i) {
|
|
158
|
+
const accordion = accordions[i];
|
|
159
|
+
const accordionGroupEl = accordionEls[i];
|
|
160
|
+
const accordionTitleEl = within(accordionEls[i]).getByTestId(
|
|
161
|
+
'accordion-title',
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
if (i === 0) {
|
|
165
|
+
expect(accordionTitleEl).toHaveAttribute('aria-expanded', 'true');
|
|
166
|
+
|
|
167
|
+
checkAccordionPanel(accordion, accordionTitleEl);
|
|
168
|
+
} else {
|
|
169
|
+
expect(accordionTitleEl).toHaveAttribute('aria-expanded', 'false');
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
expect(accordionTitleEl).toHaveAttribute('id', accordion.id);
|
|
173
|
+
expect(accordionGroupEl).toHaveAttribute('tabindex', '0');
|
|
174
|
+
expect(accordionTitleEl).toHaveAttribute(
|
|
175
|
+
'aria-controls',
|
|
176
|
+
accordions[i].ariaControls,
|
|
177
|
+
);
|
|
178
|
+
expect(accordionTitleEl.textContent).toEqual(
|
|
179
|
+
`${accordion.title}Carrot ${i === 0 ? 'down' : 'up'}`,
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
describe('AccordionGroup', () => {
|
|
187
|
+
componentAccordionTests('Large', 'large', (accordion) => accordion.text);
|
|
188
|
+
componentAccordionTests('Medium', 'medium', (accordion) => accordion.text);
|
|
189
|
+
componentAccordionTests('Small', 'small', (accordion) => accordion.text);
|
|
190
|
+
componentAccordionTests('Empty', 'empty', (accordion) => accordion.text);
|
|
191
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import {
|
|
3
|
+
Children,
|
|
4
|
+
cloneElement,
|
|
5
|
+
isValidElement,
|
|
6
|
+
useEffect,
|
|
7
|
+
useLayoutEffect,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import { useAccordionGroupContext } from './AccordionContext';
|
|
10
|
+
import { AccordionGroupProps, AccordionProps } from './types';
|
|
11
|
+
|
|
12
|
+
const AccordionBase = styled.div``;
|
|
13
|
+
|
|
14
|
+
export const AccordionGroup = ({
|
|
15
|
+
children,
|
|
16
|
+
size = 'empty',
|
|
17
|
+
accordionsStayOpen = true,
|
|
18
|
+
...rest
|
|
19
|
+
}: AccordionGroupProps) => {
|
|
20
|
+
const {
|
|
21
|
+
openedAccordions,
|
|
22
|
+
setOpenedAccordions,
|
|
23
|
+
toggleOpenedAccordion,
|
|
24
|
+
setStayOpen,
|
|
25
|
+
} = useAccordionGroupContext();
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
setStayOpen(accordionsStayOpen);
|
|
29
|
+
}, []);
|
|
30
|
+
|
|
31
|
+
useLayoutEffect(() => {
|
|
32
|
+
const initialAccordions: AccordionProps[] = [];
|
|
33
|
+
Children.map(children, (child) => {
|
|
34
|
+
if (isValidElement(child) && child.props.isOpened) {
|
|
35
|
+
const { renderContent, renderTitle, ...rest } = child.props;
|
|
36
|
+
initialAccordions.push({
|
|
37
|
+
id: rest.id,
|
|
38
|
+
renderContent: renderContent.bind(null, rest),
|
|
39
|
+
renderTitle: renderTitle.bind(null, rest),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
setOpenedAccordions(initialAccordions);
|
|
44
|
+
}, []);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<AccordionBase data-testid="accordion-group" tabIndex={0} {...rest}>
|
|
48
|
+
{Children.map(children, (child) => {
|
|
49
|
+
if (isValidElement(child)) {
|
|
50
|
+
const { renderContent, renderTitle, ...rest } = child.props;
|
|
51
|
+
const id = rest.id;
|
|
52
|
+
const isOpened = !!openedAccordions?.find(
|
|
53
|
+
(activeAccordion) => activeAccordion.id === id,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
return cloneElement(child, {
|
|
57
|
+
key: id,
|
|
58
|
+
isOpened,
|
|
59
|
+
size,
|
|
60
|
+
onClick: () =>
|
|
61
|
+
toggleOpenedAccordion({
|
|
62
|
+
id,
|
|
63
|
+
renderContent: renderContent.bind(null, rest),
|
|
64
|
+
renderTitle: renderTitle.bind(null, rest),
|
|
65
|
+
}),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
})}
|
|
69
|
+
</AccordionBase>
|
|
70
|
+
);
|
|
71
|
+
};
|