@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,39 @@
|
|
|
1
|
+
import { CommonProps } from '@global-types/emotion';
|
|
2
|
+
|
|
3
|
+
export interface ITab extends CommonProps {
|
|
4
|
+
tabId: number | string;
|
|
5
|
+
renderContent: (
|
|
6
|
+
tab?: {
|
|
7
|
+
tabId: number | string;
|
|
8
|
+
// text: string;
|
|
9
|
+
// renderContent: () => ReactNode;
|
|
10
|
+
[prop: string | number | symbol]: unknown;
|
|
11
|
+
},
|
|
12
|
+
arg?: unknown,
|
|
13
|
+
) => React.ReactNode;
|
|
14
|
+
[prop: string | number | symbol]: unknown;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ITabProps extends ITab {
|
|
18
|
+
isActive?: boolean;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
ariaControls?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface ISmallTabProps extends ITabProps {
|
|
24
|
+
text: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ILargeTabProps extends ITabProps {
|
|
28
|
+
topText: string;
|
|
29
|
+
bottomText: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ITabBarProps {
|
|
33
|
+
children: React.ReactElement<React.PropsWithChildren<ITabProps>>[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface ITabBarContext {
|
|
37
|
+
activeTab?: ITab;
|
|
38
|
+
setActiveTab: (tab?: ITab) => void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { act } from 'react-dom/test-utils';
|
|
2
|
+
import Table from '@components/Table';
|
|
3
|
+
import TableHead from '@components/TableHead';
|
|
4
|
+
import TableRow from '@components/TableRow';
|
|
5
|
+
import TableCell from '@components/TableCell';
|
|
6
|
+
import TableBody from '@components/TableBody';
|
|
7
|
+
import { fireEvent } from '@storybook/testing-library';
|
|
8
|
+
import { SortableTable } from './stories/SortableTable';
|
|
9
|
+
import { screen } from '../../../customTest';
|
|
10
|
+
|
|
11
|
+
describe('Table', () => {
|
|
12
|
+
it('Render table', () => {
|
|
13
|
+
render(
|
|
14
|
+
<Table>
|
|
15
|
+
<TableHead>
|
|
16
|
+
<TableRow>
|
|
17
|
+
<TableCell>Col</TableCell>
|
|
18
|
+
<TableCell>Col</TableCell>
|
|
19
|
+
<TableCell align="center">Col 3</TableCell>
|
|
20
|
+
</TableRow>
|
|
21
|
+
</TableHead>
|
|
22
|
+
<TableBody>
|
|
23
|
+
<TableRow>
|
|
24
|
+
<TableCell>Row</TableCell>
|
|
25
|
+
<TableCell>Row</TableCell>
|
|
26
|
+
<TableCell align="center">Row</TableCell>
|
|
27
|
+
</TableRow>
|
|
28
|
+
<TableRow>
|
|
29
|
+
<TableCell>Row 2</TableCell>
|
|
30
|
+
<TableCell>Row</TableCell>
|
|
31
|
+
<TableCell align="center">Row 2</TableCell>
|
|
32
|
+
</TableRow>
|
|
33
|
+
</TableBody>
|
|
34
|
+
</Table>,
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const table = screen.getByRole('table');
|
|
38
|
+
const cells = screen.queryAllByRole('cell');
|
|
39
|
+
|
|
40
|
+
expect(table).toBeInTheDocument();
|
|
41
|
+
expect(cells.length).toEqual(9);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe('Sorting Table', () => {
|
|
45
|
+
it('Render table', () => {
|
|
46
|
+
render(<SortableTable />);
|
|
47
|
+
|
|
48
|
+
const cells = screen.queryAllByRole('cell');
|
|
49
|
+
|
|
50
|
+
expect(screen.getByRole('table')).toBeInTheDocument();
|
|
51
|
+
expect(screen.getByTitle('Arrow Down')).toBeInTheDocument();
|
|
52
|
+
expect(cells.length).toEqual(33);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('Should change sorting correctly', () => {
|
|
56
|
+
const callback = jest.fn();
|
|
57
|
+
render(<SortableTable onSortingChange={callback} />);
|
|
58
|
+
|
|
59
|
+
const cells = screen.queryAllByRole('cell');
|
|
60
|
+
|
|
61
|
+
act(() => {
|
|
62
|
+
fireEvent.click(cells[0]);
|
|
63
|
+
});
|
|
64
|
+
expect(callback).toHaveBeenLastCalledWith({
|
|
65
|
+
column: 'title',
|
|
66
|
+
order: 'asc',
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
act(() => {
|
|
70
|
+
fireEvent.click(cells[0]);
|
|
71
|
+
});
|
|
72
|
+
expect(callback).toHaveBeenLastCalledWith({
|
|
73
|
+
column: 'title',
|
|
74
|
+
order: 'desc',
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
act(() => {
|
|
78
|
+
fireEvent.click(cells[0]);
|
|
79
|
+
});
|
|
80
|
+
expect(callback).toHaveBeenLastCalledWith({
|
|
81
|
+
column: 'title',
|
|
82
|
+
order: 'asc',
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import { CommonProps } from '@global-types/emotion';
|
|
3
|
+
|
|
4
|
+
const Table = styled.table<CommonProps>`
|
|
5
|
+
display: table;
|
|
6
|
+
|
|
7
|
+
width: 100%;
|
|
8
|
+
|
|
9
|
+
border-collapse: collapse;
|
|
10
|
+
border-spacing: 0;
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export default Table;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Table';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import Icon from '@components/Icon';
|
|
3
|
+
import Wrapper from '@components/Wrapper';
|
|
4
|
+
import Table from '@components/Table';
|
|
5
|
+
import TableHead from '@components/TableHead';
|
|
6
|
+
import TableRow from '@components/TableRow';
|
|
7
|
+
import TableCell from '@components/TableCell';
|
|
8
|
+
import TableBody from '@components/TableBody';
|
|
9
|
+
import { RowKeys, headers, dataForTableSorting } from './mock';
|
|
10
|
+
import { capitalizeFirstLetter } from './utils';
|
|
11
|
+
import { SortInfo } from './types';
|
|
12
|
+
import { DEFAULT_SORT } from './consts';
|
|
13
|
+
|
|
14
|
+
export const SortableTable = ({
|
|
15
|
+
onSortingChange,
|
|
16
|
+
}: {
|
|
17
|
+
onSortingChange?: (sortInfo: SortInfo) => void;
|
|
18
|
+
}) => {
|
|
19
|
+
const [sortInfo, setSortInfo] = useState<SortInfo>(DEFAULT_SORT);
|
|
20
|
+
|
|
21
|
+
const handleSorting = (name: RowKeys) => () => {
|
|
22
|
+
const newOrder =
|
|
23
|
+
sortInfo.column === name
|
|
24
|
+
? sortInfo.order === 'asc'
|
|
25
|
+
? 'desc'
|
|
26
|
+
: 'asc'
|
|
27
|
+
: 'asc';
|
|
28
|
+
|
|
29
|
+
const newSortInfo: SortInfo = {
|
|
30
|
+
column: name,
|
|
31
|
+
order: newOrder,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
setSortInfo(newSortInfo);
|
|
35
|
+
onSortingChange?.(newSortInfo);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Table>
|
|
40
|
+
<TableHead>
|
|
41
|
+
<TableRow>
|
|
42
|
+
{headers.map((name) => (
|
|
43
|
+
<TableCell
|
|
44
|
+
key={name}
|
|
45
|
+
css={{
|
|
46
|
+
gap: 6,
|
|
47
|
+
cursor: 'pointer',
|
|
48
|
+
}}
|
|
49
|
+
onClick={handleSorting(name)}>
|
|
50
|
+
<Wrapper
|
|
51
|
+
css={{
|
|
52
|
+
gap: 6,
|
|
53
|
+
}}>
|
|
54
|
+
{capitalizeFirstLetter(name)}
|
|
55
|
+
{sortInfo.column === name && (
|
|
56
|
+
<Icon
|
|
57
|
+
name={sortInfo.order === 'asc' ? 'arrow-up' : 'arrow-down'}
|
|
58
|
+
size={10}
|
|
59
|
+
data-testId="sort-icon"
|
|
60
|
+
/>
|
|
61
|
+
)}
|
|
62
|
+
</Wrapper>
|
|
63
|
+
</TableCell>
|
|
64
|
+
))}
|
|
65
|
+
</TableRow>
|
|
66
|
+
</TableHead>
|
|
67
|
+
<TableBody>
|
|
68
|
+
{dataForTableSorting.map((info) => (
|
|
69
|
+
<TableRow key={`row-${info.value}`}>
|
|
70
|
+
<TableCell>{info.title}</TableCell>
|
|
71
|
+
<TableCell>{info.value}</TableCell>
|
|
72
|
+
<TableCell>{info.description}</TableCell>
|
|
73
|
+
</TableRow>
|
|
74
|
+
))}
|
|
75
|
+
</TableBody>
|
|
76
|
+
</Table>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { css } from '@emotion/react';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
import {
|
|
5
|
+
Title,
|
|
6
|
+
Subtitle,
|
|
7
|
+
Description,
|
|
8
|
+
Primary,
|
|
9
|
+
Stories,
|
|
10
|
+
} from '@storybook/addon-docs';
|
|
11
|
+
|
|
12
|
+
import Badge from '@components/Badge';
|
|
13
|
+
import Icon from '@components/Icon';
|
|
14
|
+
import Wrapper from '@components/Wrapper';
|
|
15
|
+
import Table from '@components/Table';
|
|
16
|
+
import TableHead from '@components/TableHead';
|
|
17
|
+
import TableRow from '@components/TableRow';
|
|
18
|
+
import TableCell from '@components/TableCell';
|
|
19
|
+
import TableBody from '@components/TableBody';
|
|
20
|
+
import { SortableTable } from './SortableTable';
|
|
21
|
+
import { SortInfo } from './types';
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
title: 'Components/Table',
|
|
25
|
+
component: Table,
|
|
26
|
+
parameters: {
|
|
27
|
+
controls: { disable: true },
|
|
28
|
+
docs: {
|
|
29
|
+
source: {
|
|
30
|
+
type: 'code',
|
|
31
|
+
},
|
|
32
|
+
page: () => (
|
|
33
|
+
<Fragment>
|
|
34
|
+
<Title />
|
|
35
|
+
<Subtitle />
|
|
36
|
+
<Description />
|
|
37
|
+
<Primary />
|
|
38
|
+
<Stories />
|
|
39
|
+
</Fragment>
|
|
40
|
+
),
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
} as Meta<typeof Table>;
|
|
44
|
+
|
|
45
|
+
export const Default: StoryObj<typeof Table> = () => {
|
|
46
|
+
return (
|
|
47
|
+
<Table>
|
|
48
|
+
<TableHead>
|
|
49
|
+
<TableRow>
|
|
50
|
+
<TableCell>Col</TableCell>
|
|
51
|
+
<TableCell>
|
|
52
|
+
<Wrapper
|
|
53
|
+
css={css`
|
|
54
|
+
svg {
|
|
55
|
+
margin-right: 10px;
|
|
56
|
+
}
|
|
57
|
+
`}>
|
|
58
|
+
<Icon name="calendar" size={16} />
|
|
59
|
+
Col
|
|
60
|
+
</Wrapper>
|
|
61
|
+
</TableCell>
|
|
62
|
+
<TableCell align="center">Col 3</TableCell>
|
|
63
|
+
</TableRow>
|
|
64
|
+
</TableHead>
|
|
65
|
+
<TableBody>
|
|
66
|
+
<TableRow>
|
|
67
|
+
<TableCell>Row</TableCell>
|
|
68
|
+
<TableCell>
|
|
69
|
+
<Badge>Row</Badge>
|
|
70
|
+
</TableCell>
|
|
71
|
+
<TableCell align="center">Row</TableCell>
|
|
72
|
+
</TableRow>
|
|
73
|
+
<TableRow>
|
|
74
|
+
<TableCell>Row 2</TableCell>
|
|
75
|
+
<TableCell>
|
|
76
|
+
<Badge color="green">Row 2</Badge>
|
|
77
|
+
</TableCell>
|
|
78
|
+
<TableCell align="center">Row 2</TableCell>
|
|
79
|
+
</TableRow>
|
|
80
|
+
</TableBody>
|
|
81
|
+
</Table>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
Default.storyName = 'Table';
|
|
86
|
+
|
|
87
|
+
export const TableSorting: StoryObj<typeof Table> = () => {
|
|
88
|
+
const handleSortingChange = (sortInfo: SortInfo) => {
|
|
89
|
+
alert('Sorting changed to ' + JSON.stringify(sortInfo));
|
|
90
|
+
};
|
|
91
|
+
return <SortableTable onSortingChange={handleSortingChange} />;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
TableSorting.args = {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RowKeysArray } from './types';
|
|
2
|
+
|
|
3
|
+
export const dataForTableSorting = Array.from({ length: 10 }).map(
|
|
4
|
+
(_, index) => ({
|
|
5
|
+
title: `title ${index + 1}`,
|
|
6
|
+
value: `value ${index + 1}`,
|
|
7
|
+
description: `description ${index + 1}`,
|
|
8
|
+
}),
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export const headers = Object.keys(
|
|
12
|
+
dataForTableSorting[0],
|
|
13
|
+
) as unknown as RowKeysArray;
|
|
14
|
+
|
|
15
|
+
type DataRow = (typeof dataForTableSorting)[0];
|
|
16
|
+
export type RowKeys = keyof DataRow;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableBody';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import { CommonProps } from '@global-types/emotion';
|
|
3
|
+
|
|
4
|
+
const TableCell = styled.td<{ align?: string } & CommonProps>`
|
|
5
|
+
display: table-cell;
|
|
6
|
+
|
|
7
|
+
vertical-align: inherit;
|
|
8
|
+
text-align: ${({ align }) => (align ? align : 'left')};
|
|
9
|
+
|
|
10
|
+
border-bottom: 1px solid #eef1f7;
|
|
11
|
+
border-right: 1px solid #eef1f7;
|
|
12
|
+
|
|
13
|
+
padding: 14px;
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
export default TableCell;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableCell';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
|
|
3
|
+
import TableCell from '@components/TableCell';
|
|
4
|
+
import { CommonProps } from '@global-types/emotion';
|
|
5
|
+
|
|
6
|
+
const TableHead = styled.thead<CommonProps>({
|
|
7
|
+
display: 'table-header-group',
|
|
8
|
+
background: '#eef1f7',
|
|
9
|
+
[`& ${TableCell}`]: {
|
|
10
|
+
borderBottom: '1px solid white',
|
|
11
|
+
borderRight: '1px solid white',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default TableHead;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableHead';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableRow';
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { screen } from '../../../customTest';
|
|
2
|
+
import Tag from '@components/Tag';
|
|
3
|
+
import theme from '@themes/main';
|
|
4
|
+
|
|
5
|
+
describe('tag', () => {
|
|
6
|
+
it('Render small size', () => {
|
|
7
|
+
render(
|
|
8
|
+
<Tag color="purple" size="small">
|
|
9
|
+
small
|
|
10
|
+
</Tag>,
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const tag = screen.getByText(/small/i);
|
|
14
|
+
|
|
15
|
+
expect(tag).toHaveStyle('height: 18px');
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('Render with default color', () => {
|
|
19
|
+
render(<Tag size="small">small</Tag>);
|
|
20
|
+
|
|
21
|
+
const tag = screen.getByText(/small/i);
|
|
22
|
+
|
|
23
|
+
expect(tag).toHaveStyle('height: 18px');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('Render medium size', () => {
|
|
27
|
+
render(<Tag color="purple">medium</Tag>);
|
|
28
|
+
|
|
29
|
+
const tag = screen.getByText(/medium/i);
|
|
30
|
+
|
|
31
|
+
expect(tag).toHaveStyle('height: 24px');
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('Render large size', () => {
|
|
35
|
+
render(
|
|
36
|
+
<Tag color="purple" size="large">
|
|
37
|
+
large
|
|
38
|
+
</Tag>,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const tag = screen.getByText(/large/i);
|
|
42
|
+
|
|
43
|
+
expect(tag).toHaveStyle('height: 32px');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('Render with color pink', () => {
|
|
47
|
+
render(<Tag color="pink">tag</Tag>);
|
|
48
|
+
|
|
49
|
+
const tag = screen.getByText(/tag/i);
|
|
50
|
+
|
|
51
|
+
expect(tag).toHaveStyle(`background-color: ${theme.colors.pink20}`);
|
|
52
|
+
expect(tag).toHaveStyle(`border: 1px solid ${theme.colors.pink}`);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('Render with color yellow', () => {
|
|
56
|
+
render(<Tag color="yellow">tag</Tag>);
|
|
57
|
+
|
|
58
|
+
const tag = screen.getByText(/tag/i);
|
|
59
|
+
|
|
60
|
+
expect(tag).toHaveStyle(`background-color: ${theme.colors.yellow20}`);
|
|
61
|
+
expect(tag).toHaveStyle(`border: 1px solid ${theme.colors.yellow}`);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('Render with color yellowWarm', () => {
|
|
65
|
+
render(<Tag color="yellowWarm">tag</Tag>);
|
|
66
|
+
|
|
67
|
+
const tag = screen.getByText(/tag/i);
|
|
68
|
+
|
|
69
|
+
expect(tag).toHaveStyle(
|
|
70
|
+
`background-color: ${theme.colors.yellowLighter20}`,
|
|
71
|
+
);
|
|
72
|
+
expect(tag).toHaveStyle(`border: 1px solid ${theme.colors.yellowWarm}`);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('Render with color green', () => {
|
|
76
|
+
render(<Tag color="green">tag</Tag>);
|
|
77
|
+
|
|
78
|
+
const tag = screen.getByText(/tag/i);
|
|
79
|
+
|
|
80
|
+
expect(tag).toHaveStyle(`background-color: ${theme.colors.green20}`);
|
|
81
|
+
expect(tag).toHaveStyle(`border: 1px solid ${theme.colors.green}`);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('Render with color turquoise', () => {
|
|
85
|
+
render(<Tag color="turquoise">tag</Tag>);
|
|
86
|
+
|
|
87
|
+
const tag = screen.getByText(/tag/i);
|
|
88
|
+
|
|
89
|
+
expect(tag).toHaveStyle(`background-color: ${theme.colors.turquoise20}`);
|
|
90
|
+
expect(tag).toHaveStyle(`border: 1px solid ${theme.colors.turquoise}`);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('Render with color purple', () => {
|
|
94
|
+
render(<Tag color="purple">tag</Tag>);
|
|
95
|
+
|
|
96
|
+
const tag = screen.getByText(/tag/i);
|
|
97
|
+
|
|
98
|
+
expect(tag).toHaveStyle(
|
|
99
|
+
`background-color: ${theme.colors.purpleLighter20}`,
|
|
100
|
+
);
|
|
101
|
+
expect(tag).toHaveStyle(`border: 1px solid ${theme.colors.purple}`);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('Render with color blueLight', () => {
|
|
105
|
+
render(<Tag color="blueLight">tag</Tag>);
|
|
106
|
+
|
|
107
|
+
const tag = screen.getByText(/tag/i);
|
|
108
|
+
|
|
109
|
+
expect(tag).toHaveStyle(`background-color: ${theme.colors.blueLight20}`);
|
|
110
|
+
expect(tag).toHaveStyle(`border: 1px solid ${theme.colors.blueLight}`);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('Render with color blue', () => {
|
|
114
|
+
render(<Tag color="blue">tag</Tag>);
|
|
115
|
+
|
|
116
|
+
const tag = screen.getByText(/tag/i);
|
|
117
|
+
|
|
118
|
+
expect(tag).toHaveStyle(`background-color: ${theme.colors.blue20}`);
|
|
119
|
+
expect(tag).toHaveStyle(`border: 1px solid ${theme.colors.blue}`);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Meta } from '@storybook/react';
|
|
3
|
+
import {
|
|
4
|
+
sizes,
|
|
5
|
+
colors,
|
|
6
|
+
HeaderTitle,
|
|
7
|
+
GridWrapper,
|
|
8
|
+
} from '@components/Badge/helpers';
|
|
9
|
+
import Tag from './index';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Components/Tag',
|
|
13
|
+
component: Tag,
|
|
14
|
+
argTypes: {
|
|
15
|
+
color: {
|
|
16
|
+
table: {
|
|
17
|
+
type: {
|
|
18
|
+
summary: 'string',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
options: [
|
|
22
|
+
'pink',
|
|
23
|
+
'yellow',
|
|
24
|
+
'green',
|
|
25
|
+
'turquoise',
|
|
26
|
+
'purple',
|
|
27
|
+
'blueLight',
|
|
28
|
+
'blue',
|
|
29
|
+
],
|
|
30
|
+
control: {
|
|
31
|
+
type: 'select',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
size: {
|
|
35
|
+
table: {
|
|
36
|
+
type: {
|
|
37
|
+
summary: 'string',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
options: ['small', 'medium', 'large'],
|
|
41
|
+
control: {
|
|
42
|
+
type: 'inline-radio',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
children: {
|
|
46
|
+
table: {
|
|
47
|
+
type: {
|
|
48
|
+
summary: 'string | element',
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
control: {
|
|
52
|
+
type: 'text',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
args: {
|
|
57
|
+
children: 'tag',
|
|
58
|
+
},
|
|
59
|
+
} as Meta<typeof Tag>;
|
|
60
|
+
|
|
61
|
+
export const Default = {};
|
|
62
|
+
|
|
63
|
+
export const AllStates = () => (
|
|
64
|
+
<GridWrapper>
|
|
65
|
+
<HeaderTitle>Color</HeaderTitle>
|
|
66
|
+
<HeaderTitle>Small</HeaderTitle>
|
|
67
|
+
<HeaderTitle>Medium</HeaderTitle>
|
|
68
|
+
<HeaderTitle>Large</HeaderTitle>
|
|
69
|
+
{colors.map((color) => (
|
|
70
|
+
<React.Fragment key={color}>
|
|
71
|
+
<HeaderTitle>{color}</HeaderTitle>
|
|
72
|
+
{sizes.map((size) => (
|
|
73
|
+
<Tag color={color} size={size} key={color + size}>
|
|
74
|
+
tag
|
|
75
|
+
</Tag>
|
|
76
|
+
))}
|
|
77
|
+
</React.Fragment>
|
|
78
|
+
))}
|
|
79
|
+
</GridWrapper>
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
AllStates.args = {
|
|
83
|
+
name: 'All States',
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
AllStates.argTypes = {
|
|
87
|
+
color: {
|
|
88
|
+
control: false,
|
|
89
|
+
},
|
|
90
|
+
size: {
|
|
91
|
+
control: false,
|
|
92
|
+
},
|
|
93
|
+
children: {
|
|
94
|
+
control: false,
|
|
95
|
+
},
|
|
96
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import Badge from '@components/Badge';
|
|
2
|
+
import {
|
|
3
|
+
blue,
|
|
4
|
+
green,
|
|
5
|
+
blueLight,
|
|
6
|
+
pink,
|
|
7
|
+
purple,
|
|
8
|
+
turquoise,
|
|
9
|
+
yellow,
|
|
10
|
+
yellowWarm,
|
|
11
|
+
} from './styles';
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
pinkBorder,
|
|
15
|
+
yellowBorder,
|
|
16
|
+
greenBorder,
|
|
17
|
+
turquoiseBorder,
|
|
18
|
+
purpleBorder,
|
|
19
|
+
blueLightBorder,
|
|
20
|
+
blueBorder,
|
|
21
|
+
yellowWarmBorder,
|
|
22
|
+
} from './styles';
|
|
23
|
+
import { TagsProps } from './types';
|
|
24
|
+
|
|
25
|
+
const mapColors: MainColors = {
|
|
26
|
+
pink: [pink, pinkBorder],
|
|
27
|
+
yellow: [yellow, yellowBorder],
|
|
28
|
+
green: [green, greenBorder],
|
|
29
|
+
turquoise: [turquoise, turquoiseBorder],
|
|
30
|
+
purple: [purple, purpleBorder],
|
|
31
|
+
blueLight: [blueLight, blueLightBorder],
|
|
32
|
+
blue: [blue, blueBorder],
|
|
33
|
+
yellowWarm: [yellowWarm, yellowWarmBorder],
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const Tag = ({
|
|
37
|
+
color = 'purple',
|
|
38
|
+
size = 'medium',
|
|
39
|
+
className,
|
|
40
|
+
children,
|
|
41
|
+
}: TagsProps) => (
|
|
42
|
+
<Badge color={color} size={size} css={mapColors[color]} className={className}>
|
|
43
|
+
{children}
|
|
44
|
+
</Badge>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export default Tag;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Tag';
|