@clickhouse/click-ui 0.0.1 → 0.0.3
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/.eslintrc.cjs +1 -0
- package/.prettierrc +14 -0
- package/.storybook/main.ts +1 -0
- package/.storybook/manager.ts +11 -0
- package/.storybook/preview-head.html +2 -4
- package/.storybook/preview.tsx +13 -4
- package/.storybook/theme.ts +16 -0
- package/build-tokens.js +6 -6
- package/dist/App.d.ts +2 -0
- package/dist/assets/RightArrow/RightArrow.d.ts +1 -0
- package/dist/assets/S3Logo/S3Logo.d.ts +1 -0
- package/dist/components/Accordion/Accordion.d.ts +27 -0
- package/dist/components/Accordion/Accordion.stories.d.ts +21 -0
- package/dist/components/Accordion/Accordion.test.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +16 -0
- package/dist/components/Alert/Alert.stories.d.ts +12 -0
- package/dist/components/Alert/Alert.test.d.ts +1 -0
- package/dist/components/Avatar/Avatar.d.ts +7 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +11 -0
- package/dist/components/Badge/Badge.d.ts +16 -0
- package/dist/components/Badge/Badge.stories.d.ts +34 -0
- package/dist/components/Badge/Badge.test.d.ts +1 -0
- package/dist/components/BigStat/BigStat.d.ts +10 -0
- package/dist/components/BigStat/BigStat.stories.d.ts +20 -0
- package/dist/components/Button/Button.d.ts +23 -0
- package/dist/components/Button/Button.stories.d.ts +28 -0
- package/dist/components/Button/Button.test.d.ts +1 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +6 -0
- package/dist/components/ButtonGroup/ButtonGroup.stories.d.ts +12 -0
- package/dist/components/Card/Card.d.ts +10 -0
- package/dist/components/Card/Card.stories.d.ts +16 -0
- package/dist/components/Checkbox/Checkbox.d.ts +5 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +29 -0
- package/dist/components/Checkbox/Checkbox.test.d.ts +1 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +38 -0
- package/dist/components/ContextMenu/ContextMenu.stories.d.ts +30 -0
- package/dist/components/ContextMenu/ContextMenu.test.d.ts +1 -0
- package/dist/components/Dropdown/Dropdown.d.ts +38 -0
- package/dist/components/Dropdown/Dropdown.stories.d.ts +36 -0
- package/dist/components/Dropdown/Dropdown.test.d.ts +1 -0
- package/dist/components/FormField/Label.d.ts +7 -0
- package/dist/components/FormField/Label.stories.d.ts +28 -0
- package/dist/components/FormField/Select.d.ts +43 -0
- package/dist/components/FormField/Select.stories.d.ts +54 -0
- package/dist/components/FormField/Select.test.d.ts +0 -0
- package/dist/components/FormField/SelectContext.d.ts +24 -0
- package/dist/components/FormField/commonElement.d.ts +1100 -0
- package/dist/components/GenericMenu.d.ts +764 -0
- package/dist/components/HoverCard/HoverCard.d.ts +20 -0
- package/dist/components/HoverCard/HoverCard.stories.d.ts +36 -0
- package/dist/components/HoverCard/HoverCard.test.d.ts +0 -0
- package/dist/components/Icon/Icon.d.ts +571 -0
- package/dist/components/Icon/Icon.stories.d.ts +495 -0
- package/dist/components/Icon/types.d.ts +8 -0
- package/dist/components/IconButton/IconButton.d.ts +15 -0
- package/dist/components/IconButton/IconButton.stories.d.ts +30 -0
- package/dist/components/IconButton/IconButton.test.d.ts +1 -0
- package/dist/components/Panel/Panel.d.ts +11 -0
- package/dist/components/Panel/Panel.stories.d.ts +23 -0
- package/dist/components/Popover/Popover.d.ts +23 -0
- package/dist/components/Popover/Popover.stories.d.ts +43 -0
- package/dist/components/Popover/Popover.test.d.ts +1 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +17 -0
- package/dist/components/RadioGroup/RadioGroup.stories.d.ts +39 -0
- package/dist/components/RadioGroup/RadioGroup.test.d.ts +1 -0
- package/dist/components/Separator/Separator.d.ts +6 -0
- package/dist/components/SidebarNavigationItem/SidebarNavigationItem.d.ts +17 -0
- package/dist/components/SidebarNavigationItem/SidebarNavigationItem.stories.d.ts +20 -0
- package/dist/components/Spacer/Spacer.d.ts +4 -0
- package/dist/components/Spacer/Spacer.stories.d.ts +19 -0
- package/dist/components/Switch/Switch.d.ts +7 -0
- package/dist/components/Switch/Switch.stories.d.ts +13 -0
- package/dist/components/Table/Table.d.ts +568 -0
- package/dist/components/Table/Table.stories.d.ts +575 -0
- package/dist/components/Tabs/Tabs.d.ts +848 -0
- package/dist/components/Tabs/Tabs.stories.d.ts +845 -0
- package/dist/components/Tabs/Tabs.test.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +45 -0
- package/dist/components/Tooltip/Tooltip.test.d.ts +1 -0
- package/dist/components/Typography/Text/Text.d.ts +12 -0
- package/dist/components/Typography/Text/Text.stories.d.ts +22 -0
- package/dist/components/Typography/Text/Text.test.d.ts +1 -0
- package/dist/components/Typography/Title/Title.d.ts +14 -0
- package/dist/components/Typography/Title/Title.stories.d.ts +35 -0
- package/dist/components/Typography/Title/Title.test.d.ts +1 -0
- package/dist/components/icons/Activity.d.ts +3 -0
- package/dist/components/icons/ArrowDown.d.ts +3 -0
- package/dist/components/icons/ArrowRight.d.ts +3 -0
- package/dist/components/icons/ArrowTriangle.d.ts +3 -0
- package/dist/components/icons/ArrowUp.d.ts +3 -0
- package/dist/components/icons/Backups.d.ts +3 -0
- package/dist/components/icons/Blog.d.ts +3 -0
- package/dist/components/icons/Book.d.ts +3 -0
- package/dist/components/icons/Brackets.d.ts +3 -0
- package/dist/components/icons/Briefcase.d.ts +3 -0
- package/dist/components/icons/Building.d.ts +3 -0
- package/dist/components/icons/BurgerMenu.d.ts +3 -0
- package/dist/components/icons/Cards.d.ts +3 -0
- package/dist/components/icons/CellTower.d.ts +3 -0
- package/dist/components/icons/ChatIcon.d.ts +3 -0
- package/dist/components/icons/CheckIcon.d.ts +3 -0
- package/dist/components/icons/CheckInCircle.d.ts +3 -0
- package/dist/components/icons/ChevronDown.d.ts +2 -0
- package/dist/components/icons/ChevronLeft.d.ts +3 -0
- package/dist/components/icons/ChevronRight.d.ts +2 -0
- package/dist/components/icons/ChevronUp.d.ts +3 -0
- package/dist/components/icons/Clock.d.ts +3 -0
- package/dist/components/icons/Cloud.d.ts +3 -0
- package/dist/components/icons/Code.d.ts +3 -0
- package/dist/components/icons/CodeInSquare.d.ts +3 -0
- package/dist/components/icons/Connect.d.ts +3 -0
- package/dist/components/icons/ConnectAlt.d.ts +3 -0
- package/dist/components/icons/Console.d.ts +3 -0
- package/dist/components/icons/Copy.d.ts +3 -0
- package/dist/components/icons/CrossIcon.d.ts +3 -0
- package/dist/components/icons/Data.d.ts +3 -0
- package/dist/components/icons/DatabaseIcon.d.ts +3 -0
- package/dist/components/icons/Disk.d.ts +3 -0
- package/dist/components/icons/Display.d.ts +3 -0
- package/dist/components/icons/Document.d.ts +3 -0
- package/dist/components/icons/DotsHorizontal.d.ts +3 -0
- package/dist/components/icons/DotsVertical.d.ts +3 -0
- package/dist/components/icons/Email.d.ts +3 -0
- package/dist/components/icons/Empty.d.ts +3 -0
- package/dist/components/icons/FilterIcon.d.ts +3 -0
- package/dist/components/icons/Fire.d.ts +3 -0
- package/dist/components/icons/Flags/EuropeanUnion.d.ts +3 -0
- package/dist/components/icons/Flags/Germany.d.ts +3 -0
- package/dist/components/icons/Flags/India.d.ts +3 -0
- package/dist/components/icons/Flags/Ireland.d.ts +3 -0
- package/dist/components/icons/Flags/Netherlands.d.ts +3 -0
- package/dist/components/icons/Flags/Singapore.d.ts +2 -0
- package/dist/components/icons/Flags/UnitedKingdom.d.ts +3 -0
- package/dist/components/icons/Flags/UnitedStates.d.ts +3 -0
- package/dist/components/icons/Flags/index.d.ts +6 -0
- package/dist/components/icons/Folder.d.ts +3 -0
- package/dist/components/icons/Gift.d.ts +3 -0
- package/dist/components/icons/HistoryIcon.d.ts +3 -0
- package/dist/components/icons/Home.d.ts +3 -0
- package/dist/components/icons/Http.d.ts +3 -0
- package/dist/components/icons/InfoInCircleIcon.d.ts +3 -0
- package/dist/components/icons/InformationIcon.d.ts +3 -0
- package/dist/components/icons/InsertRowIcon.d.ts +3 -0
- package/dist/components/icons/Integrations.d.ts +3 -0
- package/dist/components/icons/LightBulb.d.ts +3 -0
- package/dist/components/icons/Lightening.d.ts +3 -0
- package/dist/components/icons/Loading.d.ts +3 -0
- package/dist/components/icons/Metrics.d.ts +3 -0
- package/dist/components/icons/MetricsAlt.d.ts +3 -0
- package/dist/components/icons/Payment.d.ts +3 -0
- package/dist/components/icons/Payments/Amex.d.ts +3 -0
- package/dist/components/icons/Payments/MasterCard.d.ts +3 -0
- package/dist/components/icons/Payments/Paypal.d.ts +3 -0
- package/dist/components/icons/Payments/Visa.d.ts +3 -0
- package/dist/components/icons/Payments/index.d.ts +6 -0
- package/dist/components/icons/Pencil.d.ts +3 -0
- package/dist/components/icons/PieChart.d.ts +3 -0
- package/dist/components/icons/Play.d.ts +3 -0
- package/dist/components/icons/Plus.d.ts +3 -0
- package/dist/components/icons/Popout.d.ts +3 -0
- package/dist/components/icons/PopoverArrow.d.ts +3 -0
- package/dist/components/icons/Question.d.ts +3 -0
- package/dist/components/icons/Refresh.d.ts +3 -0
- package/dist/components/icons/Search.d.ts +3 -0
- package/dist/components/icons/Secure.d.ts +3 -0
- package/dist/components/icons/Services.d.ts +3 -0
- package/dist/components/icons/Settings.d.ts +3 -0
- package/dist/components/icons/Share.d.ts +3 -0
- package/dist/components/icons/SlideIn.d.ts +3 -0
- package/dist/components/icons/SlideOut.d.ts +3 -0
- package/dist/components/icons/SortAltIcon.d.ts +3 -0
- package/dist/components/icons/SortIcon.d.ts +3 -0
- package/dist/components/icons/Sparkle.d.ts +3 -0
- package/dist/components/icons/Speaker.d.ts +3 -0
- package/dist/components/icons/Speed.d.ts +3 -0
- package/dist/components/icons/Star.d.ts +3 -0
- package/dist/components/icons/Support.d.ts +3 -0
- package/dist/components/icons/Table.d.ts +3 -0
- package/dist/components/icons/Taxi.d.ts +3 -0
- package/dist/components/icons/Trash.d.ts +3 -0
- package/dist/components/icons/Upload.d.ts +3 -0
- package/dist/components/icons/Url.d.ts +3 -0
- package/dist/components/icons/UserIcon.d.ts +2 -0
- package/dist/components/icons/UsersIcon.d.ts +2 -0
- package/dist/components/icons/WarningIcon.d.ts +3 -0
- package/dist/components/index.d.ts +24 -0
- package/dist/components/types.d.ts +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.cjs +442 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +16474 -0
- package/dist/logo.svg +17 -0
- package/dist/main.d.ts +0 -0
- package/dist/styles/types.d.ts +2087 -0
- package/dist/styles/variables.classic.json.d.ts +204 -0
- package/dist/styles/variables.dark.json.d.ts +896 -0
- package/dist/styles/variables.json.d.ts +2089 -0
- package/dist/styles/variables.light.json.d.ts +951 -0
- package/dist/theme/index.d.ts +10 -0
- package/dist/theme/theme.d.ts +6 -0
- package/dist/vite.svg +1 -0
- package/package.json +24 -5
- package/public/favicon.ico +0 -0
- package/public/logo.svg +17 -0
- package/src/App.tsx +102 -39
- package/src/components/Accordion/Accordion.stories.tsx +4 -54
- package/src/components/Accordion/Accordion.tsx +1 -0
- package/src/components/Alert/Alert.stories.tsx +14 -0
- package/src/components/Alert/Alert.test.tsx +27 -0
- package/src/components/Alert/Alert.tsx +130 -0
- package/src/components/Avatar/Avatar.stories.tsx +13 -0
- package/src/components/Avatar/Avatar.tsx +64 -0
- package/src/components/Badge/Badge.stories.ts +19 -3
- package/src/components/Badge/Badge.test.tsx +6 -1
- package/src/components/Badge/Badge.tsx +67 -13
- package/src/components/BigStat/BigStat.stories.ts +10 -5
- package/src/components/BigStat/BigStat.tsx +36 -24
- package/src/components/Button/Button.stories.ts +12 -68
- package/src/components/Button/Button.test.tsx +2 -2
- package/src/components/Button/Button.tsx +59 -41
- package/src/components/ButtonGroup/ButtonGroup.stories.ts +3 -3
- package/src/components/Card/Card.stories.ts +3 -3
- package/src/components/Checkbox/Checkbox.stories.tsx +35 -0
- package/src/components/Checkbox/Checkbox.test.tsx +41 -0
- package/src/components/Checkbox/Checkbox.tsx +89 -0
- package/src/components/ContextMenu/ContextMenu.stories.tsx +73 -0
- package/src/components/ContextMenu/ContextMenu.test.tsx +152 -0
- package/src/components/ContextMenu/ContextMenu.tsx +155 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +64 -0
- package/src/components/Dropdown/Dropdown.test.tsx +141 -0
- package/src/components/Dropdown/Dropdown.tsx +149 -0
- package/src/components/FormField/Label.stories.tsx +39 -0
- package/src/components/FormField/Label.tsx +47 -0
- package/src/components/FormField/Select.stories.tsx +48 -0
- package/src/components/FormField/Select.test.tsx +216 -0
- package/src/components/FormField/Select.tsx +574 -0
- package/src/components/FormField/SelectContext.tsx +101 -0
- package/src/components/FormField/commonElement.tsx +42 -0
- package/src/components/GenericMenu.tsx +114 -0
- package/src/components/HoverCard/HoverCard.stories.tsx +64 -0
- package/src/components/HoverCard/HoverCard.test.tsx +85 -0
- package/src/components/HoverCard/HoverCard.tsx +65 -0
- package/src/components/Icon/Icon.stories.ts +4 -35
- package/src/components/Icon/Icon.tsx +166 -18
- package/src/components/Icon/types.ts +78 -1
- package/src/components/IconButton/IconButton.stories.ts +25 -7
- package/src/components/IconButton/IconButton.test.tsx +32 -0
- package/src/components/IconButton/IconButton.tsx +60 -71
- package/src/components/Panel/Panel.stories.tsx +25 -0
- package/src/components/Panel/Panel.tsx +33 -0
- package/src/components/Popover/Popover.stories.tsx +67 -0
- package/src/components/Popover/Popover.test.tsx +46 -0
- package/src/components/Popover/Popover.tsx +115 -0
- package/src/components/RadioGroup/RadioGroup.stories.tsx +43 -0
- package/src/components/RadioGroup/RadioGroup.test.tsx +59 -0
- package/src/components/RadioGroup/RadioGroup.tsx +149 -0
- package/src/components/Separator/Separator.stories.tsx +24 -0
- package/src/components/Separator/Separator.tsx +29 -0
- package/src/components/SidebarNavigationItem/SidebarNavigationItem.stories.tsx +2 -2
- package/src/components/Spacer/Spacer.stories.tsx +20 -0
- package/src/components/Spacer/Spacer.tsx +15 -0
- package/src/components/Switch/Switch.stories.ts +3 -3
- package/src/components/Switch/Switch.tsx +3 -2
- package/src/components/Table/Table.stories.tsx +29 -0
- package/src/components/Table/Table.tsx +109 -0
- package/src/components/Tabs/Tabs.stories.tsx +2 -37
- package/src/components/Tooltip/Tooltip.stories.tsx +68 -0
- package/src/components/Tooltip/Tooltip.test.tsx +44 -0
- package/src/components/Tooltip/Tooltip.tsx +67 -0
- package/src/components/Typography/Text/Text.stories.tsx +22 -0
- package/src/components/Typography/Text/Text.test.tsx +16 -0
- package/src/components/Typography/Text/Text.tsx +30 -0
- package/src/components/Typography/Title/Title.stories.tsx +31 -0
- package/src/components/Typography/Title/Title.test.tsx +16 -0
- package/src/components/Typography/Title/Title.tsx +36 -0
- package/src/components/icons/Activity.tsx +30 -0
- package/src/components/icons/ArrowDown.tsx +22 -0
- package/src/components/icons/ArrowRight.tsx +22 -0
- package/src/components/icons/ArrowTriangle.tsx +36 -0
- package/src/components/icons/ArrowUp.tsx +22 -0
- package/src/components/icons/Backups.tsx +29 -0
- package/src/components/icons/Blog.tsx +38 -0
- package/src/components/icons/Book.tsx +30 -0
- package/src/components/icons/Brackets.tsx +22 -0
- package/src/components/icons/Briefcase.tsx +30 -0
- package/src/components/icons/Building.tsx +30 -0
- package/src/components/icons/BurgerMenu.tsx +22 -0
- package/src/components/icons/Cards.tsx +30 -0
- package/src/components/icons/CellTower.tsx +21 -0
- package/src/components/icons/CheckIcon.tsx +21 -0
- package/src/components/icons/CheckInCircle.tsx +39 -0
- package/src/components/icons/ChevronDown.tsx +19 -5
- package/src/components/icons/ChevronLeft.tsx +22 -0
- package/src/components/icons/ChevronRight.tsx +3 -3
- package/src/components/icons/ChevronUp.tsx +22 -0
- package/src/components/icons/Clock.tsx +37 -0
- package/src/components/icons/Cloud.tsx +23 -0
- package/src/components/icons/Code.tsx +22 -0
- package/src/components/icons/CodeInSquare.tsx +30 -0
- package/src/components/icons/Connect.tsx +22 -0
- package/src/components/icons/ConnectAlt.tsx +30 -0
- package/src/components/icons/Console.tsx +30 -0
- package/src/components/icons/Copy.tsx +33 -0
- package/src/components/icons/CrossIcon.tsx +29 -0
- package/src/components/icons/Data.tsx +36 -0
- package/src/components/icons/DatabaseIcon.tsx +27 -29
- package/src/components/icons/Disk.tsx +30 -0
- package/src/components/icons/Display.tsx +30 -0
- package/src/components/icons/Document.tsx +30 -0
- package/src/components/icons/DotsHorizontal.tsx +36 -0
- package/src/components/icons/DotsVertical.tsx +33 -0
- package/src/components/icons/Email.tsx +33 -0
- package/src/components/icons/Empty.tsx +14 -0
- package/src/components/icons/FilterIcon.tsx +29 -16
- package/src/components/icons/Fire.tsx +23 -0
- package/src/components/icons/Folder.tsx +20 -0
- package/src/components/icons/Gift.tsx +21 -0
- package/src/components/icons/HistoryIcon.tsx +13 -13
- package/src/components/icons/Home.tsx +29 -0
- package/src/components/icons/Http.tsx +22 -0
- package/src/components/icons/Icons.mdx +31 -28
- package/src/components/icons/InfoInCircleIcon.tsx +37 -0
- package/src/components/icons/InformationIcon.tsx +34 -0
- package/src/components/icons/InsertRowIcon.tsx +30 -32
- package/src/components/icons/Integrations.tsx +29 -0
- package/src/components/icons/LightBulb.tsx +40 -0
- package/src/components/icons/Lightening.tsx +30 -0
- package/src/components/icons/Loading.tsx +57 -0
- package/src/components/icons/Metrics.tsx +38 -0
- package/src/components/icons/MetricsAlt.tsx +30 -0
- package/src/components/icons/Payment.tsx +23 -0
- package/src/components/icons/Payments/Amex.tsx +44 -0
- package/src/components/icons/Payments/MasterCard.tsx +48 -0
- package/src/components/icons/Payments/Paypal.tsx +41 -0
- package/src/components/icons/Payments/Visa.tsx +36 -0
- package/src/components/icons/Payments/index.tsx +30 -0
- package/src/components/icons/Pencil.tsx +30 -0
- package/src/components/icons/PieChart.tsx +30 -0
- package/src/components/icons/Play.tsx +30 -0
- package/src/components/icons/Plus.tsx +22 -0
- package/src/components/icons/Popout.tsx +22 -0
- package/src/components/icons/PopoverArrow.tsx +22 -0
- package/src/components/icons/Question.tsx +30 -0
- package/src/components/icons/Refresh.tsx +29 -0
- package/src/components/icons/Search.tsx +22 -0
- package/src/components/icons/Secure.tsx +30 -0
- package/src/components/icons/Services.tsx +23 -0
- package/src/components/icons/Settings.tsx +22 -0
- package/src/components/icons/Share.tsx +29 -0
- package/src/components/icons/SlideIn.tsx +28 -0
- package/src/components/icons/SlideOut.tsx +28 -0
- package/src/components/icons/SortAltIcon.tsx +18 -20
- package/src/components/icons/SortIcon.tsx +24 -0
- package/src/components/icons/Sparkle.tsx +23 -0
- package/src/components/icons/Speaker.tsx +30 -0
- package/src/components/icons/Speed.tsx +29 -0
- package/src/components/icons/Star.tsx +23 -0
- package/src/components/icons/Support.tsx +37 -0
- package/src/components/icons/Table.tsx +30 -0
- package/src/components/icons/Taxi.tsx +120 -0
- package/src/components/icons/Trash.tsx +22 -0
- package/src/components/icons/Upload.tsx +29 -0
- package/src/components/icons/Url.tsx +22 -0
- package/src/components/icons/UsersIcon.tsx +27 -27
- package/src/components/icons/WarningIcon.tsx +30 -0
- package/src/components/index.ts +31 -10
- package/src/index.ts +2 -2
- package/src/styles/types.ts +715 -295
- package/src/styles/variables.classic.json +171 -0
- package/src/styles/variables.dark.json +447 -129
- package/src/styles/variables.json +830 -410
- package/src/styles/variables.light.json +339 -179
- package/tokens/themes/$themes.json +3657 -1
- package/tokens/themes/classic.json +492 -0
- package/tokens/themes/component.json +1126 -441
- package/tokens/themes/dark.json +1871 -758
- package/tokens/themes/light.json +852 -266
- package/tokens/themes/primitives.json +294 -210
- package/vite.config.ts +6 -4
- package/app/.babelrc +0 -27
- package/app/.eslintrc.json +0 -6
- package/app/.storybook/main.ts +0 -17
- package/app/.storybook/preview.tsx +0 -26
- package/app/README.md +0 -38
- package/app/next.config.js +0 -6
- package/app/package-lock.json +0 -28711
- package/app/package.json +0 -44
- package/app/public/favicon.ico +0 -0
- package/app/public/next.svg +0 -1
- package/app/public/vercel.svg +0 -1
- package/app/src/assets/RightArrow/right-arrow.tsx +0 -17
- package/app/src/assets/S3Logo/s3-logo.tsx +0 -31
- package/app/src/assets/amazon_s3.svg +0 -9
- package/app/src/assets/arrow.svg +0 -3
- package/app/src/globals.d.ts +0 -4
- package/app/src/pages/_app.tsx +0 -8
- package/app/src/pages/_document.tsx +0 -17
- package/app/src/pages/api/hello.ts +0 -13
- package/app/src/pages/index.tsx +0 -141
- package/app/src/pages/label.tsx +0 -27
- package/app/src/stories/assets/code-brackets.svg +0 -1
- package/app/src/stories/assets/colors.svg +0 -1
- package/app/src/stories/assets/comments.svg +0 -1
- package/app/src/stories/assets/direction.svg +0 -1
- package/app/src/stories/assets/flow.svg +0 -1
- package/app/src/stories/assets/plugin.svg +0 -1
- package/app/src/stories/assets/repo.svg +0 -1
- package/app/src/stories/assets/stackalt.svg +0 -1
- package/app/src/styles/Home.module.css +0 -235
- package/app/src/styles/globals.css +0 -111
- package/app/src/styles/types.ts +0 -1031
- package/app/src/styles/variables.classic.css +0 -16
- package/app/src/styles/variables.classic.json +0 -31
- package/app/src/styles/variables.css +0 -763
- package/app/src/styles/variables.dark.css +0 -135
- package/app/src/styles/variables.dark.json +0 -339
- package/app/src/styles/variables.json +0 -1029
- package/app/src/styles/variables.light.css +0 -203
- package/app/src/styles/variables.light.json +0 -478
- package/app/tokens/themes/$metadata.json +0 -9
- package/app/tokens/themes/$themes.json +0 -1
- package/app/tokens/themes/classic.json +0 -58
- package/app/tokens/themes/component.json +0 -868
- package/app/tokens/themes/dark.json +0 -937
- package/app/tokens/themes/light.json +0 -1380
- package/app/tokens/themes/primitives.json +0 -859
- package/app/tsconfig.json +0 -23
- package/src/components/FormField/FormField.stories.ts +0 -14
- package/src/components/FormField/FormField.tsx +0 -22
|
@@ -2,13 +2,29 @@ import { Badge } from "./Badge";
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
component: Badge,
|
|
5
|
-
title: "Badge",
|
|
6
|
-
tags: ["badge"],
|
|
5
|
+
title: "Display/Badge",
|
|
6
|
+
tags: ["badge","autodocs"],
|
|
7
|
+
argTypes: {
|
|
8
|
+
size: {
|
|
9
|
+
options: ["sm", "md"],
|
|
10
|
+
control: { type: "radio" },
|
|
11
|
+
},
|
|
12
|
+
state: {
|
|
13
|
+
options: ["default","success","neutral", "info", "warning", "danger", "disabled"],
|
|
14
|
+
control: { type: "radio" },
|
|
15
|
+
},
|
|
16
|
+
dismissible: {
|
|
17
|
+
options: [true, false],
|
|
18
|
+
control: { type: "boolean" },
|
|
19
|
+
}
|
|
20
|
+
}
|
|
7
21
|
};
|
|
8
22
|
|
|
9
|
-
export const
|
|
23
|
+
export const Playground = {
|
|
10
24
|
args: {
|
|
11
25
|
text: "experiment",
|
|
12
26
|
state: "success",
|
|
27
|
+
size: "md",
|
|
28
|
+
dismissible: false,
|
|
13
29
|
},
|
|
14
30
|
};
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { render } from "@testing-library/react";
|
|
2
2
|
import { Badge } from "./Badge";
|
|
3
|
+
import { ThemeProvider } from "@/theme";
|
|
3
4
|
|
|
4
5
|
describe("Badge", () => {
|
|
5
6
|
test("given a text, should render it", () => {
|
|
6
7
|
const text = "text to render";
|
|
7
|
-
const rendered = render(
|
|
8
|
+
const rendered = render(
|
|
9
|
+
<ThemeProvider theme="light">
|
|
10
|
+
<Badge text={text} />
|
|
11
|
+
</ThemeProvider>
|
|
12
|
+
);
|
|
8
13
|
|
|
9
14
|
expect(rendered.getByText(text).textContent).toEqual(text);
|
|
10
15
|
});
|
|
@@ -1,24 +1,78 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
+
import { Icon } from "../Icon/Icon";
|
|
3
|
+
export type BadgeState =
|
|
4
|
+
| "default"
|
|
5
|
+
| "success"
|
|
6
|
+
| "neutral"
|
|
7
|
+
| "danger"
|
|
8
|
+
| "disabled"
|
|
9
|
+
| "warning"
|
|
10
|
+
| "info";
|
|
2
11
|
|
|
3
|
-
export type
|
|
12
|
+
export type BadgeSize = "sm" | "md";
|
|
4
13
|
|
|
5
14
|
export interface BadgeProps {
|
|
6
|
-
|
|
7
|
-
|
|
15
|
+
text: string;
|
|
16
|
+
state?: BadgeState;
|
|
17
|
+
size?: BadgeSize;
|
|
8
18
|
}
|
|
9
19
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
export interface DismissibleBadge extends BadgeProps {
|
|
21
|
+
dismissible: true;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface NonDismissibleBadge extends BadgeProps {
|
|
26
|
+
dismissible?: never;
|
|
27
|
+
onClose?: never;
|
|
28
|
+
}
|
|
17
29
|
|
|
30
|
+
const Wrapper = styled.div<Pick<BadgeProps, "state" | "size">>`
|
|
31
|
+
background-color: ${({ state = "default", theme }) =>
|
|
32
|
+
theme.click.badge.color.background[state]};
|
|
33
|
+
color: ${({ state = "default", theme }) => theme.click.badge.color.text[state]};
|
|
34
|
+
font: ${({ size = "md", theme }) => theme.click.badge.typography.label[size].default};
|
|
35
|
+
border-radius: ${({ theme }) => theme.click.badge.radii.all};
|
|
36
|
+
border: ${({ state = "default", theme }) =>
|
|
37
|
+
`${theme.click.badge.stroke} solid ${theme.click.badge.color.stroke[state]}`};
|
|
38
|
+
padding: ${({ size = "md", theme }) => theme.click.badge.space[size].y}
|
|
39
|
+
${({ size = "md", theme }) => theme.click.badge.space[size].x};
|
|
18
40
|
display: inline-block;
|
|
19
41
|
`;
|
|
20
42
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
43
|
+
const Content = styled.div<Pick<BadgeProps, "state" | "size">>`
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
gap: ${({ size = "md", theme }) => theme.click.badge.space[size].gap};
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
const CrossContainer = styled.svg<Pick<BadgeProps, "state" | "size">>`
|
|
50
|
+
color: ${({ state = "default", theme }) => theme.click.badge.color.text[state]};
|
|
51
|
+
height: ${({ size = "md", theme }) => theme.click.badge.icon[size].size.height};
|
|
52
|
+
width: ${({ size = "md", theme }) => theme.click.badge.icon[size].size.width};
|
|
53
|
+
`;
|
|
24
54
|
|
|
55
|
+
export const Badge = ({
|
|
56
|
+
text,
|
|
57
|
+
state = "default",
|
|
58
|
+
size = "md",
|
|
59
|
+
dismissible,
|
|
60
|
+
onClose,
|
|
61
|
+
}: NonDismissibleBadge | DismissibleBadge) => (
|
|
62
|
+
<Wrapper
|
|
63
|
+
state={state}
|
|
64
|
+
size={size}
|
|
65
|
+
>
|
|
66
|
+
<Content>
|
|
67
|
+
{text}
|
|
68
|
+
{dismissible && (
|
|
69
|
+
<CrossContainer
|
|
70
|
+
name="cross"
|
|
71
|
+
state={state}
|
|
72
|
+
as={Icon}
|
|
73
|
+
onClick={onClose}
|
|
74
|
+
/>
|
|
75
|
+
)}
|
|
76
|
+
</Content>
|
|
77
|
+
</Wrapper>
|
|
78
|
+
);
|
|
@@ -2,14 +2,19 @@ import { BigStat } from "./BigStat";
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
component: BigStat,
|
|
5
|
-
title: "Big Stat",
|
|
6
|
-
tags: ["big-stat"],
|
|
5
|
+
title: "Display/Big Stat",
|
|
6
|
+
tags: ["big-stat", "autodocs"],
|
|
7
|
+
size: {
|
|
8
|
+
options: ["lg", "sm"],
|
|
9
|
+
control: { type: "radio" },
|
|
10
|
+
},
|
|
7
11
|
};
|
|
8
12
|
|
|
9
|
-
export const
|
|
13
|
+
export const Playground = {
|
|
10
14
|
args: {
|
|
11
|
-
label: "
|
|
12
|
-
|
|
15
|
+
label: "Percentage complete",
|
|
16
|
+
title: "100%",
|
|
13
17
|
state: "default",
|
|
18
|
+
size: "lg"
|
|
14
19
|
},
|
|
15
20
|
};
|
|
@@ -1,37 +1,49 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
|
|
3
3
|
export type bigStatState = "default";
|
|
4
|
+
export type bigStatSize = "sm" | "lg";
|
|
4
5
|
|
|
5
6
|
export interface BigStatProps {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
title: React.ReactNode;
|
|
9
|
+
state?: bigStatState;
|
|
10
|
+
size?: bigStatSize;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
//* Use this component to highlight important pieces of information. */
|
|
14
|
+
export const BigStat = ({
|
|
15
|
+
label = "Label",
|
|
16
|
+
title = "Title",
|
|
17
|
+
size,
|
|
18
|
+
state,
|
|
19
|
+
}: BigStatProps) => (
|
|
20
|
+
<Wrapper state={state} size={size}>
|
|
21
|
+
<Label state={state} size={size}>{label}</Label>
|
|
22
|
+
<Title state={state} size={size}>{title}</Title>
|
|
23
|
+
</Wrapper>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const Wrapper = styled.div<Pick<BigStatProps, "state" | "size">>`
|
|
27
|
+
background-color: ${({ state = "default", theme }) =>
|
|
28
|
+
theme.click.bigStat.color.background[state]};
|
|
29
|
+
border-radius: ${props => props.theme.click.bigStat.radii.all};
|
|
30
|
+
border: ${({ state = "default", theme }) =>
|
|
31
|
+
`${theme.click.bigStat.stroke} solid ${theme.click.bigStat.color.stroke[state]}`};
|
|
32
|
+
gap: ${props => props.theme.click.bigStat.space.gap};
|
|
33
|
+
padding: ${props => props.theme.click.bigStat.space.all};
|
|
17
34
|
display: flex;
|
|
18
|
-
flex-direction: column
|
|
35
|
+
flex-direction: ${({ size }) => size === "sm" ? "column-reverse" : "column"}
|
|
19
36
|
`;
|
|
20
37
|
|
|
21
|
-
const Label = styled.div<Pick<BigStatProps, "state">>`
|
|
22
|
-
color: ${({state}) =>
|
|
23
|
-
font: ${({state}) =>
|
|
38
|
+
const Label = styled.div<Pick<BigStatProps, "state" | "size">>`
|
|
39
|
+
color: ${({ state = "default", theme }) => theme.click.bigStat.color.label[state]};
|
|
40
|
+
font: ${({ state = "default", size = "lg", theme }) =>
|
|
41
|
+
theme.click.bigStat.typography[size].label[state]};
|
|
24
42
|
`;
|
|
25
43
|
|
|
26
|
-
const
|
|
27
|
-
color: ${({state}) =>
|
|
28
|
-
|
|
44
|
+
const Title = styled.div<Pick<BigStatProps, "state" | "size">>`
|
|
45
|
+
color: ${({ state = "default", theme }) =>
|
|
46
|
+
theme.click.bigStat.color.title[state]};
|
|
47
|
+
font: ${({ state = "default", size="lg", theme }) =>
|
|
48
|
+
theme.click.bigStat.typography[size].title[state]};
|
|
29
49
|
`;
|
|
30
|
-
|
|
31
|
-
export function BigStat({label, largeValue, state = "default"}: BigStatProps) {
|
|
32
|
-
return <Wrapper state={state}>
|
|
33
|
-
<Label state={state}>{label}</Label>
|
|
34
|
-
<LargeValue state={state}>{largeValue}</LargeValue>
|
|
35
|
-
</Wrapper>
|
|
36
|
-
}
|
|
37
|
-
|
|
@@ -1,82 +1,26 @@
|
|
|
1
1
|
import { Button } from "./Button";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
+
title: "Buttons/Button",
|
|
4
5
|
component: Button,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
args: {
|
|
11
|
-
type: "primary",
|
|
12
|
-
disabled: false,
|
|
13
|
-
label: "Button",
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const Secondary = {
|
|
18
|
-
args: {
|
|
19
|
-
type: "secondary",
|
|
20
|
-
disabled: false,
|
|
21
|
-
label: "Button",
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Hover = {
|
|
26
|
-
args: {
|
|
27
|
-
type: "primary",
|
|
28
|
-
disabled: false,
|
|
29
|
-
label: "Button",
|
|
30
|
-
},
|
|
31
|
-
parameters: {
|
|
32
|
-
pseudo: {
|
|
33
|
-
hover: true,
|
|
6
|
+
tags: ["button", "autodocs"],
|
|
7
|
+
argTypes: {
|
|
8
|
+
type: {
|
|
9
|
+
options: ["primary", "secondary", "danger"],
|
|
10
|
+
control: { type: "radio" },
|
|
34
11
|
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export const Active = {
|
|
39
|
-
args: {
|
|
40
|
-
type: "primary",
|
|
41
|
-
disabled: false,
|
|
42
|
-
label: "Button",
|
|
43
|
-
},
|
|
44
|
-
parameters: {
|
|
45
|
-
pseudo: {
|
|
46
|
-
active: true,
|
|
12
|
+
align: {
|
|
13
|
+
options: ["center", "left"],
|
|
14
|
+
control: { type: "radio" },
|
|
47
15
|
},
|
|
48
16
|
},
|
|
49
17
|
};
|
|
50
18
|
|
|
51
|
-
export const
|
|
52
|
-
args: {
|
|
53
|
-
type: "primary",
|
|
54
|
-
label: "Button",
|
|
55
|
-
iconLeft: "user",
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const IconRight = {
|
|
60
|
-
args: {
|
|
61
|
-
type: "primary",
|
|
62
|
-
label: "Button",
|
|
63
|
-
iconRight: "user",
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
export const IconLeftRight = {
|
|
19
|
+
export const Playground = {
|
|
67
20
|
args: {
|
|
68
21
|
type: "primary",
|
|
22
|
+
disabled: false,
|
|
69
23
|
label: "Button",
|
|
70
|
-
|
|
71
|
-
iconLeft: "database",
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
export const AlignLeft = {
|
|
75
|
-
args: {
|
|
76
|
-
type: "secondary",
|
|
77
|
-
label: "Button",
|
|
78
|
-
iconLeft: "database",
|
|
79
|
-
align: "left",
|
|
80
|
-
width: "270px",
|
|
24
|
+
align: "center",
|
|
81
25
|
},
|
|
82
26
|
};
|
|
@@ -18,9 +18,9 @@ describe("Button", () => {
|
|
|
18
18
|
|
|
19
19
|
it("should execute action on click", () => {
|
|
20
20
|
let counter = 0;
|
|
21
|
-
const
|
|
21
|
+
const handleClick = () => (counter = 1);
|
|
22
22
|
const { getByText } = renderButton({
|
|
23
|
-
onClick:
|
|
23
|
+
onClick: handleClick,
|
|
24
24
|
label: "Button",
|
|
25
25
|
});
|
|
26
26
|
const button = getByText("Button");
|
|
@@ -2,10 +2,12 @@ import { Icon } from "@/components";
|
|
|
2
2
|
import { IconName } from "@/components/Icon/types";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
|
|
5
|
-
type ButtonType = "primary" | "secondary";
|
|
6
|
-
type Alignment = "left";
|
|
5
|
+
type ButtonType = "primary" | "secondary" | "danger";
|
|
6
|
+
type Alignment = "center" | "left";
|
|
7
|
+
|
|
7
8
|
export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
8
9
|
type?: ButtonType;
|
|
10
|
+
disabled?: boolean;
|
|
9
11
|
label?: string;
|
|
10
12
|
iconLeft?: IconName;
|
|
11
13
|
iconRight?: IconName;
|
|
@@ -16,6 +18,7 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
16
18
|
|
|
17
19
|
export interface StyledButtonProps {
|
|
18
20
|
styleType: ButtonType;
|
|
21
|
+
disabled?: boolean;
|
|
19
22
|
align?: Alignment;
|
|
20
23
|
width?: string;
|
|
21
24
|
height?: string;
|
|
@@ -26,14 +29,28 @@ export const Button = ({
|
|
|
26
29
|
iconLeft,
|
|
27
30
|
iconRight,
|
|
28
31
|
label,
|
|
29
|
-
align,
|
|
32
|
+
align = "center",
|
|
30
33
|
children,
|
|
31
34
|
...delegated
|
|
32
35
|
}: ButtonProps) => (
|
|
33
|
-
<StyledButton
|
|
34
|
-
|
|
36
|
+
<StyledButton
|
|
37
|
+
styleType={type}
|
|
38
|
+
align={align}
|
|
39
|
+
{...delegated}
|
|
40
|
+
>
|
|
41
|
+
{iconLeft && (
|
|
42
|
+
<Icon
|
|
43
|
+
name={iconLeft}
|
|
44
|
+
size="small"
|
|
45
|
+
/>
|
|
46
|
+
)}
|
|
35
47
|
{label ? label : children}
|
|
36
|
-
{iconRight &&
|
|
48
|
+
{iconRight && (
|
|
49
|
+
<Icon
|
|
50
|
+
name={iconRight}
|
|
51
|
+
size="small"
|
|
52
|
+
/>
|
|
53
|
+
)}
|
|
37
54
|
</StyledButton>
|
|
38
55
|
);
|
|
39
56
|
|
|
@@ -41,57 +58,58 @@ const BaseButton = styled.button`
|
|
|
41
58
|
display: flex;
|
|
42
59
|
flex-direction: row;
|
|
43
60
|
justify-content: center;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
padding-left: ${props => props.theme.click.button.basic.space.x};
|
|
47
|
-
padding-right: ${props => props.theme.click.button.basic.space.x};
|
|
48
|
-
padding-top: ${props => props.theme.click.button.basic.space.y};
|
|
49
|
-
padding-bottom: ${props => props.theme.click.button.basic.space.y};
|
|
61
|
+
padding: ${props =>
|
|
62
|
+
`${props.theme.click.button.basic.space.y} ${props.theme.click.button.basic.space.x}`};
|
|
50
63
|
border-radius: ${props => props.theme.click.button.radii.all};
|
|
51
64
|
gap: ${props => props.theme.click.button.basic.space.gap};
|
|
52
65
|
cursor: pointer;
|
|
53
66
|
`;
|
|
54
67
|
|
|
55
|
-
const StyledButton = styled(BaseButton)<
|
|
68
|
+
const StyledButton = styled(BaseButton)<
|
|
69
|
+
Pick<StyledButtonProps, "width" | "height" | "align" | "styleType">
|
|
70
|
+
>`
|
|
56
71
|
width: ${props => props.width};
|
|
57
72
|
height: ${props => props.height};
|
|
73
|
+
font: ${props => props.theme.click.button.basic.typography.label.default};
|
|
74
|
+
color: ${({ styleType = "primary", theme }) =>
|
|
75
|
+
theme.click.button.basic.color[styleType].text.default};
|
|
76
|
+
background-color: ${({ styleType = "primary", theme }) =>
|
|
77
|
+
theme.click.button.basic.color[styleType].background.default};
|
|
78
|
+
border: 1px solid
|
|
79
|
+
${({ styleType = "primary", theme }) =>
|
|
80
|
+
theme.click.button.basic.color[styleType].stroke.default};
|
|
58
81
|
|
|
59
82
|
display: flex;
|
|
60
83
|
align-items: center;
|
|
61
|
-
justify-content: ${props =>
|
|
62
|
-
props.align === "left" ? "flex-start" : "center"};
|
|
84
|
+
justify-content: ${props => (props.align === "left" ? "flex-start" : "center")};
|
|
63
85
|
|
|
64
|
-
|
|
65
|
-
${
|
|
66
|
-
|
|
67
|
-
background-color: ${props =>
|
|
68
|
-
props.theme.click.button.basic.color[props.styleType].background.default};
|
|
69
|
-
color: ${props =>
|
|
70
|
-
props.theme.click.button.basic.color[props.styleType].text.default};
|
|
71
|
-
font: ${props => props.theme.click.button.basic.typography.label.default};
|
|
72
|
-
|
|
73
|
-
&:active {
|
|
86
|
+
&:hover {
|
|
87
|
+
background-color: ${({ styleType = "primary", theme }) =>
|
|
88
|
+
theme.click.button.basic.color[styleType].background.hover};
|
|
74
89
|
border: 1px solid
|
|
75
|
-
${
|
|
76
|
-
|
|
77
|
-
background-color: ${props =>
|
|
78
|
-
props.theme.click.button.basic.color[props.styleType].background.active};
|
|
79
|
-
font: ${props => props.theme.click.button.basic.typography.label.active};
|
|
90
|
+
${({ styleType = "primary", theme }) =>
|
|
91
|
+
theme.click.button.basic.color[styleType].stroke.hover};
|
|
80
92
|
}
|
|
81
93
|
|
|
82
|
-
&:
|
|
94
|
+
&:active,
|
|
95
|
+
&:focus {
|
|
96
|
+
background-color: ${({ styleType = "primary", theme }) =>
|
|
97
|
+
theme.click.button.basic.color[styleType].background.active};
|
|
83
98
|
border: 1px solid
|
|
84
|
-
${
|
|
85
|
-
|
|
86
|
-
background-color: ${props =>
|
|
87
|
-
props.theme.click.button.basic.color[props.styleType].background.hover};
|
|
88
|
-
font: ${props => props.theme.click.button.basic.typography.label.hover};
|
|
99
|
+
${({ styleType = "primary", theme }) =>
|
|
100
|
+
theme.click.button.basic.color[styleType].stroke.active};
|
|
89
101
|
}
|
|
90
102
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
color: ${
|
|
95
|
-
|
|
103
|
+
&:disabled,
|
|
104
|
+
&:disabled:hover,
|
|
105
|
+
&:disabled:active {
|
|
106
|
+
background-color: ${({ styleType = "primary", theme }) =>
|
|
107
|
+
theme.click.button.basic.color[styleType].background.disabled};
|
|
108
|
+
color: ${({ styleType = "primary", theme }) =>
|
|
109
|
+
theme.click.button.basic.color[styleType].text.disabled};
|
|
110
|
+
border: 1px solid
|
|
111
|
+
${({ styleType = "primary", theme }) =>
|
|
112
|
+
theme.click.button.basic.color[styleType].stroke.disabled};
|
|
113
|
+
cursor: not-allowed;
|
|
96
114
|
}
|
|
97
115
|
`;
|
|
@@ -2,11 +2,11 @@ import { ButtonGroup } from "./ButtonGroup";
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
component: ButtonGroup,
|
|
5
|
-
title: "ButtonGroup",
|
|
6
|
-
tags: ["
|
|
5
|
+
title: "Buttons/ButtonGroup",
|
|
6
|
+
tags: ["button-group", "autodocs"],
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export const
|
|
9
|
+
export const Playground = {
|
|
10
10
|
args: {
|
|
11
11
|
labels: ["Button 1", "Button 2", "Button 3"],
|
|
12
12
|
activeIndex: 2,
|
|
@@ -2,11 +2,11 @@ import { Card } from "./Card";
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
component: Card,
|
|
5
|
-
title: "Card",
|
|
6
|
-
tags: ["card"],
|
|
5
|
+
title: "Display/Card",
|
|
6
|
+
tags: ["card","autodocs"],
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export const
|
|
9
|
+
export const Playground = {
|
|
10
10
|
args: {
|
|
11
11
|
title: "Card title",
|
|
12
12
|
badgeText: "experiment",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Checkbox } from "./Checkbox";
|
|
2
|
+
|
|
3
|
+
const CheckboxComponent = ({
|
|
4
|
+
checked,
|
|
5
|
+
...props
|
|
6
|
+
}: {
|
|
7
|
+
checked: "default" | "checked" | "unchecked";
|
|
8
|
+
disabled: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
}) => {
|
|
11
|
+
return (
|
|
12
|
+
<Checkbox
|
|
13
|
+
checked={checked === "default" ? undefined : checked === "checked"}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
export default {
|
|
19
|
+
component: CheckboxComponent,
|
|
20
|
+
title: "Forms/Checkbox",
|
|
21
|
+
tags: ["checkbox","autodocs"],
|
|
22
|
+
argTypes: {
|
|
23
|
+
checked: { control: "radio", options: ["default", "checked", "unchecked"] },
|
|
24
|
+
disabled: { control: "boolean" },
|
|
25
|
+
label: { control: "text" },
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Playground = {
|
|
30
|
+
args: {
|
|
31
|
+
label: "Accept terms and conditions",
|
|
32
|
+
disabled: false,
|
|
33
|
+
checked: "default",
|
|
34
|
+
},
|
|
35
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ThemeProvider } from "styled-components";
|
|
2
|
+
import { themes } from "../../theme";
|
|
3
|
+
import { render, fireEvent } from "@testing-library/react";
|
|
4
|
+
import { Checkbox } from "@/components";
|
|
5
|
+
import { CheckboxProps } from "@/components/Checkbox/Checkbox";
|
|
6
|
+
|
|
7
|
+
describe("Checkbox", () => {
|
|
8
|
+
const renderCheckbox = (props: CheckboxProps) =>
|
|
9
|
+
render(
|
|
10
|
+
<ThemeProvider theme={themes.dark}>
|
|
11
|
+
<Checkbox {...props} />
|
|
12
|
+
</ThemeProvider>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
it("should execute action on click", () => {
|
|
16
|
+
let counter = 0;
|
|
17
|
+
const handleClick = () => counter++;
|
|
18
|
+
const { getByTestId } = renderCheckbox({
|
|
19
|
+
onCheckedChange: handleClick,
|
|
20
|
+
label: "Accept terms and conditions",
|
|
21
|
+
});
|
|
22
|
+
const checkbox = getByTestId("checkbox");
|
|
23
|
+
fireEvent.click(checkbox);
|
|
24
|
+
|
|
25
|
+
expect(counter).toEqual(1);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("should not execute action on click if the checkbox is disabled", () => {
|
|
29
|
+
let counter = 0;
|
|
30
|
+
const handleClick = () => counter++;
|
|
31
|
+
const { getByTestId } = renderCheckbox({
|
|
32
|
+
onCheckedChange: handleClick,
|
|
33
|
+
label: "Accept terms and conditions",
|
|
34
|
+
disabled: true,
|
|
35
|
+
});
|
|
36
|
+
const checkbox = getByTestId("checkbox");
|
|
37
|
+
fireEvent.click(checkbox);
|
|
38
|
+
|
|
39
|
+
expect(counter).toEqual(0);
|
|
40
|
+
});
|
|
41
|
+
});
|