@povio/ui 2.1.14 → 2.1.16
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 +80 -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 +197 -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 +209 -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
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Time } from "@internationalized/date";
|
|
3
|
-
import { useTimeFieldState } from "@react-stately/datepicker";
|
|
4
|
-
import { clsx } from "clsx";
|
|
5
|
-
import { useRef, useEffect } from "react";
|
|
6
|
-
import { useLocale, useTimeField, useDateSegment } from "react-aria";
|
|
7
|
-
import { ChevronDownIcon } from "../../../../assets/icons/ChevronDown.js";
|
|
8
|
-
import { ChevronUpIcon } from "../../../../assets/icons/ChevronUp.js";
|
|
9
|
-
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
10
|
-
import { getPlaceholder } from "./DateSegmentItem.js";
|
|
11
|
-
import { Typography } from "../../../text/Typography/Typography.js";
|
|
12
|
-
import { useBreakpoint } from "../../../../hooks/useBreakpoint.js";
|
|
13
|
-
import { useLongPressRepeat } from "../../../../hooks/useLongPressRepeat.js";
|
|
14
|
-
const 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) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
return index === innerState.segments.findIndex(({ type }) => ["hour", "minute", "dayPeriod"].includes(type));
|
|
34
|
-
};
|
|
35
|
-
return /* @__PURE__ */ jsxs("div", { className: "w-full p-8", children: [
|
|
36
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center gap-4", children: innerState.segments.map((segment, i) => /* @__PURE__ */ jsx(
|
|
37
|
-
TimeSegmentButton,
|
|
38
|
-
{
|
|
39
|
-
segment,
|
|
40
|
-
state: innerState,
|
|
41
|
-
type: "increment"
|
|
42
|
-
},
|
|
43
|
-
i
|
|
44
|
-
)) }),
|
|
45
|
-
/* @__PURE__ */ jsx(
|
|
46
|
-
"div",
|
|
47
|
-
{
|
|
48
|
-
ref,
|
|
49
|
-
...fieldProps,
|
|
50
|
-
className: "flex items-center justify-center gap-4 py-2",
|
|
51
|
-
children: innerState.segments.map((segment, i) => /* @__PURE__ */ jsx(
|
|
52
|
-
TimeSegmentInput,
|
|
53
|
-
{
|
|
54
|
-
segment,
|
|
55
|
-
state: innerState,
|
|
56
|
-
autoFocus: getAutoFocus(i)
|
|
57
|
-
},
|
|
58
|
-
i
|
|
59
|
-
))
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center gap-4", children: innerState.segments.map((segment, i) => /* @__PURE__ */ jsx(
|
|
63
|
-
TimeSegmentButton,
|
|
64
|
-
{
|
|
65
|
-
segment,
|
|
66
|
-
state: innerState,
|
|
67
|
-
type: "decrement"
|
|
68
|
-
},
|
|
69
|
-
i
|
|
70
|
-
)) })
|
|
71
|
-
] });
|
|
72
|
-
};
|
|
73
|
-
const TimeSegmentInput = ({ segment, state, autoFocus }) => {
|
|
74
|
-
const ref = useRef(null);
|
|
75
|
-
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
76
|
-
const isDesktop = useBreakpoint("md");
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
if (autoFocus) {
|
|
79
|
-
ref.current?.focus();
|
|
80
|
-
}
|
|
81
|
-
}, [autoFocus]);
|
|
82
|
-
if (!["literal", "hour", "minute", "dayPeriod"].includes(segment.type)) {
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
if (segment.type === "literal") {
|
|
86
|
-
if (!showSegmentText(segment.text)) {
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
return /* @__PURE__ */ jsx(
|
|
90
|
-
"div",
|
|
91
|
-
{
|
|
92
|
-
className: "flex flex-col text-center",
|
|
93
|
-
ref,
|
|
94
|
-
children: /* @__PURE__ */ jsx(
|
|
95
|
-
Typography,
|
|
96
|
-
{
|
|
97
|
-
as: "span",
|
|
98
|
-
variant: "prominent-1",
|
|
99
|
-
size: "label-2",
|
|
100
|
-
className: "text-text-default-2",
|
|
101
|
-
children: segment.text
|
|
102
|
-
}
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
return /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center justify-center gap-2", children: /* @__PURE__ */ jsx(
|
|
108
|
-
"div",
|
|
109
|
-
{
|
|
110
|
-
ref,
|
|
111
|
-
...isDesktop && segmentProps,
|
|
112
|
-
className: clsx(
|
|
113
|
-
"w-11 rounded-input-rounding-default bg-input-filled-idle py-input-height-extra-small text-center",
|
|
114
|
-
"font-labels-default text-text-default-3",
|
|
115
|
-
"border border-input-filled-idle border-solid",
|
|
116
|
-
"hover:border-interactive-contained-primary-hover",
|
|
117
|
-
"focus-within:border-interactive-contained-primary-idle focus-within:outline-none"
|
|
118
|
-
),
|
|
119
|
-
children: getPlaceholder(segment) ?? segment.text
|
|
120
|
-
}
|
|
121
|
-
) });
|
|
122
|
-
};
|
|
123
|
-
const TimeSegmentButton = ({ segment, state, type }) => {
|
|
124
|
-
const stateRef = useRef(state);
|
|
125
|
-
useEffect(() => {
|
|
126
|
-
stateRef.current = state;
|
|
127
|
-
}, [state]);
|
|
128
|
-
const onPress = (isLongPress) => {
|
|
129
|
-
if (isLongPress && segment.type === "minute") {
|
|
130
|
-
const currentValue = stateRef.current.segments.find((item) => item.type === "minute")?.value ?? 0;
|
|
131
|
-
const diff = type === "increment" ? INCREMENT_STEP_SIZE : -INCREMENT_STEP_SIZE;
|
|
132
|
-
const newValue = Math.round((currentValue + diff) / INCREMENT_STEP_SIZE) * INCREMENT_STEP_SIZE;
|
|
133
|
-
const normalizedValue = (newValue % 60 + 60) % 60;
|
|
134
|
-
stateRef.current.setSegment(segment.type, normalizedValue);
|
|
135
|
-
} else {
|
|
136
|
-
stateRef.current[type](segment.type);
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
const { onPressStart, onPressEnd } = useLongPressRepeat({
|
|
140
|
-
onPress,
|
|
141
|
-
enabled: segment.type !== "dayPeriod",
|
|
142
|
-
timeout: 300,
|
|
143
|
-
interval: 300
|
|
144
|
-
});
|
|
145
|
-
if (!["literal", "hour", "minute", "dayPeriod"].includes(segment.type)) {
|
|
146
|
-
return null;
|
|
147
|
-
}
|
|
148
|
-
if (segment.type === "literal") {
|
|
149
|
-
if (!showSegmentText(segment.text)) {
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
return /* @__PURE__ */ jsx("div", { className: "flex shrink-0", children: /* @__PURE__ */ jsx(
|
|
153
|
-
Typography,
|
|
154
|
-
{
|
|
155
|
-
as: "span",
|
|
156
|
-
variant: "prominent-1",
|
|
157
|
-
size: "label-2",
|
|
158
|
-
className: "invisible text-text-default-2",
|
|
159
|
-
"aria-hidden": true,
|
|
160
|
-
children: segment.text
|
|
161
|
-
}
|
|
162
|
-
) });
|
|
163
|
-
}
|
|
164
|
-
const Icon = type === "increment" ? ChevronUpIcon : ChevronDownIcon;
|
|
165
|
-
return /* @__PURE__ */ jsx(
|
|
166
|
-
"div",
|
|
167
|
-
{
|
|
168
|
-
className: "flex w-11 select-none items-center justify-center",
|
|
169
|
-
onContextMenu: (e) => e.preventDefault(),
|
|
170
|
-
children: /* @__PURE__ */ jsx(
|
|
171
|
-
InlineIconButton,
|
|
172
|
-
{
|
|
173
|
-
label: "",
|
|
174
|
-
color: "secondary",
|
|
175
|
-
onPressStart,
|
|
176
|
-
onPressEnd,
|
|
177
|
-
icon: Icon
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
}
|
|
181
|
-
);
|
|
182
|
-
};
|
|
183
|
-
const showSegmentText = (text) => !/[\u2066\u2069]/.test(text);
|
|
184
|
-
export {
|
|
185
|
-
TimePickerForm
|
|
186
|
-
};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { useState, useMemo } from "react";
|
|
4
|
-
import { useHover, useFocusWithin, useFocusVisible } from "react-aria";
|
|
5
|
-
import { Button } from "react-aria-components";
|
|
6
|
-
import useMeasure from "react-use-measure";
|
|
7
|
-
import { ClockIcon } from "../../../../assets/icons/Clock.js";
|
|
8
|
-
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
9
|
-
import { TimeField } from "./TimeField.js";
|
|
10
|
-
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
11
|
-
import { InputClear } from "../../shared/InputClear.js";
|
|
12
|
-
import { useInputCva, inputSide } from "../../shared/input.cva.js";
|
|
13
|
-
import { Typography } from "../../../text/Typography/Typography.js";
|
|
14
|
-
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
15
|
-
const TimePickerInput = ({
|
|
16
|
-
ref,
|
|
17
|
-
as,
|
|
18
|
-
fieldProps,
|
|
19
|
-
state,
|
|
20
|
-
isDisabled,
|
|
21
|
-
isInvalid,
|
|
22
|
-
disableDropdown,
|
|
23
|
-
variant,
|
|
24
|
-
size,
|
|
25
|
-
isClearable,
|
|
26
|
-
headerProps,
|
|
27
|
-
disableManualEntry,
|
|
28
|
-
placeholder,
|
|
29
|
-
onPress,
|
|
30
|
-
...props
|
|
31
|
-
}) => {
|
|
32
|
-
const inputCva = useInputCva();
|
|
33
|
-
const uiStyle = UIStyle.useConfig();
|
|
34
|
-
const inputSideCva = uiStyle?.input?.sideCva ?? inputSide;
|
|
35
|
-
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
36
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
37
|
-
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
38
|
-
const { isFocusVisible } = useFocusVisible();
|
|
39
|
-
const [labelContentRef, { width: labelWidth }] = useMeasure();
|
|
40
|
-
const hidePlaceholder = as === "floating" && !state.value && !isFocused;
|
|
41
|
-
const style = useMemo(() => {
|
|
42
|
-
const paddingLeft = as === "filter" ? `calc(var(${inputSideCva({ size, type: "var" })}) + ${labelWidth}px)` : "0px";
|
|
43
|
-
return {
|
|
44
|
-
paddingLeft
|
|
45
|
-
};
|
|
46
|
-
}, [labelWidth, as, size, inputSideCva]);
|
|
47
|
-
const canClear = state.segments.some((segment) => segment.type !== "literal" && segment.isPlaceholder === false);
|
|
48
|
-
return /* @__PURE__ */ jsxs(
|
|
49
|
-
"div",
|
|
50
|
-
{
|
|
51
|
-
ref,
|
|
52
|
-
className: inputCva({
|
|
53
|
-
variant,
|
|
54
|
-
as,
|
|
55
|
-
size,
|
|
56
|
-
...props,
|
|
57
|
-
className: clsx(
|
|
58
|
-
"group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2"
|
|
59
|
-
)
|
|
60
|
-
}),
|
|
61
|
-
"data-rac": "",
|
|
62
|
-
"data-hovered": isHovered || void 0,
|
|
63
|
-
"data-disabled": isDisabled || void 0,
|
|
64
|
-
"data-invalid": isInvalid || void 0,
|
|
65
|
-
"data-is-empty": state.value === null || void 0,
|
|
66
|
-
"data-focus-within": isFocused || void 0,
|
|
67
|
-
"data-focus-visible": isFocused && isFocusVisible || void 0,
|
|
68
|
-
"data-has-selection": state.value !== null || void 0,
|
|
69
|
-
...fieldProps,
|
|
70
|
-
...focusWithinProps,
|
|
71
|
-
...hoverProps,
|
|
72
|
-
children: [
|
|
73
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
74
|
-
disableManualEntry && /* @__PURE__ */ jsx(
|
|
75
|
-
Button,
|
|
76
|
-
{
|
|
77
|
-
onPress,
|
|
78
|
-
className: "absolute inset-0 z-0"
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
|
-
as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(
|
|
82
|
-
FormFieldLabel,
|
|
83
|
-
{
|
|
84
|
-
ref: labelContentRef,
|
|
85
|
-
as,
|
|
86
|
-
...headerProps
|
|
87
|
-
}
|
|
88
|
-
),
|
|
89
|
-
/* @__PURE__ */ jsx("div", { style, children: disableManualEntry && placeholder && !state.value ? /* @__PURE__ */ jsx(
|
|
90
|
-
Typography,
|
|
91
|
-
{
|
|
92
|
-
size: "label-1",
|
|
93
|
-
className: "text-text-default-3",
|
|
94
|
-
children: placeholder
|
|
95
|
-
}
|
|
96
|
-
) : /* @__PURE__ */ jsx(
|
|
97
|
-
TimeField,
|
|
98
|
-
{
|
|
99
|
-
fieldProps,
|
|
100
|
-
state,
|
|
101
|
-
isDisabled,
|
|
102
|
-
hidePlaceholder
|
|
103
|
-
}
|
|
104
|
-
) })
|
|
105
|
-
] }),
|
|
106
|
-
/* @__PURE__ */ jsxs("div", { className: clsx("relative z-1 flex items-center gap-2", as === "floating" && "-mt-4"), children: [
|
|
107
|
-
isClearable && canClear && /* @__PURE__ */ jsx(InputClear, { onClear: () => state.setValue(null) }),
|
|
108
|
-
(!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(
|
|
109
|
-
InlineIconButton,
|
|
110
|
-
{
|
|
111
|
-
label: "",
|
|
112
|
-
color: "secondary",
|
|
113
|
-
onPress,
|
|
114
|
-
icon: ClockIcon,
|
|
115
|
-
isDisabled
|
|
116
|
-
}
|
|
117
|
-
)
|
|
118
|
-
] })
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
);
|
|
122
|
-
};
|
|
123
|
-
export {
|
|
124
|
-
TimePickerInput
|
|
125
|
-
};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { today } from "@internationalized/date";
|
|
3
|
-
import { useDateFormatter } from "@react-aria/i18n";
|
|
4
|
-
import { clsx } from "clsx";
|
|
5
|
-
import { useMemo } from "react";
|
|
6
|
-
import { ListBox, ListBoxItem } from "react-aria-components";
|
|
7
|
-
import { Typography } from "../../../text/Typography/Typography.js";
|
|
8
|
-
import { useScrollableListBox } from "../../../../hooks/useScrollableListBox.js";
|
|
9
|
-
const YearPicker = ({ state, onSelectionChange }) => {
|
|
10
|
-
const formatter = useDateFormatter({
|
|
11
|
-
year: "numeric",
|
|
12
|
-
timeZone: state.timeZone
|
|
13
|
-
});
|
|
14
|
-
const years = useMemo(() => {
|
|
15
|
-
const arr = [];
|
|
16
|
-
for (let i = -100; i <= 100; i++) {
|
|
17
|
-
const date = today(state.timeZone).add({ years: i });
|
|
18
|
-
arr.push({
|
|
19
|
-
value: date.year,
|
|
20
|
-
formatted: formatter.format(date.toDate(state.timeZone))
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
return arr;
|
|
24
|
-
}, [state.timeZone, formatter]);
|
|
25
|
-
const isYearDisabled = (year) => {
|
|
26
|
-
if (state.minValue && year < state.minValue.year) {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
if (state.maxValue && year > state.maxValue.year) {
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
return false;
|
|
33
|
-
};
|
|
34
|
-
const selectedYear = years.findIndex((year) => year.value === state.focusedDate.year);
|
|
35
|
-
const { ref } = useScrollableListBox();
|
|
36
|
-
return /* @__PURE__ */ jsx(
|
|
37
|
-
ListBox,
|
|
38
|
-
{
|
|
39
|
-
ref,
|
|
40
|
-
autoFocus: true,
|
|
41
|
-
"aria-label": "Year",
|
|
42
|
-
selectionMode: "single",
|
|
43
|
-
selectedKeys: [selectedYear],
|
|
44
|
-
onSelectionChange: (key) => {
|
|
45
|
-
if (key === "all") {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const index = [...key][0];
|
|
49
|
-
if (typeof index === "number") {
|
|
50
|
-
const date = state.focusedDate.set({ year: years[index].value });
|
|
51
|
-
state.setFocusedDate(date);
|
|
52
|
-
}
|
|
53
|
-
onSelectionChange(key);
|
|
54
|
-
},
|
|
55
|
-
className: "h-80 max-h-full min-h-0 w-full shrink-0 overflow-y-auto md:h-72 md:w-80",
|
|
56
|
-
children: years.map((year, index) => {
|
|
57
|
-
const isDisabled = isYearDisabled(year.value);
|
|
58
|
-
return /* @__PURE__ */ jsx(
|
|
59
|
-
ListBoxItem,
|
|
60
|
-
{
|
|
61
|
-
id: index,
|
|
62
|
-
textValue: year.formatted,
|
|
63
|
-
isDisabled,
|
|
64
|
-
className: clsx(
|
|
65
|
-
"flex px-4 py-2 text-interactive-text-secondary-idle outline-none",
|
|
66
|
-
"border-elevation-outline-default-1 border-b border-solid bg-elevation-fill-default-1 last:border-b-0",
|
|
67
|
-
"hover:text-interactive-text-secondary-hover",
|
|
68
|
-
"selected:bg-interactive-contained-primary-idle selected:text-interactive-text-secondary-idle-inverted",
|
|
69
|
-
"focus-visible:bg-interactive-contained-primary-focus focus-visible:text-interactive-text-secondary-idle-inverted",
|
|
70
|
-
isDisabled ? "cursor-default opacity-50" : "cursor-pointer"
|
|
71
|
-
),
|
|
72
|
-
children: /* @__PURE__ */ jsx(
|
|
73
|
-
Typography,
|
|
74
|
-
{
|
|
75
|
-
as: "span",
|
|
76
|
-
size: "label-2",
|
|
77
|
-
children: year.formatted
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
},
|
|
81
|
-
index
|
|
82
|
-
);
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
export {
|
|
88
|
-
YearPicker
|
|
89
|
-
};
|
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { mergeRefs, useLabels } from "@react-aria/utils";
|
|
3
|
-
import { clsx } from "clsx";
|
|
4
|
-
import { useState, useCallback } from "react";
|
|
5
|
-
import { DropZone } from "react-aria-components";
|
|
6
|
-
import { Controller } from "react-hook-form";
|
|
7
|
-
import { useTranslation } from "react-i18next";
|
|
8
|
-
import { FormField } from "../FormField/FormField.js";
|
|
9
|
-
import { ns } from "../../../config/i18n.js";
|
|
10
|
-
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
11
|
-
import { FileUtils } from "../../../utils/file.utils.js";
|
|
12
|
-
import { FileCardList } from "./shared/FileCardList.js";
|
|
13
|
-
import { FileUploadContent } from "./shared/FileUploadContent.js";
|
|
14
|
-
import { FileUploadContentEmpty } from "./shared/FileUploadContentEmpty.js";
|
|
15
|
-
import { fileUploadDropZone } from "./shared/fileUpload.cva.js";
|
|
16
|
-
const FileUploadBase = (props) => {
|
|
17
|
-
const { t } = useTranslation(ns);
|
|
18
|
-
const {
|
|
19
|
-
ref: _ref,
|
|
20
|
-
label,
|
|
21
|
-
tooltipText,
|
|
22
|
-
variant = "vertical",
|
|
23
|
-
as = "button",
|
|
24
|
-
helperText,
|
|
25
|
-
isRequired,
|
|
26
|
-
isDisabled,
|
|
27
|
-
headerClassName,
|
|
28
|
-
errorClassName,
|
|
29
|
-
isHeaderHidden,
|
|
30
|
-
error,
|
|
31
|
-
className,
|
|
32
|
-
allowsMultiple = false,
|
|
33
|
-
hideLabel,
|
|
34
|
-
acceptedFileTypes,
|
|
35
|
-
emptyText = t(($) => $.ui.fileUpload.emptyText),
|
|
36
|
-
uploadText = t(($) => $.ui.fileUpload.uploadText),
|
|
37
|
-
browseText = t(($) => $.ui.fileUpload.browse),
|
|
38
|
-
fileUpload,
|
|
39
|
-
fileRemove,
|
|
40
|
-
children,
|
|
41
|
-
listRenderer,
|
|
42
|
-
onInvalidFileType,
|
|
43
|
-
...rest
|
|
44
|
-
} = props;
|
|
45
|
-
const ui = UIConfig.useConfig();
|
|
46
|
-
const [uploadState, setUploadState] = useState(props.value ?? []);
|
|
47
|
-
const formFieldProps = {
|
|
48
|
-
error,
|
|
49
|
-
label,
|
|
50
|
-
tooltipText,
|
|
51
|
-
helperText,
|
|
52
|
-
isRequired,
|
|
53
|
-
isHeaderHidden,
|
|
54
|
-
hideLabel: hideLabel ?? ui.input.hideLabel,
|
|
55
|
-
isDisabled,
|
|
56
|
-
headerClassName,
|
|
57
|
-
errorClassName
|
|
58
|
-
};
|
|
59
|
-
const labelProps = useLabels({ "aria-label": label });
|
|
60
|
-
const handleUpload = async (inputFiles) => {
|
|
61
|
-
const acceptedFiles = inputFiles.filter((file) => FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
|
|
62
|
-
const invalidFiles = inputFiles.filter((file) => !FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
|
|
63
|
-
if (invalidFiles.length > 0) {
|
|
64
|
-
if (allowsMultiple) {
|
|
65
|
-
onInvalidFileType?.(invalidFiles.map((file) => file.name));
|
|
66
|
-
} else {
|
|
67
|
-
onInvalidFileType?.(invalidFiles[0].name);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (acceptedFiles.length === 0 || !fileUpload) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (!allowsMultiple) {
|
|
74
|
-
setUploadState([]);
|
|
75
|
-
}
|
|
76
|
-
const newUploadState = [];
|
|
77
|
-
acceptedFiles.forEach((file) => {
|
|
78
|
-
newUploadState.push({ state: "uploading", progress: 0, file, abortController: new AbortController() });
|
|
79
|
-
});
|
|
80
|
-
const startIndex = allowsMultiple ? uploadState.length : 0;
|
|
81
|
-
setUploadState((prev) => [...prev, ...newUploadState]);
|
|
82
|
-
const promises = [];
|
|
83
|
-
acceptedFiles.forEach(async (file, index) => {
|
|
84
|
-
promises.push(
|
|
85
|
-
fileUpload(
|
|
86
|
-
{
|
|
87
|
-
data: {
|
|
88
|
-
resourceName: file.name,
|
|
89
|
-
fileName: file.name,
|
|
90
|
-
fileSize: file.size,
|
|
91
|
-
method: "put"
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
file,
|
|
95
|
-
{
|
|
96
|
-
onUploadProgress: ({ loaded, total }) => {
|
|
97
|
-
if (total == null) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
const progress = Math.round(loaded / total * 100);
|
|
101
|
-
setUploadState(
|
|
102
|
-
(prev) => prev.map((state, i) => i === startIndex + index ? { ...state, progress } : state)
|
|
103
|
-
);
|
|
104
|
-
},
|
|
105
|
-
abortController: newUploadState[index]?.abortController
|
|
106
|
-
}
|
|
107
|
-
)
|
|
108
|
-
);
|
|
109
|
-
});
|
|
110
|
-
const response = await Promise.all(promises);
|
|
111
|
-
response.forEach((res, index) => {
|
|
112
|
-
setUploadState(
|
|
113
|
-
(prev) => prev.map((state, i) => i === startIndex + index ? { ...state, state: "uploaded", id: res.id } : state)
|
|
114
|
-
);
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
const handleSelect = (inputFiles) => {
|
|
118
|
-
if (!inputFiles) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
const filesArray = Array.from(inputFiles);
|
|
122
|
-
handleUpload(filesArray);
|
|
123
|
-
};
|
|
124
|
-
const handleDrop = async (e) => {
|
|
125
|
-
if (!e.items) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const promises = [];
|
|
129
|
-
e.items.forEach((item) => {
|
|
130
|
-
if (item.kind === "file") {
|
|
131
|
-
promises.push(item.getFile());
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
const inputFiles = await Promise.all(promises);
|
|
135
|
-
handleUpload(inputFiles);
|
|
136
|
-
};
|
|
137
|
-
const handleRemove = useCallback(
|
|
138
|
-
(id) => {
|
|
139
|
-
fileRemove?.({ id });
|
|
140
|
-
setUploadState((prev) => prev.filter((state) => state.id !== id));
|
|
141
|
-
},
|
|
142
|
-
[fileRemove]
|
|
143
|
-
);
|
|
144
|
-
const handleCancelUpload = useCallback(
|
|
145
|
-
(index) => {
|
|
146
|
-
const findState = uploadState[index];
|
|
147
|
-
if (findState) {
|
|
148
|
-
findState.abortController?.abort("canceled by user");
|
|
149
|
-
setUploadState((prev) => prev.filter((_, i) => i !== index));
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
[uploadState]
|
|
153
|
-
);
|
|
154
|
-
return /* @__PURE__ */ jsxs(
|
|
155
|
-
FormField,
|
|
156
|
-
{
|
|
157
|
-
...formFieldProps,
|
|
158
|
-
labelProps,
|
|
159
|
-
className: clsx("w-full", className),
|
|
160
|
-
children: [
|
|
161
|
-
/* @__PURE__ */ jsx("div", { className: "flex w-full items-center justify-between gap-input-gap-input-to-button-gap", children: /* @__PURE__ */ jsx(
|
|
162
|
-
DropZone,
|
|
163
|
-
{
|
|
164
|
-
...rest,
|
|
165
|
-
"data-rac": "",
|
|
166
|
-
"data-disabled": isDisabled || void 0,
|
|
167
|
-
"data-invalid": !!error || void 0,
|
|
168
|
-
"data-multiple": allowsMultiple || void 0,
|
|
169
|
-
"data-has-files": uploadState.length > 0 || void 0,
|
|
170
|
-
isDisabled,
|
|
171
|
-
onDrop: handleDrop,
|
|
172
|
-
className: fileUploadDropZone({ variant, isContainer: !!children, className: "group/file-upload-drop-zone" }),
|
|
173
|
-
children: children ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
174
|
-
children({
|
|
175
|
-
files: uploadState,
|
|
176
|
-
onRemove: handleRemove,
|
|
177
|
-
onCancel: handleCancelUpload
|
|
178
|
-
}),
|
|
179
|
-
/* @__PURE__ */ jsx(
|
|
180
|
-
FileUploadContentEmpty,
|
|
181
|
-
{
|
|
182
|
-
as,
|
|
183
|
-
variant,
|
|
184
|
-
singleFile: true,
|
|
185
|
-
hideButton: true,
|
|
186
|
-
isDisabled,
|
|
187
|
-
title: emptyText,
|
|
188
|
-
uploadText,
|
|
189
|
-
browseText,
|
|
190
|
-
className: "group-drop-target/file-upload-drop-zone:flex! absolute top-1/2 left-1/2 z-50 hidden -translate-x-1/2 -translate-y-1/2 flex-col"
|
|
191
|
-
}
|
|
192
|
-
)
|
|
193
|
-
] }) : /* @__PURE__ */ jsx(
|
|
194
|
-
FileUploadContent,
|
|
195
|
-
{
|
|
196
|
-
...rest,
|
|
197
|
-
variant,
|
|
198
|
-
as,
|
|
199
|
-
isDisabled,
|
|
200
|
-
browseText,
|
|
201
|
-
uploadText,
|
|
202
|
-
emptyText,
|
|
203
|
-
uploadState,
|
|
204
|
-
handleSelect,
|
|
205
|
-
handleCancelUpload,
|
|
206
|
-
handleRemove,
|
|
207
|
-
acceptedFileTypes,
|
|
208
|
-
allowsMultiple
|
|
209
|
-
}
|
|
210
|
-
)
|
|
211
|
-
}
|
|
212
|
-
) }),
|
|
213
|
-
!children && allowsMultiple && uploadState.length > 0 && (listRenderer ? listRenderer({
|
|
214
|
-
files: uploadState,
|
|
215
|
-
onRemove: handleRemove,
|
|
216
|
-
onCancel: handleCancelUpload
|
|
217
|
-
}) : /* @__PURE__ */ jsx(
|
|
218
|
-
FileCardList,
|
|
219
|
-
{
|
|
220
|
-
as,
|
|
221
|
-
uploadState,
|
|
222
|
-
isDisabled,
|
|
223
|
-
onRemove: handleRemove,
|
|
224
|
-
onCancel: handleCancelUpload
|
|
225
|
-
}
|
|
226
|
-
))
|
|
227
|
-
]
|
|
228
|
-
}
|
|
229
|
-
);
|
|
230
|
-
};
|
|
231
|
-
const FileUpload = (props) => {
|
|
232
|
-
if ("formControl" in props && props.formControl) {
|
|
233
|
-
const { formControl, ref, ...innerProps } = props;
|
|
234
|
-
return /* @__PURE__ */ jsx(
|
|
235
|
-
Controller,
|
|
236
|
-
{
|
|
237
|
-
control: formControl.control,
|
|
238
|
-
name: formControl.name,
|
|
239
|
-
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(
|
|
240
|
-
FileUploadBase,
|
|
241
|
-
{
|
|
242
|
-
...innerProps,
|
|
243
|
-
ref: mergeRefs(ref, field.ref),
|
|
244
|
-
value: field.value,
|
|
245
|
-
onChange: field.onChange,
|
|
246
|
-
isDisabled: field.disabled || props.isDisabled,
|
|
247
|
-
error: props.error ?? error?.message
|
|
248
|
-
}
|
|
249
|
-
)
|
|
250
|
-
}
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
return /* @__PURE__ */ jsx(FileUploadBase, { ...props });
|
|
254
|
-
};
|
|
255
|
-
export {
|
|
256
|
-
FileUpload
|
|
257
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { FileUpload } from "./FileUpload.js";
|
|
3
|
-
const FileUploadContainer = (props) => {
|
|
4
|
-
return /* @__PURE__ */ jsx(
|
|
5
|
-
FileUpload,
|
|
6
|
-
{
|
|
7
|
-
label: "",
|
|
8
|
-
hideLabel: true,
|
|
9
|
-
variant: "vertical",
|
|
10
|
-
as: "button",
|
|
11
|
-
...props
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
FileUploadContainer
|
|
17
|
-
};
|