@povio/ui 2.3.0-rc.9 → 2.3.1
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 +11 -26
- package/dist/assets/icons/AlignLeft.js +11 -26
- package/dist/assets/icons/AlignLeftRight.js +11 -26
- package/dist/assets/icons/AlignRight.js +11 -26
- package/dist/assets/icons/ArrowDropDown.js +11 -26
- package/dist/assets/icons/ArrowDropUp.js +11 -26
- package/dist/assets/icons/ArrowLeft.js +11 -26
- package/dist/assets/icons/ArrowRight.js +11 -26
- package/dist/assets/icons/Bold.js +11 -26
- package/dist/assets/icons/BulletedList.js +11 -26
- package/dist/assets/icons/Calendar.js +13 -28
- package/dist/assets/icons/Check.js +13 -28
- package/dist/assets/icons/CheckCircle.js +11 -26
- package/dist/assets/icons/CheckboxCheckmark.js +14 -29
- package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
- package/dist/assets/icons/ChevronDown.js +13 -28
- package/dist/assets/icons/ChevronLeft.js +13 -28
- package/dist/assets/icons/ChevronRight.js +13 -28
- package/dist/assets/icons/ChevronUp.js +13 -28
- package/dist/assets/icons/ChevronsLeft.js +13 -28
- package/dist/assets/icons/ChevronsRight.js +13 -28
- package/dist/assets/icons/Clock.js +11 -26
- package/dist/assets/icons/Close.js +11 -26
- package/dist/assets/icons/DateTime.js +14 -35
- package/dist/assets/icons/DragIndicator.js +11 -26
- package/dist/assets/icons/File.js +13 -28
- package/dist/assets/icons/Highlight.js +11 -26
- package/dist/assets/icons/HighlightOn.js +15 -49
- package/dist/assets/icons/Home.js +11 -26
- package/dist/assets/icons/Info.js +16 -37
- package/dist/assets/icons/Italic.js +11 -26
- package/dist/assets/icons/Link.js +11 -26
- package/dist/assets/icons/Menu.js +11 -26
- package/dist/assets/icons/NumberedList.js +11 -26
- package/dist/assets/icons/PointerHorizontal.js +11 -26
- package/dist/assets/icons/PointerVertical.js +11 -26
- package/dist/assets/icons/Search.js +11 -26
- package/dist/assets/icons/Send.js +13 -28
- package/dist/assets/icons/Strikethrough.js +11 -26
- package/dist/assets/icons/TextColor.js +14 -48
- package/dist/assets/icons/Today.js +11 -26
- package/dist/assets/icons/Underlined.js +13 -28
- package/dist/assets/icons/Upload.js +14 -35
- package/dist/assets/icons/Visibility.js +11 -26
- package/dist/assets/icons/VisibilityOff.js +11 -26
- package/dist/assets/icons/WarningFilled.js +13 -28
- package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
- package/dist/components/Menu/Menu.js +2 -18
- package/dist/components/Menu/MenuDesktop.js +7 -41
- package/dist/components/Menu/MenuItem.js +9 -32
- package/dist/components/Menu/MenuMobile.js +38 -97
- package/dist/components/Menu/MenuPopover.js +29 -105
- package/dist/components/buttons/IconButton/IconButton.js +8 -40
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/PillButton/PillButton.js +17 -55
- package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
- package/dist/components/buttons/TextButton/TextButton.js +8 -30
- package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/Checkbox.js +35 -172
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
- package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -10
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +20 -121
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -10
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +111 -215
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -11
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +19 -123
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -5
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +104 -448
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
- package/dist/components/inputs/DateTime/shared/Calendar.js +119 -330
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -283
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -142
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
- package/dist/components/inputs/DateTime/shared/DateField.js +112 -296
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -6
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +136 -355
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -14
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -97
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
- package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -2
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -207
- package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
- package/dist/components/inputs/File/FileUpload.js +44 -87
- package/dist/components/inputs/File/FileUploadContainer.js +7 -15
- package/dist/components/inputs/File/InputUpload.js +79 -317
- package/dist/components/inputs/File/shared/FileCard.js +41 -104
- package/dist/components/inputs/File/shared/FileCardList.js +12 -47
- package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
- package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
- package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
- package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
- package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +37 -119
- package/dist/components/inputs/FormField/FormFieldError.js +5 -25
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
- package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +88 -334
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
- package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
- package/dist/components/inputs/Input/TextInput/TextInput.js +79 -319
- package/dist/components/inputs/Input/shared/InputContent.js +59 -192
- package/dist/components/inputs/Inputs/Form.js +11 -40
- package/dist/components/inputs/Inputs/InputItem.d.ts +21 -16
- package/dist/components/inputs/Inputs/InputItem.js +14 -71
- package/dist/components/inputs/Inputs/Inputs.js +11 -37
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.js +60 -352
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
- package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +7 -109
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -34
- package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
- package/dist/components/inputs/Selection/Select/Select.js +5 -132
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
- package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +116 -338
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/select.context.js +34 -57
- package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
- package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
- package/dist/components/inputs/Slider/Slider.js +74 -250
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
- package/dist/components/inputs/Toggle/Toggle.js +37 -189
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
- package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
- package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
- package/dist/components/inputs/shared/CheckContent.js +11 -21
- package/dist/components/inputs/shared/InputClear.d.ts +1 -2
- package/dist/components/inputs/shared/InputClear.js +13 -79
- package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
- package/dist/components/inputs/shared/input.cva.d.ts +0 -10
- package/dist/components/inputs/shared/input.cva.js +4 -32
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/navigation/Stepper/StepperItem.js +31 -104
- package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/BottomSheet/BottomSheet.js +49 -98
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
- package/dist/components/overlays/Drawer/Drawer.js +20 -62
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
- package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
- package/dist/components/segment/Segment.js +57 -218
- package/dist/components/segment/SegmentItem.js +10 -67
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/shared/pagination/PaginationList.js +64 -167
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/status/Loader/Loader.js +22 -77
- package/dist/components/status/Toast/Toast.js +13 -21
- package/dist/components/status/Toast/useToast.js +57 -62
- package/dist/components/table/ColumnConfig.js +54 -158
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/PaginatedTable.js +18 -84
- package/dist/components/table/Table.js +27 -28
- package/dist/components/text/Link/Link.js +7 -19
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +9 -23
- package/dist/config/router.context.js +16 -42
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.d.ts +6 -16
- package/dist/config/uiConfig.context.js +13 -56
- package/dist/config/uiStyle.context.d.ts +4 -27
- package/dist/config/uiStyle.context.js +5 -15
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +0 -3
- package/dist/hooks/useBreakpoint.js +3 -16
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFilters.js +64 -125
- package/dist/hooks/useForm.js +8 -42
- package/dist/hooks/useFormAutosave.js +30 -101
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +24 -91
- package/dist/hooks/useLocalStorage.js +10 -43
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/hooks/usePagination.js +19 -49
- package/dist/hooks/useScrollableListBox.js +16 -37
- package/dist/hooks/useSorting.js +28 -69
- package/dist/hooks/useStateAndRef.js +7 -21
- package/dist/hooks/useTableColumnConfig.js +31 -124
- package/dist/hooks/useTranslationMemo.js +5 -25
- package/dist/index.d.ts +0 -7
- package/dist/index.js +3 -5
- package/dist/tw-ui-plugin.js +0 -2
- package/dist/utils/date-time.utils.d.ts +10 -31
- package/dist/utils/date-time.utils.js +22 -123
- package/dist/utils/dom.utils.js +1 -1
- package/package.json +1 -1
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -4
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -6
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -21
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -31
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -80
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -479
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
- package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -122
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -6
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -13
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -79
- package/dist/components/inputs/Skeleton/InputFrame.js +0 -526
- package/dist/components/inputs/shared/StaticInput.d.ts +0 -38
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
- package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
- package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
- package/dist/hooks/useQueryAutocomplete.js +0 -57
- package/dist/utils/query.utils.d.ts +0 -4
- package/dist/utils/query.utils.js +0 -8
|
@@ -1,374 +1,82 @@
|
|
|
1
1
|
import { UIStyle } from "../../../config/uiStyle.context.js";
|
|
2
2
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
3
3
|
import { CheckContent } from "../shared/CheckContent.js";
|
|
4
|
-
import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
|
|
5
|
-
import { inputBase, inputSize } from "../shared/input.cva.js";
|
|
6
4
|
import { FormField } from "../FormField/FormField.js";
|
|
7
|
-
import {
|
|
8
|
-
import { radio, radioContentClassName, radioContentRow, radioContentWrapper, radioIndicatorClass, radioTypography } from "./radio.cva.js";
|
|
9
|
-
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { radio, radioIndicatorClass, radioTypography } from "./radio.cva.js";
|
|
10
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
7
|
import { clsx } from "clsx";
|
|
12
8
|
import { Radio, RadioGroup } from "react-aria-components";
|
|
13
|
-
import { useLabel } from "react-aria";
|
|
14
9
|
import { mergeRefs } from "@react-aria/utils";
|
|
15
10
|
import { Controller } from "react-hook-form";
|
|
16
11
|
//#region src/components/inputs/RadioGroup/RadioGroup.tsx
|
|
17
12
|
var RadioGroupBase = (props) => {
|
|
18
|
-
const $ = c(91);
|
|
19
13
|
const ui = UIConfig.useConfig();
|
|
20
14
|
const radioCva = UIStyle.useCva("radio.cva", radio);
|
|
21
|
-
const radioContentWrapperCva = UIStyle.useCva("radio.contentWrapperCva", radioContentWrapper);
|
|
22
|
-
const radioContentRowCva = UIStyle.useCva("radio.contentRowCva", radioContentRow);
|
|
23
|
-
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
24
|
-
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
25
15
|
const radioTypographyMap = UIStyle.useMapper("radio.typography", radioTypography);
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
...rest
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
className,
|
|
49
|
-
error,
|
|
50
|
-
label,
|
|
51
|
-
tooltipText,
|
|
52
|
-
helperText,
|
|
53
|
-
isRequired,
|
|
54
|
-
rightContent,
|
|
55
|
-
isHeaderHidden: t0,
|
|
56
|
-
hideLabel,
|
|
57
|
-
isDisabled,
|
|
58
|
-
headerClassName,
|
|
59
|
-
errorClassName
|
|
60
|
-
};
|
|
61
|
-
$[0] = className;
|
|
62
|
-
$[1] = error;
|
|
63
|
-
$[2] = errorClassName;
|
|
64
|
-
$[3] = headerClassName;
|
|
65
|
-
$[4] = helperText;
|
|
66
|
-
$[5] = hideLabel;
|
|
67
|
-
$[6] = isDisabled;
|
|
68
|
-
$[7] = isRequired;
|
|
69
|
-
$[8] = label;
|
|
70
|
-
$[9] = rightContent;
|
|
71
|
-
$[10] = t0;
|
|
72
|
-
$[11] = tooltipText;
|
|
73
|
-
$[12] = t1;
|
|
74
|
-
} else t1 = $[12];
|
|
75
|
-
const formFieldProps = t1;
|
|
76
|
-
let t2;
|
|
77
|
-
if ($[13] !== label) {
|
|
78
|
-
t2 = { label };
|
|
79
|
-
$[13] = label;
|
|
80
|
-
$[14] = t2;
|
|
81
|
-
} else t2 = $[14];
|
|
82
|
-
const { labelProps, fieldProps } = useLabel(t2);
|
|
83
|
-
const t3 = hideLabel || isHeaderHidden;
|
|
84
|
-
let t4;
|
|
85
|
-
if ($[15] !== headerClassName || $[16] !== helperText || $[17] !== isDisabled || $[18] !== isRequired || $[19] !== label || $[20] !== labelProps || $[21] !== rightContent || $[22] !== t3 || $[23] !== tooltipText) {
|
|
86
|
-
t4 = {
|
|
87
|
-
label,
|
|
88
|
-
tooltipText,
|
|
89
|
-
helperText,
|
|
90
|
-
isRequired,
|
|
91
|
-
rightContent,
|
|
92
|
-
isHeaderHidden: t3,
|
|
93
|
-
isDisabled,
|
|
94
|
-
className: headerClassName,
|
|
95
|
-
labelProps
|
|
96
|
-
};
|
|
97
|
-
$[15] = headerClassName;
|
|
98
|
-
$[16] = helperText;
|
|
99
|
-
$[17] = isDisabled;
|
|
100
|
-
$[18] = isRequired;
|
|
101
|
-
$[19] = label;
|
|
102
|
-
$[20] = labelProps;
|
|
103
|
-
$[21] = rightContent;
|
|
104
|
-
$[22] = t3;
|
|
105
|
-
$[23] = tooltipText;
|
|
106
|
-
$[24] = t4;
|
|
107
|
-
} else t4 = $[24];
|
|
108
|
-
const headerProps = t4;
|
|
109
|
-
const selectedValue = value ?? defaultValue;
|
|
110
|
-
const shouldRenderInputFrame = as !== "default";
|
|
111
|
-
const T0 = TooltipWrapper;
|
|
112
|
-
const t5 = as === "inline" ? -1 : void 0;
|
|
113
|
-
const T1 = RadioGroup;
|
|
114
|
-
const t6 = !!error;
|
|
115
|
-
const t7 = isDirty || void 0;
|
|
116
|
-
const t8 = isRequired || void 0;
|
|
117
|
-
const T2 = FormField;
|
|
118
|
-
const t9 = as === "inline" && "h-full";
|
|
119
|
-
let t10;
|
|
120
|
-
if ($[25] !== className || $[26] !== t9) {
|
|
121
|
-
t10 = clsx("w-full", t9, className);
|
|
122
|
-
$[25] = className;
|
|
123
|
-
$[26] = t9;
|
|
124
|
-
$[27] = t10;
|
|
125
|
-
} else t10 = $[27];
|
|
126
|
-
const t11 = as === "inline" ? -1 : void 0;
|
|
127
|
-
let t12;
|
|
128
|
-
if ($[28] !== as || $[29] !== inputBaseCva || $[30] !== inputClassName || $[31] !== shouldRenderInputFrame || $[32] !== ui) {
|
|
129
|
-
t12 = clsx("group/radio-group-content relative", shouldRenderInputFrame && inputBaseCva({
|
|
130
|
-
variant: ui.input.variant,
|
|
131
|
-
as
|
|
132
|
-
}), inputClassName);
|
|
133
|
-
$[28] = as;
|
|
134
|
-
$[29] = inputBaseCva;
|
|
135
|
-
$[30] = inputClassName;
|
|
136
|
-
$[31] = shouldRenderInputFrame;
|
|
137
|
-
$[32] = ui;
|
|
138
|
-
$[33] = t12;
|
|
139
|
-
} else t12 = $[33];
|
|
140
|
-
const t13 = "";
|
|
141
|
-
const t14 = isDisabled || void 0;
|
|
142
|
-
const t15 = isDisabled || void 0;
|
|
143
|
-
const t16 = !!error || void 0;
|
|
144
|
-
const t17 = selectedValue != null && selectedValue !== "" ? true : void 0;
|
|
145
|
-
const t18 = "";
|
|
146
|
-
const t19 = clsx(radioContentWrapperCva({
|
|
147
|
-
variant,
|
|
148
|
-
as,
|
|
149
|
-
hasInputFrame: shouldRenderInputFrame,
|
|
150
|
-
...rest
|
|
151
|
-
}), shouldRenderInputFrame && inputSizeCva({
|
|
152
|
-
as,
|
|
153
|
-
size
|
|
154
|
-
}));
|
|
155
|
-
const t20 = isDirty || void 0;
|
|
156
|
-
const t21 = isRequired || void 0;
|
|
157
|
-
let t22;
|
|
158
|
-
if ($[34] !== as || $[35] !== headerProps || $[36] !== size) {
|
|
159
|
-
t22 = as && ["filter", "floating"].includes(as) && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
160
|
-
as,
|
|
161
|
-
size,
|
|
162
|
-
...headerProps
|
|
163
|
-
});
|
|
164
|
-
$[34] = as;
|
|
165
|
-
$[35] = headerProps;
|
|
166
|
-
$[36] = size;
|
|
167
|
-
$[37] = t22;
|
|
168
|
-
} else t22 = $[37];
|
|
169
|
-
const t23 = radioContentRowCva({
|
|
170
|
-
variant,
|
|
171
|
-
as,
|
|
172
|
-
hasInputFrame: shouldRenderInputFrame,
|
|
173
|
-
...rest
|
|
174
|
-
});
|
|
175
|
-
let t24;
|
|
176
|
-
if ($[38] !== labelClassName || $[39] !== options || $[40] !== radioClassName || $[41] !== radioContentClassNameValue || $[42] !== radioTypographyProps) {
|
|
177
|
-
let t25;
|
|
178
|
-
if ($[44] !== labelClassName || $[45] !== radioClassName || $[46] !== radioContentClassNameValue || $[47] !== radioTypographyProps) {
|
|
179
|
-
t25 = (option) => /* @__PURE__ */ jsxs(Radio, {
|
|
180
|
-
value: option.value,
|
|
181
|
-
className: clsx("relative", radioIndicatorClass),
|
|
182
|
-
children: [/* @__PURE__ */ jsx("div", { className: radioClassName }), /* @__PURE__ */ jsx(CheckContent, {
|
|
183
|
-
typography: radioTypographyProps,
|
|
184
|
-
contentClassName: radioContentClassNameValue,
|
|
185
|
-
className: labelClassName,
|
|
186
|
-
children: option.label
|
|
187
|
-
})]
|
|
188
|
-
}, option.value);
|
|
189
|
-
$[44] = labelClassName;
|
|
190
|
-
$[45] = radioClassName;
|
|
191
|
-
$[46] = radioContentClassNameValue;
|
|
192
|
-
$[47] = radioTypographyProps;
|
|
193
|
-
$[48] = t25;
|
|
194
|
-
} else t25 = $[48];
|
|
195
|
-
t24 = options.map(t25);
|
|
196
|
-
$[38] = labelClassName;
|
|
197
|
-
$[39] = options;
|
|
198
|
-
$[40] = radioClassName;
|
|
199
|
-
$[41] = radioContentClassNameValue;
|
|
200
|
-
$[42] = radioTypographyProps;
|
|
201
|
-
$[43] = t24;
|
|
202
|
-
} else t24 = $[43];
|
|
203
|
-
let t25;
|
|
204
|
-
if ($[49] !== t23 || $[50] !== t24) {
|
|
205
|
-
t25 = /* @__PURE__ */ jsx("div", {
|
|
206
|
-
className: t23,
|
|
207
|
-
children: t24
|
|
208
|
-
});
|
|
209
|
-
$[49] = t23;
|
|
210
|
-
$[50] = t24;
|
|
211
|
-
$[51] = t25;
|
|
212
|
-
} else t25 = $[51];
|
|
213
|
-
let t26;
|
|
214
|
-
if ($[52] !== t19 || $[53] !== t20 || $[54] !== t21 || $[55] !== t22 || $[56] !== t25) {
|
|
215
|
-
t26 = /* @__PURE__ */ jsxs("div", {
|
|
216
|
-
className: t19,
|
|
217
|
-
"data-is-dirty": t20,
|
|
218
|
-
"data-is-required": t21,
|
|
219
|
-
children: [t22, t25]
|
|
220
|
-
});
|
|
221
|
-
$[52] = t19;
|
|
222
|
-
$[53] = t20;
|
|
223
|
-
$[54] = t21;
|
|
224
|
-
$[55] = t22;
|
|
225
|
-
$[56] = t25;
|
|
226
|
-
$[57] = t26;
|
|
227
|
-
} else t26 = $[57];
|
|
228
|
-
let t27;
|
|
229
|
-
if ($[58] !== t12 || $[59] !== t14 || $[60] !== t15 || $[61] !== t16 || $[62] !== t17 || $[63] !== t26) {
|
|
230
|
-
t27 = /* @__PURE__ */ jsx("div", {
|
|
231
|
-
className: t12,
|
|
232
|
-
"data-rac": t13,
|
|
233
|
-
"data-disabled": t14,
|
|
234
|
-
"data-is-disabled": t15,
|
|
235
|
-
"data-invalid": t16,
|
|
236
|
-
"data-has-selection": t17,
|
|
237
|
-
"data-radio-group-content": t18,
|
|
238
|
-
children: t26
|
|
239
|
-
});
|
|
240
|
-
$[58] = t12;
|
|
241
|
-
$[59] = t14;
|
|
242
|
-
$[60] = t15;
|
|
243
|
-
$[61] = t16;
|
|
244
|
-
$[62] = t17;
|
|
245
|
-
$[63] = t26;
|
|
246
|
-
$[64] = t27;
|
|
247
|
-
} else t27 = $[64];
|
|
248
|
-
let t28;
|
|
249
|
-
if ($[65] !== T2 || $[66] !== as || $[67] !== formFieldProps || $[68] !== labelProps || $[69] !== t10 || $[70] !== t11 || $[71] !== t27) {
|
|
250
|
-
t28 = /* @__PURE__ */ jsx(T2, {
|
|
16
|
+
const { label, tooltipText, helperText, isDirty, isRequired, rightContent, isDisabled, headerClassName, errorClassName, labelClassName, inputClassName, isHeaderHidden, error, className, options, variant = ui.radioGroup.variant, hideLabel = ui.radioGroup.hideLabel, ...rest } = props;
|
|
17
|
+
const formFieldProps = {
|
|
18
|
+
className,
|
|
19
|
+
error,
|
|
20
|
+
label,
|
|
21
|
+
tooltipText,
|
|
22
|
+
helperText,
|
|
23
|
+
isRequired,
|
|
24
|
+
rightContent,
|
|
25
|
+
isHeaderHidden,
|
|
26
|
+
hideLabel,
|
|
27
|
+
isDisabled,
|
|
28
|
+
headerClassName,
|
|
29
|
+
errorClassName
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ jsx(RadioGroup, {
|
|
32
|
+
...rest,
|
|
33
|
+
isDisabled,
|
|
34
|
+
isInvalid: !!error,
|
|
35
|
+
"data-is-dirty": isDirty || void 0,
|
|
36
|
+
"data-is-required": isRequired || void 0,
|
|
37
|
+
children: /* @__PURE__ */ jsx(FormField, {
|
|
251
38
|
...formFieldProps,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
ref,
|
|
273
|
-
value,
|
|
274
|
-
defaultValue,
|
|
275
|
-
isDisabled,
|
|
276
|
-
isInvalid: t6,
|
|
277
|
-
"data-is-dirty": t7,
|
|
278
|
-
"data-is-required": t8,
|
|
279
|
-
children: t28
|
|
280
|
-
});
|
|
281
|
-
$[73] = T1;
|
|
282
|
-
$[74] = defaultValue;
|
|
283
|
-
$[75] = fieldProps;
|
|
284
|
-
$[76] = isDisabled;
|
|
285
|
-
$[77] = ref;
|
|
286
|
-
$[78] = rest;
|
|
287
|
-
$[79] = t28;
|
|
288
|
-
$[80] = t6;
|
|
289
|
-
$[81] = t7;
|
|
290
|
-
$[82] = t8;
|
|
291
|
-
$[83] = value;
|
|
292
|
-
$[84] = t29;
|
|
293
|
-
} else t29 = $[84];
|
|
294
|
-
let t30;
|
|
295
|
-
if ($[85] !== T0 || $[86] !== as || $[87] !== error || $[88] !== t29 || $[89] !== t5) {
|
|
296
|
-
t30 = /* @__PURE__ */ jsx(T0, {
|
|
297
|
-
as,
|
|
298
|
-
error,
|
|
299
|
-
triggerTabIndex: t5,
|
|
300
|
-
children: t29
|
|
301
|
-
});
|
|
302
|
-
$[85] = T0;
|
|
303
|
-
$[86] = as;
|
|
304
|
-
$[87] = error;
|
|
305
|
-
$[88] = t29;
|
|
306
|
-
$[89] = t5;
|
|
307
|
-
$[90] = t30;
|
|
308
|
-
} else t30 = $[90];
|
|
309
|
-
return t30;
|
|
39
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: clsx("flex flex-col", inputClassName),
|
|
41
|
+
children: options.map((option) => /* @__PURE__ */ jsxs(Radio, {
|
|
42
|
+
value: option.value,
|
|
43
|
+
className: clsx("relative", radioIndicatorClass),
|
|
44
|
+
children: [/* @__PURE__ */ jsx("div", { className: radioCva({
|
|
45
|
+
variant,
|
|
46
|
+
...rest
|
|
47
|
+
}) }), /* @__PURE__ */ jsx(CheckContent, {
|
|
48
|
+
typography: radioTypographyMap({
|
|
49
|
+
variant,
|
|
50
|
+
...rest
|
|
51
|
+
}),
|
|
52
|
+
className: labelClassName,
|
|
53
|
+
children: option.label
|
|
54
|
+
})]
|
|
55
|
+
}, option.value))
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
});
|
|
310
59
|
};
|
|
311
60
|
var RadioGroup$1 = (props) => {
|
|
312
|
-
const $ = c(15);
|
|
313
61
|
if ("formControl" in props && props.formControl) {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
({
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
t0 = (t1) => {
|
|
331
|
-
const { field, fieldState: t2 } = t1;
|
|
332
|
-
const { error, isDirty } = t2;
|
|
333
|
-
return /* @__PURE__ */ jsx(RadioGroupBase, {
|
|
334
|
-
...innerProps,
|
|
335
|
-
ref: mergeRefs(ref, field.ref),
|
|
336
|
-
value: field.value,
|
|
337
|
-
onChange: field.onChange,
|
|
338
|
-
onBlur: field.onBlur,
|
|
339
|
-
name: field.name,
|
|
340
|
-
isDirty,
|
|
341
|
-
isDisabled: field.disabled || props.isDisabled,
|
|
342
|
-
error: props.error ?? error?.message
|
|
343
|
-
});
|
|
344
|
-
};
|
|
345
|
-
$[4] = innerProps;
|
|
346
|
-
$[5] = props.error;
|
|
347
|
-
$[6] = props.isDisabled;
|
|
348
|
-
$[7] = ref;
|
|
349
|
-
$[8] = t0;
|
|
350
|
-
} else t0 = $[8];
|
|
351
|
-
let t1;
|
|
352
|
-
if ($[9] !== formControl.control || $[10] !== formControl.name || $[11] !== t0) {
|
|
353
|
-
t1 = /* @__PURE__ */ jsx(Controller, {
|
|
354
|
-
control: formControl.control,
|
|
355
|
-
name: formControl.name,
|
|
356
|
-
render: t0
|
|
357
|
-
});
|
|
358
|
-
$[9] = formControl.control;
|
|
359
|
-
$[10] = formControl.name;
|
|
360
|
-
$[11] = t0;
|
|
361
|
-
$[12] = t1;
|
|
362
|
-
} else t1 = $[12];
|
|
363
|
-
return t1;
|
|
62
|
+
const { formControl, ref, ...innerProps } = props;
|
|
63
|
+
return /* @__PURE__ */ jsx(Controller, {
|
|
64
|
+
control: formControl.control,
|
|
65
|
+
name: formControl.name,
|
|
66
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(RadioGroupBase, {
|
|
67
|
+
...innerProps,
|
|
68
|
+
ref: mergeRefs(ref, field.ref),
|
|
69
|
+
value: field.value,
|
|
70
|
+
onChange: field.onChange,
|
|
71
|
+
onBlur: field.onBlur,
|
|
72
|
+
name: field.name,
|
|
73
|
+
isDirty,
|
|
74
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
75
|
+
error: props.error ?? error?.message
|
|
76
|
+
})
|
|
77
|
+
});
|
|
364
78
|
}
|
|
365
|
-
|
|
366
|
-
if ($[13] !== props) {
|
|
367
|
-
t0 = /* @__PURE__ */ jsx(RadioGroupBase, { ...props });
|
|
368
|
-
$[13] = props;
|
|
369
|
-
$[14] = t0;
|
|
370
|
-
} else t0 = $[14];
|
|
371
|
-
return t0;
|
|
79
|
+
return /* @__PURE__ */ jsx(RadioGroupBase, { ...props });
|
|
372
80
|
};
|
|
373
81
|
//#endregion
|
|
374
82
|
export { RadioGroup$1 as RadioGroup };
|
|
@@ -5,24 +5,7 @@ export declare const radio: (props?: ({
|
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
export interface RadioVariantProps extends VariantProps<typeof radio> {
|
|
7
7
|
}
|
|
8
|
-
export declare const radioContentWrapper: (props?: ({
|
|
9
|
-
variant?: "default" | null | undefined;
|
|
10
|
-
as?: "filter" | "default" | "floating" | "inline" | null | undefined;
|
|
11
|
-
hasInputFrame?: boolean | null | undefined;
|
|
12
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
13
|
-
export interface RadioContentWrapperVariantProps extends VariantProps<typeof radioContentWrapper> {
|
|
14
|
-
}
|
|
15
|
-
export declare const radioContentRow: (props?: ({
|
|
16
|
-
variant?: "default" | null | undefined;
|
|
17
|
-
as?: "filter" | "default" | "floating" | "inline" | null | undefined;
|
|
18
|
-
hasInputFrame?: boolean | null | undefined;
|
|
19
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
20
|
-
export interface RadioContentRowVariantProps extends VariantProps<typeof radioContentRow> {
|
|
21
|
-
}
|
|
22
8
|
export declare const radioIndicatorClass = "group flex items-center gap-2";
|
|
23
9
|
export declare const radioTypography: (props: {
|
|
24
10
|
variant?: "default" | null | undefined;
|
|
25
11
|
}) => TypographyVariantProps | undefined;
|
|
26
|
-
export declare const radioContentClassName: (props: {
|
|
27
|
-
variant?: "default" | null | undefined;
|
|
28
|
-
}) => string | undefined;
|
|
@@ -25,52 +25,11 @@ var radio = cva([
|
|
|
25
25
|
] } },
|
|
26
26
|
defaultVariants: { variant: "default" }
|
|
27
27
|
});
|
|
28
|
-
var radioContentWrapper = cva("relative flex", {
|
|
29
|
-
variants: {
|
|
30
|
-
variant: { default: "" },
|
|
31
|
-
as: {
|
|
32
|
-
default: "flex-col",
|
|
33
|
-
floating: "flex-col",
|
|
34
|
-
filter: "flex-row flex-wrap items-center gap-2",
|
|
35
|
-
inline: "flex-row flex-wrap items-center gap-2"
|
|
36
|
-
},
|
|
37
|
-
hasInputFrame: {
|
|
38
|
-
true: "gap-2",
|
|
39
|
-
false: ""
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
defaultVariants: {
|
|
43
|
-
variant: "default",
|
|
44
|
-
as: "default",
|
|
45
|
-
hasInputFrame: false
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
var radioContentRow = cva("flex", {
|
|
49
|
-
variants: {
|
|
50
|
-
variant: { default: "" },
|
|
51
|
-
as: {
|
|
52
|
-
default: "flex-col",
|
|
53
|
-
floating: "flex-col",
|
|
54
|
-
filter: "flex-row flex-wrap items-center gap-2",
|
|
55
|
-
inline: "flex-row flex-wrap items-center gap-2"
|
|
56
|
-
},
|
|
57
|
-
hasInputFrame: {
|
|
58
|
-
true: "gap-2",
|
|
59
|
-
false: ""
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
defaultVariants: {
|
|
63
|
-
variant: "default",
|
|
64
|
-
as: "default",
|
|
65
|
-
hasInputFrame: false
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
28
|
var radioIndicatorClass = "group flex items-center gap-2";
|
|
69
29
|
var radioTypography = compoundMapper({ default: {
|
|
70
30
|
size: "label-1",
|
|
71
31
|
sizeMobile: "label-1",
|
|
72
32
|
variant: "default"
|
|
73
33
|
} });
|
|
74
|
-
var radioContentClassName = compoundMapper({ default: "text-text-default-2" });
|
|
75
34
|
//#endregion
|
|
76
|
-
export { radio,
|
|
35
|
+
export { radio, radioIndicatorClass, radioTypography };
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
1
|
import { Key } from 'react-aria-components';
|
|
3
2
|
import { FieldValues } from 'react-hook-form';
|
|
4
3
|
import { SelectBaseProps } from '../shared/SelectBase';
|
|
5
4
|
import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps } from '../shared/select.types';
|
|
6
5
|
import { OmitDiscriminatedUnion } from '../../../../types/common';
|
|
7
|
-
export type AutocompleteProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = OmitDiscriminatedUnion<SelectBaseProps<TKey, TInitialSelectItem>, "isSearchable"
|
|
8
|
-
renderStaticInput?: boolean;
|
|
9
|
-
};
|
|
6
|
+
export type AutocompleteProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = OmitDiscriminatedUnion<SelectBaseProps<TKey, TInitialSelectItem>, "isSearchable">;
|
|
10
7
|
export type ControlledAutocompleteProps<TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = Omit<AutocompleteProps<TKey, TInitialSelectItem>, keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TKey, TInitialSelectItem>;
|
|
11
|
-
export declare
|
|
12
|
-
export declare function Autocomplete<TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: ControlledAutocompleteProps<TFieldValues, TKey, TInitialSelectItem>): ReactElement;
|
|
8
|
+
export declare const Autocomplete: <TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: ControlledAutocompleteProps<TFieldValues, TKey, TInitialSelectItem>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,33 +1,23 @@
|
|
|
1
|
-
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
2
|
-
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
3
|
-
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
4
|
-
import { selectInputTagsContentWrapperCva } from "../shared/selectInput.cva.js";
|
|
5
1
|
import { SelectBase } from "../shared/SelectBase.js";
|
|
6
|
-
import {
|
|
7
|
-
import { getStaticSelectValue } from "../shared/staticSelect.utils.js";
|
|
8
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { clsx } from "clsx";
|
|
10
|
-
import { useRef, useState } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
3
|
import { mergeRefs } from "@react-aria/utils";
|
|
12
|
-
import { Controller
|
|
4
|
+
import { Controller } from "react-hook-form";
|
|
13
5
|
//#region src/components/inputs/Selection/Autocomplete/Autocomplete.tsx
|
|
14
|
-
|
|
6
|
+
var Autocomplete = (props) => {
|
|
15
7
|
if ("formControl" in props && props.formControl) {
|
|
16
|
-
const {
|
|
8
|
+
const { formControl, ref, ...innerProps } = props;
|
|
17
9
|
return /* @__PURE__ */ jsx(Controller, {
|
|
18
10
|
control: formControl.control,
|
|
19
11
|
name: formControl.name,
|
|
20
|
-
render: ({ field, fieldState: { error
|
|
12
|
+
render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(SelectBase, {
|
|
21
13
|
...innerProps,
|
|
22
14
|
ref: mergeRefs(ref, field.ref),
|
|
23
15
|
value: field.value,
|
|
24
16
|
onChange: field.onChange,
|
|
25
17
|
onBlur: field.onBlur,
|
|
26
|
-
isDirty,
|
|
27
18
|
isDisabled: field.disabled || props.isDisabled,
|
|
28
19
|
error: props.error ?? error?.message,
|
|
29
|
-
isSearchable: true
|
|
30
|
-
ignoreInputValueFiltering
|
|
20
|
+
isSearchable: true
|
|
31
21
|
})
|
|
32
22
|
});
|
|
33
23
|
}
|
|
@@ -35,98 +25,6 @@ function _Autocomplete(props) {
|
|
|
35
25
|
...props,
|
|
36
26
|
isSearchable: true
|
|
37
27
|
});
|
|
38
|
-
}
|
|
39
|
-
function Autocomplete({ renderStaticInput, ...props }) {
|
|
40
|
-
const ui = UIConfig.useConfig();
|
|
41
|
-
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
42
|
-
const rootRef = useRef(null);
|
|
43
|
-
const { renderRealInput, replayStaticInputChange } = useStaticInputHandoff({
|
|
44
|
-
inputRef: rootRef,
|
|
45
|
-
renderInput,
|
|
46
|
-
setRenderInput,
|
|
47
|
-
getFocusTarget: (root) => root.querySelector("input, [data-type='select-trigger'], button, [tabindex]")
|
|
48
|
-
});
|
|
49
|
-
const currentValue = ("formControl" in props && props.formControl ? useWatch({
|
|
50
|
-
control: props.formControl.control,
|
|
51
|
-
name: props.formControl.name
|
|
52
|
-
}) : props.value) ?? props.value;
|
|
53
|
-
let isFormControlDisabled = false;
|
|
54
|
-
if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
|
|
55
|
-
if (!renderInput && !!props.customTrigger) setRenderInput(true);
|
|
56
|
-
if (!renderInput) {
|
|
57
|
-
const as = props.as ?? ui.input.as;
|
|
58
|
-
const size = props.size ?? ui.input.size;
|
|
59
|
-
let isDisabled = !!props.isDisabled;
|
|
60
|
-
if (isFormControlDisabled) isDisabled = true;
|
|
61
|
-
const mode = props.selectionMode ?? ui.select.selectionMode;
|
|
62
|
-
const { selectedItem, displayValue, isEmpty } = getStaticSelectValue({
|
|
63
|
-
items: props.items,
|
|
64
|
-
value: currentValue,
|
|
65
|
-
selectionMode: mode,
|
|
66
|
-
initialSelection: props.initialSelection,
|
|
67
|
-
mapInitialToSelectItem: props.mapInitialToSelectItem,
|
|
68
|
-
showSelectionContent: props.showSelectionContent,
|
|
69
|
-
isDisabled,
|
|
70
|
-
collapseAfter: props.collapseAfter ?? ui.select.collapseAfter,
|
|
71
|
-
selectedTagsType: props.selectedTagsType ?? ui.select.selectedTagsType
|
|
72
|
-
});
|
|
73
|
-
const isMultiple = mode === "multiple";
|
|
74
|
-
const trailingContent = /* @__PURE__ */ jsx(StaticSelectTrailingContent, {
|
|
75
|
-
trailingContent: props.trailingContent,
|
|
76
|
-
hideDropdownIcon: props.hideDropdownIcon,
|
|
77
|
-
isDisabled,
|
|
78
|
-
size
|
|
79
|
-
});
|
|
80
|
-
const placeholder = as === "floating" ? null : props.placeholder;
|
|
81
|
-
const shouldRenderPlaceholderAfterValue = mode !== "single" && props.placeholder && !isEmpty;
|
|
82
|
-
const inputValue = !isMultiple && selectedItem ? selectedItem.label : "";
|
|
83
|
-
const dataAttributes = {
|
|
84
|
-
dataIsEmpty: isEmpty,
|
|
85
|
-
dataIsFilled: !isEmpty,
|
|
86
|
-
dataIsDirty: props.isDirty,
|
|
87
|
-
dataIsRequired: props.isRequired,
|
|
88
|
-
dataIsDisabled: isDisabled,
|
|
89
|
-
dataDisabled: isDisabled,
|
|
90
|
-
dataInvalid: !!props.error,
|
|
91
|
-
dataHasSelection: !isEmpty,
|
|
92
|
-
dataHasSearch: false
|
|
93
|
-
};
|
|
94
|
-
return /* @__PURE__ */ jsx(InputFrame, {
|
|
95
|
-
...props,
|
|
96
|
-
isDisabled,
|
|
97
|
-
className: clsx("w-full", props.containerClassName),
|
|
98
|
-
inputClassName: clsx(props.className, props.inputClassName),
|
|
99
|
-
contentWrapperClassName: selectInputTagsContentWrapperCva({ isSearchable: true }),
|
|
100
|
-
labelPlacement: "content-row",
|
|
101
|
-
dataAttributes,
|
|
102
|
-
renderStatic: true,
|
|
103
|
-
onStaticInteract: renderRealInput,
|
|
104
|
-
wrapTrailingContent: false,
|
|
105
|
-
leadingContent: props.leadingContent && /* @__PURE__ */ jsx("div", {
|
|
106
|
-
className: "ml-input-side-default flex shrink-0 items-center",
|
|
107
|
-
children: props.leadingContent
|
|
108
|
-
}),
|
|
109
|
-
trailingContent,
|
|
110
|
-
children: (dataAttributeProps) => /* @__PURE__ */ jsxs(Fragment, { children: [isMultiple && !isEmpty && displayValue, /* @__PURE__ */ jsx("input", {
|
|
111
|
-
disabled: isDisabled,
|
|
112
|
-
tabIndex: -1,
|
|
113
|
-
role: "combobox",
|
|
114
|
-
"aria-autocomplete": "list",
|
|
115
|
-
"aria-controls": `${dataAttributeProps.id}-listbox`,
|
|
116
|
-
"aria-expanded": false,
|
|
117
|
-
value: inputValue,
|
|
118
|
-
placeholder: isMultiple && shouldRenderPlaceholderAfterValue ? props.placeholder : placeholder ?? void 0,
|
|
119
|
-
className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", props.inputClassName),
|
|
120
|
-
onChange: (event) => replayStaticInputChange(event.target.value),
|
|
121
|
-
...dataAttributeProps,
|
|
122
|
-
"data-rac": true
|
|
123
|
-
})] })
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
return /* @__PURE__ */ jsx(_Autocomplete, {
|
|
127
|
-
...props,
|
|
128
|
-
ref: mergeRefs(props.ref, rootRef)
|
|
129
|
-
});
|
|
130
|
-
}
|
|
28
|
+
};
|
|
131
29
|
//#endregion
|
|
132
30
|
export { Autocomplete };
|