@sixthshift/design-system 0.3.0 → 0.4.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 +114 -12
- package/dist/components/Badge/Badge.d.ts +64 -9
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +54 -46
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Badge/index.js.map +1 -1
- package/dist/components/BarChart/BarChart.d.ts +12 -0
- package/dist/components/BarChart/BarChart.d.ts.map +1 -1
- package/dist/components/BarChart/BarChart.js +12 -0
- package/dist/components/BarChart/BarChart.js.map +1 -1
- package/dist/components/Button/Button.d.ts +85 -6
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +97 -106
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +18 -4
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +19 -5
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Calendar/CalendarView.d.ts.map +1 -1
- package/dist/components/Calendar/CalendarView.js +10 -2
- package/dist/components/Calendar/CalendarView.js.map +1 -1
- package/dist/components/Calendar/calendar.types.d.ts +9 -0
- package/dist/components/Calendar/calendar.types.d.ts.map +1 -1
- package/dist/components/Card/Card.d.ts +13 -0
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +15 -2
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +21 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +22 -1
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +22 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.js +22 -0
- package/dist/components/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/dist/components/Code/Editor/Editor.js +2 -2
- package/dist/components/Code/Editor/Editor.js.map +1 -1
- package/dist/components/Code/Editor/themes.d.ts +2 -2
- package/dist/components/Code/Editor/themes.d.ts.map +1 -1
- package/dist/components/Code/Editor/themes.js +50 -32
- package/dist/components/Code/Editor/themes.js.map +1 -1
- package/dist/components/Code/ValidationStatus/ValidationStatus.d.ts.map +1 -1
- package/dist/components/Code/ValidationStatus/ValidationStatus.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +43 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +166 -4
- package/dist/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/DatePicker/DateSegments.d.ts +60 -0
- package/dist/components/DatePicker/DateSegments.d.ts.map +1 -0
- package/dist/components/DatePicker/DateSegments.js +80 -0
- package/dist/components/DatePicker/DateSegments.js.map +1 -0
- package/dist/components/DatePicker/datepicker.types.d.ts +19 -1
- package/dist/components/DatePicker/datepicker.types.d.ts.map +1 -1
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +20 -2
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +22 -4
- package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/components/DateRangePicker/daterangepicker.types.d.ts +6 -1
- package/dist/components/DateRangePicker/daterangepicker.types.d.ts.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +30 -2
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.js +105 -32
- package/dist/components/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/components/DateTimePicker/DateTimeSegments.d.ts +41 -0
- package/dist/components/DateTimePicker/DateTimeSegments.d.ts.map +1 -0
- package/dist/components/DateTimePicker/DateTimeSegments.js +67 -0
- package/dist/components/DateTimePicker/DateTimeSegments.js.map +1 -0
- package/dist/components/DateTimePicker/datetimepicker.types.d.ts +6 -1
- package/dist/components/DateTimePicker/datetimepicker.types.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +28 -2
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +136 -58
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
- package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts +6 -1
- package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts.map +1 -1
- package/dist/components/Field/Field.d.ts +15 -17
- package/dist/components/Field/Field.d.ts.map +1 -1
- package/dist/components/Field/Field.js +18 -3
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/FormField/FormField.d.ts +15 -0
- package/dist/components/FormField/FormField.d.ts.map +1 -1
- package/dist/components/FormField/FormField.js +15 -0
- package/dist/components/FormField/FormField.js.map +1 -1
- package/dist/components/HoverCard/HoverCard.d.ts +6 -0
- package/dist/components/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/components/HoverCard/HoverCard.js +6 -0
- package/dist/components/HoverCard/HoverCard.js.map +1 -1
- package/dist/components/Input/Input.d.ts +15 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.js +18 -3
- package/dist/components/Input/Input.js.map +1 -1
- package/dist/components/LineChart/LineChart.d.ts +17 -0
- package/dist/components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/components/LineChart/LineChart.js +17 -0
- package/dist/components/LineChart/LineChart.js.map +1 -1
- package/dist/components/Markdown/Markdown.d.ts +17 -0
- package/dist/components/Markdown/Markdown.d.ts.map +1 -1
- package/dist/components/Markdown/Markdown.js +17 -0
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/Message/Message.d.ts +49 -4
- package/dist/components/Message/Message.d.ts.map +1 -1
- package/dist/components/Message/Message.js +53 -17
- package/dist/components/Message/Message.js.map +1 -1
- package/dist/components/Message/index.d.ts +1 -1
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts +36 -0
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +37 -1
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/components/ModalHeader.js +1 -1
- package/dist/components/Modal/components/ModalHeader.js.map +1 -1
- package/dist/components/Popover/Popover.d.ts +29 -0
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/Popover.js +29 -0
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +14 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +14 -0
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/RadioButton/RadioButton.d.ts +26 -0
- package/dist/components/RadioButton/RadioButton.d.ts.map +1 -1
- package/dist/components/RadioButton/RadioButton.js +35 -1
- package/dist/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts +26 -0
- package/dist/components/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -1
- package/dist/components/RadioButtonGroup/RadioButtonGroup.js +33 -0
- package/dist/components/RadioButtonGroup/RadioButtonGroup.js.map +1 -1
- package/dist/components/SearchInput/SearchInput.d.ts +10 -0
- package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.js +12 -1
- package/dist/components/SearchInput/SearchInput.js.map +1 -1
- package/dist/components/Select/Select.d.ts +4 -5
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +4 -5
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectDropdown.d.ts.map +1 -1
- package/dist/components/Select/SelectDropdown.js +4 -3
- package/dist/components/Select/SelectDropdown.js.map +1 -1
- package/dist/components/Select/SelectTrigger.js +2 -2
- package/dist/components/Select/SelectTrigger.js.map +1 -1
- package/dist/components/Separator/Separator.d.ts +10 -0
- package/dist/components/Separator/Separator.d.ts.map +1 -1
- package/dist/components/Separator/Separator.js +10 -0
- package/dist/components/Separator/Separator.js.map +1 -1
- package/dist/components/Sheet/Sheet.d.ts +6 -0
- package/dist/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/Sheet/Sheet.js +7 -1
- package/dist/components/Sheet/Sheet.js.map +1 -1
- package/dist/components/Sheet/components/SheetFooter.js +1 -1
- package/dist/components/Sheet/components/SheetFooter.js.map +1 -1
- package/dist/components/Sheet/components/SheetHeader.js +1 -1
- package/dist/components/Sheet/components/SheetHeader.js.map +1 -1
- package/dist/components/Sparkline/Sparkline.d.ts +11 -0
- package/dist/components/Sparkline/Sparkline.d.ts.map +1 -1
- package/dist/components/Sparkline/Sparkline.js +11 -0
- package/dist/components/Sparkline/Sparkline.js.map +1 -1
- package/dist/components/Spinner/Spinner.d.ts +27 -2
- package/dist/components/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner/Spinner.js +28 -3
- package/dist/components/Spinner/Spinner.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +18 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.js +19 -1
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +6 -0
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +6 -0
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/components/TabsTrigger.d.ts.map +1 -1
- package/dist/components/Tabs/components/TabsTrigger.js +22 -6
- package/dist/components/Tabs/components/TabsTrigger.js.map +1 -1
- package/dist/components/TagChip/TagChip.d.ts +14 -12
- package/dist/components/TagChip/TagChip.d.ts.map +1 -1
- package/dist/components/TagChip/TagChip.js +14 -1
- package/dist/components/TagChip/TagChip.js.map +1 -1
- package/dist/components/TagInput/TagInput.d.ts +11 -8
- package/dist/components/TagInput/TagInput.d.ts.map +1 -1
- package/dist/components/TagInput/TagInput.js +11 -0
- package/dist/components/TagInput/TagInput.js.map +1 -1
- package/dist/components/Text/Text.d.ts +9 -0
- package/dist/components/Text/Text.d.ts.map +1 -1
- package/dist/components/Text/Text.js +9 -0
- package/dist/components/Text/Text.js.map +1 -1
- package/dist/components/TextInline/TextInline.d.ts +15 -4
- package/dist/components/TextInline/TextInline.d.ts.map +1 -1
- package/dist/components/TextInline/TextInline.js +11 -0
- package/dist/components/TextInline/TextInline.js.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +12 -0
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +13 -1
- package/dist/components/Textarea/Textarea.js.map +1 -1
- package/dist/components/TimePicker/TimeColumn.d.ts +10 -1
- package/dist/components/TimePicker/TimeColumn.d.ts.map +1 -1
- package/dist/components/TimePicker/TimeColumn.js +8 -1
- package/dist/components/TimePicker/TimeColumn.js.map +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts +32 -0
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.js +93 -6
- package/dist/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/components/TimePicker/TimeSegments.d.ts +50 -0
- package/dist/components/TimePicker/TimeSegments.d.ts.map +1 -0
- package/dist/components/TimePicker/TimeSegments.js +93 -0
- package/dist/components/TimePicker/TimeSegments.js.map +1 -0
- package/dist/components/TimePicker/timepicker.hooks.d.ts +0 -4
- package/dist/components/TimePicker/timepicker.hooks.d.ts.map +1 -1
- package/dist/components/TimePicker/timepicker.hooks.js +1 -23
- package/dist/components/TimePicker/timepicker.hooks.js.map +1 -1
- package/dist/components/TimePicker/timepicker.types.d.ts +0 -2
- package/dist/components/TimePicker/timepicker.types.d.ts.map +1 -1
- package/dist/components/Toast/Toast.d.ts +27 -0
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +28 -1
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts +31 -12
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.js +19 -31
- package/dist/components/Toggle/Toggle.js.map +1 -1
- package/dist/components/Toggle/index.d.ts +1 -1
- package/dist/components/Toggle/index.d.ts.map +1 -1
- package/dist/components/Toggle/index.js +1 -1
- package/dist/components/Toggle/index.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +17 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.js +17 -0
- package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +1 -1
- package/dist/components/ToggleGroup/ToggleGroupItem.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroupItem.js +7 -6
- package/dist/components/ToggleGroup/ToggleGroupItem.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroupMultiple.d.ts +4 -3
- package/dist/components/ToggleGroup/ToggleGroupMultiple.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroupMultiple.js +2 -2
- package/dist/components/ToggleGroup/ToggleGroupMultiple.js.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroupSingle.d.ts +4 -3
- package/dist/components/ToggleGroup/ToggleGroupSingle.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroupSingle.js +2 -2
- package/dist/components/ToggleGroup/ToggleGroupSingle.js.map +1 -1
- package/dist/components/ToggleGroup/toggleGroup.types.d.ts +12 -3
- package/dist/components/ToggleGroup/toggleGroup.types.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +6 -0
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +6 -0
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/date-time/index.d.ts.map +1 -1
- package/dist/date-time/index.js +0 -1
- package/dist/date-time/index.js.map +1 -1
- package/dist/internal/PickerField.d.ts +45 -0
- package/dist/internal/PickerField.d.ts.map +1 -0
- package/dist/internal/PickerField.js +24 -0
- package/dist/internal/PickerField.js.map +1 -0
- package/dist/internal/SegmentedField.d.ts +98 -0
- package/dist/internal/SegmentedField.d.ts.map +1 -0
- package/dist/internal/SegmentedField.js +315 -0
- package/dist/internal/SegmentedField.js.map +1 -0
- package/dist/internal/index.d.ts +2 -0
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +2 -0
- package/dist/internal/index.js.map +1 -1
- package/dist/theme/index.d.ts +2 -2
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/schema.d.ts +0 -22
- package/dist/theme/schema.d.ts.map +1 -1
- package/dist/theme/schema.js +0 -9
- package/dist/theme/schema.js.map +1 -1
- package/package.json +3 -45
- package/src/components/Badge/Badge.tsx +85 -48
- package/src/components/Badge/index.ts +10 -1
- package/src/components/BarChart/BarChart.tsx +12 -0
- package/src/components/Button/Button.tsx +129 -106
- package/src/components/Button/index.ts +10 -1
- package/src/components/Calendar/Calendar.tsx +29 -16
- package/src/components/Calendar/CalendarView.tsx +10 -1
- package/src/components/Calendar/calendar.types.ts +10 -0
- package/src/components/Card/Card.tsx +15 -2
- package/src/components/Checkbox/Checkbox.tsx +22 -2
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +22 -0
- package/src/components/Code/Editor/Editor.tsx +2 -2
- package/src/components/Code/Editor/themes.ts +50 -32
- package/src/components/Code/ValidationStatus/ValidationStatus.tsx +6 -3
- package/src/components/DatePicker/DatePicker.tsx +279 -28
- package/src/components/DatePicker/DateSegments.tsx +125 -0
- package/src/components/DatePicker/datepicker.types.ts +21 -1
- package/src/components/DatePicker/index.ts +8 -1
- package/src/components/DateRangePicker/DateRangePicker.tsx +22 -4
- package/src/components/DateRangePicker/daterangepicker.types.ts +7 -1
- package/src/components/DateTimePicker/DateTimePicker.tsx +143 -70
- package/src/components/DateTimePicker/DateTimeSegments.tsx +113 -0
- package/src/components/DateTimePicker/datetimepicker.types.ts +7 -1
- package/src/components/DateTimeRangePicker/DateTimeRangePicker.tsx +195 -104
- package/src/components/DateTimeRangePicker/datetimerangepicker.types.ts +7 -1
- package/src/components/Field/Field.tsx +20 -22
- package/src/components/FormField/FormField.tsx +15 -0
- package/src/components/HoverCard/HoverCard.tsx +6 -0
- package/src/components/Input/Input.tsx +19 -4
- package/src/components/LineChart/LineChart.tsx +17 -0
- package/src/components/Markdown/Markdown.tsx +17 -0
- package/src/components/Message/Message.tsx +73 -23
- package/src/components/Message/index.ts +1 -1
- package/src/components/Modal/Modal.tsx +42 -3
- package/src/components/Modal/components/ModalHeader.tsx +1 -1
- package/src/components/Popover/Popover.tsx +29 -0
- package/src/components/ProgressBar/ProgressBar.tsx +14 -0
- package/src/components/RadioButton/RadioButton.tsx +34 -3
- package/src/components/RadioButtonGroup/RadioButtonGroup.tsx +32 -0
- package/src/components/SearchInput/SearchInput.tsx +13 -2
- package/src/components/Select/Select.tsx +4 -5
- package/src/components/Select/SelectDropdown.tsx +13 -9
- package/src/components/Select/SelectTrigger.tsx +7 -7
- package/src/components/Separator/Separator.tsx +10 -0
- package/src/components/Sheet/Sheet.tsx +8 -2
- package/src/components/Sheet/components/SheetFooter.tsx +1 -1
- package/src/components/Sheet/components/SheetHeader.tsx +2 -2
- package/src/components/Sparkline/Sparkline.tsx +11 -0
- package/src/components/Spinner/Spinner.tsx +28 -3
- package/src/components/Switch/Switch.tsx +27 -4
- package/src/components/Tabs/Tabs.tsx +6 -0
- package/src/components/Tabs/components/TabsTrigger.tsx +22 -5
- package/src/components/TagChip/TagChip.tsx +18 -16
- package/src/components/TagInput/TagInput.tsx +11 -8
- package/src/components/Text/Text.tsx +9 -0
- package/src/components/TextInline/TextInline.tsx +11 -0
- package/src/components/Textarea/Textarea.tsx +13 -1
- package/src/components/TimePicker/TimeColumn.tsx +24 -1
- package/src/components/TimePicker/TimePicker.tsx +127 -39
- package/src/components/TimePicker/TimeSegments.tsx +131 -0
- package/src/components/TimePicker/timepicker.hooks.ts +1 -24
- package/src/components/TimePicker/timepicker.types.ts +0 -3
- package/src/components/Toast/Toast.tsx +28 -1
- package/src/components/Toggle/Toggle.tsx +34 -32
- package/src/components/Toggle/index.ts +1 -1
- package/src/components/ToggleGroup/ToggleGroup.tsx +17 -0
- package/src/components/ToggleGroup/ToggleGroupItem.tsx +13 -8
- package/src/components/ToggleGroup/ToggleGroupMultiple.tsx +3 -1
- package/src/components/ToggleGroup/ToggleGroupSingle.tsx +3 -1
- package/src/components/ToggleGroup/toggleGroup.types.ts +12 -3
- package/src/components/Tooltip/Tooltip.tsx +6 -0
- package/src/date-time/index.ts +0 -1
- package/src/internal/PickerField.tsx +90 -0
- package/src/internal/SegmentedField.tsx +445 -0
- package/src/internal/index.ts +2 -0
- package/src/theme/index.ts +0 -6
- package/src/theme/recipes/badge.css +140 -0
- package/src/theme/recipes/button.css +167 -0
- package/src/theme/recipes/card.css +26 -0
- package/src/theme/recipes/checkbox.css +44 -0
- package/src/theme/recipes/field.css +14 -0
- package/src/theme/recipes/index.css +28 -0
- package/src/theme/recipes/input.css +29 -0
- package/src/theme/recipes/message.css +47 -0
- package/src/theme/recipes/modal.css +31 -0
- package/src/theme/recipes/radio-button.css +42 -0
- package/src/theme/recipes/search-input.css +16 -0
- package/src/theme/recipes/select.css +105 -0
- package/src/theme/recipes/sheet.css +34 -0
- package/src/theme/recipes/spinner.css +17 -0
- package/src/theme/recipes/switch.css +39 -0
- package/src/theme/recipes/tabs.css +41 -0
- package/src/theme/recipes/tag-chip.css +27 -0
- package/src/theme/recipes/textarea.css +20 -0
- package/src/theme/recipes/toggle.css +92 -0
- package/src/theme/schema.ts +0 -27
- package/src/theme/tokens.css +26 -9
- package/dist/components/Avatar/Avatar.d.ts +0 -6
- package/dist/components/Avatar/Avatar.d.ts.map +0 -1
- package/dist/components/Avatar/Avatar.js +0 -11
- package/dist/components/Avatar/Avatar.js.map +0 -1
- package/dist/components/Avatar/index.d.ts +0 -2
- package/dist/components/Avatar/index.d.ts.map +0 -1
- package/dist/components/Avatar/index.js +0 -2
- package/dist/components/Avatar/index.js.map +0 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +0 -12
- package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +0 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +0 -19
- package/dist/components/Breadcrumb/Breadcrumb.js.map +0 -1
- package/dist/components/Breadcrumb/index.d.ts +0 -2
- package/dist/components/Breadcrumb/index.d.ts.map +0 -1
- package/dist/components/Breadcrumb/index.js +0 -2
- package/dist/components/Breadcrumb/index.js.map +0 -1
- package/dist/components/ColorDot/ColorDot.d.ts +0 -19
- package/dist/components/ColorDot/ColorDot.d.ts.map +0 -1
- package/dist/components/ColorDot/ColorDot.js +0 -36
- package/dist/components/ColorDot/ColorDot.js.map +0 -1
- package/dist/components/ColorDot/index.d.ts +0 -2
- package/dist/components/ColorDot/index.d.ts.map +0 -1
- package/dist/components/ColorDot/index.js +0 -2
- package/dist/components/ColorDot/index.js.map +0 -1
- package/dist/components/EmptyState/EmptyState.d.ts +0 -26
- package/dist/components/EmptyState/EmptyState.d.ts.map +0 -1
- package/dist/components/EmptyState/EmptyState.js +0 -9
- package/dist/components/EmptyState/EmptyState.js.map +0 -1
- package/dist/components/EmptyState/index.d.ts +0 -2
- package/dist/components/EmptyState/index.d.ts.map +0 -1
- package/dist/components/EmptyState/index.js +0 -2
- package/dist/components/EmptyState/index.js.map +0 -1
- package/dist/components/HeatMap/HeatMapCalendar.d.ts +0 -11
- package/dist/components/HeatMap/HeatMapCalendar.d.ts.map +0 -1
- package/dist/components/HeatMap/HeatMapCalendar.js +0 -68
- package/dist/components/HeatMap/HeatMapCalendar.js.map +0 -1
- package/dist/components/HeatMap/HeatMapMatrix.d.ts +0 -12
- package/dist/components/HeatMap/HeatMapMatrix.d.ts.map +0 -1
- package/dist/components/HeatMap/HeatMapMatrix.js +0 -35
- package/dist/components/HeatMap/HeatMapMatrix.js.map +0 -1
- package/dist/components/HeatMap/heat-map.utils.d.ts +0 -10
- package/dist/components/HeatMap/heat-map.utils.d.ts.map +0 -1
- package/dist/components/HeatMap/heat-map.utils.js +0 -10
- package/dist/components/HeatMap/heat-map.utils.js.map +0 -1
- package/dist/components/HeatMap/index.d.ts +0 -4
- package/dist/components/HeatMap/index.d.ts.map +0 -1
- package/dist/components/HeatMap/index.js +0 -3
- package/dist/components/HeatMap/index.js.map +0 -1
- package/dist/components/MetricList/MetricList.d.ts +0 -9
- package/dist/components/MetricList/MetricList.d.ts.map +0 -1
- package/dist/components/MetricList/MetricList.js +0 -8
- package/dist/components/MetricList/MetricList.js.map +0 -1
- package/dist/components/MetricList/MetricRow.d.ts +0 -13
- package/dist/components/MetricList/MetricRow.d.ts.map +0 -1
- package/dist/components/MetricList/MetricRow.js +0 -13
- package/dist/components/MetricList/MetricRow.js.map +0 -1
- package/dist/components/MetricList/index.d.ts +0 -3
- package/dist/components/MetricList/index.d.ts.map +0 -1
- package/dist/components/MetricList/index.js +0 -3
- package/dist/components/MetricList/index.js.map +0 -1
- package/dist/components/NavBottom/NavBottom.d.ts +0 -16
- package/dist/components/NavBottom/NavBottom.d.ts.map +0 -1
- package/dist/components/NavBottom/NavBottom.js +0 -21
- package/dist/components/NavBottom/NavBottom.js.map +0 -1
- package/dist/components/NavBottom/index.d.ts +0 -3
- package/dist/components/NavBottom/index.d.ts.map +0 -1
- package/dist/components/NavBottom/index.js +0 -2
- package/dist/components/NavBottom/index.js.map +0 -1
- package/dist/components/NavSide/NavItem.d.ts +0 -9
- package/dist/components/NavSide/NavItem.d.ts.map +0 -1
- package/dist/components/NavSide/NavItem.js +0 -13
- package/dist/components/NavSide/NavItem.js.map +0 -1
- package/dist/components/NavSide/NavSide.d.ts +0 -16
- package/dist/components/NavSide/NavSide.d.ts.map +0 -1
- package/dist/components/NavSide/NavSide.js +0 -12
- package/dist/components/NavSide/NavSide.js.map +0 -1
- package/dist/components/NavSide/index.d.ts +0 -3
- package/dist/components/NavSide/index.d.ts.map +0 -1
- package/dist/components/NavSide/index.js +0 -2
- package/dist/components/NavSide/index.js.map +0 -1
- package/dist/components/NavSide/types.d.ts +0 -38
- package/dist/components/NavSide/types.d.ts.map +0 -1
- package/dist/components/NavSide/types.js +0 -2
- package/dist/components/NavSide/types.js.map +0 -1
- package/dist/components/Pagination/Pagination.d.ts +0 -35
- package/dist/components/Pagination/Pagination.d.ts.map +0 -1
- package/dist/components/Pagination/Pagination.js +0 -26
- package/dist/components/Pagination/Pagination.js.map +0 -1
- package/dist/components/Pagination/index.d.ts +0 -3
- package/dist/components/Pagination/index.d.ts.map +0 -1
- package/dist/components/Pagination/index.js +0 -2
- package/dist/components/Pagination/index.js.map +0 -1
- package/dist/components/Skeleton/Skeleton.d.ts +0 -4
- package/dist/components/Skeleton/Skeleton.d.ts.map +0 -1
- package/dist/components/Skeleton/Skeleton.js +0 -9
- package/dist/components/Skeleton/Skeleton.js.map +0 -1
- package/dist/components/Skeleton/index.d.ts +0 -2
- package/dist/components/Skeleton/index.d.ts.map +0 -1
- package/dist/components/Skeleton/index.js +0 -2
- package/dist/components/Skeleton/index.js.map +0 -1
- package/dist/components/StatsCard/StatsCard.d.ts +0 -17
- package/dist/components/StatsCard/StatsCard.d.ts.map +0 -1
- package/dist/components/StatsCard/StatsCard.js +0 -15
- package/dist/components/StatsCard/StatsCard.js.map +0 -1
- package/dist/components/StatsCard/index.d.ts +0 -2
- package/dist/components/StatsCard/index.d.ts.map +0 -1
- package/dist/components/StatsCard/index.js +0 -2
- package/dist/components/StatsCard/index.js.map +0 -1
- package/src/components/Avatar/Avatar.tsx +0 -19
- package/src/components/Avatar/index.ts +0 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +0 -47
- package/src/components/Breadcrumb/index.ts +0 -5
- package/src/components/ColorDot/ColorDot.tsx +0 -52
- package/src/components/ColorDot/index.ts +0 -1
- package/src/components/EmptyState/EmptyState.tsx +0 -30
- package/src/components/EmptyState/index.ts +0 -1
- package/src/components/HeatMap/HeatMapCalendar.tsx +0 -127
- package/src/components/HeatMap/HeatMapMatrix.tsx +0 -75
- package/src/components/HeatMap/heat-map.utils.ts +0 -15
- package/src/components/HeatMap/index.ts +0 -3
- package/src/components/MetricList/MetricList.tsx +0 -18
- package/src/components/MetricList/MetricRow.tsx +0 -30
- package/src/components/MetricList/index.ts +0 -2
- package/src/components/NavBottom/NavBottom.tsx +0 -55
- package/src/components/NavBottom/index.ts +0 -3
- package/src/components/NavSide/NavItem.tsx +0 -39
- package/src/components/NavSide/NavSide.tsx +0 -42
- package/src/components/NavSide/index.ts +0 -2
- package/src/components/NavSide/types.ts +0 -36
- package/src/components/Pagination/Pagination.tsx +0 -86
- package/src/components/Pagination/index.ts +0 -2
- package/src/components/Skeleton/Skeleton.tsx +0 -9
- package/src/components/Skeleton/index.ts +0 -1
- package/src/components/StatsCard/StatsCard.tsx +0 -41
- package/src/components/StatsCard/index.ts +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# design-system
|
|
2
2
|
|
|
3
|
-
Personal design system: design tokens, theme pipeline, and a React component library.
|
|
3
|
+
Personal design system: design tokens, theme pipeline, and a React component library. Consumed as a versioned dependency (MUI-style), configured through the theme surface — never by editing component source in the consumer.
|
|
4
4
|
|
|
5
5
|
A single package, `@sixthshift/design-system`: ~80 components (primitives, overlays, forms, pickers, charts, typography) + a JSON-driven token/theme pipeline + Tailwind config. Built on [shadcn/ui](https://ui.shadcn.com) patterns.
|
|
6
6
|
|
|
@@ -22,6 +22,7 @@ npm install @sixthshift/design-system
|
|
|
22
22
|
/* your CSS entry — Tailwind 4 is a required peer */
|
|
23
23
|
@import "tailwindcss";
|
|
24
24
|
@import "@sixthshift/design-system/theme.css";
|
|
25
|
+
@source "../node_modules/@sixthshift/design-system";
|
|
25
26
|
```
|
|
26
27
|
|
|
27
28
|
That second line is opinionated: it replaces Tailwind's default palette with this
|
|
@@ -76,14 +77,14 @@ Skip this and text falls back to the next family in the stack (`ui-sans-serif` /
|
|
|
76
77
|
## Available exports
|
|
77
78
|
|
|
78
79
|
```tsx
|
|
79
|
-
// Primitives (Button, Badge, Card, Input, Textarea, Checkbox, Switch,
|
|
80
|
+
// Primitives (Button, Badge, Card, Input, Textarea, Checkbox, Switch, ...)
|
|
80
81
|
import { Button } from "@sixthshift/design-system/button";
|
|
81
82
|
import { Input } from "@sixthshift/design-system/input";
|
|
82
83
|
|
|
83
|
-
// Composites (FormField,
|
|
84
|
+
// Composites (FormField, Tabs, ...)
|
|
84
85
|
import { FormField } from "@sixthshift/design-system/form-field";
|
|
85
86
|
|
|
86
|
-
// Charts (LineChart, BarChart, Sparkline
|
|
87
|
+
// Charts (LineChart, BarChart, Sparkline)
|
|
87
88
|
import { LineChart } from "@sixthshift/design-system/line-chart";
|
|
88
89
|
|
|
89
90
|
// Pickers (Calendar, DatePicker, TimePicker, DateTimePicker, DateRangePicker, DateTimeRangePicker)
|
|
@@ -188,22 +189,123 @@ restyle by overriding CSS variables at runtime — component source stays
|
|
|
188
189
|
untouched. See [docs/design-tokens.md](docs/design-tokens.md) for the full token
|
|
189
190
|
reference.
|
|
190
191
|
|
|
192
|
+
Tokens come in three tiers, and the one you reach for depends on the *kind* of
|
|
193
|
+
change you are making:
|
|
194
|
+
|
|
195
|
+
| Tier | Example | Change it to | Scope |
|
|
196
|
+
| --- | --- | --- | --- |
|
|
197
|
+
| Palette | `--color-ocean-600` | add or alter a hue | everything downstream |
|
|
198
|
+
| Semantic | `--bg-brand` | **re-skin** — brand is now purple | every surface that means "brand" |
|
|
199
|
+
| Component | `--button-bg` | **re-wire** — *this* part uses a different meaning | one component, or one subtree |
|
|
200
|
+
|
|
201
|
+
Re-skinning is a token *value* change and it is global by design. Re-wiring is a
|
|
202
|
+
recipe change, and it is the one that used to be impossible.
|
|
203
|
+
|
|
191
204
|
### Tailwind integration
|
|
192
205
|
|
|
193
|
-
The
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
206
|
+
The three lines above are the whole integration. The theme import carries the
|
|
207
|
+
token variables *and* the `@theme` block declaring the library's utilities, so
|
|
208
|
+
`bg-bg-brand`, `z-modal`, `animate-fade-in` and `dark:*` compile in your build
|
|
209
|
+
alongside your own classes — same pass, same tree-shaking, and
|
|
197
210
|
`className="mt-8"` on a library component works like any other Tailwind class.
|
|
198
211
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
212
|
+
**The `@source` line is required.** Tailwind 4's automatic content detection
|
|
213
|
+
never scans `node_modules`, so without it none of this library's classes are
|
|
214
|
+
found and every component renders unstyled.
|
|
215
|
+
|
|
216
|
+
The path is a filesystem path resolved relative to the CSS file that declares
|
|
217
|
+
it — not a package specifier, so a bare `"@sixthshift/design-system"` silently
|
|
218
|
+
matches nothing. Adjust the depth to wherever your CSS entry lives; in a
|
|
219
|
+
monorepo with hoisted dependencies that is often `"../../node_modules/…"`. A
|
|
220
|
+
symlinked install (pnpm) needs no special handling: `@source` follows the link
|
|
221
|
+
into the store.
|
|
222
|
+
|
|
223
|
+
Beyond that there is no preset, no `@config`, and no prebuilt stylesheet to
|
|
224
|
+
import.
|
|
202
225
|
|
|
203
226
|
**Tailwind 4 is required, not optional.** Every component is a set of Tailwind
|
|
204
227
|
classes, so without it they render unstyled. That is why `tailwindcss` is a
|
|
205
228
|
non-optional peer dependency.
|
|
206
229
|
|
|
230
|
+
### Restyling a component
|
|
231
|
+
|
|
232
|
+
Every component reads its colours from its own tokens rather than naming a
|
|
233
|
+
semantic token directly. `Button` resolves `--button-bg`, whose value is decided
|
|
234
|
+
by a recipe in the published stylesheet:
|
|
235
|
+
|
|
236
|
+
```css
|
|
237
|
+
/* what ships, in @layer components */
|
|
238
|
+
.btn[data-variant="solid"][data-intent="neutral"] {
|
|
239
|
+
--button-bg: var(--bg-brand);
|
|
240
|
+
--button-bg-hovered: var(--bg-brand-hovered);
|
|
241
|
+
--button-fg: var(--fg-on-brand);
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
That recipe is data, not compiled-in class names, so you can re-point any cell.
|
|
246
|
+
Four granularities, narrowest to broadest:
|
|
247
|
+
|
|
248
|
+
```tsx
|
|
249
|
+
// one instance — inline styles outrank layers and specificity both
|
|
250
|
+
<Button style={{ "--button-bg": "var(--bg-strong)" } as React.CSSProperties} />
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
```css
|
|
254
|
+
/* one subtree — impossible with token values, which are global */
|
|
255
|
+
.checkout .btn[data-intent="neutral"] { --button-bg: var(--bg-success); }
|
|
256
|
+
|
|
257
|
+
/* one cell, app-wide — reject a house opinion */
|
|
258
|
+
.btn[data-variant="link"][data-intent="neutral"] { --button-fg: var(--fg-normal); }
|
|
259
|
+
|
|
260
|
+
/* every button */
|
|
261
|
+
.btn { --button-bg-hovered: var(--button-bg); } /* no hover shift, anywhere */
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Write your overrides unlayered.** The cascade compares layers *before*
|
|
265
|
+
specificity, and unlayered author CSS outranks any layered author CSS — which is
|
|
266
|
+
why a bare `.btn { … }` beats the library's three-attribute selector without an
|
|
267
|
+
`!important`. The corollary is the trap: wrap the same rule in
|
|
268
|
+
`@layer components` (a Tailwind 3 habit) and it lands in the library's own layer,
|
|
269
|
+
where specificity decides again and your override silently loses on every cell
|
|
270
|
+
the library ships.
|
|
271
|
+
|
|
272
|
+
#### Adding an intent the library never shipped
|
|
273
|
+
|
|
274
|
+
```css
|
|
275
|
+
/* 1. the semantic tokens — both modes, mirroring the library's own selectors */
|
|
276
|
+
:root:not([data-theme]),
|
|
277
|
+
:root[data-theme="light"] { --bg-info: var(--color-ocean-700); --fg-on-info: #fff; }
|
|
278
|
+
:root[data-theme="dark"] { --bg-info: var(--color-ocean-400); --fg-on-info: #06121f; }
|
|
279
|
+
|
|
280
|
+
/* 2. the recipe cell */
|
|
281
|
+
.btn[data-variant="solid"][data-intent="info"] {
|
|
282
|
+
--button-bg: var(--bg-info);
|
|
283
|
+
--button-fg: var(--fg-on-info);
|
|
284
|
+
}
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
```tsx
|
|
288
|
+
<Button intent="info">Details</Button> // type-checks; no library release needed
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
`variant` and `intent` are typed as the shipped union *plus* `string`, so a value
|
|
292
|
+
you invent is accepted while the built-ins still autocomplete. Note that no
|
|
293
|
+
`@theme` entry is needed: recipes read `var(--bg-info)` as plain CSS, never
|
|
294
|
+
through a Tailwind utility. You own the contrast of tokens you add —
|
|
295
|
+
`bun run check:contrast` only sees the library's own.
|
|
296
|
+
|
|
297
|
+
#### Finding the token names
|
|
298
|
+
|
|
299
|
+
`bun run check:recipes --list` prints every component token grouped by
|
|
300
|
+
component. The names follow `--{component}[-{part}]-{context}[-{state}]`, where
|
|
301
|
+
context is `bg`/`fg`/`border`/`ring` and state is `hovered`/`pressed`/`disabled`
|
|
302
|
+
— e.g. `--modal-overlay-bg`, `--input-placeholder-fg`, `--card-border-hovered`.
|
|
303
|
+
|
|
304
|
+
Intent and variant never appear in a token *name*; they select via the `data-*`
|
|
305
|
+
attributes. That is what lets you add one.
|
|
306
|
+
|
|
307
|
+
**These names are public API** and change only under semver, like any export.
|
|
308
|
+
|
|
207
309
|
### What the theme takes over
|
|
208
310
|
|
|
209
311
|
This is a design system, not a component grab-bag: importing `theme.css` adopts
|
|
@@ -327,4 +429,4 @@ git tag v0.2.0 && git push origin v0.2.0
|
|
|
327
429
|
|
|
328
430
|
## Docs
|
|
329
431
|
|
|
330
|
-
Design-system knowledge lives in [`docs/`](docs/): [design tokens](docs/design-tokens.md), [component catalog](docs/component-catalog.md), [component authoring](docs/component-authoring.md), [component API design](docs/component-api-design.md), [composition](docs/composition.md), [visual hierarchy](docs/visual-hierarchy.md), [spacing](docs/spacing.md), [motion](docs/motion.md), [states](docs/states.md), [overlays](docs/overlay-primitives.md), [forms](docs/forms.md), [modals](docs/modals.md), [responsive](docs/responsive.md), [density](docs/density.md), [copy](docs/copy-conventions.md), [time formatting](docs/time-formatting.md), [
|
|
432
|
+
Design-system knowledge lives in [`docs/`](docs/): [design tokens](docs/design-tokens.md), [component catalog](docs/component-catalog.md), [component authoring](docs/component-authoring.md), [component API design](docs/component-api-design.md), [composition](docs/composition.md), [visual hierarchy](docs/visual-hierarchy.md), [spacing](docs/spacing.md), [motion](docs/motion.md), [states](docs/states.md), [overlays](docs/overlay-primitives.md), [forms](docs/forms.md), [modals](docs/modals.md), [responsive](docs/responsive.md), [density](docs/density.md), [copy](docs/copy-conventions.md), [time formatting](docs/time-formatting.md), [design philosophy](docs/design-philosophy.md).
|
|
@@ -1,13 +1,68 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Geometry and behaviour only.
|
|
5
|
+
*
|
|
6
|
+
* Every colour reads a `--badge-*` component token whose value is decided by
|
|
7
|
+
* src/theme/recipes/badge.css. That file is the mapping from
|
|
8
|
+
* `(variant, intent)` to a semantic token — the layer that used to be
|
|
9
|
+
* `compoundVariants` here, where it was compiled into class-name literals and
|
|
10
|
+
* unreachable from outside. Nothing in this file names a colour, which is the
|
|
11
|
+
* point: the semantics are now configurable without a release.
|
|
12
|
+
*/
|
|
13
|
+
declare const badgeVariants: (props?: ({} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Widened deliberately. Adding a variant or an intent is a CSS change in the
|
|
16
|
+
* consuming app, not a release here — so the type has to admit values this
|
|
17
|
+
* file has never heard of, while still autocompleting the ones it ships.
|
|
18
|
+
*/
|
|
19
|
+
type Loose<T extends string> = T | (string & {});
|
|
20
|
+
export type BadgeVariantName = "solid" | "soft" | "outline";
|
|
21
|
+
/**
|
|
22
|
+
* `primary` was this component's name for the brand colour, and nothing else in
|
|
23
|
+
* the system used it — the token is `--bg-brand`, and
|
|
24
|
+
* docs/modals.md already told callers to write `intent="brand"`. It is off the
|
|
25
|
+
* closed union as of this release but still resolves, via an aliased selector in
|
|
26
|
+
* badge.css; `BadgeIntent` is widened, so it also still type-checks.
|
|
27
|
+
*/
|
|
28
|
+
export type BadgeIntentName = "neutral" | "brand" | "danger" | "success" | "warning" | "muted";
|
|
29
|
+
export type BadgeVariant = Loose<BadgeVariantName>;
|
|
30
|
+
export type BadgeIntent = Loose<BadgeIntentName>;
|
|
31
|
+
export type BadgeRecipeProps = VariantProps<typeof badgeVariants> & {
|
|
32
|
+
variant?: BadgeVariant | undefined;
|
|
33
|
+
intent?: BadgeIntent | undefined;
|
|
34
|
+
className?: string | undefined;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The class string plus the two attributes the recipe selects on.
|
|
38
|
+
*/
|
|
39
|
+
export declare function badgeRecipe({ variant, intent, className }: BadgeRecipeProps): {
|
|
40
|
+
className: string;
|
|
41
|
+
"data-variant": BadgeVariant;
|
|
42
|
+
"data-intent": BadgeIntent;
|
|
43
|
+
};
|
|
44
|
+
export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
45
|
+
variant?: BadgeVariant | undefined;
|
|
46
|
+
intent?: BadgeIntent | undefined;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Small label for status, category, or count.
|
|
50
|
+
*
|
|
51
|
+
* Two independent axes, same split as Button: `variant` is the fill
|
|
52
|
+
* (`solid`, `soft`, `outline`), `intent` is what it signals (`neutral`,
|
|
53
|
+
* `brand`, `danger`, `success`, `warning`, `muted`) — `muted` has no
|
|
54
|
+
* Button equivalent, for de-emphasized metadata rather than a status.
|
|
55
|
+
* Renders a `<span>`; purely presentational, so give it visible text — it
|
|
56
|
+
* does not manage an accessible name of its own.
|
|
57
|
+
*
|
|
58
|
+
* Colour is not decided here: each `(variant, intent)` pairing resolves
|
|
59
|
+
* through a `--badge-*` component token (src/theme/recipes/badge.css), the
|
|
60
|
+
* same seam Button uses, so a consumer can re-point a cell without a
|
|
61
|
+
* release.
|
|
62
|
+
*/
|
|
63
|
+
export declare const Badge: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & {
|
|
64
|
+
variant?: BadgeVariant | undefined;
|
|
65
|
+
intent?: BadgeIntent | undefined;
|
|
66
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
12
67
|
export { badgeVariants };
|
|
13
68
|
//# sourceMappingURL=Badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;;;GASG;AACH,QAAA,MAAM,aAAa,2FAOlB,CAAC;AAcF;;;;GAIG;AACH,KAAK,KAAK,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAC5D;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAC/F,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACnD,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAClE,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACnC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAiB,EAAE,MAAgB,EAAE,SAAS,EAAE,EAAE,gBAAgB;;;;EAM/F;AAED,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,GAAG;IAC/D,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACnC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,KAAK;cAnBN,YAAY,GAAG,SAAS;aACzB,WAAW,GAAG,SAAS;yCAoBhC,CAAC;AAGH,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -2,52 +2,60 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from "@sixthshift/design-system/utils";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Geometry and behaviour only.
|
|
7
|
+
*
|
|
8
|
+
* Every colour reads a `--badge-*` component token whose value is decided by
|
|
9
|
+
* src/theme/recipes/badge.css. That file is the mapping from
|
|
10
|
+
* `(variant, intent)` to a semantic token — the layer that used to be
|
|
11
|
+
* `compoundVariants` here, where it was compiled into class-name literals and
|
|
12
|
+
* unreachable from outside. Nothing in this file names a colour, which is the
|
|
13
|
+
* point: the semantics are now configurable without a release.
|
|
14
|
+
*/
|
|
15
|
+
const badgeVariants = cva(
|
|
16
|
+
// One literal, deliberately: `useSortedClasses --unsafe` strips the trailing
|
|
17
|
+
// space before a `+`, silently welding the last class of one fragment to the
|
|
18
|
+
// first of the next. The screenshots catch it, but a single string means the
|
|
19
|
+
// sorter has nothing to break.
|
|
20
|
+
"badge border-(color:--badge-border) focus:ring-(color:--badge-ring) inline-flex items-center rounded-md border bg-(--badge-bg) px-2.5 py-0.5 font-semibold text-(--badge-fg) text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-offset-2", { variants: {} });
|
|
21
|
+
/**
|
|
22
|
+
* The non-colour half of `variant` — elevation only, for Badge. A plain
|
|
23
|
+
* lookup rather than a CVA variant so an unrecognised variant stays a legal
|
|
24
|
+
* value that contributes no structure, leaving a consumer's CSS free to
|
|
25
|
+
* define it. `intent` needs no equivalent: it was never anything but colour.
|
|
26
|
+
*/
|
|
27
|
+
const variantStructure = {
|
|
28
|
+
solid: "shadow",
|
|
29
|
+
soft: "",
|
|
30
|
+
outline: "",
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The class string plus the two attributes the recipe selects on.
|
|
34
|
+
*/
|
|
35
|
+
export function badgeRecipe({ variant = "solid", intent = "brand", className }) {
|
|
36
|
+
return {
|
|
37
|
+
className: cn(variantStructure[variant], badgeVariants({ className })),
|
|
38
|
+
"data-variant": variant,
|
|
39
|
+
"data-intent": intent,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Small label for status, category, or count.
|
|
44
|
+
*
|
|
45
|
+
* Two independent axes, same split as Button: `variant` is the fill
|
|
46
|
+
* (`solid`, `soft`, `outline`), `intent` is what it signals (`neutral`,
|
|
47
|
+
* `brand`, `danger`, `success`, `warning`, `muted`) — `muted` has no
|
|
48
|
+
* Button equivalent, for de-emphasized metadata rather than a status.
|
|
49
|
+
* Renders a `<span>`; purely presentational, so give it visible text — it
|
|
50
|
+
* does not manage an accessible name of its own.
|
|
51
|
+
*
|
|
52
|
+
* Colour is not decided here: each `(variant, intent)` pairing resolves
|
|
53
|
+
* through a `--badge-*` component token (src/theme/recipes/badge.css), the
|
|
54
|
+
* same seam Button uses, so a consumer can re-point a cell without a
|
|
55
|
+
* release.
|
|
56
|
+
*/
|
|
57
|
+
export const Badge = React.forwardRef(({ className, variant = "solid", intent = "brand", ...props }, ref) => {
|
|
58
|
+
return _jsx("span", { ref: ref, ...badgeRecipe({ variant, intent, className }), ...props });
|
|
51
59
|
});
|
|
52
60
|
Badge.displayName = "Badge";
|
|
53
61
|
export { badgeVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,aAAa,GAAG,GAAG
|
|
1
|
+
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;;;GASG;AACH,MAAM,aAAa,GAAG,GAAG;AACvB,6EAA6E;AAC7E,6EAA6E;AAC7E,6EAA6E;AAC7E,+BAA+B;AAC/B,8PAA8P,EAC9P,EAAE,QAAQ,EAAE,EAAE,EAAE,CACjB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,gBAAgB,GAA2B;IAC/C,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,EAAE;CACZ,CAAC;AA2BF;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,SAAS,EAAoB;IAC9F,OAAO;QACL,SAAS,EAAE,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QACtE,cAAc,EAAE,OAAO;QACvB,aAAa,EAAE,MAAM;KACtB,CAAC;AACJ,CAAC;AAOD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAA8B,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACvI,OAAO,eAAM,GAAG,EAAE,GAAG,KAAM,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,KAAM,KAAK,GAAI,CAAC;AACxF,CAAC,CAAC,CAAC;AACH,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Badge, type BadgeProps, badgeVariants } from "./Badge.js";
|
|
1
|
+
export { Badge, type BadgeIntent, type BadgeIntentName, type BadgeProps, type BadgeVariant, type BadgeVariantName, badgeRecipe, badgeVariants, } from "./Badge.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Badge, badgeVariants } from "./Badge.js";
|
|
1
|
+
export { Badge, badgeRecipe, badgeVariants, } from "./Badge.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAML,WAAW,EACX,aAAa,GACd,MAAM,SAAS,CAAC"}
|
|
@@ -11,6 +11,18 @@ export type BarChartProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
11
11
|
formatValue?: (value: number) => string;
|
|
12
12
|
barHeight?: number;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Horizontal bar chart, rendered as plain `<div>` bars rather than SVG — each
|
|
16
|
+
* row is a label, a track, and a colored fill sized to the item's percentage
|
|
17
|
+
* of `maxValue` (auto-detected from the data when omitted).
|
|
18
|
+
*
|
|
19
|
+
* Colour is per-item: pass a CSS color string via `color` on a
|
|
20
|
+
* `BarChartItem` (typically a `var(--fg-*)` token), or omit it to cycle
|
|
21
|
+
* through the built-in `DEFAULT_COLORS` list by index. There is no
|
|
22
|
+
* chart-level accessible name — the only text exposed to assistive tech is
|
|
23
|
+
* the visible label and, when `showValues` is true (the default), the
|
|
24
|
+
* formatted value next to each bar.
|
|
25
|
+
*/
|
|
14
26
|
export declare const BarChart: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
15
27
|
data: BarChartItem[];
|
|
16
28
|
showValues?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../src/components/BarChart/BarChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACjE,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF,eAAO,MAAM,QAAQ;
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../src/components/BarChart/BarChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACjE,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ;UArBb,YAAY,EAAE;iBACP,OAAO;eACT,MAAM;kBACH,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM;gBAC3B,MAAM;wCA0CnB,CAAC"}
|
|
@@ -2,6 +2,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from "@sixthshift/design-system/utils";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
const DEFAULT_COLORS = ["var(--fg-brand)", "var(--fg-success)", "var(--fg-warning)", "var(--fg-danger)", "var(--fg-subtle)"];
|
|
5
|
+
/**
|
|
6
|
+
* Horizontal bar chart, rendered as plain `<div>` bars rather than SVG — each
|
|
7
|
+
* row is a label, a track, and a colored fill sized to the item's percentage
|
|
8
|
+
* of `maxValue` (auto-detected from the data when omitted).
|
|
9
|
+
*
|
|
10
|
+
* Colour is per-item: pass a CSS color string via `color` on a
|
|
11
|
+
* `BarChartItem` (typically a `var(--fg-*)` token), or omit it to cycle
|
|
12
|
+
* through the built-in `DEFAULT_COLORS` list by index. There is no
|
|
13
|
+
* chart-level accessible name — the only text exposed to assistive tech is
|
|
14
|
+
* the visible label and, when `showValues` is true (the default), the
|
|
15
|
+
* formatted value next to each bar.
|
|
16
|
+
*/
|
|
5
17
|
export const BarChart = React.forwardRef(({ data, showValues = true, maxValue: maxValueProp, formatValue = (v) => String(v), barHeight = 24, className, ...rest }, ref) => {
|
|
6
18
|
const maxValue = maxValueProp ?? Math.max(...data.map((d) => d.value), 1);
|
|
7
19
|
return (_jsx("div", { ref: ref, ...rest, className: cn("flex flex-col gap-2", className), children: data.map((item, i) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.js","sourceRoot":"","sources":["../../../src/components/BarChart/BarChart.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,MAAM,cAAc,GAAG,CAAC,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;AAE7H,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CACtC,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IAC/H,MAAM,QAAQ,GAAG,YAAY,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IAE1E,OAAO,CACL,cAAK,GAAG,EAAE,GAAG,KAAM,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,YACrE,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;YACpB,oEAAoE;YACpE,8CAA8C;YAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC1E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,cAAc,CAAC,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;YAEtE,OAAO,CACL,eAAsB,SAAS,EAAC,yBAAyB,aACvD,eAAM,SAAS,EAAC,0DAA0D,YAAE,IAAI,CAAC,KAAK,GAAQ,EAC9F,cAAK,SAAS,EAAC,gDAAgD,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YAC1F,cAAK,SAAS,EAAC,+CAA+C,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,GAAI,GACtH,EACL,UAAU,IAAI,eAAM,SAAS,EAAC,6DAA6D,YAAE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAQ,KALrH,IAAI,CAAC,KAAK,CAMd,CACP,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"BarChart.js","sourceRoot":"","sources":["../../../src/components/BarChart/BarChart.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,MAAM,cAAc,GAAG,CAAC,iBAAiB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;AAE7H;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CACtC,CAAC,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IAC/H,MAAM,QAAQ,GAAG,YAAY,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IAE1E,OAAO,CACL,cAAK,GAAG,EAAE,GAAG,KAAM,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,YACrE,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;YACpB,oEAAoE;YACpE,8CAA8C;YAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC1E,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,IAAI,cAAc,CAAC,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;YAEtE,OAAO,CACL,eAAsB,SAAS,EAAC,yBAAyB,aACvD,eAAM,SAAS,EAAC,0DAA0D,YAAE,IAAI,CAAC,KAAK,GAAQ,EAC9F,cAAK,SAAS,EAAC,gDAAgD,EAAC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YAC1F,cAAK,SAAS,EAAC,+CAA+C,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,GAAI,GACtH,EACL,UAAU,IAAI,eAAM,SAAS,EAAC,6DAA6D,YAAE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAQ,KALrH,IAAI,CAAC,KAAK,CAMd,CACP,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -1,19 +1,98 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Geometry and behaviour only.
|
|
5
|
+
*
|
|
6
|
+
* Every colour reads a `--button-*` component token whose value is decided by
|
|
7
|
+
* src/theme/recipes/button.css. That file is the mapping from
|
|
8
|
+
* `(variant, intent, state)` to a semantic token — the layer that used to be
|
|
9
|
+
* `compoundVariants` here, where it was compiled into class-name literals and
|
|
10
|
+
* unreachable from outside. Nothing in this file names a colour, which is the
|
|
11
|
+
* point: the semantics are now configurable without a release.
|
|
12
|
+
*/
|
|
3
13
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
|
|
5
|
-
intent?: "neutral" | "danger" | "success" | "warning" | null | undefined;
|
|
6
|
-
size?: "default" | "xs" | "sm" | "lg" | "xl" | "icon" | null | undefined;
|
|
14
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
7
15
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
|
+
/**
|
|
17
|
+
* Widened deliberately. Adding a variant or an intent is a CSS change in the
|
|
18
|
+
* consuming app, not a release here — so the type has to admit values this file
|
|
19
|
+
* has never heard of, while still autocompleting the ones it ships.
|
|
20
|
+
*
|
|
21
|
+
* The closed unions are exported alongside, because widening a type gives up the
|
|
22
|
+
* ability to narrow it downstream: once `string` is in the union,
|
|
23
|
+
* `Exclude<ButtonVariant, "link">` can no longer remove `link`. ToggleGroup
|
|
24
|
+
* relies on exactly that exclusion, so it builds on the closed names.
|
|
25
|
+
*/
|
|
26
|
+
type Loose<T extends string> = T | (string & {});
|
|
27
|
+
export type ButtonVariantName = "solid" | "outline" | "ghost" | "link";
|
|
28
|
+
export type ButtonIntentName = "neutral" | "brand" | "danger" | "success" | "warning";
|
|
29
|
+
export type ButtonVariant = Loose<ButtonVariantName>;
|
|
30
|
+
export type ButtonIntent = Loose<ButtonIntentName>;
|
|
31
|
+
export type ButtonRecipeProps = VariantProps<typeof buttonVariants> & {
|
|
32
|
+
variant?: ButtonVariant | undefined;
|
|
33
|
+
intent?: ButtonIntent | undefined;
|
|
34
|
+
iconOnly?: boolean | undefined;
|
|
35
|
+
className?: string | undefined;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* The class string plus the two attributes the recipe selects on.
|
|
39
|
+
*
|
|
40
|
+
* Shared with Toggle and ToggleGroupItem, which are built on Button's look. The
|
|
41
|
+
* data attributes are half the contract now, so anything reusing that look has
|
|
42
|
+
* to emit them as well or it lands on the recipe's floor instead of a cell.
|
|
43
|
+
*/
|
|
44
|
+
export declare function buttonRecipe({ variant, intent, size, iconOnly, className }: ButtonRecipeProps): {
|
|
45
|
+
className: string;
|
|
46
|
+
"data-variant": ButtonVariant;
|
|
47
|
+
"data-intent": ButtonIntent;
|
|
48
|
+
};
|
|
8
49
|
export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants> & {
|
|
50
|
+
variant?: ButtonVariant | undefined;
|
|
51
|
+
intent?: ButtonIntent | undefined;
|
|
52
|
+
/** Square the button at its current size, for an icon with no label. */
|
|
53
|
+
iconOnly?: boolean;
|
|
9
54
|
asChild?: boolean;
|
|
10
55
|
loading?: boolean;
|
|
11
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* A single action the user can take.
|
|
59
|
+
*
|
|
60
|
+
* Appearance is three independent axes, so every combination is expressible:
|
|
61
|
+
* `variant` is the fill and shape (`solid`, `outline`, `ghost`, `link`),
|
|
62
|
+
* `intent` is what the action *means* (`brand` — the default — plus `neutral`,
|
|
63
|
+
* `danger`, `success`, `warning`), and `size` is the height scale. Reach for
|
|
64
|
+
* `intent="danger"` on a destructive action rather than a red `variant` — that
|
|
65
|
+
* is the distinction that keeps "outline danger" possible.
|
|
66
|
+
*
|
|
67
|
+
* `neutral` means *no colour family*: a grey button, the same thing the word
|
|
68
|
+
* means on Badge and Message. A brand-coloured button is
|
|
69
|
+
* `intent="brand"` — an affirmative choice, which is why `neutral` is the
|
|
70
|
+
* default: omitting the prop means "no particular meaning", so it should not
|
|
71
|
+
* quietly hand back the brand colour. Button used to spell brand as `neutral`
|
|
72
|
+
* for `solid` and `link` while `outline` and `ghost` were already grey, so a
|
|
73
|
+
* primary action now needs `intent="brand"` said out loud.
|
|
74
|
+
*
|
|
75
|
+
* Colour is not decided here. Each pairing resolves through a `--button-*`
|
|
76
|
+
* component token, so a consumer can re-point any cell — or add an intent this
|
|
77
|
+
* library never shipped — from their own stylesheet. See the Component tokens
|
|
78
|
+
* story below.
|
|
79
|
+
*
|
|
80
|
+
* `iconOnly` squares the box at whatever `size` is set and drops the
|
|
81
|
+
* horizontal padding, for a button whose whole content is an icon — give it an
|
|
82
|
+
* `aria-label`, since there is no text to name it. It is a separate prop rather
|
|
83
|
+
* than a size, so `size="sm" iconOnly` is expressible.
|
|
84
|
+
*
|
|
85
|
+
* `asChild` renders the child element with Button's styling instead of a
|
|
86
|
+
* `<button>`, for links that should look like buttons. `loading` shows a spinner
|
|
87
|
+
* and disables the control, so it does not need `disabled` as well.
|
|
88
|
+
*/
|
|
12
89
|
declare const Button: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
|
|
13
|
-
|
|
14
|
-
intent?: "neutral" | "danger" | "success" | "warning" | null | undefined;
|
|
15
|
-
size?: "default" | "xs" | "sm" | "lg" | "xl" | "icon" | null | undefined;
|
|
90
|
+
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
16
91
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
92
|
+
variant?: ButtonVariant | undefined;
|
|
93
|
+
intent?: ButtonIntent | undefined;
|
|
94
|
+
/** Square the button at its current size, for an icon with no label. */
|
|
95
|
+
iconOnly?: boolean;
|
|
17
96
|
asChild?: boolean;
|
|
18
97
|
loading?: boolean;
|
|
19
98
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,QAAA,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B;;;;;;;;;GASG;AACH,QAAA,MAAM,cAAc;;8EAoBnB,CAAC;AAiCF;;;;;;;;;GASG;AACH,KAAK,KAAK,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AACvE,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AACtF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAEnD,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACpC,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAAE,OAAiB,EAAE,MAAkB,EAAE,IAAI,EAAE,QAAgB,EAAE,SAAS,EAAE,EAAE,iBAAiB;;;;EAU3H;AAED,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GACrE,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACpC,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAClC,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,QAAA,MAAM,MAAM;;;cAxCE,aAAa,GAAG,SAAS;aAC1B,YAAY,GAAG,SAAS;IACjC,wEAAwE;eAC7D,OAAO;cACR,OAAO;cACP,OAAO;2CA0DpB,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|