@povio/ui 2.1.14 → 2.1.15
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 +74 -0
- package/dist/AclGuard.js +12 -0
- package/dist/ActionModal.js +51 -0
- package/dist/Alert.js +46 -0
- package/dist/AlignCenter.js +13 -0
- package/dist/AlignLeft.js +13 -0
- package/dist/AlignLeftRight.js +13 -0
- package/dist/AlignRight.js +13 -0
- package/dist/ArrowDropDown.js +13 -0
- package/dist/ArrowDropUp.js +13 -0
- package/dist/ArrowLeft.js +13 -0
- package/dist/ArrowRight.js +13 -0
- package/dist/AuthGuard.js +22 -0
- package/dist/Autocomplete.js +28 -0
- package/dist/Bold.js +13 -0
- package/dist/BottomSheet.js +191 -0
- package/dist/BulletedList.js +13 -0
- package/dist/Button.js +54 -0
- package/dist/ButtonContent.js +28 -0
- package/dist/Calendar.js +15 -0
- package/dist/Calendar2.js +54 -0
- package/dist/CalendarCell.js +130 -0
- package/dist/CalendarGrid.js +50 -0
- package/dist/CalendarHeader.js +75 -0
- package/dist/CalendarSelectHeader.js +170 -0
- package/dist/Can.js +13 -0
- package/dist/CellText.js +13 -0
- package/dist/Check.js +15 -0
- package/dist/CheckCircle.js +13 -0
- package/dist/CheckContent.js +16 -0
- package/dist/Checkbox.js +61 -0
- package/dist/CheckboxCheckmark.js +16 -0
- package/dist/CheckboxCheckmark2.js +25 -0
- package/dist/CheckboxIndeterminate.js +16 -0
- package/dist/ChevronDown.js +15 -0
- package/dist/ChevronLeft.js +15 -0
- package/dist/ChevronRight.js +15 -0
- package/dist/ChevronUp.js +15 -0
- package/dist/ChevronsLeft.js +15 -0
- package/dist/ChevronsRight.js +15 -0
- package/dist/Clock.js +13 -0
- package/dist/Close.js +13 -0
- package/dist/ColorPicker.js +16 -0
- package/dist/ColorPickerDropdown.js +51 -0
- package/dist/ColumnConfig.js +81 -0
- package/dist/DateField.js +89 -0
- package/dist/DatePicker.js +191 -0
- package/dist/DatePickerInput.js +158 -0
- package/dist/DateRangePicker.js +601 -0
- package/dist/DateSegmentItem.js +29 -0
- package/dist/DateTime.js +18 -0
- package/dist/DateTimeDialog.js +49 -0
- package/dist/DateTimeDialogFooter.js +25 -0
- package/dist/DateTimePicker.js +200 -0
- package/dist/Drag.js +13 -0
- package/dist/Drawer.js +43 -0
- package/dist/File.js +15 -0
- package/dist/FileCard.js +50 -0
- package/dist/FileCardList.js +17 -0
- package/dist/FileUpload.js +189 -0
- package/dist/FileUploadContainer.js +12 -0
- package/dist/FileUploadContent.js +61 -0
- package/dist/FileUploadContentEmpty.js +54 -0
- package/dist/FileUploadContentError.js +109 -0
- package/dist/FileUploadContentFilled.js +112 -0
- package/dist/FileUploadContentLoading.js +76 -0
- package/dist/Form.js +42 -0
- package/dist/FormField.js +35 -0
- package/dist/FormFieldError.js +11 -0
- package/dist/FormFieldHeader.js +36 -0
- package/dist/FormFieldHeaderClose.js +15 -0
- package/dist/FormFieldLabel.js +32 -0
- package/dist/HeaderText.js +10 -0
- package/dist/Highlight.js +13 -0
- package/dist/HighlightOn.js +19 -0
- package/dist/HyperlinkAction.js +70 -0
- package/dist/IconButton.js +12 -0
- package/dist/InfiniteTable.js +31 -0
- package/dist/Info.js +18 -0
- package/dist/InlineIconButton.js +13 -0
- package/dist/InputClear.js +19 -0
- package/dist/InputContent.js +94 -0
- package/dist/InputItem.js +54 -0
- package/dist/InputUpload.js +111 -0
- package/dist/InputUploadContent.js +52 -0
- package/dist/InputUploadFilled.js +26 -0
- package/dist/Inputs.js +15 -0
- package/dist/Italic.js +13 -0
- package/dist/Link.js +13 -0
- package/dist/Link2.js +19 -0
- package/dist/Loader.js +32 -0
- package/dist/Menu.js +13 -0
- package/dist/Menu2.js +9 -0
- package/dist/MenuDesktop.js +53 -0
- package/dist/MenuItem.js +21 -0
- package/dist/MenuMobile.js +64 -0
- package/dist/MenuPopover.js +30 -0
- package/dist/Modal.js +49 -0
- package/dist/MonthPicker.js +56 -0
- package/dist/NumberInput.js +132 -0
- package/dist/NumberedList.js +13 -0
- package/dist/PaginatedTable.js +26 -0
- package/dist/Pagination.js +43 -0
- package/dist/PaginationList.js +105 -0
- package/dist/PasswordInput.js +21 -0
- package/dist/PillButton.js +37 -0
- package/dist/PointerHorizontal.js +13 -0
- package/dist/PointerVertical.js +13 -0
- package/dist/ProgressBar.js +25 -0
- package/dist/QueryAutocomplete.js +18 -0
- package/dist/RadioGroup.js +81 -0
- package/dist/RangeCalendar.js +96 -0
- package/dist/ResponsivePopover.js +41 -0
- package/dist/Segment.js +82 -0
- package/dist/SegmentItem.js +23 -0
- package/dist/Select.js +24 -0
- package/dist/SelectBase.js +28 -0
- package/dist/SelectDesktop.js +147 -0
- package/dist/SelectInput.js +159 -0
- package/dist/SelectInputTags.js +29 -0
- package/dist/SelectListBox.js +73 -0
- package/dist/SelectListBoxItem.js +48 -0
- package/dist/SelectListBoxItemSelectAll.js +31 -0
- package/dist/SelectListBoxLoadingItem.js +41 -0
- package/dist/SelectListBoxSelectionBar.js +25 -0
- package/dist/SelectMobile.js +111 -0
- package/dist/Send.js +15 -0
- package/dist/Slider.js +93 -0
- package/dist/SplitButton.js +36 -0
- package/dist/Strikethrough.js +13 -0
- package/dist/Table.js +248 -0
- package/dist/Tag.js +42 -0
- package/dist/TextAlignSelect.js +44 -0
- package/dist/TextArea.js +120 -0
- package/dist/TextButton.js +13 -0
- package/dist/TextColor.js +16 -0
- package/dist/TextColorSelect.js +22 -0
- package/dist/TextEditor.js +143 -0
- package/dist/TextEditorToolbar.js +30 -0
- package/dist/TextHighlightSelect.js +24 -0
- package/dist/TextInput.js +125 -0
- package/dist/TextListActions.js +42 -0
- package/dist/TextMarksActions.js +67 -0
- package/dist/TextStyleSelect.js +52 -0
- package/dist/TimeField.js +17 -0
- package/dist/TimePicker.js +158 -0
- package/dist/TimePickerForm.js +158 -0
- package/dist/TimePickerInput.js +92 -0
- package/dist/Toast.js +58 -0
- package/dist/Today.js +13 -0
- package/dist/Toggle.js +60 -0
- package/dist/ToggleButton.js +13 -0
- package/dist/Tooltip.js +49 -0
- package/dist/TooltipEllipsis.js +18 -0
- package/dist/TooltipWrapper.js +19 -0
- package/dist/Typography.js +14 -0
- package/dist/Underlined.js +15 -0
- package/dist/Upload.js +16 -0
- package/dist/View.js +13 -0
- package/dist/ViewOff.js +13 -0
- package/dist/WarningFilled.js +15 -0
- package/dist/YearPicker.js +64 -0
- package/dist/ability.context.js +35 -0
- package/dist/alert.cva.js +62 -0
- package/dist/array.utils.js +8 -0
- package/dist/auth.context.js +37 -0
- package/dist/auth.js +6 -12
- package/dist/button.cva.js +656 -0
- package/dist/buttonContent.cva.js +10 -0
- package/dist/checkbox.cva.js +47 -0
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.d.ts +2 -2
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +5 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +3 -1
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +8 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -0
- package/dist/components/inputs/FormField/FormField.d.ts +4 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +4 -2
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -0
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -1
- package/dist/components/inputs/Input/shared/InputContent.d.ts +4 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -0
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.d.ts +2 -0
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/compoundMapper.js +11 -0
- package/dist/config/uiStyle.context.d.ts +2 -1
- package/dist/confirmation.context.js +78 -0
- package/dist/date-time.utils.js +50 -0
- package/dist/date.utils.js +17 -0
- package/dist/dom.utils.js +17 -0
- package/dist/dynamicColumns.js +272 -0
- package/dist/dynamicInputs.js +186 -0
- package/dist/error-handling.js +87 -0
- package/dist/file.utils.js +43 -0
- package/dist/fileUpload.cva.js +49 -0
- package/dist/i18n.js +8 -0
- package/dist/index.js +136 -278
- package/dist/input.cva.js +210 -0
- package/dist/inputUploadButton.cva.js +27 -0
- package/dist/isEqual.js +57 -0
- package/dist/label.cva.js +104 -0
- package/dist/link.context.js +17 -0
- package/dist/link.cva.js +7 -0
- package/dist/loader.cva.js +16 -0
- package/dist/logger.js +17 -0
- package/dist/menu.cva.js +27 -0
- package/dist/minWidth.cva.js +9 -0
- package/dist/modal.cva.js +31 -0
- package/dist/object.utils.js +36 -0
- package/dist/outline.clsx.js +4 -0
- package/dist/pillButton.cva.js +254 -0
- package/dist/queries.utils.js +7 -0
- package/dist/radio.cva.js +42 -0
- package/dist/react.js +6 -0
- package/dist/rest-interceptor.js +22 -0
- package/dist/rest.utils.js +31 -0
- package/dist/rolldown_runtime.js +16 -0
- package/dist/router.context.js +37 -0
- package/dist/routing.utils.js +9 -0
- package/dist/segment.cva.js +25 -0
- package/dist/select.context.js +190 -0
- package/dist/status.cva.js +57 -0
- package/dist/string.utils.js +10 -0
- package/dist/table.cva.js +35 -0
- package/dist/tag.cva.js +50 -0
- package/dist/text-editor.js +2 -4
- package/dist/textEditor.types.js +38 -0
- package/dist/theme.context.js +65 -0
- package/dist/toast.cva.js +158 -0
- package/dist/toggle.cva.js +27 -0
- package/dist/tooltip.cva.js +30 -0
- package/dist/translation.js +147 -0
- package/dist/translation2.js +145 -0
- package/dist/typography.cva.js +124 -0
- package/dist/uiConfig.context.js +58 -0
- package/dist/uiStyle.context.js +16 -0
- package/dist/useAutosave.js +62 -0
- package/dist/useBreakpoint.js +28 -0
- package/dist/useDebounceCallback.js +23 -0
- package/dist/useDeepCompare.js +21 -0
- package/dist/useFilters.js +121 -0
- package/dist/useForm.js +12 -0
- package/dist/useFormAutosave.js +52 -0
- package/dist/useIntersectionObserver.js +23 -0
- package/dist/useLocalStorage.js +35 -0
- package/dist/useLongPressRepeat.js +27 -0
- package/dist/usePagination.js +26 -0
- package/dist/useScrollableListBox.js +24 -0
- package/dist/useSelectItems.js +82 -0
- package/dist/useSorting.js +34 -0
- package/dist/useStateAndRef.js +15 -0
- package/dist/useTableColumnConfig.js +38 -0
- package/dist/useTableNav.js +279 -0
- package/dist/useToast.js +63 -0
- package/dist/useTranslationMemo.js +10 -0
- package/dist/zod.utils.js +17 -0
- package/package.json +14 -14
- package/dist/assets/icons/AlignCenter.js +0 -21
- package/dist/assets/icons/AlignLeft.js +0 -21
- package/dist/assets/icons/AlignLeftRight.js +0 -21
- package/dist/assets/icons/AlignRight.js +0 -21
- package/dist/assets/icons/ArrowDropDown.js +0 -21
- package/dist/assets/icons/ArrowDropUp.js +0 -21
- package/dist/assets/icons/ArrowLeft.js +0 -21
- package/dist/assets/icons/ArrowRight.js +0 -21
- package/dist/assets/icons/Bold.js +0 -21
- package/dist/assets/icons/BulletedList.js +0 -21
- package/dist/assets/icons/Calendar.js +0 -23
- package/dist/assets/icons/Check.js +0 -23
- package/dist/assets/icons/CheckCircle.js +0 -21
- package/dist/assets/icons/CheckboxCheckmark.js +0 -24
- package/dist/assets/icons/CheckboxIndeterminate.js +0 -24
- package/dist/assets/icons/ChevronDown.js +0 -23
- package/dist/assets/icons/ChevronLeft.js +0 -23
- package/dist/assets/icons/ChevronRight.js +0 -23
- package/dist/assets/icons/ChevronUp.js +0 -23
- package/dist/assets/icons/ChevronsLeft.js +0 -23
- package/dist/assets/icons/ChevronsRight.js +0 -23
- package/dist/assets/icons/Clock.js +0 -21
- package/dist/assets/icons/Close.js +0 -21
- package/dist/assets/icons/DateTime.js +0 -32
- package/dist/assets/icons/Drag.js +0 -21
- package/dist/assets/icons/File.js +0 -23
- package/dist/assets/icons/Highlight.js +0 -21
- package/dist/assets/icons/HighlightOn.js +0 -30
- package/dist/assets/icons/Info.js +0 -32
- package/dist/assets/icons/Italic.js +0 -21
- package/dist/assets/icons/Link.js +0 -21
- package/dist/assets/icons/Menu.js +0 -21
- package/dist/assets/icons/NumberedList.js +0 -21
- package/dist/assets/icons/PointerHorizontal.js +0 -21
- package/dist/assets/icons/PointerVertical.js +0 -21
- package/dist/assets/icons/Send.js +0 -23
- package/dist/assets/icons/Strikethrough.js +0 -21
- package/dist/assets/icons/TextColor.js +0 -30
- package/dist/assets/icons/Today.js +0 -21
- package/dist/assets/icons/Underlined.js +0 -23
- package/dist/assets/icons/Upload.js +0 -30
- package/dist/assets/icons/View.js +0 -18
- package/dist/assets/icons/ViewOff.js +0 -18
- package/dist/assets/icons/WarningFilled.js +0 -23
- package/dist/assets/locales/en/translation.json.js +0 -14
- package/dist/assets/locales/sl/translation.json.js +0 -14
- package/dist/components/Menu/Menu.js +0 -14
- package/dist/components/Menu/MenuDesktop.js +0 -74
- package/dist/components/Menu/MenuItem.js +0 -27
- package/dist/components/Menu/MenuMobile.js +0 -83
- package/dist/components/Menu/MenuPopover.js +0 -43
- package/dist/components/Menu/menu.cva.js +0 -45
- package/dist/components/buttons/Button/Button.js +0 -73
- package/dist/components/buttons/Button/button.cva.js +0 -666
- package/dist/components/buttons/IconButton/IconButton.js +0 -17
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +0 -18
- package/dist/components/buttons/PillButton/PillButton.js +0 -44
- package/dist/components/buttons/PillButton/pillButton.cva.js +0 -268
- package/dist/components/buttons/SplitButton/SplitButton.js +0 -65
- package/dist/components/buttons/TextButton/TextButton.js +0 -18
- package/dist/components/buttons/ToggleButton/ToggleButton.js +0 -21
- package/dist/components/buttons/shared/ButtonContent.js +0 -53
- package/dist/components/buttons/shared/buttonContent.cva.js +0 -16
- package/dist/components/inputs/Checkbox/Checkbox.js +0 -81
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +0 -32
- package/dist/components/inputs/Checkbox/checkbox.cva.js +0 -51
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +0 -251
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +0 -689
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +0 -265
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +0 -217
- package/dist/components/inputs/DateTime/shared/Calendar.js +0 -85
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +0 -160
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +0 -67
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +0 -89
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +0 -203
- package/dist/components/inputs/DateTime/shared/DateField.js +0 -77
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +0 -206
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +0 -55
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +0 -76
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +0 -47
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +0 -82
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +0 -133
- package/dist/components/inputs/DateTime/shared/TimeField.js +0 -26
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +0 -186
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +0 -125
- package/dist/components/inputs/DateTime/shared/YearPicker.js +0 -89
- package/dist/components/inputs/File/FileUpload.js +0 -257
- package/dist/components/inputs/File/FileUploadContainer.js +0 -17
- package/dist/components/inputs/File/InputUpload.js +0 -174
- package/dist/components/inputs/File/shared/FileCard.js +0 -67
- package/dist/components/inputs/File/shared/FileCardList.js +0 -20
- package/dist/components/inputs/File/shared/FileUploadContent.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentError.js +0 -167
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +0 -173
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +0 -128
- package/dist/components/inputs/File/shared/InputUploadContent.js +0 -73
- package/dist/components/inputs/File/shared/InputUploadFilled.js +0 -45
- package/dist/components/inputs/File/shared/ProgressBar.js +0 -42
- package/dist/components/inputs/File/shared/fileUpload.cva.js +0 -58
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +0 -49
- package/dist/components/inputs/FormField/FormField.js +0 -54
- package/dist/components/inputs/FormField/FormFieldError.js +0 -16
- package/dist/components/inputs/FormField/FormFieldHeader.js +0 -57
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +0 -20
- package/dist/components/inputs/FormField/FormFieldLabel.js +0 -37
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +0 -166
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +0 -26
- package/dist/components/inputs/Input/TextArea/TextArea.js +0 -155
- package/dist/components/inputs/Input/TextInput/TextInput.js +0 -162
- package/dist/components/inputs/Input/shared/InputContent.js +0 -114
- package/dist/components/inputs/Inputs/Form.js +0 -68
- package/dist/components/inputs/Inputs/InputItem.js +0 -61
- package/dist/components/inputs/Inputs/Inputs.js +0 -32
- package/dist/components/inputs/RadioGroup/RadioGroup.js +0 -103
- package/dist/components/inputs/RadioGroup/radio.cva.js +0 -57
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +0 -39
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +0 -25
- package/dist/components/inputs/Selection/Select/Select.js +0 -32
- package/dist/components/inputs/Selection/shared/SelectBase.js +0 -27
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +0 -223
- package/dist/components/inputs/Selection/shared/SelectInput.js +0 -234
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +0 -49
- package/dist/components/inputs/Selection/shared/SelectListBox.js +0 -127
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +0 -78
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +0 -45
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +0 -47
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +0 -42
- package/dist/components/inputs/Selection/shared/SelectMobile.js +0 -165
- package/dist/components/inputs/Selection/shared/select.context.js +0 -244
- package/dist/components/inputs/Selection/shared/useSelectItems.js +0 -94
- package/dist/components/inputs/Slider/Slider.js +0 -137
- package/dist/components/inputs/TextEditor/TextEditor.js +0 -223
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +0 -34
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +0 -80
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +0 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +0 -56
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +0 -33
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +0 -31
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +0 -37
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +0 -51
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +0 -73
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +0 -61
- package/dist/components/inputs/TextEditor/textEditor.types.js +0 -40
- package/dist/components/inputs/Toggle/Toggle.js +0 -65
- package/dist/components/inputs/Toggle/toggle.cva.js +0 -44
- package/dist/components/inputs/shared/CheckContent.js +0 -22
- package/dist/components/inputs/shared/InputClear.js +0 -27
- package/dist/components/inputs/shared/TooltipWrapper.js +0 -23
- package/dist/components/inputs/shared/input.cva.js +0 -174
- package/dist/components/inputs/shared/label.cva.js +0 -128
- package/dist/components/outline.clsx.js +0 -11
- package/dist/components/overlays/ActionModal/ActionModal.js +0 -80
- package/dist/components/overlays/BottomSheet/BottomSheet.js +0 -261
- package/dist/components/overlays/Drawer/Drawer.js +0 -84
- package/dist/components/overlays/Modal/Modal.js +0 -64
- package/dist/components/overlays/Modal/modal.cva.js +0 -53
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +0 -71
- package/dist/components/overlays/Tooltip/Tooltip.js +0 -92
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +0 -27
- package/dist/components/overlays/Tooltip/tooltip.cva.js +0 -60
- package/dist/components/segment/Segment.js +0 -118
- package/dist/components/segment/SegmentItem.js +0 -35
- package/dist/components/segment/segment.cva.js +0 -35
- package/dist/components/shared/pagination/Pagination.js +0 -75
- package/dist/components/shared/pagination/PaginationList.js +0 -145
- package/dist/components/shared/pagination/minWidth.cva.js +0 -15
- package/dist/components/status/Alert/Alert.js +0 -41
- package/dist/components/status/Alert/alert.cva.js +0 -64
- package/dist/components/status/Loader/Loader.js +0 -37
- package/dist/components/status/Loader/loader.cva.js +0 -27
- package/dist/components/status/Toast/Toast.js +0 -65
- package/dist/components/status/Toast/toast.cva.js +0 -150
- package/dist/components/status/Toast/useToast.js +0 -94
- package/dist/components/status/shared/status.cva.js +0 -62
- package/dist/components/table/CellText.js +0 -18
- package/dist/components/table/ColumnConfig.js +0 -124
- package/dist/components/table/HeaderText.js +0 -15
- package/dist/components/table/InfiniteTable.js +0 -40
- package/dist/components/table/PaginatedTable.js +0 -33
- package/dist/components/table/Table.js +0 -370
- package/dist/components/table/table.cva.js +0 -63
- package/dist/components/text/Link/Link.js +0 -24
- package/dist/components/text/Link/link.cva.js +0 -18
- package/dist/components/text/Tag/Tag.js +0 -49
- package/dist/components/text/Tag/tag.cva.js +0 -59
- package/dist/components/text/Typography/Typography.js +0 -22
- package/dist/components/text/Typography/typography.cva.js +0 -100
- package/dist/config/confirmation.context.js +0 -107
- package/dist/config/i18n.js +0 -15
- package/dist/config/link.context.js +0 -19
- package/dist/config/router.context.js +0 -39
- package/dist/config/theme.context.js +0 -73
- package/dist/config/uiConfig.context.js +0 -69
- package/dist/config/uiStyle.context.js +0 -16
- package/dist/helpers/dynamicColumns.js +0 -359
- package/dist/helpers/dynamicInputs.js +0 -212
- package/dist/hooks/useAutosave.js +0 -83
- package/dist/hooks/useBreakpoint.js +0 -33
- package/dist/hooks/useDebounceCallback.js +0 -29
- package/dist/hooks/useDeepCompare.js +0 -25
- package/dist/hooks/useFilters.js +0 -160
- package/dist/hooks/useForm.js +0 -22
- package/dist/hooks/useFormAutosave.js +0 -67
- package/dist/hooks/useIntersectionObserver.js +0 -27
- package/dist/hooks/useLocalStorage.js +0 -54
- package/dist/hooks/useLongPressRepeat.js +0 -33
- package/dist/hooks/usePagination.js +0 -35
- package/dist/hooks/useScrollableListBox.js +0 -30
- package/dist/hooks/useSorting.js +0 -32
- package/dist/hooks/useStateAndRef.js +0 -17
- package/dist/hooks/useTableColumnConfig.js +0 -63
- package/dist/hooks/useTableNav.js +0 -394
- package/dist/hooks/useTranslationMemo.js +0 -14
- package/dist/utils/array.utils.js +0 -12
- package/dist/utils/compoundMapper.js +0 -14
- package/dist/utils/date-time.utils.js +0 -77
- package/dist/utils/date.utils.js +0 -23
- package/dist/utils/dom.utils.js +0 -13
- package/dist/utils/file.utils.js +0 -63
- package/dist/utils/isEqual.js +0 -95
- package/dist/utils/logger.js +0 -19
- package/dist/utils/object.utils.js +0 -53
- package/dist/utils/queries.utils.js +0 -9
- package/dist/utils/rest.utils.js +0 -51
- package/dist/utils/routing.utils.js +0 -15
- package/dist/utils/string.utils.js +0 -12
- package/dist/utils/vendor/acl/AclGuard.js +0 -14
- package/dist/utils/vendor/acl/Can.js +0 -18
- package/dist/utils/vendor/acl/ability.context.js +0 -37
- package/dist/utils/vendor/auth/AuthGuard.js +0 -26
- package/dist/utils/vendor/auth/auth.context.js +0 -41
- package/dist/utils/vendor/error-handling.js +0 -119
- package/dist/utils/vendor/rest-interceptor.js +0 -21
- package/dist/utils/zod.utils.js +0 -21
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HighlightIcon } from "./Highlight.js";
|
|
2
|
+
import { HighlightOnIcon } from "./HighlightOn.js";
|
|
3
|
+
import { ColorPickerDropdown } from "./ColorPickerDropdown.js";
|
|
4
|
+
import { defaultColors } from "./textEditor.types.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
const TextHighlightSelect = ({ editor }) => {
|
|
7
|
+
if (!editor.extensionManager.extensions.some((extension) => extension.name === "highlight")) return null;
|
|
8
|
+
const onChange = (color) => {
|
|
9
|
+
if (color === "#FFFFFF") editor.chain().focus().unsetHighlight().run();
|
|
10
|
+
else editor.chain().focus().setHighlight({ color }).run();
|
|
11
|
+
};
|
|
12
|
+
const highlightColor = editor.getAttributes("highlight").color || "#FFFFFF";
|
|
13
|
+
return /* @__PURE__ */ jsx(ColorPickerDropdown, {
|
|
14
|
+
value: highlightColor,
|
|
15
|
+
onChange,
|
|
16
|
+
colors: defaultColors,
|
|
17
|
+
isDisabled: !editor.isEditable,
|
|
18
|
+
children: highlightColor ? /* @__PURE__ */ jsx(HighlightOnIcon, {
|
|
19
|
+
className: "size-6",
|
|
20
|
+
highlightColor
|
|
21
|
+
}) : /* @__PURE__ */ jsx(HighlightIcon, { className: "size-6" })
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
export { TextHighlightSelect };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
2
|
+
import { useInputCva } from "./input.cva.js";
|
|
3
|
+
import { FormField } from "./FormField.js";
|
|
4
|
+
import { TooltipWrapper } from "./TooltipWrapper.js";
|
|
5
|
+
import { InputContent } from "./InputContent.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import { clsx } from "clsx";
|
|
8
|
+
import { Input } from "react-aria-components";
|
|
9
|
+
import { useRef } from "react";
|
|
10
|
+
import { useFocusVisible, useTextField } from "react-aria";
|
|
11
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
12
|
+
import { Controller } from "react-hook-form";
|
|
13
|
+
var TextInputBase = (props) => {
|
|
14
|
+
const ui = UIConfig.useConfig();
|
|
15
|
+
const inputCva = useInputCva();
|
|
16
|
+
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable,...rest } = props;
|
|
17
|
+
const textFieldRef = useRef(null);
|
|
18
|
+
const { isFocusVisible } = useFocusVisible();
|
|
19
|
+
const { labelProps, inputProps } = useTextField({
|
|
20
|
+
...rest,
|
|
21
|
+
label,
|
|
22
|
+
isDisabled,
|
|
23
|
+
isInvalid: !!error,
|
|
24
|
+
isRequired,
|
|
25
|
+
value,
|
|
26
|
+
onChange,
|
|
27
|
+
onBlur
|
|
28
|
+
}, textFieldRef);
|
|
29
|
+
const formFieldProps = {
|
|
30
|
+
error,
|
|
31
|
+
label,
|
|
32
|
+
tooltipText,
|
|
33
|
+
helperText,
|
|
34
|
+
isRequired,
|
|
35
|
+
rightContent,
|
|
36
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
37
|
+
hideLabel,
|
|
38
|
+
isDisabled,
|
|
39
|
+
headerClassName,
|
|
40
|
+
errorClassName
|
|
41
|
+
};
|
|
42
|
+
const inputContentProps = {
|
|
43
|
+
unit,
|
|
44
|
+
isLoading,
|
|
45
|
+
isDisabled,
|
|
46
|
+
action,
|
|
47
|
+
leadingIcon,
|
|
48
|
+
trailingIcon,
|
|
49
|
+
isClearable,
|
|
50
|
+
value,
|
|
51
|
+
onChange,
|
|
52
|
+
onBlur
|
|
53
|
+
};
|
|
54
|
+
const headerProps = {
|
|
55
|
+
label,
|
|
56
|
+
tooltipText,
|
|
57
|
+
helperText,
|
|
58
|
+
isRequired,
|
|
59
|
+
rightContent,
|
|
60
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
61
|
+
isDisabled,
|
|
62
|
+
className: headerClassName,
|
|
63
|
+
labelProps
|
|
64
|
+
};
|
|
65
|
+
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
66
|
+
as,
|
|
67
|
+
error,
|
|
68
|
+
triggerTabIndex: as === "inline" ? -1 : void 0,
|
|
69
|
+
children: /* @__PURE__ */ jsx(FormField, {
|
|
70
|
+
...formFieldProps,
|
|
71
|
+
as,
|
|
72
|
+
labelProps,
|
|
73
|
+
className: clsx("group w-full", { "h-full": as === "inline" }, className),
|
|
74
|
+
tabIndex: as === "inline" ? -1 : void 0,
|
|
75
|
+
children: /* @__PURE__ */ jsx(InputContent, {
|
|
76
|
+
...inputContentProps,
|
|
77
|
+
headerProps,
|
|
78
|
+
as,
|
|
79
|
+
size,
|
|
80
|
+
children: (style) => /* @__PURE__ */ jsx(Input, {
|
|
81
|
+
...inputProps,
|
|
82
|
+
ref,
|
|
83
|
+
"data-is-empty": value === "" || value === null || value === void 0 || void 0,
|
|
84
|
+
"data-is-dirty": isDirty || void 0,
|
|
85
|
+
"data-is-required": isRequired || void 0,
|
|
86
|
+
"data-is-disabled": isDisabled || void 0,
|
|
87
|
+
placeholder: as === "floating" ? "" : inputProps.placeholder,
|
|
88
|
+
className: inputCva({
|
|
89
|
+
variant,
|
|
90
|
+
as,
|
|
91
|
+
size,
|
|
92
|
+
...rest,
|
|
93
|
+
className: inputClassName
|
|
94
|
+
}),
|
|
95
|
+
style,
|
|
96
|
+
onFocus: (e) => {
|
|
97
|
+
inputProps.onFocus?.(e);
|
|
98
|
+
if (isFocusVisible) e.target.select();
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
const TextInput = (props) => {
|
|
106
|
+
if ("formControl" in props && props.formControl) {
|
|
107
|
+
const { formControl, ref,...innerProps } = props;
|
|
108
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
109
|
+
control: formControl.control,
|
|
110
|
+
name: formControl.name,
|
|
111
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(TextInputBase, {
|
|
112
|
+
...innerProps,
|
|
113
|
+
ref: mergeRefs(ref, field.ref),
|
|
114
|
+
value: field.value,
|
|
115
|
+
onChange: field.onChange,
|
|
116
|
+
onBlur: field.onBlur,
|
|
117
|
+
isDirty,
|
|
118
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
119
|
+
error: props.error ?? error?.message
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return /* @__PURE__ */ jsx(TextInputBase, { ...props });
|
|
124
|
+
};
|
|
125
|
+
export { TextInput };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BulletedListIcon } from "./BulletedList.js";
|
|
2
|
+
import { NumberedListIcon } from "./NumberedList.js";
|
|
3
|
+
import { InlineIconButton } from "./InlineIconButton.js";
|
|
4
|
+
import { ns } from "./i18n.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { clsx } from "clsx";
|
|
7
|
+
import { useTranslation } from "react-i18next";
|
|
8
|
+
const TextListActions = ({ editor }) => {
|
|
9
|
+
const { t } = useTranslation("ui");
|
|
10
|
+
const enabledActions = [{
|
|
11
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "bulletList"),
|
|
12
|
+
isEnabled: () => editor.isEditable && editor.can().toggleBulletList(),
|
|
13
|
+
label: t(($) => $.ui.textEditor.marks.bold),
|
|
14
|
+
icon: BulletedListIcon,
|
|
15
|
+
onPress: () => {
|
|
16
|
+
editor.chain().focus().toggleBulletList().run();
|
|
17
|
+
},
|
|
18
|
+
isActive: () => editor.isActive("bulletList")
|
|
19
|
+
}, {
|
|
20
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "orderedList"),
|
|
21
|
+
isEnabled: () => editor.isEditable && editor.can().toggleOrderedList(),
|
|
22
|
+
label: t(($) => $.ui.textEditor.marks.italic),
|
|
23
|
+
icon: NumberedListIcon,
|
|
24
|
+
onPress: () => {
|
|
25
|
+
editor.chain().focus().toggleOrderedList().run();
|
|
26
|
+
},
|
|
27
|
+
isActive: () => editor.isActive("orderedList")
|
|
28
|
+
}].filter((action) => action.can);
|
|
29
|
+
if (enabledActions.length === 0) return null;
|
|
30
|
+
return /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: "flex h-full items-center gap-3",
|
|
32
|
+
children: enabledActions.map((action) => /* @__PURE__ */ jsx(InlineIconButton, {
|
|
33
|
+
color: "secondary",
|
|
34
|
+
label: action.label,
|
|
35
|
+
onPress: action.onPress,
|
|
36
|
+
icon: action.icon,
|
|
37
|
+
isDisabled: !action.isEnabled(),
|
|
38
|
+
className: clsx(action.isActive() && "!text-interactive-text-primary-idle")
|
|
39
|
+
}, action.label))
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
export { TextListActions };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { BoldIcon } from "./Bold.js";
|
|
2
|
+
import { ItalicIcon } from "./Italic.js";
|
|
3
|
+
import { StrikethroughIcon } from "./Strikethrough.js";
|
|
4
|
+
import { UnderlinedIcon } from "./Underlined.js";
|
|
5
|
+
import { InlineIconButton } from "./InlineIconButton.js";
|
|
6
|
+
import { ns } from "./i18n.js";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { clsx } from "clsx";
|
|
9
|
+
import { useTranslation } from "react-i18next";
|
|
10
|
+
const TextMarksActions = ({ editor }) => {
|
|
11
|
+
const { t } = useTranslation("ui");
|
|
12
|
+
const enabledActions = [
|
|
13
|
+
{
|
|
14
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "bold"),
|
|
15
|
+
isEnabled: () => editor.isEditable && editor.can().toggleBold(),
|
|
16
|
+
label: t(($) => $.ui.textEditor.marks.bold),
|
|
17
|
+
icon: BoldIcon,
|
|
18
|
+
onPress: () => {
|
|
19
|
+
editor.chain().focus().toggleBold().run();
|
|
20
|
+
},
|
|
21
|
+
isActive: () => editor.isActive("bold")
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "italic"),
|
|
25
|
+
isEnabled: () => editor.isEditable && editor.can().toggleItalic(),
|
|
26
|
+
label: t(($) => $.ui.textEditor.marks.italic),
|
|
27
|
+
icon: ItalicIcon,
|
|
28
|
+
onPress: () => {
|
|
29
|
+
editor.chain().focus().toggleItalic().run();
|
|
30
|
+
},
|
|
31
|
+
isActive: () => editor.isActive("italic")
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "strike"),
|
|
35
|
+
isEnabled: () => editor.isEditable && editor.can().toggleStrike(),
|
|
36
|
+
label: t(($) => $.ui.textEditor.marks.strikethrough),
|
|
37
|
+
icon: StrikethroughIcon,
|
|
38
|
+
onPress: () => {
|
|
39
|
+
editor.chain().focus().toggleStrike().run();
|
|
40
|
+
},
|
|
41
|
+
isActive: () => editor.isActive("strike")
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "underline"),
|
|
45
|
+
isEnabled: () => editor.isEditable && editor.can().toggleUnderline(),
|
|
46
|
+
label: t(($) => $.ui.textEditor.marks.underline),
|
|
47
|
+
icon: UnderlinedIcon,
|
|
48
|
+
onPress: () => {
|
|
49
|
+
editor.chain().focus().toggleUnderline().run();
|
|
50
|
+
},
|
|
51
|
+
isActive: () => editor.isActive("underline")
|
|
52
|
+
}
|
|
53
|
+
].filter((action) => action.can);
|
|
54
|
+
if (enabledActions.length === 0) return null;
|
|
55
|
+
return /* @__PURE__ */ jsx("div", {
|
|
56
|
+
className: "flex h-full items-center gap-3",
|
|
57
|
+
children: enabledActions.map((action) => /* @__PURE__ */ jsx(InlineIconButton, {
|
|
58
|
+
color: "secondary",
|
|
59
|
+
label: action.label,
|
|
60
|
+
onPress: action.onPress,
|
|
61
|
+
icon: action.icon,
|
|
62
|
+
isDisabled: !action.isEnabled(),
|
|
63
|
+
className: clsx(action.isActive() && "!text-interactive-text-primary-idle")
|
|
64
|
+
}, action.label))
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
export { TextMarksActions };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Typography } from "./Typography.js";
|
|
2
|
+
import { ns } from "./i18n.js";
|
|
3
|
+
import { Select } from "./Select.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useTranslation } from "react-i18next";
|
|
6
|
+
const TextStyleSelect = ({ editor }) => {
|
|
7
|
+
const { t } = useTranslation("ui");
|
|
8
|
+
if (!!!editor.extensionManager.extensions.find((extension) => extension.name === "heading")) return null;
|
|
9
|
+
const getItem = (level) => {
|
|
10
|
+
return {
|
|
11
|
+
id: level,
|
|
12
|
+
label: t(($) => $.ui.textEditor.textStyle[`heading${level}`]),
|
|
13
|
+
content: /* @__PURE__ */ jsx(Typography, {
|
|
14
|
+
size: `title-${level}`,
|
|
15
|
+
children: t(($) => $.ui.textEditor.textStyle[`heading${level}`])
|
|
16
|
+
})
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const onChange = (val) => {
|
|
20
|
+
if (!val) {
|
|
21
|
+
const currentLevel = editor.getAttributes("heading")?.level;
|
|
22
|
+
if (!currentLevel) return;
|
|
23
|
+
editor.chain().focus().toggleHeading({ level: currentLevel }).run();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (!editor.can().setHeading({ level: val })) return;
|
|
27
|
+
editor.chain().focus().setHeading({ level: val }).run();
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ jsx(Select, {
|
|
30
|
+
as: "inline",
|
|
31
|
+
placeholder: t(($) => $.ui.textEditor.textStyle.label),
|
|
32
|
+
label: t(($) => $.ui.textEditor.textStyle.label),
|
|
33
|
+
hideLabel: true,
|
|
34
|
+
ignoreTriggerWidth: true,
|
|
35
|
+
onChange,
|
|
36
|
+
items: [
|
|
37
|
+
{
|
|
38
|
+
id: 0,
|
|
39
|
+
label: t(($) => $.ui.textEditor.textStyle.normal)
|
|
40
|
+
},
|
|
41
|
+
...editor.can().toggleHeading({ level: 1 }) ? [getItem(1)] : [],
|
|
42
|
+
...editor.can().toggleHeading({ level: 2 }) ? [getItem(2)] : [],
|
|
43
|
+
...editor.can().toggleHeading({ level: 3 }) ? [getItem(3)] : [],
|
|
44
|
+
...editor.can().toggleHeading({ level: 4 }) ? [getItem(4)] : [],
|
|
45
|
+
...editor.can().toggleHeading({ level: 5 }) ? [getItem(5)] : [],
|
|
46
|
+
...editor.can().toggleHeading({ level: 6 }) ? [getItem(6)] : []
|
|
47
|
+
],
|
|
48
|
+
value: editor.getAttributes("heading")?.level || 0,
|
|
49
|
+
isDisabled: !editor.isEditable
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
export { TextStyleSelect };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DateSegmentItem } from "./DateSegmentItem.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
const TimeField = ({ ref, fieldProps, state, isDisabled, hidePlaceholder }) => {
|
|
4
|
+
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", {
|
|
5
|
+
...fieldProps,
|
|
6
|
+
ref,
|
|
7
|
+
className: "flex",
|
|
8
|
+
children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(DateSegmentItem, {
|
|
9
|
+
segment,
|
|
10
|
+
state,
|
|
11
|
+
isDisabled,
|
|
12
|
+
timePickerOnly: true,
|
|
13
|
+
hidePlaceholder
|
|
14
|
+
}, i))
|
|
15
|
+
}) });
|
|
16
|
+
};
|
|
17
|
+
export { TimeField };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { UIConfig } from "./uiConfig.context.js";
|
|
2
|
+
import { TimePickerForm } from "./TimePickerForm.js";
|
|
3
|
+
import { DateTimeDialog } from "./DateTimeDialog.js";
|
|
4
|
+
import { DateTimeDialogFooter } from "./DateTimeDialogFooter.js";
|
|
5
|
+
import { FormField } from "./FormField.js";
|
|
6
|
+
import { TooltipWrapper } from "./TooltipWrapper.js";
|
|
7
|
+
import { DateTimeUtils } from "./date-time.utils.js";
|
|
8
|
+
import { TimePickerInput } from "./TimePickerInput.js";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { useEffect, useRef, useState } from "react";
|
|
11
|
+
import { useLocale, useTimeField } from "react-aria";
|
|
12
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
13
|
+
import { Controller } from "react-hook-form";
|
|
14
|
+
import { getLocalTimeZone, now, toTime } from "@internationalized/date";
|
|
15
|
+
import { DateTime } from "luxon";
|
|
16
|
+
import { useTimeFieldState } from "react-stately";
|
|
17
|
+
var TimePickerBase = (props) => {
|
|
18
|
+
const ui = UIConfig.useConfig();
|
|
19
|
+
const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, placeholder, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, hideLabel = ui.input.hideLabel, isClearable = ui.input.isClearable, disableManualEntry = ui.dateInput.disableManualEntry,...rest } = props;
|
|
20
|
+
const formFieldProps = {
|
|
21
|
+
error,
|
|
22
|
+
label,
|
|
23
|
+
tooltipText,
|
|
24
|
+
helperText,
|
|
25
|
+
isRequired,
|
|
26
|
+
rightContent,
|
|
27
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
28
|
+
hideLabel,
|
|
29
|
+
isDisabled,
|
|
30
|
+
headerClassName,
|
|
31
|
+
errorClassName
|
|
32
|
+
};
|
|
33
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
34
|
+
const initialDateEmitRef = useRef(true);
|
|
35
|
+
const { locale } = useLocale();
|
|
36
|
+
const dialogState = useTimeFieldState({
|
|
37
|
+
...rest,
|
|
38
|
+
defaultValue: value || rest.defaultValue,
|
|
39
|
+
locale
|
|
40
|
+
});
|
|
41
|
+
const state = useTimeFieldState({
|
|
42
|
+
...rest,
|
|
43
|
+
isDisabled,
|
|
44
|
+
value,
|
|
45
|
+
onChange,
|
|
46
|
+
locale
|
|
47
|
+
});
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (initialDateEmitRef.current) {
|
|
50
|
+
initialDateEmitRef.current = false;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (state.timeValue) onChange?.(state.timeValue);
|
|
54
|
+
}, [rest.date]);
|
|
55
|
+
const timeFieldRef = useRef(null);
|
|
56
|
+
const { labelProps, fieldProps } = useTimeField({
|
|
57
|
+
...rest,
|
|
58
|
+
label,
|
|
59
|
+
isReadOnly: disableManualEntry
|
|
60
|
+
}, state, timeFieldRef);
|
|
61
|
+
const headerProps = {
|
|
62
|
+
label,
|
|
63
|
+
tooltipText,
|
|
64
|
+
helperText,
|
|
65
|
+
isRequired,
|
|
66
|
+
rightContent,
|
|
67
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
68
|
+
isDisabled,
|
|
69
|
+
className: headerClassName,
|
|
70
|
+
labelProps
|
|
71
|
+
};
|
|
72
|
+
const onApply = () => {
|
|
73
|
+
state.setValue(dialogState.value);
|
|
74
|
+
setIsOpen(false);
|
|
75
|
+
};
|
|
76
|
+
const onOpenChange = (open) => {
|
|
77
|
+
setIsOpen(open);
|
|
78
|
+
if (!isOpen) dialogState.setValue(state.value);
|
|
79
|
+
};
|
|
80
|
+
const onOpen = () => {
|
|
81
|
+
dialogState.setValue(state.value);
|
|
82
|
+
setIsOpen(true);
|
|
83
|
+
};
|
|
84
|
+
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
85
|
+
as,
|
|
86
|
+
error,
|
|
87
|
+
triggerTabIndex: as === "inline" ? -1 : void 0,
|
|
88
|
+
children: /* @__PURE__ */ jsxs(FormField, {
|
|
89
|
+
...formFieldProps,
|
|
90
|
+
as,
|
|
91
|
+
labelProps,
|
|
92
|
+
className: "relative inline-flex w-full flex-col text-left",
|
|
93
|
+
tabIndex: as === "inline" ? -1 : void 0,
|
|
94
|
+
children: [/* @__PURE__ */ jsx(TimePickerInput, {
|
|
95
|
+
ref: mergeRefs(ref, timeFieldRef),
|
|
96
|
+
as,
|
|
97
|
+
fieldProps,
|
|
98
|
+
state,
|
|
99
|
+
onPress: onOpen,
|
|
100
|
+
isDisabled,
|
|
101
|
+
isDirty,
|
|
102
|
+
isInvalid: !!error,
|
|
103
|
+
disableDropdown,
|
|
104
|
+
variant,
|
|
105
|
+
size,
|
|
106
|
+
isClearable,
|
|
107
|
+
headerProps,
|
|
108
|
+
disableManualEntry,
|
|
109
|
+
placeholder
|
|
110
|
+
}), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
111
|
+
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
112
|
+
isDisabled,
|
|
113
|
+
onApply,
|
|
114
|
+
isValid: !dialogState.isInvalid && !!dialogState.value
|
|
115
|
+
}),
|
|
116
|
+
label,
|
|
117
|
+
triggerRef: timeFieldRef,
|
|
118
|
+
isOpen,
|
|
119
|
+
onOpenChange,
|
|
120
|
+
children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
|
|
121
|
+
})]
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
const TimePicker = (props) => {
|
|
126
|
+
const formatTimeValue = (timeValue) => {
|
|
127
|
+
if (timeValue === null) return null;
|
|
128
|
+
const parsedDate = props.date ? DateTime.fromISO(props.date).toJSDate() : void 0;
|
|
129
|
+
const dateTimeValue = (parsedDate ? DateTimeUtils.fromLocalToZonedDateTime(parsedDate) : now(getLocalTimeZone())).set(timeValue);
|
|
130
|
+
return DateTimeUtils.fromDateValueToISO(dateTimeValue);
|
|
131
|
+
};
|
|
132
|
+
const parseTimeValue = (isoString) => {
|
|
133
|
+
if (isoString == null) return isoString;
|
|
134
|
+
return toTime(DateTimeUtils.fromISOtoZonedDateTime(isoString));
|
|
135
|
+
};
|
|
136
|
+
if ("formControl" in props && props.formControl) {
|
|
137
|
+
const { formControl, ref,...innerProps } = props;
|
|
138
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
139
|
+
control: formControl.control,
|
|
140
|
+
name: formControl.name,
|
|
141
|
+
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(TimePickerBase, {
|
|
142
|
+
...innerProps,
|
|
143
|
+
ref: mergeRefs(ref, field.ref),
|
|
144
|
+
value: parseTimeValue(field.value),
|
|
145
|
+
onChange: (value) => field.onChange(formatTimeValue(value)),
|
|
146
|
+
onBlur: field.onBlur,
|
|
147
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
148
|
+
error: props.error ?? error?.message
|
|
149
|
+
})
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return /* @__PURE__ */ jsx(TimePickerBase, {
|
|
153
|
+
...props,
|
|
154
|
+
value: parseTimeValue(props.value),
|
|
155
|
+
onChange: (value) => props.onChange?.(formatTimeValue(value))
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
export { TimePicker };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { ChevronDownIcon } from "./ChevronDown.js";
|
|
2
|
+
import { ChevronUpIcon } from "./ChevronUp.js";
|
|
3
|
+
import { Typography } from "./Typography.js";
|
|
4
|
+
import { InlineIconButton } from "./InlineIconButton.js";
|
|
5
|
+
import { useBreakpoint } from "./useBreakpoint.js";
|
|
6
|
+
import { getPlaceholder } from "./DateSegmentItem.js";
|
|
7
|
+
import { useLongPressRepeat } from "./useLongPressRepeat.js";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { clsx } from "clsx";
|
|
10
|
+
import { useEffect, useRef } from "react";
|
|
11
|
+
import { useDateSegment, useLocale, useTimeField } from "react-aria";
|
|
12
|
+
import { Time } from "@internationalized/date";
|
|
13
|
+
import { useTimeFieldState } from "@react-stately/datepicker";
|
|
14
|
+
var INCREMENT_STEP_SIZE = 5;
|
|
15
|
+
const TimePickerForm = ({ state, datePickerState }) => {
|
|
16
|
+
const isDesktop = useBreakpoint("md");
|
|
17
|
+
const { locale } = useLocale();
|
|
18
|
+
const fieldState = useTimeFieldState({
|
|
19
|
+
locale,
|
|
20
|
+
defaultValue: datePickerState?.timeValue,
|
|
21
|
+
onChange: (value) => {
|
|
22
|
+
datePickerState?.setTimeValue(value ?? new Time(0, 0));
|
|
23
|
+
},
|
|
24
|
+
hideTimeZone: true
|
|
25
|
+
});
|
|
26
|
+
const ref = useRef(null);
|
|
27
|
+
const innerState = state ?? fieldState;
|
|
28
|
+
const { fieldProps } = useTimeField({ "aria-label": "Time Picker" }, innerState, ref);
|
|
29
|
+
const getAutoFocus = (index) => {
|
|
30
|
+
if (!isDesktop) return false;
|
|
31
|
+
return index === innerState.segments.findIndex(({ type }) => [
|
|
32
|
+
"hour",
|
|
33
|
+
"minute",
|
|
34
|
+
"dayPeriod"
|
|
35
|
+
].includes(type));
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
38
|
+
className: "w-full p-8",
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsx("div", {
|
|
41
|
+
className: "flex items-center justify-center gap-4",
|
|
42
|
+
children: innerState.segments.map((segment, i) => /* @__PURE__ */ jsx(TimeSegmentButton, {
|
|
43
|
+
segment,
|
|
44
|
+
state: innerState,
|
|
45
|
+
type: "increment"
|
|
46
|
+
}, i))
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsx("div", {
|
|
49
|
+
ref,
|
|
50
|
+
...fieldProps,
|
|
51
|
+
className: "flex items-center justify-center gap-4 py-2",
|
|
52
|
+
children: innerState.segments.map((segment, i) => /* @__PURE__ */ jsx(TimeSegmentInput, {
|
|
53
|
+
segment,
|
|
54
|
+
state: innerState,
|
|
55
|
+
autoFocus: getAutoFocus(i)
|
|
56
|
+
}, i))
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ jsx("div", {
|
|
59
|
+
className: "flex items-center justify-center gap-4",
|
|
60
|
+
children: innerState.segments.map((segment, i) => /* @__PURE__ */ jsx(TimeSegmentButton, {
|
|
61
|
+
segment,
|
|
62
|
+
state: innerState,
|
|
63
|
+
type: "decrement"
|
|
64
|
+
}, i))
|
|
65
|
+
})
|
|
66
|
+
]
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
var TimeSegmentInput = ({ segment, state, autoFocus }) => {
|
|
70
|
+
const ref = useRef(null);
|
|
71
|
+
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
72
|
+
const isDesktop = useBreakpoint("md");
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
if (autoFocus) ref.current?.focus();
|
|
75
|
+
}, [autoFocus]);
|
|
76
|
+
if (![
|
|
77
|
+
"literal",
|
|
78
|
+
"hour",
|
|
79
|
+
"minute",
|
|
80
|
+
"dayPeriod"
|
|
81
|
+
].includes(segment.type)) return null;
|
|
82
|
+
if (segment.type === "literal") {
|
|
83
|
+
if (!showSegmentText(segment.text)) return null;
|
|
84
|
+
return /* @__PURE__ */ jsx("div", {
|
|
85
|
+
className: "flex flex-col text-center",
|
|
86
|
+
ref,
|
|
87
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
88
|
+
as: "span",
|
|
89
|
+
variant: "prominent-1",
|
|
90
|
+
size: "label-2",
|
|
91
|
+
className: "text-text-default-2",
|
|
92
|
+
children: segment.text
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return /* @__PURE__ */ jsx("div", {
|
|
97
|
+
className: "flex flex-col items-center justify-center gap-2",
|
|
98
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
99
|
+
ref,
|
|
100
|
+
...isDesktop && segmentProps,
|
|
101
|
+
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"),
|
|
102
|
+
children: getPlaceholder(segment) ?? segment.text
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
var TimeSegmentButton = ({ segment, state, type }) => {
|
|
107
|
+
const stateRef = useRef(state);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
stateRef.current = state;
|
|
110
|
+
}, [state]);
|
|
111
|
+
const onPress = (isLongPress) => {
|
|
112
|
+
if (isLongPress && segment.type === "minute") {
|
|
113
|
+
const currentValue = stateRef.current.segments.find((item) => item.type === "minute")?.value ?? 0;
|
|
114
|
+
const diff = type === "increment" ? INCREMENT_STEP_SIZE : -INCREMENT_STEP_SIZE;
|
|
115
|
+
const normalizedValue = (Math.round((currentValue + diff) / INCREMENT_STEP_SIZE) * INCREMENT_STEP_SIZE % 60 + 60) % 60;
|
|
116
|
+
stateRef.current.setSegment(segment.type, normalizedValue);
|
|
117
|
+
} else stateRef.current[type](segment.type);
|
|
118
|
+
};
|
|
119
|
+
const { onPressStart, onPressEnd } = useLongPressRepeat({
|
|
120
|
+
onPress,
|
|
121
|
+
enabled: segment.type !== "dayPeriod",
|
|
122
|
+
timeout: 300,
|
|
123
|
+
interval: 300
|
|
124
|
+
});
|
|
125
|
+
if (![
|
|
126
|
+
"literal",
|
|
127
|
+
"hour",
|
|
128
|
+
"minute",
|
|
129
|
+
"dayPeriod"
|
|
130
|
+
].includes(segment.type)) return null;
|
|
131
|
+
if (segment.type === "literal") {
|
|
132
|
+
if (!showSegmentText(segment.text)) return null;
|
|
133
|
+
return /* @__PURE__ */ jsx("div", {
|
|
134
|
+
className: "flex shrink-0",
|
|
135
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
136
|
+
as: "span",
|
|
137
|
+
variant: "prominent-1",
|
|
138
|
+
size: "label-2",
|
|
139
|
+
className: "invisible text-text-default-2",
|
|
140
|
+
"aria-hidden": true,
|
|
141
|
+
children: segment.text
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return /* @__PURE__ */ jsx("div", {
|
|
146
|
+
className: "flex w-11 select-none items-center justify-center",
|
|
147
|
+
onContextMenu: (e) => e.preventDefault(),
|
|
148
|
+
children: /* @__PURE__ */ jsx(InlineIconButton, {
|
|
149
|
+
label: "",
|
|
150
|
+
color: "secondary",
|
|
151
|
+
onPressStart,
|
|
152
|
+
onPressEnd,
|
|
153
|
+
icon: type === "increment" ? ChevronUpIcon : ChevronDownIcon
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
var showSegmentText = (text) => !/[\u2066\u2069]/.test(text);
|
|
158
|
+
export { TimePickerForm };
|