@povio/ui 2.3.3 → 3.0.0-rc.2
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 +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +215 -64
- package/dist/components/Breadcrumbs/breadcrumbs.cva.d.ts +40 -14
- package/dist/components/Breadcrumbs/breadcrumbs.cva.js +21 -18
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +35 -12
- package/dist/components/Menu/MenuMobile.js +103 -44
- package/dist/components/Menu/MenuPopover.js +110 -34
- package/dist/components/Menu/menu.cva.d.ts +35 -13
- package/dist/components/Menu/menu.cva.js +30 -24
- package/dist/components/buttons/Button/Button.js +7 -7
- package/dist/components/buttons/Button/button.cva.d.ts +95 -26
- package/dist/components/buttons/Button/button.cva.js +601 -589
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +59 -21
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +33 -9
- package/dist/components/buttons/PillButton/pillButton.cva.js +247 -239
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +83 -25
- package/dist/components/buttons/shared/buttonContent.cva.d.ts +3 -5
- package/dist/components/buttons/shared/buttonContent.cva.js +1 -8
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +203 -37
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +28 -14
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +26 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.js +47 -40
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +373 -75
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +492 -186
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +13 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +273 -47
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +7 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +611 -121
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +338 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +310 -103
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +249 -93
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.js +286 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +13 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +358 -133
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +96 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +84 -30
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +214 -69
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +27 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +40 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +85 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +87 -44
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +151 -37
- package/dist/components/inputs/File/shared/InputUploadFilled.js +51 -10
- package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +26 -9
- package/dist/components/inputs/File/shared/fileUpload.cva.js +48 -40
- package/dist/components/inputs/File/shared/inputUploadButton.cva.d.ts +23 -6
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +29 -20
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +27 -7
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +28 -8
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +46 -15
- package/dist/components/inputs/FormField/formFieldError.cva.d.ts +12 -5
- package/dist/components/inputs/FormField/formFieldError.cva.js +11 -8
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +22 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +13 -0
- package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +12 -5
- package/dist/components/inputs/FormField/formFieldHelper.cva.js +11 -8
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +450 -100
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +575 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +12 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +4 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +309 -94
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +422 -93
- package/dist/components/inputs/Input/shared/InputContent.js +196 -63
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +356 -64
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +101 -6
- package/dist/components/inputs/RadioGroup/radio.cva.js +74 -24
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +214 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +107 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +37 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +178 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +225 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +396 -141
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +398 -119
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +88 -38
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +72 -19
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +73 -24
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +14 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +43 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +10 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +4 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectItem.cva.d.ts +16 -6
- package/dist/components/inputs/Selection/shared/selectItem.cva.js +21 -18
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +37 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +82 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +548 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -76
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +450 -101
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +105 -33
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +217 -40
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +15 -6
- package/dist/components/inputs/Toggle/toggle.cva.js +25 -21
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +23 -13
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +88 -12
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +137 -16
- package/dist/components/inputs/shared/input.cva.js +317 -273
- package/dist/components/inputs/shared/label.cva.d.ts +15 -6
- package/dist/components/inputs/shared/label.cva.js +28 -25
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +12 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +4 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +14 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +100 -0
- package/dist/components/navigation/Accordion/Accordion.js +71 -24
- package/dist/components/navigation/Accordion/AccordionItem.js +97 -52
- package/dist/components/navigation/Accordion/accordion.cva.d.ts +109 -44
- package/dist/components/navigation/Accordion/accordion.cva.js +114 -84
- package/dist/components/navigation/Stepper/Stepper.js +69 -24
- package/dist/components/navigation/Stepper/StepperItem.js +112 -39
- package/dist/components/navigation/Stepper/StepperSeparator.js +25 -7
- package/dist/components/navigation/Stepper/stepper.cva.d.ts +86 -30
- package/dist/components/navigation/Stepper/stepper.cva.js +104 -83
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/Modal/Modal.js +5 -5
- package/dist/components/overlays/Modal/modal.cva.d.ts +34 -9
- package/dist/components/overlays/Modal/modal.cva.js +38 -27
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +86 -30
- package/dist/components/overlays/Tooltip/Tooltip.js +143 -34
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/overlays/Tooltip/tooltip.cva.d.ts +45 -17
- package/dist/components/overlays/Tooltip/tooltip.cva.js +38 -26
- package/dist/components/segment/Segment.js +221 -60
- package/dist/components/segment/SegmentItem.js +70 -13
- package/dist/components/segment/segment.cva.d.ts +18 -7
- package/dist/components/segment/segment.cva.js +24 -21
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/shared/popover.cva.d.ts +7 -3
- package/dist/components/shared/popover.cva.js +3 -3
- package/dist/components/status/Alert/Alert.js +103 -36
- package/dist/components/status/Alert/alert.cva.d.ts +18 -6
- package/dist/components/status/Alert/alert.cva.js +60 -57
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Loader/loader.cva.d.ts +23 -4
- package/dist/components/status/Loader/loader.cva.js +22 -13
- package/dist/components/status/Toast/Toast.js +27 -20
- package/dist/components/status/Toast/toast.cva.d.ts +61 -10
- package/dist/components/status/Toast/toast.cva.js +129 -64
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/status/shared/status.cva.d.ts +30 -8
- package/dist/components/status/shared/status.cva.js +56 -50
- package/dist/components/table/CellText.js +3 -3
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/HeaderText.js +3 -3
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +34 -33
- package/dist/components/table/table.cva.d.ts +52 -19
- package/dist/components/table/table.cva.js +44 -35
- package/dist/components/text/Link/Link.js +22 -10
- package/dist/components/text/Link/link.cva.d.ts +11 -5
- package/dist/components/text/Link/link.cva.js +8 -5
- package/dist/components/text/Tag/Tag.js +3 -3
- package/dist/components/text/Tag/tag.cva.d.ts +15 -5
- package/dist/components/text/Tag/tag.cva.js +51 -48
- package/dist/components/text/Typography/Typography.js +25 -10
- package/dist/components/text/Typography/typography.cva.d.ts +93 -7
- package/dist/components/text/Typography/typography.cva.js +126 -122
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +20 -6
- package/dist/config/uiConfig.context.js +68 -14
- package/dist/config/uiOverrides.context.d.ts +192 -0
- package/dist/config/uiOverrides.context.js +113 -0
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +3 -0
- package/dist/hooks/useAutosave.d.ts +2 -1
- package/dist/hooks/useAutosave.js +12 -4
- package/dist/hooks/useAutosave.spec.d.ts +1 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.d.ts +3 -1
- package/dist/hooks/useFormAutosave.js +122 -30
- package/dist/hooks/useFormAutosave.spec.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useKeyInteractions.d.ts +20 -0
- package/dist/hooks/useKeyInteractions.js +54 -0
- package/dist/hooks/useKeyInteractions.spec.d.ts +1 -0
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +72 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +37 -1
- package/dist/index.js +34 -3
- package/dist/tw-ui-plugin.js +6 -0
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +136 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/dist/utils/style-merge.util.d.ts +43 -0
- package/dist/utils/style-merge.util.js +233 -0
- package/dist/utils/style-merge.util.spec.d.ts +1 -0
- package/package.json +1 -1
- package/dist/config/uiStyle.context.d.ts +0 -162
- package/dist/config/uiStyle.context.js +0 -30
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useLocalStorage } from "../hooks/useLocalStorage.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, use,
|
|
4
|
+
import { createContext, use, useEffect, useState } from "react";
|
|
4
5
|
import { z } from "zod";
|
|
5
6
|
//#region src/config/theme.context.tsx
|
|
6
7
|
var ThemeContext;
|
|
@@ -12,56 +13,108 @@ var ThemeContext;
|
|
|
12
13
|
"system"
|
|
13
14
|
]);
|
|
14
15
|
const ThemeContext = createContext(null);
|
|
15
|
-
_ThemeContext.ThemeContextProvider = (
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
set(theme);
|
|
26
|
-
}, [set]);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (typeof window === "undefined") return;
|
|
29
|
-
const onChange = (event) => {
|
|
30
|
-
setSystemTheme(event.matches ? "dark" : "light");
|
|
16
|
+
_ThemeContext.ThemeContextProvider = (t0) => {
|
|
17
|
+
const $ = c(17);
|
|
18
|
+
const { children, storageKey: t1 } = t0;
|
|
19
|
+
const storageKey = t1 === void 0 ? DEFAULT_STORAGE_KEY : t1;
|
|
20
|
+
const [systemTheme, setSystemTheme] = useState(_temp);
|
|
21
|
+
let t2;
|
|
22
|
+
if ($[0] !== storageKey) {
|
|
23
|
+
t2 = {
|
|
24
|
+
key: storageKey,
|
|
25
|
+
schema: ThemeSchema
|
|
31
26
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
$[0] = storageKey;
|
|
28
|
+
$[1] = t2;
|
|
29
|
+
} else t2 = $[1];
|
|
30
|
+
const { value: theme, set } = useLocalStorage(t2);
|
|
31
|
+
let t3;
|
|
32
|
+
if ($[2] !== set) {
|
|
33
|
+
t3 = (theme_0) => {
|
|
34
|
+
set(theme_0);
|
|
36
35
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
36
|
+
$[2] = set;
|
|
37
|
+
$[3] = t3;
|
|
38
|
+
} else t3 = $[3];
|
|
39
|
+
const updateTheme = t3;
|
|
40
|
+
let t4;
|
|
41
|
+
let t5;
|
|
42
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
43
|
+
t4 = () => {
|
|
44
|
+
if (typeof window === "undefined") return;
|
|
45
|
+
const onChange = (event) => {
|
|
46
|
+
setSystemTheme(event.matches ? "dark" : "light");
|
|
47
|
+
};
|
|
48
|
+
const media_0 = window.matchMedia("(prefers-color-scheme: dark)");
|
|
49
|
+
media_0.addEventListener("change", onChange);
|
|
50
|
+
return () => {
|
|
51
|
+
media_0.removeEventListener("change", onChange);
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
t5 = [];
|
|
55
|
+
$[4] = t4;
|
|
56
|
+
$[5] = t5;
|
|
57
|
+
} else {
|
|
58
|
+
t4 = $[4];
|
|
59
|
+
t5 = $[5];
|
|
60
|
+
}
|
|
61
|
+
useEffect(t4, t5);
|
|
62
|
+
let t6;
|
|
63
|
+
let t7;
|
|
64
|
+
if ($[6] !== systemTheme || $[7] !== theme) {
|
|
65
|
+
t6 = () => {
|
|
66
|
+
document.documentElement.classList.remove("dark");
|
|
67
|
+
if ((!theme || theme === "system") && systemTheme === "dark" || theme === "dark") {
|
|
68
|
+
document.documentElement.classList.add("dark");
|
|
69
|
+
document.documentElement.style.colorScheme = "dark";
|
|
70
|
+
} else if (theme === "light") {
|
|
71
|
+
document.documentElement.classList.add("light");
|
|
72
|
+
document.documentElement.style.colorScheme = "light";
|
|
73
|
+
} else document.documentElement.style.colorScheme = "light";
|
|
74
|
+
};
|
|
75
|
+
t7 = [theme, systemTheme];
|
|
76
|
+
$[6] = systemTheme;
|
|
77
|
+
$[7] = theme;
|
|
78
|
+
$[8] = t6;
|
|
79
|
+
$[9] = t7;
|
|
80
|
+
} else {
|
|
81
|
+
t6 = $[8];
|
|
82
|
+
t7 = $[9];
|
|
83
|
+
}
|
|
84
|
+
useEffect(t6, t7);
|
|
85
|
+
const t8 = theme ?? "system";
|
|
86
|
+
let t9;
|
|
87
|
+
if ($[10] !== systemTheme || $[11] !== t8 || $[12] !== updateTheme) {
|
|
88
|
+
t9 = {
|
|
89
|
+
theme: t8,
|
|
90
|
+
systemTheme,
|
|
91
|
+
updateTheme
|
|
92
|
+
};
|
|
93
|
+
$[10] = systemTheme;
|
|
94
|
+
$[11] = t8;
|
|
95
|
+
$[12] = updateTheme;
|
|
96
|
+
$[13] = t9;
|
|
97
|
+
} else t9 = $[13];
|
|
98
|
+
const contextValue = t9;
|
|
99
|
+
let t10;
|
|
100
|
+
if ($[14] !== children || $[15] !== contextValue) {
|
|
101
|
+
t10 = /* @__PURE__ */ jsx(ThemeContext.Provider, {
|
|
102
|
+
value: contextValue,
|
|
103
|
+
children
|
|
104
|
+
});
|
|
105
|
+
$[14] = children;
|
|
106
|
+
$[15] = contextValue;
|
|
107
|
+
$[16] = t10;
|
|
108
|
+
} else t10 = $[16];
|
|
109
|
+
return t10;
|
|
61
110
|
};
|
|
62
111
|
_ThemeContext.useTheme = () => {
|
|
63
112
|
return use(ThemeContext);
|
|
64
113
|
};
|
|
65
114
|
})(ThemeContext || (ThemeContext = {}));
|
|
115
|
+
function _temp() {
|
|
116
|
+
if (typeof window === "undefined") return;
|
|
117
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
118
|
+
}
|
|
66
119
|
//#endregion
|
|
67
120
|
export { ThemeContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
2
|
import { ButtonProps } from '../components/buttons/Button/Button';
|
|
3
3
|
import { CheckboxProps } from '../components/inputs/Checkbox/Checkbox';
|
|
4
4
|
import { DatePickerProps } from '../components/inputs/DateTime/DatePicker/DatePicker';
|
|
@@ -19,17 +19,31 @@ export declare namespace UIConfig {
|
|
|
19
19
|
[P in keyof T]-?: T[P] extends object ? DeepRequired<T[P]> : Exclude<T[P], null | undefined>;
|
|
20
20
|
};
|
|
21
21
|
export interface Options {
|
|
22
|
+
renderStaticInput: boolean;
|
|
22
23
|
input: Pick<TextInputProps, "variant" | "isClearable" | "hideLabel" | "as" | "size"> & {
|
|
23
24
|
alwaysShowClear?: boolean;
|
|
24
25
|
};
|
|
25
26
|
button: Pick<ButtonProps, "variant" | "size">;
|
|
26
27
|
numberInput: Pick<NumberInputProps, "formatOptions">;
|
|
27
|
-
radioGroup: Pick<RadioGroupProps, "variant" | "hideLabel">;
|
|
28
|
-
checkbox: Pick<CheckboxProps, "variant">;
|
|
29
|
-
select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType" | "hideSearchIcon">;
|
|
30
|
-
|
|
28
|
+
radioGroup: Pick<RadioGroupProps, "variant" | "hideLabel" | "fireBlurOnChange">;
|
|
29
|
+
checkbox: Pick<CheckboxProps, "variant" | "fireBlurOnChange">;
|
|
30
|
+
select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType" | "hideSearchIcon" | "fireBlurOnChange">;
|
|
31
|
+
queryAutocomplete: {
|
|
32
|
+
isInitialQueryDisabled?: boolean;
|
|
33
|
+
};
|
|
34
|
+
querySelect: {
|
|
35
|
+
isInitialQueryDisabled?: boolean;
|
|
36
|
+
};
|
|
37
|
+
toggle: Pick<ToggleProps, "variant" | "fireBlurOnChange">;
|
|
31
38
|
slider: Pick<SliderProps, "minValue" | "maxValue">;
|
|
32
|
-
dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros" | "disableManualEntry" | "shouldUpdateDateOnMonthYearChange" | "granularity" | "autoFixYear"
|
|
39
|
+
dateInput: Pick<DatePickerProps, "todayIcon" | "todayIconButtonSize" | "todayIconPlacement" | "shouldForceLeadingZeros" | "disableManualEntry" | "shouldUpdateDateOnMonthYearChange" | "granularity" | "autoFixYear" | "fireBlurOnChange"> & {
|
|
40
|
+
calendarIcon?: ReactElement;
|
|
41
|
+
dateTimeIcon?: ReactElement;
|
|
42
|
+
timeIcon?: ReactElement;
|
|
43
|
+
setDateValueOnDateSelection?: boolean;
|
|
44
|
+
timeZone?: string;
|
|
45
|
+
todayIconButtonComponent?: DatePickerProps["todayIconButtonComponent"];
|
|
46
|
+
};
|
|
33
47
|
actionModal: Pick<ActionModalProps, "titleTypography" | "descriptionTypography">;
|
|
34
48
|
bottomSheet: Pick<BottomSheetProps, "closeDragThreshold" | "closeVelocityThreshold" | "hideThumb" | "headerTypography">;
|
|
35
49
|
tableHeaderText: Pick<HeaderTextProps, "variant" | "size">;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { CalendarIcon } from "../assets/icons/Calendar.js";
|
|
2
|
+
import { ClockIcon } from "../assets/icons/Clock.js";
|
|
3
|
+
import { DateTimeIcon } from "../assets/icons/DateTime.js";
|
|
1
4
|
import { ObjectUtils } from "../utils/object.utils.js";
|
|
2
5
|
import { useDeepCompareMemo } from "../hooks/useDeepCompare.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
3
7
|
import { jsx } from "react/jsx-runtime";
|
|
4
8
|
import { createContext, use } from "react";
|
|
5
9
|
//#region src/config/uiConfig.context.tsx
|
|
6
10
|
var UIConfig;
|
|
7
11
|
(function(_UIConfig) {
|
|
8
12
|
const DEFAULT_CONFIG = {
|
|
13
|
+
renderStaticInput: true,
|
|
9
14
|
input: {
|
|
10
15
|
variant: "outlined",
|
|
11
16
|
as: "default",
|
|
@@ -24,28 +29,47 @@ var UIConfig;
|
|
|
24
29
|
} },
|
|
25
30
|
radioGroup: {
|
|
26
31
|
variant: "default",
|
|
27
|
-
hideLabel: false
|
|
32
|
+
hideLabel: false,
|
|
33
|
+
fireBlurOnChange: false
|
|
34
|
+
},
|
|
35
|
+
checkbox: {
|
|
36
|
+
variant: "default",
|
|
37
|
+
fireBlurOnChange: false
|
|
28
38
|
},
|
|
29
|
-
checkbox: { variant: "default" },
|
|
30
39
|
select: {
|
|
31
40
|
selectionMode: "single",
|
|
32
41
|
isSearchable: false,
|
|
33
42
|
selectedTagsType: "list",
|
|
34
43
|
collapseAfter: 3,
|
|
35
|
-
hideSearchIcon: false
|
|
44
|
+
hideSearchIcon: false,
|
|
45
|
+
fireBlurOnChange: false
|
|
46
|
+
},
|
|
47
|
+
queryAutocomplete: { isInitialQueryDisabled: false },
|
|
48
|
+
querySelect: { isInitialQueryDisabled: false },
|
|
49
|
+
toggle: {
|
|
50
|
+
variant: "default",
|
|
51
|
+
fireBlurOnChange: false
|
|
36
52
|
},
|
|
37
|
-
toggle: { variant: "default" },
|
|
38
53
|
slider: {
|
|
39
54
|
minValue: 0,
|
|
40
55
|
maxValue: 100
|
|
41
56
|
},
|
|
42
57
|
dateInput: {
|
|
43
58
|
todayIcon: false,
|
|
59
|
+
todayIconButtonSize: "none",
|
|
60
|
+
todayIconButtonComponent: "iconButton",
|
|
61
|
+
todayIconPlacement: "content",
|
|
44
62
|
shouldForceLeadingZeros: false,
|
|
45
63
|
disableManualEntry: false,
|
|
46
|
-
|
|
64
|
+
autoFixYear: false,
|
|
65
|
+
fireBlurOnChange: false,
|
|
66
|
+
calendarIcon: /* @__PURE__ */ jsx(CalendarIcon, { className: "size-5" }),
|
|
67
|
+
dateTimeIcon: /* @__PURE__ */ jsx(DateTimeIcon, { className: "size-5" }),
|
|
68
|
+
timeIcon: /* @__PURE__ */ jsx(ClockIcon, { className: "size-6 text-interactive-text-secondary-idle" }),
|
|
69
|
+
setDateValueOnDateSelection: false,
|
|
70
|
+
timeZone: "clientLocal",
|
|
47
71
|
granularity: "day",
|
|
48
|
-
|
|
72
|
+
shouldUpdateDateOnMonthYearChange: false
|
|
49
73
|
},
|
|
50
74
|
actionModal: {
|
|
51
75
|
titleTypography: {
|
|
@@ -78,15 +102,42 @@ var UIConfig;
|
|
|
78
102
|
toast: { variant: "outlined" }
|
|
79
103
|
};
|
|
80
104
|
const Context = createContext(DEFAULT_CONFIG);
|
|
81
|
-
_UIConfig.Provider = (
|
|
105
|
+
_UIConfig.Provider = (t0) => {
|
|
106
|
+
const $ = c(9);
|
|
107
|
+
const { config: t1, children } = t0;
|
|
108
|
+
let t2;
|
|
109
|
+
if ($[0] !== t1) {
|
|
110
|
+
t2 = t1 === void 0 ? {} : t1;
|
|
111
|
+
$[0] = t1;
|
|
112
|
+
$[1] = t2;
|
|
113
|
+
} else t2 = $[1];
|
|
114
|
+
const config = t2;
|
|
82
115
|
const parentConfig = use(Context) || DEFAULT_CONFIG;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
116
|
+
let t3;
|
|
117
|
+
let t4;
|
|
118
|
+
if ($[2] !== config || $[3] !== parentConfig) {
|
|
119
|
+
t3 = () => ObjectUtils.deepConditionalMerge(parentConfig, config, _temp);
|
|
120
|
+
t4 = [config, parentConfig];
|
|
121
|
+
$[2] = config;
|
|
122
|
+
$[3] = parentConfig;
|
|
123
|
+
$[4] = t3;
|
|
124
|
+
$[5] = t4;
|
|
125
|
+
} else {
|
|
126
|
+
t3 = $[4];
|
|
127
|
+
t4 = $[5];
|
|
128
|
+
}
|
|
129
|
+
const value = useDeepCompareMemo(t3, t4);
|
|
130
|
+
let t5;
|
|
131
|
+
if ($[6] !== children || $[7] !== value) {
|
|
132
|
+
t5 = /* @__PURE__ */ jsx(Context.Provider, {
|
|
133
|
+
value,
|
|
134
|
+
children
|
|
135
|
+
});
|
|
136
|
+
$[6] = children;
|
|
137
|
+
$[7] = value;
|
|
138
|
+
$[8] = t5;
|
|
139
|
+
} else t5 = $[8];
|
|
140
|
+
return t5;
|
|
90
141
|
};
|
|
91
142
|
_UIConfig.useConfig = () => {
|
|
92
143
|
const context = use(Context);
|
|
@@ -94,5 +145,8 @@ var UIConfig;
|
|
|
94
145
|
return context;
|
|
95
146
|
};
|
|
96
147
|
})(UIConfig || (UIConfig = {}));
|
|
148
|
+
function _temp(val) {
|
|
149
|
+
return val !== null && val !== void 0;
|
|
150
|
+
}
|
|
97
151
|
//#endregion
|
|
98
152
|
export { UIConfig };
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { ButtonConfig, ButtonContentConfig, ButtonIconSizeConfig, ButtonSizeConfig } from '../components/buttons/Button/button.cva';
|
|
4
|
+
import { StatusIconConfig, StatusSeparatorConfig, ToastConfig } from '../components/status/Toast/toast.cva';
|
|
5
|
+
import { CompoundMapper, ConfigSchema } from '../utils/compoundMapper';
|
|
6
|
+
import { StyleMergeUtils } from '../utils/style-merge.util';
|
|
7
|
+
export declare namespace UIOverrides {
|
|
8
|
+
export type Cva<T> = (props?: (T & ClassProp) | ClassProp) => string;
|
|
9
|
+
type GenericCva = Cva<unknown>;
|
|
10
|
+
type Mapper = CompoundMapper<unknown, ConfigSchema>;
|
|
11
|
+
type CvaOption<TConfig extends StyleMergeUtils.CvaConfigShape> = StyleMergeUtils.CvaConfigOverride<TConfig> | GenericCva;
|
|
12
|
+
type GenericCvaOption = StyleMergeUtils.CvaConfigOverride | GenericCva;
|
|
13
|
+
type OptionKey = {
|
|
14
|
+
[K in keyof Options]: Options[K] extends object ? `${K & string}.${keyof Options[K] & string}` : never;
|
|
15
|
+
}[keyof Options];
|
|
16
|
+
type OptionValue<K extends OptionKey> = K extends `${infer TSection}.${infer TSlot}` ? TSection extends keyof Options ? TSlot extends keyof Options[TSection] ? Options[TSection][TSlot] : never : never : never;
|
|
17
|
+
type ConfigFromOverride<TValue> = TValue extends StyleMergeUtils.CvaConfigOverride<infer TConfig> ? TConfig : never;
|
|
18
|
+
type OverrideConfig<TValue> = [ConfigFromOverride<TValue>] extends [never] ? never : ConfigFromOverride<TValue>;
|
|
19
|
+
type ExtractConfig<TValue> = [OverrideConfig<TValue>] extends [never] ? TValue extends {
|
|
20
|
+
config?: infer TConfig;
|
|
21
|
+
} ? NonNullable<TConfig> : TValue : OverrideConfig<TValue>;
|
|
22
|
+
type EmptyObject = {};
|
|
23
|
+
type VariantSchema<TConfig> = [TConfig] extends [never] ? EmptyObject : TConfig extends {
|
|
24
|
+
variants?: infer TVariants;
|
|
25
|
+
} ? [NonNullable<TVariants>] extends [never] ? EmptyObject : NonNullable<TVariants> : EmptyObject;
|
|
26
|
+
export type VariantProps<TConfig> = [keyof VariantSchema<ExtractConfig<TConfig>>] extends [never] ? EmptyObject : StyleMergeUtils.ConfigVariants<Extract<VariantSchema<ExtractConfig<TConfig>>, StyleMergeUtils.ConfigSchema>>;
|
|
27
|
+
export type OverrideVariantProps<TOverride> = VariantProps<ExtractConfig<TOverride>>;
|
|
28
|
+
export interface Options {
|
|
29
|
+
button: {
|
|
30
|
+
cva?: CvaOption<ButtonConfig>;
|
|
31
|
+
sizeCva?: CvaOption<ButtonSizeConfig>;
|
|
32
|
+
contentCva?: CvaOption<ButtonContentConfig>;
|
|
33
|
+
iconSize?: CvaOption<ButtonIconSizeConfig>;
|
|
34
|
+
typography?: Mapper;
|
|
35
|
+
};
|
|
36
|
+
pillButton: {
|
|
37
|
+
cva?: GenericCvaOption;
|
|
38
|
+
typography?: Mapper;
|
|
39
|
+
};
|
|
40
|
+
checkbox: {
|
|
41
|
+
cva?: GenericCvaOption;
|
|
42
|
+
iconCva?: GenericCvaOption;
|
|
43
|
+
typography?: Mapper;
|
|
44
|
+
contentClassName?: Mapper;
|
|
45
|
+
};
|
|
46
|
+
radio: {
|
|
47
|
+
cva?: GenericCvaOption;
|
|
48
|
+
contentWrapperCva?: GenericCvaOption;
|
|
49
|
+
contentRowCva?: GenericCvaOption;
|
|
50
|
+
typography?: Mapper;
|
|
51
|
+
contentClassName?: Mapper;
|
|
52
|
+
};
|
|
53
|
+
status: {
|
|
54
|
+
iconCva?: CvaOption<StatusIconConfig>;
|
|
55
|
+
separatorCva?: CvaOption<StatusSeparatorConfig>;
|
|
56
|
+
};
|
|
57
|
+
toast: {
|
|
58
|
+
cva?: CvaOption<ToastConfig>;
|
|
59
|
+
buttonColor?: Mapper;
|
|
60
|
+
};
|
|
61
|
+
alert: {
|
|
62
|
+
cva?: GenericCvaOption;
|
|
63
|
+
};
|
|
64
|
+
input: {
|
|
65
|
+
baseCva?: GenericCvaOption;
|
|
66
|
+
clearClassCva?: GenericCvaOption;
|
|
67
|
+
contentWrapperCva?: GenericCvaOption;
|
|
68
|
+
sizeCva?: GenericCvaOption;
|
|
69
|
+
sideCva?: GenericCvaOption;
|
|
70
|
+
};
|
|
71
|
+
textArea: {
|
|
72
|
+
wrapperCva?: GenericCvaOption;
|
|
73
|
+
};
|
|
74
|
+
tooltipWrapper: {
|
|
75
|
+
triggerCva?: GenericCvaOption;
|
|
76
|
+
};
|
|
77
|
+
datePickerInput: {
|
|
78
|
+
contentRowCva?: GenericCvaOption;
|
|
79
|
+
};
|
|
80
|
+
label: {
|
|
81
|
+
cva?: GenericCvaOption;
|
|
82
|
+
typography?: Mapper;
|
|
83
|
+
};
|
|
84
|
+
toggle: {
|
|
85
|
+
cva?: GenericCvaOption;
|
|
86
|
+
typography?: Mapper;
|
|
87
|
+
contentClassName?: Mapper;
|
|
88
|
+
};
|
|
89
|
+
typography: {
|
|
90
|
+
cva?: GenericCvaOption;
|
|
91
|
+
};
|
|
92
|
+
link: {
|
|
93
|
+
cva?: GenericCvaOption;
|
|
94
|
+
};
|
|
95
|
+
tag: {
|
|
96
|
+
cva?: GenericCvaOption;
|
|
97
|
+
};
|
|
98
|
+
table: {
|
|
99
|
+
headRowCva?: GenericCvaOption;
|
|
100
|
+
headDataCva?: GenericCvaOption;
|
|
101
|
+
rowCva?: GenericCvaOption;
|
|
102
|
+
dataCva?: GenericCvaOption;
|
|
103
|
+
headerTextCva?: GenericCvaOption;
|
|
104
|
+
cellTextCva?: GenericCvaOption;
|
|
105
|
+
};
|
|
106
|
+
tooltip: {
|
|
107
|
+
cva?: GenericCvaOption;
|
|
108
|
+
pointerHorizontalCva?: GenericCvaOption;
|
|
109
|
+
pointerVerticalCva?: GenericCvaOption;
|
|
110
|
+
textCva?: GenericCvaOption;
|
|
111
|
+
};
|
|
112
|
+
modal: {
|
|
113
|
+
contentCva?: GenericCvaOption;
|
|
114
|
+
overlayCva?: GenericCvaOption;
|
|
115
|
+
mainCva?: GenericCvaOption;
|
|
116
|
+
};
|
|
117
|
+
menu: {
|
|
118
|
+
cva?: GenericCvaOption;
|
|
119
|
+
itemCva?: GenericCvaOption;
|
|
120
|
+
popoverCva?: GenericCvaOption;
|
|
121
|
+
popoverWrapperCva?: GenericCvaOption;
|
|
122
|
+
};
|
|
123
|
+
segment: {
|
|
124
|
+
cva?: GenericCvaOption;
|
|
125
|
+
itemCva?: GenericCvaOption;
|
|
126
|
+
};
|
|
127
|
+
stepper: {
|
|
128
|
+
cva?: GenericCvaOption;
|
|
129
|
+
itemCva?: GenericCvaOption;
|
|
130
|
+
iconCva?: GenericCvaOption;
|
|
131
|
+
numberCva?: GenericCvaOption;
|
|
132
|
+
titleCva?: GenericCvaOption;
|
|
133
|
+
subtextCva?: GenericCvaOption;
|
|
134
|
+
separatorCva?: GenericCvaOption;
|
|
135
|
+
};
|
|
136
|
+
accordion: {
|
|
137
|
+
cva?: GenericCvaOption;
|
|
138
|
+
itemCva?: GenericCvaOption;
|
|
139
|
+
triggerCva?: GenericCvaOption;
|
|
140
|
+
headingCva?: GenericCvaOption;
|
|
141
|
+
headingTitleCva?: GenericCvaOption;
|
|
142
|
+
headingSubtitleCva?: GenericCvaOption;
|
|
143
|
+
chevronCva?: GenericCvaOption;
|
|
144
|
+
iconCva?: GenericCvaOption;
|
|
145
|
+
panelCva?: GenericCvaOption;
|
|
146
|
+
panelContentCva?: GenericCvaOption;
|
|
147
|
+
};
|
|
148
|
+
breadcrumbs: {
|
|
149
|
+
cva?: GenericCvaOption;
|
|
150
|
+
itemCva?: GenericCvaOption;
|
|
151
|
+
segmentCva?: GenericCvaOption;
|
|
152
|
+
chevronCva?: GenericCvaOption;
|
|
153
|
+
iconCva?: GenericCvaOption;
|
|
154
|
+
};
|
|
155
|
+
popover: {
|
|
156
|
+
cva?: GenericCvaOption;
|
|
157
|
+
};
|
|
158
|
+
formField: {
|
|
159
|
+
headerCva?: GenericCvaOption;
|
|
160
|
+
errorLabelCva?: GenericCvaOption;
|
|
161
|
+
helperLabelCva?: GenericCvaOption;
|
|
162
|
+
};
|
|
163
|
+
select: {
|
|
164
|
+
listBoxItemCva?: GenericCvaOption;
|
|
165
|
+
popoverCva?: GenericCvaOption;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export type Config = Partial<Options>;
|
|
169
|
+
interface ProviderProps {
|
|
170
|
+
config?: Config;
|
|
171
|
+
}
|
|
172
|
+
export const Provider: ({ children, config }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
173
|
+
export const useCvaOverride: <K extends OptionKey>(key: K) => undefined;
|
|
174
|
+
export function defineConfig(definition: {
|
|
175
|
+
base: string[];
|
|
176
|
+
}): {
|
|
177
|
+
base: string[];
|
|
178
|
+
config?: StyleMergeUtils.Config<Record<never, never>>;
|
|
179
|
+
};
|
|
180
|
+
export function defineConfig<const TSchema extends StyleMergeUtils.ConfigSchema>(definition: {
|
|
181
|
+
base: string[];
|
|
182
|
+
config: StyleMergeUtils.Config<TSchema>;
|
|
183
|
+
}): {
|
|
184
|
+
base: string[];
|
|
185
|
+
config: StyleMergeUtils.Config<TSchema>;
|
|
186
|
+
};
|
|
187
|
+
export const defineOverride: <K extends OptionKey, const TOverride extends NonNullable<OptionValue<K>>>(_key: K, override: TOverride) => TOverride;
|
|
188
|
+
export function useCva<K extends OptionKey>(key: K, fallback: StyleMergeUtils.CvaDefinition<ConfigFromOverride<NonNullable<OptionValue<K>>> & StyleMergeUtils.CvaConfigShape>): Cva<any>;
|
|
189
|
+
export function useCva<K extends OptionKey, TProps>(key: K, fallback: Cva<TProps>): Cva<TProps>;
|
|
190
|
+
export const useMapper: <T, K extends ConfigSchema>(key: OptionKey, fallback: CompoundMapper<T, K>) => CompoundMapper<T, K>;
|
|
191
|
+
export {};
|
|
192
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { StyleMergeUtils } from "../utils/style-merge.util.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { clsx } from "clsx";
|
|
5
|
+
import { createContext, use } from "react";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
//#region src/config/uiOverrides.context.tsx
|
|
8
|
+
var UIOverrides;
|
|
9
|
+
(function(_UIOverrides) {
|
|
10
|
+
const Context = createContext(null);
|
|
11
|
+
_UIOverrides.Provider = (t0) => {
|
|
12
|
+
const $ = c(3);
|
|
13
|
+
const { children, config } = t0;
|
|
14
|
+
let t1;
|
|
15
|
+
if ($[0] !== children || $[1] !== config) {
|
|
16
|
+
t1 = /* @__PURE__ */ jsx(Context.Provider, {
|
|
17
|
+
value: config,
|
|
18
|
+
children
|
|
19
|
+
});
|
|
20
|
+
$[0] = children;
|
|
21
|
+
$[1] = config;
|
|
22
|
+
$[2] = t1;
|
|
23
|
+
} else t1 = $[2];
|
|
24
|
+
return t1;
|
|
25
|
+
};
|
|
26
|
+
const useConfig = () => {
|
|
27
|
+
return use(Context);
|
|
28
|
+
};
|
|
29
|
+
const useCvaOverride = _UIOverrides.useCvaOverride = (key) => {
|
|
30
|
+
const uiOverrides = useConfig();
|
|
31
|
+
if (!uiOverrides) return;
|
|
32
|
+
const [k1, k2] = key.split(".");
|
|
33
|
+
const item = uiOverrides[k1]?.[k2];
|
|
34
|
+
if (!item) return;
|
|
35
|
+
return item;
|
|
36
|
+
};
|
|
37
|
+
function defineConfig(definition) {
|
|
38
|
+
return definition;
|
|
39
|
+
}
|
|
40
|
+
_UIOverrides.defineConfig = defineConfig;
|
|
41
|
+
_UIOverrides.defineOverride = (_key, override) => {
|
|
42
|
+
return override;
|
|
43
|
+
};
|
|
44
|
+
const isCvaFunction = (item) => {
|
|
45
|
+
return typeof item === "function";
|
|
46
|
+
};
|
|
47
|
+
const isCvaOverrideConfig = (item) => {
|
|
48
|
+
if (typeof item !== "object") return false;
|
|
49
|
+
if (item == null) return false;
|
|
50
|
+
return "mode" in item;
|
|
51
|
+
};
|
|
52
|
+
const isDefinition = (item) => {
|
|
53
|
+
if (typeof item !== "object") return false;
|
|
54
|
+
if (item == null) return false;
|
|
55
|
+
return "base" in item;
|
|
56
|
+
};
|
|
57
|
+
function useCva(key, fallback) {
|
|
58
|
+
const $ = c(6);
|
|
59
|
+
const override = useCvaOverride(key);
|
|
60
|
+
let t0;
|
|
61
|
+
bb0: {
|
|
62
|
+
if (isCvaFunction(override)) {
|
|
63
|
+
t0 = override;
|
|
64
|
+
break bb0;
|
|
65
|
+
}
|
|
66
|
+
if (isCvaFunction(fallback)) {
|
|
67
|
+
t0 = fallback;
|
|
68
|
+
break bb0;
|
|
69
|
+
}
|
|
70
|
+
if (!isDefinition(fallback)) {
|
|
71
|
+
t0 = _temp;
|
|
72
|
+
break bb0;
|
|
73
|
+
}
|
|
74
|
+
const definition = fallback;
|
|
75
|
+
const typedOverride = override;
|
|
76
|
+
if (isCvaOverrideConfig(typedOverride)) {
|
|
77
|
+
let t1;
|
|
78
|
+
if ($[0] !== definition || $[1] !== typedOverride) {
|
|
79
|
+
const mergedDefinition = StyleMergeUtils.mergeCvaDefinition(definition, typedOverride);
|
|
80
|
+
t1 = cva(clsx(mergedDefinition.base), mergedDefinition.config);
|
|
81
|
+
$[0] = definition;
|
|
82
|
+
$[1] = typedOverride;
|
|
83
|
+
$[2] = t1;
|
|
84
|
+
} else t1 = $[2];
|
|
85
|
+
t0 = t1;
|
|
86
|
+
break bb0;
|
|
87
|
+
}
|
|
88
|
+
let t1;
|
|
89
|
+
if ($[3] !== definition.base || $[4] !== definition.config) {
|
|
90
|
+
t1 = cva(clsx(definition.base), definition.config);
|
|
91
|
+
$[3] = definition.base;
|
|
92
|
+
$[4] = definition.config;
|
|
93
|
+
$[5] = t1;
|
|
94
|
+
} else t1 = $[5];
|
|
95
|
+
t0 = t1;
|
|
96
|
+
}
|
|
97
|
+
return t0;
|
|
98
|
+
}
|
|
99
|
+
_UIOverrides.useCva = useCva;
|
|
100
|
+
function _temp() {
|
|
101
|
+
return "";
|
|
102
|
+
}
|
|
103
|
+
_UIOverrides.useMapper = (key, fallback) => {
|
|
104
|
+
const uiOverrides = useConfig();
|
|
105
|
+
if (!uiOverrides) return fallback;
|
|
106
|
+
const [k1, k2] = key.split(".");
|
|
107
|
+
const item = uiOverrides[k1]?.[k2];
|
|
108
|
+
if (typeof item !== "function") return fallback;
|
|
109
|
+
return item;
|
|
110
|
+
};
|
|
111
|
+
})(UIOverrides || (UIOverrides = {}));
|
|
112
|
+
//#endregion
|
|
113
|
+
export { UIOverrides };
|
|
@@ -21,14 +21,14 @@ export type AllowedComponentType<TZodType extends z.ZodType> = ZodUtils.ZodTypeS
|
|
|
21
21
|
datetime: "datePicker" | "dateTimePicker" | "timePicker";
|
|
22
22
|
dateRange: "dateRangePicker";
|
|
23
23
|
boolean: "toggle" | "checkbox";
|
|
24
|
-
number: "numberInput" | "slider" | "select" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
25
|
-
enum: "select" | "autocomplete" | "segment";
|
|
26
|
-
string: "textInput" | "passwordInput" | "textArea" | "select" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
24
|
+
number: "numberInput" | "slider" | "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
25
|
+
enum: "select" | "querySelect" | "autocomplete" | "segment";
|
|
26
|
+
string: "textInput" | "passwordInput" | "textArea" | "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
27
27
|
email: "textInput";
|
|
28
|
-
array: "select" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
28
|
+
array: "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
29
29
|
object: InputComponentType;
|
|
30
30
|
unknown: InputComponentType;
|
|
31
|
-
uuid: "select" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
31
|
+
uuid: "select" | "querySelect" | "autocomplete" | "queryAutocomplete" | "segment";
|
|
32
32
|
}>;
|
|
33
33
|
interface DynamicInputDefBase<TProps> {
|
|
34
34
|
label?: string;
|
|
@@ -81,6 +81,7 @@ var getDefaultProps = (componentType, keyType) => {
|
|
|
81
81
|
].includes(componentType)) props.items = getDefaultSelectionItems(unwrappedType);
|
|
82
82
|
if ([
|
|
83
83
|
"select",
|
|
84
|
+
"querySelect",
|
|
84
85
|
"autocomplete",
|
|
85
86
|
"queryAutocomplete",
|
|
86
87
|
"segment"
|
|
@@ -146,6 +147,8 @@ var populateInputDef = (schema, schemaKey, value, options) => {
|
|
|
146
147
|
const inputWrapper = value.inputWrapper ?? options.globalInputWrapper;
|
|
147
148
|
if ("render" in value) return {
|
|
148
149
|
name,
|
|
150
|
+
label,
|
|
151
|
+
placeholder,
|
|
149
152
|
render: value.render
|
|
150
153
|
};
|
|
151
154
|
const schemaKeyType = schema.shape[schemaKey];
|