@pithakthakul/ui 0.0.0-stage → 1.0.0
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/README.md +118 -2
- package/dist/components/ui/Accordion/Accordion.d.ts +8 -0
- package/dist/components/ui/Accordion/Accordion.d.ts.map +1 -0
- package/dist/components/ui/Accordion/Accordion.js +88 -0
- package/dist/components/ui/Accordion/Accordion.js.map +1 -0
- package/dist/components/ui/Accordion/index.d.ts +2 -0
- package/dist/components/ui/Accordion/index.d.ts.map +1 -0
- package/dist/components/ui/Accordion/index.js +2 -0
- package/dist/components/ui/Accordion/index.js.map +1 -0
- package/dist/components/ui/Alert/Alert.d.ts +13 -0
- package/dist/components/ui/Alert/Alert.d.ts.map +1 -0
- package/dist/components/ui/Alert/Alert.js +65 -0
- package/dist/components/ui/Alert/Alert.js.map +1 -0
- package/dist/components/ui/Alert/index.d.ts +2 -0
- package/dist/components/ui/Alert/index.d.ts.map +1 -0
- package/dist/components/ui/Alert/index.js +2 -0
- package/dist/components/ui/Alert/index.js.map +1 -0
- package/dist/components/ui/AlertDialog/AlertDialog.d.ts +19 -0
- package/dist/components/ui/AlertDialog/AlertDialog.d.ts.map +1 -0
- package/dist/components/ui/AlertDialog/AlertDialog.js +165 -0
- package/dist/components/ui/AlertDialog/AlertDialog.js.map +1 -0
- package/dist/components/ui/AlertDialog/index.d.ts +2 -0
- package/dist/components/ui/AlertDialog/index.d.ts.map +1 -0
- package/dist/components/ui/AlertDialog/index.js +2 -0
- package/dist/components/ui/AlertDialog/index.js.map +1 -0
- package/dist/components/ui/AspectRatio/AspectRatio.d.ts +4 -0
- package/dist/components/ui/AspectRatio/AspectRatio.d.ts.map +1 -0
- package/dist/components/ui/AspectRatio/AspectRatio.js +12 -0
- package/dist/components/ui/AspectRatio/AspectRatio.js.map +1 -0
- package/dist/components/ui/AspectRatio/index.d.ts +2 -0
- package/dist/components/ui/AspectRatio/index.d.ts.map +1 -0
- package/dist/components/ui/AspectRatio/index.js +2 -0
- package/dist/components/ui/AspectRatio/index.js.map +1 -0
- package/dist/components/ui/Attachment/Attachment.d.ts +29 -0
- package/dist/components/ui/Attachment/Attachment.d.ts.map +1 -0
- package/dist/components/ui/Attachment/Attachment.js +155 -0
- package/dist/components/ui/Attachment/Attachment.js.map +1 -0
- package/dist/components/ui/Attachment/index.d.ts +2 -0
- package/dist/components/ui/Attachment/index.d.ts.map +1 -0
- package/dist/components/ui/Attachment/index.js +2 -0
- package/dist/components/ui/Attachment/index.js.map +1 -0
- package/dist/components/ui/Avatar/Avatar.d.ts +12 -0
- package/dist/components/ui/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/ui/Avatar/Avatar.js +88 -0
- package/dist/components/ui/Avatar/Avatar.js.map +1 -0
- package/dist/components/ui/Avatar/index.d.ts +2 -0
- package/dist/components/ui/Avatar/index.d.ts.map +1 -0
- package/dist/components/ui/Avatar/index.js +2 -0
- package/dist/components/ui/Avatar/index.js.map +1 -0
- package/dist/components/ui/Badge/Badge.d.ts +12 -0
- package/dist/components/ui/Badge/Badge.d.ts.map +1 -0
- package/dist/components/ui/Badge/Badge.js +30 -0
- package/dist/components/ui/Badge/Badge.js.map +1 -0
- package/dist/components/ui/Badge/index.d.ts +2 -0
- package/dist/components/ui/Badge/index.d.ts.map +1 -0
- package/dist/components/ui/Badge/index.js +2 -0
- package/dist/components/ui/Badge/index.js.map +1 -0
- package/dist/components/ui/Breadcrumb/Breadcrumb.d.ts +12 -0
- package/dist/components/ui/Breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/Breadcrumb/Breadcrumb.js +110 -0
- package/dist/components/ui/Breadcrumb/Breadcrumb.js.map +1 -0
- package/dist/components/ui/Breadcrumb/index.d.ts +2 -0
- package/dist/components/ui/Breadcrumb/index.d.ts.map +1 -0
- package/dist/components/ui/Breadcrumb/index.js +2 -0
- package/dist/components/ui/Breadcrumb/index.js.map +1 -0
- package/dist/components/ui/Bubble/Bubble.d.ts +20 -0
- package/dist/components/ui/Bubble/Bubble.d.ts.map +1 -0
- package/dist/components/ui/Bubble/Bubble.js +78 -0
- package/dist/components/ui/Bubble/Bubble.js.map +1 -0
- package/dist/components/ui/Bubble/index.d.ts +2 -0
- package/dist/components/ui/Bubble/index.d.ts.map +1 -0
- package/dist/components/ui/Bubble/index.js +2 -0
- package/dist/components/ui/Bubble/index.js.map +1 -0
- package/dist/components/ui/Button/Button.d.ts +13 -0
- package/dist/components/ui/Button/Button.d.ts.map +1 -0
- package/dist/components/ui/Button/Button.js +33 -0
- package/dist/components/ui/Button/Button.js.map +1 -0
- package/dist/components/ui/Button/index.d.ts +2 -0
- package/dist/components/ui/Button/index.d.ts.map +1 -0
- package/dist/components/ui/Button/index.js +2 -0
- package/dist/components/ui/Button/index.js.map +1 -0
- package/dist/components/ui/ButtonGroup/ButtonGroup.d.ts +14 -0
- package/dist/components/ui/ButtonGroup/ButtonGroup.d.ts.map +1 -0
- package/dist/components/ui/ButtonGroup/ButtonGroup.js +54 -0
- package/dist/components/ui/ButtonGroup/ButtonGroup.js.map +1 -0
- package/dist/components/ui/ButtonGroup/index.d.ts +2 -0
- package/dist/components/ui/ButtonGroup/index.d.ts.map +1 -0
- package/dist/components/ui/ButtonGroup/index.js +2 -0
- package/dist/components/ui/ButtonGroup/index.js.map +1 -0
- package/dist/components/ui/Calendar/Calendar.d.ts +11 -0
- package/dist/components/ui/Calendar/Calendar.d.ts.map +1 -0
- package/dist/components/ui/Calendar/Calendar.js +181 -0
- package/dist/components/ui/Calendar/Calendar.js.map +1 -0
- package/dist/components/ui/Calendar/index.d.ts +2 -0
- package/dist/components/ui/Calendar/index.d.ts.map +1 -0
- package/dist/components/ui/Calendar/index.js +2 -0
- package/dist/components/ui/Calendar/index.js.map +1 -0
- package/dist/components/ui/Carousel/Carousel.d.ts +29 -0
- package/dist/components/ui/Carousel/Carousel.d.ts.map +1 -0
- package/dist/components/ui/Carousel/Carousel.js +202 -0
- package/dist/components/ui/Carousel/Carousel.js.map +1 -0
- package/dist/components/ui/Carousel/index.d.ts +2 -0
- package/dist/components/ui/Carousel/index.d.ts.map +1 -0
- package/dist/components/ui/Carousel/index.js +2 -0
- package/dist/components/ui/Carousel/index.js.map +1 -0
- package/dist/components/ui/Chart/Chart.d.ts +45 -0
- package/dist/components/ui/Chart/Chart.d.ts.map +1 -0
- package/dist/components/ui/Chart/Chart.js +233 -0
- package/dist/components/ui/Chart/Chart.js.map +1 -0
- package/dist/components/ui/Chart/index.d.ts +2 -0
- package/dist/components/ui/Chart/index.d.ts.map +1 -0
- package/dist/components/ui/Chart/index.js +2 -0
- package/dist/components/ui/Chart/index.js.map +1 -0
- package/dist/components/ui/Checkbox/Checkbox.d.ts +5 -0
- package/dist/components/ui/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/ui/Checkbox/Checkbox.js +31 -0
- package/dist/components/ui/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/ui/Checkbox/index.d.ts +2 -0
- package/dist/components/ui/Checkbox/index.d.ts.map +1 -0
- package/dist/components/ui/Checkbox/index.js +2 -0
- package/dist/components/ui/Checkbox/index.js.map +1 -0
- package/dist/components/ui/CodeBlock/CodeBlock.d.ts +31 -0
- package/dist/components/ui/CodeBlock/CodeBlock.d.ts.map +1 -0
- package/dist/components/ui/CodeBlock/CodeBlock.js +174 -0
- package/dist/components/ui/CodeBlock/CodeBlock.js.map +1 -0
- package/dist/components/ui/CodeBlock/index.d.ts +2 -0
- package/dist/components/ui/CodeBlock/index.d.ts.map +1 -0
- package/dist/components/ui/CodeBlock/index.js +2 -0
- package/dist/components/ui/CodeBlock/index.js.map +1 -0
- package/dist/components/ui/Collapsible/Collapsible.d.ts +6 -0
- package/dist/components/ui/Collapsible/Collapsible.d.ts.map +1 -0
- package/dist/components/ui/Collapsible/Collapsible.js +36 -0
- package/dist/components/ui/Collapsible/Collapsible.js.map +1 -0
- package/dist/components/ui/Collapsible/index.d.ts +2 -0
- package/dist/components/ui/Collapsible/index.d.ts.map +1 -0
- package/dist/components/ui/Collapsible/index.js +2 -0
- package/dist/components/ui/Collapsible/index.js.map +1 -0
- package/dist/components/ui/Combobox/Combobox.d.ts +25 -0
- package/dist/components/ui/Combobox/Combobox.d.ts.map +1 -0
- package/dist/components/ui/Combobox/Combobox.js +272 -0
- package/dist/components/ui/Combobox/Combobox.js.map +1 -0
- package/dist/components/ui/Combobox/index.d.ts +2 -0
- package/dist/components/ui/Combobox/index.d.ts.map +1 -0
- package/dist/components/ui/Combobox/index.js +2 -0
- package/dist/components/ui/Combobox/index.js.map +1 -0
- package/dist/components/ui/Command/Command.d.ts +19 -0
- package/dist/components/ui/Command/Command.d.ts.map +1 -0
- package/dist/components/ui/Command/Command.js +161 -0
- package/dist/components/ui/Command/Command.js.map +1 -0
- package/dist/components/ui/Command/index.d.ts +2 -0
- package/dist/components/ui/Command/index.d.ts.map +1 -0
- package/dist/components/ui/Command/index.js +2 -0
- package/dist/components/ui/Command/index.js.map +1 -0
- package/dist/components/ui/ContextMenu/ContextMenu.d.ts +32 -0
- package/dist/components/ui/ContextMenu/ContextMenu.d.ts.map +1 -0
- package/dist/components/ui/ContextMenu/ContextMenu.js +214 -0
- package/dist/components/ui/ContextMenu/ContextMenu.js.map +1 -0
- package/dist/components/ui/ContextMenu/index.d.ts +2 -0
- package/dist/components/ui/ContextMenu/index.d.ts.map +1 -0
- package/dist/components/ui/ContextMenu/index.js +2 -0
- package/dist/components/ui/ContextMenu/index.js.map +1 -0
- package/dist/components/ui/Dialog/Dialog.d.ts +18 -0
- package/dist/components/ui/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/ui/Dialog/Dialog.js +141 -0
- package/dist/components/ui/Dialog/Dialog.js.map +1 -0
- package/dist/components/ui/Dialog/index.d.ts +2 -0
- package/dist/components/ui/Dialog/index.d.ts.map +1 -0
- package/dist/components/ui/Dialog/index.js +2 -0
- package/dist/components/ui/Dialog/index.js.map +1 -0
- package/dist/components/ui/Direction/Direction.d.ts +8 -0
- package/dist/components/ui/Direction/Direction.d.ts.map +1 -0
- package/dist/components/ui/Direction/Direction.js +17 -0
- package/dist/components/ui/Direction/Direction.js.map +1 -0
- package/dist/components/ui/Direction/index.d.ts +2 -0
- package/dist/components/ui/Direction/index.d.ts.map +1 -0
- package/dist/components/ui/Direction/index.js +2 -0
- package/dist/components/ui/Direction/index.js.map +1 -0
- package/dist/components/ui/Drawer/Drawer.d.ts +14 -0
- package/dist/components/ui/Drawer/Drawer.d.ts.map +1 -0
- package/dist/components/ui/Drawer/Drawer.js +118 -0
- package/dist/components/ui/Drawer/Drawer.js.map +1 -0
- package/dist/components/ui/Drawer/index.d.ts +2 -0
- package/dist/components/ui/Drawer/index.d.ts.map +1 -0
- package/dist/components/ui/Drawer/index.js +2 -0
- package/dist/components/ui/Drawer/index.js.map +1 -0
- package/dist/components/ui/DropdownMenu/DropdownMenu.d.ts +30 -0
- package/dist/components/ui/DropdownMenu/DropdownMenu.d.ts.map +1 -0
- package/dist/components/ui/DropdownMenu/DropdownMenu.js +233 -0
- package/dist/components/ui/DropdownMenu/DropdownMenu.js.map +1 -0
- package/dist/components/ui/DropdownMenu/index.d.ts +2 -0
- package/dist/components/ui/DropdownMenu/index.d.ts.map +1 -0
- package/dist/components/ui/DropdownMenu/index.js +2 -0
- package/dist/components/ui/DropdownMenu/index.js.map +1 -0
- package/dist/components/ui/Empty/Empty.d.ts +14 -0
- package/dist/components/ui/Empty/Empty.d.ts.map +1 -0
- package/dist/components/ui/Empty/Empty.js +76 -0
- package/dist/components/ui/Empty/Empty.js.map +1 -0
- package/dist/components/ui/Empty/index.d.ts +2 -0
- package/dist/components/ui/Empty/index.d.ts.map +1 -0
- package/dist/components/ui/Empty/index.js +2 -0
- package/dist/components/ui/Empty/index.js.map +1 -0
- package/dist/components/ui/Field/Field.d.ts +27 -0
- package/dist/components/ui/Field/Field.d.ts.map +1 -0
- package/dist/components/ui/Field/Field.js +183 -0
- package/dist/components/ui/Field/Field.js.map +1 -0
- package/dist/components/ui/Field/index.d.ts +2 -0
- package/dist/components/ui/Field/index.d.ts.map +1 -0
- package/dist/components/ui/Field/index.js +2 -0
- package/dist/components/ui/Field/index.js.map +1 -0
- package/dist/components/ui/HoverCard/HoverCard.d.ts +7 -0
- package/dist/components/ui/HoverCard/HoverCard.d.ts.map +1 -0
- package/dist/components/ui/HoverCard/HoverCard.js +38 -0
- package/dist/components/ui/HoverCard/HoverCard.js.map +1 -0
- package/dist/components/ui/HoverCard/index.d.ts +2 -0
- package/dist/components/ui/HoverCard/index.d.ts.map +1 -0
- package/dist/components/ui/HoverCard/index.js +2 -0
- package/dist/components/ui/HoverCard/index.js.map +1 -0
- package/dist/components/ui/Input/Input.d.ts +4 -0
- package/dist/components/ui/Input/Input.d.ts.map +1 -0
- package/dist/components/ui/Input/Input.js +18 -0
- package/dist/components/ui/Input/Input.js.map +1 -0
- package/dist/components/ui/Input/index.d.ts +2 -0
- package/dist/components/ui/Input/index.d.ts.map +1 -0
- package/dist/components/ui/Input/index.js +2 -0
- package/dist/components/ui/Input/index.js.map +1 -0
- package/dist/components/ui/InputGroup/InputGroup.d.ts +21 -0
- package/dist/components/ui/InputGroup/InputGroup.d.ts.map +1 -0
- package/dist/components/ui/InputGroup/InputGroup.js +103 -0
- package/dist/components/ui/InputGroup/InputGroup.js.map +1 -0
- package/dist/components/ui/InputGroup/index.d.ts +2 -0
- package/dist/components/ui/InputGroup/index.d.ts.map +1 -0
- package/dist/components/ui/InputGroup/index.js +2 -0
- package/dist/components/ui/InputGroup/index.js.map +1 -0
- package/dist/components/ui/InputOtp/InputOtp.d.ts +12 -0
- package/dist/components/ui/InputOtp/InputOtp.d.ts.map +1 -0
- package/dist/components/ui/InputOtp/InputOtp.js +75 -0
- package/dist/components/ui/InputOtp/InputOtp.js.map +1 -0
- package/dist/components/ui/InputOtp/index.d.ts +2 -0
- package/dist/components/ui/InputOtp/index.d.ts.map +1 -0
- package/dist/components/ui/InputOtp/index.js +2 -0
- package/dist/components/ui/InputOtp/index.js.map +1 -0
- package/dist/components/ui/Item/Item.d.ts +28 -0
- package/dist/components/ui/Item/Item.d.ts.map +1 -0
- package/dist/components/ui/Item/Item.js +148 -0
- package/dist/components/ui/Item/Item.js.map +1 -0
- package/dist/components/ui/Item/index.d.ts +2 -0
- package/dist/components/ui/Item/index.d.ts.map +1 -0
- package/dist/components/ui/Item/index.js +2 -0
- package/dist/components/ui/Item/index.js.map +1 -0
- package/dist/components/ui/Kbd/Kbd.d.ts +4 -0
- package/dist/components/ui/Kbd/Kbd.d.ts.map +1 -0
- package/dist/components/ui/Kbd/Kbd.js +20 -0
- package/dist/components/ui/Kbd/Kbd.js.map +1 -0
- package/dist/components/ui/Kbd/index.d.ts +2 -0
- package/dist/components/ui/Kbd/index.d.ts.map +1 -0
- package/dist/components/ui/Kbd/index.js +2 -0
- package/dist/components/ui/Kbd/index.js.map +1 -0
- package/dist/components/ui/Label/Label.d.ts +5 -0
- package/dist/components/ui/Label/Label.d.ts.map +1 -0
- package/dist/components/ui/Label/Label.js +22 -0
- package/dist/components/ui/Label/Label.js.map +1 -0
- package/dist/components/ui/Label/index.d.ts +2 -0
- package/dist/components/ui/Label/index.d.ts.map +1 -0
- package/dist/components/ui/Label/index.js +2 -0
- package/dist/components/ui/Label/index.js.map +1 -0
- package/dist/components/ui/Marker/Marker.d.ts +14 -0
- package/dist/components/ui/Marker/Marker.d.ts.map +1 -0
- package/dist/components/ui/Marker/Marker.js +51 -0
- package/dist/components/ui/Marker/Marker.js.map +1 -0
- package/dist/components/ui/Marker/index.d.ts +2 -0
- package/dist/components/ui/Marker/index.d.ts.map +1 -0
- package/dist/components/ui/Marker/index.js +2 -0
- package/dist/components/ui/Marker/index.js.map +1 -0
- package/dist/components/ui/Menubar/Menubar.d.ts +31 -0
- package/dist/components/ui/Menubar/Menubar.d.ts.map +1 -0
- package/dist/components/ui/Menubar/Menubar.js +228 -0
- package/dist/components/ui/Menubar/Menubar.js.map +1 -0
- package/dist/components/ui/Menubar/index.d.ts +2 -0
- package/dist/components/ui/Menubar/index.d.ts.map +1 -0
- package/dist/components/ui/Menubar/index.js +2 -0
- package/dist/components/ui/Menubar/index.js.map +1 -0
- package/dist/components/ui/Message/Message.d.ts +11 -0
- package/dist/components/ui/Message/Message.d.ts.map +1 -0
- package/dist/components/ui/Message/Message.js +77 -0
- package/dist/components/ui/Message/Message.js.map +1 -0
- package/dist/components/ui/Message/index.d.ts +2 -0
- package/dist/components/ui/Message/index.d.ts.map +1 -0
- package/dist/components/ui/Message/index.js +2 -0
- package/dist/components/ui/Message/index.js.map +1 -0
- package/dist/components/ui/MessageScroller/MessageScroller.d.ts +11 -0
- package/dist/components/ui/MessageScroller/MessageScroller.d.ts.map +1 -0
- package/dist/components/ui/MessageScroller/MessageScroller.js +108 -0
- package/dist/components/ui/MessageScroller/MessageScroller.js.map +1 -0
- package/dist/components/ui/MessageScroller/index.d.ts +2 -0
- package/dist/components/ui/MessageScroller/index.d.ts.map +1 -0
- package/dist/components/ui/MessageScroller/index.js +2 -0
- package/dist/components/ui/MessageScroller/index.js.map +1 -0
- package/dist/components/ui/NativeSelect/NativeSelect.d.ts +9 -0
- package/dist/components/ui/NativeSelect/NativeSelect.d.ts.map +1 -0
- package/dist/components/ui/NativeSelect/NativeSelect.js +69 -0
- package/dist/components/ui/NativeSelect/NativeSelect.js.map +1 -0
- package/dist/components/ui/NativeSelect/index.d.ts +2 -0
- package/dist/components/ui/NativeSelect/index.d.ts.map +1 -0
- package/dist/components/ui/NativeSelect/index.js +2 -0
- package/dist/components/ui/NativeSelect/index.js.map +1 -0
- package/dist/components/ui/NavigationMenu/NavigationMenu.d.ts +19 -0
- package/dist/components/ui/NavigationMenu/NavigationMenu.d.ts.map +1 -0
- package/dist/components/ui/NavigationMenu/NavigationMenu.js +148 -0
- package/dist/components/ui/NavigationMenu/NavigationMenu.js.map +1 -0
- package/dist/components/ui/NavigationMenu/index.d.ts +2 -0
- package/dist/components/ui/NavigationMenu/index.d.ts.map +1 -0
- package/dist/components/ui/NavigationMenu/index.js +2 -0
- package/dist/components/ui/NavigationMenu/index.js.map +1 -0
- package/dist/components/ui/Pagination/Pagination.d.ts +18 -0
- package/dist/components/ui/Pagination/Pagination.d.ts.map +1 -0
- package/dist/components/ui/Pagination/Pagination.js +128 -0
- package/dist/components/ui/Pagination/Pagination.js.map +1 -0
- package/dist/components/ui/Pagination/index.d.ts +2 -0
- package/dist/components/ui/Pagination/index.d.ts.map +1 -0
- package/dist/components/ui/Pagination/index.js +2 -0
- package/dist/components/ui/Pagination/index.js.map +1 -0
- package/dist/components/ui/Popover/Popover.d.ts +11 -0
- package/dist/components/ui/Popover/Popover.d.ts.map +1 -0
- package/dist/components/ui/Popover/Popover.js +80 -0
- package/dist/components/ui/Popover/Popover.js.map +1 -0
- package/dist/components/ui/Popover/index.d.ts +2 -0
- package/dist/components/ui/Popover/index.d.ts.map +1 -0
- package/dist/components/ui/Popover/index.js +2 -0
- package/dist/components/ui/Popover/index.js.map +1 -0
- package/dist/components/ui/Progress/Progress.d.ts +5 -0
- package/dist/components/ui/Progress/Progress.d.ts.map +1 -0
- package/dist/components/ui/Progress/Progress.js +31 -0
- package/dist/components/ui/Progress/Progress.js.map +1 -0
- package/dist/components/ui/Progress/index.d.ts +2 -0
- package/dist/components/ui/Progress/index.d.ts.map +1 -0
- package/dist/components/ui/Progress/index.js +2 -0
- package/dist/components/ui/Progress/index.js.map +1 -0
- package/dist/components/ui/Questionnaire/Questionnaire.d.ts +20 -0
- package/dist/components/ui/Questionnaire/Questionnaire.d.ts.map +1 -0
- package/dist/components/ui/Questionnaire/Questionnaire.js +322 -0
- package/dist/components/ui/Questionnaire/Questionnaire.js.map +1 -0
- package/dist/components/ui/Questionnaire/index.d.ts +2 -0
- package/dist/components/ui/Questionnaire/index.d.ts.map +1 -0
- package/dist/components/ui/Questionnaire/index.js +2 -0
- package/dist/components/ui/Questionnaire/index.js.map +1 -0
- package/dist/components/ui/RadioGroup/RadioGroup.d.ts +6 -0
- package/dist/components/ui/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/components/ui/RadioGroup/RadioGroup.js +47 -0
- package/dist/components/ui/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/components/ui/RadioGroup/index.d.ts +2 -0
- package/dist/components/ui/RadioGroup/index.d.ts.map +1 -0
- package/dist/components/ui/RadioGroup/index.js +2 -0
- package/dist/components/ui/RadioGroup/index.js.map +1 -0
- package/dist/components/ui/Resizable/Resizable.d.ts +8 -0
- package/dist/components/ui/Resizable/Resizable.d.ts.map +1 -0
- package/dist/components/ui/Resizable/Resizable.js +41 -0
- package/dist/components/ui/Resizable/Resizable.js.map +1 -0
- package/dist/components/ui/Resizable/index.d.ts +2 -0
- package/dist/components/ui/Resizable/index.d.ts.map +1 -0
- package/dist/components/ui/Resizable/index.js +2 -0
- package/dist/components/ui/Resizable/index.js.map +1 -0
- package/dist/components/ui/ScrollArea/ScrollArea.d.ts +6 -0
- package/dist/components/ui/ScrollArea/ScrollArea.d.ts.map +1 -0
- package/dist/components/ui/ScrollArea/ScrollArea.js +59 -0
- package/dist/components/ui/ScrollArea/ScrollArea.js.map +1 -0
- package/dist/components/ui/ScrollArea/index.d.ts +2 -0
- package/dist/components/ui/ScrollArea/index.d.ts.map +1 -0
- package/dist/components/ui/ScrollArea/index.js +2 -0
- package/dist/components/ui/ScrollArea/index.js.map +1 -0
- package/dist/components/ui/Select/Select.d.ts +16 -0
- package/dist/components/ui/Select/Select.d.ts.map +1 -0
- package/dist/components/ui/Select/Select.js +172 -0
- package/dist/components/ui/Select/Select.js.map +1 -0
- package/dist/components/ui/Select/index.d.ts +2 -0
- package/dist/components/ui/Select/index.d.ts.map +1 -0
- package/dist/components/ui/Select/index.js +2 -0
- package/dist/components/ui/Select/index.js.map +1 -0
- package/dist/components/ui/Separator/Separator.d.ts +5 -0
- package/dist/components/ui/Separator/Separator.d.ts.map +1 -0
- package/dist/components/ui/Separator/Separator.js +26 -0
- package/dist/components/ui/Separator/Separator.js.map +1 -0
- package/dist/components/ui/Separator/index.d.ts +2 -0
- package/dist/components/ui/Separator/index.d.ts.map +1 -0
- package/dist/components/ui/Separator/index.js +2 -0
- package/dist/components/ui/Separator/index.js.map +1 -0
- package/dist/components/ui/Sheet/Sheet.d.ts +15 -0
- package/dist/components/ui/Sheet/Sheet.d.ts.map +1 -0
- package/dist/components/ui/Sheet/Sheet.js +130 -0
- package/dist/components/ui/Sheet/Sheet.js.map +1 -0
- package/dist/components/ui/Sheet/index.d.ts +2 -0
- package/dist/components/ui/Sheet/index.d.ts.map +1 -0
- package/dist/components/ui/Sheet/index.js +2 -0
- package/dist/components/ui/Sheet/index.js.map +1 -0
- package/dist/components/ui/Sidebar/Sidebar.d.ts +72 -0
- package/dist/components/ui/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/components/ui/Sidebar/Sidebar.js +570 -0
- package/dist/components/ui/Sidebar/Sidebar.js.map +1 -0
- package/dist/components/ui/Sidebar/index.d.ts +2 -0
- package/dist/components/ui/Sidebar/index.d.ts.map +1 -0
- package/dist/components/ui/Sidebar/index.js +2 -0
- package/dist/components/ui/Sidebar/index.js.map +1 -0
- package/dist/components/ui/Skeleton/Skeleton.d.ts +3 -0
- package/dist/components/ui/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/ui/Skeleton/Skeleton.js +16 -0
- package/dist/components/ui/Skeleton/Skeleton.js.map +1 -0
- package/dist/components/ui/Skeleton/index.d.ts +2 -0
- package/dist/components/ui/Skeleton/index.d.ts.map +1 -0
- package/dist/components/ui/Skeleton/index.js +2 -0
- package/dist/components/ui/Skeleton/index.js.map +1 -0
- package/dist/components/ui/Slider/Slider.d.ts +5 -0
- package/dist/components/ui/Slider/Slider.d.ts.map +1 -0
- package/dist/components/ui/Slider/Slider.js +58 -0
- package/dist/components/ui/Slider/Slider.js.map +1 -0
- package/dist/components/ui/Slider/index.d.ts +2 -0
- package/dist/components/ui/Slider/index.d.ts.map +1 -0
- package/dist/components/ui/Slider/index.js +2 -0
- package/dist/components/ui/Slider/index.js.map +1 -0
- package/dist/components/ui/Sonner/Sonner.d.ts +4 -0
- package/dist/components/ui/Sonner/Sonner.d.ts.map +1 -0
- package/dist/components/ui/Sonner/Sonner.js +44 -0
- package/dist/components/ui/Sonner/Sonner.js.map +1 -0
- package/dist/components/ui/Sonner/index.d.ts +2 -0
- package/dist/components/ui/Sonner/index.d.ts.map +1 -0
- package/dist/components/ui/Sonner/index.js +2 -0
- package/dist/components/ui/Sonner/index.js.map +1 -0
- package/dist/components/ui/Spinner/Spinner.d.ts +3 -0
- package/dist/components/ui/Spinner/Spinner.d.ts.map +1 -0
- package/dist/components/ui/Spinner/Spinner.js +19 -0
- package/dist/components/ui/Spinner/Spinner.js.map +1 -0
- package/dist/components/ui/Spinner/index.d.ts +2 -0
- package/dist/components/ui/Spinner/index.d.ts.map +1 -0
- package/dist/components/ui/Spinner/index.js +2 -0
- package/dist/components/ui/Spinner/index.js.map +1 -0
- package/dist/components/ui/Switch/Switch.d.ts +7 -0
- package/dist/components/ui/Switch/Switch.d.ts.map +1 -0
- package/dist/components/ui/Switch/Switch.js +31 -0
- package/dist/components/ui/Switch/Switch.js.map +1 -0
- package/dist/components/ui/Switch/index.d.ts +2 -0
- package/dist/components/ui/Switch/index.d.ts.map +1 -0
- package/dist/components/ui/Switch/index.js +2 -0
- package/dist/components/ui/Switch/index.js.map +1 -0
- package/dist/components/ui/Table/Table.d.ts +11 -0
- package/dist/components/ui/Table/Table.d.ts.map +1 -0
- package/dist/components/ui/Table/Table.js +98 -0
- package/dist/components/ui/Table/Table.js.map +1 -0
- package/dist/components/ui/Table/index.d.ts +2 -0
- package/dist/components/ui/Table/index.d.ts.map +1 -0
- package/dist/components/ui/Table/index.js +2 -0
- package/dist/components/ui/Table/index.js.map +1 -0
- package/dist/components/ui/Tabs/Tabs.d.ts +14 -0
- package/dist/components/ui/Tabs/Tabs.d.ts.map +1 -0
- package/dist/components/ui/Tabs/Tabs.js +76 -0
- package/dist/components/ui/Tabs/Tabs.js.map +1 -0
- package/dist/components/ui/Tabs/index.d.ts +2 -0
- package/dist/components/ui/Tabs/index.d.ts.map +1 -0
- package/dist/components/ui/Tabs/index.js +2 -0
- package/dist/components/ui/Tabs/index.js.map +1 -0
- package/dist/components/ui/Textarea/Textarea.d.ts +4 -0
- package/dist/components/ui/Textarea/Textarea.d.ts.map +1 -0
- package/dist/components/ui/Textarea/Textarea.js +17 -0
- package/dist/components/ui/Textarea/Textarea.js.map +1 -0
- package/dist/components/ui/Textarea/index.d.ts +2 -0
- package/dist/components/ui/Textarea/index.d.ts.map +1 -0
- package/dist/components/ui/Textarea/index.js +2 -0
- package/dist/components/ui/Textarea/index.js.map +1 -0
- package/dist/components/ui/Toggle/Toggle.d.ts +12 -0
- package/dist/components/ui/Toggle/Toggle.d.ts.map +1 -0
- package/dist/components/ui/Toggle/Toggle.js +30 -0
- package/dist/components/ui/Toggle/Toggle.js.map +1 -0
- package/dist/components/ui/Toggle/index.d.ts +2 -0
- package/dist/components/ui/Toggle/index.d.ts.map +1 -0
- package/dist/components/ui/Toggle/index.js +2 -0
- package/dist/components/ui/Toggle/index.js.map +1 -0
- package/dist/components/ui/ToggleGroup/ToggleGroup.d.ts +11 -0
- package/dist/components/ui/ToggleGroup/ToggleGroup.d.ts.map +1 -0
- package/dist/components/ui/ToggleGroup/ToggleGroup.js +76 -0
- package/dist/components/ui/ToggleGroup/ToggleGroup.js.map +1 -0
- package/dist/components/ui/ToggleGroup/index.d.ts +2 -0
- package/dist/components/ui/ToggleGroup/index.d.ts.map +1 -0
- package/dist/components/ui/ToggleGroup/index.js +2 -0
- package/dist/components/ui/ToggleGroup/index.js.map +1 -0
- package/dist/components/ui/Tooltip/Tooltip.d.ts +8 -0
- package/dist/components/ui/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/components/ui/Tooltip/Tooltip.js +55 -0
- package/dist/components/ui/Tooltip/Tooltip.js.map +1 -0
- package/dist/components/ui/Tooltip/index.d.ts +2 -0
- package/dist/components/ui/Tooltip/index.d.ts.map +1 -0
- package/dist/components/ui/Tooltip/index.js +2 -0
- package/dist/components/ui/Tooltip/index.js.map +1 -0
- package/dist/components/ui/Trace/Trace.d.ts +19 -0
- package/dist/components/ui/Trace/Trace.d.ts.map +1 -0
- package/dist/components/ui/Trace/Trace.js +128 -0
- package/dist/components/ui/Trace/Trace.js.map +1 -0
- package/dist/components/ui/Trace/index.d.ts +2 -0
- package/dist/components/ui/Trace/index.d.ts.map +1 -0
- package/dist/components/ui/Trace/index.js +2 -0
- package/dist/components/ui/Trace/index.js.map +1 -0
- package/dist/docs/Accordion.md +73 -0
- package/dist/docs/Alert.md +74 -0
- package/dist/docs/AlertDialog.md +92 -0
- package/dist/docs/AspectRatio.md +38 -0
- package/dist/docs/Attachment.md +98 -0
- package/dist/docs/Avatar.md +77 -0
- package/dist/docs/Badge.md +80 -0
- package/dist/docs/Breadcrumb.md +72 -0
- package/dist/docs/Bubble.md +89 -0
- package/dist/docs/Button.md +105 -0
- package/dist/docs/ButtonGroup.md +70 -0
- package/dist/docs/Calendar.md +84 -0
- package/dist/docs/Carousel.md +71 -0
- package/dist/docs/Chart.md +89 -0
- package/dist/docs/Checkbox.md +67 -0
- package/dist/docs/CodeBlock.md +77 -0
- package/dist/docs/Collapsible.md +45 -0
- package/dist/docs/Combobox.md +112 -0
- package/dist/docs/Command.md +90 -0
- package/dist/docs/ContextMenu.md +76 -0
- package/dist/docs/Dialog.md +90 -0
- package/dist/docs/Direction.md +44 -0
- package/dist/docs/Drawer.md +86 -0
- package/dist/docs/DropdownMenu.md +96 -0
- package/dist/docs/Empty.md +70 -0
- package/dist/docs/Field.md +82 -0
- package/dist/docs/HoverCard.md +68 -0
- package/dist/docs/Input.md +67 -0
- package/dist/docs/InputGroup.md +91 -0
- package/dist/docs/InputOtp.md +81 -0
- package/dist/docs/Item.md +95 -0
- package/dist/docs/Kbd.md +56 -0
- package/dist/docs/Label.md +50 -0
- package/dist/docs/Marker.md +65 -0
- package/dist/docs/Menubar.md +93 -0
- package/dist/docs/Message.md +75 -0
- package/dist/docs/MessageScroller.md +78 -0
- package/dist/docs/NativeSelect.md +83 -0
- package/dist/docs/NavigationMenu.md +94 -0
- package/dist/docs/Pagination.md +71 -0
- package/dist/docs/Popover.md +78 -0
- package/dist/docs/Progress.md +50 -0
- package/dist/docs/Questionnaire.md +124 -0
- package/dist/docs/RadioGroup.md +87 -0
- package/dist/docs/Resizable.md +60 -0
- package/dist/docs/ScrollArea.md +50 -0
- package/dist/docs/Select.md +107 -0
- package/dist/docs/Separator.md +47 -0
- package/dist/docs/Sheet.md +87 -0
- package/dist/docs/Sidebar.md +150 -0
- package/dist/docs/Skeleton.md +46 -0
- package/dist/docs/Slider.md +64 -0
- package/dist/docs/Sonner.md +64 -0
- package/dist/docs/Spinner.md +45 -0
- package/dist/docs/Switch.md +69 -0
- package/dist/docs/Table.md +81 -0
- package/dist/docs/Tabs.md +82 -0
- package/dist/docs/Textarea.md +65 -0
- package/dist/docs/Toggle.md +76 -0
- package/dist/docs/ToggleGroup.md +72 -0
- package/dist/docs/Tooltip.md +71 -0
- package/dist/docs/Trace.md +84 -0
- package/dist/docs/index.md +66 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +21 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/index.d.ts +65 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +5 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/variants.d.ts +22 -0
- package/dist/lib/variants.d.ts.map +1 -0
- package/dist/lib/variants.js +24 -0
- package/dist/lib/variants.js.map +1 -0
- package/dist/styles.css +3994 -0
- package/package.json +87 -4
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# AlertDialog
|
|
2
|
+
|
|
3
|
+
**Purpose:** a window that interrupts the user to confirm an important or irreversible action before it happens.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Confirming a destructive action, such as deleting a project or removing a member.
|
|
8
|
+
- Any choice the user must answer before going on.
|
|
9
|
+
|
|
10
|
+
## When not to use
|
|
11
|
+
|
|
12
|
+
- **A form or task.** Use **Dialog**.
|
|
13
|
+
- **A message that needs no answer.** Use **Sonner** (toast) or **Alert**.
|
|
14
|
+
- **Routine actions that can be undone.** Do the action and offer undo instead.
|
|
15
|
+
|
|
16
|
+
## Team rules
|
|
17
|
+
|
|
18
|
+
- TODO: add at least one rule from the team that AI can't work out from the code.
|
|
19
|
+
|
|
20
|
+
## Props and variants
|
|
21
|
+
|
|
22
|
+
AlertDialog is built from parts.
|
|
23
|
+
|
|
24
|
+
| Part | What it is |
|
|
25
|
+
| ------------------------ | ----------------------------------------------------------------------------- |
|
|
26
|
+
| `AlertDialog` | Holds the open state. Props: `open`, `defaultOpen`, `onOpenChange`. |
|
|
27
|
+
| `AlertDialogTrigger` | The control that opens it. Use `asChild` to make a **Button** the trigger. |
|
|
28
|
+
| `AlertDialogContent` | The window, centred with a dimmed backdrop. |
|
|
29
|
+
| `AlertDialogHeader` | Groups the media, title and description. |
|
|
30
|
+
| `AlertDialogMedia` | Optional 40px icon tile shown beside or above the title. |
|
|
31
|
+
| `AlertDialogTitle` | The question being asked. Required: screen readers announce it. |
|
|
32
|
+
| `AlertDialogDescription` | What will happen if the user goes ahead. |
|
|
33
|
+
| `AlertDialogFooter` | The action row on a light grey band. |
|
|
34
|
+
| `AlertDialogCancel` | Closes without doing anything. Looks like an `outline` **Button** by default. |
|
|
35
|
+
| `AlertDialogAction` | Confirms and closes. Looks like a `default` **Button** by default. |
|
|
36
|
+
|
|
37
|
+
| Prop | On | Values | Default | Notes |
|
|
38
|
+
| --------- | ---------------------------------------- | ---------------------- | -------------------------------------- | ---------------------------------------- |
|
|
39
|
+
| `size` | `AlertDialogContent` | `default`, `sm` | `default` | See Sizes. |
|
|
40
|
+
| `variant` | `AlertDialogAction`, `AlertDialogCancel` | any **Button** variant | `default` (Action), `outline` (Cancel) | Use `destructive` on Action for deletes. |
|
|
41
|
+
| `size` | `AlertDialogAction`, `AlertDialogCancel` | any **Button** size | `default` | |
|
|
42
|
+
|
|
43
|
+
### Sizes
|
|
44
|
+
|
|
45
|
+
| Size | Width | Layout |
|
|
46
|
+
| --------- | ------------------------------ | ----------------------------------------------------------------------------------------------- |
|
|
47
|
+
| `default` | 320px, 384px on larger screens | Text is centred on small screens and left-aligned on larger ones. Media sits left of the title. |
|
|
48
|
+
| `sm` | 320px | Text always centred. The two footer buttons split the width evenly. |
|
|
49
|
+
|
|
50
|
+
### Behaviour
|
|
51
|
+
|
|
52
|
+
- Clicking the backdrop does **not** close it. Only Cancel, Action or Escape does.
|
|
53
|
+
- Focus moves into the window when it opens.
|
|
54
|
+
|
|
55
|
+
## Tokens used
|
|
56
|
+
|
|
57
|
+
| Token | Where it's used |
|
|
58
|
+
| -------------------------------- | ------------------------------------------------- |
|
|
59
|
+
| `popover` / `popover-foreground` | Window fill and text |
|
|
60
|
+
| `foreground` | Faint outline (at low opacity); link hover colour |
|
|
61
|
+
| `muted` | Footer band (at half opacity); media tile fill |
|
|
62
|
+
| `muted-foreground` | Description text |
|
|
63
|
+
| `border` | Line above the footer |
|
|
64
|
+
| `radius` | Window and media tile corners |
|
|
65
|
+
|
|
66
|
+
Buttons use the **Button** tokens.
|
|
67
|
+
|
|
68
|
+
TODO: the backdrop is a fixed black at 10% opacity, not a token. Confirm whether it should become one.
|
|
69
|
+
|
|
70
|
+
## Example
|
|
71
|
+
|
|
72
|
+
Based on the **Default** story:
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
<AlertDialog>
|
|
76
|
+
<AlertDialogTrigger asChild>
|
|
77
|
+
<Button variant="destructive">Delete project</Button>
|
|
78
|
+
</AlertDialogTrigger>
|
|
79
|
+
<AlertDialogContent>
|
|
80
|
+
<AlertDialogHeader>
|
|
81
|
+
<AlertDialogTitle>Delete this project?</AlertDialogTitle>
|
|
82
|
+
<AlertDialogDescription>
|
|
83
|
+
This removes the project and all its files. You can't undo this.
|
|
84
|
+
</AlertDialogDescription>
|
|
85
|
+
</AlertDialogHeader>
|
|
86
|
+
<AlertDialogFooter>
|
|
87
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
88
|
+
<AlertDialogAction variant="destructive">Delete</AlertDialogAction>
|
|
89
|
+
</AlertDialogFooter>
|
|
90
|
+
</AlertDialogContent>
|
|
91
|
+
</AlertDialog>
|
|
92
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# AspectRatio
|
|
2
|
+
|
|
3
|
+
**Purpose:** keeps its content at a fixed width-to-height shape, such as 16:9, at any width.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Images, videos, maps or embeds that must keep their shape as the layout resizes.
|
|
8
|
+
|
|
9
|
+
## When not to use
|
|
10
|
+
|
|
11
|
+
- **Avatars.** Use **Avatar**.
|
|
12
|
+
- **Content whose height should follow its text.** Leave the height free.
|
|
13
|
+
|
|
14
|
+
## Team rules
|
|
15
|
+
|
|
16
|
+
- TODO: add at least one rule from the team that AI can't work out from the code.
|
|
17
|
+
|
|
18
|
+
## Props and variants
|
|
19
|
+
|
|
20
|
+
| Prop | Values | Default | Notes |
|
|
21
|
+
| ------- | ------ | ------- | ------------------------------------------ |
|
|
22
|
+
| `ratio` | number | `1` | Width divided by height, such as `16 / 9`. |
|
|
23
|
+
|
|
24
|
+
The content inside should fill the box (for example an image set to cover it).
|
|
25
|
+
|
|
26
|
+
## Tokens used
|
|
27
|
+
|
|
28
|
+
AspectRatio has no visual style and uses no tokens.
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
Based on the **Default** story:
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
<AspectRatio ratio={16 / 9} className="overflow-hidden rounded-lg">
|
|
36
|
+
<img src="/cover.jpg" alt="Team at the offsite" className="size-full object-cover" />
|
|
37
|
+
</AspectRatio>
|
|
38
|
+
```
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Attachment
|
|
2
|
+
|
|
3
|
+
**Purpose:** a small card for a file the user has attached or uploaded, showing its name, type and upload state.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Files attached to a message, comment or form, before or after sending.
|
|
8
|
+
- A row of uploads that shows which are still uploading or failed.
|
|
9
|
+
|
|
10
|
+
## When not to use
|
|
11
|
+
|
|
12
|
+
- **A list of documents in a library.** Use **Item** or **Table**.
|
|
13
|
+
- **A large image preview.** Use **AspectRatio** with an image.
|
|
14
|
+
|
|
15
|
+
## Team rules
|
|
16
|
+
|
|
17
|
+
- TODO: add at least one rule from the team that AI can't work out from the code.
|
|
18
|
+
|
|
19
|
+
## Props and variants
|
|
20
|
+
|
|
21
|
+
Attachment is built from parts.
|
|
22
|
+
|
|
23
|
+
| Part | What it is |
|
|
24
|
+
| ----------------------- | --------------------------------------------------------------------------------------- |
|
|
25
|
+
| `AttachmentGroup` | A row of attachments that scrolls sideways and snaps to each card. |
|
|
26
|
+
| `Attachment` | One card. |
|
|
27
|
+
| `AttachmentMedia` | A file-type icon or a thumbnail image. |
|
|
28
|
+
| `AttachmentContent` | The text column. |
|
|
29
|
+
| `AttachmentTitle` | The file name, cut off with "…" if too long. |
|
|
30
|
+
| `AttachmentDescription` | Small grey line, such as size or "Uploading 40%". Red when the state is `error`. |
|
|
31
|
+
| `AttachmentActions` | Holds action buttons, such as remove or retry. |
|
|
32
|
+
| `AttachmentAction` | A small ghost icon **Button**. Give it an `aria-label`. |
|
|
33
|
+
| `AttachmentTrigger` | Makes the whole card clickable (to open or preview the file). Use `asChild` for a link. |
|
|
34
|
+
|
|
35
|
+
| Prop | On | Values | Default | Notes |
|
|
36
|
+
| ----------------- | ------------------ | -------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
37
|
+
| `state` | `Attachment` | `idle`, `uploading`, `processing`, `error`, `done` | `done` | See States. |
|
|
38
|
+
| `size` | `Attachment` | `default`, `sm`, `xs` | `default` | See Sizes. |
|
|
39
|
+
| `orientation` | `Attachment` | `horizontal`, `vertical` | `horizontal` | `horizontal`: media beside the text, at least 160px wide. `vertical`: a 96px tile (120px with text) with media on top and actions in the corner. |
|
|
40
|
+
| `variant` | `AttachmentMedia` | `icon`, `image` | `icon` | `icon`: a 16px icon on a grey square. `image`: a cropped thumbnail. |
|
|
41
|
+
| `variant`, `size` | `AttachmentAction` | any **Button** variant and size | `ghost`, `icon-xs` | |
|
|
42
|
+
|
|
43
|
+
### Sizes
|
|
44
|
+
|
|
45
|
+
| Size | Media tile | Text | Corners |
|
|
46
|
+
| --------- | ---------- | ---- | ------- |
|
|
47
|
+
| `default` | 40px | 14px | 12px |
|
|
48
|
+
| `sm` | 32px | 12px | 12px |
|
|
49
|
+
| `xs` | 28px | 12px | 8px |
|
|
50
|
+
|
|
51
|
+
### States
|
|
52
|
+
|
|
53
|
+
| State | Looks like |
|
|
54
|
+
| ------------ | --------------------------------------------------------- |
|
|
55
|
+
| `idle` | Dashed border (picked but not uploaded yet). |
|
|
56
|
+
| `uploading` | File name shimmers; thumbnail is faded. |
|
|
57
|
+
| `processing` | File name shimmers; thumbnail is faded. |
|
|
58
|
+
| `error` | Light red border; description in red; thumbnail is faded. |
|
|
59
|
+
| `done` | Normal card. |
|
|
60
|
+
|
|
61
|
+
- **Clickable card, on hover:** light grey fill.
|
|
62
|
+
- **Keyboard focus inside:** soft ring.
|
|
63
|
+
|
|
64
|
+
## Tokens used
|
|
65
|
+
|
|
66
|
+
| Token | Where it's used |
|
|
67
|
+
| -------------------------- | ---------------------------------------- |
|
|
68
|
+
| `card` / `card-foreground` | Card fill and text |
|
|
69
|
+
| `border` | Card border |
|
|
70
|
+
| `muted` | Media tile; hover fill (at half opacity) |
|
|
71
|
+
| `foreground` | Media icon |
|
|
72
|
+
| `muted-foreground` | Description text |
|
|
73
|
+
| `destructive` | `error` border and description |
|
|
74
|
+
| `ring` | Focus ring |
|
|
75
|
+
| `radius` | Card and media corners |
|
|
76
|
+
|
|
77
|
+
## Example
|
|
78
|
+
|
|
79
|
+
Based on the **States** story:
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
<AttachmentGroup>
|
|
83
|
+
<Attachment state="uploading">
|
|
84
|
+
<AttachmentMedia>
|
|
85
|
+
<FileTextIcon />
|
|
86
|
+
</AttachmentMedia>
|
|
87
|
+
<AttachmentContent>
|
|
88
|
+
<AttachmentTitle>brief.pdf</AttachmentTitle>
|
|
89
|
+
<AttachmentDescription>Uploading 40%</AttachmentDescription>
|
|
90
|
+
</AttachmentContent>
|
|
91
|
+
<AttachmentActions>
|
|
92
|
+
<AttachmentAction aria-label="Remove brief.pdf">
|
|
93
|
+
<XIcon />
|
|
94
|
+
</AttachmentAction>
|
|
95
|
+
</AttachmentActions>
|
|
96
|
+
</Attachment>
|
|
97
|
+
</AttachmentGroup>
|
|
98
|
+
```
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Avatar
|
|
2
|
+
|
|
3
|
+
**Purpose:** a round picture of a person or team, with initials when there's no picture.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Showing who a person is next to their name, in lists, comments, menus and headers.
|
|
8
|
+
- A stack of overlapping avatars to show who is in a group or on a document.
|
|
9
|
+
|
|
10
|
+
## When not to use
|
|
11
|
+
|
|
12
|
+
- **Product images or other pictures.** Use **AspectRatio** with an image.
|
|
13
|
+
- **An icon in a list row.** Use **Item**'s media.
|
|
14
|
+
|
|
15
|
+
## Team rules
|
|
16
|
+
|
|
17
|
+
- TODO: add at least one rule from the team that AI can't work out from the code.
|
|
18
|
+
|
|
19
|
+
## Props and variants
|
|
20
|
+
|
|
21
|
+
Avatar is built from parts.
|
|
22
|
+
|
|
23
|
+
| Part | What it is |
|
|
24
|
+
| ------------------ | -------------------------------------------------------------------------------- |
|
|
25
|
+
| `Avatar` | The round frame. |
|
|
26
|
+
| `AvatarImage` | The picture. Takes `src` and `alt`. |
|
|
27
|
+
| `AvatarFallback` | Shown while the picture loads or if it fails, usually initials. |
|
|
28
|
+
| `AvatarBadge` | A small dot at the bottom right, such as an online status. Can hold a tiny icon. |
|
|
29
|
+
| `AvatarGroup` | Overlaps several avatars in a row. |
|
|
30
|
+
| `AvatarGroupCount` | A grey circle at the end of a group, such as "+3". |
|
|
31
|
+
|
|
32
|
+
| Prop | On | Values | Default | Notes |
|
|
33
|
+
| ------ | -------- | --------------------- | --------- | ---------- |
|
|
34
|
+
| `size` | `Avatar` | `sm`, `default`, `lg` | `default` | See Sizes. |
|
|
35
|
+
|
|
36
|
+
### Sizes
|
|
37
|
+
|
|
38
|
+
| Size | Diameter | Initials text | Badge |
|
|
39
|
+
| --------- | -------- | ------------- | ------------ |
|
|
40
|
+
| `sm` | 24px | 12px | 8px, no icon |
|
|
41
|
+
| `default` | 32px | 14px | 10px |
|
|
42
|
+
| `lg` | 40px | 14px | 12px |
|
|
43
|
+
|
|
44
|
+
The group count matches the size of the avatars in its group.
|
|
45
|
+
|
|
46
|
+
### Look
|
|
47
|
+
|
|
48
|
+
- A faint border around the edge keeps light pictures from blending into the page.
|
|
49
|
+
- In a group, each avatar has a ring in the page colour to separate it from the next.
|
|
50
|
+
|
|
51
|
+
TODO: the badge is always the primary colour. There's no way to show other statuses (such as away or busy) without new colours; ask before adding any.
|
|
52
|
+
|
|
53
|
+
## Tokens used
|
|
54
|
+
|
|
55
|
+
| Token | Where it's used |
|
|
56
|
+
| -------------------------------- | --------------------------------------- |
|
|
57
|
+
| `border` | Faint edge |
|
|
58
|
+
| `muted` / `muted-foreground` | Initials fill and text; group count |
|
|
59
|
+
| `primary` / `primary-foreground` | Badge fill and icon |
|
|
60
|
+
| `background` | Rings around badges and grouped avatars |
|
|
61
|
+
|
|
62
|
+
## Example
|
|
63
|
+
|
|
64
|
+
Based on the **Group** story:
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
<AvatarGroup>
|
|
68
|
+
<Avatar>
|
|
69
|
+
<AvatarImage src="/people/sam.jpg" alt="Sam K." />
|
|
70
|
+
<AvatarFallback>SK</AvatarFallback>
|
|
71
|
+
</Avatar>
|
|
72
|
+
<Avatar>
|
|
73
|
+
<AvatarFallback>JL</AvatarFallback>
|
|
74
|
+
</Avatar>
|
|
75
|
+
<AvatarGroupCount>+3</AvatarGroupCount>
|
|
76
|
+
</AvatarGroup>
|
|
77
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Badge
|
|
2
|
+
|
|
3
|
+
**Purpose:** a small pill-shaped label that shows a status, such as "Active", "Draft" or "Failed".
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Showing the status of an item in a list, table, card or heading.
|
|
8
|
+
- A short count or tag next to a title.
|
|
9
|
+
|
|
10
|
+
## When not to use
|
|
11
|
+
|
|
12
|
+
- **Anything the user clicks to do something.** Use **Button** (see Team rules).
|
|
13
|
+
- **An on/off option.** Use **Toggle** or **Checkbox**.
|
|
14
|
+
- **Long text.** Badge never wraps onto a second line, so keep it to one or two words.
|
|
15
|
+
|
|
16
|
+
## Team rules
|
|
17
|
+
|
|
18
|
+
- Badge is for showing status only. Never use it as a clickable button.
|
|
19
|
+
- Don't add new colours. If none of the existing tones (variants) fits, stop and ask before going further.
|
|
20
|
+
|
|
21
|
+
## Props and variants
|
|
22
|
+
|
|
23
|
+
| Prop | Values | Default | Notes |
|
|
24
|
+
| -------------- | ----------------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------- |
|
|
25
|
+
| `variant` | `default`, `secondary`, `destructive`, `outline`, `ghost`, `link` | `default` | The tone. See the table below. |
|
|
26
|
+
| `asChild` | `true` / `false` | `false` | Applies the badge's look to the single element inside it instead of rendering its own. |
|
|
27
|
+
| `aria-invalid` | `true` / `false` | | Red border. |
|
|
28
|
+
|
|
29
|
+
TODO: the `link` variant and `asChild` (wrapping a link) make a badge clickable, which goes against the first team rule. Decide whether clickable badges are allowed in any case, such as a link to a filtered list.
|
|
30
|
+
|
|
31
|
+
### Variants
|
|
32
|
+
|
|
33
|
+
| Variant | Looks like | Use for |
|
|
34
|
+
| ------------- | --------------------------------------------------------------------- | ------------------------------------ |
|
|
35
|
+
| `default` | Solid dark fill with light text in light mode (inverted in dark mode) | TODO: which statuses this tone means |
|
|
36
|
+
| `secondary` | Soft light-grey fill | TODO: which statuses this tone means |
|
|
37
|
+
| `destructive` | Light red tint with red text | Errors and failures. TODO: confirm |
|
|
38
|
+
| `outline` | Thin border, no fill | TODO: which statuses this tone means |
|
|
39
|
+
| `ghost` | No fill or border; light grey fill on hover | TODO: which statuses this tone means |
|
|
40
|
+
| `link` | Primary-coloured text, underlined on hover | See the TODO above |
|
|
41
|
+
|
|
42
|
+
There is no success or warning tone (green or amber). Under the team rules, ask before adding one.
|
|
43
|
+
|
|
44
|
+
TODO: in light mode the `destructive` badge fails the accessibility contrast check. Its red text on the light red tint is 4:1, and WCAG AA needs 4.5:1 for 12px text. Storybook's Accessibility panel flags it on the **Status In List** story. Decide whether to darken the text or strengthen the tint.
|
|
45
|
+
|
|
46
|
+
### Size
|
|
47
|
+
|
|
48
|
+
- 20px tall, 12px medium text and fully rounded ends.
|
|
49
|
+
- Icons inside are 12px.
|
|
50
|
+
- Only as wide as its text.
|
|
51
|
+
|
|
52
|
+
### States
|
|
53
|
+
|
|
54
|
+
- **Hover:** only `ghost` and `link` react on their own. The other variants change only when the badge is a link.
|
|
55
|
+
- **Keyboard focus:** a soft ring, when the badge is focusable.
|
|
56
|
+
- **Invalid:** red border.
|
|
57
|
+
|
|
58
|
+
## Tokens used
|
|
59
|
+
|
|
60
|
+
| Token | Where it's used |
|
|
61
|
+
| ------------------------------------ | ---------------------------------------------------------------- |
|
|
62
|
+
| `primary` / `primary-foreground` | `default` fill and text; `link` text |
|
|
63
|
+
| `secondary` / `secondary-foreground` | `secondary` fill and text |
|
|
64
|
+
| `destructive` | `destructive` tint and text; invalid border |
|
|
65
|
+
| `border` | `outline` border |
|
|
66
|
+
| `foreground` | `outline` text |
|
|
67
|
+
| `muted` / `muted-foreground` | Hover fill and text for `ghost` (and `outline` when it's a link) |
|
|
68
|
+
| `ring` | Focus ring |
|
|
69
|
+
| `radius` | The fully rounded ends |
|
|
70
|
+
|
|
71
|
+
## Example
|
|
72
|
+
|
|
73
|
+
From the **Status In List** story (one row):
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
<li className="flex items-center justify-between">
|
|
77
|
+
<span>Checkout flow</span>
|
|
78
|
+
<Badge variant="destructive">Failed</Badge>
|
|
79
|
+
</li>
|
|
80
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Breadcrumb
|
|
2
|
+
|
|
3
|
+
**Purpose:** shows where the current page sits in the site's hierarchy, with links back up each level.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Pages nested two or more levels deep, such as Projects › Website › Settings.
|
|
8
|
+
|
|
9
|
+
## When not to use
|
|
10
|
+
|
|
11
|
+
- **Top-level pages with no parent.** Leave it out.
|
|
12
|
+
- **Steps in a process.** Use a stepper or **Questionnaire**.
|
|
13
|
+
- **Main navigation.** Use **NavigationMenu** or **Sidebar**.
|
|
14
|
+
|
|
15
|
+
## Team rules
|
|
16
|
+
|
|
17
|
+
- TODO: add at least one rule from the team that AI can't work out from the code.
|
|
18
|
+
|
|
19
|
+
## Props and variants
|
|
20
|
+
|
|
21
|
+
Breadcrumb is built from parts. It has no variants or sizes.
|
|
22
|
+
|
|
23
|
+
| Part | What it is |
|
|
24
|
+
| --------------------- | -------------------------------------------------------------------------------- |
|
|
25
|
+
| `Breadcrumb` | The navigation landmark around the trail. |
|
|
26
|
+
| `BreadcrumbList` | The ordered trail. Wraps onto more lines when it runs out of room. |
|
|
27
|
+
| `BreadcrumbItem` | One level. |
|
|
28
|
+
| `BreadcrumbLink` | A link to a parent page. Takes `href`. Use `asChild` to wrap your router's link. |
|
|
29
|
+
| `BreadcrumbPage` | The current page, as plain text (not a link). Always the last item. |
|
|
30
|
+
| `BreadcrumbSeparator` | The arrow between levels. Pass your own icon as children to change it. |
|
|
31
|
+
| `BreadcrumbEllipsis` | "⋯" standing in for hidden middle levels. Screen readers hear "More". |
|
|
32
|
+
|
|
33
|
+
| Prop | On | Values | Default | Notes |
|
|
34
|
+
| --------- | ---------------- | ---------------- | ------- | ------------------------------------------------- |
|
|
35
|
+
| `asChild` | `BreadcrumbLink` | `true` / `false` | `false` | Applies the link look to your own link component. |
|
|
36
|
+
|
|
37
|
+
### Look
|
|
38
|
+
|
|
39
|
+
- 14px grey text, with links turning to full colour on hover.
|
|
40
|
+
- The current page is full colour.
|
|
41
|
+
- Separators are 14px chevrons; the ellipsis is a 20px box with a 16px icon.
|
|
42
|
+
|
|
43
|
+
TODO: the ellipsis is not clickable on its own. Decide how hidden levels are revealed (for example, wrapping it in a **DropdownMenu** trigger).
|
|
44
|
+
|
|
45
|
+
## Tokens used
|
|
46
|
+
|
|
47
|
+
| Token | Where it's used |
|
|
48
|
+
| ------------------ | ------------------------ |
|
|
49
|
+
| `muted-foreground` | Trail text and links |
|
|
50
|
+
| `foreground` | Link hover; current page |
|
|
51
|
+
|
|
52
|
+
## Example
|
|
53
|
+
|
|
54
|
+
Based on the **Default** story:
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
<Breadcrumb>
|
|
58
|
+
<BreadcrumbList>
|
|
59
|
+
<BreadcrumbItem>
|
|
60
|
+
<BreadcrumbLink href="/projects">Projects</BreadcrumbLink>
|
|
61
|
+
</BreadcrumbItem>
|
|
62
|
+
<BreadcrumbSeparator />
|
|
63
|
+
<BreadcrumbItem>
|
|
64
|
+
<BreadcrumbLink href="/projects/website">Website</BreadcrumbLink>
|
|
65
|
+
</BreadcrumbItem>
|
|
66
|
+
<BreadcrumbSeparator />
|
|
67
|
+
<BreadcrumbItem>
|
|
68
|
+
<BreadcrumbPage>Settings</BreadcrumbPage>
|
|
69
|
+
</BreadcrumbItem>
|
|
70
|
+
</BreadcrumbList>
|
|
71
|
+
</Breadcrumb>
|
|
72
|
+
```
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Bubble
|
|
2
|
+
|
|
3
|
+
**Purpose:** the rounded speech bubble that holds the text of one chat message.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Chat and assistant conversations: one bubble per message, inside a **Message**.
|
|
8
|
+
- Quick-reply suggestions the user can tap (a bubble whose content is a button).
|
|
9
|
+
|
|
10
|
+
## When not to use
|
|
11
|
+
|
|
12
|
+
- **The layout around a message** (avatar, name, time). Use **Message**, with a Bubble inside.
|
|
13
|
+
- **A comment or note outside a conversation.** Use a card or **Item**.
|
|
14
|
+
- **A hint on hover.** Use **Tooltip**.
|
|
15
|
+
|
|
16
|
+
## Team rules
|
|
17
|
+
|
|
18
|
+
- TODO: add at least one rule from the team that AI can't work out from the code.
|
|
19
|
+
|
|
20
|
+
## Props and variants
|
|
21
|
+
|
|
22
|
+
Bubble is built from parts.
|
|
23
|
+
|
|
24
|
+
| Part | What it is |
|
|
25
|
+
| ----------------- | ------------------------------------------------------------------------- |
|
|
26
|
+
| `BubbleGroup` | Stacks several bubbles from the same sender with a small gap. |
|
|
27
|
+
| `Bubble` | One bubble, at most 80% of the conversation width. |
|
|
28
|
+
| `BubbleContent` | The rounded box with the text. Use `asChild` to make it a button or link. |
|
|
29
|
+
| `BubbleReactions` | A small grey pill of emoji reactions that sits over the bubble's edge. |
|
|
30
|
+
|
|
31
|
+
| Prop | On | Values | Default | Notes |
|
|
32
|
+
| --------- | ----------------- | ---------------------------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `variant` | `Bubble` | `default`, `secondary`, `muted`, `tinted`, `outline`, `ghost`, `destructive` | `default` | See Variants. |
|
|
34
|
+
| `align` | `Bubble` | `start`, `end` | `start` | `end` pushes the bubble to the right (usually the user's own messages). Inside an `end` **Message** it follows the message. |
|
|
35
|
+
| `asChild` | `BubbleContent` | `true` / `false` | `false` | Puts the bubble's look on a button or link. |
|
|
36
|
+
| `side` | `BubbleReactions` | `top`, `bottom` | `bottom` | Which edge the reactions sit on. |
|
|
37
|
+
| `align` | `BubbleReactions` | `start`, `end` | `end` | Which corner. |
|
|
38
|
+
|
|
39
|
+
### Variants
|
|
40
|
+
|
|
41
|
+
| Variant | Looks like |
|
|
42
|
+
| ------------- | ---------------------------------------------------------------------- |
|
|
43
|
+
| `default` | Solid dark fill, light text (inverted in dark mode). |
|
|
44
|
+
| `secondary` | Soft light-grey fill. |
|
|
45
|
+
| `muted` | Light-grey fill. |
|
|
46
|
+
| `tinted` | A pale tint of the primary colour. |
|
|
47
|
+
| `outline` | Thin border, page-coloured fill. |
|
|
48
|
+
| `ghost` | No box at all: plain text at full width. Suits long assistant replies. |
|
|
49
|
+
| `destructive` | Light red tint with red text, for a message that failed. |
|
|
50
|
+
|
|
51
|
+
TODO: which sender each variant is for (user, assistant, system) isn't defined. Decide the pairing.
|
|
52
|
+
|
|
53
|
+
TODO: `tinted` and the hover colours of `secondary` and `muted` are mixed from tokens rather than being tokens themselves. Confirm this is OK.
|
|
54
|
+
|
|
55
|
+
### Look
|
|
56
|
+
|
|
57
|
+
- 14px text, 12px × 8px padding, 12px rounded corners. Long words break instead of overflowing.
|
|
58
|
+
- **Clickable bubble, on hover:** a slightly darker fill. **Keyboard focus:** a ring.
|
|
59
|
+
|
|
60
|
+
## Tokens used
|
|
61
|
+
|
|
62
|
+
| Token | Where it's used |
|
|
63
|
+
| ------------------------------------ | -------------------------------------------------- |
|
|
64
|
+
| `primary` / `primary-foreground` | `default` fill and text; base of the `tinted` fill |
|
|
65
|
+
| `secondary` / `secondary-foreground` | `secondary` fill and text |
|
|
66
|
+
| `muted` | `muted` fill; reactions pill; hover fills |
|
|
67
|
+
| `foreground` | `tinted` text; mixed into hover fills |
|
|
68
|
+
| `background` | `outline` fill |
|
|
69
|
+
| `border` | `outline` border |
|
|
70
|
+
| `input` | Hover fill in dark mode |
|
|
71
|
+
| `destructive` | `destructive` tint and text |
|
|
72
|
+
| `card` | Ring around the reactions pill |
|
|
73
|
+
| `ring` | Focus ring |
|
|
74
|
+
| `radius` | Corner rounding |
|
|
75
|
+
|
|
76
|
+
## Example
|
|
77
|
+
|
|
78
|
+
Based on the **Conversation** story:
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
<BubbleGroup>
|
|
82
|
+
<Bubble align="end">
|
|
83
|
+
<BubbleContent>Can you summarise this file?</BubbleContent>
|
|
84
|
+
</Bubble>
|
|
85
|
+
<Bubble variant="ghost">
|
|
86
|
+
<BubbleContent>Sure. It covers three things…</BubbleContent>
|
|
87
|
+
</Bubble>
|
|
88
|
+
</BubbleGroup>
|
|
89
|
+
```
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
**Purpose:** a clickable control that triggers an action, such as saving, submitting or opening something.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- To start an action on the current page: submit a form, save, confirm, cancel, open a dialog or menu.
|
|
8
|
+
- As the trigger for a menu, popover or dialog. While the thing it opens is showing, the button keeps its hover look.
|
|
9
|
+
- For an icon-only action in a toolbar or tight space. Use one of the `icon` sizes and give it a text label for screen readers.
|
|
10
|
+
- When something has to look like a button but is really a link to another page. Use `asChild` with a link (see Props).
|
|
11
|
+
|
|
12
|
+
## When not to use
|
|
13
|
+
|
|
14
|
+
- **For an on/off or selected state** (bold, a view mode, a filter). Use **Toggle** or **ToggleGroup** instead, because they announce whether they are pressed.
|
|
15
|
+
- **For a row of related actions that should read as one control.** Wrap the buttons in **ButtonGroup**.
|
|
16
|
+
- **For a link inside running text.** Use a normal text link. The `link` variant is for actions that should look like links, next to other buttons.
|
|
17
|
+
|
|
18
|
+
## Team rules
|
|
19
|
+
|
|
20
|
+
- One area can have only one primary (`default` variant) button.
|
|
21
|
+
- While saving, make the button disabled and change its label to say what is happening (for example "Saving…").
|
|
22
|
+
|
|
23
|
+
## Props and variants
|
|
24
|
+
|
|
25
|
+
| Prop | Values | Default | Notes |
|
|
26
|
+
| ---------- | -------------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------- |
|
|
27
|
+
| `variant` | `default`, `secondary`, `outline`, `ghost`, `destructive`, `link` | `default` | Visual emphasis. See the variant table below. |
|
|
28
|
+
| `size` | `xs`, `sm`, `default`, `lg`, `icon-xs`, `icon-sm`, `icon`, `icon-lg` | `default` | The `icon` sizes are square and meant for a single icon with no text. |
|
|
29
|
+
| `asChild` | `true` / `false` | `false` | Applies the button's look to the single element inside it (for example a link) instead of rendering a button. |
|
|
30
|
+
| `disabled` | `true` / `false` | `false` | Shows the button at half opacity and ignores clicks. |
|
|
31
|
+
|
|
32
|
+
Button also accepts everything a normal HTML button does: `onClick`, `type`, `aria-label` and so on. Three things to know:
|
|
33
|
+
|
|
34
|
+
- **`type`:** Button doesn't set one. Inside a form, a button with no `type` submits the form. Set `type="button"` on any button in a form that shouldn't submit it.
|
|
35
|
+
- **`aria-invalid`:** shows a red error border and ring. Use it when the button belongs to a field that failed validation.
|
|
36
|
+
- **`aria-label`:** required on icon-only buttons, because they have no visible text.
|
|
37
|
+
|
|
38
|
+
### Variants
|
|
39
|
+
|
|
40
|
+
| Variant | Looks like | Use for |
|
|
41
|
+
| ------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
|
42
|
+
| `default` | Solid dark fill with light text in light mode (inverted in dark mode). | The main action in a view or dialog. |
|
|
43
|
+
| `secondary` | Soft light-grey fill. | Supporting actions next to the main one. |
|
|
44
|
+
| `outline` | Page background with a thin border. | Supporting actions that need a clear edge, such as Cancel or toolbar buttons. |
|
|
45
|
+
| `ghost` | No fill or border until hovered. | Low-emphasis actions in toolbars, menus and lists. |
|
|
46
|
+
| `destructive` | Light red tint with red text. It is not a solid red fill. | Actions that delete or can't be undone. |
|
|
47
|
+
| `link` | Text in the primary colour, underlined on hover. | Actions that should read as a link. |
|
|
48
|
+
|
|
49
|
+
TODO: there are no written rules yet for choosing between `secondary` and `outline` for supporting actions.
|
|
50
|
+
|
|
51
|
+
### Sizes
|
|
52
|
+
|
|
53
|
+
| Size | Height | Text | Icon |
|
|
54
|
+
| --------- | --------- | ------ | ---- |
|
|
55
|
+
| `xs` | 24px | 12px | 12px |
|
|
56
|
+
| `sm` | 28px | 12.8px | 14px |
|
|
57
|
+
| `default` | 32px | 14px | 16px |
|
|
58
|
+
| `lg` | 36px | 14px | 16px |
|
|
59
|
+
| `icon-xs` | 24 × 24px | n/a | 12px |
|
|
60
|
+
| `icon-sm` | 28 × 28px | n/a | 16px |
|
|
61
|
+
| `icon` | 32 × 32px | n/a | 16px |
|
|
62
|
+
| `icon-lg` | 36 × 36px | n/a | 16px |
|
|
63
|
+
|
|
64
|
+
`lg` is taller than `default` but uses the same text size.
|
|
65
|
+
|
|
66
|
+
TODO: every size is under the common 44px touch-target guideline. The team needs to decide whether touch screens should use `lg` or a separate larger size.
|
|
67
|
+
|
|
68
|
+
### States
|
|
69
|
+
|
|
70
|
+
- **Hover:** each variant changes slightly. `default` fades a little, `outline` and `ghost` get a light grey fill, `secondary` darkens a little, `destructive` deepens its tint, and `link` underlines.
|
|
71
|
+
- **Keyboard focus:** a soft ring appears around the button. It shows for keyboard focus only, not for mouse clicks.
|
|
72
|
+
- **Pressed:** the button moves down 1px. Buttons that open a menu or popover don't move.
|
|
73
|
+
- **Open:** while a button's menu, popover or dialog is open, `outline`, `secondary` and `ghost` keep their hover look.
|
|
74
|
+
- **Disabled:** half opacity, and it ignores the pointer.
|
|
75
|
+
- **Invalid:** red border and red ring.
|
|
76
|
+
- **Loading:** Button has no loading prop. The stories show a pattern instead: make the button disabled, put a **Spinner** before the label, and change the label to say what's happening (for example "Saving…").
|
|
77
|
+
|
|
78
|
+
## Tokens used
|
|
79
|
+
|
|
80
|
+
The tokens are defined in `src/styles/globals.css` and each has a light and a dark value.
|
|
81
|
+
|
|
82
|
+
| Token | Where it's used |
|
|
83
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
84
|
+
| `primary` | `default` fill, `link` text |
|
|
85
|
+
| `primary-foreground` | `default` text |
|
|
86
|
+
| `secondary` | `secondary` fill, and its hover (mixed with 5% `foreground`) |
|
|
87
|
+
| `secondary-foreground` | `secondary` text |
|
|
88
|
+
| `muted` | Hover fill for `outline` and `ghost` (at half strength in dark mode for `ghost`), and their open state |
|
|
89
|
+
| `foreground` | Text colour on hover for `outline` and `ghost` |
|
|
90
|
+
| `background` | `outline` fill in light mode |
|
|
91
|
+
| `border` | `outline` border in light mode |
|
|
92
|
+
| `input` | `outline` border and a faint fill in dark mode |
|
|
93
|
+
| `destructive` | `destructive` tint and text, plus the invalid border and ring on any variant |
|
|
94
|
+
| `ring` | Keyboard focus ring and border |
|
|
95
|
+
| `radius` | Corner rounding. `default`, `lg`, `icon` and `icon-lg` use the full radius (10px). The smaller sizes (`xs`, `sm`, `icon-xs`, `icon-sm`) use 8px, and stay at 10–12px or less even if the radius token is raised. |
|
|
96
|
+
|
|
97
|
+
## Example
|
|
98
|
+
|
|
99
|
+
An icon-only action, from the **Icon Sizes** story:
|
|
100
|
+
|
|
101
|
+
```tsx
|
|
102
|
+
<Button variant="outline" size="icon" aria-label="Add">
|
|
103
|
+
<PlusIcon />
|
|
104
|
+
</Button>
|
|
105
|
+
```
|