@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,133 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { compoundMapper } from "../../../utils/compoundMapper.js";
|
|
3
|
+
const labelBase = cva([], {
|
|
4
|
+
variants: {
|
|
5
|
+
as: {
|
|
6
|
+
default: ["flex items-start gap-1"],
|
|
7
|
+
filter: ["-translate-y-1/2 absolute top-1/2"],
|
|
8
|
+
inline: ["flex items-start gap-1"],
|
|
9
|
+
floating: [
|
|
10
|
+
"absolute transition-all duration-75",
|
|
11
|
+
"-translate-y-1/2 top-1/2",
|
|
12
|
+
"text-text-default-2 group-has-[input:disabled]/input-content:text-interactive-text-secondary-disabled",
|
|
13
|
+
"group-disabled/date-picker-content:text-interactive-text-secondary-disabled",
|
|
14
|
+
"group-disabled/text-editor:text-interactive-text-secondary-disabled",
|
|
15
|
+
"group-has-[input:disabled]/select-content:text-interactive-text-secondary-disabled",
|
|
16
|
+
"group-has-[textarea:disabled]/text-area:text-interactive-text-secondary-disabled",
|
|
17
|
+
// TextArea default positioning
|
|
18
|
+
"group-data-[text-area]/text-area:top-5 group-data-[text-area]/text-area:translate-y-0",
|
|
19
|
+
// TextEditor default positioning
|
|
20
|
+
"group-data-[text-editor]/text-editor:top-5 group-data-[text-editor]/text-editor:left-2 group-data-[text-editor]/text-editor:translate-y-0",
|
|
21
|
+
// Text and Number Input
|
|
22
|
+
"group-focus/input-content:top-1 group-focus/input-content:translate-y-0",
|
|
23
|
+
"group-focus-within/input-content:top-1 group-focus-within/input-content:translate-y-0",
|
|
24
|
+
"group-has-[input:not(:placeholder-shown)]/input-content:top-1 group-has-[input:not(:placeholder-shown)]/input-content:translate-y-0",
|
|
25
|
+
// TextArea
|
|
26
|
+
"group-focus/text-area:top-1 group-focus/text-area:translate-y-0",
|
|
27
|
+
"group-focus-within/text-area:top-1 group-focus-within/text-area:translate-y-0",
|
|
28
|
+
"group-has-[textarea:not(:placeholder-shown)]/text-area:top-1 group-has-[textarea:not(:placeholder-shown)]/text-area:translate-y-0",
|
|
29
|
+
// TextEditor
|
|
30
|
+
"group-focus/text-editor:top-1 group-focus/text-editor:translate-y-0",
|
|
31
|
+
"group-focus-within/text-editor:top-1 group-focus-within/text-editor:translate-y-0",
|
|
32
|
+
"group-data-[is-filled=true]/text-editor:top-1 group-data-[is-filled=true]/text-editor:translate-y-0",
|
|
33
|
+
// Date and Time Picker
|
|
34
|
+
"group-data-[has-selection]/date-picker-content:top-1 group-data-[has-selection]/date-picker-content:translate-y-0",
|
|
35
|
+
"group-focus-within/date-picker-content:top-1 group-focus-within/date-picker-content:translate-y-0",
|
|
36
|
+
// Select and Autocomplete
|
|
37
|
+
"group-data-[has-selection]/select-content:top-1 group-data-[has-selection]/select-content:translate-y-0",
|
|
38
|
+
"group-data-[searchable-focus-within]/select-content:top-1 group-data-[searchable-focus-within]/select-content:translate-y-0",
|
|
39
|
+
"group-data-[has-search]/select-content:top-1 group-data-[has-search]/select-content:translate-y-0",
|
|
40
|
+
// Text and Number Input
|
|
41
|
+
"group-has-[input:placeholder-shown]/input-content:text-text-default-3",
|
|
42
|
+
"group-has-[input:placeholder-shown]/input-content:!font-medium",
|
|
43
|
+
"group-has-[input:not(placeholder-shown)]/input-content:!font-semibold",
|
|
44
|
+
"group-has-[input:not(:placeholder-shown)]/input-content:!text-label-3",
|
|
45
|
+
"group-has-[input:not(placeholder-shown)]/input-content:text-text-default-1",
|
|
46
|
+
"group-focus-within/input-content:!text-text-default-1",
|
|
47
|
+
"group-focus-within/input-content:text-label-3",
|
|
48
|
+
"group-has-[input:focus-within]/input-content:!font-semibold",
|
|
49
|
+
// TextArea
|
|
50
|
+
"group-has-[textarea:placeholder-shown]/text-area:text-text-default-3",
|
|
51
|
+
"group-has-[textarea:placeholder-shown]/text-area:!font-medium",
|
|
52
|
+
"group-has-[textarea:not(placeholder-shown)]/text-area:!font-semibold",
|
|
53
|
+
"group-has-[textarea:not(:placeholder-shown)]/text-area:!text-label-3",
|
|
54
|
+
"group-has-[textarea:not(placeholder-shown)]/text-area:text-text-default-1",
|
|
55
|
+
"group-focus-within/text-area:!text-text-default-1",
|
|
56
|
+
"group-focus-within/text-area:text-label-3",
|
|
57
|
+
"group-has-[textarea:focus-within]/text-area:!font-semibold",
|
|
58
|
+
// TextEditor
|
|
59
|
+
"group-has-[data-text-editor:placeholder-shown]/text-editor:text-text-default-3",
|
|
60
|
+
"group-has-[data-text-editor:placeholder-shown]/text-editor:!font-medium",
|
|
61
|
+
"group-data-[is-filled=true]/text-editor:!font-semibold",
|
|
62
|
+
"group-data-[is-filled=true]/text-editor:!text-label-3",
|
|
63
|
+
"group-data-[is-filled=true]/text-editor:text-text-default-1",
|
|
64
|
+
"group-focus-within/text-editor:!text-text-default-1",
|
|
65
|
+
"group-focus-within/text-editor:text-label-3",
|
|
66
|
+
"group-has-[data-text-editor:focus-within]/text-editor:!font-semibold",
|
|
67
|
+
// DatePicker, TimePicker focus-within
|
|
68
|
+
"group-data-[has-selection]/date-picker-content:!font-semibold",
|
|
69
|
+
"group-data-[has-selection]/date-picker-content:!text-label-3",
|
|
70
|
+
"group-data-[has-selection]/date-picker-content:text-text-default-1",
|
|
71
|
+
"group-focus-within/date-picker-content:!font-semibold",
|
|
72
|
+
"group-focus-within/date-picker-content:!text-label-3",
|
|
73
|
+
"group-focus-within/date-picker-content:text-text-default-1",
|
|
74
|
+
// Select focused state
|
|
75
|
+
"group-data-[has-selection]/select-content:!font-semibold",
|
|
76
|
+
"group-data-[has-selection]/select-content:!text-label-3",
|
|
77
|
+
"group-data-[has-selection]/select-content:text-text-default-1",
|
|
78
|
+
"group-data-[searchable-focus-within]/select-content:!font-semibold",
|
|
79
|
+
"group-data-[searchable-focus-within]/select-content:!text-label-3",
|
|
80
|
+
"group-data-[searchable-focus-within]/select-content:text-text-default-1",
|
|
81
|
+
"group-data-[has-search]/select-content:!font-semibold",
|
|
82
|
+
"group-data-[has-search]/select-content:!text-label-3",
|
|
83
|
+
"group-data-[has-search]/select-content:text-text-default-1"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
defaultVariants: {
|
|
88
|
+
as: "default"
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const labelTypography = compoundMapper({
|
|
92
|
+
compoundVariants: [
|
|
93
|
+
{
|
|
94
|
+
as: "default",
|
|
95
|
+
value: {
|
|
96
|
+
size: "label-2",
|
|
97
|
+
variant: "prominent-1"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
as: "filter",
|
|
102
|
+
value: {
|
|
103
|
+
size: "label-1",
|
|
104
|
+
variant: "default"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
as: "inline",
|
|
109
|
+
value: {
|
|
110
|
+
size: "label-2",
|
|
111
|
+
variant: "prominent-1"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
as: "floating",
|
|
116
|
+
value: {
|
|
117
|
+
size: "label-1",
|
|
118
|
+
variant: "default"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
default: {
|
|
123
|
+
size: "label-2",
|
|
124
|
+
variant: "prominent-1"
|
|
125
|
+
},
|
|
126
|
+
defaultVariants: {
|
|
127
|
+
as: "default"
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
export {
|
|
131
|
+
labelBase,
|
|
132
|
+
labelTypography
|
|
133
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
const uiOutlineClass = clsx(
|
|
3
|
+
"focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2"
|
|
4
|
+
);
|
|
5
|
+
const uiGroupOutlineClass = clsx(
|
|
6
|
+
"group-focus:outline-none group-focus-visible:outline group-focus-visible:outline-2 group-focus-visible:outline-solid group-focus-visible:outline-offset-2"
|
|
7
|
+
);
|
|
8
|
+
export {
|
|
9
|
+
uiGroupOutlineClass,
|
|
10
|
+
uiOutlineClass
|
|
11
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ButtonVariantProps } from '
|
|
2
|
-
import { ModalProps } from '
|
|
1
|
+
import { ButtonVariantProps } from '../../buttons/Button/button.cva';
|
|
2
|
+
import { ModalProps } from '../Modal/Modal';
|
|
3
3
|
interface ActionModalAction {
|
|
4
4
|
label: string;
|
|
5
5
|
onPress: () => void;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { Button } from "../../buttons/Button/Button.js";
|
|
4
|
+
import { Modal } from "../Modal/Modal.js";
|
|
5
|
+
import { Typography } from "../../text/Typography/Typography.js";
|
|
6
|
+
const textAlignClassMap = {
|
|
7
|
+
left: "text-left",
|
|
8
|
+
center: "text-center",
|
|
9
|
+
right: "text-right"
|
|
10
|
+
};
|
|
11
|
+
const ActionModal = ({
|
|
12
|
+
heading,
|
|
13
|
+
description,
|
|
14
|
+
primaryAction,
|
|
15
|
+
secondaryAction,
|
|
16
|
+
buttonSize = "m",
|
|
17
|
+
textAlign = "left",
|
|
18
|
+
modalClassName,
|
|
19
|
+
...modalProps
|
|
20
|
+
}) => {
|
|
21
|
+
const textAlignClass = textAlignClassMap[textAlign];
|
|
22
|
+
return /* @__PURE__ */ jsxs(
|
|
23
|
+
Modal,
|
|
24
|
+
{
|
|
25
|
+
modalClassName: clsx("w-modal", modalClassName),
|
|
26
|
+
...modalProps,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-modal-gap-text", children: [
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
Typography,
|
|
31
|
+
{
|
|
32
|
+
size: "title-5",
|
|
33
|
+
variant: "prominent-1",
|
|
34
|
+
as: "h2",
|
|
35
|
+
className: textAlignClass,
|
|
36
|
+
children: heading
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
Typography,
|
|
41
|
+
{
|
|
42
|
+
size: "body-3",
|
|
43
|
+
className: textAlignClass,
|
|
44
|
+
children: description
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] }),
|
|
48
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full flex-wrap gap-modal-gap-buttons pt-1", children: [
|
|
49
|
+
secondaryAction && /* @__PURE__ */ jsx(
|
|
50
|
+
Button,
|
|
51
|
+
{
|
|
52
|
+
variant: secondaryAction?.variant ?? "contained",
|
|
53
|
+
size: buttonSize,
|
|
54
|
+
color: secondaryAction?.color ?? "secondary",
|
|
55
|
+
width: "fill",
|
|
56
|
+
onPress: secondaryAction?.onPress,
|
|
57
|
+
className: clsx("min-w-40 flex-1 shrink-0", secondaryAction?.className),
|
|
58
|
+
children: secondaryAction?.label
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ jsx(
|
|
62
|
+
Button,
|
|
63
|
+
{
|
|
64
|
+
variant: primaryAction?.variant ?? "contained",
|
|
65
|
+
size: buttonSize,
|
|
66
|
+
color: primaryAction?.color ?? "primary",
|
|
67
|
+
width: "fill",
|
|
68
|
+
onPress: primaryAction.onPress,
|
|
69
|
+
className: clsx("min-w-40 flex-1 shrink-0", primaryAction?.className),
|
|
70
|
+
children: primaryAction.label
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] })
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
export {
|
|
79
|
+
ActionModal
|
|
80
|
+
};
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useViewportSize, useResizeObserver } from "@react-aria/utils";
|
|
3
|
+
import { clsx } from "clsx";
|
|
4
|
+
import { useState, useEffect, useMemo, useRef } from "react";
|
|
5
|
+
import { DialogTrigger, Dialog, ModalOverlay, Modal } from "react-aria-components";
|
|
6
|
+
import { DomUtils } from "../../../utils/dom.utils.js";
|
|
7
|
+
import { useMotionValue, animate, AnimatePresence, motion } from "framer-motion";
|
|
8
|
+
const MotionModal = motion.create(Modal);
|
|
9
|
+
const MotionModalOverlay = motion.create(ModalOverlay);
|
|
10
|
+
const inertiaTransition = {
|
|
11
|
+
type: "inertia",
|
|
12
|
+
bounceStiffness: 300,
|
|
13
|
+
bounceDamping: 40,
|
|
14
|
+
timeConstant: 300
|
|
15
|
+
};
|
|
16
|
+
const staticTransition = {
|
|
17
|
+
duration: 0.5,
|
|
18
|
+
ease: [0.32, 0.72, 0, 1]
|
|
19
|
+
};
|
|
20
|
+
const BottomSheetBase = ({
|
|
21
|
+
isOpen,
|
|
22
|
+
onOpenChange,
|
|
23
|
+
onStateChange,
|
|
24
|
+
isDismissable = false,
|
|
25
|
+
isScrollable = true,
|
|
26
|
+
height = "full",
|
|
27
|
+
label,
|
|
28
|
+
portalContainerRef,
|
|
29
|
+
children,
|
|
30
|
+
footer,
|
|
31
|
+
sheetMarginTop = 96,
|
|
32
|
+
sheetMarginBottom = 128
|
|
33
|
+
}) => {
|
|
34
|
+
const viewport = useViewportSize();
|
|
35
|
+
const { sheetHeight, windowHeight } = useMemo(() => {
|
|
36
|
+
const sh = viewport.height - sheetMarginTop;
|
|
37
|
+
const wh = Math.max(window.innerHeight, viewport.height) - sheetMarginTop;
|
|
38
|
+
return { sheetHeight: sh, windowHeight: wh };
|
|
39
|
+
}, [viewport.height, sheetMarginTop]);
|
|
40
|
+
const y = useMotionValue(sheetHeight);
|
|
41
|
+
const closeVelocityRef = useRef(true);
|
|
42
|
+
const overlayRef = useRef(null);
|
|
43
|
+
const containerRef = useRef(null);
|
|
44
|
+
const dialogRef = useRef(null);
|
|
45
|
+
const footerRef = useRef(null);
|
|
46
|
+
const focusTrapRef = useRef(null);
|
|
47
|
+
const [footerHeight, setFooterHeight] = useState(0);
|
|
48
|
+
useResizeObserver({
|
|
49
|
+
ref: footerRef,
|
|
50
|
+
onResize: () => {
|
|
51
|
+
setFooterHeight(footerRef.current?.offsetHeight || 0);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
const oldHeightRef = useRef(0);
|
|
55
|
+
useResizeObserver({
|
|
56
|
+
ref: dialogRef,
|
|
57
|
+
onResize: () => {
|
|
58
|
+
const rect = dialogRef.current?.getBoundingClientRect();
|
|
59
|
+
if (!rect || oldHeightRef.current === rect.height) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
oldHeightRef.current = rect.height;
|
|
63
|
+
if (rect.bottom < viewport.height) {
|
|
64
|
+
y.stop();
|
|
65
|
+
animate(y, -(rect.height - viewport.height + sheetMarginTop));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsxs(
|
|
70
|
+
MotionModalOverlay,
|
|
71
|
+
{
|
|
72
|
+
isOpen: true,
|
|
73
|
+
UNSTABLE_portalContainer: portalContainerRef?.current,
|
|
74
|
+
className: "fixed top-0 left-0 z-10 w-screen",
|
|
75
|
+
onOpenChange,
|
|
76
|
+
isDismissable,
|
|
77
|
+
style: { height: viewport.height },
|
|
78
|
+
ref: overlayRef,
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
motion.div,
|
|
82
|
+
{
|
|
83
|
+
className: "pointer-events-none absolute inset-0 bg-elevation-fill-default-3/80",
|
|
84
|
+
animate: { opacity: 1 },
|
|
85
|
+
initial: { opacity: 0 },
|
|
86
|
+
exit: { opacity: 0 }
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
MotionModal,
|
|
91
|
+
{
|
|
92
|
+
isDismissable: true,
|
|
93
|
+
className: clsx(
|
|
94
|
+
"pointer-events-none flex w-full flex-col items-stretch justify-end outline-none will-change-transform",
|
|
95
|
+
isScrollable ? "h-auto" : "h-full"
|
|
96
|
+
),
|
|
97
|
+
animate: { y: 0, opacity: 1 },
|
|
98
|
+
initial: { y: windowHeight, opacity: 1 },
|
|
99
|
+
exit: { y: windowHeight, opacity: 1 },
|
|
100
|
+
onAnimationComplete: (data) => {
|
|
101
|
+
onStateChange?.(data.y === 0 ? "opened" : "closed");
|
|
102
|
+
},
|
|
103
|
+
onAnimationStart: (data) => {
|
|
104
|
+
onStateChange?.(data.y === 0 ? "opening" : "closing");
|
|
105
|
+
},
|
|
106
|
+
transition: staticTransition,
|
|
107
|
+
style: { y, minHeight: "100%" },
|
|
108
|
+
drag: "y",
|
|
109
|
+
dragElastic: 1,
|
|
110
|
+
dragConstraints: overlayRef,
|
|
111
|
+
onUpdate: (latest) => {
|
|
112
|
+
if (!latest || !footerRef.current) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
footerRef.current?.style.setProperty("--scroll-position", `${(latest.y || 0).toFixed(0)}px`);
|
|
116
|
+
},
|
|
117
|
+
onDragStart: () => {
|
|
118
|
+
if (document.activeElement && DomUtils.isKeyboardInput(document.activeElement)) {
|
|
119
|
+
focusTrapRef.current?.focus();
|
|
120
|
+
}
|
|
121
|
+
y.animation?.stop();
|
|
122
|
+
closeVelocityRef.current = isScrollable ? y.get() >= -10 : true;
|
|
123
|
+
containerRef.current?.style.setProperty("pointer-events", "none");
|
|
124
|
+
},
|
|
125
|
+
onDragEnd: (e, { velocity }) => {
|
|
126
|
+
containerRef.current?.style.removeProperty("pointer-events");
|
|
127
|
+
if (y.get() > 0) {
|
|
128
|
+
if (closeVelocityRef.current && velocity.y > 10 || y.get() > 200) {
|
|
129
|
+
onOpenChange?.(false);
|
|
130
|
+
} else {
|
|
131
|
+
animate(y, 0, { ...inertiaTransition, min: 0, max: 0 });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
children: /* @__PURE__ */ jsx(
|
|
136
|
+
Dialog,
|
|
137
|
+
{
|
|
138
|
+
className: "relative flex min-h-0 flex-1 flex-col items-stretch outline-none",
|
|
139
|
+
ref: dialogRef,
|
|
140
|
+
"aria-label": label,
|
|
141
|
+
children: ({ close }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
142
|
+
/* @__PURE__ */ jsx(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
style: { minHeight: `${sheetMarginTop}px` },
|
|
146
|
+
className: clsx("shrink-0", height === "auto" && "grow")
|
|
147
|
+
}
|
|
148
|
+
),
|
|
149
|
+
/* @__PURE__ */ jsxs(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
className: clsx(
|
|
153
|
+
"pointer-events-auto relative flex min-h-0 flex-col items-stretch rounded-t-xl bg-elevation-fill-default-1",
|
|
154
|
+
height === "full" && "flex-1"
|
|
155
|
+
),
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ jsx(
|
|
158
|
+
"div",
|
|
159
|
+
{
|
|
160
|
+
className: clsx(
|
|
161
|
+
"absolute bottom-full left-0 w-full outline-none",
|
|
162
|
+
isDismissable ? "h-0" : "h-screen"
|
|
163
|
+
),
|
|
164
|
+
ref: focusTrapRef,
|
|
165
|
+
tabIndex: -1
|
|
166
|
+
}
|
|
167
|
+
),
|
|
168
|
+
/* @__PURE__ */ jsx(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
className: clsx("flex min-h-0 grow flex-col items-stretch", isScrollable ? "shrink-0" : "shrink"),
|
|
172
|
+
ref: containerRef,
|
|
173
|
+
children: typeof children === "function" ? children(close) : children
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ jsx(
|
|
177
|
+
"div",
|
|
178
|
+
{
|
|
179
|
+
className: "shrink-0",
|
|
180
|
+
style: { height: `${footerHeight + sheetMarginBottom}px` }
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ jsx("div", { className: "absolute top-full h-screen w-full bg-elevation-fill-default-1" })
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
footer && /* @__PURE__ */ jsx(
|
|
188
|
+
motion.div,
|
|
189
|
+
{
|
|
190
|
+
ref: footerRef,
|
|
191
|
+
className: clsx(
|
|
192
|
+
"pointer-events-auto absolute z-50 w-full bg-elevation-fill-default-2",
|
|
193
|
+
"top-(--visual-viewport-height) left-0 translate-y-[calc(-100%-var(--scroll-position,0px))]"
|
|
194
|
+
),
|
|
195
|
+
children: footer
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
] })
|
|
199
|
+
}
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
) });
|
|
206
|
+
};
|
|
207
|
+
const BottomSheet = ({
|
|
208
|
+
isOpen,
|
|
209
|
+
portalContainerRef,
|
|
210
|
+
onOpenChange,
|
|
211
|
+
trigger,
|
|
212
|
+
children,
|
|
213
|
+
...rest
|
|
214
|
+
}) => {
|
|
215
|
+
const [isSheetOpen, setIsSheetOpen] = useState(!!isOpen);
|
|
216
|
+
const hasTrigger = !!trigger;
|
|
217
|
+
useEffect(() => {
|
|
218
|
+
if (hasTrigger) {
|
|
219
|
+
setIsSheetOpen(!!isOpen);
|
|
220
|
+
}
|
|
221
|
+
}, [isOpen, hasTrigger]);
|
|
222
|
+
if (trigger) {
|
|
223
|
+
const handleOpenChange = (open) => {
|
|
224
|
+
setIsSheetOpen(open);
|
|
225
|
+
onOpenChange?.(open);
|
|
226
|
+
};
|
|
227
|
+
return /* @__PURE__ */ jsxs(
|
|
228
|
+
DialogTrigger,
|
|
229
|
+
{
|
|
230
|
+
isOpen: isSheetOpen,
|
|
231
|
+
onOpenChange: handleOpenChange,
|
|
232
|
+
children: [
|
|
233
|
+
trigger,
|
|
234
|
+
/* @__PURE__ */ jsx(
|
|
235
|
+
BottomSheetBase,
|
|
236
|
+
{
|
|
237
|
+
isOpen: isSheetOpen,
|
|
238
|
+
onOpenChange: handleOpenChange,
|
|
239
|
+
portalContainerRef,
|
|
240
|
+
...rest,
|
|
241
|
+
children
|
|
242
|
+
}
|
|
243
|
+
)
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
return /* @__PURE__ */ jsx(
|
|
249
|
+
BottomSheetBase,
|
|
250
|
+
{
|
|
251
|
+
isOpen,
|
|
252
|
+
onOpenChange,
|
|
253
|
+
portalContainerRef,
|
|
254
|
+
...rest,
|
|
255
|
+
children
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
};
|
|
259
|
+
export {
|
|
260
|
+
BottomSheet
|
|
261
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { DialogTrigger, ModalOverlay, Modal, Dialog } from "react-aria-components";
|
|
4
|
+
import { modalOverlay } from "../Modal/modal.cva.js";
|
|
5
|
+
const Drawer = ({
|
|
6
|
+
isOpen,
|
|
7
|
+
portalContainerRef,
|
|
8
|
+
onOpenChange,
|
|
9
|
+
trigger,
|
|
10
|
+
children,
|
|
11
|
+
isDismissable,
|
|
12
|
+
overlayClassName,
|
|
13
|
+
dialogClassName,
|
|
14
|
+
className
|
|
15
|
+
}) => {
|
|
16
|
+
if (trigger) {
|
|
17
|
+
return /* @__PURE__ */ jsxs(
|
|
18
|
+
DialogTrigger,
|
|
19
|
+
{
|
|
20
|
+
isOpen,
|
|
21
|
+
onOpenChange,
|
|
22
|
+
children: [
|
|
23
|
+
trigger,
|
|
24
|
+
/* @__PURE__ */ jsx(
|
|
25
|
+
DrawerOverlay,
|
|
26
|
+
{
|
|
27
|
+
portalContainerRef,
|
|
28
|
+
isDismissable,
|
|
29
|
+
overlayClassName,
|
|
30
|
+
dialogClassName,
|
|
31
|
+
className,
|
|
32
|
+
children
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
DrawerOverlay,
|
|
41
|
+
{
|
|
42
|
+
isOpen,
|
|
43
|
+
onOpenChange,
|
|
44
|
+
portalContainerRef,
|
|
45
|
+
isDismissable,
|
|
46
|
+
className,
|
|
47
|
+
children
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
const DrawerOverlay = ({
|
|
52
|
+
isOpen,
|
|
53
|
+
onOpenChange,
|
|
54
|
+
portalContainerRef,
|
|
55
|
+
children,
|
|
56
|
+
isDismissable,
|
|
57
|
+
overlayClassName,
|
|
58
|
+
dialogClassName,
|
|
59
|
+
className
|
|
60
|
+
}) => {
|
|
61
|
+
return /* @__PURE__ */ jsx(
|
|
62
|
+
ModalOverlay,
|
|
63
|
+
{
|
|
64
|
+
isOpen,
|
|
65
|
+
onOpenChange,
|
|
66
|
+
UNSTABLE_portalContainer: portalContainerRef?.current,
|
|
67
|
+
className: clsx(modalOverlay(), overlayClassName),
|
|
68
|
+
isDismissable,
|
|
69
|
+
children: /* @__PURE__ */ jsx(
|
|
70
|
+
Modal,
|
|
71
|
+
{
|
|
72
|
+
className: clsx(
|
|
73
|
+
"fixed inset-y-0 right-0 z-10 w-fit entering:animate-drawer-enter-right exiting:animate-drawer-exit-right bg-elevation-fill-default-1",
|
|
74
|
+
className
|
|
75
|
+
),
|
|
76
|
+
children: /* @__PURE__ */ jsx(Dialog, { className: clsx("outline-none", dialogClassName), children: ({ close }) => children(close) })
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
Drawer
|
|
84
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren, RefObject } from 'react';
|
|
2
|
-
import { ModalVariantProps } from '
|
|
2
|
+
import { ModalVariantProps } from './modal.cva';
|
|
3
3
|
export interface ModalProps extends ModalVariantProps {
|
|
4
4
|
isOpen: boolean;
|
|
5
5
|
portalContainerRef?: RefObject<HTMLElement>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { ModalOverlay, Modal as Modal$1, Dialog } from "react-aria-components";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { CloseIcon } from "../../../assets/icons/Close.js";
|
|
6
|
+
import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
|
|
7
|
+
import { modalOverlay, modalContent, modalMain } from "./modal.cva.js";
|
|
8
|
+
import { ns } from "../../../config/i18n.js";
|
|
9
|
+
const Modal = ({
|
|
10
|
+
isOpen,
|
|
11
|
+
portalContainerRef,
|
|
12
|
+
onClose,
|
|
13
|
+
aside,
|
|
14
|
+
children,
|
|
15
|
+
modalClassName,
|
|
16
|
+
showCloseIcon,
|
|
17
|
+
isDismissable = true
|
|
18
|
+
}) => {
|
|
19
|
+
const { t } = useTranslation(ns);
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
ModalOverlay,
|
|
22
|
+
{
|
|
23
|
+
UNSTABLE_portalContainer: portalContainerRef?.current,
|
|
24
|
+
className: modalOverlay({ aside }),
|
|
25
|
+
isDismissable,
|
|
26
|
+
isOpen,
|
|
27
|
+
shouldCloseOnInteractOutside: () => {
|
|
28
|
+
return !portalContainerRef?.current;
|
|
29
|
+
},
|
|
30
|
+
onOpenChange: (open) => {
|
|
31
|
+
if (!open) {
|
|
32
|
+
onClose();
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
children: /* @__PURE__ */ jsx(Modal$1, { className: clsx(modalMain({ aside })), children: /* @__PURE__ */ jsxs(Dialog, { className: modalContent({ aside, className: modalClassName }), children: [
|
|
36
|
+
showCloseIcon && /* @__PURE__ */ jsx(
|
|
37
|
+
InlineIconButton,
|
|
38
|
+
{
|
|
39
|
+
color: "secondary",
|
|
40
|
+
onPress: onClose,
|
|
41
|
+
icon: CloseIcon,
|
|
42
|
+
className: "absolute top-0 right-0 p-2",
|
|
43
|
+
label: t(($) => $.ui.modal.closeBtn)
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
children
|
|
47
|
+
] }) })
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
Modal
|
|
53
|
+
};
|