@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,22 @@
|
|
|
1
|
+
import { useTooltip } from './useTooltip';
|
|
2
|
+
import { TooltipContext } from './useTooltipContext';
|
|
3
|
+
import { ITooltipProps } from './types';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* <Tooltip>
|
|
7
|
+
* <TooltipTrigger>
|
|
8
|
+
* <Button />
|
|
9
|
+
* </TooltipTrigger>
|
|
10
|
+
* <TooltipContent>Tooltip</TooltipContent>
|
|
11
|
+
* </Tooltip>
|
|
12
|
+
* */
|
|
13
|
+
const Tooltip = ({ children, ...props }: ITooltipProps) => {
|
|
14
|
+
const tooltip = useTooltip(props);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<TooltipContext.Provider value={tooltip}>
|
|
18
|
+
{children}
|
|
19
|
+
</TooltipContext.Provider>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
export default Tooltip;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useTheme } from '@emotion/react';
|
|
2
|
+
import { FloatingArrow } from '@floating-ui/react';
|
|
3
|
+
import { useTooltipContext } from './useTooltipContext';
|
|
4
|
+
import { TooltipArrowProps } from './types';
|
|
5
|
+
|
|
6
|
+
export const TooltipArrow = ({
|
|
7
|
+
width = 10,
|
|
8
|
+
height = 10,
|
|
9
|
+
fill,
|
|
10
|
+
...props
|
|
11
|
+
}: TooltipArrowProps) => {
|
|
12
|
+
const { context, arrowRef } = useTooltipContext();
|
|
13
|
+
const theme = useTheme();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<FloatingArrow
|
|
17
|
+
data-testid="floating-arrow"
|
|
18
|
+
ref={arrowRef}
|
|
19
|
+
context={context}
|
|
20
|
+
width={width}
|
|
21
|
+
height={height}
|
|
22
|
+
fill={fill || theme.colors.greyLighter}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
|
|
3
|
+
export const TooltipContentBase = styled.div`
|
|
4
|
+
line-height: 0.75rem; /* 12px */
|
|
5
|
+
background: ${({ theme }) => theme.colors.greyLighter};
|
|
6
|
+
border-radius: 8px;
|
|
7
|
+
color: ${({ theme }) => theme.colors.greyDarker};
|
|
8
|
+
font-weight: 600;
|
|
9
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
|
|
3
|
+
export const small = css`
|
|
4
|
+
font-size: 0.579rem; // 9.26px
|
|
5
|
+
padding: 6px 12px;
|
|
6
|
+
`;
|
|
7
|
+
|
|
8
|
+
export const medium = css`
|
|
9
|
+
font-size: 0.694rem; // 11.11px
|
|
10
|
+
padding: 8px 16px;
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export const large = css`
|
|
14
|
+
font-size: 0.833rem; // 13.33px
|
|
15
|
+
padding: 10px 20px;
|
|
16
|
+
`;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useInteractions,
|
|
3
|
+
FloatingArrow,
|
|
4
|
+
Placement,
|
|
5
|
+
UseFloatingReturn,
|
|
6
|
+
} from '@floating-ui/react';
|
|
7
|
+
import { PointTooltipProps, Point } from '@nivo/line';
|
|
8
|
+
import { IMapIcons } from '@components/Icon/types';
|
|
9
|
+
import { ProgressBarProps } from '@components/ProgressBar/types';
|
|
10
|
+
import { SerializedStyles } from '@emotion/react';
|
|
11
|
+
import { CommonProps } from '@global-types/emotion';
|
|
12
|
+
|
|
13
|
+
export type TooltipSize = 'small' | 'medium' | 'large';
|
|
14
|
+
|
|
15
|
+
export interface ITooltipProps extends CommonProps {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
placement?: Placement;
|
|
18
|
+
enableHover?: boolean;
|
|
19
|
+
enableClick?: boolean;
|
|
20
|
+
offsetPx?: number;
|
|
21
|
+
// TooltipContent-related props
|
|
22
|
+
size?: TooltipSize;
|
|
23
|
+
hasArrow?: boolean;
|
|
24
|
+
arrowProps?: TooltipArrowProps;
|
|
25
|
+
isOpen?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type UseTooltipArgs = Omit<ITooltipProps, 'children'>;
|
|
29
|
+
|
|
30
|
+
type UseInteractions = ReturnType<typeof useInteractions>;
|
|
31
|
+
|
|
32
|
+
interface MutableRefObject<T> {
|
|
33
|
+
current: T;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type UseTooltip = (props: UseTooltipArgs) => Pick<
|
|
37
|
+
ITooltipProps,
|
|
38
|
+
'size' | 'hasArrow' | 'arrowProps'
|
|
39
|
+
> & {
|
|
40
|
+
arrowRef: MutableRefObject<null>;
|
|
41
|
+
isOpen: boolean;
|
|
42
|
+
} & UseFloatingReturn &
|
|
43
|
+
UseInteractions;
|
|
44
|
+
|
|
45
|
+
export type TooltipContextType =
|
|
46
|
+
| (UseFloatingReturn &
|
|
47
|
+
ReturnType<typeof useInteractions> & {
|
|
48
|
+
isOpen: boolean;
|
|
49
|
+
arrowRef: React.Ref<SVGSVGElement>;
|
|
50
|
+
} & Pick<ITooltipProps, 'size' | 'hasArrow' | 'arrowProps'>)
|
|
51
|
+
| null;
|
|
52
|
+
|
|
53
|
+
export type TooltipArrowProps = Omit<
|
|
54
|
+
React.ComponentProps<typeof FloatingArrow>,
|
|
55
|
+
'context'
|
|
56
|
+
>;
|
|
57
|
+
|
|
58
|
+
export interface ITooltipContentProps {
|
|
59
|
+
children: React.ReactNode;
|
|
60
|
+
className?: string;
|
|
61
|
+
style?: React.CSSProperties;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface ITooltipContentSizes {
|
|
65
|
+
small: SerializedStyles;
|
|
66
|
+
medium: SerializedStyles;
|
|
67
|
+
large: SerializedStyles;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface ITooltipTriggerProps {
|
|
71
|
+
children: React.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type SimpleChartTooltipProps =
|
|
75
|
+
| PointTooltipProps &
|
|
76
|
+
Pick<ITooltipProps, 'size'> & {
|
|
77
|
+
renderValue?: (data: Point['data']) => React.ReactNode;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export interface IProgressChartTooltipProps {
|
|
81
|
+
caption: string;
|
|
82
|
+
value: number;
|
|
83
|
+
valueFormatted: string;
|
|
84
|
+
iconName?: keyof IMapIcons;
|
|
85
|
+
barProps?: Partial<Omit<ProgressBarProps, 'currentValue'>>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export type UseTooltipContext = () => NonNullable<TooltipContextType>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useState, useMemo, useRef } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
useFloating,
|
|
4
|
+
offset,
|
|
5
|
+
flip,
|
|
6
|
+
shift,
|
|
7
|
+
arrow,
|
|
8
|
+
autoUpdate,
|
|
9
|
+
useHover,
|
|
10
|
+
useClick,
|
|
11
|
+
useDismiss,
|
|
12
|
+
useRole,
|
|
13
|
+
useInteractions,
|
|
14
|
+
} from '@floating-ui/react';
|
|
15
|
+
import { UseTooltip } from './types';
|
|
16
|
+
|
|
17
|
+
export const useTooltip: UseTooltip = ({
|
|
18
|
+
placement,
|
|
19
|
+
enableClick = true,
|
|
20
|
+
enableHover = false,
|
|
21
|
+
offsetPx = 12,
|
|
22
|
+
size = 'small',
|
|
23
|
+
hasArrow = true,
|
|
24
|
+
arrowProps = {},
|
|
25
|
+
isOpen: isInitOpen = false,
|
|
26
|
+
}) => {
|
|
27
|
+
const [isOpen, setIsOpen] = useState(isInitOpen || false);
|
|
28
|
+
const arrowRef = useRef(null);
|
|
29
|
+
|
|
30
|
+
const floatingData = useFloating({
|
|
31
|
+
open: isOpen,
|
|
32
|
+
onOpenChange: setIsOpen,
|
|
33
|
+
placement,
|
|
34
|
+
middleware: [
|
|
35
|
+
offset(offsetPx),
|
|
36
|
+
flip(),
|
|
37
|
+
shift(),
|
|
38
|
+
arrow({
|
|
39
|
+
element: arrowRef,
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
whileElementsMounted: autoUpdate,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const { context } = floatingData;
|
|
46
|
+
|
|
47
|
+
const hover = useHover(context, { enabled: enableHover, move: true });
|
|
48
|
+
const click = useClick(context, { enabled: enableClick });
|
|
49
|
+
const dismiss = useDismiss(context);
|
|
50
|
+
const role = useRole(context);
|
|
51
|
+
|
|
52
|
+
const interactionsData = useInteractions([hover, click, dismiss, role]);
|
|
53
|
+
|
|
54
|
+
return useMemo(
|
|
55
|
+
() => ({
|
|
56
|
+
isOpen,
|
|
57
|
+
arrowRef,
|
|
58
|
+
size,
|
|
59
|
+
hasArrow,
|
|
60
|
+
arrowProps,
|
|
61
|
+
...floatingData,
|
|
62
|
+
...interactionsData,
|
|
63
|
+
}),
|
|
64
|
+
[
|
|
65
|
+
isOpen,
|
|
66
|
+
arrowRef,
|
|
67
|
+
size,
|
|
68
|
+
hasArrow,
|
|
69
|
+
arrowProps,
|
|
70
|
+
floatingData,
|
|
71
|
+
interactionsData,
|
|
72
|
+
],
|
|
73
|
+
);
|
|
74
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import { TooltipContextType, UseTooltipContext } from './types';
|
|
3
|
+
|
|
4
|
+
export const TooltipContext = createContext<TooltipContextType>(null);
|
|
5
|
+
|
|
6
|
+
export const useTooltipContext: UseTooltipContext = () => {
|
|
7
|
+
const tooltipContext = useContext(TooltipContext);
|
|
8
|
+
|
|
9
|
+
if (tooltipContext == null) {
|
|
10
|
+
throw new Error(
|
|
11
|
+
'The component should be wrapped with <Tooltip> to have access to the context',
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return tooltipContext;
|
|
16
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
FloatingPortal,
|
|
4
|
+
FloatingFocusManager,
|
|
5
|
+
useMergeRefs,
|
|
6
|
+
} from '@floating-ui/react';
|
|
7
|
+
|
|
8
|
+
import { TooltipArrow } from '@components/Tooltip/TooltipArrow';
|
|
9
|
+
import { TooltipContentBase } from '@components/Tooltip/TooltipContentBase';
|
|
10
|
+
import { ITooltipContentProps, TooltipSize } from '@components/Tooltip/types';
|
|
11
|
+
import { useTooltipContext } from '@components/Tooltip/useTooltipContext';
|
|
12
|
+
import { mapSizes } from '@components/Tooltip/utils';
|
|
13
|
+
|
|
14
|
+
const TooltipContent = forwardRef<HTMLDivElement, ITooltipContentProps>(
|
|
15
|
+
function TooltipContent({ children, className, style }, refProp) {
|
|
16
|
+
const tooltipCtx = useTooltipContext();
|
|
17
|
+
const ref = useMergeRefs([tooltipCtx?.refs.setFloating, refProp]);
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<FloatingPortal>
|
|
21
|
+
{tooltipCtx?.isOpen && (
|
|
22
|
+
<FloatingFocusManager context={tooltipCtx.context} modal={false}>
|
|
23
|
+
<TooltipContentBase
|
|
24
|
+
{...tooltipCtx.getFloatingProps({
|
|
25
|
+
ref,
|
|
26
|
+
css:
|
|
27
|
+
tooltipCtx.size && mapSizes[tooltipCtx.size as TooltipSize],
|
|
28
|
+
className,
|
|
29
|
+
style: {
|
|
30
|
+
position: tooltipCtx.strategy,
|
|
31
|
+
top: tooltipCtx.y ?? 0,
|
|
32
|
+
left: tooltipCtx.x ?? 0,
|
|
33
|
+
width: 'max-content',
|
|
34
|
+
...style,
|
|
35
|
+
},
|
|
36
|
+
})}>
|
|
37
|
+
{tooltipCtx.hasArrow && (
|
|
38
|
+
<TooltipArrow {...tooltipCtx.arrowProps} />
|
|
39
|
+
)}
|
|
40
|
+
{children}
|
|
41
|
+
</TooltipContentBase>
|
|
42
|
+
</FloatingFocusManager>
|
|
43
|
+
)}
|
|
44
|
+
</FloatingPortal>
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
export default TooltipContent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TooltipContent';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cloneElement, isValidElement } from 'react';
|
|
2
|
+
|
|
3
|
+
import { ITooltipTriggerProps } from '@components/Tooltip/types';
|
|
4
|
+
import { useTooltipContext } from '@components/Tooltip/useTooltipContext';
|
|
5
|
+
|
|
6
|
+
const TooltipTrigger = ({ children }: ITooltipTriggerProps) => {
|
|
7
|
+
const tooltipCtx = useTooltipContext();
|
|
8
|
+
|
|
9
|
+
if (isValidElement(children)) {
|
|
10
|
+
return cloneElement(
|
|
11
|
+
children,
|
|
12
|
+
tooltipCtx?.getReferenceProps({
|
|
13
|
+
ref: tooltipCtx.refs.setReference,
|
|
14
|
+
}),
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return null;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default TooltipTrigger;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TooltipTrigger';
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { createRef } from 'react';
|
|
2
|
+
import { screen } from '../../../customTest';
|
|
3
|
+
import Typography from './index';
|
|
4
|
+
|
|
5
|
+
describe('Typography', () => {
|
|
6
|
+
it('Render Typography h1 with correct font-size and weight', () => {
|
|
7
|
+
render(<Typography variant="h1">text regular</Typography>);
|
|
8
|
+
|
|
9
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
10
|
+
|
|
11
|
+
expect(textRegular).toHaveStyle(`font-size: 2.488rem`);
|
|
12
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
13
|
+
|
|
14
|
+
render(
|
|
15
|
+
<Typography variant="h1" weight="bold">
|
|
16
|
+
text bold
|
|
17
|
+
</Typography>,
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const textBold = screen.getByText(/text bold/i);
|
|
21
|
+
|
|
22
|
+
expect(textBold).toHaveStyle(`font-weight: 700`);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('Render Typography h2 with correct font-size and weight', () => {
|
|
26
|
+
render(<Typography variant="h2">text regular</Typography>);
|
|
27
|
+
|
|
28
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
29
|
+
|
|
30
|
+
expect(textRegular).toHaveStyle(`font-size: 1.188rem`);
|
|
31
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
32
|
+
|
|
33
|
+
render(
|
|
34
|
+
<Typography variant="h2" weight="bold">
|
|
35
|
+
text bold
|
|
36
|
+
</Typography>,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const textBold = screen.getByText(/text bold/i);
|
|
40
|
+
|
|
41
|
+
expect(textBold).toHaveStyle(`font-weight: 700`);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('Render Typography h3 with correct font-size and weight', () => {
|
|
45
|
+
render(<Typography variant="h3">text regular</Typography>);
|
|
46
|
+
|
|
47
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
48
|
+
|
|
49
|
+
expect(textRegular).toHaveStyle(`font-size: 1.438rem`);
|
|
50
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
51
|
+
|
|
52
|
+
render(
|
|
53
|
+
<Typography variant="h3" weight="bold">
|
|
54
|
+
text bold
|
|
55
|
+
</Typography>,
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const textBold = screen.getByText(/text bold/i);
|
|
59
|
+
|
|
60
|
+
expect(textBold).toHaveStyle(`font-weight: 700`);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('Render Typography h4 with correct font-size and weight', () => {
|
|
64
|
+
render(<Typography variant="h4">text regular</Typography>);
|
|
65
|
+
|
|
66
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
67
|
+
|
|
68
|
+
expect(textRegular).toHaveStyle(`font-size: 1.44rem`);
|
|
69
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
70
|
+
|
|
71
|
+
render(
|
|
72
|
+
<Typography variant="h4" weight="bold">
|
|
73
|
+
text bold
|
|
74
|
+
</Typography>,
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const textBold = screen.getByText(/text bold/i);
|
|
78
|
+
|
|
79
|
+
expect(textBold).toHaveStyle(`font-weight: 700`);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('Render Typography h5 with correct font-size and weight', () => {
|
|
83
|
+
render(<Typography variant="h5">text regular</Typography>);
|
|
84
|
+
|
|
85
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
86
|
+
|
|
87
|
+
expect(textRegular).toHaveStyle(`font-size: 1rem`);
|
|
88
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
89
|
+
|
|
90
|
+
render(
|
|
91
|
+
<Typography variant="h5" weight="bold">
|
|
92
|
+
text bold
|
|
93
|
+
</Typography>,
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const textBold = screen.getByText(/text bold/i);
|
|
97
|
+
|
|
98
|
+
expect(textBold).toHaveStyle(`font-weight: 700`);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('Render Typography h6 with correct font-size and weight', () => {
|
|
102
|
+
render(<Typography variant="h6">text regular</Typography>);
|
|
103
|
+
|
|
104
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
105
|
+
|
|
106
|
+
expect(textRegular).toHaveStyle(`font-size: 1rem`);
|
|
107
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
108
|
+
|
|
109
|
+
render(
|
|
110
|
+
<Typography variant="h6" weight="bold">
|
|
111
|
+
text bold
|
|
112
|
+
</Typography>,
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
const textBold = screen.getByText(/text bold/i);
|
|
116
|
+
|
|
117
|
+
expect(textBold).toHaveStyle(`font-weight: 700`);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('Render Typography subtitle with correct font-size and weight', () => {
|
|
121
|
+
render(<Typography variant="subtitle">text regular</Typography>);
|
|
122
|
+
|
|
123
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
124
|
+
|
|
125
|
+
expect(textRegular).toHaveStyle(`font-size: 0.833rem`);
|
|
126
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
127
|
+
|
|
128
|
+
render(
|
|
129
|
+
<Typography variant="subtitle" weight="bold">
|
|
130
|
+
text bold
|
|
131
|
+
</Typography>,
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
const textBold = screen.getByText(/text bold/i);
|
|
135
|
+
|
|
136
|
+
expect(textBold).toHaveStyle(`font-weight: 700`);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('Render Typography body1 with correct font-size and weight', () => {
|
|
140
|
+
render(<Typography>text regular</Typography>);
|
|
141
|
+
|
|
142
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
143
|
+
|
|
144
|
+
expect(textRegular).toHaveStyle(`font-size: 0.694rem`);
|
|
145
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
146
|
+
|
|
147
|
+
render(
|
|
148
|
+
<Typography variant="body1" weight="bold">
|
|
149
|
+
text bold
|
|
150
|
+
</Typography>,
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
const textBold = screen.getByText(/text bold/i);
|
|
154
|
+
|
|
155
|
+
expect(textBold).toHaveStyle(`font-weight: 700`);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('Render Typography body2 with correct font-size and weight', () => {
|
|
159
|
+
render(<Typography variant="body2">text regular</Typography>);
|
|
160
|
+
|
|
161
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
162
|
+
|
|
163
|
+
expect(textRegular).toHaveStyle(`font-size: 0.579rem`);
|
|
164
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
165
|
+
|
|
166
|
+
render(
|
|
167
|
+
<Typography variant="body2" weight="bold">
|
|
168
|
+
text bold
|
|
169
|
+
</Typography>,
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
const textBold = screen.getByText(/text bold/i);
|
|
173
|
+
|
|
174
|
+
expect(textBold).toHaveStyle(`font-weight: 700`);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it('Render Typography body3 with correct font-size and weight', () => {
|
|
178
|
+
render(<Typography variant="body3">text regular</Typography>);
|
|
179
|
+
|
|
180
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
181
|
+
|
|
182
|
+
expect(textRegular).toHaveStyle(`font-size: 0.5rem`);
|
|
183
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
184
|
+
|
|
185
|
+
render(
|
|
186
|
+
<Typography variant="body3" weight="bold">
|
|
187
|
+
text bold
|
|
188
|
+
</Typography>,
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
const textBold = screen.getByText(/text bold/i);
|
|
192
|
+
|
|
193
|
+
expect(textBold).toHaveStyle(`font-weight: 700`);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it('Render Typography caption with correct font-size and weight', () => {
|
|
197
|
+
render(<Typography variant="caption">text regular</Typography>);
|
|
198
|
+
|
|
199
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
200
|
+
|
|
201
|
+
expect(textRegular).toHaveStyle(`font-size: 0.481rem`);
|
|
202
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
203
|
+
|
|
204
|
+
render(
|
|
205
|
+
<Typography variant="caption" weight="bold">
|
|
206
|
+
text bold
|
|
207
|
+
</Typography>,
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
const textBold = screen.getByText(/text bold/i);
|
|
211
|
+
|
|
212
|
+
expect(textBold).toHaveStyle(`font-weight: 700`);
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
it('Render Typography with gutter', () => {
|
|
216
|
+
render(
|
|
217
|
+
<Typography variant="h1" gutter>
|
|
218
|
+
text regular
|
|
219
|
+
</Typography>,
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
223
|
+
|
|
224
|
+
expect(textRegular).toHaveStyle(`font-size: 2.488rem`);
|
|
225
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
226
|
+
expect(textRegular).toHaveStyle('margin-block-end: 1rem');
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it('Render Typography with a tag specified in the "as" prop', () => {
|
|
230
|
+
render(
|
|
231
|
+
<Typography variant="h1" gutter as="p">
|
|
232
|
+
text regular
|
|
233
|
+
</Typography>,
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
const textRegular = screen.getByText(/text regular/i);
|
|
237
|
+
expect(textRegular.tagName.toLowerCase()).toBe('p');
|
|
238
|
+
|
|
239
|
+
expect(textRegular).toHaveStyle(`font-size: 2.488rem`);
|
|
240
|
+
expect(textRegular).toHaveStyle(`font-weight: 500`);
|
|
241
|
+
expect(textRegular).toHaveStyle('margin-block-end: 1rem');
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
it('Accepts a ref', () => {
|
|
245
|
+
const ref = createRef<HTMLElement>();
|
|
246
|
+
|
|
247
|
+
render(
|
|
248
|
+
<Typography variant="h1" weight="bold" ref={ref}>
|
|
249
|
+
A text
|
|
250
|
+
</Typography>,
|
|
251
|
+
);
|
|
252
|
+
|
|
253
|
+
expect(ref.current).toBeTruthy();
|
|
254
|
+
(ref.current as HTMLElement).style.backgroundColor = 'Indigo';
|
|
255
|
+
|
|
256
|
+
const h1El = screen.getByRole('heading');
|
|
257
|
+
expect(h1El).toHaveStyle(`background-color: Indigo`);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import Typography from './index';
|
|
4
|
+
import { TypographyProps } from './types';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Components/Typography',
|
|
8
|
+
component: Typography,
|
|
9
|
+
argTypes: {
|
|
10
|
+
color: { control: 'color' },
|
|
11
|
+
variant: {
|
|
12
|
+
control: {
|
|
13
|
+
disable: true,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
} as Meta<typeof Typography>;
|
|
18
|
+
|
|
19
|
+
export const Basic: StoryObj<typeof Typography> = ({
|
|
20
|
+
weight,
|
|
21
|
+
gutter,
|
|
22
|
+
color,
|
|
23
|
+
}: TypographyProps) => {
|
|
24
|
+
return (
|
|
25
|
+
<div>
|
|
26
|
+
<Typography variant="h1" weight={weight} gutter={gutter} color={color}>
|
|
27
|
+
H1. text variant
|
|
28
|
+
</Typography>
|
|
29
|
+
<Typography variant="h2" weight={weight} gutter={gutter} color={color}>
|
|
30
|
+
H2. text variant
|
|
31
|
+
</Typography>
|
|
32
|
+
<Typography variant="h3" weight={weight} gutter={gutter} color={color}>
|
|
33
|
+
H3. text variant
|
|
34
|
+
</Typography>
|
|
35
|
+
<Typography variant="h4" weight={weight} gutter={gutter} color={color}>
|
|
36
|
+
H4. text variant
|
|
37
|
+
</Typography>
|
|
38
|
+
<Typography variant="h5" weight={weight} gutter={gutter} color={color}>
|
|
39
|
+
H5. text variant
|
|
40
|
+
</Typography>
|
|
41
|
+
<Typography variant="h6" weight={weight} gutter={gutter} color={color}>
|
|
42
|
+
H6. text variant
|
|
43
|
+
</Typography>
|
|
44
|
+
<Typography
|
|
45
|
+
variant="subtitle"
|
|
46
|
+
weight={weight}
|
|
47
|
+
gutter={gutter}
|
|
48
|
+
color={color}>
|
|
49
|
+
Sub-title. text variant
|
|
50
|
+
</Typography>
|
|
51
|
+
<Typography variant="body1" weight={weight} gutter={gutter} color={color}>
|
|
52
|
+
Body 1. text variant
|
|
53
|
+
</Typography>
|
|
54
|
+
<Typography variant="body2" weight={weight} gutter={gutter} color={color}>
|
|
55
|
+
Body 2. text variant
|
|
56
|
+
</Typography>
|
|
57
|
+
<Typography
|
|
58
|
+
variant="caption"
|
|
59
|
+
weight={weight}
|
|
60
|
+
gutter={gutter}
|
|
61
|
+
color={color}>
|
|
62
|
+
Caption. text variant
|
|
63
|
+
</Typography>
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
Basic.storyName = 'Typography';
|