@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,49 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
const inputUploadButtonBase = cva(
|
|
4
|
+
["flex w-full items-center justify-between gap-file-upload-input-gap-input-to-button-gap"],
|
|
5
|
+
{
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: [],
|
|
9
|
+
nested: []
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
variant: "default"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
const inputUploadButton = (props) => {
|
|
18
|
+
const { className, ...rest } = props;
|
|
19
|
+
return clsx(inputUploadButtonBase(rest), className);
|
|
20
|
+
};
|
|
21
|
+
const inputUploadDropZone = cva(
|
|
22
|
+
[
|
|
23
|
+
"min-w-0 flex-1",
|
|
24
|
+
"flex items-center",
|
|
25
|
+
"group-data-[invalid]/input-upload:border group-data-[invalid]/input-upload:border-input-outlined-outline-error",
|
|
26
|
+
"data-[drop-target]:border-input-outlined-outline-hover",
|
|
27
|
+
"hover:border-input-outlined-outline-hover"
|
|
28
|
+
],
|
|
29
|
+
{
|
|
30
|
+
variants: {
|
|
31
|
+
variant: {
|
|
32
|
+
default: [
|
|
33
|
+
"rounded-input-rounding-default border border-input-outlined-outline-idle border-solid bg-input-outlined-idle"
|
|
34
|
+
],
|
|
35
|
+
nested: [
|
|
36
|
+
"rounded-input-rounding-default border border-input-outlined-outline-idle border-solid bg-input-outlined-idle"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
variant: "default"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
export {
|
|
46
|
+
inputUploadButton,
|
|
47
|
+
inputUploadButtonBase,
|
|
48
|
+
inputUploadDropZone
|
|
49
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren, Ref } from 'react';
|
|
2
|
-
import { FormFieldErrorProps } from '
|
|
3
|
-
import { FormFieldHeaderProps } from '
|
|
4
|
-
import { TextInputProps } from '
|
|
2
|
+
import { FormFieldErrorProps } from './FormFieldError';
|
|
3
|
+
import { FormFieldHeaderProps } from './FormFieldHeader';
|
|
4
|
+
import { TextInputProps } from '../Input/TextInput/TextInput';
|
|
5
5
|
export interface FormFieldProps extends Omit<FormFieldHeaderProps, "className" | "labelProps">, Omit<FormFieldErrorProps, "className"> {
|
|
6
6
|
hideLabel?: boolean;
|
|
7
7
|
headerClassName?: string;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FormFieldError } from "./FormFieldError.js";
|
|
3
|
+
import { FormFieldHeader } from "./FormFieldHeader.js";
|
|
4
|
+
const FormField = ({
|
|
5
|
+
ref,
|
|
6
|
+
as,
|
|
7
|
+
label,
|
|
8
|
+
tooltipText,
|
|
9
|
+
helperText,
|
|
10
|
+
isRequired,
|
|
11
|
+
rightContent,
|
|
12
|
+
isDisabled,
|
|
13
|
+
error,
|
|
14
|
+
hideLabel,
|
|
15
|
+
headerClassName,
|
|
16
|
+
errorClassName,
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
labelProps,
|
|
20
|
+
isHeaderHidden
|
|
21
|
+
}) => {
|
|
22
|
+
const headerProps = {
|
|
23
|
+
label,
|
|
24
|
+
tooltipText,
|
|
25
|
+
helperText,
|
|
26
|
+
isRequired,
|
|
27
|
+
rightContent,
|
|
28
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
29
|
+
isDisabled,
|
|
30
|
+
className: headerClassName,
|
|
31
|
+
labelProps
|
|
32
|
+
};
|
|
33
|
+
const errorProps = {
|
|
34
|
+
error,
|
|
35
|
+
isDisabled,
|
|
36
|
+
isHidden: isHeaderHidden,
|
|
37
|
+
className: errorClassName
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
"div",
|
|
41
|
+
{
|
|
42
|
+
ref,
|
|
43
|
+
className,
|
|
44
|
+
children: [
|
|
45
|
+
!["filter", "floating"].includes(as ?? "") && /* @__PURE__ */ jsx(FormFieldHeader, { ...headerProps }),
|
|
46
|
+
children,
|
|
47
|
+
/* @__PURE__ */ jsx(FormFieldError, { ...errorProps })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
FormField
|
|
54
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { Typography } from "../../text/Typography/Typography.js";
|
|
4
|
+
const FormFieldError = ({ error, isDisabled, isHidden, className }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
Typography,
|
|
7
|
+
{
|
|
8
|
+
className: clsx("text-text-error-1", !error || isDisabled || isHidden ? "sr-only" : "mt-1-5", className),
|
|
9
|
+
size: "label-3",
|
|
10
|
+
children: error
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
FormFieldError
|
|
16
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { Focusable } from "react-aria-components";
|
|
4
|
+
import { InfoIcon } from "../../../assets/icons/Info.js";
|
|
5
|
+
import { FormFieldLabel } from "./FormFieldLabel.js";
|
|
6
|
+
import { Tooltip } from "../../overlays/Tooltip/Tooltip.js";
|
|
7
|
+
import { Typography } from "../../text/Typography/Typography.js";
|
|
8
|
+
const FormFieldHeader = ({
|
|
9
|
+
label,
|
|
10
|
+
tooltipText,
|
|
11
|
+
helperText,
|
|
12
|
+
isRequired,
|
|
13
|
+
rightContent,
|
|
14
|
+
isHeaderHidden,
|
|
15
|
+
isDisabled,
|
|
16
|
+
className,
|
|
17
|
+
labelProps
|
|
18
|
+
}) => {
|
|
19
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx(isHeaderHidden ? "sr-only" : "mb-1", className), children: [
|
|
20
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
21
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-1", children: [
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
FormFieldLabel,
|
|
24
|
+
{
|
|
25
|
+
label,
|
|
26
|
+
isRequired,
|
|
27
|
+
isDisabled,
|
|
28
|
+
labelProps
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
tooltipText && /* @__PURE__ */ jsx(Tooltip, { text: tooltipText, children: /* @__PURE__ */ jsx(Focusable, { children: /* @__PURE__ */ jsx(
|
|
32
|
+
InfoIcon,
|
|
33
|
+
{
|
|
34
|
+
className: clsx(
|
|
35
|
+
"size-6",
|
|
36
|
+
isDisabled ? "text-interactive-text-secondary-disabled" : "text-interactive-text-secondary-idle hover:text-interactive-text-secondary-hover"
|
|
37
|
+
),
|
|
38
|
+
tabIndex: 0
|
|
39
|
+
}
|
|
40
|
+
) }) })
|
|
41
|
+
] }),
|
|
42
|
+
rightContent
|
|
43
|
+
] }),
|
|
44
|
+
helperText && /* @__PURE__ */ jsx(
|
|
45
|
+
Typography,
|
|
46
|
+
{
|
|
47
|
+
slot: "description",
|
|
48
|
+
size: "label-2",
|
|
49
|
+
className: clsx(isDisabled ? "text-interactive-3" : "text-text-default-2"),
|
|
50
|
+
children: helperText
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] });
|
|
54
|
+
};
|
|
55
|
+
export {
|
|
56
|
+
FormFieldHeader
|
|
57
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "react-aria-components";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { CloseIcon } from "../../../assets/icons/Close.js";
|
|
5
|
+
import { ns } from "../../../config/i18n.js";
|
|
6
|
+
const FormFieldHeaderClose = ({ onClose }) => {
|
|
7
|
+
const { t } = useTranslation(ns);
|
|
8
|
+
return /* @__PURE__ */ jsx(
|
|
9
|
+
Button,
|
|
10
|
+
{
|
|
11
|
+
onPress: onClose,
|
|
12
|
+
"aria-label": t(($) => $.ui.closeAlt),
|
|
13
|
+
className: "shrink-0 focus-visible:outline-interactive-text-secondary-focus",
|
|
14
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-6 text-interactive-text-secondary-idle" })
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
FormFieldHeaderClose
|
|
20
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DOMAttributes } from '@react-types/shared';
|
|
2
2
|
import { RefCallback } from 'react';
|
|
3
|
-
import { InputSizeProps } from '
|
|
4
|
-
import { LabelBaseProps } from '
|
|
3
|
+
import { InputSizeProps } from '../shared/input.cva';
|
|
4
|
+
import { LabelBaseProps } from '../shared/label.cva';
|
|
5
5
|
export interface FormFieldLabelProps extends LabelBaseProps, InputSizeProps {
|
|
6
6
|
label: string;
|
|
7
7
|
isRequired?: boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { Label } from "react-aria-components";
|
|
4
|
+
import { inputSide } from "../shared/input.cva.js";
|
|
5
|
+
import { labelTypography, labelBase } from "../shared/label.cva.js";
|
|
6
|
+
import { Typography } from "../../text/Typography/Typography.js";
|
|
7
|
+
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
8
|
+
const FormFieldLabel = ({ ref, as, label, isRequired, isDisabled, labelProps, size }) => {
|
|
9
|
+
const uiStyle = UIStyle.useConfig();
|
|
10
|
+
const labelTypographyMap = uiStyle?.label?.typography ?? labelTypography;
|
|
11
|
+
const labelBaseCva = uiStyle?.label?.cva ?? labelBase;
|
|
12
|
+
const inputSideCva = uiStyle?.input?.sideCva ?? inputSide;
|
|
13
|
+
return /* @__PURE__ */ jsx(Label, { ...labelProps, children: /* @__PURE__ */ jsxs(
|
|
14
|
+
Typography,
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
as: "span",
|
|
18
|
+
...{
|
|
19
|
+
size: "label-2",
|
|
20
|
+
variant: "prominent-1",
|
|
21
|
+
...labelTypographyMap({ as })
|
|
22
|
+
},
|
|
23
|
+
className: clsx(
|
|
24
|
+
labelBaseCva({ as }),
|
|
25
|
+
as && ["filter", "floating"].includes(as) && inputSideCva({ size, type: "left" }),
|
|
26
|
+
labelProps?.className
|
|
27
|
+
),
|
|
28
|
+
children: [
|
|
29
|
+
label,
|
|
30
|
+
isRequired && /* @__PURE__ */ jsx("span", { className: clsx(!isDisabled && "text-text-error-1"), children: "*" })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
) });
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
FormFieldLabel
|
|
37
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import { NumberFieldProps as AriaNumberFieldProps } from 'react-aria-components';
|
|
3
3
|
import { FieldValues } from 'react-hook-form';
|
|
4
|
-
import { FormFieldProps } from '
|
|
5
|
-
import { InputContentProps } from '
|
|
6
|
-
import { ControlProps } from '
|
|
7
|
-
import { InputVariantProps } from '
|
|
4
|
+
import { FormFieldProps } from '../../FormField/FormField';
|
|
5
|
+
import { InputContentProps } from '../shared/InputContent';
|
|
6
|
+
import { ControlProps } from '../../shared/form.types';
|
|
7
|
+
import { InputVariantProps } from '../../shared/input.cva';
|
|
8
8
|
interface NumberInputBaseProps extends FormFieldProps, InputVariantProps, Omit<InputContentProps, "ref" | "value" | "onChange">, Omit<AriaNumberFieldProps, "value" | "onChange" | "className"> {
|
|
9
9
|
ref?: Ref<HTMLInputElement>;
|
|
10
10
|
placeholder?: string;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { useRef } from "react";
|
|
5
|
+
import { useNumberField } from "react-aria";
|
|
6
|
+
import { useLocale, Input } from "react-aria-components";
|
|
7
|
+
import { Controller } from "react-hook-form";
|
|
8
|
+
import { useNumberFieldState } from "react-stately";
|
|
9
|
+
import { FormField } from "../../FormField/FormField.js";
|
|
10
|
+
import { InputContent } from "../shared/InputContent.js";
|
|
11
|
+
import { useInputCva } from "../../shared/input.cva.js";
|
|
12
|
+
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
13
|
+
const NumberInputBase = (props) => {
|
|
14
|
+
const ui = UIConfig.useConfig();
|
|
15
|
+
const inputCva = useInputCva();
|
|
16
|
+
const {
|
|
17
|
+
ref,
|
|
18
|
+
inputClassName,
|
|
19
|
+
label,
|
|
20
|
+
tooltipText,
|
|
21
|
+
helperText,
|
|
22
|
+
isRequired,
|
|
23
|
+
rightContent,
|
|
24
|
+
isDisabled,
|
|
25
|
+
headerClassName,
|
|
26
|
+
errorClassName,
|
|
27
|
+
isHeaderHidden,
|
|
28
|
+
error,
|
|
29
|
+
className,
|
|
30
|
+
unit,
|
|
31
|
+
isLoading,
|
|
32
|
+
action,
|
|
33
|
+
leadingIcon,
|
|
34
|
+
trailingIcon,
|
|
35
|
+
value,
|
|
36
|
+
onChange,
|
|
37
|
+
onBlur,
|
|
38
|
+
formatOptions = ui.numberInput.formatOptions,
|
|
39
|
+
variant = ui.input.variant,
|
|
40
|
+
as = ui.input.as,
|
|
41
|
+
size = ui.input.size,
|
|
42
|
+
hideLabel = ui.input.hideLabel,
|
|
43
|
+
isClearable = ui.input.isClearable,
|
|
44
|
+
...rest
|
|
45
|
+
} = props;
|
|
46
|
+
const numberFieldRef = useRef(null);
|
|
47
|
+
const { locale } = useLocale();
|
|
48
|
+
const numberProps = {
|
|
49
|
+
...rest,
|
|
50
|
+
value: value ?? void 0,
|
|
51
|
+
label,
|
|
52
|
+
isDisabled,
|
|
53
|
+
isInvalid: !!error,
|
|
54
|
+
isRequired,
|
|
55
|
+
onChange,
|
|
56
|
+
onBlur,
|
|
57
|
+
locale,
|
|
58
|
+
formatOptions
|
|
59
|
+
};
|
|
60
|
+
const state = useNumberFieldState(numberProps);
|
|
61
|
+
const { labelProps, inputProps } = useNumberField(numberProps, state, numberFieldRef);
|
|
62
|
+
const formFieldProps = {
|
|
63
|
+
error,
|
|
64
|
+
label,
|
|
65
|
+
tooltipText,
|
|
66
|
+
helperText,
|
|
67
|
+
isRequired,
|
|
68
|
+
rightContent,
|
|
69
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
70
|
+
hideLabel,
|
|
71
|
+
isDisabled,
|
|
72
|
+
headerClassName,
|
|
73
|
+
errorClassName
|
|
74
|
+
};
|
|
75
|
+
const inputContentProps = {
|
|
76
|
+
unit,
|
|
77
|
+
isLoading,
|
|
78
|
+
isDisabled,
|
|
79
|
+
action,
|
|
80
|
+
leadingIcon,
|
|
81
|
+
trailingIcon,
|
|
82
|
+
isClearable
|
|
83
|
+
};
|
|
84
|
+
const headerProps = {
|
|
85
|
+
label,
|
|
86
|
+
tooltipText,
|
|
87
|
+
helperText,
|
|
88
|
+
isRequired,
|
|
89
|
+
rightContent,
|
|
90
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
91
|
+
isDisabled,
|
|
92
|
+
className: headerClassName,
|
|
93
|
+
labelProps
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
FormField,
|
|
97
|
+
{
|
|
98
|
+
...formFieldProps,
|
|
99
|
+
as,
|
|
100
|
+
labelProps,
|
|
101
|
+
className: clsx("group w-full", className),
|
|
102
|
+
children: /* @__PURE__ */ jsx(
|
|
103
|
+
InputContent,
|
|
104
|
+
{
|
|
105
|
+
...inputContentProps,
|
|
106
|
+
headerProps,
|
|
107
|
+
as,
|
|
108
|
+
size,
|
|
109
|
+
children: (style) => /* @__PURE__ */ jsx(
|
|
110
|
+
Input,
|
|
111
|
+
{
|
|
112
|
+
...inputProps,
|
|
113
|
+
ref,
|
|
114
|
+
placeholder: as === "floating" ? "" : inputProps.placeholder,
|
|
115
|
+
className: inputCva({
|
|
116
|
+
variant,
|
|
117
|
+
as,
|
|
118
|
+
size,
|
|
119
|
+
...rest,
|
|
120
|
+
className: inputClassName
|
|
121
|
+
}),
|
|
122
|
+
style
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
const NumberInput = (props) => {
|
|
131
|
+
if ("formControl" in props && props.formControl) {
|
|
132
|
+
const { formControl, ref, ...innerProps } = props;
|
|
133
|
+
return /* @__PURE__ */ jsx(
|
|
134
|
+
Controller,
|
|
135
|
+
{
|
|
136
|
+
control: formControl.control,
|
|
137
|
+
name: formControl.name,
|
|
138
|
+
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(
|
|
139
|
+
NumberInputBase,
|
|
140
|
+
{
|
|
141
|
+
...innerProps,
|
|
142
|
+
ref: mergeRefs(ref, field.ref),
|
|
143
|
+
value: field.value,
|
|
144
|
+
onChange: field.onChange,
|
|
145
|
+
onBlur: field.onBlur,
|
|
146
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
147
|
+
error: props.error ?? error?.message
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
return /* @__PURE__ */ jsx(NumberInputBase, { ...props });
|
|
154
|
+
};
|
|
155
|
+
export {
|
|
156
|
+
NumberInput
|
|
157
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FieldValues } from 'react-hook-form';
|
|
2
|
-
import { TextInputProps } from '
|
|
3
|
-
import { ControlProps } from '
|
|
2
|
+
import { TextInputProps } from '../TextInput/TextInput';
|
|
3
|
+
import { ControlProps } from '../../shared/form.types';
|
|
4
4
|
export interface PasswordInputProps extends Omit<TextInputProps, "type" | "action" | "trailingIcon" | "unit"> {
|
|
5
5
|
}
|
|
6
6
|
export type ControlledPasswordInputProps<TFieldValues extends FieldValues> = ControlProps<PasswordInputProps, TFieldValues>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { ViewIcon } from "../../../../assets/icons/View.js";
|
|
5
|
+
import { ViewOffIcon } from "../../../../assets/icons/ViewOff.js";
|
|
6
|
+
import { TextInput } from "../TextInput/TextInput.js";
|
|
7
|
+
import { ns } from "../../../../config/i18n.js";
|
|
8
|
+
const PasswordInput = (props) => {
|
|
9
|
+
const { t } = useTranslation(ns);
|
|
10
|
+
const [isRevealed, setIsRevealed] = useState(false);
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
TextInput,
|
|
13
|
+
{
|
|
14
|
+
...props,
|
|
15
|
+
type: isRevealed ? "text" : "password",
|
|
16
|
+
action: {
|
|
17
|
+
icon: isRevealed ? ViewIcon : ViewOffIcon,
|
|
18
|
+
altText: t(($) => isRevealed ? $.ui.password.hide : $.ui.password.reveal),
|
|
19
|
+
onClick: () => setIsRevealed(!isRevealed)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
PasswordInput
|
|
26
|
+
};
|
|
@@ -2,9 +2,9 @@ import { Ref } from 'react';
|
|
|
2
2
|
import { AriaTextFieldProps } from 'react-aria';
|
|
3
3
|
import { TextAreaProps as AriaTextAreaProps } from 'react-aria-components';
|
|
4
4
|
import { FieldValues } from 'react-hook-form';
|
|
5
|
-
import { FormFieldProps } from '
|
|
6
|
-
import { ControlProps } from '
|
|
7
|
-
import { InputVariantProps } from '
|
|
5
|
+
import { FormFieldProps } from '../../FormField/FormField';
|
|
6
|
+
import { ControlProps } from '../../shared/form.types';
|
|
7
|
+
import { InputVariantProps } from '../../shared/input.cva';
|
|
8
8
|
interface TextAreaBaseProps extends FormFieldProps, InputVariantProps, Omit<AriaTextAreaProps, "value" | "defaultValue" | "onChange" | "disabled" | "required" | "className" | keyof AriaTextFieldProps>, Omit<AriaTextFieldProps<HTMLTextAreaElement>, "label"> {
|
|
9
9
|
ref?: Ref<HTMLTextAreaElement>;
|
|
10
10
|
isClearable?: boolean;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { mergeRefs } from "@react-aria/utils";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { useRef } from "react";
|
|
5
|
+
import { useTextField } from "react-aria";
|
|
6
|
+
import { TextArea as TextArea$1 } from "react-aria-components";
|
|
7
|
+
import { Controller } from "react-hook-form";
|
|
8
|
+
import { FormField } from "../../FormField/FormField.js";
|
|
9
|
+
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
10
|
+
import { InputClear } from "../../shared/InputClear.js";
|
|
11
|
+
import { useInputCva, inputSize } from "../../shared/input.cva.js";
|
|
12
|
+
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
13
|
+
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
14
|
+
const TextAreaBase = (props) => {
|
|
15
|
+
const ui = UIConfig.useConfig();
|
|
16
|
+
const inputCva = useInputCva();
|
|
17
|
+
const uiStyle = UIStyle.useConfig();
|
|
18
|
+
const inputSizeCva = uiStyle?.input?.sizeCva ?? inputSize;
|
|
19
|
+
const {
|
|
20
|
+
ref,
|
|
21
|
+
className,
|
|
22
|
+
inputClassName,
|
|
23
|
+
error,
|
|
24
|
+
label,
|
|
25
|
+
tooltipText,
|
|
26
|
+
helperText,
|
|
27
|
+
isRequired,
|
|
28
|
+
rightContent,
|
|
29
|
+
isDisabled,
|
|
30
|
+
headerClassName,
|
|
31
|
+
errorClassName,
|
|
32
|
+
isHeaderHidden,
|
|
33
|
+
value,
|
|
34
|
+
onChange,
|
|
35
|
+
onBlur,
|
|
36
|
+
as = ui.input.as,
|
|
37
|
+
hideLabel = ui.input.hideLabel,
|
|
38
|
+
variant = ui.input.variant,
|
|
39
|
+
isClearable = ui.input.isClearable,
|
|
40
|
+
...rest
|
|
41
|
+
} = props;
|
|
42
|
+
const textFieldRef = useRef(null);
|
|
43
|
+
const textFieldProps = {
|
|
44
|
+
...rest,
|
|
45
|
+
label,
|
|
46
|
+
isDisabled,
|
|
47
|
+
isInvalid: !!error,
|
|
48
|
+
isRequired,
|
|
49
|
+
value,
|
|
50
|
+
onChange,
|
|
51
|
+
onBlur
|
|
52
|
+
};
|
|
53
|
+
const { labelProps, inputProps } = useTextField(textFieldProps, textFieldRef);
|
|
54
|
+
const formFieldProps = {
|
|
55
|
+
error,
|
|
56
|
+
label,
|
|
57
|
+
tooltipText,
|
|
58
|
+
helperText,
|
|
59
|
+
isRequired,
|
|
60
|
+
rightContent,
|
|
61
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
62
|
+
hideLabel,
|
|
63
|
+
isDisabled,
|
|
64
|
+
headerClassName,
|
|
65
|
+
errorClassName
|
|
66
|
+
};
|
|
67
|
+
const headerProps = {
|
|
68
|
+
label,
|
|
69
|
+
tooltipText,
|
|
70
|
+
helperText,
|
|
71
|
+
isRequired,
|
|
72
|
+
rightContent,
|
|
73
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
74
|
+
isDisabled,
|
|
75
|
+
className: headerClassName,
|
|
76
|
+
labelProps
|
|
77
|
+
};
|
|
78
|
+
const showClear = isClearable && !!value;
|
|
79
|
+
return /* @__PURE__ */ jsx(
|
|
80
|
+
FormField,
|
|
81
|
+
{
|
|
82
|
+
...formFieldProps,
|
|
83
|
+
as,
|
|
84
|
+
labelProps,
|
|
85
|
+
className: clsx("w-full", className),
|
|
86
|
+
children: /* @__PURE__ */ jsxs(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: "group/text-area relative h-full",
|
|
90
|
+
"data-text-area": true,
|
|
91
|
+
children: [
|
|
92
|
+
as === "floating" && headerProps && /* @__PURE__ */ jsx(
|
|
93
|
+
FormFieldLabel,
|
|
94
|
+
{
|
|
95
|
+
as,
|
|
96
|
+
...headerProps
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ jsx(
|
|
100
|
+
TextArea$1,
|
|
101
|
+
{
|
|
102
|
+
...inputProps,
|
|
103
|
+
placeholder: as === "floating" ? "" : inputProps.placeholder,
|
|
104
|
+
className: inputCva({
|
|
105
|
+
variant,
|
|
106
|
+
as,
|
|
107
|
+
...rest,
|
|
108
|
+
className: clsx("block h-full min-h-8", inputClassName)
|
|
109
|
+
}),
|
|
110
|
+
ref
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
showClear && /* @__PURE__ */ jsx("span", { className: clsx("absolute top-0 right-0", inputSizeCva({ size: "default" })), children: /* @__PURE__ */ jsx(InputClear, { onClear: () => onChange?.("") }) })
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
const TextArea = (props) => {
|
|
121
|
+
if ("formControl" in props && props.formControl) {
|
|
122
|
+
const { formControl, ref, ...innerProps } = props;
|
|
123
|
+
return /* @__PURE__ */ jsx(
|
|
124
|
+
Controller,
|
|
125
|
+
{
|
|
126
|
+
control: formControl.control,
|
|
127
|
+
name: formControl.name,
|
|
128
|
+
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(
|
|
129
|
+
TextAreaBase,
|
|
130
|
+
{
|
|
131
|
+
...innerProps,
|
|
132
|
+
ref: mergeRefs(ref, field.ref),
|
|
133
|
+
value: field.value ?? "",
|
|
134
|
+
onChange: field.onChange,
|
|
135
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
136
|
+
error: props.error ?? error?.message
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
return /* @__PURE__ */ jsx(TextAreaBase, { ...props });
|
|
143
|
+
};
|
|
144
|
+
export {
|
|
145
|
+
TextArea
|
|
146
|
+
};
|
|
@@ -2,10 +2,10 @@ import { Ref } from 'react';
|
|
|
2
2
|
import { AriaTextFieldProps } from 'react-aria';
|
|
3
3
|
import { InputProps as AriaInputProps } from 'react-aria-components';
|
|
4
4
|
import { FieldValues } from 'react-hook-form';
|
|
5
|
-
import { FormFieldProps } from '
|
|
6
|
-
import { InputContentProps } from '
|
|
7
|
-
import { ControlProps } from '
|
|
8
|
-
import { InputVariantProps } from '
|
|
5
|
+
import { FormFieldProps } from '../../FormField/FormField';
|
|
6
|
+
import { InputContentProps } from '../shared/InputContent';
|
|
7
|
+
import { ControlProps } from '../../shared/form.types';
|
|
8
|
+
import { InputVariantProps } from '../../shared/input.cva';
|
|
9
9
|
type AllowedHTMLInputTypeAttribute = "email" | "hidden" | "tel" | "text" | "url";
|
|
10
10
|
interface TextInputBaseProps extends FormFieldProps, InputVariantProps, Omit<InputContentProps, "ref" | "value" | "onChange">, Omit<AriaInputProps, "value" | "defaultValue" | "onChange" | "disabled" | "required" | "type" | "size" | "className" | keyof AriaTextFieldProps>, Omit<AriaTextFieldProps<HTMLInputElement>, "label"> {
|
|
11
11
|
ref?: Ref<HTMLInputElement>;
|