@povio/ui 0.0.8 → 0.0.10
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/dist/assets/icons/AlignCenter.js +21 -0
- package/dist/assets/icons/AlignLeft.js +21 -0
- package/dist/assets/icons/AlignLeftRight.js +21 -0
- package/dist/assets/icons/AlignRight.js +21 -0
- package/dist/assets/icons/ArrowDropDown.js +21 -0
- package/dist/assets/icons/ArrowDropUp.js +21 -0
- package/dist/assets/icons/ArrowLeft.js +21 -0
- package/dist/assets/icons/ArrowRight.js +21 -0
- package/dist/assets/icons/Bold.js +21 -0
- package/dist/assets/icons/BulletedList.js +21 -0
- package/dist/assets/icons/Calendar.js +23 -0
- package/dist/assets/icons/Check.js +23 -0
- package/dist/assets/icons/CheckCircle.js +21 -0
- package/dist/assets/icons/CheckboxCheckmark.js +24 -0
- package/dist/assets/icons/CheckboxIndeterminate.js +24 -0
- package/dist/assets/icons/ChevronDown.js +23 -0
- package/dist/assets/icons/ChevronLeft.js +23 -0
- package/dist/assets/icons/ChevronRight.js +23 -0
- package/dist/assets/icons/ChevronUp.js +23 -0
- package/dist/assets/icons/ChevronsLeft.js +23 -0
- package/dist/assets/icons/ChevronsRight.js +23 -0
- package/dist/assets/icons/Clock.js +21 -0
- package/dist/assets/icons/Close.js +21 -0
- package/dist/assets/icons/DateTime.js +32 -0
- package/dist/assets/icons/Drag.js +21 -0
- package/dist/assets/icons/File.js +23 -0
- package/dist/assets/icons/Highlight.js +21 -0
- package/dist/assets/icons/HighlightOn.js +30 -0
- package/dist/assets/icons/Info.js +32 -0
- package/dist/assets/icons/Italic.js +21 -0
- package/dist/assets/icons/Link.js +21 -0
- package/dist/assets/icons/Menu.js +21 -0
- package/dist/assets/icons/NumberedList.js +21 -0
- package/dist/assets/icons/PointerHorizontal.js +21 -0
- package/dist/assets/icons/PointerVertical.js +21 -0
- package/dist/assets/icons/Send.js +23 -0
- package/dist/assets/icons/Strikethrough.js +21 -0
- package/dist/assets/icons/TextColor.js +30 -0
- package/dist/assets/icons/Today.js +21 -0
- package/dist/assets/icons/Underlined.js +23 -0
- package/dist/assets/icons/Upload.js +30 -0
- package/dist/assets/icons/View.js +18 -0
- package/dist/assets/icons/ViewOff.js +18 -0
- package/dist/assets/icons/WarningFilled.js +23 -0
- package/dist/assets/locales/en/translation.json.js +14 -0
- package/dist/assets/locales/sl/translation.json.js +14 -0
- package/dist/components/Menu/Menu.js +14 -0
- package/{src → dist}/components/Menu/MenuDesktop.d.ts +1 -1
- package/dist/components/Menu/MenuDesktop.js +68 -0
- package/{src → dist}/components/Menu/MenuItem.d.ts +1 -1
- package/dist/components/Menu/MenuItem.js +33 -0
- package/{src → dist}/components/Menu/MenuMobile.d.ts +1 -1
- package/dist/components/Menu/MenuMobile.js +78 -0
- package/{src → dist}/components/Menu/MenuPopover.d.ts +1 -1
- package/dist/components/Menu/MenuPopover.js +38 -0
- package/{src → dist}/components/buttons/Button/Button.d.ts +1 -1
- package/dist/components/buttons/Button/Button.js +68 -0
- package/{src → dist}/components/buttons/Button/button.cva.d.ts +1 -1
- package/dist/components/buttons/Button/button.cva.js +672 -0
- package/{src → dist}/components/buttons/IconButton/IconButton.d.ts +1 -1
- package/dist/components/buttons/IconButton/IconButton.js +17 -0
- package/{src → dist}/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +18 -0
- package/{src → dist}/components/buttons/PillButton/PillButton.d.ts +2 -2
- package/dist/components/buttons/PillButton/PillButton.js +44 -0
- package/{src → dist}/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/buttons/PillButton/pillButton.cva.js +86 -0
- package/{src → dist}/components/buttons/SplitButton/SplitButton.d.ts +2 -2
- package/dist/components/buttons/SplitButton/SplitButton.js +62 -0
- package/{src → dist}/components/buttons/TextButton/TextButton.d.ts +3 -3
- package/dist/components/buttons/TextButton/TextButton.js +18 -0
- package/{src → dist}/components/buttons/ToggleButton/ToggleButton.d.ts +3 -3
- package/dist/components/buttons/ToggleButton/ToggleButton.js +21 -0
- package/{src → dist}/components/buttons/shared/ButtonContent.d.ts +3 -3
- package/dist/components/buttons/shared/ButtonContent.js +53 -0
- package/dist/components/buttons/shared/buttonContent.cva.js +16 -0
- package/{src → dist}/components/inputs/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/inputs/Checkbox/Checkbox.js +81 -0
- package/{src → dist}/components/inputs/Checkbox/CheckboxCheckmark.d.ts +1 -1
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +49 -0
- package/{src → dist}/components/inputs/Checkbox/checkbox.cva.d.ts +1 -1
- package/dist/components/inputs/Checkbox/checkbox.cva.js +47 -0
- package/{src → dist}/components/inputs/DateTime/DatePicker/DatePicker.d.ts +3 -3
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +245 -0
- package/{src → dist}/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +683 -0
- package/{src → dist}/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +3 -3
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +259 -0
- package/{src → dist}/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +232 -0
- package/dist/components/inputs/DateTime/shared/Calendar.js +85 -0
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +160 -0
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +67 -0
- package/{src → dist}/components/inputs/DateTime/shared/CalendarHeader.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +89 -0
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +203 -0
- package/dist/components/inputs/DateTime/shared/DateField.js +62 -0
- package/{src → dist}/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -2
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +175 -0
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +55 -0
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +76 -0
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +41 -0
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +82 -0
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +131 -0
- package/dist/components/inputs/DateTime/shared/TimeField.js +26 -0
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +186 -0
- package/{src → dist}/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +115 -0
- package/dist/components/inputs/DateTime/shared/YearPicker.js +89 -0
- package/dist/components/inputs/File/FileUpload.js +254 -0
- package/dist/components/inputs/File/FileUploadContainer.js +17 -0
- package/dist/components/inputs/File/InputUpload.js +176 -0
- package/{src → dist}/components/inputs/File/fileUpload.types.d.ts +3 -3
- package/{src → dist}/components/inputs/File/inputUpload.types.d.ts +2 -2
- package/{src → dist}/components/inputs/File/shared/FileCard.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +67 -0
- package/{src → dist}/components/inputs/File/shared/FileCardList.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCardList.js +20 -0
- package/dist/components/inputs/File/shared/FileProgressBar.js +32 -0
- package/{src → dist}/components/inputs/File/shared/FileUploadContent.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileUploadContent.js +92 -0
- package/{src → dist}/components/inputs/File/shared/FileUploadContentEmpty.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +92 -0
- package/{src → dist}/components/inputs/File/shared/FileUploadContentError.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentError.js +167 -0
- package/{src → dist}/components/inputs/File/shared/FileUploadContentFilled.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +176 -0
- package/{src → dist}/components/inputs/File/shared/FileUploadContentLoading.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +128 -0
- package/{src → dist}/components/inputs/File/shared/InputUploadContent.d.ts +1 -1
- package/dist/components/inputs/File/shared/InputUploadContent.js +74 -0
- package/dist/components/inputs/File/shared/InputUploadFilled.js +45 -0
- package/dist/components/inputs/File/shared/fileUpload.cva.js +58 -0
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +49 -0
- package/{src → dist}/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +54 -0
- package/dist/components/inputs/FormField/FormFieldError.js +16 -0
- package/dist/components/inputs/FormField/FormFieldHeader.js +57 -0
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +20 -0
- package/{src → dist}/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +37 -0
- package/{src → dist}/components/inputs/Input/NumberInput/NumberInput.d.ts +4 -4
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +166 -0
- package/{src → dist}/components/inputs/Input/PasswordInput/PasswordInput.d.ts +2 -2
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +26 -0
- package/{src → dist}/components/inputs/Input/TextArea/TextArea.d.ts +3 -3
- package/dist/components/inputs/Input/TextArea/TextArea.js +155 -0
- package/{src → dist}/components/inputs/Input/TextInput/TextInput.d.ts +4 -4
- package/dist/components/inputs/Input/TextInput/TextInput.js +162 -0
- package/{src → dist}/components/inputs/Input/shared/InputContent.d.ts +3 -3
- package/dist/components/inputs/Input/shared/InputContent.js +114 -0
- package/{src → dist}/components/inputs/Inputs/Form.d.ts +2 -2
- package/dist/components/inputs/Inputs/Form.js +68 -0
- package/{src → dist}/components/inputs/Inputs/InputItem.d.ts +16 -16
- package/dist/components/inputs/Inputs/InputItem.js +63 -0
- package/dist/components/inputs/Inputs/Inputs.js +32 -0
- package/{src → dist}/components/inputs/RadioGroup/RadioGroup.d.ts +3 -3
- package/dist/components/inputs/RadioGroup/RadioGroup.js +113 -0
- package/{src → dist}/components/inputs/RadioGroup/radio.cva.d.ts +1 -1
- package/dist/components/inputs/RadioGroup/radio.cva.js +47 -0
- package/{src → dist}/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +3 -3
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +39 -0
- package/{src → dist}/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +25 -0
- package/{src → dist}/components/inputs/Selection/Select/Select.d.ts +3 -3
- package/dist/components/inputs/Selection/Select/Select.js +32 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectBase.d.ts +4 -3
- package/dist/components/inputs/Selection/shared/SelectBase.js +27 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +223 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectInput.d.ts +6 -6
- package/dist/components/inputs/Selection/shared/SelectInput.js +234 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectInputTags.d.ts +4 -3
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +49 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +127 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectListBoxItem.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +78 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectListBoxItemSelectAll.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +45 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectListBoxLoadingItem.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +47 -0
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +42 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +165 -0
- package/{src → dist}/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +244 -0
- package/{src → dist}/components/inputs/Selection/shared/select.types.d.ts +1 -1
- package/{src → dist}/components/inputs/Selection/shared/useSelectItems.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/useSelectItems.js +94 -0
- package/{src → dist}/components/inputs/Slider/Slider.d.ts +2 -2
- package/dist/components/inputs/Slider/Slider.js +137 -0
- package/{src → dist}/components/inputs/TextEditor/TextEditor.d.ts +2 -2
- package/dist/components/inputs/TextEditor/TextEditor.js +223 -0
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +34 -0
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +80 -0
- package/{src → dist}/components/inputs/TextEditor/Toolbar/HyperlinkAction.d.ts +1 -1
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +92 -0
- package/{src → dist}/components/inputs/TextEditor/Toolbar/TextAlignSelect.d.ts +1 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +56 -0
- package/{src → dist}/components/inputs/TextEditor/Toolbar/TextColorSelect.d.ts +1 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +33 -0
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +31 -0
- package/{src → dist}/components/inputs/TextEditor/Toolbar/TextHighlightSelect.d.ts +1 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +37 -0
- package/{src → dist}/components/inputs/TextEditor/Toolbar/TextListActions.d.ts +1 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +51 -0
- package/{src → dist}/components/inputs/TextEditor/Toolbar/TextMarksActions.d.ts +1 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +73 -0
- package/{src → dist}/components/inputs/TextEditor/Toolbar/TextStyleSelect.d.ts +1 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +61 -0
- package/dist/components/inputs/TextEditor/textEditor.types.js +40 -0
- package/{src → dist}/components/inputs/Toggle/Toggle.d.ts +3 -3
- package/dist/components/inputs/Toggle/Toggle.js +65 -0
- package/{src → dist}/components/inputs/Toggle/toggle.cva.d.ts +1 -1
- package/dist/components/inputs/Toggle/toggle.cva.js +44 -0
- package/{src → dist}/components/inputs/shared/CheckContent.d.ts +1 -1
- package/dist/components/inputs/shared/CheckContent.js +22 -0
- package/dist/components/inputs/shared/InputClear.js +27 -0
- package/dist/components/inputs/shared/TooltipWrapper.d.ts +8 -0
- package/dist/components/inputs/shared/TooltipWrapper.js +21 -0
- package/dist/components/inputs/shared/input.cva.js +168 -0
- package/{src → dist}/components/inputs/shared/label.cva.d.ts +1 -1
- package/dist/components/inputs/shared/label.cva.js +133 -0
- package/dist/components/outline.clsx.js +11 -0
- package/{src → dist}/components/overlays/ActionModal/ActionModal.d.ts +2 -2
- package/dist/components/overlays/ActionModal/ActionModal.js +80 -0
- package/dist/components/overlays/BottomSheet/BottomSheet.js +261 -0
- package/dist/components/overlays/Drawer/Drawer.js +84 -0
- package/{src → dist}/components/overlays/Modal/Modal.d.ts +1 -1
- package/dist/components/overlays/Modal/Modal.js +53 -0
- package/dist/components/overlays/Modal/modal.cva.js +53 -0
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +71 -0
- package/{src → dist}/components/overlays/Tooltip/Tooltip.d.ts +3 -2
- package/dist/components/overlays/Tooltip/Tooltip.js +72 -0
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +27 -0
- package/dist/components/overlays/Tooltip/tooltip.cva.js +60 -0
- package/dist/components/segment/Segment.js +119 -0
- package/dist/components/segment/SegmentItem.js +43 -0
- package/{src → dist}/components/segment/segment.types.d.ts +1 -1
- package/dist/components/shared/pagination/Pagination.js +75 -0
- package/{src → dist}/components/shared/pagination/PaginationList.d.ts +1 -1
- package/dist/components/shared/pagination/PaginationList.js +145 -0
- package/dist/components/shared/pagination/minWidth.cva.js +15 -0
- package/{src → dist}/components/status/Alert/Alert.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +41 -0
- package/dist/components/status/Alert/alert.cva.js +64 -0
- package/{src → dist}/components/status/Loader/Loader.d.ts +1 -1
- package/dist/components/status/Loader/Loader.js +37 -0
- package/dist/components/status/Loader/loader.cva.js +27 -0
- package/{src → dist}/components/status/Toast/Toast.d.ts +1 -1
- package/dist/components/status/Toast/Toast.js +64 -0
- package/{src → dist}/components/status/Toast/toast.cva.d.ts +1 -1
- package/dist/components/status/Toast/toast.cva.js +150 -0
- package/dist/components/status/Toast/useToast.js +83 -0
- package/dist/components/status/shared/status.cva.js +62 -0
- package/dist/components/table/CellText.js +18 -0
- package/dist/components/table/ColumnConfig.js +124 -0
- package/dist/components/table/HeaderText.js +15 -0
- package/dist/components/table/InfiniteTable.js +40 -0
- package/dist/components/table/PaginatedTable.js +33 -0
- package/dist/components/table/Table.js +370 -0
- package/dist/components/table/table.cva.js +63 -0
- package/{src → dist}/components/text/Link/Link.d.ts +1 -1
- package/dist/components/text/Link/Link.js +18 -0
- package/dist/components/text/Link/link.cva.js +18 -0
- package/{src → dist}/components/text/Tag/Tag.d.ts +1 -1
- package/dist/components/text/Tag/Tag.js +49 -0
- package/dist/components/text/Tag/tag.cva.js +59 -0
- package/{src → dist}/components/text/Typography/Typography.d.ts +1 -1
- package/dist/components/text/Typography/Typography.js +22 -0
- package/dist/components/text/Typography/typography.cva.js +100 -0
- package/{src → dist}/config/confirmation.context.d.ts +1 -1
- package/dist/config/confirmation.context.js +107 -0
- package/dist/config/i18n.js +15 -0
- package/dist/config/router.context.js +43 -0
- package/{src → dist}/config/uiConfig.context.d.ts +9 -9
- package/dist/config/uiConfig.context.js +68 -0
- package/{src → dist}/config/uiStyle.context.d.ts +14 -14
- package/dist/config/uiStyle.context.js +16 -0
- package/dist/helpers/dynamicColumns.js +359 -0
- package/{src → dist}/helpers/dynamicInputs.d.ts +2 -2
- package/dist/helpers/dynamicInputs.js +216 -0
- package/dist/hooks/useAutosave.js +83 -0
- package/dist/hooks/useBreakpoint.js +20 -0
- package/dist/hooks/useDebounceCallback.js +29 -0
- package/dist/hooks/useDeepCompare.js +25 -0
- package/dist/hooks/useFilters.js +120 -0
- package/dist/hooks/useForm.js +22 -0
- package/{src → dist}/hooks/useFormAutosave.d.ts +2 -2
- package/dist/hooks/useFormAutosave.js +67 -0
- package/dist/hooks/useIntersectionObserver.js +27 -0
- package/dist/hooks/useLocalStorage.js +63 -0
- package/dist/hooks/useLongPressRepeat.js +33 -0
- package/dist/hooks/usePagination.js +35 -0
- package/dist/hooks/useScrollableListBox.js +30 -0
- package/dist/hooks/useSorting.js +30 -0
- package/dist/hooks/useStateAndRef.js +17 -0
- package/dist/hooks/useTableColumnConfig.js +63 -0
- package/dist/hooks/useTableNav.js +394 -0
- package/dist/hooks/useTranslationMemo.js +14 -0
- package/dist/index.js +284 -0
- package/{src → dist}/types/react-query.d.ts +1 -1
- package/dist/utils/array.utils.js +12 -0
- package/dist/utils/compoundMapper.js +14 -0
- package/dist/utils/date-time.utils.js +77 -0
- package/dist/utils/date.utils.js +12 -0
- package/dist/utils/dom.utils.js +13 -0
- package/dist/utils/file.utils.js +63 -0
- package/dist/utils/isEqual.js +95 -0
- package/dist/utils/logger.js +19 -0
- package/dist/utils/object.utils.js +53 -0
- package/dist/utils/queries.utils.js +9 -0
- package/dist/utils/rest.utils.js +51 -0
- package/dist/utils/routing.utils.js +15 -0
- package/dist/utils/string.utils.js +12 -0
- package/{src → dist}/utils/vendor/acl/AclGuard.d.ts +1 -1
- package/dist/utils/vendor/acl/AclGuard.js +15 -0
- package/dist/utils/vendor/acl/Can.js +18 -0
- package/dist/utils/vendor/acl/ability.context.js +37 -0
- package/dist/utils/vendor/auth/AuthGuard.js +26 -0
- package/dist/utils/vendor/auth/auth.context.js +36 -0
- package/{src → dist}/utils/vendor/auth/withPrivateAuthGuard.d.ts +1 -1
- package/dist/utils/vendor/auth/withPrivateAuthGuard.js +17 -0
- package/dist/utils/vendor/error-handling.js +119 -0
- package/dist/utils/vendor/rest-interceptor.js +21 -0
- package/dist/utils/zod.utils.js +25 -0
- package/package.json +57 -5
- package/index.js +0 -62585
- package/povio-ui-0.0.8.tgz +0 -0
- package/vite.config.d.ts +0 -2
- /package/{src → dist}/assets/icons/AlignCenter.d.ts +0 -0
- /package/{src → dist}/assets/icons/AlignLeft.d.ts +0 -0
- /package/{src → dist}/assets/icons/AlignLeftRight.d.ts +0 -0
- /package/{src → dist}/assets/icons/AlignRight.d.ts +0 -0
- /package/{src → dist}/assets/icons/ArrowDropDown.d.ts +0 -0
- /package/{src → dist}/assets/icons/ArrowDropUp.d.ts +0 -0
- /package/{src → dist}/assets/icons/ArrowLeft.d.ts +0 -0
- /package/{src → dist}/assets/icons/ArrowRight.d.ts +0 -0
- /package/{src → dist}/assets/icons/Bold.d.ts +0 -0
- /package/{src → dist}/assets/icons/BulletedList.d.ts +0 -0
- /package/{src → dist}/assets/icons/Calendar.d.ts +0 -0
- /package/{src → dist}/assets/icons/Check.d.ts +0 -0
- /package/{src → dist}/assets/icons/CheckCircle.d.ts +0 -0
- /package/{src → dist}/assets/icons/CheckboxCheckmark.d.ts +0 -0
- /package/{src → dist}/assets/icons/CheckboxIndeterminate.d.ts +0 -0
- /package/{src → dist}/assets/icons/ChevronDown.d.ts +0 -0
- /package/{src → dist}/assets/icons/ChevronLeft.d.ts +0 -0
- /package/{src → dist}/assets/icons/ChevronRight.d.ts +0 -0
- /package/{src → dist}/assets/icons/ChevronUp.d.ts +0 -0
- /package/{src → dist}/assets/icons/ChevronsLeft.d.ts +0 -0
- /package/{src → dist}/assets/icons/ChevronsRight.d.ts +0 -0
- /package/{src → dist}/assets/icons/Clock.d.ts +0 -0
- /package/{src → dist}/assets/icons/Close.d.ts +0 -0
- /package/{src → dist}/assets/icons/DateTime.d.ts +0 -0
- /package/{src → dist}/assets/icons/Drag.d.ts +0 -0
- /package/{src → dist}/assets/icons/File.d.ts +0 -0
- /package/{src → dist}/assets/icons/Highlight.d.ts +0 -0
- /package/{src → dist}/assets/icons/HighlightOn.d.ts +0 -0
- /package/{src → dist}/assets/icons/Info.d.ts +0 -0
- /package/{src → dist}/assets/icons/Italic.d.ts +0 -0
- /package/{src → dist}/assets/icons/Link.d.ts +0 -0
- /package/{src → dist}/assets/icons/Menu.d.ts +0 -0
- /package/{src → dist}/assets/icons/NumberedList.d.ts +0 -0
- /package/{src → dist}/assets/icons/PointerHorizontal.d.ts +0 -0
- /package/{src → dist}/assets/icons/PointerVertical.d.ts +0 -0
- /package/{src → dist}/assets/icons/Send.d.ts +0 -0
- /package/{src → dist}/assets/icons/Strikethrough.d.ts +0 -0
- /package/{src → dist}/assets/icons/TextColor.d.ts +0 -0
- /package/{src → dist}/assets/icons/Today.d.ts +0 -0
- /package/{src → dist}/assets/icons/Underlined.d.ts +0 -0
- /package/{src → dist}/assets/icons/Upload.d.ts +0 -0
- /package/{src → dist}/assets/icons/View.d.ts +0 -0
- /package/{src → dist}/assets/icons/ViewOff.d.ts +0 -0
- /package/{src → dist}/assets/icons/WarningFilled.d.ts +0 -0
- /package/{src → dist}/components/Menu/Menu.d.ts +0 -0
- /package/{src → dist}/components/buttons/shared/buttonContent.cva.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/Calendar.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/CalendarCell.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/CalendarGrid.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/CalendarSelectHeader.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/DateField.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/DateTimeDialog.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/DateTimeDialogFooter.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/MonthPicker.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/RangeCalendar.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/TimeField.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/TimePickerForm.d.ts +0 -0
- /package/{src → dist}/components/inputs/DateTime/shared/YearPicker.d.ts +0 -0
- /package/{src → dist}/components/inputs/File/FileUpload.d.ts +0 -0
- /package/{src → dist}/components/inputs/File/FileUploadContainer.d.ts +0 -0
- /package/{src → dist}/components/inputs/File/InputUpload.d.ts +0 -0
- /package/{src → dist}/components/inputs/File/index.d.ts +0 -0
- /package/{src → dist}/components/inputs/File/shared/FileProgressBar.d.ts +0 -0
- /package/{src → dist}/components/inputs/File/shared/InputUploadFilled.d.ts +0 -0
- /package/{src → dist}/components/inputs/File/shared/fileUpload.cva.d.ts +0 -0
- /package/{src → dist}/components/inputs/File/shared/inputUploadButton.cva.d.ts +0 -0
- /package/{src → dist}/components/inputs/FormField/FormFieldError.d.ts +0 -0
- /package/{src → dist}/components/inputs/FormField/FormFieldHeader.d.ts +0 -0
- /package/{src → dist}/components/inputs/FormField/FormFieldHeaderClose.d.ts +0 -0
- /package/{src → dist}/components/inputs/Inputs/Inputs.d.ts +0 -0
- /package/{src → dist}/components/inputs/Selection/shared/SelectListBoxSelectionBar.d.ts +0 -0
- /package/{src → dist}/components/inputs/TextEditor/Toolbar/ColorPicker.d.ts +0 -0
- /package/{src → dist}/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.d.ts +0 -0
- /package/{src → dist}/components/inputs/TextEditor/Toolbar/TextEditorToolbar.d.ts +0 -0
- /package/{src → dist}/components/inputs/TextEditor/textEditor.types.d.ts +0 -0
- /package/{src → dist}/components/inputs/shared/InputClear.d.ts +0 -0
- /package/{src → dist}/components/inputs/shared/form.types.d.ts +0 -0
- /package/{src → dist}/components/inputs/shared/input.cva.d.ts +0 -0
- /package/{src → dist}/components/outline.clsx.d.ts +0 -0
- /package/{src → dist}/components/overlays/BottomSheet/BottomSheet.d.ts +0 -0
- /package/{src → dist}/components/overlays/Drawer/Drawer.d.ts +0 -0
- /package/{src → dist}/components/overlays/Modal/modal.cva.d.ts +0 -0
- /package/{src → dist}/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +0 -0
- /package/{src → dist}/components/overlays/Tooltip/TooltipEllipsis.d.ts +0 -0
- /package/{src → dist}/components/overlays/Tooltip/tooltip.cva.d.ts +0 -0
- /package/{src → dist}/components/segment/Segment.d.ts +0 -0
- /package/{src → dist}/components/segment/SegmentItem.d.ts +0 -0
- /package/{src → dist}/components/shared/pagination/Pagination.d.ts +0 -0
- /package/{src → dist}/components/shared/pagination/minWidth.cva.d.ts +0 -0
- /package/{src → dist}/components/status/Alert/alert.cva.d.ts +0 -0
- /package/{src → dist}/components/status/Loader/loader.cva.d.ts +0 -0
- /package/{src → dist}/components/status/Toast/useToast.d.ts +0 -0
- /package/{src → dist}/components/status/shared/status.cva.d.ts +0 -0
- /package/{src → dist}/components/table/CellText.d.ts +0 -0
- /package/{src → dist}/components/table/ColumnConfig.d.ts +0 -0
- /package/{src → dist}/components/table/HeaderText.d.ts +0 -0
- /package/{src → dist}/components/table/InfiniteTable.d.ts +0 -0
- /package/{src → dist}/components/table/PaginatedTable.d.ts +0 -0
- /package/{src → dist}/components/table/Table.d.ts +0 -0
- /package/{src → dist}/components/table/table.cva.d.ts +0 -0
- /package/{src → dist}/components/text/Link/link.cva.d.ts +0 -0
- /package/{src → dist}/components/text/Tag/tag.cva.d.ts +0 -0
- /package/{src → dist}/components/text/Typography/typography.cva.d.ts +0 -0
- /package/{src → dist}/config/i18n.d.ts +0 -0
- /package/{src → dist}/config/router.context.d.ts +0 -0
- /package/{src → dist}/helpers/dynamicColumns.d.ts +0 -0
- /package/{src → dist}/hooks/useAutosave.d.ts +0 -0
- /package/{src → dist}/hooks/useBreakpoint.d.ts +0 -0
- /package/{src → dist}/hooks/useDebounceCallback.d.ts +0 -0
- /package/{src → dist}/hooks/useDeepCompare.d.ts +0 -0
- /package/{src → dist}/hooks/useFilters.d.ts +0 -0
- /package/{src → dist}/hooks/useForm.d.ts +0 -0
- /package/{src → dist}/hooks/useIntersectionObserver.d.ts +0 -0
- /package/{src → dist}/hooks/useLocalStorage.d.ts +0 -0
- /package/{src → dist}/hooks/useLongPressRepeat.d.ts +0 -0
- /package/{src → dist}/hooks/usePagination.d.ts +0 -0
- /package/{src → dist}/hooks/useScrollableListBox.d.ts +0 -0
- /package/{src → dist}/hooks/useSorting.d.ts +0 -0
- /package/{src → dist}/hooks/useStateAndRef.d.ts +0 -0
- /package/{src → dist}/hooks/useTableColumnConfig.d.ts +0 -0
- /package/{src → dist}/hooks/useTableNav.d.ts +0 -0
- /package/{src → dist}/hooks/useTranslationMemo.d.ts +0 -0
- /package/{src → dist}/index.d.ts +0 -0
- /package/{styles → dist/styles}/editor.css +0 -0
- /package/{styles → dist/styles}/index.css +0 -0
- /package/{src → dist}/types/common.d.ts +0 -0
- /package/{src → dist}/utils/array.utils.d.ts +0 -0
- /package/{src → dist}/utils/array.utils.spec.d.ts +0 -0
- /package/{src → dist}/utils/compoundMapper.d.ts +0 -0
- /package/{src → dist}/utils/compoundMapper.spec.d.ts +0 -0
- /package/{src → dist}/utils/date-time.utils.d.ts +0 -0
- /package/{src → dist}/utils/date-time.utils.spec.d.ts +0 -0
- /package/{src → dist}/utils/date.utils.d.ts +0 -0
- /package/{src → dist}/utils/date.utils.spec.d.ts +0 -0
- /package/{src → dist}/utils/dom.utils.d.ts +0 -0
- /package/{src → dist}/utils/file.utils.d.ts +0 -0
- /package/{src → dist}/utils/isEqual.d.ts +0 -0
- /package/{src → dist}/utils/logger.d.ts +0 -0
- /package/{src → dist}/utils/object.utils.d.ts +0 -0
- /package/{src → dist}/utils/queries.utils.d.ts +0 -0
- /package/{src → dist}/utils/rest.utils.d.ts +0 -0
- /package/{src → dist}/utils/routing.utils.d.ts +0 -0
- /package/{src → dist}/utils/string.utils.d.ts +0 -0
- /package/{src → dist}/utils/vendor/acl/Can.d.ts +0 -0
- /package/{src → dist}/utils/vendor/acl/ability.context.d.ts +0 -0
- /package/{src → dist}/utils/vendor/acl/appAbility.types.d.ts +0 -0
- /package/{src → dist}/utils/vendor/auth/AuthGuard.d.ts +0 -0
- /package/{src → dist}/utils/vendor/auth/auth.context.d.ts +0 -0
- /package/{src → dist}/utils/vendor/error-handling.d.ts +0 -0
- /package/{src → dist}/utils/vendor/rest-client.types.d.ts +0 -0
- /package/{src → dist}/utils/vendor/rest-interceptor.d.ts +0 -0
- /package/{src → dist}/utils/zod.utils.d.ts +0 -0
|
@@ -0,0 +1,186 @@
|
|
|
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,8 +1,8 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import { DateFieldAria } from 'react-aria';
|
|
3
3
|
import { TimeFieldState } from 'react-stately';
|
|
4
|
-
import { FormFieldHeaderProps } from '
|
|
5
|
-
import { InputVariantProps } from '
|
|
4
|
+
import { FormFieldHeaderProps } from '../../FormField/FormFieldHeader';
|
|
5
|
+
import { InputVariantProps } from '../../shared/input.cva';
|
|
6
6
|
interface DatePickerInputProps extends InputVariantProps {
|
|
7
7
|
ref?: Ref<HTMLDivElement>;
|
|
8
8
|
fieldProps: DateFieldAria["fieldProps"];
|
|
@@ -0,0 +1,115 @@
|
|
|
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 useMeasure from "react-use-measure";
|
|
6
|
+
import { ClockIcon } from "../../../../assets/icons/Clock.js";
|
|
7
|
+
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
8
|
+
import { TimeField } from "./TimeField.js";
|
|
9
|
+
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
10
|
+
import { InputClear } from "../../shared/InputClear.js";
|
|
11
|
+
import { useInputCva, inputSide } from "../../shared/input.cva.js";
|
|
12
|
+
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
13
|
+
const TimePickerInput = ({
|
|
14
|
+
ref,
|
|
15
|
+
as,
|
|
16
|
+
fieldProps,
|
|
17
|
+
state,
|
|
18
|
+
isDisabled,
|
|
19
|
+
isInvalid,
|
|
20
|
+
disableDropdown,
|
|
21
|
+
variant,
|
|
22
|
+
size,
|
|
23
|
+
isClearable,
|
|
24
|
+
headerProps,
|
|
25
|
+
onPress,
|
|
26
|
+
...props
|
|
27
|
+
}) => {
|
|
28
|
+
const inputCva = useInputCva();
|
|
29
|
+
const uiStyle = UIStyle.useConfig();
|
|
30
|
+
const inputSideCva = uiStyle?.input?.sideCva ?? inputSide;
|
|
31
|
+
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
32
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
33
|
+
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
34
|
+
const { isFocusVisible } = useFocusVisible();
|
|
35
|
+
const [labelContentRef, { width: labelWidth }] = useMeasure();
|
|
36
|
+
const hidePlaceholder = as === "floating" && !state.value && !isFocused;
|
|
37
|
+
const style = useMemo(() => {
|
|
38
|
+
const paddingLeft = as === "filter" ? `calc(var(${inputSideCva({ size, type: "var" })}) + ${labelWidth}px)` : "0px";
|
|
39
|
+
return {
|
|
40
|
+
paddingLeft
|
|
41
|
+
};
|
|
42
|
+
}, [labelWidth, as, size, inputSideCva]);
|
|
43
|
+
const canClear = state.segments.some((segment) => segment.type !== "literal" && segment.isPlaceholder === false);
|
|
44
|
+
return /* @__PURE__ */ jsxs(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
ref,
|
|
48
|
+
className: inputCva({
|
|
49
|
+
variant,
|
|
50
|
+
as,
|
|
51
|
+
size,
|
|
52
|
+
...props,
|
|
53
|
+
className: clsx(
|
|
54
|
+
"group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2"
|
|
55
|
+
)
|
|
56
|
+
}),
|
|
57
|
+
"data-rac": "",
|
|
58
|
+
"data-hovered": isHovered || void 0,
|
|
59
|
+
"data-disabled": isDisabled || void 0,
|
|
60
|
+
"data-invalid": isInvalid || void 0,
|
|
61
|
+
"data-is-empty": state.value === null || void 0,
|
|
62
|
+
"data-focus-within": isFocused || void 0,
|
|
63
|
+
"data-focus-visible": isFocused && isFocusVisible || void 0,
|
|
64
|
+
"data-has-selection": state.value !== null || void 0,
|
|
65
|
+
...fieldProps,
|
|
66
|
+
...focusWithinProps,
|
|
67
|
+
...hoverProps,
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
70
|
+
as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(
|
|
71
|
+
FormFieldLabel,
|
|
72
|
+
{
|
|
73
|
+
ref: labelContentRef,
|
|
74
|
+
as,
|
|
75
|
+
...headerProps
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ jsx("div", { style, children: /* @__PURE__ */ jsx(
|
|
79
|
+
TimeField,
|
|
80
|
+
{
|
|
81
|
+
fieldProps,
|
|
82
|
+
state,
|
|
83
|
+
isDisabled,
|
|
84
|
+
hidePlaceholder
|
|
85
|
+
}
|
|
86
|
+
) })
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ jsxs(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
className: clsx("flex items-center gap-2", {
|
|
92
|
+
"-mt-4": as === "floating"
|
|
93
|
+
}),
|
|
94
|
+
children: [
|
|
95
|
+
isClearable && canClear && /* @__PURE__ */ jsx(InputClear, { onClear: () => state.setValue(null) }),
|
|
96
|
+
!disableDropdown && /* @__PURE__ */ jsx(
|
|
97
|
+
InlineIconButton,
|
|
98
|
+
{
|
|
99
|
+
label: "",
|
|
100
|
+
color: "secondary",
|
|
101
|
+
onPress,
|
|
102
|
+
icon: ClockIcon,
|
|
103
|
+
isDisabled
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
export {
|
|
114
|
+
TimePickerInput
|
|
115
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,254 @@
|
|
|
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
|
+
...rest
|
|
43
|
+
} = props;
|
|
44
|
+
const ui = UIConfig.useConfig();
|
|
45
|
+
const [uploadState, setUploadState] = useState(props.value ?? []);
|
|
46
|
+
const formFieldProps = {
|
|
47
|
+
error,
|
|
48
|
+
label,
|
|
49
|
+
tooltipText,
|
|
50
|
+
helperText,
|
|
51
|
+
isRequired,
|
|
52
|
+
isHeaderHidden,
|
|
53
|
+
hideLabel: hideLabel ?? ui.input.hideLabel,
|
|
54
|
+
isDisabled,
|
|
55
|
+
headerClassName,
|
|
56
|
+
errorClassName
|
|
57
|
+
};
|
|
58
|
+
const labelProps = useLabels({ "aria-label": label });
|
|
59
|
+
const handleUpload = useCallback(
|
|
60
|
+
async (inputFiles) => {
|
|
61
|
+
const acceptedFiles = inputFiles.filter((file) => FileUtils.isFileTypeAccepted(file, acceptedFileTypes));
|
|
62
|
+
if (acceptedFiles.length === 0 || !fileUpload) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (!allowsMultiple) {
|
|
66
|
+
setUploadState([]);
|
|
67
|
+
}
|
|
68
|
+
const newUploadState = [];
|
|
69
|
+
acceptedFiles.forEach((file) => {
|
|
70
|
+
newUploadState.push({ state: "uploading", progress: 0, file, abortController: new AbortController() });
|
|
71
|
+
});
|
|
72
|
+
const startIndex = allowsMultiple ? uploadState.length : 0;
|
|
73
|
+
setUploadState((prev) => [...prev, ...newUploadState]);
|
|
74
|
+
const promises = [];
|
|
75
|
+
acceptedFiles.forEach(async (file, index) => {
|
|
76
|
+
promises.push(
|
|
77
|
+
fileUpload(
|
|
78
|
+
{
|
|
79
|
+
data: {
|
|
80
|
+
resourceName: file.name,
|
|
81
|
+
fileName: file.name,
|
|
82
|
+
fileSize: file.size,
|
|
83
|
+
method: "put"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
file,
|
|
87
|
+
{
|
|
88
|
+
onUploadProgress: ({ loaded, total }) => {
|
|
89
|
+
if (total == null) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const progress = Math.round(loaded / total * 100);
|
|
93
|
+
setUploadState(
|
|
94
|
+
(prev) => prev.map((state, i) => i === startIndex + index ? { ...state, progress } : state)
|
|
95
|
+
);
|
|
96
|
+
},
|
|
97
|
+
abortController: newUploadState[index]?.abortController
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
const response = await Promise.all(promises);
|
|
103
|
+
response.forEach((res, index) => {
|
|
104
|
+
setUploadState(
|
|
105
|
+
(prev) => prev.map((state, i) => i === startIndex + index ? { ...state, state: "uploaded", id: res.id } : state)
|
|
106
|
+
);
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
[fileUpload, acceptedFileTypes, setUploadState, allowsMultiple, uploadState.length]
|
|
110
|
+
);
|
|
111
|
+
const handleSelect = useCallback(
|
|
112
|
+
(inputFiles) => {
|
|
113
|
+
if (!inputFiles) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const filesArray = Array.from(inputFiles);
|
|
117
|
+
handleUpload(filesArray);
|
|
118
|
+
},
|
|
119
|
+
[handleUpload]
|
|
120
|
+
);
|
|
121
|
+
const handleDrop = async (e) => {
|
|
122
|
+
if (!e.items) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const promises = [];
|
|
126
|
+
e.items.forEach((item) => {
|
|
127
|
+
if (item.kind === "file") {
|
|
128
|
+
promises.push(item.getFile());
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
const inputFiles = await Promise.all(promises);
|
|
132
|
+
handleUpload(inputFiles);
|
|
133
|
+
};
|
|
134
|
+
const handleRemove = useCallback(
|
|
135
|
+
(id) => {
|
|
136
|
+
fileRemove?.({ id });
|
|
137
|
+
setUploadState((prev) => prev.filter((state) => state.id !== id));
|
|
138
|
+
},
|
|
139
|
+
[fileRemove]
|
|
140
|
+
);
|
|
141
|
+
const handleCancelUpload = useCallback(
|
|
142
|
+
(index) => {
|
|
143
|
+
const findState = uploadState[index];
|
|
144
|
+
if (findState) {
|
|
145
|
+
findState.abortController?.abort("canceled by user");
|
|
146
|
+
setUploadState((prev) => prev.filter((_, i) => i !== index));
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
[uploadState]
|
|
150
|
+
);
|
|
151
|
+
return /* @__PURE__ */ jsxs(
|
|
152
|
+
FormField,
|
|
153
|
+
{
|
|
154
|
+
...formFieldProps,
|
|
155
|
+
labelProps,
|
|
156
|
+
className: clsx("w-full", className),
|
|
157
|
+
children: [
|
|
158
|
+
/* @__PURE__ */ jsx("div", { className: "flex w-full items-center justify-between gap-file-upload-input-gap-input-to-button-gap", children: /* @__PURE__ */ jsx(
|
|
159
|
+
DropZone,
|
|
160
|
+
{
|
|
161
|
+
...rest,
|
|
162
|
+
"data-rac": "",
|
|
163
|
+
"data-disabled": isDisabled || void 0,
|
|
164
|
+
"data-invalid": !!error || void 0,
|
|
165
|
+
"data-multiple": allowsMultiple || void 0,
|
|
166
|
+
"data-has-files": uploadState.length > 0 || void 0,
|
|
167
|
+
isDisabled,
|
|
168
|
+
onDrop: handleDrop,
|
|
169
|
+
className: fileUploadDropZone({ variant, isContainer: !!children, className: "group/file-upload-drop-zone" }),
|
|
170
|
+
children: children ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
171
|
+
children({
|
|
172
|
+
files: uploadState,
|
|
173
|
+
onRemove: handleRemove,
|
|
174
|
+
onCancel: handleCancelUpload
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ jsx(
|
|
177
|
+
FileUploadContentEmpty,
|
|
178
|
+
{
|
|
179
|
+
as,
|
|
180
|
+
variant,
|
|
181
|
+
singleFile: true,
|
|
182
|
+
hideButton: true,
|
|
183
|
+
isDisabled,
|
|
184
|
+
title: emptyText,
|
|
185
|
+
uploadText,
|
|
186
|
+
browseText,
|
|
187
|
+
className: "-translate-x-1/2 -translate-y-1/2 group-data-[drop-target]/file-upload-drop-zone:!flex absolute top-1/2 left-1/2 z-50 hidden flex-col"
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
] }) : /* @__PURE__ */ jsx(
|
|
191
|
+
FileUploadContent,
|
|
192
|
+
{
|
|
193
|
+
...rest,
|
|
194
|
+
variant,
|
|
195
|
+
as,
|
|
196
|
+
isDisabled,
|
|
197
|
+
browseText,
|
|
198
|
+
uploadText,
|
|
199
|
+
emptyText,
|
|
200
|
+
uploadState,
|
|
201
|
+
handleSelect,
|
|
202
|
+
handleCancelUpload,
|
|
203
|
+
handleRemove,
|
|
204
|
+
acceptedFileTypes,
|
|
205
|
+
allowsMultiple
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
) }),
|
|
210
|
+
!children && allowsMultiple && uploadState.length > 0 && (listRenderer ? listRenderer({
|
|
211
|
+
files: uploadState,
|
|
212
|
+
onRemove: handleRemove,
|
|
213
|
+
onCancel: handleCancelUpload
|
|
214
|
+
}) : /* @__PURE__ */ jsx(
|
|
215
|
+
FileCardList,
|
|
216
|
+
{
|
|
217
|
+
as,
|
|
218
|
+
uploadState,
|
|
219
|
+
isDisabled,
|
|
220
|
+
onRemove: handleRemove,
|
|
221
|
+
onCancel: handleCancelUpload
|
|
222
|
+
}
|
|
223
|
+
))
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
};
|
|
228
|
+
const FileUpload = (props) => {
|
|
229
|
+
if ("formControl" in props && props.formControl) {
|
|
230
|
+
const { formControl, ref, ...innerProps } = props;
|
|
231
|
+
return /* @__PURE__ */ jsx(
|
|
232
|
+
Controller,
|
|
233
|
+
{
|
|
234
|
+
control: formControl.control,
|
|
235
|
+
name: formControl.name,
|
|
236
|
+
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(
|
|
237
|
+
FileUploadBase,
|
|
238
|
+
{
|
|
239
|
+
...innerProps,
|
|
240
|
+
ref: mergeRefs(ref, field.ref),
|
|
241
|
+
value: field.value,
|
|
242
|
+
onChange: field.onChange,
|
|
243
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
244
|
+
error: props.error ?? error?.message
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
}
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
return /* @__PURE__ */ jsx(FileUploadBase, { ...props });
|
|
251
|
+
};
|
|
252
|
+
export {
|
|
253
|
+
FileUpload
|
|
254
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
};
|