@povio/ui 0.0.7 → 0.0.8
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/index.js +62585 -0
- package/package.json +5 -57
- package/povio-ui-0.0.8.tgz +0 -0
- package/{dist → src}/components/Menu/MenuDesktop.d.ts +1 -1
- package/{dist → src}/components/Menu/MenuItem.d.ts +1 -1
- package/{dist → src}/components/Menu/MenuMobile.d.ts +1 -1
- package/{dist → src}/components/Menu/MenuPopover.d.ts +1 -1
- package/{dist → src}/components/buttons/Button/Button.d.ts +1 -1
- package/{dist → src}/components/buttons/Button/button.cva.d.ts +1 -1
- package/{dist → src}/components/buttons/IconButton/IconButton.d.ts +1 -1
- package/{dist → src}/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -1
- package/{dist → src}/components/buttons/PillButton/PillButton.d.ts +2 -2
- package/{dist → src}/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/{dist → src}/components/buttons/SplitButton/SplitButton.d.ts +2 -2
- package/{dist → src}/components/buttons/TextButton/TextButton.d.ts +3 -3
- package/{dist → src}/components/buttons/ToggleButton/ToggleButton.d.ts +3 -3
- package/{dist → src}/components/buttons/shared/ButtonContent.d.ts +3 -3
- package/{dist → src}/components/inputs/Checkbox/Checkbox.d.ts +3 -3
- package/{dist → src}/components/inputs/Checkbox/CheckboxCheckmark.d.ts +1 -1
- package/{dist → src}/components/inputs/Checkbox/checkbox.cva.d.ts +1 -1
- package/{dist → src}/components/inputs/DateTime/DatePicker/DatePicker.d.ts +3 -3
- package/{dist → src}/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/{dist → src}/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +3 -3
- package/{dist → src}/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -3
- package/{dist → src}/components/inputs/DateTime/shared/CalendarHeader.d.ts +1 -1
- package/{dist → src}/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -2
- package/{dist → src}/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -2
- package/{dist → src}/components/inputs/File/fileUpload.types.d.ts +3 -3
- package/{dist → src}/components/inputs/File/inputUpload.types.d.ts +2 -2
- package/{dist → src}/components/inputs/File/shared/FileCard.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileCardList.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileUploadContent.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileUploadContentEmpty.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileUploadContentError.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileUploadContentFilled.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileUploadContentLoading.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/InputUploadContent.d.ts +1 -1
- package/{dist → src}/components/inputs/FormField/FormField.d.ts +3 -3
- package/src/components/inputs/FormField/FormFieldLabel.d.ts +12 -0
- package/{dist → src}/components/inputs/Input/NumberInput/NumberInput.d.ts +4 -4
- package/{dist → src}/components/inputs/Input/PasswordInput/PasswordInput.d.ts +2 -2
- package/{dist → src}/components/inputs/Input/TextArea/TextArea.d.ts +3 -3
- package/{dist → src}/components/inputs/Input/TextInput/TextInput.d.ts +5 -4
- package/{dist → src}/components/inputs/Input/shared/InputContent.d.ts +3 -3
- package/{dist → src}/components/inputs/Inputs/Form.d.ts +2 -2
- package/{dist → src}/components/inputs/Inputs/InputItem.d.ts +16 -16
- package/{dist → src}/components/inputs/RadioGroup/RadioGroup.d.ts +3 -3
- package/{dist → src}/components/inputs/RadioGroup/radio.cva.d.ts +1 -1
- package/{dist → src}/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +3 -3
- package/{dist → src}/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -3
- package/{dist → src}/components/inputs/Selection/Select/Select.d.ts +3 -3
- package/{dist → src}/components/inputs/Selection/shared/SelectBase.d.ts +5 -4
- package/{dist → src}/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/{dist → src}/components/inputs/Selection/shared/SelectInput.d.ts +6 -6
- package/src/components/inputs/Selection/shared/SelectInputTags.d.ts +11 -0
- package/src/components/inputs/Selection/shared/SelectListBox.d.ts +9 -0
- package/{dist → src}/components/inputs/Selection/shared/SelectListBoxItem.d.ts +2 -2
- package/{dist → src}/components/inputs/Selection/shared/SelectListBoxItemSelectAll.d.ts +1 -1
- package/{dist → src}/components/inputs/Selection/shared/SelectListBoxLoadingItem.d.ts +1 -1
- package/{dist → src}/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/{dist → src}/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/{dist → src}/components/inputs/Selection/shared/select.types.d.ts +9 -1
- package/{dist → src}/components/inputs/Selection/shared/useSelectItems.d.ts +2 -2
- package/{dist → src}/components/inputs/Slider/Slider.d.ts +2 -2
- package/{dist → src}/components/inputs/TextEditor/TextEditor.d.ts +2 -2
- package/{dist → src}/components/inputs/TextEditor/Toolbar/HyperlinkAction.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextAlignSelect.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextColorSelect.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextHighlightSelect.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextListActions.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextMarksActions.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextStyleSelect.d.ts +1 -1
- package/{dist → src}/components/inputs/Toggle/Toggle.d.ts +3 -3
- package/{dist → src}/components/inputs/Toggle/toggle.cva.d.ts +1 -1
- package/{dist → src}/components/inputs/shared/CheckContent.d.ts +1 -1
- package/src/components/inputs/shared/InputClear.d.ts +8 -0
- package/{dist → src}/components/inputs/shared/label.cva.d.ts +1 -1
- package/{dist → src}/components/overlays/ActionModal/ActionModal.d.ts +2 -2
- package/{dist → src}/components/overlays/Modal/Modal.d.ts +1 -1
- package/{dist → src}/components/overlays/Tooltip/Tooltip.d.ts +4 -2
- package/src/components/overlays/Tooltip/tooltip.cva.d.ts +21 -0
- package/{dist → src}/components/segment/segment.types.d.ts +1 -1
- package/{dist → src}/components/shared/pagination/PaginationList.d.ts +1 -1
- package/{dist → src}/components/status/Alert/Alert.d.ts +1 -1
- package/{dist → src}/components/status/Loader/Loader.d.ts +1 -1
- package/{dist → src}/components/status/Toast/Toast.d.ts +1 -1
- package/{dist → src}/components/status/Toast/toast.cva.d.ts +1 -1
- package/{dist → src}/components/table/table.cva.d.ts +7 -3
- package/{dist → src}/components/text/Link/Link.d.ts +1 -1
- package/{dist → src}/components/text/Tag/Tag.d.ts +1 -1
- package/{dist → src}/components/text/Typography/Typography.d.ts +1 -1
- package/{dist → src}/config/confirmation.context.d.ts +1 -1
- package/{dist → src}/config/uiConfig.context.d.ts +10 -8
- package/{dist → src}/config/uiStyle.context.d.ts +15 -14
- package/{dist → src}/helpers/dynamicInputs.d.ts +4 -2
- package/{dist → src}/hooks/useFormAutosave.d.ts +2 -2
- package/{dist → src}/index.d.ts +12 -6
- package/{dist → src}/types/react-query.d.ts +1 -1
- package/src/utils/vendor/acl/AclGuard.d.ts +8 -0
- package/src/utils/vendor/acl/Can.d.ts +9 -0
- package/src/utils/vendor/acl/ability.context.d.ts +15 -0
- package/src/utils/vendor/acl/appAbility.types.d.ts +3 -0
- package/src/utils/vendor/auth/AuthGuard.d.ts +6 -0
- package/src/utils/vendor/auth/auth.context.d.ts +21 -0
- package/src/utils/vendor/auth/withPrivateAuthGuard.d.ts +6 -0
- package/{dist/utils/rest/rest-client.d.ts → src/utils/vendor/rest-client.types.d.ts} +8 -14
- package/{dist → src}/utils/zod.utils.d.ts +2 -1
- package/vite.config.d.ts +2 -0
- 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 -34
- package/dist/assets/icons/ChevronsRight.js +0 -34
- package/dist/assets/icons/Clock.js +0 -21
- package/dist/assets/icons/Close.js +0 -21
- package/dist/assets/icons/DateTime.js +0 -25
- 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 -34
- package/dist/assets/icons/Italic.js +0 -21
- package/dist/assets/icons/Link.js +0 -21
- package/dist/assets/icons/Menu.js +0 -23
- 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 -68
- package/dist/components/Menu/MenuItem.js +0 -33
- package/dist/components/Menu/MenuMobile.js +0 -78
- package/dist/components/Menu/MenuPopover.js +0 -38
- package/dist/components/buttons/Button/Button.js +0 -68
- package/dist/components/buttons/Button/button.cva.js +0 -672
- 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 -86
- package/dist/components/buttons/SplitButton/SplitButton.js +0 -62
- 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 -49
- package/dist/components/inputs/Checkbox/checkbox.cva.js +0 -47
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +0 -234
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +0 -668
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +0 -248
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +0 -224
- 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 -62
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +0 -163
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +0 -54
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +0 -76
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +0 -41
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +0 -82
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +0 -131
- 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 -107
- package/dist/components/inputs/DateTime/shared/YearPicker.js +0 -89
- package/dist/components/inputs/File/FileUpload.js +0 -254
- package/dist/components/inputs/File/FileUploadContainer.js +0 -17
- package/dist/components/inputs/File/InputUpload.js +0 -176
- 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/FileProgressBar.js +0 -32
- 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 -176
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +0 -128
- package/dist/components/inputs/File/shared/InputUploadContent.js +0 -68
- package/dist/components/inputs/File/shared/InputUploadFilled.js +0 -31
- package/dist/components/inputs/File/shared/fileUpload.cva.js +0 -57
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +0 -48
- 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.d.ts +0 -11
- package/dist/components/inputs/FormField/FormFieldLabel.js +0 -31
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +0 -157
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +0 -26
- package/dist/components/inputs/Input/TextArea/TextArea.js +0 -149
- package/dist/components/inputs/Input/TextInput/TextInput.js +0 -147
- package/dist/components/inputs/Input/shared/InputContent.js +0 -106
- package/dist/components/inputs/Inputs/Form.js +0 -68
- package/dist/components/inputs/Inputs/InputItem.js +0 -63
- package/dist/components/inputs/Inputs/Inputs.js +0 -32
- package/dist/components/inputs/RadioGroup/RadioGroup.js +0 -113
- package/dist/components/inputs/RadioGroup/radio.cva.js +0 -47
- 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 -24
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +0 -211
- package/dist/components/inputs/Selection/shared/SelectInput.js +0 -237
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/SelectListBox.js +0 -97
- 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 -161
- package/dist/components/inputs/Selection/shared/select.context.js +0 -243
- 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.d.ts +0 -6
- package/dist/components/inputs/shared/InputClear.js +0 -26
- package/dist/components/inputs/shared/input.cva.js +0 -167
- package/dist/components/inputs/shared/label.cva.js +0 -133
- 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 -256
- package/dist/components/overlays/Drawer/Drawer.js +0 -84
- package/dist/components/overlays/Modal/Modal.js +0 -53
- 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 -44
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +0 -27
- package/dist/components/segment/Segment.js +0 -113
- package/dist/components/segment/SegmentItem.js +0 -41
- 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 -64
- package/dist/components/status/Toast/toast.cva.js +0 -150
- package/dist/components/status/Toast/useToast.js +0 -83
- 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 -352
- package/dist/components/table/table.cva.js +0 -37
- package/dist/components/text/Link/Link.js +0 -18
- 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/router.context.js +0 -43
- package/dist/config/uiConfig.context.js +0 -62
- package/dist/config/uiStyle.context.js +0 -16
- package/dist/helpers/dynamicColumns.js +0 -359
- package/dist/helpers/dynamicInputs.js +0 -214
- package/dist/hooks/useAutosave.js +0 -80
- package/dist/hooks/useBreakpoint.js +0 -20
- package/dist/hooks/useDebounceCallback.js +0 -29
- package/dist/hooks/useDeepCompare.js +0 -25
- package/dist/hooks/useFilters.js +0 -120
- 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 -63
- package/dist/hooks/useLongPressRepeat.js +0 -33
- package/dist/hooks/usePagination.js +0 -35
- package/dist/hooks/useScrollableListBox.js +0 -30
- package/dist/hooks/useSingletonMutation.d.ts +0 -4
- package/dist/hooks/useSingletonMutation.js +0 -27
- package/dist/hooks/useSorting.js +0 -30
- package/dist/hooks/useStateAndRef.js +0 -17
- package/dist/hooks/useTableColumnConfig.js +0 -59
- package/dist/hooks/useTableNav.js +0 -409
- package/dist/hooks/useTranslationMemo.js +0 -14
- package/dist/index.js +0 -280
- 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 -12
- package/dist/utils/dom.utils.js +0 -13
- package/dist/utils/file.utils.js +0 -63
- package/dist/utils/isEqual.js +0 -94
- 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/interceptors/logging.interceptor.d.ts +0 -2
- package/dist/utils/rest/interceptors/logging.interceptor.js +0 -17
- package/dist/utils/rest/interceptors/response.interceptor.d.ts +0 -2
- package/dist/utils/rest/interceptors/response.interceptor.js +0 -25
- package/dist/utils/rest/interceptors/rest-interceptor.js +0 -21
- package/dist/utils/rest/rest-client.js +0 -62
- package/dist/utils/rest/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/error-handling.js +0 -119
- package/dist/utils/zod.utils.js +0 -25
- /package/{dist → src}/assets/icons/AlignCenter.d.ts +0 -0
- /package/{dist → src}/assets/icons/AlignLeft.d.ts +0 -0
- /package/{dist → src}/assets/icons/AlignLeftRight.d.ts +0 -0
- /package/{dist → src}/assets/icons/AlignRight.d.ts +0 -0
- /package/{dist → src}/assets/icons/ArrowDropDown.d.ts +0 -0
- /package/{dist → src}/assets/icons/ArrowDropUp.d.ts +0 -0
- /package/{dist → src}/assets/icons/ArrowLeft.d.ts +0 -0
- /package/{dist → src}/assets/icons/ArrowRight.d.ts +0 -0
- /package/{dist → src}/assets/icons/Bold.d.ts +0 -0
- /package/{dist → src}/assets/icons/BulletedList.d.ts +0 -0
- /package/{dist → src}/assets/icons/Calendar.d.ts +0 -0
- /package/{dist → src}/assets/icons/Check.d.ts +0 -0
- /package/{dist → src}/assets/icons/CheckCircle.d.ts +0 -0
- /package/{dist → src}/assets/icons/CheckboxCheckmark.d.ts +0 -0
- /package/{dist → src}/assets/icons/CheckboxIndeterminate.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronDown.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronLeft.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronRight.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronUp.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronsLeft.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronsRight.d.ts +0 -0
- /package/{dist → src}/assets/icons/Clock.d.ts +0 -0
- /package/{dist → src}/assets/icons/Close.d.ts +0 -0
- /package/{dist → src}/assets/icons/DateTime.d.ts +0 -0
- /package/{dist → src}/assets/icons/Drag.d.ts +0 -0
- /package/{dist → src}/assets/icons/File.d.ts +0 -0
- /package/{dist → src}/assets/icons/Highlight.d.ts +0 -0
- /package/{dist → src}/assets/icons/HighlightOn.d.ts +0 -0
- /package/{dist → src}/assets/icons/Info.d.ts +0 -0
- /package/{dist → src}/assets/icons/Italic.d.ts +0 -0
- /package/{dist → src}/assets/icons/Link.d.ts +0 -0
- /package/{dist → src}/assets/icons/Menu.d.ts +0 -0
- /package/{dist → src}/assets/icons/NumberedList.d.ts +0 -0
- /package/{dist → src}/assets/icons/PointerHorizontal.d.ts +0 -0
- /package/{dist → src}/assets/icons/PointerVertical.d.ts +0 -0
- /package/{dist → src}/assets/icons/Send.d.ts +0 -0
- /package/{dist → src}/assets/icons/Strikethrough.d.ts +0 -0
- /package/{dist → src}/assets/icons/TextColor.d.ts +0 -0
- /package/{dist → src}/assets/icons/Today.d.ts +0 -0
- /package/{dist → src}/assets/icons/Underlined.d.ts +0 -0
- /package/{dist → src}/assets/icons/Upload.d.ts +0 -0
- /package/{dist → src}/assets/icons/View.d.ts +0 -0
- /package/{dist → src}/assets/icons/ViewOff.d.ts +0 -0
- /package/{dist/assets/icons/Warningfilled.d.ts → src/assets/icons/WarningFilled.d.ts} +0 -0
- /package/{dist → src}/components/Menu/Menu.d.ts +0 -0
- /package/{dist → src}/components/buttons/shared/buttonContent.cva.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/Calendar.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/CalendarCell.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/CalendarGrid.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/CalendarSelectHeader.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/DateField.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/DateTimeDialog.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/DateTimeDialogFooter.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/MonthPicker.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/RangeCalendar.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/TimeField.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/TimePickerForm.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/YearPicker.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/FileUpload.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/FileUploadContainer.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/InputUpload.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/index.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/shared/FileProgressBar.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/shared/InputUploadFilled.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/shared/fileUpload.cva.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/shared/inputUploadButton.cva.d.ts +0 -0
- /package/{dist → src}/components/inputs/FormField/FormFieldError.d.ts +0 -0
- /package/{dist → src}/components/inputs/FormField/FormFieldHeader.d.ts +0 -0
- /package/{dist → src}/components/inputs/FormField/FormFieldHeaderClose.d.ts +0 -0
- /package/{dist → src}/components/inputs/Inputs/Inputs.d.ts +0 -0
- /package/{dist → src}/components/inputs/Selection/shared/SelectListBoxSelectionBar.d.ts +0 -0
- /package/{dist → src}/components/inputs/TextEditor/Toolbar/ColorPicker.d.ts +0 -0
- /package/{dist → src}/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.d.ts +0 -0
- /package/{dist → src}/components/inputs/TextEditor/Toolbar/TextEditorToolbar.d.ts +0 -0
- /package/{dist → src}/components/inputs/TextEditor/textEditor.types.d.ts +0 -0
- /package/{dist → src}/components/inputs/shared/form.types.d.ts +0 -0
- /package/{dist → src}/components/inputs/shared/input.cva.d.ts +0 -0
- /package/{dist → src}/components/outline.clsx.d.ts +0 -0
- /package/{dist → src}/components/overlays/BottomSheet/BottomSheet.d.ts +0 -0
- /package/{dist → src}/components/overlays/Drawer/Drawer.d.ts +0 -0
- /package/{dist → src}/components/overlays/Modal/modal.cva.d.ts +0 -0
- /package/{dist → src}/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +0 -0
- /package/{dist → src}/components/overlays/Tooltip/TooltipEllipsis.d.ts +0 -0
- /package/{dist → src}/components/segment/Segment.d.ts +0 -0
- /package/{dist → src}/components/segment/SegmentItem.d.ts +0 -0
- /package/{dist → src}/components/shared/pagination/Pagination.d.ts +0 -0
- /package/{dist → src}/components/shared/pagination/minWidth.cva.d.ts +0 -0
- /package/{dist → src}/components/status/Alert/alert.cva.d.ts +0 -0
- /package/{dist → src}/components/status/Loader/loader.cva.d.ts +0 -0
- /package/{dist → src}/components/status/Toast/useToast.d.ts +0 -0
- /package/{dist → src}/components/status/shared/status.cva.d.ts +0 -0
- /package/{dist → src}/components/table/CellText.d.ts +0 -0
- /package/{dist → src}/components/table/ColumnConfig.d.ts +0 -0
- /package/{dist → src}/components/table/HeaderText.d.ts +0 -0
- /package/{dist → src}/components/table/InfiniteTable.d.ts +0 -0
- /package/{dist → src}/components/table/PaginatedTable.d.ts +0 -0
- /package/{dist → src}/components/table/Table.d.ts +0 -0
- /package/{dist → src}/components/text/Link/link.cva.d.ts +0 -0
- /package/{dist → src}/components/text/Tag/tag.cva.d.ts +0 -0
- /package/{dist → src}/components/text/Typography/typography.cva.d.ts +0 -0
- /package/{dist → src}/config/i18n.d.ts +0 -0
- /package/{dist → src}/config/router.context.d.ts +0 -0
- /package/{dist → src}/helpers/dynamicColumns.d.ts +0 -0
- /package/{dist → src}/hooks/useAutosave.d.ts +0 -0
- /package/{dist → src}/hooks/useBreakpoint.d.ts +0 -0
- /package/{dist → src}/hooks/useDebounceCallback.d.ts +0 -0
- /package/{dist → src}/hooks/useDeepCompare.d.ts +0 -0
- /package/{dist → src}/hooks/useFilters.d.ts +0 -0
- /package/{dist → src}/hooks/useForm.d.ts +0 -0
- /package/{dist → src}/hooks/useIntersectionObserver.d.ts +0 -0
- /package/{dist → src}/hooks/useLocalStorage.d.ts +0 -0
- /package/{dist → src}/hooks/useLongPressRepeat.d.ts +0 -0
- /package/{dist → src}/hooks/usePagination.d.ts +0 -0
- /package/{dist → src}/hooks/useScrollableListBox.d.ts +0 -0
- /package/{dist → src}/hooks/useSorting.d.ts +0 -0
- /package/{dist → src}/hooks/useStateAndRef.d.ts +0 -0
- /package/{dist → src}/hooks/useTableColumnConfig.d.ts +0 -0
- /package/{dist → src}/hooks/useTableNav.d.ts +0 -0
- /package/{dist → src}/hooks/useTranslationMemo.d.ts +0 -0
- /package/{dist → src}/types/common.d.ts +0 -0
- /package/{dist → src}/utils/array.utils.d.ts +0 -0
- /package/{dist → src}/utils/array.utils.spec.d.ts +0 -0
- /package/{dist → src}/utils/compoundMapper.d.ts +0 -0
- /package/{dist → src}/utils/compoundMapper.spec.d.ts +0 -0
- /package/{dist → src}/utils/date-time.utils.d.ts +0 -0
- /package/{dist → src}/utils/date-time.utils.spec.d.ts +0 -0
- /package/{dist → src}/utils/date.utils.d.ts +0 -0
- /package/{dist → src}/utils/date.utils.spec.d.ts +0 -0
- /package/{dist → src}/utils/dom.utils.d.ts +0 -0
- /package/{dist → src}/utils/file.utils.d.ts +0 -0
- /package/{dist → src}/utils/isEqual.d.ts +0 -0
- /package/{dist → src}/utils/logger.d.ts +0 -0
- /package/{dist → src}/utils/object.utils.d.ts +0 -0
- /package/{dist → src}/utils/queries.utils.d.ts +0 -0
- /package/{dist/utils/rest → src/utils}/rest.utils.d.ts +0 -0
- /package/{dist → src}/utils/routing.utils.d.ts +0 -0
- /package/{dist → src}/utils/string.utils.d.ts +0 -0
- /package/{dist → src}/utils/vendor/error-handling.d.ts +0 -0
- /package/{dist/utils/rest/interceptors → src/utils/vendor}/rest-interceptor.d.ts +0 -0
- /package/{dist/styles → styles}/editor.css +0 -0
- /package/{dist/styles → styles}/index.css +0 -0
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { now, getLocalTimeZone, today } from "@internationalized/date";
|
|
3
|
-
import { clsx } from "clsx";
|
|
4
|
-
import { useState, useRef, useCallback, useMemo } from "react";
|
|
5
|
-
import { useHover, useFocusWithin, useFocusVisible } from "react-aria";
|
|
6
|
-
import useMeasure from "react-use-measure";
|
|
7
|
-
import { CalendarIcon } from "../../../../assets/icons/Calendar.js";
|
|
8
|
-
import { DateTimeIcon } from "../../../../assets/icons/DateTime.js";
|
|
9
|
-
import { TodayIcon } from "../../../../assets/icons/Today.js";
|
|
10
|
-
import { IconButton } from "../../../buttons/IconButton/IconButton.js";
|
|
11
|
-
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
12
|
-
import { DateField } from "./DateField.js";
|
|
13
|
-
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
14
|
-
import { InputClear } from "../../shared/InputClear.js";
|
|
15
|
-
import { useInputCva } from "../../shared/input.cva.js";
|
|
16
|
-
const DatePickerInput = ({
|
|
17
|
-
ref,
|
|
18
|
-
as,
|
|
19
|
-
groupProps,
|
|
20
|
-
fieldProps,
|
|
21
|
-
endFieldProps,
|
|
22
|
-
buttonProps,
|
|
23
|
-
isDisabled,
|
|
24
|
-
isInvalid,
|
|
25
|
-
disableDropdown,
|
|
26
|
-
variant,
|
|
27
|
-
size,
|
|
28
|
-
isDateTime,
|
|
29
|
-
isClearable,
|
|
30
|
-
headerProps,
|
|
31
|
-
todayIcon,
|
|
32
|
-
...props
|
|
33
|
-
}) => {
|
|
34
|
-
const inputCva = useInputCva();
|
|
35
|
-
const [canClear, setCanClear] = useState(false);
|
|
36
|
-
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
37
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
38
|
-
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
39
|
-
const { isFocusVisible } = useFocusVisible();
|
|
40
|
-
const dateFieldRef = useRef(null);
|
|
41
|
-
const endDateFieldRef = useRef(null);
|
|
42
|
-
const [labelContentRef, { width: labelWidth }] = useMeasure();
|
|
43
|
-
const onClearChange = useCallback((canClearInput) => {
|
|
44
|
-
setCanClear(canClearInput);
|
|
45
|
-
}, []);
|
|
46
|
-
const onClear = () => {
|
|
47
|
-
dateFieldRef.current?.clearField();
|
|
48
|
-
fieldProps.onChange?.(null);
|
|
49
|
-
const timeout = setTimeout(() => {
|
|
50
|
-
endDateFieldRef.current?.clearField();
|
|
51
|
-
clearTimeout(timeout);
|
|
52
|
-
}, 0);
|
|
53
|
-
setCanClear(false);
|
|
54
|
-
};
|
|
55
|
-
const onToday = () => {
|
|
56
|
-
if (isDateTime) {
|
|
57
|
-
fieldProps.onChange?.(now(getLocalTimeZone()));
|
|
58
|
-
} else {
|
|
59
|
-
fieldProps.onChange?.(today(getLocalTimeZone()));
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const hidePlaceholder = as === "floating" && !fieldProps.value && !isFocused;
|
|
63
|
-
const style = useMemo(() => {
|
|
64
|
-
const leftPadding = as === "filter" ? `var(--spacing-input-side-default) + ${labelWidth}` : "0";
|
|
65
|
-
return {
|
|
66
|
-
paddingLeft: `calc(${leftPadding}px)`
|
|
67
|
-
};
|
|
68
|
-
}, [labelWidth, as]);
|
|
69
|
-
return /* @__PURE__ */ jsxs(
|
|
70
|
-
"div",
|
|
71
|
-
{
|
|
72
|
-
ref,
|
|
73
|
-
className: inputCva({
|
|
74
|
-
variant,
|
|
75
|
-
as,
|
|
76
|
-
size,
|
|
77
|
-
...props,
|
|
78
|
-
className: clsx("group/date-picker-content relative flex items-center justify-between gap-2")
|
|
79
|
-
}),
|
|
80
|
-
"data-rac": "",
|
|
81
|
-
"data-hovered": isHovered || void 0,
|
|
82
|
-
"data-disabled": isDisabled || void 0,
|
|
83
|
-
"data-invalid": isInvalid || void 0,
|
|
84
|
-
"data-focus-within": isFocused || void 0,
|
|
85
|
-
"data-focus-visible": isFocused && isFocusVisible || void 0,
|
|
86
|
-
"data-has-selection": fieldProps.value !== null || void 0,
|
|
87
|
-
...groupProps,
|
|
88
|
-
...focusWithinProps,
|
|
89
|
-
...hoverProps,
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
92
|
-
as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(
|
|
93
|
-
FormFieldLabel,
|
|
94
|
-
{
|
|
95
|
-
ref: labelContentRef,
|
|
96
|
-
as,
|
|
97
|
-
...headerProps
|
|
98
|
-
}
|
|
99
|
-
),
|
|
100
|
-
/* @__PURE__ */ jsxs(
|
|
101
|
-
"div",
|
|
102
|
-
{
|
|
103
|
-
className: "flex items-center gap-2",
|
|
104
|
-
style,
|
|
105
|
-
children: [
|
|
106
|
-
todayIcon && /* @__PURE__ */ jsx(
|
|
107
|
-
IconButton,
|
|
108
|
-
{
|
|
109
|
-
label: "",
|
|
110
|
-
icon: TodayIcon,
|
|
111
|
-
size: "xxs",
|
|
112
|
-
onPress: onToday
|
|
113
|
-
}
|
|
114
|
-
),
|
|
115
|
-
/* @__PURE__ */ jsx(
|
|
116
|
-
DateField,
|
|
117
|
-
{
|
|
118
|
-
ref: dateFieldRef,
|
|
119
|
-
...fieldProps,
|
|
120
|
-
isDisabled,
|
|
121
|
-
isInvalid,
|
|
122
|
-
onClearChange,
|
|
123
|
-
hidePlaceholder
|
|
124
|
-
}
|
|
125
|
-
),
|
|
126
|
-
endFieldProps && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
127
|
-
!((as === "floating" || as === "filter") && hidePlaceholder) && /* @__PURE__ */ jsx("span", { className: "select-none", children: "–" }),
|
|
128
|
-
/* @__PURE__ */ jsx(
|
|
129
|
-
DateField,
|
|
130
|
-
{
|
|
131
|
-
ref: endDateFieldRef,
|
|
132
|
-
...endFieldProps,
|
|
133
|
-
isDisabled,
|
|
134
|
-
isInvalid,
|
|
135
|
-
onClearChange,
|
|
136
|
-
hidePlaceholder
|
|
137
|
-
}
|
|
138
|
-
)
|
|
139
|
-
] })
|
|
140
|
-
]
|
|
141
|
-
}
|
|
142
|
-
)
|
|
143
|
-
] }),
|
|
144
|
-
/* @__PURE__ */ jsxs("div", { className: clsx("flex items-center gap-2", as === "floating" && "-mt-4"), children: [
|
|
145
|
-
isClearable && canClear && /* @__PURE__ */ jsx(InputClear, { onClear }),
|
|
146
|
-
!disableDropdown && /* @__PURE__ */ jsx(
|
|
147
|
-
InlineIconButton,
|
|
148
|
-
{
|
|
149
|
-
label: "",
|
|
150
|
-
color: "secondary",
|
|
151
|
-
...buttonProps,
|
|
152
|
-
icon: isDateTime ? DateTimeIcon : CalendarIcon,
|
|
153
|
-
isDisabled
|
|
154
|
-
}
|
|
155
|
-
)
|
|
156
|
-
] })
|
|
157
|
-
]
|
|
158
|
-
}
|
|
159
|
-
);
|
|
160
|
-
};
|
|
161
|
-
export {
|
|
162
|
-
DatePickerInput
|
|
163
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { useRef } from "react";
|
|
4
|
-
import { useDateSegment } from "react-aria";
|
|
5
|
-
const getPlaceholder = (segment) => {
|
|
6
|
-
if (!segment.isPlaceholder) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
9
|
-
switch (segment.type) {
|
|
10
|
-
case "hour":
|
|
11
|
-
return "hh";
|
|
12
|
-
case "minute":
|
|
13
|
-
return "mm";
|
|
14
|
-
case "second":
|
|
15
|
-
return "ss";
|
|
16
|
-
default:
|
|
17
|
-
return segment.placeholder;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
const DateSegmentItem = ({ segment, state, isDisabled, timePickerOnly, hidePlaceholder }) => {
|
|
21
|
-
const ref = useRef(null);
|
|
22
|
-
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
23
|
-
const isInputEmpty = !state.value;
|
|
24
|
-
return /* @__PURE__ */ jsx(
|
|
25
|
-
"div",
|
|
26
|
-
{
|
|
27
|
-
...segmentProps,
|
|
28
|
-
ref,
|
|
29
|
-
className: clsx(
|
|
30
|
-
"box-content rounded-input-rounding-default",
|
|
31
|
-
isDisabled && "text-interactive-text-secondary-disabled",
|
|
32
|
-
!isDisabled && isInputEmpty && "text-text-default-3 group-focus-within:text-text-default-1",
|
|
33
|
-
!isDisabled && !isInputEmpty && "text-text-default-1",
|
|
34
|
-
"focus-within:outline-1 focus-within:outline-interactive-contained-primary-idle focus-within:outline-offset-1",
|
|
35
|
-
["hour", "dayPeriod"].includes(segment.type) && !timePickerOnly && "ml-1"
|
|
36
|
-
),
|
|
37
|
-
children: !hidePlaceholder && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
38
|
-
segment.isPlaceholder && /* @__PURE__ */ jsx(
|
|
39
|
-
"span",
|
|
40
|
-
{
|
|
41
|
-
"aria-hidden": "true",
|
|
42
|
-
className: "pointer-events-none",
|
|
43
|
-
children: getPlaceholder(segment)
|
|
44
|
-
}
|
|
45
|
-
),
|
|
46
|
-
segment.isPlaceholder ? "" : segment.text
|
|
47
|
-
] })
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
export {
|
|
52
|
-
DateSegmentItem,
|
|
53
|
-
getPlaceholder
|
|
54
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Popover, Dialog } from "react-aria-components";
|
|
3
|
-
import { FormFieldHeader } from "../../FormField/FormFieldHeader.js";
|
|
4
|
-
import { FormFieldHeaderClose } from "../../FormField/FormFieldHeaderClose.js";
|
|
5
|
-
import { BottomSheet } from "../../../overlays/BottomSheet/BottomSheet.js";
|
|
6
|
-
import { useBreakpoint } from "../../../../hooks/useBreakpoint.js";
|
|
7
|
-
const DateTimeDialog = ({
|
|
8
|
-
hideSidebar,
|
|
9
|
-
children,
|
|
10
|
-
footer,
|
|
11
|
-
sidebar,
|
|
12
|
-
label,
|
|
13
|
-
isOpen,
|
|
14
|
-
triggerRef,
|
|
15
|
-
dialogProps,
|
|
16
|
-
onOpenChange
|
|
17
|
-
}) => {
|
|
18
|
-
const isDesktop = useBreakpoint("md");
|
|
19
|
-
if (isDesktop) {
|
|
20
|
-
if (!isOpen) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return /* @__PURE__ */ jsx(
|
|
24
|
-
Popover,
|
|
25
|
-
{
|
|
26
|
-
triggerRef,
|
|
27
|
-
isOpen,
|
|
28
|
-
placement: "bottom start",
|
|
29
|
-
onOpenChange,
|
|
30
|
-
children: /* @__PURE__ */ jsx(
|
|
31
|
-
Dialog,
|
|
32
|
-
{
|
|
33
|
-
...dialogProps,
|
|
34
|
-
className: "!outline-none",
|
|
35
|
-
"aria-label": label,
|
|
36
|
-
children: /* @__PURE__ */ jsxs("div", { className: "flex overflow-hidden rounded-input-rounding-default border border-elevation-outline-default-1 border-solid bg-elevation-fill-default-1 shadow-5", children: [
|
|
37
|
-
!hideSidebar && sidebar,
|
|
38
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col justify-between", children: [
|
|
39
|
-
children,
|
|
40
|
-
footer
|
|
41
|
-
] })
|
|
42
|
-
] })
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
return /* @__PURE__ */ jsx(
|
|
49
|
-
BottomSheet,
|
|
50
|
-
{
|
|
51
|
-
label,
|
|
52
|
-
footer,
|
|
53
|
-
isOpen,
|
|
54
|
-
onOpenChange,
|
|
55
|
-
sheetMarginBottom: 0,
|
|
56
|
-
isScrollable: false,
|
|
57
|
-
height: "auto",
|
|
58
|
-
isDismissable: true,
|
|
59
|
-
children: (close) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
60
|
-
/* @__PURE__ */ jsx(
|
|
61
|
-
FormFieldHeader,
|
|
62
|
-
{
|
|
63
|
-
label,
|
|
64
|
-
className: "!mb-8 shrink-0 px-4 pt-3",
|
|
65
|
-
rightContent: /* @__PURE__ */ jsx(FormFieldHeaderClose, { onClose: close })
|
|
66
|
-
}
|
|
67
|
-
),
|
|
68
|
-
children,
|
|
69
|
-
!hideSidebar && sidebar
|
|
70
|
-
] })
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
};
|
|
74
|
-
export {
|
|
75
|
-
DateTimeDialog
|
|
76
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { TextButton } from "../../../buttons/TextButton/TextButton.js";
|
|
5
|
-
import { ns } from "../../../../config/i18n.js";
|
|
6
|
-
const DateTimeDialogFooter = ({ isValid = true, onTodayPress, onApply }) => {
|
|
7
|
-
const { t } = useTranslation(ns);
|
|
8
|
-
return /* @__PURE__ */ jsxs(
|
|
9
|
-
"footer",
|
|
10
|
-
{
|
|
11
|
-
className: clsx(
|
|
12
|
-
"flex shrink-0 items-center gap-2 bg-elevation-fill-default-2 px-4 py-3 md:border-elevation-outline-default-1 md:border-t md:bg-elevation-fill-default-1 md:py-1-5",
|
|
13
|
-
onTodayPress ? "justify-between" : "justify-end"
|
|
14
|
-
),
|
|
15
|
-
children: [
|
|
16
|
-
onTodayPress && /* @__PURE__ */ jsx(
|
|
17
|
-
TextButton,
|
|
18
|
-
{
|
|
19
|
-
type: "button",
|
|
20
|
-
color: "primary",
|
|
21
|
-
onPress: onTodayPress,
|
|
22
|
-
children: t(($) => $.ui.datePicker.today)
|
|
23
|
-
}
|
|
24
|
-
),
|
|
25
|
-
/* @__PURE__ */ jsx(
|
|
26
|
-
TextButton,
|
|
27
|
-
{
|
|
28
|
-
type: "button",
|
|
29
|
-
color: "secondary",
|
|
30
|
-
onPress: onApply,
|
|
31
|
-
isDisabled: !isValid,
|
|
32
|
-
children: t(($) => $.ui.datePicker.save)
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
export {
|
|
40
|
-
DateTimeDialogFooter
|
|
41
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useDateFormatter } from "@react-aria/i18n";
|
|
3
|
-
import { clsx } from "clsx";
|
|
4
|
-
import { ListBox, ListBoxItem } from "react-aria-components";
|
|
5
|
-
import { Typography } from "../../../text/Typography/Typography.js";
|
|
6
|
-
const MonthPicker = ({ state, onSelectionChange }) => {
|
|
7
|
-
const formatter = useDateFormatter({
|
|
8
|
-
month: "long",
|
|
9
|
-
timeZone: state.timeZone
|
|
10
|
-
});
|
|
11
|
-
const numMonths = state.focusedDate.calendar.getMonthsInYear(state.focusedDate);
|
|
12
|
-
const getMonths = () => {
|
|
13
|
-
const months = [];
|
|
14
|
-
for (let i = 1; i <= numMonths; i++) {
|
|
15
|
-
const date = state.focusedDate.set({ month: i });
|
|
16
|
-
months.push(formatter.format(date.toDate(state.timeZone)));
|
|
17
|
-
}
|
|
18
|
-
return months;
|
|
19
|
-
};
|
|
20
|
-
const isMonthDisabled = (month) => {
|
|
21
|
-
if (state.minValue && state.focusedDate.set({ month }) < state.minValue) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
if (state.maxValue && state.focusedDate.set({ month }) > state.maxValue) {
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
28
|
-
};
|
|
29
|
-
return /* @__PURE__ */ jsx(
|
|
30
|
-
ListBox,
|
|
31
|
-
{
|
|
32
|
-
autoFocus: true,
|
|
33
|
-
"aria-label": "Month",
|
|
34
|
-
selectionMode: "single",
|
|
35
|
-
layout: "grid",
|
|
36
|
-
selectedKeys: [state.focusedDate.month],
|
|
37
|
-
onSelectionChange: (key) => {
|
|
38
|
-
if (key === "all") {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const index = [...key][0];
|
|
42
|
-
if (typeof index === "number") {
|
|
43
|
-
const date = state.focusedDate.set({ month: [...key][0] });
|
|
44
|
-
state.setFocusedDate(date);
|
|
45
|
-
}
|
|
46
|
-
onSelectionChange(key);
|
|
47
|
-
},
|
|
48
|
-
className: "grid size-full min-h-72 grid-cols-3 grid-rows-4 gap-2 p-3 md:w-80",
|
|
49
|
-
children: getMonths().map((month, index) => {
|
|
50
|
-
const isDisabled = isMonthDisabled(index + 1);
|
|
51
|
-
return /* @__PURE__ */ jsx(
|
|
52
|
-
ListBoxItem,
|
|
53
|
-
{
|
|
54
|
-
id: index + 1,
|
|
55
|
-
textValue: month,
|
|
56
|
-
isDisabled,
|
|
57
|
-
className: clsx(
|
|
58
|
-
"flex items-center justify-center text-interactive-text-secondary-idle",
|
|
59
|
-
"rounded-button-rounding-m border border-elevation-outline-default-1 border-solid bg-elevation-fill-default-1",
|
|
60
|
-
"hover:text-interactive-text-secondary-hover",
|
|
61
|
-
"selected:border-interactive-contained-primary-idle selected:bg-interactive-contained-primary-idle selected:text-interactive-text-secondary-idle-inverted",
|
|
62
|
-
"focus:outline-none focus-visible:outline-1 focus-visible:outline-interactive-contained-primary-focus focus-visible:outline-offset-1",
|
|
63
|
-
isDisabled ? "cursor-default opacity-50" : "cursor-pointer"
|
|
64
|
-
),
|
|
65
|
-
children: /* @__PURE__ */ jsx(
|
|
66
|
-
Typography,
|
|
67
|
-
{
|
|
68
|
-
as: "span",
|
|
69
|
-
size: "label-2",
|
|
70
|
-
children: month
|
|
71
|
-
}
|
|
72
|
-
)
|
|
73
|
-
},
|
|
74
|
-
month
|
|
75
|
-
);
|
|
76
|
-
})
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
export {
|
|
81
|
-
MonthPicker
|
|
82
|
-
};
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRangeCalendar } from "@react-aria/calendar";
|
|
3
|
-
import { clsx } from "clsx";
|
|
4
|
-
import { useRef, useMemo } from "react";
|
|
5
|
-
import { CalendarGrid } from "./CalendarGrid.js";
|
|
6
|
-
import { CalendarSelectHeader } from "./CalendarSelectHeader.js";
|
|
7
|
-
const RangeCalendar = ({
|
|
8
|
-
className,
|
|
9
|
-
leftCalendarState,
|
|
10
|
-
rightCalendarState,
|
|
11
|
-
calendarProps,
|
|
12
|
-
onApply,
|
|
13
|
-
onRangeChange: _onRangeChange,
|
|
14
|
-
onDateSelection,
|
|
15
|
-
onDateHover,
|
|
16
|
-
rangeSelection,
|
|
17
|
-
hoverDate,
|
|
18
|
-
onKeyboardNavigation
|
|
19
|
-
}) => {
|
|
20
|
-
const leftRef = useRef(null);
|
|
21
|
-
const rightRef = useRef(null);
|
|
22
|
-
const { calendarProps: leftCalendarAriaProps } = useRangeCalendar(calendarProps, leftCalendarState, leftRef);
|
|
23
|
-
const { calendarProps: rightCalendarAriaProps } = useRangeCalendar(calendarProps, rightCalendarState, rightRef);
|
|
24
|
-
const leftDate = leftCalendarState.visibleRange.start;
|
|
25
|
-
const rightDate = rightCalendarState.visibleRange.start;
|
|
26
|
-
const handleLeftKeyboardNavigation = (event, date) => {
|
|
27
|
-
return onKeyboardNavigation?.(event, date, "left") ?? false;
|
|
28
|
-
};
|
|
29
|
-
const handleRightKeyboardNavigation = (event, date) => {
|
|
30
|
-
return onKeyboardNavigation?.(event, date, "right") ?? false;
|
|
31
|
-
};
|
|
32
|
-
const handleLeftNavigate = (newDate) => {
|
|
33
|
-
const rightCurrentDate = rightCalendarState.visibleRange.start;
|
|
34
|
-
if (newDate.year < rightCurrentDate.year || newDate.year === rightCurrentDate.year && newDate.month < rightCurrentDate.month) {
|
|
35
|
-
leftCalendarState.setFocusedDate(newDate);
|
|
36
|
-
} else {
|
|
37
|
-
const closestValidDate = rightCurrentDate.subtract({ months: 1 });
|
|
38
|
-
leftCalendarState.setFocusedDate(closestValidDate);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const handleRightNavigate = (newDate) => {
|
|
42
|
-
const leftCurrentDate = leftCalendarState.visibleRange.start;
|
|
43
|
-
if (newDate.year > leftCurrentDate.year || newDate.year === leftCurrentDate.year && newDate.month > leftCurrentDate.month) {
|
|
44
|
-
rightCalendarState.setFocusedDate(newDate);
|
|
45
|
-
} else {
|
|
46
|
-
const closestValidDate = leftCurrentDate.add({ months: 1 });
|
|
47
|
-
rightCalendarState.setFocusedDate(closestValidDate);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const isNextDisabled = useMemo(() => {
|
|
51
|
-
return leftDate.year > rightDate.year || leftDate.year === rightDate.year && leftDate.add({ months: 1 }).month === rightDate.month;
|
|
52
|
-
}, [leftDate, rightDate]);
|
|
53
|
-
const isPrevDisabled = useMemo(() => {
|
|
54
|
-
return rightDate.year < leftDate.year || rightDate.year === leftDate.year && rightDate.subtract({ months: 1 }).month === leftDate.month;
|
|
55
|
-
}, [leftDate, rightDate]);
|
|
56
|
-
return /* @__PURE__ */ jsx("div", { className: clsx("flex w-fit flex-col items-center bg-elevation-fill-default-1", className), children: /* @__PURE__ */ jsxs("div", { className: "flex", children: [
|
|
57
|
-
/* @__PURE__ */ jsxs(
|
|
58
|
-
"div",
|
|
59
|
-
{
|
|
60
|
-
...leftCalendarAriaProps,
|
|
61
|
-
ref: leftRef,
|
|
62
|
-
className: "flex flex-col items-center",
|
|
63
|
-
children: [
|
|
64
|
-
/* @__PURE__ */ jsx(
|
|
65
|
-
CalendarSelectHeader,
|
|
66
|
-
{
|
|
67
|
-
state: leftCalendarState,
|
|
68
|
-
isNextMonthDisabled: isNextDisabled,
|
|
69
|
-
isNextYearDisabled: isNextDisabled,
|
|
70
|
-
onNavigate: handleLeftNavigate,
|
|
71
|
-
maxDate: rightDate
|
|
72
|
-
}
|
|
73
|
-
),
|
|
74
|
-
/* @__PURE__ */ jsx(
|
|
75
|
-
CalendarGrid,
|
|
76
|
-
{
|
|
77
|
-
state: leftCalendarState,
|
|
78
|
-
onApply,
|
|
79
|
-
shouldCloseOnSelect: false,
|
|
80
|
-
onDateSelection,
|
|
81
|
-
rangeSelection,
|
|
82
|
-
onDateHover,
|
|
83
|
-
hoverDate,
|
|
84
|
-
onKeyboardNavigation: handleLeftKeyboardNavigation,
|
|
85
|
-
className: "!w-[304px] h-64",
|
|
86
|
-
calendarSide: "left"
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
),
|
|
92
|
-
/* @__PURE__ */ jsxs(
|
|
93
|
-
"div",
|
|
94
|
-
{
|
|
95
|
-
...rightCalendarAriaProps,
|
|
96
|
-
ref: rightRef,
|
|
97
|
-
className: "hidden flex-col items-center md:flex",
|
|
98
|
-
children: [
|
|
99
|
-
/* @__PURE__ */ jsx(
|
|
100
|
-
CalendarSelectHeader,
|
|
101
|
-
{
|
|
102
|
-
state: rightCalendarState,
|
|
103
|
-
isPrevMonthDisabled: isPrevDisabled,
|
|
104
|
-
isPrevYearDisabled: isPrevDisabled,
|
|
105
|
-
onNavigate: handleRightNavigate,
|
|
106
|
-
minDate: leftDate
|
|
107
|
-
}
|
|
108
|
-
),
|
|
109
|
-
/* @__PURE__ */ jsx(
|
|
110
|
-
CalendarGrid,
|
|
111
|
-
{
|
|
112
|
-
state: rightCalendarState,
|
|
113
|
-
onApply,
|
|
114
|
-
shouldCloseOnSelect: false,
|
|
115
|
-
onDateSelection,
|
|
116
|
-
rangeSelection,
|
|
117
|
-
onDateHover,
|
|
118
|
-
hoverDate,
|
|
119
|
-
onKeyboardNavigation: handleRightKeyboardNavigation,
|
|
120
|
-
className: "!w-[304px] h-64",
|
|
121
|
-
calendarSide: "right"
|
|
122
|
-
}
|
|
123
|
-
)
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
)
|
|
127
|
-
] }) });
|
|
128
|
-
};
|
|
129
|
-
export {
|
|
130
|
-
RangeCalendar
|
|
131
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { DateSegmentItem } from "./DateSegmentItem.js";
|
|
3
|
-
const TimeField = ({ ref, fieldProps, state, isDisabled, hidePlaceholder }) => {
|
|
4
|
-
return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
5
|
-
"div",
|
|
6
|
-
{
|
|
7
|
-
...fieldProps,
|
|
8
|
-
ref,
|
|
9
|
-
className: "flex",
|
|
10
|
-
children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(
|
|
11
|
-
DateSegmentItem,
|
|
12
|
-
{
|
|
13
|
-
segment,
|
|
14
|
-
state,
|
|
15
|
-
isDisabled,
|
|
16
|
-
timePickerOnly: true,
|
|
17
|
-
hidePlaceholder
|
|
18
|
-
},
|
|
19
|
-
i
|
|
20
|
-
))
|
|
21
|
-
}
|
|
22
|
-
) });
|
|
23
|
-
};
|
|
24
|
-
export {
|
|
25
|
-
TimeField
|
|
26
|
-
};
|