@sixthshift/design-system 0.2.1 → 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 +242 -33
- package/dist/components/Badge/Badge.d.ts +65 -7
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +56 -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 +20 -2
- package/dist/components/BarChart/BarChart.d.ts.map +1 -1
- package/dist/components/BarChart/BarChart.js +17 -3
- 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 +31 -1
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +94 -225
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Calendar/CalendarView.d.ts +15 -0
- package/dist/components/Calendar/CalendarView.d.ts.map +1 -0
- package/dist/components/Calendar/CalendarView.js +263 -0
- package/dist/components/Calendar/CalendarView.js.map +1 -0
- package/dist/components/Calendar/calendar.types.d.ts +87 -27
- package/dist/components/Calendar/calendar.types.d.ts.map +1 -1
- package/dist/components/Calendar/calendar.types.js +10 -3
- package/dist/components/Calendar/calendar.types.js.map +1 -1
- package/dist/components/Calendar/index.d.ts +16 -2
- package/dist/components/Calendar/index.d.ts.map +1 -1
- package/dist/components/Calendar/index.js +15 -1
- package/dist/components/Calendar/index.js.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 +45 -2
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +228 -11
- 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 +53 -37
- package/dist/components/DatePicker/datepicker.types.d.ts.map +1 -1
- package/dist/components/DatePicker/datepicker.types.js +5 -3
- package/dist/components/DatePicker/datepicker.types.js.map +1 -1
- package/dist/components/DatePicker/index.d.ts +10 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +8 -0
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +22 -3
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +38 -24
- package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/components/DateRangePicker/daterangepicker.types.d.ts +26 -21
- package/dist/components/DateRangePicker/daterangepicker.types.d.ts.map +1 -1
- package/dist/components/DateRangePicker/daterangepicker.types.js +6 -0
- package/dist/components/DateRangePicker/daterangepicker.types.js.map +1 -1
- package/dist/components/DateRangePicker/index.d.ts +8 -1
- package/dist/components/DateRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateRangePicker/index.js +6 -0
- package/dist/components/DateRangePicker/index.js.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +32 -4
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.js +133 -42
- 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 +26 -18
- package/dist/components/DateTimePicker/datetimepicker.types.d.ts.map +1 -1
- package/dist/components/DateTimePicker/datetimepicker.types.js +10 -0
- package/dist/components/DateTimePicker/datetimepicker.types.js.map +1 -1
- package/dist/components/DateTimePicker/index.d.ts +8 -1
- package/dist/components/DateTimePicker/index.d.ts.map +1 -1
- package/dist/components/DateTimePicker/index.js +6 -0
- package/dist/components/DateTimePicker/index.js.map +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +30 -4
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +171 -72
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
- package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts +28 -19
- package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/datetimerangepicker.types.js +8 -0
- package/dist/components/DateTimeRangePicker/datetimerangepicker.types.js.map +1 -1
- package/dist/components/DateTimeRangePicker/index.d.ts +8 -0
- package/dist/components/DateTimeRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/index.js +7 -0
- package/dist/components/DateTimeRangePicker/index.js.map +1 -1
- package/dist/components/Field/Field.d.ts +18 -20
- package/dist/components/Field/Field.d.ts.map +1 -1
- package/dist/components/Field/Field.js +22 -5
- 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 +35 -2
- package/dist/components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/components/LineChart/LineChart.js +22 -3
- package/dist/components/LineChart/LineChart.js.map +1 -1
- package/dist/components/Markdown/Markdown.d.ts +19 -4
- package/dist/components/Markdown/Markdown.d.ts.map +1 -1
- package/dist/components/Markdown/Markdown.js +20 -2
- 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 +62 -11
- 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 +60 -5
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +52 -6
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/components/ModalContext.d.ts +14 -0
- package/dist/components/Modal/components/ModalContext.d.ts.map +1 -1
- package/dist/components/Modal/components/ModalContext.js.map +1 -1
- package/dist/components/Modal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/Modal/components/ModalHeader.js +13 -2
- 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 +36 -0
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover/components/PopoverBody.d.ts.map +1 -1
- package/dist/components/Popover/components/PopoverBody.js +5 -2
- package/dist/components/Popover/components/PopoverBody.js.map +1 -1
- package/dist/components/Popover/components/PopoverContext.d.ts +1 -0
- package/dist/components/Popover/components/PopoverContext.d.ts.map +1 -1
- package/dist/components/Popover/components/PopoverContext.js.map +1 -1
- package/dist/components/Popover/components/PopoverTrigger.d.ts.map +1 -1
- package/dist/components/Popover/components/PopoverTrigger.js +2 -2
- package/dist/components/Popover/components/PopoverTrigger.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +16 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +19 -3
- 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 +10 -2
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +63 -18
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectDropdown.d.ts +14 -2
- package/dist/components/Select/SelectDropdown.d.ts.map +1 -1
- package/dist/components/Select/SelectDropdown.js +20 -4
- package/dist/components/Select/SelectDropdown.js.map +1 -1
- package/dist/components/Select/SelectTrigger.d.ts +10 -3
- package/dist/components/Select/SelectTrigger.d.ts.map +1 -1
- package/dist/components/Select/SelectTrigger.js +12 -3
- package/dist/components/Select/SelectTrigger.js.map +1 -1
- package/dist/components/Select/useSelectKeyboard.d.ts +15 -1
- package/dist/components/Select/useSelectKeyboard.d.ts.map +1 -1
- package/dist/components/Select/useSelectKeyboard.js +73 -65
- package/dist/components/Select/useSelectKeyboard.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 +25 -5
- package/dist/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/Sheet/Sheet.js +24 -6
- package/dist/components/Sheet/Sheet.js.map +1 -1
- package/dist/components/Sheet/components/SheetContext.d.ts +10 -0
- package/dist/components/Sheet/components/SheetContext.d.ts.map +1 -1
- package/dist/components/Sheet/components/SheetContext.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.d.ts.map +1 -1
- package/dist/components/Sheet/components/SheetHeader.js +11 -2
- package/dist/components/Sheet/components/SheetHeader.js.map +1 -1
- package/dist/components/Sparkline/Sparkline.d.ts +21 -2
- package/dist/components/Sparkline/Sparkline.d.ts.map +1 -1
- package/dist/components/Sparkline/Sparkline.js +16 -3
- 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 +8 -2
- 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/TabsList.d.ts +1 -1
- package/dist/components/Tabs/components/TabsList.d.ts.map +1 -1
- package/dist/components/Tabs/components/TabsList.js +5 -4
- package/dist/components/Tabs/components/TabsList.js.map +1 -1
- package/dist/components/Tabs/components/TabsPanels.d.ts +1 -1
- package/dist/components/Tabs/components/TabsPanels.d.ts.map +1 -1
- package/dist/components/Tabs/components/TabsPanels.js +5 -3
- package/dist/components/Tabs/components/TabsPanels.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 +16 -13
- package/dist/components/TagChip/TagChip.d.ts.map +1 -1
- package/dist/components/TagChip/TagChip.js +18 -3
- package/dist/components/TagChip/TagChip.js.map +1 -1
- package/dist/components/TagInput/TagInput.d.ts +12 -9
- package/dist/components/TagInput/TagInput.d.ts.map +1 -1
- package/dist/components/TagInput/TagInput.js +16 -4
- 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 +34 -2
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.js +118 -15
- 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 +14 -15
- package/dist/components/TimePicker/timepicker.types.d.ts.map +1 -1
- package/dist/components/TimePicker/timepicker.types.js +4 -3
- package/dist/components/TimePicker/timepicker.types.js.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 +2 -0
- package/dist/date-time/index.d.ts.map +1 -1
- package/dist/date-time/index.js +9 -1
- package/dist/date-time/index.js.map +1 -1
- package/dist/date-time/iso.d.ts +261 -0
- package/dist/date-time/iso.d.ts.map +1 -0
- package/dist/date-time/iso.js +358 -0
- package/dist/date-time/iso.js.map +1 -0
- package/dist/date-time/now.d.ts +7 -6
- package/dist/date-time/now.d.ts.map +1 -1
- package/dist/date-time/now.js +3 -3
- package/dist/date-time/now.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 +4 -3
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +3 -2
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/schema.d.ts +49 -33
- package/dist/theme/schema.d.ts.map +1 -1
- package/dist/theme/schema.js +30 -21
- package/dist/theme/schema.js.map +1 -1
- package/package.json +11 -59
- package/src/components/Badge/Badge.tsx +87 -49
- package/src/components/Badge/index.ts +10 -1
- package/src/components/BarChart/BarChart.tsx +37 -30
- package/src/components/Button/Button.tsx +129 -106
- package/src/components/Button/index.ts +10 -1
- package/src/components/Calendar/Calendar.tsx +104 -401
- package/src/components/Calendar/CalendarView.tsx +454 -0
- package/src/components/Calendar/calendar.types.ts +104 -29
- package/src/components/Calendar/index.ts +16 -17
- 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 +369 -42
- package/src/components/DatePicker/DateSegments.tsx +125 -0
- package/src/components/DatePicker/datepicker.types.ts +58 -39
- package/src/components/DatePicker/index.ts +11 -3
- package/src/components/DateRangePicker/DateRangePicker.tsx +38 -24
- package/src/components/DateRangePicker/daterangepicker.types.ts +29 -23
- package/src/components/DateRangePicker/index.ts +9 -1
- package/src/components/DateTimePicker/DateTimePicker.tsx +189 -88
- package/src/components/DateTimePicker/DateTimeSegments.tsx +113 -0
- package/src/components/DateTimePicker/datetimepicker.types.ts +29 -19
- package/src/components/DateTimePicker/index.ts +9 -1
- package/src/components/DateTimeRangePicker/DateTimeRangePicker.tsx +251 -126
- package/src/components/DateTimeRangePicker/datetimerangepicker.types.ts +31 -20
- package/src/components/DateTimeRangePicker/index.ts +9 -0
- package/src/components/Field/Field.tsx +25 -26
- 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 +164 -141
- package/src/components/Markdown/Markdown.tsx +21 -3
- package/src/components/Message/Message.tsx +83 -17
- package/src/components/Message/index.ts +1 -1
- package/src/components/Modal/Modal.tsx +157 -86
- package/src/components/Modal/components/ModalContext.tsx +14 -0
- package/src/components/Modal/components/ModalHeader.tsx +15 -3
- package/src/components/Popover/Popover.tsx +36 -0
- package/src/components/Popover/components/PopoverBody.tsx +6 -1
- package/src/components/Popover/components/PopoverContext.tsx +1 -0
- package/src/components/Popover/components/PopoverTrigger.tsx +2 -1
- package/src/components/ProgressBar/ProgressBar.tsx +46 -28
- 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 +75 -19
- package/src/components/Select/SelectDropdown.tsx +45 -12
- package/src/components/Select/SelectTrigger.tsx +31 -8
- package/src/components/Select/useSelectKeyboard.ts +20 -10
- package/src/components/Separator/Separator.tsx +10 -0
- package/src/components/Sheet/Sheet.tsx +114 -83
- package/src/components/Sheet/components/SheetContext.tsx +10 -0
- package/src/components/Sheet/components/SheetFooter.tsx +1 -1
- package/src/components/Sheet/components/SheetHeader.tsx +18 -3
- package/src/components/Sparkline/Sparkline.tsx +40 -36
- 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/TabsList.tsx +5 -3
- package/src/components/Tabs/components/TabsPanels.tsx +5 -3
- package/src/components/Tabs/components/TabsTrigger.tsx +22 -5
- package/src/components/TagChip/TagChip.tsx +27 -18
- package/src/components/TagInput/TagInput.tsx +16 -11
- 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 +157 -51
- package/src/components/TimePicker/TimeSegments.tsx +131 -0
- package/src/components/TimePicker/timepicker.hooks.ts +1 -24
- package/src/components/TimePicker/timepicker.types.ts +14 -16
- 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 +61 -1
- package/src/date-time/iso.ts +511 -0
- package/src/date-time/now.ts +10 -9
- 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 +11 -9
- 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 +59 -58
- package/src/theme/tokens.css +824 -0
- 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 -13
- package/dist/components/ColorDot/ColorDot.d.ts.map +0 -1
- package/dist/components/ColorDot/ColorDot.js +0 -34
- 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 -15
- package/dist/components/EmptyState/EmptyState.d.ts.map +0 -1
- package/dist/components/EmptyState/EmptyState.js +0 -7
- 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 -6
- 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 -15
- package/dist/components/NavBottom/NavBottom.d.ts.map +0 -1
- package/dist/components/NavBottom/NavBottom.js +0 -19
- 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 -15
- package/dist/components/NavSide/NavSide.d.ts.map +0 -1
- package/dist/components/NavSide/NavSide.js +0 -10
- 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 -3
- package/dist/components/Skeleton/Skeleton.d.ts.map +0 -1
- package/dist/components/Skeleton/Skeleton.js +0 -7
- 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 -13
- 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/dist/styles.css +0 -2
- package/dist/theme.generated.css +0 -438
- 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 -50
- package/src/components/ColorDot/index.ts +0 -1
- package/src/components/EmptyState/EmptyState.tsx +0 -29
- 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 -13
- package/src/components/MetricList/MetricRow.tsx +0 -30
- package/src/components/MetricList/index.ts +0 -2
- package/src/components/NavBottom/NavBottom.tsx +0 -53
- package/src/components/NavBottom/index.ts +0 -3
- package/src/components/NavSide/NavItem.tsx +0 -39
- package/src/components/NavSide/NavSide.tsx +0 -40
- 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 -7
- package/src/components/Skeleton/index.ts +0 -1
- package/src/components/StatsCard/StatsCard.tsx +0 -40
- package/src/components/StatsCard/index.ts +0 -1
- package/src/styles/base.css +0 -41
- package/src/theme/palette.json +0 -100
- package/src/theme/palette.schema.json +0 -40
- package/src/theme/theme.json +0 -349
- package/src/theme/theme.schema.json +0 -876
- package/src/theme/typography.json +0 -7
- package/src/theme/typography.schema.json +0 -36
- package/tailwind.config.ts +0 -261
|
@@ -2,22 +2,71 @@ 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
|
|
6
|
-
import
|
|
5
|
+
import { Clock } from "lucide-react";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { useCallback, useId, useMemo, useState } from "react";
|
|
8
|
+
import { fromISOTime, fromISOTimeOrUndefined, toISOTimeOrUndefined } from "../../date-time/index.js";
|
|
9
|
+
import { PickerField } from "../../internal/index.js";
|
|
7
10
|
import { Button } from "../Button/index.js";
|
|
8
11
|
import { Separator } from "../Separator/index.js";
|
|
9
12
|
import { PeriodSelector } from "./PeriodSelector.js";
|
|
10
13
|
import { TimeColumn } from "./TimeColumn.js";
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
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
|
+
*/
|
|
48
|
+
export const TimePicker = React.forwardRef((props, ref) => {
|
|
49
|
+
const { value, defaultValue, onChange, format = "HH:mm", clockFormat = "12h", minuteStep = 1, minTime, maxTime, presets, name, isDisabled = false, isInvalid = false, className, } = props;
|
|
14
50
|
// Open state
|
|
15
51
|
const [open, setOpen] = useState(false);
|
|
52
|
+
// ---------------------------------------------------------------------------
|
|
53
|
+
// The ISO boundary.
|
|
54
|
+
//
|
|
55
|
+
// Props arrive as ISO time strings and onChange emits the canonical
|
|
56
|
+
// `HH:MM:SS` form; everything below works in Temporal.PlainTime as before.
|
|
57
|
+
// Each conversion is memoised on its source string, so the Temporal values
|
|
58
|
+
// handed to the hooks below stay referentially stable across renders.
|
|
59
|
+
// ---------------------------------------------------------------------------
|
|
60
|
+
const temporalValue = useMemo(() => fromISOTimeOrUndefined(value), [value]);
|
|
61
|
+
const temporalDefaultValue = useMemo(() => fromISOTimeOrUndefined(defaultValue), [defaultValue]);
|
|
62
|
+
const temporalMinTime = useMemo(() => fromISOTimeOrUndefined(minTime), [minTime]);
|
|
63
|
+
const temporalMaxTime = useMemo(() => fromISOTimeOrUndefined(maxTime), [maxTime]);
|
|
64
|
+
const handleChange = useCallback((next) => onChange?.(toISOTimeOrUndefined(next)), [onChange]);
|
|
16
65
|
// Controllable value state (external/committed value)
|
|
17
66
|
const [committedValue, setCommittedValue] = useControllableState({
|
|
18
|
-
value,
|
|
19
|
-
defaultValue,
|
|
20
|
-
onChange,
|
|
67
|
+
value: temporalValue,
|
|
68
|
+
defaultValue: temporalDefaultValue,
|
|
69
|
+
onChange: handleChange,
|
|
21
70
|
});
|
|
22
71
|
// Parse committed value
|
|
23
72
|
const parsedCommitted = committedValue ? temporalToParsed(committedValue) : undefined;
|
|
@@ -31,9 +80,19 @@ export const TimePicker = (props) => {
|
|
|
31
80
|
}
|
|
32
81
|
return "AM";
|
|
33
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);
|
|
34
90
|
// Sync draft when popup opens
|
|
35
91
|
const handleOpenChange = useCallback((newOpen) => {
|
|
92
|
+
if (!newOpen)
|
|
93
|
+
setAutoFocusHour(false);
|
|
36
94
|
if (newOpen) {
|
|
95
|
+
setDraftCleared(false);
|
|
37
96
|
if (committedValue) {
|
|
38
97
|
const parsed = temporalToParsed(committedValue);
|
|
39
98
|
setDraftHour(clockFormat === "12h" ? to12Hour(parsed.hour).hour12 : parsed.hour);
|
|
@@ -64,15 +123,20 @@ export const TimePicker = (props) => {
|
|
|
64
123
|
}, [clockFormat, draftHour, draftMinute, draftSecond, draftPeriod]);
|
|
65
124
|
// Apply changes
|
|
66
125
|
const handleApply = useCallback(() => {
|
|
126
|
+
if (draftCleared) {
|
|
127
|
+
setCommittedValue(undefined);
|
|
128
|
+
setOpen(false);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
67
131
|
const parsed = getDraftTime();
|
|
68
132
|
const temporalTime = parsedToTemporal(parsed);
|
|
69
133
|
// Check if disabled
|
|
70
|
-
if (isTimeDisabled(temporalTime,
|
|
134
|
+
if (isTimeDisabled(temporalTime, temporalMinTime, temporalMaxTime)) {
|
|
71
135
|
return;
|
|
72
136
|
}
|
|
73
137
|
setCommittedValue(temporalTime);
|
|
74
138
|
setOpen(false);
|
|
75
|
-
}, [getDraftTime,
|
|
139
|
+
}, [draftCleared, getDraftTime, temporalMinTime, temporalMaxTime, setCommittedValue]);
|
|
76
140
|
// Cancel changes
|
|
77
141
|
const handleCancel = useCallback(() => {
|
|
78
142
|
setOpen(false);
|
|
@@ -94,7 +158,7 @@ export const TimePicker = (props) => {
|
|
|
94
158
|
}, [clockFormat]);
|
|
95
159
|
// Preset selection
|
|
96
160
|
const handlePresetClick = useCallback((preset) => {
|
|
97
|
-
const parsed = temporalToParsed(preset.value);
|
|
161
|
+
const parsed = temporalToParsed(fromISOTime(preset.value));
|
|
98
162
|
setDraftHour(clockFormat === "12h" ? to12Hour(parsed.hour).hour12 : parsed.hour);
|
|
99
163
|
setDraftMinute(parsed.minute);
|
|
100
164
|
setDraftSecond(parsed.second);
|
|
@@ -103,7 +167,7 @@ export const TimePicker = (props) => {
|
|
|
103
167
|
// Check if a preset is currently active
|
|
104
168
|
const isPresetActive = useCallback((preset) => {
|
|
105
169
|
const draftTime = getDraftTime();
|
|
106
|
-
const presetParsed = temporalToParsed(preset.value);
|
|
170
|
+
const presetParsed = temporalToParsed(fromISOTime(preset.value));
|
|
107
171
|
return (draftTime.hour === presetParsed.hour && draftTime.minute === presetParsed.minute && (format === "HH:mm" || draftTime.second === presetParsed.second));
|
|
108
172
|
}, [getDraftTime, format]);
|
|
109
173
|
// Floating UI setup
|
|
@@ -122,12 +186,51 @@ export const TimePicker = (props) => {
|
|
|
122
186
|
const contentId = `timepicker-content-${id}`;
|
|
123
187
|
const inputId = `timepicker-input-${id}`;
|
|
124
188
|
// Display value
|
|
125
|
-
const displayValue = committedValue ? formatTimeDisplay(committedValue, clockFormat, format) : "";
|
|
126
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]);
|
|
127
229
|
// Generate column values
|
|
128
230
|
const hours = generateHours(clockFormat);
|
|
129
231
|
const minutes = generateMinutes(minuteStep);
|
|
130
232
|
const seconds = generateSeconds();
|
|
131
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "relative flex items-center", children: [_jsx(
|
|
132
|
-
};
|
|
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" })] })] })] })] }) }) }))] }));
|
|
234
|
+
});
|
|
235
|
+
TimePicker.displayName = "TimePicker";
|
|
133
236
|
//# sourceMappingURL=TimePicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../../src/components/TimePicker/TimePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACzI,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,EAAE,EAAE,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EA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AAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,EAAE,WAAW,sBAE1E,IACL,IACF,IACF,IACF,GACF,GACS,CAClB,IACA,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Temporal } from "../../date-time/index.js";
|
|
2
|
+
import { type SegmentSpec, type SegmentValues } from "../../internal/index.js";
|
|
3
|
+
import type { ClockFormat, TimeFormat } from "./timepicker.types.js";
|
|
4
|
+
export type TimeSegmentsProps = {
|
|
5
|
+
/** The time the segments display. `undefined` leaves them empty. */
|
|
6
|
+
value: Temporal.PlainTime | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Fires with a complete time, or `undefined` the moment the segments stop
|
|
9
|
+
* describing one. Never fires a partial time.
|
|
10
|
+
*/
|
|
11
|
+
onChange: (time: Temporal.PlainTime | undefined) => void;
|
|
12
|
+
/** `"HH:mm:ss"` adds a seconds segment. */
|
|
13
|
+
format?: TimeFormat | undefined;
|
|
14
|
+
/** `"12h"` runs the hour 1–12 and adds an AM/PM segment. */
|
|
15
|
+
clockFormat?: ClockFormat | undefined;
|
|
16
|
+
isDisabled?: boolean | undefined;
|
|
17
|
+
isInvalid?: boolean | undefined;
|
|
18
|
+
label?: string | undefined;
|
|
19
|
+
onOpenRequest?: (() => void) | undefined;
|
|
20
|
+
onSubmit?: (() => void) | undefined;
|
|
21
|
+
id?: string | undefined;
|
|
22
|
+
className?: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The segments for a clock, which depend on both format props: the hour's range
|
|
26
|
+
* is the difference between a 12-hour and a 24-hour clock, and AM/PM only exists
|
|
27
|
+
* in the former.
|
|
28
|
+
*/
|
|
29
|
+
export declare function timeSpec(format: TimeFormat, clockFormat: ClockFormat, leadingSeparator?: string): SegmentSpec[];
|
|
30
|
+
export declare function timeCodec(format: TimeFormat, clockFormat: ClockFormat): {
|
|
31
|
+
toSegments: (time: Temporal.PlainTime | undefined) => SegmentValues;
|
|
32
|
+
fromSegments: (values: Record<string, number>) => Temporal.PlainTime;
|
|
33
|
+
parsePaste: (text: string) => SegmentValues | null;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* The typeable half of `TimePicker`: a time as spinbutton segments.
|
|
37
|
+
*
|
|
38
|
+
* A thin spec over `SegmentedField`, which owns the keyboard model. What belongs
|
|
39
|
+
* to clocks specifically lives here: the hour's range and the AM/PM segment,
|
|
40
|
+
* both decided by `clockFormat`, and the fact that the value always carries
|
|
41
|
+
* seconds even when the field does not show them.
|
|
42
|
+
*
|
|
43
|
+
* `minuteStep` deliberately does not constrain typing. It sets the popover
|
|
44
|
+
* column's increment, but snapping a typed `:37` onto a 15-minute grid would
|
|
45
|
+
* fight the keystrokes.
|
|
46
|
+
*
|
|
47
|
+
* Internal to `TimePicker`; not exported from `./index.ts`.
|
|
48
|
+
*/
|
|
49
|
+
export declare function TimeSegments({ value, onChange, format, clockFormat, label, ...rest }: TimeSegmentsProps): import("react").JSX.Element;
|
|
50
|
+
//# sourceMappingURL=TimeSegments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeSegments.d.ts","sourceRoot":"","sources":["../../../src/components/TimePicker/TimeSegments.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAkB,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEtF,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAElE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oEAAoE;IACpE,KAAK,EAAE,QAAQ,CAAC,SAAS,GAAG,SAAS,CAAC;IACtC;;;OAG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edField } from "../../internal/index.js";
|
|
3
|
+
import { parsedToTemporal, temporalTimeToISO, to12Hour, to24Hour } from "./timepicker.hooks.js";
|
|
4
|
+
const PERIODS = ["AM", "PM"];
|
|
5
|
+
/**
|
|
6
|
+
* The segments for a clock, which depend on both format props: the hour's range
|
|
7
|
+
* is the difference between a 12-hour and a 24-hour clock, and AM/PM only exists
|
|
8
|
+
* in the former.
|
|
9
|
+
*/
|
|
10
|
+
export function timeSpec(format, clockFormat, leadingSeparator) {
|
|
11
|
+
const twelve = clockFormat === "12h";
|
|
12
|
+
const spec = [
|
|
13
|
+
{ name: "hour", label: "Hour", placeholder: "hh", digits: 2, min: twelve ? 1 : 0, max: twelve ? 12 : 23, separatorBefore: leadingSeparator },
|
|
14
|
+
{ name: "minute", label: "Minute", placeholder: "mm", digits: 2, min: 0, max: 59, separatorBefore: ":" },
|
|
15
|
+
];
|
|
16
|
+
if (format === "HH:mm:ss") {
|
|
17
|
+
spec.push({ name: "second", label: "Second", placeholder: "ss", digits: 2, min: 0, max: 59, separatorBefore: ":" });
|
|
18
|
+
}
|
|
19
|
+
if (twelve) {
|
|
20
|
+
// A choice segment rather than a number: `a` and `p` type it, arrows toggle
|
|
21
|
+
// it, and it announces "AM" instead of an index.
|
|
22
|
+
spec.push({ kind: "choice", name: "period", label: "AM/PM", placeholder: "--", options: PERIODS, separatorBefore: " " });
|
|
23
|
+
}
|
|
24
|
+
return spec;
|
|
25
|
+
}
|
|
26
|
+
export function timeCodec(format, clockFormat) {
|
|
27
|
+
const twelve = clockFormat === "12h";
|
|
28
|
+
const withSeconds = format === "HH:mm:ss";
|
|
29
|
+
const toSegments = (time) => {
|
|
30
|
+
if (!time) {
|
|
31
|
+
return {
|
|
32
|
+
hour: null,
|
|
33
|
+
minute: null,
|
|
34
|
+
...(withSeconds ? { second: null } : {}),
|
|
35
|
+
...(twelve ? { period: null } : {}),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const { hour12, period } = to12Hour(time.hour);
|
|
39
|
+
return {
|
|
40
|
+
hour: twelve ? hour12 : time.hour,
|
|
41
|
+
minute: time.minute,
|
|
42
|
+
...(withSeconds ? { second: time.second } : {}),
|
|
43
|
+
...(twelve ? { period: period === "PM" ? 1 : 0 } : {}),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const fromSegments = (values) => {
|
|
47
|
+
const hour = twelve ? to24Hour(values.hour, values.period === 1 ? "PM" : "AM") : values.hour;
|
|
48
|
+
// Seconds are part of the value even when the field does not show them —
|
|
49
|
+
// `onChange` always emits canonical `HH:MM:SS`.
|
|
50
|
+
return parsedToTemporal({ hour, minute: values.minute, second: withSeconds ? values.second : 0 });
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* A pasted time is read as `H:MM`, `H:MM:SS`, optionally followed by a
|
|
54
|
+
* meridiem. The hour is interpreted in the field's own clock, so `9:30 PM`
|
|
55
|
+
* pasted into a 24-hour field still lands on 21:30.
|
|
56
|
+
*/
|
|
57
|
+
const parsePaste = (text) => {
|
|
58
|
+
const match = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*(am|pm)?$/i.exec(text.trim());
|
|
59
|
+
if (!match)
|
|
60
|
+
return null;
|
|
61
|
+
const meridiem = match[4]?.toUpperCase();
|
|
62
|
+
let hour = Number(match[1]);
|
|
63
|
+
if (meridiem)
|
|
64
|
+
hour = to24Hour(hour, meridiem === "PM" ? "PM" : "AM");
|
|
65
|
+
if (hour > 23 || Number(match[2]) > 59)
|
|
66
|
+
return null;
|
|
67
|
+
const second = match[3] === undefined ? 0 : Number(match[3]);
|
|
68
|
+
if (second > 59)
|
|
69
|
+
return null;
|
|
70
|
+
return toSegments(parsedToTemporal({ hour, minute: Number(match[2]), second }));
|
|
71
|
+
};
|
|
72
|
+
return { toSegments, fromSegments, parsePaste };
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The typeable half of `TimePicker`: a time as spinbutton segments.
|
|
76
|
+
*
|
|
77
|
+
* A thin spec over `SegmentedField`, which owns the keyboard model. What belongs
|
|
78
|
+
* to clocks specifically lives here: the hour's range and the AM/PM segment,
|
|
79
|
+
* both decided by `clockFormat`, and the fact that the value always carries
|
|
80
|
+
* seconds even when the field does not show them.
|
|
81
|
+
*
|
|
82
|
+
* `minuteStep` deliberately does not constrain typing. It sets the popover
|
|
83
|
+
* column's increment, but snapping a typed `:37` onto a 15-minute grid would
|
|
84
|
+
* fight the keystrokes.
|
|
85
|
+
*
|
|
86
|
+
* Internal to `TimePicker`; not exported from `./index.ts`.
|
|
87
|
+
*/
|
|
88
|
+
export function TimeSegments({ value, onChange, format = "HH:mm", clockFormat = "12h", label = "Time", ...rest }) {
|
|
89
|
+
const spec = timeSpec(format, clockFormat);
|
|
90
|
+
const { toSegments, fromSegments, parsePaste } = timeCodec(format, clockFormat);
|
|
91
|
+
return (_jsx(SegmentedField, { spec: spec, value: value, toSegments: toSegments, fromSegments: fromSegments, keyOf: (time) => temporalTimeToISO(time, "HH:mm:ss"), onChange: onChange, parsePaste: parsePaste, label: label, ...rest }));
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=TimeSegments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimeSegments.js","sourceRoot":"","sources":["../../../src/components/TimePicker/TimeSegments.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAwC,MAAM,gBAAgB,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAwB7F,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAE7B;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAkB,EAAE,WAAwB,EAAE,gBAAyB;IAC9F,MAAM,MAAM,GAAG,WAAW,KAAK,KAAK,CAAC;IACrC,MAAM,IAAI,GAAkB;QAC1B,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK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AO,EAAE,WAAW,GAAG,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,GAAG,IAAI,EAAqB;IACjI,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAC3C,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAEhF,OAAO,CACL,KAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAU,CAAC,EACpD,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,KACR,IAAI,GACR,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -12,10 +12,6 @@ export declare function parsedToTemporal(parsed: ParsedTime): Temporal.PlainTime
|
|
|
12
12
|
* Convert Temporal.PlainTime to ISO string (for form submission)
|
|
13
13
|
*/
|
|
14
14
|
export declare function temporalTimeToISO(time: Temporal.PlainTime, format?: TimeFormat): string;
|
|
15
|
-
/**
|
|
16
|
-
* Format Temporal.PlainTime for display
|
|
17
|
-
*/
|
|
18
|
-
export declare function formatTimeDisplay(time: Temporal.PlainTime, clockFormat?: ClockFormat, format?: TimeFormat): string;
|
|
19
15
|
/**
|
|
20
16
|
* Check if time a is before time b
|
|
21
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timepicker.hooks.d.ts","sourceRoot":"","sources":["../../../src/components/TimePicker/timepicker.hooks.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"timepicker.hooks.d.ts","sourceRoot":"","sources":["../../../src/components/TimePicker/timepicker.hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM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;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAE1C;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,QAAQ,CAAC,SAAS,CAEnD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Temporal } from "../../date-time/index.js";
|
|
2
2
|
// =============================================================================
|
|
3
3
|
// Temporal ↔ ParsedTime Conversion
|
|
4
4
|
// =============================================================================
|
|
@@ -34,28 +34,6 @@ export function temporalTimeToISO(time, format = "HH:mm") {
|
|
|
34
34
|
// =============================================================================
|
|
35
35
|
// Time Formatting
|
|
36
36
|
// =============================================================================
|
|
37
|
-
/**
|
|
38
|
-
* Format Temporal.PlainTime for display
|
|
39
|
-
*/
|
|
40
|
-
export function formatTimeDisplay(time, clockFormat = "12h", format = "HH:mm") {
|
|
41
|
-
if (clockFormat === "12h") {
|
|
42
|
-
return formatTimePadded(time);
|
|
43
|
-
}
|
|
44
|
-
// 24h format
|
|
45
|
-
if (format === "HH:mm:ss") {
|
|
46
|
-
return time.toLocaleString("en-US", {
|
|
47
|
-
hour: "2-digit",
|
|
48
|
-
minute: "2-digit",
|
|
49
|
-
second: "2-digit",
|
|
50
|
-
hour12: false,
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return time.toLocaleString("en-US", {
|
|
54
|
-
hour: "2-digit",
|
|
55
|
-
minute: "2-digit",
|
|
56
|
-
hour12: false,
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
37
|
// =============================================================================
|
|
60
38
|
// Time Comparison
|
|
61
39
|
// =============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timepicker.hooks.js","sourceRoot":"","sources":["../../../src/components/TimePicker/timepicker.hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"timepicker.hooks.js","sourceRoot":"","sources":["../../../src/components/TimePicker/timepicker.hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,gFAAgF;AAChF,mCAAmC;AACnC,gFAAgF;AAEhF;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAwB;IACvD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAkB;IACjD,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;QAC7B,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAwB,EAAE,SAAqB,OAAO;IACtF,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa;IACnD,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU;AAChD,CAAC;AAED,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF,gFAAgF;AAChF,kBAAkB;AAClB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,CAAqB,EAAE,CAAqB;IACvE,OAAO,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU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AAM,UAAU,WAAW,CAAC,MAAc,EAAE,IAAY;IACtD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;AAC1C,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TimePicker types
|
|
2
|
+
* TimePicker types.
|
|
3
3
|
*
|
|
4
|
-
* All time values
|
|
5
|
-
*
|
|
4
|
+
* All time values at the public boundary are ISO 8601 time strings. `"09:30"`
|
|
5
|
+
* and `"09:30:00"` are both accepted as input; `onChange` always emits the
|
|
6
|
+
* canonical `HH:MM:SS` form.
|
|
6
7
|
*/
|
|
7
|
-
import type {
|
|
8
|
+
import type { ISOTime } from "../../date-time/index.js";
|
|
8
9
|
/**
|
|
9
10
|
* Time value format for display and serialization
|
|
10
11
|
* - "HH:mm" for minute precision (default)
|
|
@@ -19,29 +20,27 @@ export type TimeFormat = "HH:mm" | "HH:mm:ss";
|
|
|
19
20
|
export type ClockFormat = "12h" | "24h";
|
|
20
21
|
export type TimePresetOption = {
|
|
21
22
|
label: string;
|
|
22
|
-
value:
|
|
23
|
+
value: ISOTime;
|
|
23
24
|
};
|
|
24
25
|
export type TimePickerProps = {
|
|
25
26
|
/** Controlled value */
|
|
26
|
-
value?:
|
|
27
|
+
value?: ISOTime | undefined;
|
|
27
28
|
/** Default value for uncontrolled mode */
|
|
28
|
-
defaultValue?:
|
|
29
|
-
/** Called when time changes */
|
|
30
|
-
onChange?: (time:
|
|
29
|
+
defaultValue?: ISOTime | undefined;
|
|
30
|
+
/** Called when time changes. Always canonical `HH:MM:SS`. */
|
|
31
|
+
onChange?: (time: ISOTime | undefined) => void;
|
|
31
32
|
/** Time format for the value (affects seconds visibility) */
|
|
32
33
|
format?: TimeFormat;
|
|
33
34
|
/** Clock display format */
|
|
34
35
|
clockFormat?: ClockFormat;
|
|
35
36
|
/** Minute step interval (default: 1) */
|
|
36
37
|
minuteStep?: 1 | 5 | 10 | 15 | 30;
|
|
37
|
-
/**
|
|
38
|
-
minTime?:
|
|
39
|
-
/**
|
|
40
|
-
maxTime?:
|
|
38
|
+
/** Earliest selectable time, inclusive */
|
|
39
|
+
minTime?: ISOTime;
|
|
40
|
+
/** Latest selectable time, inclusive */
|
|
41
|
+
maxTime?: ISOTime;
|
|
41
42
|
/** Preset options (shown in sidebar) */
|
|
42
43
|
presets?: TimePresetOption[];
|
|
43
|
-
/** Placeholder text */
|
|
44
|
-
placeholder?: string;
|
|
45
44
|
/** Input name for form submission */
|
|
46
45
|
name?: string;
|
|
47
46
|
/** Whether the picker is disabled */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timepicker.types.d.ts","sourceRoot":"","sources":["../../../src/components/TimePicker/timepicker.types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"timepicker.types.d.ts","sourceRoot":"","sources":["../../../src/components/TimePicker/timepicker.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAM/C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,KAAK,CAAC;AAMxC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAMF,MAAM,MAAM,eAAe,GAAG;IAC5B,uBAAuB;IACvB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE5B,0CAA0C;IAC1C,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEnC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,KAAK,IAAI,CAAC;IAE/C,6DAA6D;IAC7D,MAAM,CAAC,EAAE,UAAU,CAAC;IAEpB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B,wCAAwC;IACxC,UAAU,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IAElC,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,wCAAwC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,wCAAwC;IACxC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAE7B,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,qCAAqC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,kBAAkB;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAMF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TimePicker types
|
|
2
|
+
* TimePicker types.
|
|
3
3
|
*
|
|
4
|
-
* All time values
|
|
5
|
-
*
|
|
4
|
+
* All time values at the public boundary are ISO 8601 time strings. `"09:30"`
|
|
5
|
+
* and `"09:30:00"` are both accepted as input; `onChange` always emits the
|
|
6
|
+
* canonical `HH:MM:SS` form.
|
|
6
7
|
*/
|
|
7
8
|
export {};
|
|
8
9
|
//# sourceMappingURL=timepicker.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timepicker.types.js","sourceRoot":"","sources":["../../../src/components/TimePicker/timepicker.types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"timepicker.types.js","sourceRoot":"","sources":["../../../src/components/TimePicker/timepicker.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -17,6 +17,33 @@ export type ToastProps = Omit<MessageProps, "size"> & {
|
|
|
17
17
|
*/
|
|
18
18
|
standalone?: boolean;
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* A transient notification for the outcome of an action that already
|
|
22
|
+
* happened — a save, a delete, a failed request — self-positioned bottom
|
|
23
|
+
* center. Reach for `Toast` over `Message` when the feedback is about an
|
|
24
|
+
* action and shouldn't stick around in the page's layout; reach for
|
|
25
|
+
* `Message` when the feedback belongs inline, in the place the caller puts
|
|
26
|
+
* it (a form's own validation state, an in-card page-load error).
|
|
27
|
+
*
|
|
28
|
+
* Toast renders `Message` internally (`<Message intent={intent}>` wrapping
|
|
29
|
+
* `MessageIcon`/`MessageBody`/`MessageTitle`/`MessageDescription`), so it
|
|
30
|
+
* inherits Message's live-region role mapping: `intent="danger"` gets
|
|
31
|
+
* `role="alert"` (assertive), everything else gets `role="status"` (polite).
|
|
32
|
+
* `action`/`onAction` render a link-style button inside the description; the
|
|
33
|
+
* dismiss (X) button only renders when `onClose` is provided.
|
|
34
|
+
*
|
|
35
|
+
* `standalone` (default `true`) controls positioning: when `true`, Toast
|
|
36
|
+
* portals itself (`FloatingPortal`, optionally to a custom `root`) and
|
|
37
|
+
* applies the fixed bottom-center classes itself. Set it to `false` when a
|
|
38
|
+
* parent already handles portalling and position — this is how
|
|
39
|
+
* `OverlayContext`'s toast stack renders it. Toast has no built-in
|
|
40
|
+
* auto-dismiss timer; that's `useToast`'s job, one layer up.
|
|
41
|
+
*
|
|
42
|
+
* Exit animation (`usePresence`) keeps Toast mounted through its fade-out,
|
|
43
|
+
* so `onClose` fires only after the animation completes. Toast has no focus
|
|
44
|
+
* trap and no Escape handling of its own — it's a passive notification, not
|
|
45
|
+
* a dialog.
|
|
46
|
+
*/
|
|
20
47
|
export declare const Toast: React.ForwardRefExoticComponent<Omit<MessageProps, "size"> & {
|
|
21
48
|
/** Called when toast closes (after exit animation) */
|
|
22
49
|
onClose?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,EAAyD,KAAK,YAAY,EAAgB,MAAM,mCAAmC,CAAC;AAG3I,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG;IACpD,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,mDAAmD;IACnD,IAAI,CAAC,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACnC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAMF,eAAO,MAAM,KAAK;
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG9E,OAAO,EAAyD,KAAK,YAAY,EAAgB,MAAM,mCAAmC,CAAC;AAG3I,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG;IACpD,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,mD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