@povio/ui 0.0.8 → 0.0.9
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 +237 -0
- package/{src → dist}/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +674 -0
- package/{src → dist}/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +3 -3
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +251 -0
- package/{src → dist}/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +224 -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 +174 -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 +114 -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 +157 -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 +146 -0
- package/{src → dist}/components/inputs/Input/TextInput/TextInput.d.ts +4 -4
- package/dist/components/inputs/Input/TextInput/TextInput.js +170 -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 +3 -3
- package/dist/components/inputs/Selection/shared/SelectBase.js +25 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +211 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectInput.d.ts +4 -4
- package/dist/components/inputs/Selection/shared/SelectInput.js +231 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectInputTags.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +22 -0
- package/{src → dist}/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +108 -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 +161 -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/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 +1 -1
- package/dist/components/overlays/Tooltip/Tooltip.js +70 -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 +8 -8
- package/dist/config/uiConfig.context.js +67 -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 +409 -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,167 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { FileTrigger } from "react-aria-components";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { CloseIcon } from "../../../../assets/icons/Close.js";
|
|
6
|
+
import { WarningFilledIcon } from "../../../../assets/icons/WarningFilled.js";
|
|
7
|
+
import { Button } from "../../../buttons/Button/Button.js";
|
|
8
|
+
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
9
|
+
import { TextButton } from "../../../buttons/TextButton/TextButton.js";
|
|
10
|
+
import { Typography } from "../../../text/Typography/Typography.js";
|
|
11
|
+
import { ns } from "../../../../config/i18n.js";
|
|
12
|
+
const FileUploadContentError = ({
|
|
13
|
+
variant,
|
|
14
|
+
as,
|
|
15
|
+
isDisabled,
|
|
16
|
+
state,
|
|
17
|
+
browseText,
|
|
18
|
+
fileTriggerProps,
|
|
19
|
+
removeWithIcon = false,
|
|
20
|
+
singleFile,
|
|
21
|
+
onRemove
|
|
22
|
+
}) => {
|
|
23
|
+
const { t } = useTranslation(ns);
|
|
24
|
+
return /* @__PURE__ */ jsx("div", { className: clsx("flex w-full flex-fill flex-col items-start"), children: /* @__PURE__ */ jsxs(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
className: clsx("flex w-full items-center", {
|
|
28
|
+
"flex-row gap-file-upload-content-gap-left-to-right-content": variant === "horizontal",
|
|
29
|
+
"flex-col": variant === "vertical",
|
|
30
|
+
"gap-file-upload-content-gap-content-to-button": variant === "vertical" && as === "button",
|
|
31
|
+
"gap-file-upload-content-gap-text-to-text": variant === "vertical" && as === "link"
|
|
32
|
+
}),
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsxs(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: clsx(
|
|
38
|
+
"flex min-w-0 max-w-full flex-grow items-center gap-file-upload-content-gap-icon-to-content",
|
|
39
|
+
{
|
|
40
|
+
"flex-col": variant === "vertical",
|
|
41
|
+
"flex-row": variant === "horizontal",
|
|
42
|
+
"opacity-50": isDisabled
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsx(WarningFilledIcon, { className: "h-6 w-6 text-elevation-fill-warning-1" }),
|
|
47
|
+
/* @__PURE__ */ jsxs(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: clsx("flex flex-col gap-file-upload-content-gap-text-to-text", {
|
|
51
|
+
"max-w-full items-center": variant === "vertical",
|
|
52
|
+
"max-w-[calc(100%_-_32px)]": variant === "horizontal"
|
|
53
|
+
}),
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
Typography,
|
|
57
|
+
{
|
|
58
|
+
variant: "prominent-1",
|
|
59
|
+
size: "label-1",
|
|
60
|
+
as: "span",
|
|
61
|
+
className: clsx("self-stretch truncate text-text-default-1", {
|
|
62
|
+
"text-center": variant === "vertical"
|
|
63
|
+
}),
|
|
64
|
+
children: state.file.name
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
Typography,
|
|
69
|
+
{
|
|
70
|
+
variant: "default",
|
|
71
|
+
size: singleFile ? "label-2" : "label-3",
|
|
72
|
+
as: "span",
|
|
73
|
+
className: clsx("text-text-default-2", {
|
|
74
|
+
"text-center": variant === "vertical"
|
|
75
|
+
}),
|
|
76
|
+
children: state.error?.serverMessage ?? state.error?.message
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__PURE__ */ jsx(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: clsx("flex flex-none items-center justify-end", {
|
|
89
|
+
"flex-col": variant === "vertical" && as === "button",
|
|
90
|
+
"gap-file-upload-content-gap-text-to-text": as === "link",
|
|
91
|
+
"gap-file-upload-content-gap-content-to-button": as === "button"
|
|
92
|
+
}),
|
|
93
|
+
children: as === "link" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
94
|
+
fileTriggerProps && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
95
|
+
/* @__PURE__ */ jsx(FileTrigger, { ...fileTriggerProps, children: /* @__PURE__ */ jsx(TextButton, { className: "text-interactive-text-primary-idle", children: browseText ?? "" }) }),
|
|
96
|
+
/* @__PURE__ */ jsx(
|
|
97
|
+
Typography,
|
|
98
|
+
{
|
|
99
|
+
variant: "default",
|
|
100
|
+
size: "label-2",
|
|
101
|
+
as: "span",
|
|
102
|
+
className: "text-text-default-2",
|
|
103
|
+
children: t(($) => $.ui.fileUpload.or)
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
] }),
|
|
107
|
+
removeWithIcon ? /* @__PURE__ */ jsx(
|
|
108
|
+
InlineIconButton,
|
|
109
|
+
{
|
|
110
|
+
label: "Cancel",
|
|
111
|
+
color: "secondary",
|
|
112
|
+
onPress: () => {
|
|
113
|
+
onRemove(state.id ?? "");
|
|
114
|
+
},
|
|
115
|
+
icon: CloseIcon
|
|
116
|
+
}
|
|
117
|
+
) : /* @__PURE__ */ jsx(
|
|
118
|
+
TextButton,
|
|
119
|
+
{
|
|
120
|
+
className: "text-interactive-text-primary-idle lowercase",
|
|
121
|
+
onPress: () => {
|
|
122
|
+
onRemove(state.id ?? "");
|
|
123
|
+
},
|
|
124
|
+
children: t(($) => $.ui.fileUpload.removeFile)
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-file-upload-content-gap-button-to-button self-stretch", children: [
|
|
128
|
+
fileTriggerProps && /* @__PURE__ */ jsx(FileTrigger, { ...fileTriggerProps, children: /* @__PURE__ */ jsx(
|
|
129
|
+
Button,
|
|
130
|
+
{
|
|
131
|
+
variant: "outlined",
|
|
132
|
+
size: "xs",
|
|
133
|
+
width: "hug",
|
|
134
|
+
isDisabled,
|
|
135
|
+
children: browseText ?? ""
|
|
136
|
+
}
|
|
137
|
+
) }),
|
|
138
|
+
removeWithIcon ? /* @__PURE__ */ jsx(
|
|
139
|
+
InlineIconButton,
|
|
140
|
+
{
|
|
141
|
+
label: "Cancel",
|
|
142
|
+
color: "secondary",
|
|
143
|
+
onPress: () => {
|
|
144
|
+
onRemove(state.id ?? "");
|
|
145
|
+
},
|
|
146
|
+
icon: CloseIcon
|
|
147
|
+
}
|
|
148
|
+
) : /* @__PURE__ */ jsx(
|
|
149
|
+
TextButton,
|
|
150
|
+
{
|
|
151
|
+
color: "secondary",
|
|
152
|
+
onPress: () => {
|
|
153
|
+
onRemove(state.id ?? "");
|
|
154
|
+
},
|
|
155
|
+
children: t(($) => $.ui.fileUpload.removeFile)
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
] })
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
) });
|
|
164
|
+
};
|
|
165
|
+
export {
|
|
166
|
+
FileUploadContentError
|
|
167
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FileTriggerProps } from 'react-aria-components';
|
|
2
|
-
import { FileUploadBaseProps, FileUploadState } from '
|
|
2
|
+
import { FileUploadBaseProps, FileUploadState } from '../fileUpload.types';
|
|
3
3
|
type FileUploadContentFilledProps = Pick<FileUploadBaseProps, "variant" | "as" | "isDisabled" | "emptyText" | "browseText"> & {
|
|
4
4
|
state: FileUploadState;
|
|
5
5
|
fileTriggerProps?: FileTriggerProps;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { FileTrigger } from "react-aria-components";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { CheckCircleIcon } from "../../../../assets/icons/CheckCircle.js";
|
|
6
|
+
import { CloseIcon } from "../../../../assets/icons/Close.js";
|
|
7
|
+
import { Button } from "../../../buttons/Button/Button.js";
|
|
8
|
+
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
9
|
+
import { TextButton } from "../../../buttons/TextButton/TextButton.js";
|
|
10
|
+
import { Typography } from "../../../text/Typography/Typography.js";
|
|
11
|
+
import { ns } from "../../../../config/i18n.js";
|
|
12
|
+
import { FileUtils } from "../../../../utils/file.utils.js";
|
|
13
|
+
const FileUploadContentFilled = ({
|
|
14
|
+
variant,
|
|
15
|
+
as,
|
|
16
|
+
isDisabled,
|
|
17
|
+
state,
|
|
18
|
+
browseText,
|
|
19
|
+
fileTriggerProps,
|
|
20
|
+
removeWithIcon = false,
|
|
21
|
+
singleFile,
|
|
22
|
+
onRemove
|
|
23
|
+
}) => {
|
|
24
|
+
const { t } = useTranslation(ns);
|
|
25
|
+
return /* @__PURE__ */ jsx("div", { className: clsx("flex w-full flex-fill flex-col items-start"), children: /* @__PURE__ */ jsxs(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: clsx("flex w-full items-center", {
|
|
29
|
+
"flex-row gap-file-upload-content-gap-left-to-right-content": variant === "horizontal",
|
|
30
|
+
"flex-col": variant === "vertical",
|
|
31
|
+
"gap-file-upload-content-gap-content-to-button": variant === "vertical" && as === "button",
|
|
32
|
+
"gap-file-upload-content-gap-text-to-text": variant === "vertical" && as === "link"
|
|
33
|
+
}),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxs(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: clsx(
|
|
39
|
+
"flex min-w-0 max-w-full flex-grow items-center gap-file-upload-content-gap-icon-to-content",
|
|
40
|
+
{
|
|
41
|
+
"flex-col": variant === "vertical",
|
|
42
|
+
"flex-row": variant === "horizontal",
|
|
43
|
+
"opacity-50": isDisabled
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx(CheckCircleIcon, { className: "h-6 w-6 text-text-default-1" }),
|
|
48
|
+
/* @__PURE__ */ jsxs(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
className: clsx("flex flex-col gap-file-upload-content-gap-text-to-text", {
|
|
52
|
+
"max-w-full items-center": variant === "vertical",
|
|
53
|
+
"max-w-[calc(100%_-_32px)]": variant === "horizontal"
|
|
54
|
+
}),
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
Typography,
|
|
58
|
+
{
|
|
59
|
+
variant: "prominent-1",
|
|
60
|
+
size: "label-1",
|
|
61
|
+
as: "span",
|
|
62
|
+
className: "self-stretch truncate text-center text-text-default-1",
|
|
63
|
+
children: state.file.name
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
Typography,
|
|
68
|
+
{
|
|
69
|
+
variant: "default",
|
|
70
|
+
size: singleFile ? "label-2" : "label-3",
|
|
71
|
+
as: "span",
|
|
72
|
+
className: "text-text-default-2",
|
|
73
|
+
children: FileUtils.getCalculatedFileSize(state.file)
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
className: clsx("flex flex-none items-center justify-end", {
|
|
86
|
+
"flex-col": variant === "vertical" && as === "button",
|
|
87
|
+
"gap-file-upload-content-gap-text-to-text": as === "link" && variant === "vertical",
|
|
88
|
+
"gap-file-upload-content-gap-content-to-button": as === "button" && variant === "vertical",
|
|
89
|
+
"gap-file-upload-content-gap-button-to-button": variant === "horizontal"
|
|
90
|
+
}),
|
|
91
|
+
children: as === "link" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
92
|
+
fileTriggerProps && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
93
|
+
/* @__PURE__ */ jsx(FileTrigger, { ...fileTriggerProps, children: /* @__PURE__ */ jsx(
|
|
94
|
+
TextButton,
|
|
95
|
+
{
|
|
96
|
+
className: clsx("text-interactive-text-primary-idle", {
|
|
97
|
+
"[&>span>span]:!font-medium": variant === "vertical"
|
|
98
|
+
}),
|
|
99
|
+
children: browseText ?? ""
|
|
100
|
+
}
|
|
101
|
+
) }),
|
|
102
|
+
variant === "vertical" && /* @__PURE__ */ jsx(
|
|
103
|
+
Typography,
|
|
104
|
+
{
|
|
105
|
+
variant: "default",
|
|
106
|
+
size: "label-2",
|
|
107
|
+
as: "span",
|
|
108
|
+
className: "text-text-default-2",
|
|
109
|
+
children: t(($) => $.ui.fileUpload.or)
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
] }),
|
|
113
|
+
removeWithIcon ? /* @__PURE__ */ jsx(
|
|
114
|
+
InlineIconButton,
|
|
115
|
+
{
|
|
116
|
+
label: "Cancel",
|
|
117
|
+
color: "secondary",
|
|
118
|
+
onPress: () => {
|
|
119
|
+
onRemove(state.id ?? "");
|
|
120
|
+
},
|
|
121
|
+
icon: CloseIcon
|
|
122
|
+
}
|
|
123
|
+
) : /* @__PURE__ */ jsx(
|
|
124
|
+
TextButton,
|
|
125
|
+
{
|
|
126
|
+
className: clsx(
|
|
127
|
+
variant === "vertical" && "[&>span>span]:!font-medium text-interactive-text-primary-idle lowercase"
|
|
128
|
+
),
|
|
129
|
+
color: variant === "horizontal" ? "secondary" : "primary",
|
|
130
|
+
onPress: () => {
|
|
131
|
+
onRemove(state.id ?? "");
|
|
132
|
+
},
|
|
133
|
+
children: t(($) => $.ui.fileUpload.removeFile)
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-file-upload-content-gap-button-to-button self-stretch", children: [
|
|
137
|
+
fileTriggerProps && /* @__PURE__ */ jsx(FileTrigger, { ...fileTriggerProps, children: /* @__PURE__ */ jsx(
|
|
138
|
+
Button,
|
|
139
|
+
{
|
|
140
|
+
variant: "outlined",
|
|
141
|
+
size: "xs",
|
|
142
|
+
width: "hug",
|
|
143
|
+
isDisabled,
|
|
144
|
+
children: browseText ?? ""
|
|
145
|
+
}
|
|
146
|
+
) }),
|
|
147
|
+
removeWithIcon ? /* @__PURE__ */ jsx(
|
|
148
|
+
InlineIconButton,
|
|
149
|
+
{
|
|
150
|
+
label: "Cancel",
|
|
151
|
+
color: "secondary",
|
|
152
|
+
onPress: () => {
|
|
153
|
+
onRemove(state.id ?? "");
|
|
154
|
+
},
|
|
155
|
+
icon: CloseIcon
|
|
156
|
+
}
|
|
157
|
+
) : /* @__PURE__ */ jsx(
|
|
158
|
+
TextButton,
|
|
159
|
+
{
|
|
160
|
+
color: "secondary",
|
|
161
|
+
onPress: () => {
|
|
162
|
+
onRemove(state.id ?? "");
|
|
163
|
+
},
|
|
164
|
+
children: t(($) => $.ui.fileUpload.removeFile)
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] })
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
) });
|
|
173
|
+
};
|
|
174
|
+
export {
|
|
175
|
+
FileUploadContentFilled
|
|
176
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FileUploadBaseProps, FileUploadState } from '
|
|
1
|
+
import { FileUploadBaseProps, FileUploadState } from '../fileUpload.types';
|
|
2
2
|
type FileUploadContentLoadingProps = Pick<FileUploadBaseProps, "variant" | "as" | "isDisabled" | "emptyText" | "browseText"> & {
|
|
3
3
|
index: number;
|
|
4
4
|
state: FileUploadState;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { CloseIcon } from "../../../../assets/icons/Close.js";
|
|
5
|
+
import { FileIcon } from "../../../../assets/icons/File.js";
|
|
6
|
+
import { Button } from "../../../buttons/Button/Button.js";
|
|
7
|
+
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
8
|
+
import { Typography } from "../../../text/Typography/Typography.js";
|
|
9
|
+
import { ns } from "../../../../config/i18n.js";
|
|
10
|
+
import { FileUtils } from "../../../../utils/file.utils.js";
|
|
11
|
+
import { FileProgressBar } from "./FileProgressBar.js";
|
|
12
|
+
const FileUploadContentLoading = ({
|
|
13
|
+
index,
|
|
14
|
+
variant,
|
|
15
|
+
as,
|
|
16
|
+
state,
|
|
17
|
+
isDisabled,
|
|
18
|
+
singleFile,
|
|
19
|
+
onCancel
|
|
20
|
+
}) => {
|
|
21
|
+
const { t } = useTranslation(ns);
|
|
22
|
+
return /* @__PURE__ */ jsxs(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: clsx("flex w-full flex-col items-center", {
|
|
26
|
+
"flex-col": variant === "vertical",
|
|
27
|
+
"flex-row": variant === "horizontal",
|
|
28
|
+
"gap-file-upload-content-gap-content-to-button": as === "button"
|
|
29
|
+
}),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsxs(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: clsx("flex w-full items-center justify-between", {
|
|
35
|
+
"flex-col gap-file-upload-content-gap-text-to-progress": variant === "vertical",
|
|
36
|
+
"flex-row gap-file-upload-content-gap-left-to-right-content": variant === "horizontal",
|
|
37
|
+
"opacity-50": isDisabled
|
|
38
|
+
}),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsxs(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: clsx("flex items-center gap-file-upload-content-gap-icon-to-content", {
|
|
44
|
+
"w-full flex-col": variant === "vertical",
|
|
45
|
+
"w-1/2": variant === "horizontal"
|
|
46
|
+
}),
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsx(FileIcon, { className: "h-6 w-6 text-text-default-1" }),
|
|
49
|
+
/* @__PURE__ */ jsxs(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: clsx("flex flex-col", {
|
|
53
|
+
"max-w-full gap-file-upload-content-gap-icon-to-content text-center": variant === "vertical",
|
|
54
|
+
"max-w-[calc(100%_-_32px)] gap-file-upload-content-gap-text-to-text": variant === "horizontal"
|
|
55
|
+
}),
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsx(
|
|
58
|
+
Typography,
|
|
59
|
+
{
|
|
60
|
+
variant: "prominent-1",
|
|
61
|
+
size: "label-1",
|
|
62
|
+
as: "span",
|
|
63
|
+
className: "self-stretch truncate text-center text-text-default-1",
|
|
64
|
+
children: state.file.name
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
Typography,
|
|
69
|
+
{
|
|
70
|
+
variant: "default",
|
|
71
|
+
size: singleFile ? "label-2" : "label-3",
|
|
72
|
+
as: "span",
|
|
73
|
+
className: "text-text-default-2",
|
|
74
|
+
children: FileUtils.getCalculatedFileSize(state.file)
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ jsxs(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
className: clsx("flex items-center gap-1", {
|
|
87
|
+
"w-1/2": variant === "horizontal",
|
|
88
|
+
"w-full": variant === "vertical"
|
|
89
|
+
}),
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx(FileProgressBar, { progress: state.progress }),
|
|
92
|
+
(as === "link" || variant === "horizontal") && /* @__PURE__ */ jsx(
|
|
93
|
+
InlineIconButton,
|
|
94
|
+
{
|
|
95
|
+
label: "Cancel",
|
|
96
|
+
color: "secondary",
|
|
97
|
+
onPress: () => {
|
|
98
|
+
onCancel(index);
|
|
99
|
+
},
|
|
100
|
+
icon: CloseIcon
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
as === "button" && variant === "vertical" && /* @__PURE__ */ jsx(
|
|
110
|
+
Button,
|
|
111
|
+
{
|
|
112
|
+
variant: "outlined",
|
|
113
|
+
size: "xs",
|
|
114
|
+
color: "secondary",
|
|
115
|
+
width: "hug",
|
|
116
|
+
onPress: () => {
|
|
117
|
+
onCancel(index);
|
|
118
|
+
},
|
|
119
|
+
children: t(($) => $.ui.fileUpload.cancel)
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
};
|
|
126
|
+
export {
|
|
127
|
+
FileUploadContentLoading
|
|
128
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DropZoneProps, FileTriggerProps } from 'react-aria-components';
|
|
2
|
-
import { InputUploadBaseProps } from '
|
|
2
|
+
import { InputUploadBaseProps } from '../inputUpload.types';
|
|
3
3
|
interface InputUploadContentProps extends Omit<InputUploadBaseProps, "ref"> {
|
|
4
4
|
onSelect: FileTriggerProps["onSelect"];
|
|
5
5
|
onDrop: DropZoneProps["onDrop"];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { FileTrigger, DropZone } from "react-aria-components";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { UploadIcon } from "../../../../assets/icons/Upload.js";
|
|
6
|
+
import { Button } from "../../../buttons/Button/Button.js";
|
|
7
|
+
import { TextButton } from "../../../buttons/TextButton/TextButton.js";
|
|
8
|
+
import { inputSize } from "../../shared/input.cva.js";
|
|
9
|
+
import { Typography } from "../../../text/Typography/Typography.js";
|
|
10
|
+
import { ns } from "../../../../config/i18n.js";
|
|
11
|
+
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
12
|
+
import { inputUploadButton, inputUploadDropZone } from "./inputUploadButton.cva.js";
|
|
13
|
+
const InputUploadContent = (props) => {
|
|
14
|
+
const { variant, isDisabled, error, ...rest } = props;
|
|
15
|
+
const { t } = useTranslation(ns);
|
|
16
|
+
const uiStyle = UIStyle.useConfig();
|
|
17
|
+
const inputSizeCva = uiStyle?.input?.sizeCva ?? inputSize;
|
|
18
|
+
return /* @__PURE__ */ jsx(FileTrigger, { ...rest, children: /* @__PURE__ */ jsxs(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
"data-rac": "",
|
|
22
|
+
"data-disabled": isDisabled || void 0,
|
|
23
|
+
"data-invalid": !!error || void 0,
|
|
24
|
+
className: inputUploadButton({
|
|
25
|
+
variant,
|
|
26
|
+
className: "group/input-upload"
|
|
27
|
+
}),
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsxs(
|
|
30
|
+
DropZone,
|
|
31
|
+
{
|
|
32
|
+
...rest,
|
|
33
|
+
isDisabled,
|
|
34
|
+
className: clsx(inputUploadDropZone({ variant }), inputSizeCva({ size: "default" })),
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ jsx(
|
|
37
|
+
Typography,
|
|
38
|
+
{
|
|
39
|
+
variant: "default",
|
|
40
|
+
size: "label-1",
|
|
41
|
+
as: "span",
|
|
42
|
+
className: "min-w-0 flex-fill select-none truncate text-text-default-3",
|
|
43
|
+
children: t(($) => $.ui.fileUpload.emptyText)
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
variant === "nested" && /* @__PURE__ */ jsx(
|
|
47
|
+
TextButton,
|
|
48
|
+
{
|
|
49
|
+
isDisabled,
|
|
50
|
+
icon: UploadIcon,
|
|
51
|
+
className: "p-0!",
|
|
52
|
+
children: t(($) => $.ui.fileUpload.upload)
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
variant !== "nested" && /* @__PURE__ */ jsx(
|
|
59
|
+
Button,
|
|
60
|
+
{
|
|
61
|
+
size: "m",
|
|
62
|
+
width: "hug",
|
|
63
|
+
isDisabled,
|
|
64
|
+
className: "truncate",
|
|
65
|
+
children: t(($) => $.ui.fileUpload.uploadFile)
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
) });
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
InputUploadContent
|
|
74
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { CloseIcon } from "../../../../assets/icons/Close.js";
|
|
4
|
+
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
|
+
import { inputSize } from "../../shared/input.cva.js";
|
|
6
|
+
import { Typography } from "../../../text/Typography/Typography.js";
|
|
7
|
+
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
8
|
+
const InputUploadFilled = ({ files, onRemove, isDisabled }) => {
|
|
9
|
+
const uiStyle = UIStyle.useConfig();
|
|
10
|
+
const inputSizeCva = uiStyle?.input?.sizeCva ?? inputSize;
|
|
11
|
+
return /* @__PURE__ */ jsxs(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: clsx(
|
|
15
|
+
"flex items-center rounded-input-rounding-default border border-input-outlined-outline-idle border-solid bg-input-outlined-idle",
|
|
16
|
+
inputSizeCva({ size: "default" })
|
|
17
|
+
),
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ jsx(
|
|
20
|
+
Typography,
|
|
21
|
+
{
|
|
22
|
+
variant: "default",
|
|
23
|
+
size: "label-1",
|
|
24
|
+
as: "span",
|
|
25
|
+
className: "flex-fill select-none truncate text-ellipsis text-text-default-1",
|
|
26
|
+
children: files.map((file) => file.name).join(", ")
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
InlineIconButton,
|
|
31
|
+
{
|
|
32
|
+
label: "Remove files",
|
|
33
|
+
color: "secondary",
|
|
34
|
+
icon: CloseIcon,
|
|
35
|
+
isDisabled,
|
|
36
|
+
onPress: onRemove
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
InputUploadFilled
|
|
45
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
const fileUploadDropZoneBase = cva(["relative w-full rounded-input-rounding-default"], {
|
|
4
|
+
variants: {
|
|
5
|
+
variant: {
|
|
6
|
+
vertical: ["flex-col justify-center"],
|
|
7
|
+
horizontal: ["flex-row justify-between"]
|
|
8
|
+
},
|
|
9
|
+
isContainer: {
|
|
10
|
+
true: [
|
|
11
|
+
"data-[drop-target]:before:content-['']",
|
|
12
|
+
"data-[drop-target]:before:absolute",
|
|
13
|
+
"data-[drop-target]:before:z-40",
|
|
14
|
+
"data-[drop-target]:before:width-full",
|
|
15
|
+
"data-[drop-target]:before:height-full",
|
|
16
|
+
"data-[drop-target]:before:top-0",
|
|
17
|
+
"data-[drop-target]:before:left-0",
|
|
18
|
+
"data-[drop-target]:border data-[drop-target]:border-dashed",
|
|
19
|
+
"data-[drop-target]:border-elevation-outline-default-2",
|
|
20
|
+
"data-[drop-target]:before:pointer-events-none data-[drop-target]:before:inset-0",
|
|
21
|
+
"data-[drop-target]:before:bg-elevation-fill-default-2"
|
|
22
|
+
],
|
|
23
|
+
false: [
|
|
24
|
+
"flex items-center",
|
|
25
|
+
"py-file-upload-container-height-top-bottom",
|
|
26
|
+
"px-file-upload-container-side-default",
|
|
27
|
+
"gap-gap-file-upload-content-gap-icon-to-content",
|
|
28
|
+
"border border-input-outlined-outline-idle border-dashed bg-input-outlined-idle",
|
|
29
|
+
"hover:border-elevation-outline-default-2 hover:bg-elevation-fill-default-2",
|
|
30
|
+
"invalid:border invalid:border-input-outlined-outline-error",
|
|
31
|
+
"data-[drop-target]:border-elevation-outline-default-2 data-[drop-target]:bg-elevation-fill-default-2",
|
|
32
|
+
"data-[has-files]:border-solid"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
variant: "vertical"
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
const fileUploadDropZone = (props) => {
|
|
41
|
+
const { className, ...rest } = props;
|
|
42
|
+
return clsx(fileUploadDropZoneBase(rest), className);
|
|
43
|
+
};
|
|
44
|
+
cva(["flex gap-3"], {
|
|
45
|
+
variants: {
|
|
46
|
+
variant: {
|
|
47
|
+
vertical: ["flex-col"],
|
|
48
|
+
horizontal: ["flex-row flex-wrap"]
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
variant: "vertical"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
fileUploadDropZone,
|
|
57
|
+
fileUploadDropZoneBase
|
|
58
|
+
};
|