@sixthshift/design-system 0.3.0 → 0.5.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 +116 -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 +61 -2
- package/dist/components/Card/Card.d.ts.map +1 -1
- package/dist/components/Card/Card.js +99 -3
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Card/index.d.ts.map +1 -1
- package/dist/components/Card/index.js +1 -1
- package/dist/components/Card/index.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/lib/contexts/OverlayContext/OverlayContext.d.ts +2 -2
- package/dist/lib/contexts/OverlayContext/OverlayContext.d.ts.map +1 -1
- package/dist/lib/contexts/OverlayContext/OverlayContext.js +17 -6
- package/dist/lib/contexts/OverlayContext/OverlayContext.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 +7 -48
- 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 +114 -15
- package/src/components/Card/index.ts +1 -1
- 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/lib/contexts/OverlayContext/OverlayContext.tsx +21 -10
- 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 +31 -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
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
export type TagChipProps = {
|
|
3
|
+
tag: string;
|
|
4
|
+
/** When set, renders an × affordance. Omit for read-only / navigable chips. */
|
|
5
|
+
onRemove?: () => void;
|
|
6
|
+
/** `sm` (default) for rows; `md` for detail pages. */
|
|
7
|
+
size?: "sm" | "md";
|
|
8
|
+
className?: string;
|
|
9
|
+
};
|
|
2
10
|
/**
|
|
3
11
|
* One tag, rendered prettily. A `namespace:value` tag (`project:website`)
|
|
4
12
|
* shows the namespace muted; a plain tag (`urgent`) renders as-is.
|
|
5
13
|
*
|
|
6
14
|
* Pure presentation. Entity-reference tags (`person:per_…`) are NOT rendered
|
|
7
|
-
* here — the
|
|
8
|
-
*
|
|
15
|
+
* here — the consuming app is expected to intercept those and resolve them to
|
|
16
|
+
* a name chip; TagChip never shows a raw id.
|
|
9
17
|
*
|
|
10
|
-
* Two disjoint modes
|
|
11
|
-
*
|
|
18
|
+
* Two disjoint modes, chosen by whether `onRemove` is passed: navigable (no
|
|
19
|
+
* `onRemove`; the caller wraps it in a link) or removable (`onRemove` renders
|
|
20
|
+
* an × — used by `TagInput` and edit surfaces). Built on `Badge`
|
|
21
|
+
* (`variant="outline" intent="muted"`).
|
|
12
22
|
*/
|
|
13
|
-
export type TagChipProps = {
|
|
14
|
-
tag: string;
|
|
15
|
-
/** When set, renders an × affordance. Omit for read-only / navigable chips. */
|
|
16
|
-
onRemove?: () => void;
|
|
17
|
-
/** `sm` (default) for rows; `default` for detail pages. */
|
|
18
|
-
size?: "sm" | "default";
|
|
19
|
-
className?: string;
|
|
20
|
-
};
|
|
21
23
|
export declare const TagChip: React.ForwardRefExoticComponent<TagChipProps & React.RefAttributes<HTMLSpanElement>>;
|
|
22
24
|
//# sourceMappingURL=TagChip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagChip.d.ts","sourceRoot":"","sources":["../../../src/components/TagChip/TagChip.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B
|
|
1
|
+
{"version":3,"file":"TagChip.d.ts","sourceRoot":"","sources":["../../../src/components/TagChip/TagChip.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,sDAAsD;IACtD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,sFA0BlB,CAAC"}
|
|
@@ -3,11 +3,24 @@ import { Badge } from "@sixthshift/design-system/badge";
|
|
|
3
3
|
import { cn } from "@sixthshift/design-system/utils";
|
|
4
4
|
import { X } from "lucide-react";
|
|
5
5
|
import * as React from "react";
|
|
6
|
+
/**
|
|
7
|
+
* One tag, rendered prettily. A `namespace:value` tag (`project:website`)
|
|
8
|
+
* shows the namespace muted; a plain tag (`urgent`) renders as-is.
|
|
9
|
+
*
|
|
10
|
+
* Pure presentation. Entity-reference tags (`person:per_…`) are NOT rendered
|
|
11
|
+
* here — the consuming app is expected to intercept those and resolve them to
|
|
12
|
+
* a name chip; TagChip never shows a raw id.
|
|
13
|
+
*
|
|
14
|
+
* Two disjoint modes, chosen by whether `onRemove` is passed: navigable (no
|
|
15
|
+
* `onRemove`; the caller wraps it in a link) or removable (`onRemove` renders
|
|
16
|
+
* an × — used by `TagInput` and edit surfaces). Built on `Badge`
|
|
17
|
+
* (`variant="outline" intent="muted"`).
|
|
18
|
+
*/
|
|
6
19
|
export const TagChip = React.forwardRef(({ tag, onRemove, size = "sm", className }, ref) => {
|
|
7
20
|
const sep = tag.indexOf(":");
|
|
8
21
|
const namespace = sep > 0 ? tag.slice(0, sep) : null;
|
|
9
22
|
const value = sep > 0 ? tag.slice(sep + 1) : tag;
|
|
10
|
-
return (_jsxs(Badge, { ref: ref, variant: "outline", intent: "muted", className: cn("gap-1 font-normal", size === "sm" ? "px-1.5 py-0 text-[10px]" : "px-2 py-0.5 text-xs", className), children: [namespace && _jsxs("span", { className: "text-fg
|
|
23
|
+
return (_jsxs(Badge, { ref: ref, variant: "outline", intent: "muted", className: cn("tag-chip gap-1 font-normal", size === "sm" ? "px-1.5 py-0 text-[10px]" : "px-2 py-0.5 text-xs", className), children: [namespace && _jsxs("span", { className: "text-(--tag-chip-namespace-fg)", children: [namespace, ":"] }), _jsx("span", { children: value }), onRemove && (_jsx("button", { type: "button", onClick: onRemove, "aria-label": `Remove ${tag}`, className: "focus-visible:ring-(color:--tag-chip-remove-ring) -mr-0.5 ml-0.5 rounded-sm text-(--tag-chip-remove-fg) hover:text-(--tag-chip-remove-fg-hovered) focus-visible:outline-none focus-visible:ring-2", children: _jsx(X, { className: "h-3 w-3" }) }))] }));
|
|
11
24
|
});
|
|
12
25
|
TagChip.displayName = "TagChip";
|
|
13
26
|
//# sourceMappingURL=TagChip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagChip.js","sourceRoot":"","sources":["../../../src/components/TagChip/TagChip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TagChip.js","sourceRoot":"","sources":["../../../src/components/TagChip/TagChip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAgC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE;IACxH,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACrD,MAAM,KAAK,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAEjD,OAAO,CACL,MAAC,KAAK,IACJ,GAAG,EAAE,GAAG,EACR,OAAO,EAAC,SAAS,EACjB,MAAM,EAAC,OAAO,EACd,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,qBAAqB,EAAE,SAAS,CAAC,aAExH,SAAS,IAAI,gBAAM,SAAS,EAAC,gCAAgC,aAAE,SAAS,SAAS,EAClF,yBAAO,KAAK,GAAQ,EACnB,QAAQ,IAAI,CACX,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,QAAQ,gBACL,UAAU,GAAG,EAAE,EAC3B,SAAS,EAAC,mMAAmM,YAE7M,KAAC,CAAC,IAAC,SAAS,EAAC,SAAS,GAAG,GAClB,CACV,IACK,CACT,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC"}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Token input for tags: existing tags render as removable chips, typing plus
|
|
3
|
-
* Enter or comma commits a new one, Backspace on an empty field removes the
|
|
4
|
-
* last. Duplicates are ignored. Controlled — the parent owns `value`.
|
|
5
|
-
*
|
|
6
|
-
* The chrome matches `Input` (same border/focus tokens) so it sits naturally
|
|
7
|
-
* among other form fields.
|
|
8
|
-
*/
|
|
9
1
|
export type TagInputProps = {
|
|
10
2
|
value: string[];
|
|
11
3
|
onChange: (tags: string[]) => void;
|
|
@@ -13,5 +5,16 @@ export type TagInputProps = {
|
|
|
13
5
|
id?: string;
|
|
14
6
|
className?: string;
|
|
15
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Token input for tags: existing tags render as removable `TagChip`s, typing
|
|
10
|
+
* plus Enter or comma commits a new one, Backspace on an empty field removes
|
|
11
|
+
* the last. Duplicates are ignored. Controlled only — there is no
|
|
12
|
+
* `defaultValue`, the parent always owns `value`.
|
|
13
|
+
*
|
|
14
|
+
* The chrome matches `Input` (same border/focus tokens) so it sits naturally
|
|
15
|
+
* among other form fields; the field has no visible label of its own, so
|
|
16
|
+
* give it an accessible name via a `<label htmlFor={id}>` (pass `id`) or
|
|
17
|
+
* `aria-label`.
|
|
18
|
+
*/
|
|
16
19
|
export declare const TagInput: import("react").ForwardRefExoticComponent<TagInputProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
20
|
//# sourceMappingURL=TagInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagInput.d.ts","sourceRoot":"","sources":["../../../src/components/TagInput/TagInput.tsx"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"TagInput.d.ts","sourceRoot":"","sources":["../../../src/components/TagInput/TagInput.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,0GAwCnB,CAAC"}
|
|
@@ -2,6 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { TagChip } from "@sixthshift/design-system/tag-chip";
|
|
3
3
|
import { cn } from "@sixthshift/design-system/utils";
|
|
4
4
|
import { forwardRef, useState } from "react";
|
|
5
|
+
/**
|
|
6
|
+
* Token input for tags: existing tags render as removable `TagChip`s, typing
|
|
7
|
+
* plus Enter or comma commits a new one, Backspace on an empty field removes
|
|
8
|
+
* the last. Duplicates are ignored. Controlled only — there is no
|
|
9
|
+
* `defaultValue`, the parent always owns `value`.
|
|
10
|
+
*
|
|
11
|
+
* The chrome matches `Input` (same border/focus tokens) so it sits naturally
|
|
12
|
+
* among other form fields; the field has no visible label of its own, so
|
|
13
|
+
* give it an accessible name via a `<label htmlFor={id}>` (pass `id`) or
|
|
14
|
+
* `aria-label`.
|
|
15
|
+
*/
|
|
5
16
|
export const TagInput = forwardRef(({ value, onChange, placeholder = "Add a tag…", id, className }, ref) => {
|
|
6
17
|
const [draft, setDraft] = useState("");
|
|
7
18
|
const commit = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagInput.js","sourceRoot":"","sources":["../../../src/components/TagInput/TagInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,UAAU,EAAsB,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TagInput.js","sourceRoot":"","sources":["../../../src/components/TagInput/TagInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAC;AAC7D,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,UAAU,EAAsB,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUjE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAgC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,GAAG,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,EAAE;IACxI,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEvC,MAAM,MAAM,GAAG,GAAG,EAAE;QAClB,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QACzB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,QAAQ,CAAC,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;QAC3D,QAAQ,CAAC,EAAE,CAAC,CAAC;IACf,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,CAAC,CAAkC,EAAE,EAAE;QAC3D,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;YACvC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,MAAM,EAAE,CAAC;QACX,CAAC;aAAM,IAAI,CAAC,CAAC,GAAG,KAAK,WAAW,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,eACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACX,kMAAkM,EAClM,SAAS,CACV,aAEA,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAClB,KAAC,OAAO,IAAW,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,IAAvE,GAAG,CAAwE,CAC1F,CAAC,EACF,gBACE,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACzC,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAChD,SAAS,EAAC,2EAA2E,GACrF,IACE,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -3,6 +3,15 @@ export type TextElement = "span" | "p" | "div" | "label" | "code" | "h1" | "h2"
|
|
|
3
3
|
export type TextProps = React.HTMLAttributes<HTMLElement> & {
|
|
4
4
|
as?: TextElement;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* The polymorphic base every typography preset (`Heading`, `Body`,
|
|
8
|
+
* `Emphasis`, ...) is built on: renders as `as` (default `span`) and applies
|
|
9
|
+
* no styling of its own beyond `className`.
|
|
10
|
+
*
|
|
11
|
+
* Reach for a preset first — the typographic ramp (docs/visual-hierarchy.md)
|
|
12
|
+
* is what keeps text sizing and color consistent across the app. Use `Text`
|
|
13
|
+
* directly only for one-off text that doesn't fit an existing preset.
|
|
14
|
+
*/
|
|
6
15
|
declare const Text: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
7
16
|
as?: TextElement;
|
|
8
17
|
} & React.RefAttributes<HTMLElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,GAAG,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5G,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG;IAC1D,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,QAAA,MAAM,IAAI;
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,GAAG,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE5G,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG;IAC1D,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF;;;;;;;;GAQG;AACH,QAAA,MAAM,IAAI;SAZH,WAAW;qCAmBhB,CAAC;AAGH,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "@sixthshift/design-system/utils";
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* The polymorphic base every typography preset (`Heading`, `Body`,
|
|
6
|
+
* `Emphasis`, ...) is built on: renders as `as` (default `span`) and applies
|
|
7
|
+
* no styling of its own beyond `className`.
|
|
8
|
+
*
|
|
9
|
+
* Reach for a preset first — the typographic ramp (docs/visual-hierarchy.md)
|
|
10
|
+
* is what keeps text sizing and color consistent across the app. Use `Text`
|
|
11
|
+
* directly only for one-off text that doesn't fit an existing preset.
|
|
12
|
+
*/
|
|
4
13
|
const Text = React.forwardRef(({ as: Comp = "span", className, ...props }, ref) => (_jsx(Comp
|
|
5
14
|
// biome-ignore lint/suspicious/noExplicitAny: polymorphic ref requires any
|
|
6
15
|
, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuB/B,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAyB,CAAC,EAAE,EAAE,EAAE,IAAI,GAAG,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACzG,KAAC,IAAI;AACH,2EAA2E;;IAA3E,2EAA2E;IAC3E,GAAG,EAAE,GAAU,EACf,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KACpB,KAAK,GACT,CACH,CAAC,CAAC;AACH,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuB/B;;;;;;;;GAQG;AACH,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAyB,CAAC,EAAE,EAAE,EAAE,IAAI,GAAG,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CACzG,KAAC,IAAI;AACH,2EAA2E;;IAA3E,2EAA2E;IAC3E,GAAG,EAAE,GAAU,EACf,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KACpB,KAAK,GACT,CACH,CAAC,CAAC;AACH,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const textInlineVariants: (props?: ({
|
|
4
|
-
gap?: "none" | "xs" | "sm" | "
|
|
5
|
-
align?: "center" | "
|
|
4
|
+
gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
5
|
+
align?: "center" | "start" | "end" | "baseline" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type TextInlineProps = React.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof textInlineVariants>;
|
|
8
|
+
/**
|
|
9
|
+
* Lays out several inline fragments — typically `Text` nodes, but any inline
|
|
10
|
+
* content works — in a single flex row with a consistent gap and cross-axis
|
|
11
|
+
* alignment, so a label/value pair or a value/badge pair doesn't need one-off
|
|
12
|
+
* spacing classes at every call site.
|
|
13
|
+
*
|
|
14
|
+
* Renders a single `<span>`. `gap` (default `sm`) and `align` (default
|
|
15
|
+
* `baseline`) are the only two axes; there's no `as` polymorphism, and this
|
|
16
|
+
* is not a variant of `Text` — `TextInline` is about spacing *between*
|
|
17
|
+
* inline children, not about styling the text itself.
|
|
18
|
+
*/
|
|
8
19
|
declare const TextInline: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & VariantProps<(props?: ({
|
|
9
|
-
gap?: "none" | "xs" | "sm" | "
|
|
10
|
-
align?: "center" | "
|
|
20
|
+
gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
21
|
+
align?: "center" | "start" | "end" | "baseline" | null | undefined;
|
|
11
22
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLSpanElement>>;
|
|
12
23
|
export { TextInline, textInlineVariants };
|
|
13
24
|
//# sourceMappingURL=TextInline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInline.d.ts","sourceRoot":"","sources":["../../../src/components/TextInline/TextInline.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,QAAA,MAAM,kBAAkB;;;8EAqBtB,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9G,QAAA,MAAM,UAAU;;;uHAEd,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"TextInline.d.ts","sourceRoot":"","sources":["../../../src/components/TextInline/TextInline.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,QAAA,MAAM,kBAAkB;;;8EAqBtB,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9G;;;;;;;;;;GAUG;AACH,QAAA,MAAM,UAAU;;;uHAEd,CAAC;AAGH,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -24,6 +24,17 @@ const textInlineVariants = cva("inline-flex items-center", {
|
|
|
24
24
|
align: "baseline",
|
|
25
25
|
},
|
|
26
26
|
});
|
|
27
|
+
/**
|
|
28
|
+
* Lays out several inline fragments — typically `Text` nodes, but any inline
|
|
29
|
+
* content works — in a single flex row with a consistent gap and cross-axis
|
|
30
|
+
* alignment, so a label/value pair or a value/badge pair doesn't need one-off
|
|
31
|
+
* spacing classes at every call site.
|
|
32
|
+
*
|
|
33
|
+
* Renders a single `<span>`. `gap` (default `sm`) and `align` (default
|
|
34
|
+
* `baseline`) are the only two axes; there's no `as` polymorphism, and this
|
|
35
|
+
* is not a variant of `Text` — `TextInline` is about spacing *between*
|
|
36
|
+
* inline children, not about styling the text itself.
|
|
37
|
+
*/
|
|
27
38
|
const TextInline = React.forwardRef(({ className, gap, align, ...props }, ref) => (_jsx("span", { ref: ref, className: cn(textInlineVariants({ gap, align }), className), ...props })));
|
|
28
39
|
TextInline.displayName = "TextInline";
|
|
29
40
|
export { TextInline, textInlineVariants };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInline.js","sourceRoot":"","sources":["../../../src/components/TextInline/TextInline.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,kBAAkB,GAAG,GAAG,CAAC,0BAA0B,EAAE;IACzD,QAAQ,EAAE;QACR,GAAG,EAAE;YACH,IAAI,EAAE,OAAO;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,OAAO;YACX,EAAE,EAAE,OAAO;YACX,EAAE,EAAE,OAAO;YACX,EAAE,EAAE,OAAO;SACZ;QACD,KAAK,EAAE;YACL,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,cAAc;YACtB,GAAG,EAAE,WAAW;YAChB,QAAQ,EAAE,gBAAgB;SAC3B;KACF;IACD,eAAe,EAAE;QACf,GAAG,EAAE,IAAI;QACT,KAAK,EAAE,UAAU;KAClB;CACF,CAAC,CAAC;AAIH,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAmC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClH,eAAM,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAC5F,CAAC,CAAC;AACH,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"TextInline.js","sourceRoot":"","sources":["../../../src/components/TextInline/TextInline.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,kBAAkB,GAAG,GAAG,CAAC,0BAA0B,EAAE;IACzD,QAAQ,EAAE;QACR,GAAG,EAAE;YACH,IAAI,EAAE,OAAO;YACb,EAAE,EAAE,SAAS;YACb,EAAE,EAAE,OAAO;YACX,EAAE,EAAE,OAAO;YACX,EAAE,EAAE,OAAO;YACX,EAAE,EAAE,OAAO;SACZ;QACD,KAAK,EAAE;YACL,KAAK,EAAE,aAAa;YACpB,MAAM,EAAE,cAAc;YACtB,GAAG,EAAE,WAAW;YAChB,QAAQ,EAAE,gBAAgB;SAC3B;KACF;IACD,eAAe,EAAE;QACf,GAAG,EAAE,IAAI;QACT,KAAK,EAAE,UAAU;KAClB;CACF,CAAC,CAAC;AAIH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAmC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAClH,eAAM,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,kBAAkB,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAC5F,CAAC,CAAC;AACH,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export type TextareaProps = React.TextareaHTMLAttributes<HTMLTextAreaElement>;
|
|
3
|
+
/**
|
|
4
|
+
* Multi-line text input for longer free-form text.
|
|
5
|
+
*
|
|
6
|
+
* A thin styled wrapper around `<textarea>` — no custom props beyond
|
|
7
|
+
* `React.TextareaHTMLAttributes`, no auto-resize, and no maximum-length UI of
|
|
8
|
+
* its own. Height comes from a `min-h-[60px]` default plus whatever `rows`
|
|
9
|
+
* or `className` the caller passes; growing with content is the caller's
|
|
10
|
+
* responsibility. Controlled or uncontrolled exactly like a native textarea.
|
|
11
|
+
*
|
|
12
|
+
* Meant to be wrapped by `FormField` for label, description and validation
|
|
13
|
+
* wiring.
|
|
14
|
+
*/
|
|
3
15
|
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
4
16
|
export { Textarea };
|
|
5
17
|
//# sourceMappingURL=Textarea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;AAE9E,QAAA,MAAM,QAAQ,2FAWZ,CAAC;AAGH,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;AAE9E;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,QAAQ,2FAWZ,CAAC;AAGH,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "@sixthshift/design-system/utils";
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
/**
|
|
5
|
+
* Multi-line text input for longer free-form text.
|
|
6
|
+
*
|
|
7
|
+
* A thin styled wrapper around `<textarea>` — no custom props beyond
|
|
8
|
+
* `React.TextareaHTMLAttributes`, no auto-resize, and no maximum-length UI of
|
|
9
|
+
* its own. Height comes from a `min-h-[60px]` default plus whatever `rows`
|
|
10
|
+
* or `className` the caller passes; growing with content is the caller's
|
|
11
|
+
* responsibility. Controlled or uncontrolled exactly like a native textarea.
|
|
12
|
+
*
|
|
13
|
+
* Meant to be wrapped by `FormField` for label, description and validation
|
|
14
|
+
* wiring.
|
|
15
|
+
*/
|
|
4
16
|
const Textarea = React.forwardRef(({ className, ...props }, ref) => {
|
|
5
|
-
return (_jsx("textarea", { className: cn("flex min-h-[60px] w-full rounded-md border
|
|
17
|
+
return (_jsx("textarea", { className: cn("textarea border-(color:--textarea-border) focus-visible:ring-(color:--textarea-ring) flex min-h-[60px] w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs placeholder:text-(--textarea-placeholder-fg) focus-visible:outline-hidden focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50", className), ref: ref, ...props }));
|
|
6
18
|
});
|
|
7
19
|
Textarea.displayName = "Textarea";
|
|
8
20
|
export { Textarea };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAqC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACrG,OAAO,CACL,mBACE,SAAS,EAAE,EAAE,CACX,
|
|
1
|
+
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../src/components/Textarea/Textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;;;GAWG;AACH,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAqC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACrG,OAAO,CACL,mBACE,SAAS,EAAE,EAAE,CACX,2TAA2T,EAC3T,SAAS,CACV,EACD,GAAG,EAAE,GAAG,KACJ,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -4,6 +4,15 @@ export type TimeColumnProps = {
|
|
|
4
4
|
onSelect: (value: number) => void;
|
|
5
5
|
formatValue?: (value: number) => string;
|
|
6
6
|
disabled?: (value: number) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Move DOM focus to the selected option on mount.
|
|
9
|
+
*
|
|
10
|
+
* Off by default: a column that grabs focus when it appears is wrong for a
|
|
11
|
+
* pointer user who clicked a trigger. `TimePicker` turns it on only when the
|
|
12
|
+
* popover was opened from the keyboard (`Alt+ArrowDown`), where the whole
|
|
13
|
+
* point of opening it was to pick an hour.
|
|
14
|
+
*/
|
|
15
|
+
autoFocusSelected?: boolean;
|
|
7
16
|
};
|
|
8
|
-
export declare const TimeColumn: ({ values, selected, onSelect, formatValue, disabled }: TimeColumnProps) => import("react").JSX.Element;
|
|
17
|
+
export declare const TimeColumn: ({ values, selected, onSelect, formatValue, disabled, autoFocusSelected, }: TimeColumnProps) => import("react").JSX.Element;
|
|
9
18
|
//# sourceMappingURL=TimeColumn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeColumn.d.ts","sourceRoot":"","sources":["../../../src/components/TimePicker/TimeColumn.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TimeColumn.d.ts","sourceRoot":"","sources":["../../../src/components/TimePicker/TimeColumn.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACtC;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,UAAU,8EAOpB,eAAe,gCAyDjB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { cn } from "@sixthshift/design-system/utils";
|
|
3
3
|
import { useEffect, useRef } from "react";
|
|
4
|
-
export const TimeColumn = ({ values, selected, onSelect, formatValue = (v) => String(v).padStart(2, "0"), disabled }) => {
|
|
4
|
+
export const TimeColumn = ({ values, selected, onSelect, formatValue = (v) => String(v).padStart(2, "0"), disabled, autoFocusSelected = false, }) => {
|
|
5
5
|
const containerRef = useRef(null);
|
|
6
6
|
const selectedRef = useRef(null);
|
|
7
7
|
// Scroll selected item into view on mount and when selection changes
|
|
@@ -15,6 +15,13 @@ export const TimeColumn = ({ values, selected, onSelect, formatValue = (v) => St
|
|
|
15
15
|
container.scrollTo({ top: scrollTop, behavior: "smooth" });
|
|
16
16
|
}
|
|
17
17
|
}, []);
|
|
18
|
+
// Seed focus once, when the caller asked for it. Keyed on the flag alone:
|
|
19
|
+
// `selected` changes as the user picks, and re-running then would drag focus
|
|
20
|
+
// back to the option they started from.
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (autoFocusSelected)
|
|
23
|
+
selectedRef.current?.focus();
|
|
24
|
+
}, [autoFocusSelected]);
|
|
18
25
|
return (_jsxs("div", { ref: containerRef, role: "listbox", className: "h-48 w-14 overflow-y-auto overscroll-contain rounded-lg border border-border-subtle bg-bg-subtle/50", children: [_jsx("div", { className: "h-19", "aria-hidden": "true" }), _jsx("div", { className: "flex flex-col gap-0.5", children: values.map((value) => {
|
|
19
26
|
const isSelected = value === selected;
|
|
20
27
|
const isDisabled = disabled?.(value) ?? false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeColumn.js","sourceRoot":"","sources":["../../../src/components/TimePicker/TimeColumn.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TimeColumn.js","sourceRoot":"","sources":["../../../src/components/TimePicker/TimeColumn.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAmB1C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,WAAW,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAC/C,QAAQ,EACR,iBAAiB,GAAG,KAAK,GACT,EAAE,EAAE;IACpB,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,WAAW,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAEpD,qEAAqE;IACrE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,WAAW,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YAChD,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC;YACvC,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC;YACjC,MAAM,aAAa,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAC;YACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC9C,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,GAAG,aAAa,CAAC,MAAM,GAAG,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;YACxG,SAAS,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7D,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,0EAA0E;IAC1E,6EAA6E;IAC7E,wCAAwC;IACxC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,iBAAiB;YAAE,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IACtD,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAExB,OAAO,CACL,eAAK,GAAG,EAAE,YAAY,EAAE,IAAI,EAAC,SAAS,EAAC,SAAS,EAAC,qGAAqG,aAEpJ,cAAK,SAAS,EAAC,MAAM,iBAAa,MAAM,GAAG,EAC3C,cAAK,SAAS,EAAC,uBAAuB,YACnC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;oBACpB,MAAM,UAAU,GAAG,KAAK,KAAK,QAAQ,CAAC;oBACtC,MAAM,UAAU,GAAG,QAAQ,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;oBAE9C,OAAO,CACL,iBAEE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EACzC,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,QAAQ,mBACE,UAAU,EACzB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU,IAAI,QAAQ,CAAC,KAAK,CAAC,EAC7C,QAAQ,EAAE,UAAU,EACpB,SAAS,EAAE,EAAE,CACX,0GAA0G,EAC1G,gGAAgG,EAChG,UAAU,IAAI,uDAAuD,EACrE,UAAU,IAAI,+BAA+B,CAC9C,YAEA,WAAW,CAAC,KAAK,CAAC,IAdd,KAAK,CAeH,CACV,CAAC;gBACJ,CAAC,CAAC,GACE,EAEN,cAAK,SAAS,EAAC,MAAM,iBAAa,MAAM,GAAG,IACvC,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import type { TimePickerProps } from "./timepicker.types.js";
|
|
3
3
|
export type { TimePickerProps };
|
|
4
|
+
/**
|
|
5
|
+
* A typeable time field and a popover of scrollable hour/minute(/second)
|
|
6
|
+
* columns, as one control. The value is an `ISOTime` string — `"09:30"` and
|
|
7
|
+
* `"09:30:00"` are both accepted as input, and `onChange` always emits the
|
|
8
|
+
* canonical `HH:MM:SS` form regardless of `format`. There is no timezone
|
|
9
|
+
* conversion: the value is a plain time, not an instant.
|
|
10
|
+
*
|
|
11
|
+
* The field is spinbutton segments rather than a text box, and is built to be
|
|
12
|
+
* typed straight through: `0230p` is half past two in the afternoon, `345` in a
|
|
13
|
+
* 24-hour field is 03:45 (there is no 30th hour, so the digit rolls into the
|
|
14
|
+
* minute). `a`/`p` set the meridiem, arrows step any segment, `Alt+ArrowDown`
|
|
15
|
+
* opens the columns and moves focus to the hour, and `Enter` is Apply. See
|
|
16
|
+
* `SegmentedField` for the full keyboard model. `minuteStep` sets the column's
|
|
17
|
+
* increment and deliberately does not constrain typing.
|
|
18
|
+
*
|
|
19
|
+
* Typing and picking move one value: the segments show the draft while the
|
|
20
|
+
* popover is open and the committed value while it is closed. A partial time is
|
|
21
|
+
* never reported — clearing a segment reports `undefined`.
|
|
22
|
+
*
|
|
23
|
+
* Supports both controlled (`value`/`onChange`) and uncontrolled
|
|
24
|
+
* (`defaultValue`) use. Opening the popover seeds the draft columns from the
|
|
25
|
+
* committed value (or the current time, if none); scrolling the columns only
|
|
26
|
+
* updates the draft, and the footer's Apply commits it and closes, Cancel
|
|
27
|
+
* discards it. A "Now" button resets the draft to the current time without
|
|
28
|
+
* closing the popover.
|
|
29
|
+
*
|
|
30
|
+
* `format` (`"HH:mm" | "HH:mm:ss"`) shows or hides the seconds column;
|
|
31
|
+
* `clockFormat` (`"12h" | "24h"`) shows or hides the AM/PM selector.
|
|
32
|
+
* `minTime`/`maxTime` bound the selectable time inclusively — Apply is a
|
|
33
|
+
* no-op while the draft falls outside them. `minuteStep` controls the minute
|
|
34
|
+
* column's increment. `presets` renders a sidebar of quick picks.
|
|
35
|
+
*/
|
|
4
36
|
export declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
37
|
//# sourceMappingURL=TimePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../src/components/TimePicker/TimePicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../../src/components/TimePicker/TimePicker.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqB/B,OAAO,KAAK,EAA0B,eAAe,EAAoB,MAAM,oBAAoB,CAAC;AAEpG,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,UAAU,wFA8WrB,CAAC"}
|
|
@@ -2,17 +2,51 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { autoUpdate, FloatingPortal, flip, offset, shift, useClick, useDismiss, useFloating, useInteractions } from "@floating-ui/react";
|
|
3
3
|
import { useControllableState } from "@sixthshift/design-system/hooks";
|
|
4
4
|
import { cn } from "@sixthshift/design-system/utils";
|
|
5
|
-
import { Clock
|
|
5
|
+
import { Clock } from "lucide-react";
|
|
6
6
|
import * as React from "react";
|
|
7
7
|
import { useCallback, useId, useMemo, useState } from "react";
|
|
8
8
|
import { fromISOTime, fromISOTimeOrUndefined, toISOTimeOrUndefined } from "../../date-time/index.js";
|
|
9
|
+
import { PickerField } from "../../internal/index.js";
|
|
9
10
|
import { Button } from "../Button/index.js";
|
|
10
11
|
import { Separator } from "../Separator/index.js";
|
|
11
12
|
import { PeriodSelector } from "./PeriodSelector.js";
|
|
12
13
|
import { TimeColumn } from "./TimeColumn.js";
|
|
13
|
-
import {
|
|
14
|
+
import { TimeSegments } from "./TimeSegments.js";
|
|
15
|
+
import { generateHours, generateMinutes, generateSeconds, getCurrentTime, isTimeDisabled, parsedToTemporal, temporalTimeToISO, temporalToParsed, to12Hour, to24Hour, } from "./timepicker.hooks.js";
|
|
16
|
+
/**
|
|
17
|
+
* A typeable time field and a popover of scrollable hour/minute(/second)
|
|
18
|
+
* columns, as one control. The value is an `ISOTime` string — `"09:30"` and
|
|
19
|
+
* `"09:30:00"` are both accepted as input, and `onChange` always emits the
|
|
20
|
+
* canonical `HH:MM:SS` form regardless of `format`. There is no timezone
|
|
21
|
+
* conversion: the value is a plain time, not an instant.
|
|
22
|
+
*
|
|
23
|
+
* The field is spinbutton segments rather than a text box, and is built to be
|
|
24
|
+
* typed straight through: `0230p` is half past two in the afternoon, `345` in a
|
|
25
|
+
* 24-hour field is 03:45 (there is no 30th hour, so the digit rolls into the
|
|
26
|
+
* minute). `a`/`p` set the meridiem, arrows step any segment, `Alt+ArrowDown`
|
|
27
|
+
* opens the columns and moves focus to the hour, and `Enter` is Apply. See
|
|
28
|
+
* `SegmentedField` for the full keyboard model. `minuteStep` sets the column's
|
|
29
|
+
* increment and deliberately does not constrain typing.
|
|
30
|
+
*
|
|
31
|
+
* Typing and picking move one value: the segments show the draft while the
|
|
32
|
+
* popover is open and the committed value while it is closed. A partial time is
|
|
33
|
+
* never reported — clearing a segment reports `undefined`.
|
|
34
|
+
*
|
|
35
|
+
* Supports both controlled (`value`/`onChange`) and uncontrolled
|
|
36
|
+
* (`defaultValue`) use. Opening the popover seeds the draft columns from the
|
|
37
|
+
* committed value (or the current time, if none); scrolling the columns only
|
|
38
|
+
* updates the draft, and the footer's Apply commits it and closes, Cancel
|
|
39
|
+
* discards it. A "Now" button resets the draft to the current time without
|
|
40
|
+
* closing the popover.
|
|
41
|
+
*
|
|
42
|
+
* `format` (`"HH:mm" | "HH:mm:ss"`) shows or hides the seconds column;
|
|
43
|
+
* `clockFormat` (`"12h" | "24h"`) shows or hides the AM/PM selector.
|
|
44
|
+
* `minTime`/`maxTime` bound the selectable time inclusively — Apply is a
|
|
45
|
+
* no-op while the draft falls outside them. `minuteStep` controls the minute
|
|
46
|
+
* column's increment. `presets` renders a sidebar of quick picks.
|
|
47
|
+
*/
|
|
14
48
|
export const TimePicker = React.forwardRef((props, ref) => {
|
|
15
|
-
const { value, defaultValue, onChange, format = "HH:mm", clockFormat = "12h", minuteStep = 1, minTime, maxTime, presets,
|
|
49
|
+
const { value, defaultValue, onChange, format = "HH:mm", clockFormat = "12h", minuteStep = 1, minTime, maxTime, presets, name, isDisabled = false, isInvalid = false, className, } = props;
|
|
16
50
|
// Open state
|
|
17
51
|
const [open, setOpen] = useState(false);
|
|
18
52
|
// ---------------------------------------------------------------------------
|
|
@@ -46,9 +80,19 @@ export const TimePicker = React.forwardRef((props, ref) => {
|
|
|
46
80
|
}
|
|
47
81
|
return "AM";
|
|
48
82
|
});
|
|
83
|
+
// Whether the hour column should take focus when the popover mounts — true
|
|
84
|
+
// only when it was opened from the keyboard. See `openWithColumnFocus`.
|
|
85
|
+
const [autoFocusHour, setAutoFocusHour] = useState(false);
|
|
86
|
+
// The draft is three numbers, so it cannot represent "no time". This does:
|
|
87
|
+
// clearing a segment while the popover is open has to stick rather than being
|
|
88
|
+
// instantly resynced back from the draft.
|
|
89
|
+
const [draftCleared, setDraftCleared] = useState(false);
|
|
49
90
|
// Sync draft when popup opens
|
|
50
91
|
const handleOpenChange = useCallback((newOpen) => {
|
|
92
|
+
if (!newOpen)
|
|
93
|
+
setAutoFocusHour(false);
|
|
51
94
|
if (newOpen) {
|
|
95
|
+
setDraftCleared(false);
|
|
52
96
|
if (committedValue) {
|
|
53
97
|
const parsed = temporalToParsed(committedValue);
|
|
54
98
|
setDraftHour(clockFormat === "12h" ? to12Hour(parsed.hour).hour12 : parsed.hour);
|
|
@@ -79,6 +123,11 @@ export const TimePicker = React.forwardRef((props, ref) => {
|
|
|
79
123
|
}, [clockFormat, draftHour, draftMinute, draftSecond, draftPeriod]);
|
|
80
124
|
// Apply changes
|
|
81
125
|
const handleApply = useCallback(() => {
|
|
126
|
+
if (draftCleared) {
|
|
127
|
+
setCommittedValue(undefined);
|
|
128
|
+
setOpen(false);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
82
131
|
const parsed = getDraftTime();
|
|
83
132
|
const temporalTime = parsedToTemporal(parsed);
|
|
84
133
|
// Check if disabled
|
|
@@ -87,7 +136,7 @@ export const TimePicker = React.forwardRef((props, ref) => {
|
|
|
87
136
|
}
|
|
88
137
|
setCommittedValue(temporalTime);
|
|
89
138
|
setOpen(false);
|
|
90
|
-
}, [getDraftTime, temporalMinTime, temporalMaxTime, setCommittedValue]);
|
|
139
|
+
}, [draftCleared, getDraftTime, temporalMinTime, temporalMaxTime, setCommittedValue]);
|
|
91
140
|
// Cancel changes
|
|
92
141
|
const handleCancel = useCallback(() => {
|
|
93
142
|
setOpen(false);
|
|
@@ -137,13 +186,51 @@ export const TimePicker = React.forwardRef((props, ref) => {
|
|
|
137
186
|
const contentId = `timepicker-content-${id}`;
|
|
138
187
|
const inputId = `timepicker-input-${id}`;
|
|
139
188
|
// Display value
|
|
140
|
-
const displayValue = committedValue ? formatTimeDisplay(committedValue, clockFormat, format) : "";
|
|
141
189
|
const hasValue = Boolean(committedValue);
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
// The typeable field.
|
|
192
|
+
//
|
|
193
|
+
// One value, two ways to move it: the segments show the draft while the
|
|
194
|
+
// popover is open and the committed value while it is closed, so typing a time
|
|
195
|
+
// moves the columns and scrolling a column shows up in the segments. The
|
|
196
|
+
// commit contract stays single — open means Apply/Cancel owns it, closed means
|
|
197
|
+
// a complete time commits as soon as it is complete.
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
const draftTime = parsedToTemporal(getDraftTime());
|
|
200
|
+
const segmentValue = open ? (draftCleared ? undefined : draftTime) : committedValue;
|
|
201
|
+
// A typed time can fall outside `minTime`/`maxTime`, which the columns would
|
|
202
|
+
// refuse. The field says so rather than silently clamping. See DatePicker.
|
|
203
|
+
const outOfBounds = segmentValue !== undefined && isTimeDisabled(segmentValue, temporalMinTime, temporalMaxTime);
|
|
204
|
+
const handleSegmentsChange = useCallback((time) => {
|
|
205
|
+
if (!open) {
|
|
206
|
+
setCommittedValue(time);
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (!time) {
|
|
210
|
+
setDraftCleared(true);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
setDraftCleared(false);
|
|
214
|
+
setDraftHour(clockFormat === "12h" ? to12Hour(time.hour).hour12 : time.hour);
|
|
215
|
+
setDraftMinute(time.minute);
|
|
216
|
+
setDraftSecond(time.second);
|
|
217
|
+
setDraftPeriod(to12Hour(time.hour).period);
|
|
218
|
+
}, [clockFormat, open, setCommittedValue]);
|
|
219
|
+
/** `Alt+ArrowDown` from a segment: open the columns *and* go there. */
|
|
220
|
+
const openWithColumnFocus = useCallback(() => {
|
|
221
|
+
setAutoFocusHour(true);
|
|
222
|
+
handleOpenChange(true);
|
|
223
|
+
}, [handleOpenChange]);
|
|
224
|
+
/** `Enter` in a segment commits the draft, matching the popover's Apply. */
|
|
225
|
+
const handleFieldSubmit = useCallback(() => {
|
|
226
|
+
if (open)
|
|
227
|
+
handleApply();
|
|
228
|
+
}, [handleApply, open]);
|
|
142
229
|
// Generate column values
|
|
143
230
|
const hours = generateHours(clockFormat);
|
|
144
231
|
const minutes = generateMinutes(minuteStep);
|
|
145
232
|
const seconds = generateSeconds();
|
|
146
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: ref, className: "relative flex items-center", children: [_jsx(
|
|
233
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { ref: ref, className: "relative flex items-center", children: [_jsx(PickerField, { ref: refs.setReference, className: cn("w-full min-w-45", className), icon: _jsx(Clock, { className: "h-4 w-4" }), toggleLabel: "Open time picker", toggleProps: getReferenceProps(), isOpen: open, contentId: contentId, isDisabled: isDisabled, isInvalid: isInvalid || outOfBounds, onClear: hasValue && !isDisabled ? handleClear : undefined, clearLabel: "Clear time", children: _jsx(TimeSegments, { className: "h-full flex-1", id: inputId, value: segmentValue, onChange: handleSegmentsChange, format: format, clockFormat: clockFormat, isDisabled: isDisabled, isInvalid: isInvalid || outOfBounds, onOpenRequest: openWithColumnFocus, onSubmit: handleFieldSubmit }) }), name && committedValue && _jsx("input", { type: "hidden", name: name, value: temporalTimeToISO(committedValue, format) })] }), open && (_jsx(FloatingPortal, { children: _jsx("div", { ref: refs.setFloating, id: contentId, role: "dialog", "aria-label": "Choose time", style: floatingStyles, className: "z-popover rounded-xl border border-border-normal bg-bg-normal p-4 shadow-lg", ...getFloatingProps(), children: _jsxs("div", { className: "flex", children: [presets && presets.length > 0 && (_jsx("div", { className: "mr-3 flex flex-col gap-1 border-border-normal border-r pr-3", children: presets.map((preset) => (_jsx("button", { type: "button", onClick: () => handlePresetClick(preset), className: cn(`rounded-md px-3 py-1.5 text-left text-sm transition-colors`, `hover:bg-bg-subtle focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-inset`, isPresetActive(preset) && "bg-bg-brand-subtle text-fg-brand"), children: preset.label }, preset.label))) })), _jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { className: "flex items-center justify-center gap-2", children: [_jsx("div", { className: "w-14 text-center font-medium text-fg-subtle text-xs", children: "Hour" }), _jsx("div", { className: "w-14 text-center font-medium text-fg-subtle text-xs", children: "Min" }), format === "HH:mm:ss" && _jsx("div", { className: "w-14 text-center font-medium text-fg-subtle text-xs", children: "Sec" }), clockFormat === "12h" && _jsx("div", { className: "w-12 text-center font-medium text-fg-subtle text-xs" })] }), _jsxs("div", { className: "flex items-start gap-2", children: [_jsx(TimeColumn, { values: hours, selected: draftHour, onSelect: setDraftHour, formatValue: clockFormat === "12h" ? (v) => String(v) : (v) => String(v).padStart(2, "0"), autoFocusSelected: autoFocusHour }), _jsx(TimeColumn, { values: minutes, selected: draftMinute, onSelect: setDraftMinute }), format === "HH:mm:ss" && _jsx(TimeColumn, { values: seconds, selected: draftSecond, onSelect: setDraftSecond }), clockFormat === "12h" && _jsx(PeriodSelector, { value: draftPeriod, onChange: setDraftPeriod })] }), _jsx(Separator, {}), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: handleNow, children: "Now" }), _jsxs("div", { className: "flex gap-2", children: [_jsx(Button, { type: "button", variant: "ghost", size: "sm", onClick: handleCancel, children: "Cancel" }), _jsx(Button, { type: "button", variant: "solid", intent: "brand", size: "sm", onClick: handleApply, children: "Apply" })] })] })] })] }) }) }))] }));
|
|
147
234
|
});
|
|
148
235
|
TimePicker.displayName = "TimePicker";
|
|
149
236
|
//# sourceMappingURL=TimePicker.js.map
|