@clickhouse/click-ui 0.0.3 → 0.0.4
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/dist/{index.js → click-ui.es.js} +4553 -5052
- package/dist/click-ui.umd.js +442 -0
- package/package.json +14 -6
- package/.eslintrc.cjs +0 -33
- package/.github/workflows/deployment.yml +0 -34
- package/.prettierrc +0 -14
- package/.storybook/main.ts +0 -19
- package/.storybook/manager.ts +0 -11
- package/.storybook/preview-head.html +0 -2
- package/.storybook/preview.tsx +0 -76
- package/.storybook/theme.ts +0 -16
- package/build-tokens.js +0 -131
- package/dist/App.d.ts +0 -2
- package/dist/assets/RightArrow/RightArrow.d.ts +0 -1
- package/dist/assets/S3Logo/S3Logo.d.ts +0 -1
- package/dist/components/Accordion/Accordion.d.ts +0 -27
- package/dist/components/Accordion/Accordion.stories.d.ts +0 -21
- package/dist/components/Accordion/Accordion.test.d.ts +0 -1
- package/dist/components/Alert/Alert.d.ts +0 -16
- package/dist/components/Alert/Alert.stories.d.ts +0 -12
- package/dist/components/Alert/Alert.test.d.ts +0 -1
- package/dist/components/Avatar/Avatar.d.ts +0 -7
- package/dist/components/Avatar/Avatar.stories.d.ts +0 -11
- package/dist/components/Badge/Badge.d.ts +0 -16
- package/dist/components/Badge/Badge.stories.d.ts +0 -34
- package/dist/components/Badge/Badge.test.d.ts +0 -1
- package/dist/components/BigStat/BigStat.d.ts +0 -10
- package/dist/components/BigStat/BigStat.stories.d.ts +0 -20
- package/dist/components/Button/Button.d.ts +0 -23
- package/dist/components/Button/Button.stories.d.ts +0 -28
- package/dist/components/Button/Button.test.d.ts +0 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +0 -6
- package/dist/components/ButtonGroup/ButtonGroup.stories.d.ts +0 -12
- package/dist/components/Card/Card.d.ts +0 -10
- package/dist/components/Card/Card.stories.d.ts +0 -16
- package/dist/components/Checkbox/Checkbox.d.ts +0 -5
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -29
- package/dist/components/Checkbox/Checkbox.test.d.ts +0 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +0 -38
- package/dist/components/ContextMenu/ContextMenu.stories.d.ts +0 -30
- package/dist/components/ContextMenu/ContextMenu.test.d.ts +0 -1
- package/dist/components/Dropdown/Dropdown.d.ts +0 -38
- package/dist/components/Dropdown/Dropdown.stories.d.ts +0 -36
- package/dist/components/Dropdown/Dropdown.test.d.ts +0 -1
- package/dist/components/FormField/Label.d.ts +0 -7
- package/dist/components/FormField/Label.stories.d.ts +0 -28
- package/dist/components/FormField/Select.d.ts +0 -43
- package/dist/components/FormField/Select.stories.d.ts +0 -54
- package/dist/components/FormField/Select.test.d.ts +0 -0
- package/dist/components/FormField/SelectContext.d.ts +0 -24
- package/dist/components/FormField/commonElement.d.ts +0 -1100
- package/dist/components/GenericMenu.d.ts +0 -764
- package/dist/components/HoverCard/HoverCard.d.ts +0 -20
- package/dist/components/HoverCard/HoverCard.stories.d.ts +0 -36
- package/dist/components/HoverCard/HoverCard.test.d.ts +0 -0
- package/dist/components/Icon/Icon.d.ts +0 -571
- package/dist/components/Icon/Icon.stories.d.ts +0 -495
- package/dist/components/Icon/types.d.ts +0 -8
- package/dist/components/IconButton/IconButton.d.ts +0 -15
- package/dist/components/IconButton/IconButton.stories.d.ts +0 -30
- package/dist/components/IconButton/IconButton.test.d.ts +0 -1
- package/dist/components/Panel/Panel.d.ts +0 -11
- package/dist/components/Panel/Panel.stories.d.ts +0 -23
- package/dist/components/Popover/Popover.d.ts +0 -23
- package/dist/components/Popover/Popover.stories.d.ts +0 -43
- package/dist/components/Popover/Popover.test.d.ts +0 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +0 -17
- package/dist/components/RadioGroup/RadioGroup.stories.d.ts +0 -39
- package/dist/components/RadioGroup/RadioGroup.test.d.ts +0 -1
- package/dist/components/Separator/Separator.d.ts +0 -6
- package/dist/components/SidebarNavigationItem/SidebarNavigationItem.d.ts +0 -17
- package/dist/components/SidebarNavigationItem/SidebarNavigationItem.stories.d.ts +0 -20
- package/dist/components/Spacer/Spacer.d.ts +0 -4
- package/dist/components/Spacer/Spacer.stories.d.ts +0 -19
- package/dist/components/Switch/Switch.d.ts +0 -7
- package/dist/components/Switch/Switch.stories.d.ts +0 -13
- package/dist/components/Table/Table.d.ts +0 -568
- package/dist/components/Table/Table.stories.d.ts +0 -575
- package/dist/components/Tabs/Tabs.d.ts +0 -848
- package/dist/components/Tabs/Tabs.stories.d.ts +0 -845
- package/dist/components/Tabs/Tabs.test.d.ts +0 -1
- package/dist/components/Tooltip/Tooltip.d.ts +0 -17
- package/dist/components/Tooltip/Tooltip.stories.d.ts +0 -45
- package/dist/components/Tooltip/Tooltip.test.d.ts +0 -1
- package/dist/components/Typography/Text/Text.d.ts +0 -12
- package/dist/components/Typography/Text/Text.stories.d.ts +0 -22
- package/dist/components/Typography/Text/Text.test.d.ts +0 -1
- package/dist/components/Typography/Title/Title.d.ts +0 -14
- package/dist/components/Typography/Title/Title.stories.d.ts +0 -35
- package/dist/components/Typography/Title/Title.test.d.ts +0 -1
- package/dist/components/icons/Activity.d.ts +0 -3
- package/dist/components/icons/ArrowDown.d.ts +0 -3
- package/dist/components/icons/ArrowRight.d.ts +0 -3
- package/dist/components/icons/ArrowTriangle.d.ts +0 -3
- package/dist/components/icons/ArrowUp.d.ts +0 -3
- package/dist/components/icons/Backups.d.ts +0 -3
- package/dist/components/icons/Blog.d.ts +0 -3
- package/dist/components/icons/Book.d.ts +0 -3
- package/dist/components/icons/Brackets.d.ts +0 -3
- package/dist/components/icons/Briefcase.d.ts +0 -3
- package/dist/components/icons/Building.d.ts +0 -3
- package/dist/components/icons/BurgerMenu.d.ts +0 -3
- package/dist/components/icons/Cards.d.ts +0 -3
- package/dist/components/icons/CellTower.d.ts +0 -3
- package/dist/components/icons/ChatIcon.d.ts +0 -3
- package/dist/components/icons/CheckIcon.d.ts +0 -3
- package/dist/components/icons/CheckInCircle.d.ts +0 -3
- package/dist/components/icons/ChevronDown.d.ts +0 -2
- package/dist/components/icons/ChevronLeft.d.ts +0 -3
- package/dist/components/icons/ChevronRight.d.ts +0 -2
- package/dist/components/icons/ChevronUp.d.ts +0 -3
- package/dist/components/icons/Clock.d.ts +0 -3
- package/dist/components/icons/Cloud.d.ts +0 -3
- package/dist/components/icons/Code.d.ts +0 -3
- package/dist/components/icons/CodeInSquare.d.ts +0 -3
- package/dist/components/icons/Connect.d.ts +0 -3
- package/dist/components/icons/ConnectAlt.d.ts +0 -3
- package/dist/components/icons/Console.d.ts +0 -3
- package/dist/components/icons/Copy.d.ts +0 -3
- package/dist/components/icons/CrossIcon.d.ts +0 -3
- package/dist/components/icons/Data.d.ts +0 -3
- package/dist/components/icons/DatabaseIcon.d.ts +0 -3
- package/dist/components/icons/Disk.d.ts +0 -3
- package/dist/components/icons/Display.d.ts +0 -3
- package/dist/components/icons/Document.d.ts +0 -3
- package/dist/components/icons/DotsHorizontal.d.ts +0 -3
- package/dist/components/icons/DotsVertical.d.ts +0 -3
- package/dist/components/icons/Email.d.ts +0 -3
- package/dist/components/icons/Empty.d.ts +0 -3
- package/dist/components/icons/FilterIcon.d.ts +0 -3
- package/dist/components/icons/Fire.d.ts +0 -3
- package/dist/components/icons/Flags/EuropeanUnion.d.ts +0 -3
- package/dist/components/icons/Flags/Germany.d.ts +0 -3
- package/dist/components/icons/Flags/India.d.ts +0 -3
- package/dist/components/icons/Flags/Ireland.d.ts +0 -3
- package/dist/components/icons/Flags/Netherlands.d.ts +0 -3
- package/dist/components/icons/Flags/Singapore.d.ts +0 -2
- package/dist/components/icons/Flags/UnitedKingdom.d.ts +0 -3
- package/dist/components/icons/Flags/UnitedStates.d.ts +0 -3
- package/dist/components/icons/Flags/index.d.ts +0 -6
- package/dist/components/icons/Folder.d.ts +0 -3
- package/dist/components/icons/Gift.d.ts +0 -3
- package/dist/components/icons/HistoryIcon.d.ts +0 -3
- package/dist/components/icons/Home.d.ts +0 -3
- package/dist/components/icons/Http.d.ts +0 -3
- package/dist/components/icons/InfoInCircleIcon.d.ts +0 -3
- package/dist/components/icons/InformationIcon.d.ts +0 -3
- package/dist/components/icons/InsertRowIcon.d.ts +0 -3
- package/dist/components/icons/Integrations.d.ts +0 -3
- package/dist/components/icons/LightBulb.d.ts +0 -3
- package/dist/components/icons/Lightening.d.ts +0 -3
- package/dist/components/icons/Loading.d.ts +0 -3
- package/dist/components/icons/Metrics.d.ts +0 -3
- package/dist/components/icons/MetricsAlt.d.ts +0 -3
- package/dist/components/icons/Payment.d.ts +0 -3
- package/dist/components/icons/Payments/Amex.d.ts +0 -3
- package/dist/components/icons/Payments/MasterCard.d.ts +0 -3
- package/dist/components/icons/Payments/Paypal.d.ts +0 -3
- package/dist/components/icons/Payments/Visa.d.ts +0 -3
- package/dist/components/icons/Payments/index.d.ts +0 -6
- package/dist/components/icons/Pencil.d.ts +0 -3
- package/dist/components/icons/PieChart.d.ts +0 -3
- package/dist/components/icons/Play.d.ts +0 -3
- package/dist/components/icons/Plus.d.ts +0 -3
- package/dist/components/icons/Popout.d.ts +0 -3
- package/dist/components/icons/PopoverArrow.d.ts +0 -3
- package/dist/components/icons/Question.d.ts +0 -3
- package/dist/components/icons/Refresh.d.ts +0 -3
- package/dist/components/icons/Search.d.ts +0 -3
- package/dist/components/icons/Secure.d.ts +0 -3
- package/dist/components/icons/Services.d.ts +0 -3
- package/dist/components/icons/Settings.d.ts +0 -3
- package/dist/components/icons/Share.d.ts +0 -3
- package/dist/components/icons/SlideIn.d.ts +0 -3
- package/dist/components/icons/SlideOut.d.ts +0 -3
- package/dist/components/icons/SortAltIcon.d.ts +0 -3
- package/dist/components/icons/SortIcon.d.ts +0 -3
- package/dist/components/icons/Sparkle.d.ts +0 -3
- package/dist/components/icons/Speaker.d.ts +0 -3
- package/dist/components/icons/Speed.d.ts +0 -3
- package/dist/components/icons/Star.d.ts +0 -3
- package/dist/components/icons/Support.d.ts +0 -3
- package/dist/components/icons/Table.d.ts +0 -3
- package/dist/components/icons/Taxi.d.ts +0 -3
- package/dist/components/icons/Trash.d.ts +0 -3
- package/dist/components/icons/Upload.d.ts +0 -3
- package/dist/components/icons/Url.d.ts +0 -3
- package/dist/components/icons/UserIcon.d.ts +0 -2
- package/dist/components/icons/UsersIcon.d.ts +0 -2
- package/dist/components/icons/WarningIcon.d.ts +0 -3
- package/dist/components/index.d.ts +0 -24
- package/dist/components/types.d.ts +0 -1
- package/dist/index.cjs +0 -442
- package/dist/index.d.ts +0 -2
- package/dist/main.d.ts +0 -0
- package/dist/styles/types.d.ts +0 -2087
- package/dist/styles/variables.classic.json.d.ts +0 -204
- package/dist/styles/variables.dark.json.d.ts +0 -896
- package/dist/styles/variables.json.d.ts +0 -2089
- package/dist/styles/variables.light.json.d.ts +0 -951
- package/dist/theme/index.d.ts +0 -10
- package/dist/theme/theme.d.ts +0 -6
- package/index.html +0 -17
- package/jest.config.ts +0 -11
- package/public/favicon.ico +0 -0
- package/public/logo.svg +0 -17
- package/public/vite.svg +0 -1
- package/src/App.css +0 -1
- package/src/App.module.css +0 -235
- package/src/App.tsx +0 -217
- package/src/assets/RightArrow/RightArrow.tsx +0 -17
- package/src/assets/S3Logo/S3Logo.tsx +0 -31
- package/src/assets/react.svg +0 -1
- package/src/components/Accordion/Accordion.stories.tsx +0 -28
- package/src/components/Accordion/Accordion.test.tsx +0 -46
- package/src/components/Accordion/Accordion.tsx +0 -119
- package/src/components/Alert/Alert.stories.tsx +0 -14
- package/src/components/Alert/Alert.test.tsx +0 -27
- package/src/components/Alert/Alert.tsx +0 -130
- package/src/components/Avatar/Avatar.stories.tsx +0 -13
- package/src/components/Avatar/Avatar.tsx +0 -64
- package/src/components/Badge/Badge.stories.ts +0 -30
- package/src/components/Badge/Badge.test.tsx +0 -16
- package/src/components/Badge/Badge.tsx +0 -78
- package/src/components/BigStat/BigStat.stories.ts +0 -20
- package/src/components/BigStat/BigStat.tsx +0 -49
- package/src/components/Button/Button.stories.ts +0 -26
- package/src/components/Button/Button.test.tsx +0 -32
- package/src/components/Button/Button.tsx +0 -115
- package/src/components/ButtonGroup/ButtonGroup.stories.ts +0 -14
- package/src/components/ButtonGroup/ButtonGroup.tsx +0 -78
- package/src/components/Card/Card.stories.ts +0 -19
- package/src/components/Card/Card.tsx +0 -107
- package/src/components/Checkbox/Checkbox.stories.tsx +0 -35
- package/src/components/Checkbox/Checkbox.test.tsx +0 -41
- package/src/components/Checkbox/Checkbox.tsx +0 -89
- package/src/components/ContextMenu/ContextMenu.stories.tsx +0 -73
- package/src/components/ContextMenu/ContextMenu.test.tsx +0 -152
- package/src/components/ContextMenu/ContextMenu.tsx +0 -155
- package/src/components/Dropdown/Dropdown.stories.tsx +0 -64
- package/src/components/Dropdown/Dropdown.test.tsx +0 -141
- package/src/components/Dropdown/Dropdown.tsx +0 -149
- package/src/components/FormField/Label.stories.tsx +0 -39
- package/src/components/FormField/Label.tsx +0 -47
- package/src/components/FormField/Select.stories.tsx +0 -48
- package/src/components/FormField/Select.test.tsx +0 -216
- package/src/components/FormField/Select.tsx +0 -574
- package/src/components/FormField/SelectContext.tsx +0 -101
- package/src/components/FormField/commonElement.tsx +0 -42
- package/src/components/GenericMenu.tsx +0 -114
- package/src/components/HoverCard/HoverCard.stories.tsx +0 -64
- package/src/components/HoverCard/HoverCard.test.tsx +0 -85
- package/src/components/HoverCard/HoverCard.tsx +0 -65
- package/src/components/Icon/Icon.stories.ts +0 -15
- package/src/components/Icon/Icon.tsx +0 -238
- package/src/components/Icon/types.ts +0 -95
- package/src/components/IconButton/IconButton.stories.ts +0 -34
- package/src/components/IconButton/IconButton.test.tsx +0 -32
- package/src/components/IconButton/IconButton.tsx +0 -83
- package/src/components/Panel/Panel.stories.tsx +0 -25
- package/src/components/Panel/Panel.tsx +0 -33
- package/src/components/Popover/Popover.stories.tsx +0 -67
- package/src/components/Popover/Popover.test.tsx +0 -46
- package/src/components/Popover/Popover.tsx +0 -115
- package/src/components/RadioGroup/RadioGroup.stories.tsx +0 -43
- package/src/components/RadioGroup/RadioGroup.test.tsx +0 -59
- package/src/components/RadioGroup/RadioGroup.tsx +0 -149
- package/src/components/Separator/Separator.stories.tsx +0 -24
- package/src/components/Separator/Separator.tsx +0 -29
- package/src/components/SidebarNavigationItem/SidebarNavigationItem.stories.tsx +0 -28
- package/src/components/SidebarNavigationItem/SidebarNavigationItem.tsx +0 -112
- package/src/components/Spacer/Spacer.stories.tsx +0 -20
- package/src/components/Spacer/Spacer.tsx +0 -15
- package/src/components/Switch/Switch.stories.ts +0 -14
- package/src/components/Switch/Switch.tsx +0 -107
- package/src/components/Table/Table.stories.tsx +0 -29
- package/src/components/Table/Table.tsx +0 -109
- package/src/components/Tabs/Tabs.stories.tsx +0 -36
- package/src/components/Tabs/Tabs.test.tsx +0 -86
- package/src/components/Tabs/Tabs.tsx +0 -82
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -68
- package/src/components/Tooltip/Tooltip.test.tsx +0 -44
- package/src/components/Tooltip/Tooltip.tsx +0 -67
- package/src/components/Typography/Text/Text.stories.tsx +0 -22
- package/src/components/Typography/Text/Text.test.tsx +0 -16
- package/src/components/Typography/Text/Text.tsx +0 -30
- package/src/components/Typography/Title/Title.stories.tsx +0 -31
- package/src/components/Typography/Title/Title.test.tsx +0 -16
- package/src/components/Typography/Title/Title.tsx +0 -36
- package/src/components/icons/Activity.tsx +0 -30
- package/src/components/icons/ArrowDown.tsx +0 -22
- package/src/components/icons/ArrowRight.tsx +0 -22
- package/src/components/icons/ArrowTriangle.tsx +0 -36
- package/src/components/icons/ArrowUp.tsx +0 -22
- package/src/components/icons/Backups.tsx +0 -29
- package/src/components/icons/Blog.tsx +0 -38
- package/src/components/icons/Book.tsx +0 -30
- package/src/components/icons/Brackets.tsx +0 -22
- package/src/components/icons/Briefcase.tsx +0 -30
- package/src/components/icons/Building.tsx +0 -30
- package/src/components/icons/BurgerMenu.tsx +0 -22
- package/src/components/icons/Cards.tsx +0 -30
- package/src/components/icons/CellTower.tsx +0 -21
- package/src/components/icons/ChatIcon.tsx +0 -22
- package/src/components/icons/CheckIcon.tsx +0 -21
- package/src/components/icons/CheckInCircle.tsx +0 -39
- package/src/components/icons/ChevronDown.tsx +0 -20
- package/src/components/icons/ChevronLeft.tsx +0 -22
- package/src/components/icons/ChevronRight.tsx +0 -20
- package/src/components/icons/ChevronUp.tsx +0 -22
- package/src/components/icons/Clock.tsx +0 -37
- package/src/components/icons/Cloud.tsx +0 -23
- package/src/components/icons/Code.tsx +0 -22
- package/src/components/icons/CodeInSquare.tsx +0 -30
- package/src/components/icons/Connect.tsx +0 -22
- package/src/components/icons/ConnectAlt.tsx +0 -30
- package/src/components/icons/Console.tsx +0 -30
- package/src/components/icons/Copy.tsx +0 -33
- package/src/components/icons/CrossIcon.tsx +0 -29
- package/src/components/icons/Data.tsx +0 -36
- package/src/components/icons/DatabaseIcon.tsx +0 -31
- package/src/components/icons/Disk.tsx +0 -30
- package/src/components/icons/Display.tsx +0 -30
- package/src/components/icons/Document.tsx +0 -30
- package/src/components/icons/DotsHorizontal.tsx +0 -36
- package/src/components/icons/DotsVertical.tsx +0 -33
- package/src/components/icons/Email.tsx +0 -33
- package/src/components/icons/Empty.tsx +0 -14
- package/src/components/icons/FilterIcon.tsx +0 -37
- package/src/components/icons/Fire.tsx +0 -23
- package/src/components/icons/Flags/EuropeanUnion.tsx +0 -174
- package/src/components/icons/Flags/Germany.tsx +0 -25
- package/src/components/icons/Flags/India.tsx +0 -48
- package/src/components/icons/Flags/Ireland.tsx +0 -32
- package/src/components/icons/Flags/Netherlands.tsx +0 -29
- package/src/components/icons/Flags/Singapore.tsx +0 -43
- package/src/components/icons/Flags/UnitedKingdom.tsx +0 -32
- package/src/components/icons/Flags/UnitedStates.tsx +0 -26
- package/src/components/icons/Flags/index.tsx +0 -46
- package/src/components/icons/Folder.tsx +0 -20
- package/src/components/icons/Gift.tsx +0 -21
- package/src/components/icons/HistoryIcon.tsx +0 -28
- package/src/components/icons/Home.tsx +0 -29
- package/src/components/icons/Http.tsx +0 -22
- package/src/components/icons/Icons.mdx +0 -39
- package/src/components/icons/InfoInCircleIcon.tsx +0 -37
- package/src/components/icons/InformationIcon.tsx +0 -34
- package/src/components/icons/InsertRowIcon.tsx +0 -34
- package/src/components/icons/Integrations.tsx +0 -29
- package/src/components/icons/LightBulb.tsx +0 -40
- package/src/components/icons/Lightening.tsx +0 -30
- package/src/components/icons/Loading.tsx +0 -57
- package/src/components/icons/Metrics.tsx +0 -38
- package/src/components/icons/MetricsAlt.tsx +0 -30
- package/src/components/icons/Payment.tsx +0 -23
- package/src/components/icons/Payments/Amex.tsx +0 -44
- package/src/components/icons/Payments/MasterCard.tsx +0 -48
- package/src/components/icons/Payments/Paypal.tsx +0 -41
- package/src/components/icons/Payments/Visa.tsx +0 -36
- package/src/components/icons/Payments/index.tsx +0 -30
- package/src/components/icons/Pencil.tsx +0 -30
- package/src/components/icons/PieChart.tsx +0 -30
- package/src/components/icons/Play.tsx +0 -30
- package/src/components/icons/Plus.tsx +0 -22
- package/src/components/icons/Popout.tsx +0 -22
- package/src/components/icons/PopoverArrow.tsx +0 -22
- package/src/components/icons/Question.tsx +0 -30
- package/src/components/icons/Refresh.tsx +0 -29
- package/src/components/icons/Search.tsx +0 -22
- package/src/components/icons/Secure.tsx +0 -30
- package/src/components/icons/Services.tsx +0 -23
- package/src/components/icons/Settings.tsx +0 -22
- package/src/components/icons/Share.tsx +0 -29
- package/src/components/icons/SlideIn.tsx +0 -28
- package/src/components/icons/SlideOut.tsx +0 -28
- package/src/components/icons/SortAltIcon.tsx +0 -22
- package/src/components/icons/SortIcon.tsx +0 -24
- package/src/components/icons/Sparkle.tsx +0 -23
- package/src/components/icons/Speaker.tsx +0 -30
- package/src/components/icons/Speed.tsx +0 -29
- package/src/components/icons/Star.tsx +0 -23
- package/src/components/icons/Support.tsx +0 -37
- package/src/components/icons/Table.tsx +0 -30
- package/src/components/icons/Taxi.tsx +0 -120
- package/src/components/icons/Trash.tsx +0 -22
- package/src/components/icons/Upload.tsx +0 -29
- package/src/components/icons/Url.tsx +0 -22
- package/src/components/icons/UserIcon.tsx +0 -17
- package/src/components/icons/UsersIcon.tsx +0 -43
- package/src/components/icons/WarningIcon.tsx +0 -30
- package/src/components/index.ts +0 -35
- package/src/components/types.ts +0 -1
- package/src/index.css +0 -9
- package/src/index.ts +0 -2
- package/src/main.tsx +0 -11
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/styles/Home.module.css +0 -235
- package/src/styles/globals.css +0 -111
- package/src/styles/types.ts +0 -2089
- package/src/styles/variables.classic.css +0 -16
- package/src/styles/variables.classic.json +0 -202
- package/src/styles/variables.css +0 -763
- package/src/styles/variables.dark.css +0 -135
- package/src/styles/variables.dark.json +0 -894
- package/src/styles/variables.json +0 -2087
- package/src/styles/variables.light.css +0 -203
- package/src/styles/variables.light.json +0 -949
- package/src/theme/index.ts +0 -22
- package/src/theme/theme.tsx +0 -28
- package/src/vite-env.d.ts +0 -1
- package/tokens/themes/$metadata.json +0 -9
- package/tokens/themes/$themes.json +0 -3657
- package/tokens/themes/classic.json +0 -550
- package/tokens/themes/component.json +0 -2252
- package/tokens/themes/dark.json +0 -2563
- package/tokens/themes/light.json +0 -2645
- package/tokens/themes/primitives.json +0 -947
- package/tsconfig.json +0 -27
- package/tsconfig.node.json +0 -10
- package/vite.config.ts +0 -40
package/src/assets/react.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Accordion } from "./Accordion";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
component: Accordion,
|
|
5
|
-
title: "Display/Accordion",
|
|
6
|
-
tags: ["accordion", "autodocs"],
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const children = (
|
|
10
|
-
<div style={{ padding: "8px", border: "1px solid #f1f1f1" }}>
|
|
11
|
-
<h2>Content</h2>
|
|
12
|
-
<p>
|
|
13
|
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
|
14
|
-
Lorem Ipsum has been the industry's standard Lorem Ipsum is simply dummy
|
|
15
|
-
text of the printing and typesetting industry. Lorem Ipsum has been the
|
|
16
|
-
industry's standard Lorem Ipsum is simply dummy text of the printing and
|
|
17
|
-
typesetting industry. Lorem Ipsum has been the industry's standard
|
|
18
|
-
</p>
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
export const Playground = {
|
|
22
|
-
args: {
|
|
23
|
-
title: "Accordion title",
|
|
24
|
-
theme: "light",
|
|
25
|
-
size: "medium",
|
|
26
|
-
children,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { render, fireEvent } from "@testing-library/react";
|
|
2
|
-
import { Accordion } from "./Accordion";
|
|
3
|
-
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import { themes } from "../../theme";
|
|
5
|
-
|
|
6
|
-
interface RenderAccordionProps {
|
|
7
|
-
title: string;
|
|
8
|
-
content?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
describe("Accordion", () => {
|
|
12
|
-
const renderAccordion = ({ title, content }: RenderAccordionProps) =>
|
|
13
|
-
render(
|
|
14
|
-
<ThemeProvider theme={themes.dark}>
|
|
15
|
-
<Accordion title={title}>
|
|
16
|
-
<div>{content}</div>
|
|
17
|
-
</Accordion>
|
|
18
|
-
</ThemeProvider>
|
|
19
|
-
);
|
|
20
|
-
it("given no arguments, should render the accordion", () => {
|
|
21
|
-
const title = "Test accordion";
|
|
22
|
-
const rendered = renderAccordion({ title });
|
|
23
|
-
|
|
24
|
-
const accordion = rendered.getByText(title);
|
|
25
|
-
expect(accordion).toBeTruthy;
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("given a title, should render the accordion's title", () => {
|
|
29
|
-
const title = "Test title";
|
|
30
|
-
const rendered = renderAccordion({ title });
|
|
31
|
-
|
|
32
|
-
const accordion = rendered.getByText(title);
|
|
33
|
-
expect(accordion.textContent).toEqual(title);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it("given some content, should render the content when clicked", () => {
|
|
37
|
-
const content = "Accordion content";
|
|
38
|
-
const title = "Test title";
|
|
39
|
-
const rendered = renderAccordion({ title, content });
|
|
40
|
-
|
|
41
|
-
const accordion = rendered.getByText(title);
|
|
42
|
-
fireEvent.click(accordion);
|
|
43
|
-
const accordionContent = rendered.getByText(content);
|
|
44
|
-
expect(accordionContent.textContent).toEqual(content);
|
|
45
|
-
});
|
|
46
|
-
});
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import * as RadixAccordion from "@radix-ui/react-accordion";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
import { IconName } from "@/components/Icon/types";
|
|
4
|
-
import { Icon } from "@/components";
|
|
5
|
-
|
|
6
|
-
type Size = "small" | "medium" | "large";
|
|
7
|
-
export interface AccordionProps extends SizeProp {
|
|
8
|
-
title: string;
|
|
9
|
-
icon?: IconName;
|
|
10
|
-
iconSize?: Size;
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
interface TriggerProps extends RadixAccordion.AccordionTriggerProps, SizeProp {}
|
|
15
|
-
interface SizeProp {
|
|
16
|
-
size?: Size;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const Accordion = ({
|
|
20
|
-
title,
|
|
21
|
-
size = "medium",
|
|
22
|
-
icon,
|
|
23
|
-
iconSize,
|
|
24
|
-
children,
|
|
25
|
-
...delegated
|
|
26
|
-
}: AccordionProps) => (
|
|
27
|
-
<AccordionRoot type="single" collapsible {...delegated}>
|
|
28
|
-
<AccordionItem value="item">
|
|
29
|
-
<AccordionTrigger size={size}>
|
|
30
|
-
<AccordionIconsWrapper>
|
|
31
|
-
<AccordionIconWrapper>
|
|
32
|
-
<Icon name="chevron-right" size={iconSize || size} />
|
|
33
|
-
</AccordionIconWrapper>
|
|
34
|
-
{icon ? <Icon name={icon} size={iconSize || size} /> : null}
|
|
35
|
-
</AccordionIconsWrapper>
|
|
36
|
-
<p>{title}</p>
|
|
37
|
-
</AccordionTrigger>
|
|
38
|
-
<AccordionContent>{children}</AccordionContent>
|
|
39
|
-
</AccordionItem>
|
|
40
|
-
</AccordionRoot>
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
const AccordionRoot = styled(RadixAccordion.Root)``;
|
|
44
|
-
|
|
45
|
-
const AccordionItem = styled(RadixAccordion.Item)``;
|
|
46
|
-
|
|
47
|
-
const AccordionTrigger = styled(RadixAccordion.Trigger)<TriggerProps>`
|
|
48
|
-
border: none;
|
|
49
|
-
padding: 0;
|
|
50
|
-
background-color: transparent;
|
|
51
|
-
display: flex;
|
|
52
|
-
align-items: center;
|
|
53
|
-
gap: ${props =>
|
|
54
|
-
props.theme.click.accordion[props.size || "medium"].space.gap};
|
|
55
|
-
|
|
56
|
-
color: ${props => props.theme.click.accordion.color.label.default};
|
|
57
|
-
font: ${props =>
|
|
58
|
-
props.theme.click.accordion[props.size || "medium"].typography.label
|
|
59
|
-
.default};
|
|
60
|
-
|
|
61
|
-
&:active {
|
|
62
|
-
color: ${props => props.theme.click.accordion.color.label.active};
|
|
63
|
-
font: ${props =>
|
|
64
|
-
props.theme.click.accordion[props.size || "medium"].typography.label
|
|
65
|
-
.active};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
&:hover {
|
|
69
|
-
color: ${props => props.theme.click.accordion.color.label.hover};
|
|
70
|
-
cursor: pointer;
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
|
-
const AccordionIconWrapper = styled.div`
|
|
75
|
-
display: flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
justify-content: center;
|
|
78
|
-
transition: transform 200ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
79
|
-
|
|
80
|
-
${AccordionTrigger}[data-state='open'] & {
|
|
81
|
-
transform: rotate(90deg);
|
|
82
|
-
}
|
|
83
|
-
`;
|
|
84
|
-
const AccordionIconsWrapper = styled.div`
|
|
85
|
-
display: flex;
|
|
86
|
-
align-items: center;
|
|
87
|
-
justify-content: center;
|
|
88
|
-
`;
|
|
89
|
-
|
|
90
|
-
const AccordionContent = styled(RadixAccordion.Content)``;
|
|
91
|
-
|
|
92
|
-
const SidebarAccordion = styled(Accordion)`
|
|
93
|
-
${AccordionTrigger} {
|
|
94
|
-
gap: ${props =>
|
|
95
|
-
props.theme.click.sidebar.navigation.item.default.space.gap};
|
|
96
|
-
}
|
|
97
|
-
p {
|
|
98
|
-
margin: 0;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
${AccordionIconWrapper} {
|
|
102
|
-
visibility: hidden;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
&:hover ${AccordionIconWrapper} {
|
|
106
|
-
visibility: revert;
|
|
107
|
-
}
|
|
108
|
-
&:active ${AccordionIconWrapper} {
|
|
109
|
-
visibility: revert;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
${AccordionTrigger}[data-state='open'] ${AccordionIconWrapper} {
|
|
113
|
-
visibility: revert;
|
|
114
|
-
}
|
|
115
|
-
`;
|
|
116
|
-
// This allows the Accordion to be referenced inside other
|
|
117
|
-
// components css
|
|
118
|
-
const AccordionToExport = styled(Accordion)``;
|
|
119
|
-
export { AccordionToExport as Accordion, SidebarAccordion };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Alert } from "@/components/Alert/Alert";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
component: Alert,
|
|
5
|
-
title: "Display/Alert",
|
|
6
|
-
tags: ["alert", "autodocs"],
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const Playground = {
|
|
10
|
-
args: {
|
|
11
|
-
state: "success",
|
|
12
|
-
text: "An alert example",
|
|
13
|
-
},
|
|
14
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ThemeProvider } from "@/theme";
|
|
2
|
-
import { Alert, AlertProps } from "./Alert";
|
|
3
|
-
import { render, waitFor } from "@testing-library/react";
|
|
4
|
-
import userEvent from "@testing-library/user-event";
|
|
5
|
-
|
|
6
|
-
describe("Alert", () => {
|
|
7
|
-
const renderAlert = (props: AlertProps) =>
|
|
8
|
-
render(
|
|
9
|
-
<ThemeProvider theme="light">
|
|
10
|
-
<Alert {...props} />
|
|
11
|
-
</ThemeProvider>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
it("given a dismissible alert, should not be visible after dismissing it", async () => {
|
|
15
|
-
const text = "Test alert component";
|
|
16
|
-
const { queryAllByText, getByTestId } = renderAlert({
|
|
17
|
-
text,
|
|
18
|
-
dismissible: true,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
expect(queryAllByText(text).length).toEqual(1);
|
|
22
|
-
|
|
23
|
-
const dismissButton = getByTestId("click-alert-dismiss-button");
|
|
24
|
-
userEvent.click(dismissButton);
|
|
25
|
-
await waitFor(() => expect(queryAllByText(text).length).toEqual(0));
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { Icon } from "@/components";
|
|
2
|
-
import { IconName } from "@/components/Icon/types";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import styled from "styled-components";
|
|
5
|
-
|
|
6
|
-
type AlertSize = "small" | "medium";
|
|
7
|
-
type AlertState = "neutral" | "success" | "warning" | "danger" | "info";
|
|
8
|
-
export type AlertProps = {
|
|
9
|
-
state?: AlertState;
|
|
10
|
-
title?: string;
|
|
11
|
-
text: string;
|
|
12
|
-
size?: AlertSize;
|
|
13
|
-
showIcon?: boolean;
|
|
14
|
-
dismissible?: boolean;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const stateIconMap: Record<AlertState, IconName> = {
|
|
18
|
-
neutral: "information",
|
|
19
|
-
success: "check",
|
|
20
|
-
warning: "warning",
|
|
21
|
-
danger: "warning",
|
|
22
|
-
info: "information",
|
|
23
|
-
};
|
|
24
|
-
const Alert = ({
|
|
25
|
-
text,
|
|
26
|
-
title = "",
|
|
27
|
-
size = "small",
|
|
28
|
-
state = "neutral",
|
|
29
|
-
showIcon = true,
|
|
30
|
-
dismissible,
|
|
31
|
-
...delegated
|
|
32
|
-
}: AlertProps) => {
|
|
33
|
-
const [isVisible, setIsVisible] = useState(true);
|
|
34
|
-
|
|
35
|
-
return isVisible ? (
|
|
36
|
-
<Wrapper size={size} state={state} data-testid="click-alert" {...delegated}>
|
|
37
|
-
{showIcon && (
|
|
38
|
-
<IconWrapper state={state} size={size}>
|
|
39
|
-
<StyledIcon size={size} name={stateIconMap[state]} />
|
|
40
|
-
</IconWrapper>
|
|
41
|
-
)}
|
|
42
|
-
<TextWrapper state={state} size={size}>
|
|
43
|
-
{title && <Title size={size}>{title}</Title>}
|
|
44
|
-
<Text size={size}>{text}</Text>
|
|
45
|
-
</TextWrapper>
|
|
46
|
-
{dismissible && (
|
|
47
|
-
<DismissWrapper
|
|
48
|
-
data-testid="click-alert-dismiss-button"
|
|
49
|
-
state={state}
|
|
50
|
-
onClick={() => setIsVisible(false)}
|
|
51
|
-
>
|
|
52
|
-
<Icon name="cross" />
|
|
53
|
-
</DismissWrapper>
|
|
54
|
-
)}
|
|
55
|
-
</Wrapper>
|
|
56
|
-
) : null;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const Wrapper = styled.div<{
|
|
60
|
-
state: AlertState;
|
|
61
|
-
size: AlertSize;
|
|
62
|
-
}>`
|
|
63
|
-
display: flex;
|
|
64
|
-
border-radius: ${props => props.theme.click.alert.radii.end};
|
|
65
|
-
background-color: ${({ state = "neutral", theme }) =>
|
|
66
|
-
theme.click.alert.color.background[state]};
|
|
67
|
-
color: ${({ state = "neutral", theme }) =>
|
|
68
|
-
theme.click.alert.color.text[state]};
|
|
69
|
-
`;
|
|
70
|
-
|
|
71
|
-
const IconWrapper = styled.div<{ state: AlertState; size: AlertSize }>`
|
|
72
|
-
display: flex;
|
|
73
|
-
align-items: center;
|
|
74
|
-
background-color: ${({ state = "neutral", theme }) =>
|
|
75
|
-
theme.click.alert.color.iconBackground[state]};
|
|
76
|
-
color: ${({ state = "neutral", theme }) =>
|
|
77
|
-
theme.click.alert.color.iconForeground[state]};
|
|
78
|
-
border-top-left-radius: ${props => props.theme.click.alert.radii.end};
|
|
79
|
-
border-bottom-left-radius: ${props => props.theme.click.alert.radii.end};
|
|
80
|
-
padding: ${props =>
|
|
81
|
-
`${props.theme.click.alert[props.size].space.y} ${
|
|
82
|
-
props.theme.click.alert[props.size].space.x
|
|
83
|
-
}`};
|
|
84
|
-
`;
|
|
85
|
-
|
|
86
|
-
const StyledIcon = styled(Icon)<{ size: AlertSize }>`
|
|
87
|
-
height: ${props => props.theme.click.alert[props.size].icon.height};
|
|
88
|
-
width: ${props => props.theme.click.alert[props.size].icon.width};
|
|
89
|
-
`;
|
|
90
|
-
const TextWrapper = styled.div<{ state: AlertState; size: AlertSize }>`
|
|
91
|
-
display: flex;
|
|
92
|
-
flex-flow: column;
|
|
93
|
-
gap: ${props => props.theme.click.alert[props.size].space.gap};
|
|
94
|
-
padding: ${props =>
|
|
95
|
-
`${props.theme.click.alert[props.size].space.y} ${
|
|
96
|
-
props.theme.click.alert[props.size].space.x
|
|
97
|
-
}`};
|
|
98
|
-
`;
|
|
99
|
-
const Title = styled.h6<{ size: AlertSize }>`
|
|
100
|
-
margin: 0;
|
|
101
|
-
font: ${props =>
|
|
102
|
-
props.theme.click.alert[props.size].typography.title.default};
|
|
103
|
-
`;
|
|
104
|
-
const Text = styled.p<{ size: AlertSize }>`
|
|
105
|
-
margin: 0;
|
|
106
|
-
font: ${props => props.theme.click.alert[props.size].typography.text.default};
|
|
107
|
-
`;
|
|
108
|
-
|
|
109
|
-
const DismissWrapper = styled.button<{ state: AlertState }>`
|
|
110
|
-
display: flex;
|
|
111
|
-
align-items: center;
|
|
112
|
-
margin-left: auto;
|
|
113
|
-
border: none;
|
|
114
|
-
background-color: transparent;
|
|
115
|
-
color: inherit;
|
|
116
|
-
`;
|
|
117
|
-
|
|
118
|
-
const DangerAlert = (props: AlertProps) => <Alert {...props} state="danger" />;
|
|
119
|
-
|
|
120
|
-
const InfoAlert = (props: AlertProps) => <Alert {...props} state="info" />;
|
|
121
|
-
|
|
122
|
-
const SuccessAlert = (props: AlertProps) => (
|
|
123
|
-
<Alert {...props} state="success" />
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
const WarningAlert = (props: AlertProps) => (
|
|
127
|
-
<Alert {...props} state="warning" />
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
export { Alert, DangerAlert, InfoAlert, SuccessAlert, WarningAlert };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Fallback, Root } from "@radix-ui/react-avatar";
|
|
2
|
-
import styled from "styled-components";
|
|
3
|
-
|
|
4
|
-
type TextSize = "md" | "sm";
|
|
5
|
-
|
|
6
|
-
export type AvatarProps = {
|
|
7
|
-
text: string;
|
|
8
|
-
textSize?: TextSize;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const Avatar = ({ text = "", textSize = "sm", ...delegated }: AvatarProps) => (
|
|
12
|
-
<StyledRoot {...delegated}>
|
|
13
|
-
<StyledFallback textSize={textSize}>{text}</StyledFallback>
|
|
14
|
-
</StyledRoot>
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
const StyledRoot = styled(Root)`
|
|
18
|
-
width: ${props => props.theme.click.avatar.size.width};
|
|
19
|
-
height: ${props => props.theme.click.avatar.size.height};
|
|
20
|
-
display: inline-flex;
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
vertical-align: middle;
|
|
24
|
-
overflow: hidden;
|
|
25
|
-
user-select: none;
|
|
26
|
-
|
|
27
|
-
background-color: ${props =>
|
|
28
|
-
props.theme.click.avatar.color.background.default};
|
|
29
|
-
color: ${props => props.theme.click.avatar.color.text.default};
|
|
30
|
-
border-radius: ${props => props.theme.click.avatar.radii.all};
|
|
31
|
-
|
|
32
|
-
&:active {
|
|
33
|
-
background-color: ${props =>
|
|
34
|
-
props.theme.click.avatar.color.background.active};
|
|
35
|
-
color: ${props => props.theme.click.avatar.color.text.active};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&:hover {
|
|
39
|
-
background-color: ${props =>
|
|
40
|
-
props.theme.click.avatar.color.background.hover};
|
|
41
|
-
color: ${props => props.theme.click.avatar.color.text.hover};
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
44
|
-
|
|
45
|
-
const StyledFallback = styled(Fallback)<{ textSize: TextSize }>`
|
|
46
|
-
width: ${props => props.theme.click.avatar.size.label.width};
|
|
47
|
-
display: inline-flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
font: ${props =>
|
|
51
|
-
props.theme.click.avatar.typography.label[props.textSize || "sm"].default};
|
|
52
|
-
|
|
53
|
-
&:active {
|
|
54
|
-
font: ${props =>
|
|
55
|
-
props.theme.click.avatar.typography.label[props.textSize || "sm"].active};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&:hover {
|
|
59
|
-
font: ${props =>
|
|
60
|
-
props.theme.click.avatar.typography.label[props.textSize || "sm"].hover};
|
|
61
|
-
}
|
|
62
|
-
`;
|
|
63
|
-
|
|
64
|
-
export { Avatar };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Badge } from "./Badge";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
component: 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
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const Playground = {
|
|
24
|
-
args: {
|
|
25
|
-
text: "experiment",
|
|
26
|
-
state: "success",
|
|
27
|
-
size: "md",
|
|
28
|
-
dismissible: false,
|
|
29
|
-
},
|
|
30
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { render } from "@testing-library/react";
|
|
2
|
-
import { Badge } from "./Badge";
|
|
3
|
-
import { ThemeProvider } from "@/theme";
|
|
4
|
-
|
|
5
|
-
describe("Badge", () => {
|
|
6
|
-
test("given a text, should render it", () => {
|
|
7
|
-
const text = "text to render";
|
|
8
|
-
const rendered = render(
|
|
9
|
-
<ThemeProvider theme="light">
|
|
10
|
-
<Badge text={text} />
|
|
11
|
-
</ThemeProvider>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
expect(rendered.getByText(text).textContent).toEqual(text);
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,78 +0,0 @@
|
|
|
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";
|
|
11
|
-
|
|
12
|
-
export type BadgeSize = "sm" | "md";
|
|
13
|
-
|
|
14
|
-
export interface BadgeProps {
|
|
15
|
-
text: string;
|
|
16
|
-
state?: BadgeState;
|
|
17
|
-
size?: BadgeSize;
|
|
18
|
-
}
|
|
19
|
-
|
|
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
|
-
}
|
|
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};
|
|
40
|
-
display: inline-block;
|
|
41
|
-
`;
|
|
42
|
-
|
|
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
|
-
`;
|
|
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
|
-
);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BigStat } from "./BigStat";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
component: BigStat,
|
|
5
|
-
title: "Display/Big Stat",
|
|
6
|
-
tags: ["big-stat", "autodocs"],
|
|
7
|
-
size: {
|
|
8
|
-
options: ["lg", "sm"],
|
|
9
|
-
control: { type: "radio" },
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const Playground = {
|
|
14
|
-
args: {
|
|
15
|
-
label: "Percentage complete",
|
|
16
|
-
title: "100%",
|
|
17
|
-
state: "default",
|
|
18
|
-
size: "lg"
|
|
19
|
-
},
|
|
20
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
|
|
3
|
-
export type bigStatState = "default";
|
|
4
|
-
export type bigStatSize = "sm" | "lg";
|
|
5
|
-
|
|
6
|
-
export interface BigStatProps {
|
|
7
|
-
label: React.ReactNode;
|
|
8
|
-
title: React.ReactNode;
|
|
9
|
-
state?: bigStatState;
|
|
10
|
-
size?: bigStatSize;
|
|
11
|
-
}
|
|
12
|
-
|
|
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};
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-direction: ${({ size }) => size === "sm" ? "column-reverse" : "column"}
|
|
36
|
-
`;
|
|
37
|
-
|
|
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]};
|
|
42
|
-
`;
|
|
43
|
-
|
|
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]};
|
|
49
|
-
`;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Button } from "./Button";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Buttons/Button",
|
|
5
|
-
component: Button,
|
|
6
|
-
tags: ["button", "autodocs"],
|
|
7
|
-
argTypes: {
|
|
8
|
-
type: {
|
|
9
|
-
options: ["primary", "secondary", "danger"],
|
|
10
|
-
control: { type: "radio" },
|
|
11
|
-
},
|
|
12
|
-
align: {
|
|
13
|
-
options: ["center", "left"],
|
|
14
|
-
control: { type: "radio" },
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const Playground = {
|
|
20
|
-
args: {
|
|
21
|
-
type: "primary",
|
|
22
|
-
disabled: false,
|
|
23
|
-
label: "Button",
|
|
24
|
-
align: "center",
|
|
25
|
-
},
|
|
26
|
-
};
|