@povio/ui 3.0.0-rc.3 → 3.1.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 +39 -0
- package/dist/assets/icons/AlignCenter.js +11 -26
- package/dist/assets/icons/AlignLeft.js +11 -26
- package/dist/assets/icons/AlignLeftRight.js +11 -26
- package/dist/assets/icons/AlignRight.js +11 -26
- package/dist/assets/icons/ArrowDropDown.js +11 -26
- package/dist/assets/icons/ArrowDropUp.js +11 -26
- package/dist/assets/icons/ArrowLeft.js +11 -26
- package/dist/assets/icons/ArrowRight.js +11 -26
- package/dist/assets/icons/Bold.js +11 -26
- package/dist/assets/icons/BulletedList.js +11 -26
- package/dist/assets/icons/Calendar.js +13 -28
- package/dist/assets/icons/Check.js +13 -28
- package/dist/assets/icons/CheckCircle.js +11 -26
- package/dist/assets/icons/CheckboxCheckmark.js +14 -29
- package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
- package/dist/assets/icons/ChevronDown.js +13 -28
- package/dist/assets/icons/ChevronLeft.js +13 -28
- package/dist/assets/icons/ChevronRight.js +13 -28
- package/dist/assets/icons/ChevronUp.js +13 -28
- package/dist/assets/icons/ChevronsLeft.js +13 -28
- package/dist/assets/icons/ChevronsRight.js +13 -28
- package/dist/assets/icons/Clock.js +11 -26
- package/dist/assets/icons/Close.js +11 -26
- package/dist/assets/icons/DateTime.js +14 -35
- package/dist/assets/icons/DragIndicator.js +11 -26
- package/dist/assets/icons/File.js +13 -28
- package/dist/assets/icons/Highlight.js +11 -26
- package/dist/assets/icons/HighlightOn.js +15 -49
- package/dist/assets/icons/Home.js +11 -26
- package/dist/assets/icons/Info.js +16 -37
- package/dist/assets/icons/Italic.js +11 -26
- package/dist/assets/icons/Link.js +11 -26
- package/dist/assets/icons/Menu.js +11 -26
- package/dist/assets/icons/NumberedList.js +11 -26
- package/dist/assets/icons/PointerHorizontal.js +11 -26
- package/dist/assets/icons/PointerVertical.js +11 -26
- package/dist/assets/icons/Search.js +11 -26
- package/dist/assets/icons/Send.js +13 -28
- package/dist/assets/icons/Strikethrough.js +11 -26
- package/dist/assets/icons/TextColor.js +14 -48
- package/dist/assets/icons/Today.js +11 -26
- package/dist/assets/icons/Underlined.js +13 -28
- package/dist/assets/icons/Upload.js +14 -35
- package/dist/assets/icons/Visibility.js +11 -26
- package/dist/assets/icons/VisibilityOff.js +11 -26
- package/dist/assets/icons/WarningFilled.js +13 -28
- package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
- package/dist/components/Menu/Menu.d.ts +4 -0
- package/dist/components/Menu/Menu.js +2 -18
- package/dist/components/Menu/MenuDesktop.js +7 -41
- package/dist/components/Menu/MenuItem.js +9 -32
- package/dist/components/Menu/MenuMobile.d.ts +1 -1
- package/dist/components/Menu/MenuMobile.js +39 -97
- package/dist/components/Menu/MenuPopover.js +29 -105
- package/dist/components/buttons/IconButton/IconButton.js +8 -40
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/PillButton/PillButton.js +17 -55
- package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
- package/dist/components/buttons/TextButton/TextButton.js +8 -30
- package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +0 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +35 -201
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
- package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -12
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +75 -373
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -12
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +186 -492
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -14
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +47 -273
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -7
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +121 -611
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +3 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +120 -338
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +103 -310
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -4
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +98 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -286
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -14
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +129 -356
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -96
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +28 -81
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
- package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -4
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -210
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/File/FileUpload.js +45 -88
- package/dist/components/inputs/File/FileUploadContainer.js +7 -15
- package/dist/components/inputs/File/InputUpload.js +79 -317
- package/dist/components/inputs/File/shared/FileCard.js +41 -104
- package/dist/components/inputs/File/shared/FileCardList.js +12 -47
- package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
- package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
- package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
- package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
- package/dist/components/inputs/File/shared/ProgressBar.d.ts +2 -2
- package/dist/components/inputs/File/shared/ProgressBar.js +20 -53
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +1 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -1
- package/dist/components/inputs/File/shared/progressBar.cva.d.ts +38 -0
- package/dist/components/inputs/File/shared/progressBar.cva.js +28 -0
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +37 -119
- package/dist/components/inputs/FormField/FormFieldError.js +5 -25
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +97 -447
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
- package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
- package/dist/components/inputs/Input/TextInput/TextInput.js +90 -419
- package/dist/components/inputs/Input/shared/InputContent.js +59 -192
- package/dist/components/inputs/Inputs/Form.js +11 -40
- package/dist/components/inputs/Inputs/InputItem.d.ts +21 -15
- package/dist/components/inputs/Inputs/InputItem.js +14 -69
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.js +61 -353
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -45
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -48
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +22 -217
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -107
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +18 -227
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +3 -8
- package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +116 -397
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +6 -11
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/select.context.js +36 -67
- package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
- package/dist/components/inputs/Slider/Slider.d.ts +1 -2
- package/dist/components/inputs/Slider/Slider.js +76 -265
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
- package/dist/components/inputs/Toggle/Toggle.d.ts +0 -1
- package/dist/components/inputs/Toggle/Toggle.js +37 -214
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
- package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
- package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.d.ts +1 -2
- package/dist/components/inputs/shared/InputClear.js +12 -88
- package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
- package/dist/components/inputs/shared/input.cva.d.ts +0 -28
- package/dist/components/inputs/shared/input.cva.js +4 -38
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/navigation/Stepper/StepperItem.js +31 -104
- package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/BottomSheet/BottomSheet.js +25 -98
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +22 -64
- package/dist/components/overlays/Modal/modal.cva.js +1 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +5 -1
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +28 -83
- package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
- package/dist/components/segment/Segment.js +57 -218
- package/dist/components/segment/SegmentItem.js +10 -67
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/shared/pagination/PaginationList.js +64 -167
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/status/Loader/Loader.js +22 -77
- package/dist/components/status/Toast/Toast.js +17 -22
- package/dist/components/status/Toast/toast.cva.d.ts +14 -3
- package/dist/components/status/Toast/toast.cva.js +12 -10
- package/dist/components/status/Toast/useToast.js +57 -62
- package/dist/components/table/ColumnConfig.js +54 -158
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/PaginatedTable.js +18 -84
- package/dist/components/table/Table.js +30 -30
- package/dist/components/table/table.cva.d.ts +7 -0
- package/dist/components/table/table.cva.js +2 -1
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Pill/Pill.d.ts +15 -0
- package/dist/components/text/Pill/Pill.js +44 -0
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +9 -23
- package/dist/config/router.context.js +16 -42
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +10 -21
- package/dist/config/uiConfig.context.js +18 -69
- package/dist/config/uiOverrides.context.d.ts +10 -20
- package/dist/config/uiOverrides.context.js +14 -54
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useAutosave.d.ts +1 -2
- package/dist/hooks/useAutosave.js +4 -12
- package/dist/hooks/useBreakpoint.js +3 -16
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFilters.js +64 -125
- package/dist/hooks/useForm.js +8 -42
- package/dist/hooks/useFormAutosave.d.ts +1 -3
- package/dist/hooks/useFormAutosave.js +30 -122
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +24 -91
- package/dist/hooks/useLocalStorage.js +10 -43
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/hooks/usePagination.js +19 -49
- package/dist/hooks/useScrollableListBox.js +16 -37
- package/dist/hooks/useSorting.js +28 -69
- package/dist/hooks/useStateAndRef.js +7 -21
- package/dist/hooks/useTableColumnConfig.js +31 -124
- package/dist/hooks/useTranslationMemo.js +5 -25
- package/dist/index.d.ts +7 -16
- package/dist/index.js +6 -13
- package/dist/tw-ui-plugin.js +0 -6
- package/dist/utils/date-time.utils.d.ts +10 -38
- package/dist/utils/date-time.utils.js +22 -136
- package/package.json +1 -1
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -5
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -16
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -16
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -32
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -40
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -85
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -13
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -14
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -575
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -8
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -37
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -178
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -14
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -43
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -12
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -8
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -54
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -82
- package/dist/components/inputs/Skeleton/InputFrame.js +0 -548
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -8
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
- package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
- package/dist/hooks/useAutosave.spec.d.ts +0 -1
- package/dist/hooks/useFormAutosave.spec.d.ts +0 -1
- package/dist/hooks/useKeyInteractions.d.ts +0 -20
- package/dist/hooks/useKeyInteractions.js +0 -54
- package/dist/hooks/useKeyInteractions.spec.d.ts +0 -1
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -72
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -5,7 +5,6 @@ import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconBu
|
|
|
5
5
|
import { useBreakpoint } from "../../../../hooks/useBreakpoint.js";
|
|
6
6
|
import { getPlaceholder } from "./DateSegmentItem.js";
|
|
7
7
|
import { useLongPressRepeat } from "../../../../hooks/useLongPressRepeat.js";
|
|
8
|
-
import { c } from "react/compiler-runtime";
|
|
9
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import { clsx } from "clsx";
|
|
11
10
|
import { useEffect, useRef } from "react";
|
|
@@ -14,152 +13,67 @@ import { Time } from "@internationalized/date";
|
|
|
14
13
|
import { useTimeFieldState } from "@react-stately/datepicker";
|
|
15
14
|
//#region src/components/inputs/DateTime/shared/TimePickerForm.tsx
|
|
16
15
|
var INCREMENT_STEP_SIZE = 5;
|
|
17
|
-
var TimePickerForm = (
|
|
18
|
-
const $ = c(28);
|
|
19
|
-
const { state, datePickerState } = t0;
|
|
16
|
+
var TimePickerForm = ({ state, datePickerState }) => {
|
|
20
17
|
const isDesktop = useBreakpoint("md");
|
|
21
18
|
const { locale } = useLocale();
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const fieldState = useTimeFieldState({
|
|
20
|
+
locale,
|
|
21
|
+
defaultValue: datePickerState?.timeValue,
|
|
22
|
+
onChange: (value) => {
|
|
26
23
|
datePickerState?.setTimeValue(value ?? new Time(0, 0));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} else t2 = $[1];
|
|
31
|
-
let t3;
|
|
32
|
-
if ($[2] !== locale || $[3] !== t1 || $[4] !== t2) {
|
|
33
|
-
t3 = {
|
|
34
|
-
locale,
|
|
35
|
-
defaultValue: t1,
|
|
36
|
-
onChange: t2,
|
|
37
|
-
hideTimeZone: true
|
|
38
|
-
};
|
|
39
|
-
$[2] = locale;
|
|
40
|
-
$[3] = t1;
|
|
41
|
-
$[4] = t2;
|
|
42
|
-
$[5] = t3;
|
|
43
|
-
} else t3 = $[5];
|
|
44
|
-
const fieldState = useTimeFieldState(t3);
|
|
24
|
+
},
|
|
25
|
+
hideTimeZone: true
|
|
26
|
+
});
|
|
45
27
|
const ref = useRef(null);
|
|
46
28
|
const innerState = state ?? fieldState;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
state: innerState,
|
|
88
|
-
autoFocus: getAutoFocus(i_0)
|
|
89
|
-
}, i_0));
|
|
90
|
-
$[14] = getAutoFocus;
|
|
91
|
-
$[15] = innerState;
|
|
92
|
-
$[16] = t8;
|
|
93
|
-
} else t8 = $[16];
|
|
94
|
-
let t9;
|
|
95
|
-
if ($[17] !== fieldProps || $[18] !== t8) {
|
|
96
|
-
t9 = /* @__PURE__ */ jsx("div", {
|
|
97
|
-
ref,
|
|
98
|
-
...fieldProps,
|
|
99
|
-
className: "flex items-center justify-center gap-4 py-2",
|
|
100
|
-
children: t8
|
|
101
|
-
});
|
|
102
|
-
$[17] = fieldProps;
|
|
103
|
-
$[18] = t8;
|
|
104
|
-
$[19] = t9;
|
|
105
|
-
} else t9 = $[19];
|
|
106
|
-
let t10;
|
|
107
|
-
if ($[20] !== innerState) {
|
|
108
|
-
t10 = innerState.segments.map((segment_1, i_1) => /* @__PURE__ */ jsx(TimeSegmentButton, {
|
|
109
|
-
segment: segment_1,
|
|
110
|
-
state: innerState,
|
|
111
|
-
type: "decrement"
|
|
112
|
-
}, i_1));
|
|
113
|
-
$[20] = innerState;
|
|
114
|
-
$[21] = t10;
|
|
115
|
-
} else t10 = $[21];
|
|
116
|
-
let t11;
|
|
117
|
-
if ($[22] !== t10) {
|
|
118
|
-
t11 = /* @__PURE__ */ jsx("div", {
|
|
119
|
-
className: "flex items-center justify-center gap-4",
|
|
120
|
-
children: t10
|
|
121
|
-
});
|
|
122
|
-
$[22] = t10;
|
|
123
|
-
$[23] = t11;
|
|
124
|
-
} else t11 = $[23];
|
|
125
|
-
let t12;
|
|
126
|
-
if ($[24] !== t11 || $[25] !== t7 || $[26] !== t9) {
|
|
127
|
-
t12 = /* @__PURE__ */ jsxs("div", {
|
|
128
|
-
className: "w-full p-8",
|
|
129
|
-
children: [
|
|
130
|
-
t7,
|
|
131
|
-
t9,
|
|
132
|
-
t11
|
|
133
|
-
]
|
|
134
|
-
});
|
|
135
|
-
$[24] = t11;
|
|
136
|
-
$[25] = t7;
|
|
137
|
-
$[26] = t9;
|
|
138
|
-
$[27] = t12;
|
|
139
|
-
} else t12 = $[27];
|
|
140
|
-
return t12;
|
|
29
|
+
const { fieldProps } = useTimeField({ "aria-label": "Time Picker" }, innerState, ref);
|
|
30
|
+
const getAutoFocus = (index) => {
|
|
31
|
+
if (!isDesktop) return false;
|
|
32
|
+
return index === innerState.segments.findIndex(({ type }) => [
|
|
33
|
+
"hour",
|
|
34
|
+
"minute",
|
|
35
|
+
"dayPeriod"
|
|
36
|
+
].includes(type));
|
|
37
|
+
};
|
|
38
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
39
|
+
className: "w-full p-8",
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: "flex items-center justify-center gap-4",
|
|
43
|
+
children: innerState.segments.map((segment, i) => /* @__PURE__ */ jsx(TimeSegmentButton, {
|
|
44
|
+
segment,
|
|
45
|
+
state: innerState,
|
|
46
|
+
type: "increment"
|
|
47
|
+
}, i))
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ jsx("div", {
|
|
50
|
+
ref,
|
|
51
|
+
...fieldProps,
|
|
52
|
+
className: "flex items-center justify-center gap-4 py-2",
|
|
53
|
+
children: innerState.segments.map((segment, i) => /* @__PURE__ */ jsx(TimeSegmentInput, {
|
|
54
|
+
segment,
|
|
55
|
+
state: innerState,
|
|
56
|
+
autoFocus: getAutoFocus(i)
|
|
57
|
+
}, i))
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ jsx("div", {
|
|
60
|
+
className: "flex items-center justify-center gap-4",
|
|
61
|
+
children: innerState.segments.map((segment, i) => /* @__PURE__ */ jsx(TimeSegmentButton, {
|
|
62
|
+
segment,
|
|
63
|
+
state: innerState,
|
|
64
|
+
type: "decrement"
|
|
65
|
+
}, i))
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
});
|
|
141
69
|
};
|
|
142
|
-
var TimeSegmentInput = (
|
|
143
|
-
const $ = c(11);
|
|
144
|
-
const { segment, state, autoFocus } = t0;
|
|
70
|
+
var TimeSegmentInput = ({ segment, state, autoFocus }) => {
|
|
145
71
|
const ref = useRef(null);
|
|
146
72
|
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
147
73
|
const isDesktop = useBreakpoint("md");
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
t1 = () => {
|
|
152
|
-
if (autoFocus) ref.current?.focus();
|
|
153
|
-
};
|
|
154
|
-
t2 = [autoFocus];
|
|
155
|
-
$[0] = autoFocus;
|
|
156
|
-
$[1] = t1;
|
|
157
|
-
$[2] = t2;
|
|
158
|
-
} else {
|
|
159
|
-
t1 = $[1];
|
|
160
|
-
t2 = $[2];
|
|
161
|
-
}
|
|
162
|
-
useEffect(t1, t2);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
if (autoFocus) ref.current?.focus();
|
|
76
|
+
}, [autoFocus]);
|
|
163
77
|
if (![
|
|
164
78
|
"literal",
|
|
165
79
|
"hour",
|
|
@@ -168,101 +82,47 @@ var TimeSegmentInput = (t0) => {
|
|
|
168
82
|
].includes(segment.type)) return null;
|
|
169
83
|
if (segment.type === "literal") {
|
|
170
84
|
if (!showSegmentText(segment.text)) return null;
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
className: "text-text-default-2",
|
|
181
|
-
children: segment.text
|
|
182
|
-
})
|
|
183
|
-
});
|
|
184
|
-
$[3] = segment.text;
|
|
185
|
-
$[4] = t3;
|
|
186
|
-
} else t3 = $[4];
|
|
187
|
-
return t3;
|
|
188
|
-
}
|
|
189
|
-
const t3 = isDesktop && segmentProps;
|
|
190
|
-
let t4;
|
|
191
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
192
|
-
t4 = clsx("w-11 rounded-input-rounding-default bg-input-filled-idle py-input-height-extra-small text-center", "font-labels-default text-text-default-3", "border border-input-filled-idle border-solid", "hover:border-interactive-contained-primary-hover", "focus-within:border-interactive-contained-primary-idle focus-within:outline-none");
|
|
193
|
-
$[5] = t4;
|
|
194
|
-
} else t4 = $[5];
|
|
195
|
-
let t5;
|
|
196
|
-
if ($[6] !== segment) {
|
|
197
|
-
t5 = getPlaceholder(segment) ?? segment.text;
|
|
198
|
-
$[6] = segment;
|
|
199
|
-
$[7] = t5;
|
|
200
|
-
} else t5 = $[7];
|
|
201
|
-
let t6;
|
|
202
|
-
if ($[8] !== t3 || $[9] !== t5) {
|
|
203
|
-
t6 = /* @__PURE__ */ jsx("div", {
|
|
204
|
-
className: "flex flex-col items-center justify-center gap-2",
|
|
205
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
206
|
-
ref,
|
|
207
|
-
...t3,
|
|
208
|
-
className: t4,
|
|
209
|
-
children: t5
|
|
85
|
+
return /* @__PURE__ */ jsx("div", {
|
|
86
|
+
className: "flex flex-col text-center",
|
|
87
|
+
ref,
|
|
88
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
89
|
+
as: "span",
|
|
90
|
+
variant: "prominent-1",
|
|
91
|
+
size: "label-2",
|
|
92
|
+
className: "text-text-default-2",
|
|
93
|
+
children: segment.text
|
|
210
94
|
})
|
|
211
95
|
});
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
96
|
+
}
|
|
97
|
+
return /* @__PURE__ */ jsx("div", {
|
|
98
|
+
className: "flex flex-col items-center justify-center gap-2",
|
|
99
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
100
|
+
ref,
|
|
101
|
+
...isDesktop && segmentProps,
|
|
102
|
+
className: clsx("w-11 rounded-input-rounding-default bg-input-filled-idle py-input-height-extra-small text-center", "font-labels-default text-text-default-3", "border border-input-filled-idle border-solid", "hover:border-interactive-contained-primary-hover", "focus-within:border-interactive-contained-primary-idle focus-within:outline-none"),
|
|
103
|
+
children: getPlaceholder(segment) ?? segment.text
|
|
104
|
+
})
|
|
105
|
+
});
|
|
217
106
|
};
|
|
218
|
-
var TimeSegmentButton = (
|
|
219
|
-
const $ = c(15);
|
|
220
|
-
const { segment, state, type } = t0;
|
|
107
|
+
var TimeSegmentButton = ({ segment, state, type }) => {
|
|
221
108
|
const stateRef = useRef(state);
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
t3 = (isLongPress) => {
|
|
240
|
-
if (isLongPress && segment.type === "minute") {
|
|
241
|
-
const currentValue = stateRef.current.segments.find(_temp2)?.value ?? 0;
|
|
242
|
-
const diff = type === "increment" ? INCREMENT_STEP_SIZE : -INCREMENT_STEP_SIZE;
|
|
243
|
-
const normalizedValue = (Math.round((currentValue + diff) / INCREMENT_STEP_SIZE) * INCREMENT_STEP_SIZE % 60 + 60) % 60;
|
|
244
|
-
stateRef.current.setSegment(segment.type, normalizedValue);
|
|
245
|
-
} else stateRef.current[type](segment.type);
|
|
246
|
-
};
|
|
247
|
-
$[3] = segment.type;
|
|
248
|
-
$[4] = type;
|
|
249
|
-
$[5] = t3;
|
|
250
|
-
} else t3 = $[5];
|
|
251
|
-
const onPress = t3;
|
|
252
|
-
const t4 = segment.type !== "dayPeriod";
|
|
253
|
-
let t5;
|
|
254
|
-
if ($[6] !== onPress || $[7] !== t4) {
|
|
255
|
-
t5 = {
|
|
256
|
-
onPress,
|
|
257
|
-
enabled: t4,
|
|
258
|
-
timeout: 300,
|
|
259
|
-
interval: 300
|
|
260
|
-
};
|
|
261
|
-
$[6] = onPress;
|
|
262
|
-
$[7] = t4;
|
|
263
|
-
$[8] = t5;
|
|
264
|
-
} else t5 = $[8];
|
|
265
|
-
const { onPressStart, onPressEnd } = useLongPressRepeat(t5);
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
stateRef.current = state;
|
|
111
|
+
}, [state]);
|
|
112
|
+
const onPress = (isLongPress) => {
|
|
113
|
+
if (isLongPress && segment.type === "minute") {
|
|
114
|
+
const currentValue = stateRef.current.segments.find((item) => item.type === "minute")?.value ?? 0;
|
|
115
|
+
const diff = type === "increment" ? INCREMENT_STEP_SIZE : -INCREMENT_STEP_SIZE;
|
|
116
|
+
const normalizedValue = (Math.round((currentValue + diff) / INCREMENT_STEP_SIZE) * INCREMENT_STEP_SIZE % 60 + 60) % 60;
|
|
117
|
+
stateRef.current.setSegment(segment.type, normalizedValue);
|
|
118
|
+
} else stateRef.current[type](segment.type);
|
|
119
|
+
};
|
|
120
|
+
const { onPressStart, onPressEnd } = useLongPressRepeat({
|
|
121
|
+
onPress,
|
|
122
|
+
enabled: segment.type !== "dayPeriod",
|
|
123
|
+
timeout: 300,
|
|
124
|
+
interval: 300
|
|
125
|
+
});
|
|
266
126
|
if (![
|
|
267
127
|
"literal",
|
|
268
128
|
"hour",
|
|
@@ -271,59 +131,30 @@ var TimeSegmentButton = (t0) => {
|
|
|
271
131
|
].includes(segment.type)) return null;
|
|
272
132
|
if (segment.type === "literal") {
|
|
273
133
|
if (!showSegmentText(segment.text)) return null;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
"aria-hidden": true,
|
|
284
|
-
children: segment.text
|
|
285
|
-
})
|
|
286
|
-
});
|
|
287
|
-
$[9] = segment.text;
|
|
288
|
-
$[10] = t6;
|
|
289
|
-
} else t6 = $[10];
|
|
290
|
-
return t6;
|
|
291
|
-
}
|
|
292
|
-
const Icon = type === "increment" ? ChevronUpIcon : ChevronDownIcon;
|
|
293
|
-
let t6;
|
|
294
|
-
if ($[11] !== Icon || $[12] !== onPressEnd || $[13] !== onPressStart) {
|
|
295
|
-
t6 = /* @__PURE__ */ jsx("div", {
|
|
296
|
-
className: "flex w-11 select-none items-center justify-center",
|
|
297
|
-
onContextMenu: _temp3,
|
|
298
|
-
children: /* @__PURE__ */ jsx(InlineIconButton, {
|
|
299
|
-
label: "",
|
|
300
|
-
color: "secondary",
|
|
301
|
-
onPressStart,
|
|
302
|
-
onPressEnd,
|
|
303
|
-
icon: Icon
|
|
134
|
+
return /* @__PURE__ */ jsx("div", {
|
|
135
|
+
className: "flex shrink-0",
|
|
136
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
137
|
+
as: "span",
|
|
138
|
+
variant: "prominent-1",
|
|
139
|
+
size: "label-2",
|
|
140
|
+
className: "invisible text-text-default-2",
|
|
141
|
+
"aria-hidden": true,
|
|
142
|
+
children: segment.text
|
|
304
143
|
})
|
|
305
144
|
});
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
145
|
+
}
|
|
146
|
+
return /* @__PURE__ */ jsx("div", {
|
|
147
|
+
className: "flex w-11 select-none items-center justify-center",
|
|
148
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
149
|
+
children: /* @__PURE__ */ jsx(InlineIconButton, {
|
|
150
|
+
label: "",
|
|
151
|
+
color: "secondary",
|
|
152
|
+
onPressStart,
|
|
153
|
+
onPressEnd,
|
|
154
|
+
icon: type === "increment" ? ChevronUpIcon : ChevronDownIcon
|
|
155
|
+
})
|
|
156
|
+
});
|
|
312
157
|
};
|
|
313
158
|
var showSegmentText = (text) => !/[\u2066\u2069]/.test(text);
|
|
314
|
-
function _temp(t0) {
|
|
315
|
-
const { type } = t0;
|
|
316
|
-
return [
|
|
317
|
-
"hour",
|
|
318
|
-
"minute",
|
|
319
|
-
"dayPeriod"
|
|
320
|
-
].includes(type);
|
|
321
|
-
}
|
|
322
|
-
function _temp2(item) {
|
|
323
|
-
return item.type === "minute";
|
|
324
|
-
}
|
|
325
|
-
function _temp3(e) {
|
|
326
|
-
return e.preventDefault();
|
|
327
|
-
}
|
|
328
159
|
//#endregion
|
|
329
160
|
export { TimePickerForm };
|
|
@@ -9,7 +9,6 @@ interface DatePickerInputProps extends InputVariantProps {
|
|
|
9
9
|
state: TimeFieldState;
|
|
10
10
|
isDisabled?: boolean;
|
|
11
11
|
isDirty?: boolean;
|
|
12
|
-
isRequired?: boolean;
|
|
13
12
|
isInvalid?: boolean;
|
|
14
13
|
disableDropdown?: boolean;
|
|
15
14
|
headerProps?: FormFieldHeaderProps;
|
|
@@ -18,8 +17,6 @@ interface DatePickerInputProps extends InputVariantProps {
|
|
|
18
17
|
placeholder?: string;
|
|
19
18
|
className?: string;
|
|
20
19
|
onPress: () => void;
|
|
21
|
-
onClear?: () => void;
|
|
22
|
-
fireBlurOnChange?: boolean;
|
|
23
20
|
}
|
|
24
|
-
export declare const TimePickerInput: ({ ref, as, fieldProps, state, isDisabled, isDirty,
|
|
21
|
+
export declare const TimePickerInput: ({ ref, as, fieldProps, state, isDisabled, isDirty, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, ...props }: DatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
22
|
export {};
|