@povio/ui 0.0.7 → 0.0.8
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/index.js +62585 -0
- package/package.json +5 -57
- package/povio-ui-0.0.8.tgz +0 -0
- package/{dist → src}/components/Menu/MenuDesktop.d.ts +1 -1
- package/{dist → src}/components/Menu/MenuItem.d.ts +1 -1
- package/{dist → src}/components/Menu/MenuMobile.d.ts +1 -1
- package/{dist → src}/components/Menu/MenuPopover.d.ts +1 -1
- package/{dist → src}/components/buttons/Button/Button.d.ts +1 -1
- package/{dist → src}/components/buttons/Button/button.cva.d.ts +1 -1
- package/{dist → src}/components/buttons/IconButton/IconButton.d.ts +1 -1
- package/{dist → src}/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -1
- package/{dist → src}/components/buttons/PillButton/PillButton.d.ts +2 -2
- package/{dist → src}/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/{dist → src}/components/buttons/SplitButton/SplitButton.d.ts +2 -2
- package/{dist → src}/components/buttons/TextButton/TextButton.d.ts +3 -3
- package/{dist → src}/components/buttons/ToggleButton/ToggleButton.d.ts +3 -3
- package/{dist → src}/components/buttons/shared/ButtonContent.d.ts +3 -3
- package/{dist → src}/components/inputs/Checkbox/Checkbox.d.ts +3 -3
- package/{dist → src}/components/inputs/Checkbox/CheckboxCheckmark.d.ts +1 -1
- package/{dist → src}/components/inputs/Checkbox/checkbox.cva.d.ts +1 -1
- package/{dist → src}/components/inputs/DateTime/DatePicker/DatePicker.d.ts +3 -3
- package/{dist → src}/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +3 -3
- package/{dist → src}/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +3 -3
- package/{dist → src}/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -3
- package/{dist → src}/components/inputs/DateTime/shared/CalendarHeader.d.ts +1 -1
- package/{dist → src}/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -2
- package/{dist → src}/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -2
- package/{dist → src}/components/inputs/File/fileUpload.types.d.ts +3 -3
- package/{dist → src}/components/inputs/File/inputUpload.types.d.ts +2 -2
- package/{dist → src}/components/inputs/File/shared/FileCard.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileCardList.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileUploadContent.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileUploadContentEmpty.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileUploadContentError.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileUploadContentFilled.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/FileUploadContentLoading.d.ts +1 -1
- package/{dist → src}/components/inputs/File/shared/InputUploadContent.d.ts +1 -1
- package/{dist → src}/components/inputs/FormField/FormField.d.ts +3 -3
- package/src/components/inputs/FormField/FormFieldLabel.d.ts +12 -0
- package/{dist → src}/components/inputs/Input/NumberInput/NumberInput.d.ts +4 -4
- package/{dist → src}/components/inputs/Input/PasswordInput/PasswordInput.d.ts +2 -2
- package/{dist → src}/components/inputs/Input/TextArea/TextArea.d.ts +3 -3
- package/{dist → src}/components/inputs/Input/TextInput/TextInput.d.ts +5 -4
- package/{dist → src}/components/inputs/Input/shared/InputContent.d.ts +3 -3
- package/{dist → src}/components/inputs/Inputs/Form.d.ts +2 -2
- package/{dist → src}/components/inputs/Inputs/InputItem.d.ts +16 -16
- package/{dist → src}/components/inputs/RadioGroup/RadioGroup.d.ts +3 -3
- package/{dist → src}/components/inputs/RadioGroup/radio.cva.d.ts +1 -1
- package/{dist → src}/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +3 -3
- package/{dist → src}/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -3
- package/{dist → src}/components/inputs/Selection/Select/Select.d.ts +3 -3
- package/{dist → src}/components/inputs/Selection/shared/SelectBase.d.ts +5 -4
- package/{dist → src}/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/{dist → src}/components/inputs/Selection/shared/SelectInput.d.ts +6 -6
- package/src/components/inputs/Selection/shared/SelectInputTags.d.ts +11 -0
- package/src/components/inputs/Selection/shared/SelectListBox.d.ts +9 -0
- package/{dist → src}/components/inputs/Selection/shared/SelectListBoxItem.d.ts +2 -2
- package/{dist → src}/components/inputs/Selection/shared/SelectListBoxItemSelectAll.d.ts +1 -1
- package/{dist → src}/components/inputs/Selection/shared/SelectListBoxLoadingItem.d.ts +1 -1
- package/{dist → src}/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/{dist → src}/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/{dist → src}/components/inputs/Selection/shared/select.types.d.ts +9 -1
- package/{dist → src}/components/inputs/Selection/shared/useSelectItems.d.ts +2 -2
- package/{dist → src}/components/inputs/Slider/Slider.d.ts +2 -2
- package/{dist → src}/components/inputs/TextEditor/TextEditor.d.ts +2 -2
- package/{dist → src}/components/inputs/TextEditor/Toolbar/HyperlinkAction.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextAlignSelect.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextColorSelect.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextHighlightSelect.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextListActions.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextMarksActions.d.ts +1 -1
- package/{dist → src}/components/inputs/TextEditor/Toolbar/TextStyleSelect.d.ts +1 -1
- package/{dist → src}/components/inputs/Toggle/Toggle.d.ts +3 -3
- package/{dist → src}/components/inputs/Toggle/toggle.cva.d.ts +1 -1
- package/{dist → src}/components/inputs/shared/CheckContent.d.ts +1 -1
- package/src/components/inputs/shared/InputClear.d.ts +8 -0
- package/{dist → src}/components/inputs/shared/label.cva.d.ts +1 -1
- package/{dist → src}/components/overlays/ActionModal/ActionModal.d.ts +2 -2
- package/{dist → src}/components/overlays/Modal/Modal.d.ts +1 -1
- package/{dist → src}/components/overlays/Tooltip/Tooltip.d.ts +4 -2
- package/src/components/overlays/Tooltip/tooltip.cva.d.ts +21 -0
- package/{dist → src}/components/segment/segment.types.d.ts +1 -1
- package/{dist → src}/components/shared/pagination/PaginationList.d.ts +1 -1
- package/{dist → src}/components/status/Alert/Alert.d.ts +1 -1
- package/{dist → src}/components/status/Loader/Loader.d.ts +1 -1
- package/{dist → src}/components/status/Toast/Toast.d.ts +1 -1
- package/{dist → src}/components/status/Toast/toast.cva.d.ts +1 -1
- package/{dist → src}/components/table/table.cva.d.ts +7 -3
- package/{dist → src}/components/text/Link/Link.d.ts +1 -1
- package/{dist → src}/components/text/Tag/Tag.d.ts +1 -1
- package/{dist → src}/components/text/Typography/Typography.d.ts +1 -1
- package/{dist → src}/config/confirmation.context.d.ts +1 -1
- package/{dist → src}/config/uiConfig.context.d.ts +10 -8
- package/{dist → src}/config/uiStyle.context.d.ts +15 -14
- package/{dist → src}/helpers/dynamicInputs.d.ts +4 -2
- package/{dist → src}/hooks/useFormAutosave.d.ts +2 -2
- package/{dist → src}/index.d.ts +12 -6
- package/{dist → src}/types/react-query.d.ts +1 -1
- package/src/utils/vendor/acl/AclGuard.d.ts +8 -0
- package/src/utils/vendor/acl/Can.d.ts +9 -0
- package/src/utils/vendor/acl/ability.context.d.ts +15 -0
- package/src/utils/vendor/acl/appAbility.types.d.ts +3 -0
- package/src/utils/vendor/auth/AuthGuard.d.ts +6 -0
- package/src/utils/vendor/auth/auth.context.d.ts +21 -0
- package/src/utils/vendor/auth/withPrivateAuthGuard.d.ts +6 -0
- package/{dist/utils/rest/rest-client.d.ts → src/utils/vendor/rest-client.types.d.ts} +8 -14
- package/{dist → src}/utils/zod.utils.d.ts +2 -1
- package/vite.config.d.ts +2 -0
- package/dist/assets/icons/AlignCenter.js +0 -21
- package/dist/assets/icons/AlignLeft.js +0 -21
- package/dist/assets/icons/AlignLeftRight.js +0 -21
- package/dist/assets/icons/AlignRight.js +0 -21
- package/dist/assets/icons/ArrowDropDown.js +0 -21
- package/dist/assets/icons/ArrowDropUp.js +0 -21
- package/dist/assets/icons/ArrowLeft.js +0 -21
- package/dist/assets/icons/ArrowRight.js +0 -21
- package/dist/assets/icons/Bold.js +0 -21
- package/dist/assets/icons/BulletedList.js +0 -21
- package/dist/assets/icons/Calendar.js +0 -23
- package/dist/assets/icons/Check.js +0 -23
- package/dist/assets/icons/CheckCircle.js +0 -21
- package/dist/assets/icons/CheckboxCheckmark.js +0 -24
- package/dist/assets/icons/CheckboxIndeterminate.js +0 -24
- package/dist/assets/icons/ChevronDown.js +0 -23
- package/dist/assets/icons/ChevronLeft.js +0 -23
- package/dist/assets/icons/ChevronRight.js +0 -23
- package/dist/assets/icons/ChevronUp.js +0 -23
- package/dist/assets/icons/ChevronsLeft.js +0 -34
- package/dist/assets/icons/ChevronsRight.js +0 -34
- package/dist/assets/icons/Clock.js +0 -21
- package/dist/assets/icons/Close.js +0 -21
- package/dist/assets/icons/DateTime.js +0 -25
- package/dist/assets/icons/Drag.js +0 -21
- package/dist/assets/icons/File.js +0 -23
- package/dist/assets/icons/Highlight.js +0 -21
- package/dist/assets/icons/HighlightOn.js +0 -30
- package/dist/assets/icons/Info.js +0 -34
- package/dist/assets/icons/Italic.js +0 -21
- package/dist/assets/icons/Link.js +0 -21
- package/dist/assets/icons/Menu.js +0 -23
- package/dist/assets/icons/NumberedList.js +0 -21
- package/dist/assets/icons/PointerHorizontal.js +0 -21
- package/dist/assets/icons/PointerVertical.js +0 -21
- package/dist/assets/icons/Send.js +0 -23
- package/dist/assets/icons/Strikethrough.js +0 -21
- package/dist/assets/icons/TextColor.js +0 -30
- package/dist/assets/icons/Today.js +0 -21
- package/dist/assets/icons/Underlined.js +0 -23
- package/dist/assets/icons/Upload.js +0 -30
- package/dist/assets/icons/View.js +0 -18
- package/dist/assets/icons/ViewOff.js +0 -18
- package/dist/assets/icons/Warningfilled.js +0 -23
- package/dist/assets/locales/en/translation.json.js +0 -14
- package/dist/assets/locales/sl/translation.json.js +0 -14
- package/dist/components/Menu/Menu.js +0 -14
- package/dist/components/Menu/MenuDesktop.js +0 -68
- package/dist/components/Menu/MenuItem.js +0 -33
- package/dist/components/Menu/MenuMobile.js +0 -78
- package/dist/components/Menu/MenuPopover.js +0 -38
- package/dist/components/buttons/Button/Button.js +0 -68
- package/dist/components/buttons/Button/button.cva.js +0 -672
- package/dist/components/buttons/IconButton/IconButton.js +0 -17
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +0 -18
- package/dist/components/buttons/PillButton/PillButton.js +0 -44
- package/dist/components/buttons/PillButton/pillButton.cva.js +0 -86
- package/dist/components/buttons/SplitButton/SplitButton.js +0 -62
- package/dist/components/buttons/TextButton/TextButton.js +0 -18
- package/dist/components/buttons/ToggleButton/ToggleButton.js +0 -21
- package/dist/components/buttons/shared/ButtonContent.js +0 -53
- package/dist/components/buttons/shared/buttonContent.cva.js +0 -16
- package/dist/components/inputs/Checkbox/Checkbox.js +0 -81
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +0 -49
- package/dist/components/inputs/Checkbox/checkbox.cva.js +0 -47
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +0 -234
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +0 -668
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +0 -248
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +0 -224
- package/dist/components/inputs/DateTime/shared/Calendar.js +0 -85
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +0 -160
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +0 -67
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +0 -89
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +0 -203
- package/dist/components/inputs/DateTime/shared/DateField.js +0 -62
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +0 -163
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +0 -54
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +0 -76
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +0 -41
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +0 -82
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +0 -131
- package/dist/components/inputs/DateTime/shared/TimeField.js +0 -26
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +0 -186
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +0 -107
- package/dist/components/inputs/DateTime/shared/YearPicker.js +0 -89
- package/dist/components/inputs/File/FileUpload.js +0 -254
- package/dist/components/inputs/File/FileUploadContainer.js +0 -17
- package/dist/components/inputs/File/InputUpload.js +0 -176
- package/dist/components/inputs/File/shared/FileCard.js +0 -67
- package/dist/components/inputs/File/shared/FileCardList.js +0 -20
- package/dist/components/inputs/File/shared/FileProgressBar.js +0 -32
- package/dist/components/inputs/File/shared/FileUploadContent.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +0 -92
- package/dist/components/inputs/File/shared/FileUploadContentError.js +0 -167
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +0 -176
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +0 -128
- package/dist/components/inputs/File/shared/InputUploadContent.js +0 -68
- package/dist/components/inputs/File/shared/InputUploadFilled.js +0 -31
- package/dist/components/inputs/File/shared/fileUpload.cva.js +0 -57
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +0 -48
- package/dist/components/inputs/FormField/FormField.js +0 -54
- package/dist/components/inputs/FormField/FormFieldError.js +0 -16
- package/dist/components/inputs/FormField/FormFieldHeader.js +0 -57
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +0 -20
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +0 -11
- package/dist/components/inputs/FormField/FormFieldLabel.js +0 -31
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +0 -157
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +0 -26
- package/dist/components/inputs/Input/TextArea/TextArea.js +0 -149
- package/dist/components/inputs/Input/TextInput/TextInput.js +0 -147
- package/dist/components/inputs/Input/shared/InputContent.js +0 -106
- package/dist/components/inputs/Inputs/Form.js +0 -68
- package/dist/components/inputs/Inputs/InputItem.js +0 -63
- package/dist/components/inputs/Inputs/Inputs.js +0 -32
- package/dist/components/inputs/RadioGroup/RadioGroup.js +0 -113
- package/dist/components/inputs/RadioGroup/radio.cva.js +0 -47
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +0 -39
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +0 -25
- package/dist/components/inputs/Selection/Select/Select.js +0 -32
- package/dist/components/inputs/Selection/shared/SelectBase.js +0 -24
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +0 -211
- package/dist/components/inputs/Selection/shared/SelectInput.js +0 -237
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/SelectListBox.js +0 -97
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +0 -78
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +0 -45
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +0 -47
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +0 -42
- package/dist/components/inputs/Selection/shared/SelectMobile.js +0 -161
- package/dist/components/inputs/Selection/shared/select.context.js +0 -243
- package/dist/components/inputs/Selection/shared/useSelectItems.js +0 -94
- package/dist/components/inputs/Slider/Slider.js +0 -137
- package/dist/components/inputs/TextEditor/TextEditor.js +0 -223
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +0 -34
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +0 -80
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +0 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +0 -56
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +0 -33
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +0 -31
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +0 -37
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +0 -51
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +0 -73
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +0 -61
- package/dist/components/inputs/TextEditor/textEditor.types.js +0 -40
- package/dist/components/inputs/Toggle/Toggle.js +0 -65
- package/dist/components/inputs/Toggle/toggle.cva.js +0 -44
- package/dist/components/inputs/shared/CheckContent.js +0 -22
- package/dist/components/inputs/shared/InputClear.d.ts +0 -6
- package/dist/components/inputs/shared/InputClear.js +0 -26
- package/dist/components/inputs/shared/input.cva.js +0 -167
- package/dist/components/inputs/shared/label.cva.js +0 -133
- package/dist/components/outline.clsx.js +0 -11
- package/dist/components/overlays/ActionModal/ActionModal.js +0 -80
- package/dist/components/overlays/BottomSheet/BottomSheet.js +0 -256
- package/dist/components/overlays/Drawer/Drawer.js +0 -84
- package/dist/components/overlays/Modal/Modal.js +0 -53
- package/dist/components/overlays/Modal/modal.cva.js +0 -53
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +0 -71
- package/dist/components/overlays/Tooltip/Tooltip.js +0 -44
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +0 -27
- package/dist/components/segment/Segment.js +0 -113
- package/dist/components/segment/SegmentItem.js +0 -41
- package/dist/components/shared/pagination/Pagination.js +0 -75
- package/dist/components/shared/pagination/PaginationList.js +0 -145
- package/dist/components/shared/pagination/minWidth.cva.js +0 -15
- package/dist/components/status/Alert/Alert.js +0 -41
- package/dist/components/status/Alert/alert.cva.js +0 -64
- package/dist/components/status/Loader/Loader.js +0 -37
- package/dist/components/status/Loader/loader.cva.js +0 -27
- package/dist/components/status/Toast/Toast.js +0 -64
- package/dist/components/status/Toast/toast.cva.js +0 -150
- package/dist/components/status/Toast/useToast.js +0 -83
- package/dist/components/status/shared/status.cva.js +0 -62
- package/dist/components/table/CellText.js +0 -18
- package/dist/components/table/ColumnConfig.js +0 -124
- package/dist/components/table/HeaderText.js +0 -15
- package/dist/components/table/InfiniteTable.js +0 -40
- package/dist/components/table/PaginatedTable.js +0 -33
- package/dist/components/table/Table.js +0 -352
- package/dist/components/table/table.cva.js +0 -37
- package/dist/components/text/Link/Link.js +0 -18
- package/dist/components/text/Link/link.cva.js +0 -18
- package/dist/components/text/Tag/Tag.js +0 -49
- package/dist/components/text/Tag/tag.cva.js +0 -59
- package/dist/components/text/Typography/Typography.js +0 -22
- package/dist/components/text/Typography/typography.cva.js +0 -100
- package/dist/config/confirmation.context.js +0 -107
- package/dist/config/i18n.js +0 -15
- package/dist/config/router.context.js +0 -43
- package/dist/config/uiConfig.context.js +0 -62
- package/dist/config/uiStyle.context.js +0 -16
- package/dist/helpers/dynamicColumns.js +0 -359
- package/dist/helpers/dynamicInputs.js +0 -214
- package/dist/hooks/useAutosave.js +0 -80
- package/dist/hooks/useBreakpoint.js +0 -20
- package/dist/hooks/useDebounceCallback.js +0 -29
- package/dist/hooks/useDeepCompare.js +0 -25
- package/dist/hooks/useFilters.js +0 -120
- package/dist/hooks/useForm.js +0 -22
- package/dist/hooks/useFormAutosave.js +0 -67
- package/dist/hooks/useIntersectionObserver.js +0 -27
- package/dist/hooks/useLocalStorage.js +0 -63
- package/dist/hooks/useLongPressRepeat.js +0 -33
- package/dist/hooks/usePagination.js +0 -35
- package/dist/hooks/useScrollableListBox.js +0 -30
- package/dist/hooks/useSingletonMutation.d.ts +0 -4
- package/dist/hooks/useSingletonMutation.js +0 -27
- package/dist/hooks/useSorting.js +0 -30
- package/dist/hooks/useStateAndRef.js +0 -17
- package/dist/hooks/useTableColumnConfig.js +0 -59
- package/dist/hooks/useTableNav.js +0 -409
- package/dist/hooks/useTranslationMemo.js +0 -14
- package/dist/index.js +0 -280
- package/dist/utils/array.utils.js +0 -12
- package/dist/utils/compoundMapper.js +0 -14
- package/dist/utils/date-time.utils.js +0 -77
- package/dist/utils/date.utils.js +0 -12
- package/dist/utils/dom.utils.js +0 -13
- package/dist/utils/file.utils.js +0 -63
- package/dist/utils/isEqual.js +0 -94
- package/dist/utils/logger.js +0 -19
- package/dist/utils/object.utils.js +0 -53
- package/dist/utils/queries.utils.js +0 -9
- package/dist/utils/rest/interceptors/logging.interceptor.d.ts +0 -2
- package/dist/utils/rest/interceptors/logging.interceptor.js +0 -17
- package/dist/utils/rest/interceptors/response.interceptor.d.ts +0 -2
- package/dist/utils/rest/interceptors/response.interceptor.js +0 -25
- package/dist/utils/rest/interceptors/rest-interceptor.js +0 -21
- package/dist/utils/rest/rest-client.js +0 -62
- package/dist/utils/rest/rest.utils.js +0 -51
- package/dist/utils/routing.utils.js +0 -15
- package/dist/utils/string.utils.js +0 -12
- package/dist/utils/vendor/error-handling.js +0 -119
- package/dist/utils/zod.utils.js +0 -25
- /package/{dist → src}/assets/icons/AlignCenter.d.ts +0 -0
- /package/{dist → src}/assets/icons/AlignLeft.d.ts +0 -0
- /package/{dist → src}/assets/icons/AlignLeftRight.d.ts +0 -0
- /package/{dist → src}/assets/icons/AlignRight.d.ts +0 -0
- /package/{dist → src}/assets/icons/ArrowDropDown.d.ts +0 -0
- /package/{dist → src}/assets/icons/ArrowDropUp.d.ts +0 -0
- /package/{dist → src}/assets/icons/ArrowLeft.d.ts +0 -0
- /package/{dist → src}/assets/icons/ArrowRight.d.ts +0 -0
- /package/{dist → src}/assets/icons/Bold.d.ts +0 -0
- /package/{dist → src}/assets/icons/BulletedList.d.ts +0 -0
- /package/{dist → src}/assets/icons/Calendar.d.ts +0 -0
- /package/{dist → src}/assets/icons/Check.d.ts +0 -0
- /package/{dist → src}/assets/icons/CheckCircle.d.ts +0 -0
- /package/{dist → src}/assets/icons/CheckboxCheckmark.d.ts +0 -0
- /package/{dist → src}/assets/icons/CheckboxIndeterminate.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronDown.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronLeft.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronRight.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronUp.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronsLeft.d.ts +0 -0
- /package/{dist → src}/assets/icons/ChevronsRight.d.ts +0 -0
- /package/{dist → src}/assets/icons/Clock.d.ts +0 -0
- /package/{dist → src}/assets/icons/Close.d.ts +0 -0
- /package/{dist → src}/assets/icons/DateTime.d.ts +0 -0
- /package/{dist → src}/assets/icons/Drag.d.ts +0 -0
- /package/{dist → src}/assets/icons/File.d.ts +0 -0
- /package/{dist → src}/assets/icons/Highlight.d.ts +0 -0
- /package/{dist → src}/assets/icons/HighlightOn.d.ts +0 -0
- /package/{dist → src}/assets/icons/Info.d.ts +0 -0
- /package/{dist → src}/assets/icons/Italic.d.ts +0 -0
- /package/{dist → src}/assets/icons/Link.d.ts +0 -0
- /package/{dist → src}/assets/icons/Menu.d.ts +0 -0
- /package/{dist → src}/assets/icons/NumberedList.d.ts +0 -0
- /package/{dist → src}/assets/icons/PointerHorizontal.d.ts +0 -0
- /package/{dist → src}/assets/icons/PointerVertical.d.ts +0 -0
- /package/{dist → src}/assets/icons/Send.d.ts +0 -0
- /package/{dist → src}/assets/icons/Strikethrough.d.ts +0 -0
- /package/{dist → src}/assets/icons/TextColor.d.ts +0 -0
- /package/{dist → src}/assets/icons/Today.d.ts +0 -0
- /package/{dist → src}/assets/icons/Underlined.d.ts +0 -0
- /package/{dist → src}/assets/icons/Upload.d.ts +0 -0
- /package/{dist → src}/assets/icons/View.d.ts +0 -0
- /package/{dist → src}/assets/icons/ViewOff.d.ts +0 -0
- /package/{dist/assets/icons/Warningfilled.d.ts → src/assets/icons/WarningFilled.d.ts} +0 -0
- /package/{dist → src}/components/Menu/Menu.d.ts +0 -0
- /package/{dist → src}/components/buttons/shared/buttonContent.cva.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/Calendar.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/CalendarCell.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/CalendarGrid.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/CalendarSelectHeader.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/DateField.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/DateTimeDialog.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/DateTimeDialogFooter.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/MonthPicker.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/RangeCalendar.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/TimeField.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/TimePickerForm.d.ts +0 -0
- /package/{dist → src}/components/inputs/DateTime/shared/YearPicker.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/FileUpload.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/FileUploadContainer.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/InputUpload.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/index.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/shared/FileProgressBar.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/shared/InputUploadFilled.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/shared/fileUpload.cva.d.ts +0 -0
- /package/{dist → src}/components/inputs/File/shared/inputUploadButton.cva.d.ts +0 -0
- /package/{dist → src}/components/inputs/FormField/FormFieldError.d.ts +0 -0
- /package/{dist → src}/components/inputs/FormField/FormFieldHeader.d.ts +0 -0
- /package/{dist → src}/components/inputs/FormField/FormFieldHeaderClose.d.ts +0 -0
- /package/{dist → src}/components/inputs/Inputs/Inputs.d.ts +0 -0
- /package/{dist → src}/components/inputs/Selection/shared/SelectListBoxSelectionBar.d.ts +0 -0
- /package/{dist → src}/components/inputs/TextEditor/Toolbar/ColorPicker.d.ts +0 -0
- /package/{dist → src}/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.d.ts +0 -0
- /package/{dist → src}/components/inputs/TextEditor/Toolbar/TextEditorToolbar.d.ts +0 -0
- /package/{dist → src}/components/inputs/TextEditor/textEditor.types.d.ts +0 -0
- /package/{dist → src}/components/inputs/shared/form.types.d.ts +0 -0
- /package/{dist → src}/components/inputs/shared/input.cva.d.ts +0 -0
- /package/{dist → src}/components/outline.clsx.d.ts +0 -0
- /package/{dist → src}/components/overlays/BottomSheet/BottomSheet.d.ts +0 -0
- /package/{dist → src}/components/overlays/Drawer/Drawer.d.ts +0 -0
- /package/{dist → src}/components/overlays/Modal/modal.cva.d.ts +0 -0
- /package/{dist → src}/components/overlays/ResponsivePopover/ResponsivePopover.d.ts +0 -0
- /package/{dist → src}/components/overlays/Tooltip/TooltipEllipsis.d.ts +0 -0
- /package/{dist → src}/components/segment/Segment.d.ts +0 -0
- /package/{dist → src}/components/segment/SegmentItem.d.ts +0 -0
- /package/{dist → src}/components/shared/pagination/Pagination.d.ts +0 -0
- /package/{dist → src}/components/shared/pagination/minWidth.cva.d.ts +0 -0
- /package/{dist → src}/components/status/Alert/alert.cva.d.ts +0 -0
- /package/{dist → src}/components/status/Loader/loader.cva.d.ts +0 -0
- /package/{dist → src}/components/status/Toast/useToast.d.ts +0 -0
- /package/{dist → src}/components/status/shared/status.cva.d.ts +0 -0
- /package/{dist → src}/components/table/CellText.d.ts +0 -0
- /package/{dist → src}/components/table/ColumnConfig.d.ts +0 -0
- /package/{dist → src}/components/table/HeaderText.d.ts +0 -0
- /package/{dist → src}/components/table/InfiniteTable.d.ts +0 -0
- /package/{dist → src}/components/table/PaginatedTable.d.ts +0 -0
- /package/{dist → src}/components/table/Table.d.ts +0 -0
- /package/{dist → src}/components/text/Link/link.cva.d.ts +0 -0
- /package/{dist → src}/components/text/Tag/tag.cva.d.ts +0 -0
- /package/{dist → src}/components/text/Typography/typography.cva.d.ts +0 -0
- /package/{dist → src}/config/i18n.d.ts +0 -0
- /package/{dist → src}/config/router.context.d.ts +0 -0
- /package/{dist → src}/helpers/dynamicColumns.d.ts +0 -0
- /package/{dist → src}/hooks/useAutosave.d.ts +0 -0
- /package/{dist → src}/hooks/useBreakpoint.d.ts +0 -0
- /package/{dist → src}/hooks/useDebounceCallback.d.ts +0 -0
- /package/{dist → src}/hooks/useDeepCompare.d.ts +0 -0
- /package/{dist → src}/hooks/useFilters.d.ts +0 -0
- /package/{dist → src}/hooks/useForm.d.ts +0 -0
- /package/{dist → src}/hooks/useIntersectionObserver.d.ts +0 -0
- /package/{dist → src}/hooks/useLocalStorage.d.ts +0 -0
- /package/{dist → src}/hooks/useLongPressRepeat.d.ts +0 -0
- /package/{dist → src}/hooks/usePagination.d.ts +0 -0
- /package/{dist → src}/hooks/useScrollableListBox.d.ts +0 -0
- /package/{dist → src}/hooks/useSorting.d.ts +0 -0
- /package/{dist → src}/hooks/useStateAndRef.d.ts +0 -0
- /package/{dist → src}/hooks/useTableColumnConfig.d.ts +0 -0
- /package/{dist → src}/hooks/useTableNav.d.ts +0 -0
- /package/{dist → src}/hooks/useTranslationMemo.d.ts +0 -0
- /package/{dist → src}/types/common.d.ts +0 -0
- /package/{dist → src}/utils/array.utils.d.ts +0 -0
- /package/{dist → src}/utils/array.utils.spec.d.ts +0 -0
- /package/{dist → src}/utils/compoundMapper.d.ts +0 -0
- /package/{dist → src}/utils/compoundMapper.spec.d.ts +0 -0
- /package/{dist → src}/utils/date-time.utils.d.ts +0 -0
- /package/{dist → src}/utils/date-time.utils.spec.d.ts +0 -0
- /package/{dist → src}/utils/date.utils.d.ts +0 -0
- /package/{dist → src}/utils/date.utils.spec.d.ts +0 -0
- /package/{dist → src}/utils/dom.utils.d.ts +0 -0
- /package/{dist → src}/utils/file.utils.d.ts +0 -0
- /package/{dist → src}/utils/isEqual.d.ts +0 -0
- /package/{dist → src}/utils/logger.d.ts +0 -0
- /package/{dist → src}/utils/object.utils.d.ts +0 -0
- /package/{dist → src}/utils/queries.utils.d.ts +0 -0
- /package/{dist/utils/rest → src/utils}/rest.utils.d.ts +0 -0
- /package/{dist → src}/utils/routing.utils.d.ts +0 -0
- /package/{dist → src}/utils/string.utils.d.ts +0 -0
- /package/{dist → src}/utils/vendor/error-handling.d.ts +0 -0
- /package/{dist/utils/rest/interceptors → src/utils/vendor}/rest-interceptor.d.ts +0 -0
- /package/{dist/styles → styles}/editor.css +0 -0
- /package/{dist/styles → styles}/index.css +0 -0
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { use, useState, useMemo } from "react";
|
|
4
|
-
import { useHover, useFocusWithin, useFocusVisible } from "react-aria";
|
|
5
|
-
import { ComboBoxStateContext, Input, Button } from "react-aria-components";
|
|
6
|
-
import { useTranslation } from "react-i18next";
|
|
7
|
-
import useMeasure from "react-use-measure";
|
|
8
|
-
import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
|
|
9
|
-
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
10
|
-
import { SelectContext } from "./select.context.js";
|
|
11
|
-
import { InputClear } from "../../shared/InputClear.js";
|
|
12
|
-
import { inputSize, inputBase } from "../../shared/input.cva.js";
|
|
13
|
-
import { Tag } from "../../../text/Tag/Tag.js";
|
|
14
|
-
import { Typography } from "../../../text/Typography/Typography.js";
|
|
15
|
-
import { ns } from "../../../../config/i18n.js";
|
|
16
|
-
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
17
|
-
const SelectInput = ({
|
|
18
|
-
ref,
|
|
19
|
-
placeholder,
|
|
20
|
-
variant,
|
|
21
|
-
as,
|
|
22
|
-
size,
|
|
23
|
-
isDisabled,
|
|
24
|
-
isInvalid,
|
|
25
|
-
className,
|
|
26
|
-
hideDropdownIcon,
|
|
27
|
-
isSearchable,
|
|
28
|
-
isClearable,
|
|
29
|
-
showSelectionContent,
|
|
30
|
-
inputClassName,
|
|
31
|
-
fieldProps,
|
|
32
|
-
headerProps,
|
|
33
|
-
onCloseComboBox,
|
|
34
|
-
onBlur,
|
|
35
|
-
...props
|
|
36
|
-
}) => {
|
|
37
|
-
const uiStyle = UIStyle.useConfig();
|
|
38
|
-
const inputSizeCva = uiStyle?.input?.sizeCva ?? inputSize;
|
|
39
|
-
const inputBaseCva = uiStyle?.input?.baseCva ?? inputBase;
|
|
40
|
-
const { t } = useTranslation(ns);
|
|
41
|
-
const state = use(ComboBoxStateContext);
|
|
42
|
-
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
43
|
-
const [isFocused, setIsFocused] = useState(false);
|
|
44
|
-
const { focusWithinProps } = useFocusWithin({
|
|
45
|
-
onFocusWithinChange: setIsFocused
|
|
46
|
-
});
|
|
47
|
-
const { isFocusVisible } = useFocusVisible();
|
|
48
|
-
const [labelContentRef, { width: labelWidth }] = useMeasure();
|
|
49
|
-
const {
|
|
50
|
-
fieldState,
|
|
51
|
-
isOpen,
|
|
52
|
-
setIsOpen,
|
|
53
|
-
listItems,
|
|
54
|
-
selectedItems,
|
|
55
|
-
onChange,
|
|
56
|
-
onClear,
|
|
57
|
-
onRemove,
|
|
58
|
-
isMultiple,
|
|
59
|
-
isLoading
|
|
60
|
-
} = SelectContext.useSelect();
|
|
61
|
-
const isEmpty = selectedItems.length === 0;
|
|
62
|
-
const showTags = isMultiple && !isEmpty;
|
|
63
|
-
const showClearButton = isClearable && isHovered && (selectedItems.length > 0 || isSearchable && fieldState.inputValue !== "");
|
|
64
|
-
const style = useMemo(() => {
|
|
65
|
-
if (as !== "filter") {
|
|
66
|
-
return {};
|
|
67
|
-
}
|
|
68
|
-
return {
|
|
69
|
-
paddingLeft: `calc(var(--spacing-input-side-default) + ${labelWidth}px + var(--spacing-2))`
|
|
70
|
-
};
|
|
71
|
-
}, [labelWidth, as]);
|
|
72
|
-
const labelProps = useMemo(() => {
|
|
73
|
-
const { labelProps: headerLabelProps } = headerProps ?? {};
|
|
74
|
-
const isFilterOrFloating = as && ["filter", "floating"].includes(as);
|
|
75
|
-
if (!isFilterOrFloating || isSearchable) {
|
|
76
|
-
return headerLabelProps;
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
...headerLabelProps,
|
|
80
|
-
className: clsx(headerLabelProps?.className, "pointer-events-none")
|
|
81
|
-
};
|
|
82
|
-
}, [as, headerProps, isSearchable]);
|
|
83
|
-
const onKeyDown = (e) => {
|
|
84
|
-
if (e.key === "Enter" && !isMultiple && !isLoading && listItems.length === 1 && !listItems[0].isDisabled) {
|
|
85
|
-
e.preventDefault();
|
|
86
|
-
onChange(listItems[0].id);
|
|
87
|
-
onCloseComboBox?.(state);
|
|
88
|
-
}
|
|
89
|
-
if (e.key === "Backspace" && isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0) {
|
|
90
|
-
onChange(fieldState.value.slice(0, -1));
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
return /* @__PURE__ */ jsxs(
|
|
94
|
-
"div",
|
|
95
|
-
{
|
|
96
|
-
ref,
|
|
97
|
-
className: inputBaseCva({
|
|
98
|
-
variant,
|
|
99
|
-
as,
|
|
100
|
-
...props,
|
|
101
|
-
className: clsx("group/select-content !px-0 relative flex", isSearchable && "cursor-text", className)
|
|
102
|
-
}),
|
|
103
|
-
"data-rac": "",
|
|
104
|
-
"data-disabled": isDisabled,
|
|
105
|
-
"data-hovered": isHovered || void 0,
|
|
106
|
-
"data-focused": isOpen || isFocused || void 0,
|
|
107
|
-
"data-focus-within": isFocused || void 0,
|
|
108
|
-
"data-searchable-focus-within": isFocused && isSearchable || void 0,
|
|
109
|
-
"data-focus-visible": isFocused && isFocusVisible || void 0,
|
|
110
|
-
"data-has-selection": !isEmpty || void 0,
|
|
111
|
-
"data-has-search": fieldState.searchValue !== "" || void 0,
|
|
112
|
-
"data-invalid": isInvalid || void 0,
|
|
113
|
-
...hoverProps,
|
|
114
|
-
...focusWithinProps,
|
|
115
|
-
children: [
|
|
116
|
-
/* @__PURE__ */ jsxs(
|
|
117
|
-
"div",
|
|
118
|
-
{
|
|
119
|
-
className: clsx(
|
|
120
|
-
"relative flex flex-1 items-center truncate",
|
|
121
|
-
showTags && inputSizeCva({ size, ...props, className: "pr-2 pl-input-side-default" })
|
|
122
|
-
),
|
|
123
|
-
children: [
|
|
124
|
-
as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(
|
|
125
|
-
FormFieldLabel,
|
|
126
|
-
{
|
|
127
|
-
ref: labelContentRef,
|
|
128
|
-
as,
|
|
129
|
-
...headerProps,
|
|
130
|
-
labelProps
|
|
131
|
-
}
|
|
132
|
-
),
|
|
133
|
-
(showTags || isSearchable) && /* @__PURE__ */ jsxs(
|
|
134
|
-
"div",
|
|
135
|
-
{
|
|
136
|
-
className: clsx("flex flex-1 flex-wrap gap-2 truncate", !isSearchable && "pointer-events-none z-[1]"),
|
|
137
|
-
style,
|
|
138
|
-
children: [
|
|
139
|
-
showTags && selectedItems.map((item) => /* @__PURE__ */ jsx(
|
|
140
|
-
Tag,
|
|
141
|
-
{
|
|
142
|
-
dismissable: true,
|
|
143
|
-
isDisabled,
|
|
144
|
-
onDismiss: () => onRemove(item.id),
|
|
145
|
-
excludeFromTabOrder: true,
|
|
146
|
-
className: "z-[1]",
|
|
147
|
-
children: item.label
|
|
148
|
-
},
|
|
149
|
-
item.id
|
|
150
|
-
)),
|
|
151
|
-
isSearchable && /* @__PURE__ */ jsx(
|
|
152
|
-
Input,
|
|
153
|
-
{
|
|
154
|
-
placeholder,
|
|
155
|
-
onBlur,
|
|
156
|
-
className: clsx(
|
|
157
|
-
"flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled",
|
|
158
|
-
!showTags && inputSizeCva({
|
|
159
|
-
size,
|
|
160
|
-
...props,
|
|
161
|
-
className: "rounded-input-rounding-default pl-input-side-default"
|
|
162
|
-
}),
|
|
163
|
-
inputClassName
|
|
164
|
-
),
|
|
165
|
-
onKeyDown,
|
|
166
|
-
...fieldProps
|
|
167
|
-
}
|
|
168
|
-
)
|
|
169
|
-
]
|
|
170
|
-
}
|
|
171
|
-
),
|
|
172
|
-
!isSearchable && /* @__PURE__ */ jsx(
|
|
173
|
-
Button,
|
|
174
|
-
{
|
|
175
|
-
isDisabled,
|
|
176
|
-
onPress: () => setIsOpen(!isOpen),
|
|
177
|
-
onBlur,
|
|
178
|
-
"data-type": "select-trigger",
|
|
179
|
-
className: inputSizeCva({
|
|
180
|
-
size,
|
|
181
|
-
...props,
|
|
182
|
-
className: clsx(
|
|
183
|
-
"w-full truncate pl-input-side-default text-start outline-none disabled:text-interactive-text-secondary-disabled",
|
|
184
|
-
showTags && "absolute inset-0 z-0"
|
|
185
|
-
)
|
|
186
|
-
}),
|
|
187
|
-
style,
|
|
188
|
-
...fieldProps,
|
|
189
|
-
children: (isEmpty || !isMultiple) && /* @__PURE__ */ jsxs(
|
|
190
|
-
Typography,
|
|
191
|
-
{
|
|
192
|
-
size: "label-1",
|
|
193
|
-
className: "truncate empty:before:inline-block empty:before:content-['']",
|
|
194
|
-
children: [
|
|
195
|
-
isEmpty && placeholder,
|
|
196
|
-
!isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)
|
|
197
|
-
]
|
|
198
|
-
}
|
|
199
|
-
)
|
|
200
|
-
}
|
|
201
|
-
)
|
|
202
|
-
]
|
|
203
|
-
}
|
|
204
|
-
),
|
|
205
|
-
showClearButton && /* @__PURE__ */ jsx(InputClear, { onClear }),
|
|
206
|
-
!hideDropdownIcon && /* @__PURE__ */ jsx(
|
|
207
|
-
Button,
|
|
208
|
-
{
|
|
209
|
-
excludeFromTabOrder: true,
|
|
210
|
-
"aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
|
|
211
|
-
className: "self-stretch pr-input-side-default pl-1-5 outline-none",
|
|
212
|
-
isDisabled,
|
|
213
|
-
onPress: () => {
|
|
214
|
-
if (!isSearchable) {
|
|
215
|
-
setIsOpen(!isOpen);
|
|
216
|
-
}
|
|
217
|
-
},
|
|
218
|
-
children: /* @__PURE__ */ jsx(
|
|
219
|
-
ArrowDropDownIcon,
|
|
220
|
-
{
|
|
221
|
-
className: clsx(
|
|
222
|
-
"size-6 shrink-0",
|
|
223
|
-
isOpen && "rotate-180",
|
|
224
|
-
isDisabled ? "text-interactive-text-secondary-disabled" : "text-interactive-text-secondary-idle"
|
|
225
|
-
),
|
|
226
|
-
"aria-hidden": "true"
|
|
227
|
-
}
|
|
228
|
-
)
|
|
229
|
-
}
|
|
230
|
-
)
|
|
231
|
-
]
|
|
232
|
-
}
|
|
233
|
-
);
|
|
234
|
-
};
|
|
235
|
-
export {
|
|
236
|
-
SelectInput
|
|
237
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AriaListBoxProps } from 'react-aria';
|
|
2
|
-
import { SelectBaseProps } from './SelectBase';
|
|
3
|
-
import { SelectItem } from './select.types';
|
|
4
|
-
export interface SelectListBoxProps extends Pick<SelectBaseProps, "label" | "newItemRender" | "onLoadMore" | "selectionMode" | "isSearchable">, Omit<AriaListBoxProps<SelectItem>, "children" | "aria-label" | "selectionMode" | "items" | "selectedKeys" | "onSelectionChange" | "escapeKeyBehavior" | "shouldSelectOnPressUp" | "label"> {
|
|
5
|
-
className?: string;
|
|
6
|
-
isScrollable?: boolean;
|
|
7
|
-
onClose?: () => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const SelectListBox: ({ label, selectionMode, isSearchable, isScrollable, newItemRender, onLoadMore, className, onClose, ...props }: SelectListBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { ListBox } from "react-aria-components";
|
|
4
|
-
import { SelectListBoxItem } from "./SelectListBoxItem.js";
|
|
5
|
-
import { SelectListBoxItemSelectAll } from "./SelectListBoxItemSelectAll.js";
|
|
6
|
-
import { SelectListBoxLoadingItem } from "./SelectListBoxLoadingItem.js";
|
|
7
|
-
import { SelectContext } from "./select.context.js";
|
|
8
|
-
import { SelectAllItemId } from "./useSelectItems.js";
|
|
9
|
-
const SelectListBox = ({
|
|
10
|
-
label,
|
|
11
|
-
selectionMode,
|
|
12
|
-
isSearchable,
|
|
13
|
-
isScrollable = true,
|
|
14
|
-
newItemRender,
|
|
15
|
-
onLoadMore,
|
|
16
|
-
className,
|
|
17
|
-
onClose,
|
|
18
|
-
...props
|
|
19
|
-
}) => {
|
|
20
|
-
const { fieldState, onChange, listItems, selectableListItems, selectedIds, isMultiple, onClear, onSelectAll } = SelectContext.useSelect();
|
|
21
|
-
const onSelectionChange = (value) => {
|
|
22
|
-
const ids = Array.from(value);
|
|
23
|
-
if (!isMultiple && ids.length === 0) {
|
|
24
|
-
if (fieldState.value) {
|
|
25
|
-
onClose?.();
|
|
26
|
-
onChange(fieldState.value);
|
|
27
|
-
}
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (isMultiple && ids.includes(SelectAllItemId)) {
|
|
31
|
-
if (ids.length > selectableListItems.length) {
|
|
32
|
-
onClear();
|
|
33
|
-
} else {
|
|
34
|
-
onSelectAll();
|
|
35
|
-
}
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
if (isMultiple) {
|
|
39
|
-
onChange(ids);
|
|
40
|
-
} else {
|
|
41
|
-
onClose?.();
|
|
42
|
-
onChange(ids[0]);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
return /* @__PURE__ */ jsx(
|
|
46
|
-
ListBox,
|
|
47
|
-
{
|
|
48
|
-
...props,
|
|
49
|
-
"aria-label": label,
|
|
50
|
-
selectionMode,
|
|
51
|
-
className: clsx(
|
|
52
|
-
"flex-1 outline-none",
|
|
53
|
-
isScrollable ? "overflow-y-auto overflow-x-hidden" : "overflow-hidden",
|
|
54
|
-
className
|
|
55
|
-
),
|
|
56
|
-
items: listItems,
|
|
57
|
-
selectedKeys: selectedIds,
|
|
58
|
-
onSelectionChange,
|
|
59
|
-
escapeKeyBehavior: "none",
|
|
60
|
-
shouldSelectOnPressUp: true,
|
|
61
|
-
children: ({ isSelectAllItem, isNewItem, isLoadingItem, ...item }) => {
|
|
62
|
-
if (isSelectAllItem) {
|
|
63
|
-
return /* @__PURE__ */ jsx(
|
|
64
|
-
SelectListBoxItemSelectAll,
|
|
65
|
-
{
|
|
66
|
-
...item
|
|
67
|
-
},
|
|
68
|
-
item.id
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
if (isLoadingItem) {
|
|
72
|
-
return /* @__PURE__ */ jsx(
|
|
73
|
-
SelectListBoxLoadingItem,
|
|
74
|
-
{
|
|
75
|
-
...item,
|
|
76
|
-
onLoadMore
|
|
77
|
-
},
|
|
78
|
-
item.id
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
return /* @__PURE__ */ jsx(
|
|
82
|
-
SelectListBoxItem,
|
|
83
|
-
{
|
|
84
|
-
...item,
|
|
85
|
-
isSearchable,
|
|
86
|
-
isNewItem,
|
|
87
|
-
newItemRender
|
|
88
|
-
},
|
|
89
|
-
item.id
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
};
|
|
95
|
-
export {
|
|
96
|
-
SelectListBox
|
|
97
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { useRef, useMemo } from "react";
|
|
4
|
-
import { ListBoxItem } from "react-aria-components";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
7
|
-
import { SelectContext } from "./select.context.js";
|
|
8
|
-
import { ns } from "../../../../config/i18n.js";
|
|
9
|
-
const SelectListBoxItem = ({
|
|
10
|
-
isSearchable,
|
|
11
|
-
isNewItem,
|
|
12
|
-
newItemRender,
|
|
13
|
-
id,
|
|
14
|
-
label,
|
|
15
|
-
content,
|
|
16
|
-
isDisabled
|
|
17
|
-
}) => {
|
|
18
|
-
const ref = useRef(null);
|
|
19
|
-
const { t } = useTranslation(ns);
|
|
20
|
-
const { selectedIds, isMultiple } = SelectContext.useSelect();
|
|
21
|
-
const itemContent = useMemo(() => {
|
|
22
|
-
if (isNewItem) {
|
|
23
|
-
return newItemRender?.(label) ?? `${t(($) => $.ui.autocomplete.createNewBtn)} '${label}'`;
|
|
24
|
-
}
|
|
25
|
-
return content ?? label;
|
|
26
|
-
}, [isNewItem, newItemRender, label, content, t]);
|
|
27
|
-
return /* @__PURE__ */ jsxs(
|
|
28
|
-
ListBoxItem,
|
|
29
|
-
{
|
|
30
|
-
ref,
|
|
31
|
-
id,
|
|
32
|
-
textValue: label,
|
|
33
|
-
isDisabled,
|
|
34
|
-
className: clsx(
|
|
35
|
-
selectListBoxItemClass,
|
|
36
|
-
!isMultiple && "selected:bg-interactive-contained-primary-idle selected:text-interactive-text-secondary-idle-inverted",
|
|
37
|
-
isNewItem ? "text-interactive-text-primary-idle" : "text-interactive-text-secondary-idle"
|
|
38
|
-
),
|
|
39
|
-
children: [
|
|
40
|
-
isMultiple && !isSearchable && /* @__PURE__ */ jsx(
|
|
41
|
-
CheckboxCheckmark,
|
|
42
|
-
{
|
|
43
|
-
variant: "default",
|
|
44
|
-
className: "group-focus-visible:!outline-none"
|
|
45
|
-
}
|
|
46
|
-
),
|
|
47
|
-
isMultiple && isSearchable && /* @__PURE__ */ jsx(
|
|
48
|
-
"div",
|
|
49
|
-
{
|
|
50
|
-
className: "group",
|
|
51
|
-
"data-rac": "",
|
|
52
|
-
"data-selected": selectedIds.includes(id) || void 0,
|
|
53
|
-
children: /* @__PURE__ */ jsx(
|
|
54
|
-
CheckboxCheckmark,
|
|
55
|
-
{
|
|
56
|
-
variant: "default",
|
|
57
|
-
className: "group-focus-visible:!outline-none"
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
),
|
|
62
|
-
itemContent
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
const selectListBoxItemClass = clsx(
|
|
68
|
-
"group flex cursor-pointer items-center gap-2 px-list-side-item py-list-height-item",
|
|
69
|
-
"border-b border-b-elevation-outline-default-1 outline-none last:border-b-0",
|
|
70
|
-
"font-labels-default text-interactive-text-secondary-idle text-label-2",
|
|
71
|
-
"hover:text-interactive-text-secondary-hover",
|
|
72
|
-
"focus-visible:bg-interactive-contained-primary-focus focus-visible:text-interactive-text-secondary-idle-inverted",
|
|
73
|
-
"disabled:cursor-default disabled:text-interactive-text-secondary-disabled"
|
|
74
|
-
);
|
|
75
|
-
export {
|
|
76
|
-
SelectListBoxItem,
|
|
77
|
-
selectListBoxItemClass
|
|
78
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
import { ListBoxItem } from "react-aria-components";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
6
|
-
import { selectListBoxItemClass } from "./SelectListBoxItem.js";
|
|
7
|
-
import { SelectContext } from "./select.context.js";
|
|
8
|
-
import { ns } from "../../../../config/i18n.js";
|
|
9
|
-
const SelectListBoxItemSelectAll = ({ id, label, isDisabled }) => {
|
|
10
|
-
const ref = useRef(null);
|
|
11
|
-
const { t } = useTranslation(ns);
|
|
12
|
-
const { selectableListItems, selectedIds } = SelectContext.useSelect();
|
|
13
|
-
return /* @__PURE__ */ jsxs(
|
|
14
|
-
ListBoxItem,
|
|
15
|
-
{
|
|
16
|
-
ref,
|
|
17
|
-
id,
|
|
18
|
-
textValue: label || t(($) => $.ui.select.allOption),
|
|
19
|
-
isDisabled,
|
|
20
|
-
className: selectListBoxItemClass,
|
|
21
|
-
children: [
|
|
22
|
-
/* @__PURE__ */ jsx(
|
|
23
|
-
"div",
|
|
24
|
-
{
|
|
25
|
-
className: "group",
|
|
26
|
-
"data-rac": "",
|
|
27
|
-
"data-selected": selectedIds.length === selectableListItems.length || void 0,
|
|
28
|
-
"data-indeterminate": selectedIds.length > 0 && selectedIds.length < selectableListItems.length || void 0,
|
|
29
|
-
children: /* @__PURE__ */ jsx(
|
|
30
|
-
CheckboxCheckmark,
|
|
31
|
-
{
|
|
32
|
-
variant: "default",
|
|
33
|
-
className: "group-focus-visible:!outline-none"
|
|
34
|
-
}
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
),
|
|
38
|
-
t(($) => $.ui.select.allOption)
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
export {
|
|
44
|
-
SelectListBoxItemSelectAll
|
|
45
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { ListBoxItem } from "react-aria-components";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { selectListBoxItemClass } from "./SelectListBoxItem.js";
|
|
6
|
-
import { SelectContext } from "./select.context.js";
|
|
7
|
-
import { Loader } from "../../../status/Loader/Loader.js";
|
|
8
|
-
import { ns } from "../../../../config/i18n.js";
|
|
9
|
-
import { useIntersectionObserver } from "../../../../hooks/useIntersectionObserver.js";
|
|
10
|
-
const SelectListBoxLoadingItem = ({ id, label, onLoadMore }) => {
|
|
11
|
-
const { t } = useTranslation(ns);
|
|
12
|
-
const { isDebouncing, isLoading, hasLoadMore } = SelectContext.useSelect();
|
|
13
|
-
const onIntersection = useCallback(() => {
|
|
14
|
-
if (!isDebouncing && !isLoading && hasLoadMore) {
|
|
15
|
-
onLoadMore?.();
|
|
16
|
-
}
|
|
17
|
-
}, [isDebouncing, isLoading, hasLoadMore, onLoadMore]);
|
|
18
|
-
const { setRef } = useIntersectionObserver({
|
|
19
|
-
onIntersection,
|
|
20
|
-
rootMargin: "40px"
|
|
21
|
-
});
|
|
22
|
-
return /* @__PURE__ */ jsx(
|
|
23
|
-
ListBoxItem,
|
|
24
|
-
{
|
|
25
|
-
id,
|
|
26
|
-
textValue: label || t(($) => $.ui.loadingState.text),
|
|
27
|
-
isDisabled: true,
|
|
28
|
-
className: selectListBoxItemClass,
|
|
29
|
-
children: /* @__PURE__ */ jsx(
|
|
30
|
-
"div",
|
|
31
|
-
{
|
|
32
|
-
ref: (ref) => {
|
|
33
|
-
setRef(ref);
|
|
34
|
-
return () => {
|
|
35
|
-
setRef(null);
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
className: "flex flex-1 justify-center text-interactive-text-primary-idle",
|
|
39
|
-
children: /* @__PURE__ */ jsx(Loader, {})
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
export {
|
|
46
|
-
SelectListBoxLoadingItem
|
|
47
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { clsx } from "clsx";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { TextButton } from "../../../buttons/TextButton/TextButton.js";
|
|
5
|
-
import { SelectContext } from "./select.context.js";
|
|
6
|
-
import { ns } from "../../../../config/i18n.js";
|
|
7
|
-
const SelectListBoxSelectionBar = ({ className }) => {
|
|
8
|
-
const { t } = useTranslation(ns);
|
|
9
|
-
const { onClear, onSelectAll } = SelectContext.useSelect();
|
|
10
|
-
return /* @__PURE__ */ jsxs(
|
|
11
|
-
"div",
|
|
12
|
-
{
|
|
13
|
-
className: clsx(
|
|
14
|
-
"flex items-center justify-between border-elevation-outline-default-1 border-b px-4 py-3",
|
|
15
|
-
className
|
|
16
|
-
),
|
|
17
|
-
children: [
|
|
18
|
-
/* @__PURE__ */ jsx(
|
|
19
|
-
TextButton,
|
|
20
|
-
{
|
|
21
|
-
type: "button",
|
|
22
|
-
color: "primary",
|
|
23
|
-
onPress: onSelectAll,
|
|
24
|
-
children: t(($) => $.ui.select.selectAll)
|
|
25
|
-
}
|
|
26
|
-
),
|
|
27
|
-
/* @__PURE__ */ jsx(
|
|
28
|
-
TextButton,
|
|
29
|
-
{
|
|
30
|
-
type: "button",
|
|
31
|
-
color: "secondary",
|
|
32
|
-
onPress: onClear,
|
|
33
|
-
children: t(($) => $.ui.select.clearSelection)
|
|
34
|
-
}
|
|
35
|
-
)
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
export {
|
|
41
|
-
SelectListBoxSelectionBar
|
|
42
|
-
};
|