@povio/ui 2.2.12 → 2.3.0-rc.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/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +2 -2
- package/dist/components/inputs/Checkbox/Checkbox.js +6 -1
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +10 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +89 -9
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +10 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +95 -7
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +11 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +95 -9
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +5 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +77 -7
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +23 -6
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +3 -3
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +6 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +78 -61
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +14 -0
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +19 -6
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +11 -4
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +4 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +7 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +13 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +6 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +21 -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 +35 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +80 -0
- package/dist/components/inputs/File/FileUpload.js +1 -0
- package/dist/components/inputs/File/shared/InputUploadContent.js +1 -0
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +3 -1
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +6 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +11 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +81 -7
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +146 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +235 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +4 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +82 -7
- package/dist/components/inputs/Input/shared/InputContent.js +7 -6
- 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/InputItem.d.ts +16 -21
- package/dist/components/inputs/Inputs/InputItem.js +6 -0
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +2 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +106 -25
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +17 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +42 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +102 -7
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +33 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +36 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +42 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +115 -5
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +11 -3
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +27 -4
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +3 -3
- 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/querySelect.utils.d.ts +6 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +13 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +27 -4
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +3 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- 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/Skeleton/InputFrame.d.ts +77 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +200 -0
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +8 -3
- package/dist/components/inputs/Toggle/Toggle.js +6 -1
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +3 -4
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +13 -1
- package/dist/components/inputs/shared/StaticInput.d.ts +38 -0
- package/dist/components/inputs/shared/TooltipWrapper.js +5 -1
- package/dist/components/inputs/shared/input.cva.d.ts +10 -0
- package/dist/components/inputs/shared/input.cva.js +19 -1
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +4 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +13 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +47 -0
- package/dist/config/router.context.d.ts +3 -4
- package/dist/config/router.context.js +1 -3
- package/dist/config/uiConfig.context.d.ts +15 -3
- package/dist/config/uiConfig.context.js +16 -3
- package/dist/config/uiStyle.context.d.ts +27 -4
- package/dist/helpers/dynamicInputs.d.ts +5 -5
- package/dist/helpers/dynamicInputs.js +3 -0
- package/dist/hooks/useFilters.js +27 -23
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +27 -14
- package/dist/hooks/usePagination.js +8 -4
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +56 -0
- package/dist/hooks/useSorting.js +7 -4
- package/dist/index.d.ts +7 -0
- package/dist/index.js +5 -3
- package/dist/tw-ui-plugin.js +2 -0
- package/dist/utils/date-time.utils.d.ts +31 -10
- package/dist/utils/date-time.utils.js +123 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/dist/utils/routing.utils.d.ts +1 -0
- package/dist/utils/routing.utils.js +14 -0
- package/package.json +2 -2
|
@@ -13,9 +13,11 @@ interface TextInputBaseProps extends FormFieldProps, InputVariantProps, Omit<Inp
|
|
|
13
13
|
type?: AllowedHTMLInputTypeAttribute;
|
|
14
14
|
todayIcon?: boolean;
|
|
15
15
|
isDirty?: boolean;
|
|
16
|
+
autoFocusOnMount?: boolean;
|
|
16
17
|
}
|
|
17
18
|
export interface TextInputProps extends TextInputBaseProps {
|
|
19
|
+
renderStaticInput?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export type ControlledTextInputProps<TFieldValues extends FieldValues> = ControlProps<TextInputProps, TFieldValues>;
|
|
20
|
-
export declare const TextInput: <TFieldValues extends FieldValues>(props: ControlledTextInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const TextInput: <TFieldValues extends FieldValues>({ renderStaticInput, ...props }: ControlledTextInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export {};
|
|
@@ -3,20 +3,22 @@ import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
|
3
3
|
import { inputBase } from "../../shared/input.cva.js";
|
|
4
4
|
import { FormField } from "../../FormField/FormField.js";
|
|
5
5
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
6
|
+
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
7
|
+
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
6
8
|
import { InputContent } from "../shared/InputContent.js";
|
|
7
9
|
import { jsx } from "react/jsx-runtime";
|
|
8
10
|
import { clsx } from "clsx";
|
|
9
|
-
import { useRef } from "react";
|
|
11
|
+
import { useEffect, useRef, useState } from "react";
|
|
10
12
|
import { Input } from "react-aria-components";
|
|
11
13
|
import { useFocusVisible, useTextField } from "react-aria";
|
|
12
14
|
import { mergeRefs } from "@react-aria/utils";
|
|
13
|
-
import { Controller } from "react-hook-form";
|
|
15
|
+
import { Controller, useWatch } from "react-hook-form";
|
|
14
16
|
//#region src/components/inputs/Input/TextInput/TextInput.tsx
|
|
15
17
|
var TextInputBase = (props) => {
|
|
16
18
|
const ui = UIConfig.useConfig();
|
|
17
19
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
18
20
|
const inputRef = useRef(null);
|
|
19
|
-
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, ...rest } = props;
|
|
21
|
+
const { ref, inputClassName, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, className, unit, isLoading, action, leadingIcon, trailingIcon, value, onChange, onBlur, as = ui.input.as, hideLabel = ui.input.hideLabel, variant = ui.input.variant, size = ui.input.size, isClearable = ui.input.isClearable, autoFocusOnMount, ...rest } = props;
|
|
20
22
|
const textFieldRef = useRef(null);
|
|
21
23
|
const { isFocusVisible } = useFocusVisible();
|
|
22
24
|
const { labelProps, inputProps } = useTextField({
|
|
@@ -29,6 +31,10 @@ var TextInputBase = (props) => {
|
|
|
29
31
|
onChange,
|
|
30
32
|
onBlur
|
|
31
33
|
}, textFieldRef);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!autoFocusOnMount || isDisabled) return;
|
|
36
|
+
requestAnimationFrame(() => inputRef.current?.focus());
|
|
37
|
+
}, [autoFocusOnMount, isDisabled]);
|
|
32
38
|
const formFieldProps = {
|
|
33
39
|
error,
|
|
34
40
|
label,
|
|
@@ -75,6 +81,8 @@ var TextInputBase = (props) => {
|
|
|
75
81
|
labelProps,
|
|
76
82
|
className: clsx("group w-full", as === "inline" && "h-full", className),
|
|
77
83
|
tabIndex: as === "inline" ? -1 : void 0,
|
|
84
|
+
"data-is-empty": value === "" || value === null || value === void 0 || void 0,
|
|
85
|
+
"data-is-required": isRequired || void 0,
|
|
78
86
|
children: /* @__PURE__ */ jsx("div", {
|
|
79
87
|
className: clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
80
88
|
variant,
|
|
@@ -82,6 +90,8 @@ var TextInputBase = (props) => {
|
|
|
82
90
|
...rest
|
|
83
91
|
}), inputClassName),
|
|
84
92
|
onClick: () => inputRef.current?.focus(),
|
|
93
|
+
"data-is-empty": value === "" || value === null || value === void 0 || void 0,
|
|
94
|
+
"data-is-required": isRequired || void 0,
|
|
85
95
|
children: /* @__PURE__ */ jsx(InputContent, {
|
|
86
96
|
...inputContentProps,
|
|
87
97
|
headerProps,
|
|
@@ -91,6 +101,7 @@ var TextInputBase = (props) => {
|
|
|
91
101
|
...inputProps,
|
|
92
102
|
ref: mergeRefs(ref, inputRef),
|
|
93
103
|
"data-is-empty": value === "" || value === null || value === void 0 || void 0,
|
|
104
|
+
"data-is-filled": !(value === "" || value === null || value === void 0) || void 0,
|
|
94
105
|
"data-is-dirty": isDirty || void 0,
|
|
95
106
|
"data-is-required": isRequired || void 0,
|
|
96
107
|
"data-is-disabled": isDisabled || void 0,
|
|
@@ -106,7 +117,66 @@ var TextInputBase = (props) => {
|
|
|
106
117
|
})
|
|
107
118
|
});
|
|
108
119
|
};
|
|
109
|
-
var TextInput = (props) => {
|
|
120
|
+
var TextInput = ({ renderStaticInput, ...props }) => {
|
|
121
|
+
const ui = UIConfig.useConfig();
|
|
122
|
+
const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
|
|
123
|
+
const inputRef = useRef(null);
|
|
124
|
+
const { shouldFocus, renderRealInput, replayStaticInputChange } = useStaticInputHandoff({
|
|
125
|
+
inputRef,
|
|
126
|
+
renderInput,
|
|
127
|
+
setRenderInput
|
|
128
|
+
});
|
|
129
|
+
const watchedValue = "formControl" in props && props.formControl ? useWatch({
|
|
130
|
+
control: props.formControl.control,
|
|
131
|
+
name: props.formControl.name
|
|
132
|
+
}) : props.value;
|
|
133
|
+
let isFormControlDisabled = false;
|
|
134
|
+
if ("formControl" in props && props.formControl) isFormControlDisabled = !!props.formControl.control._options?.disabled;
|
|
135
|
+
const staticValue = watchedValue ?? props.value ?? props.defaultValue ?? "";
|
|
136
|
+
const inputType = props.type;
|
|
137
|
+
if (!renderInput && inputType === "password" && `${staticValue}`.length > 0) setRenderInput(true);
|
|
138
|
+
if (!renderInput) {
|
|
139
|
+
const as = props.as ?? ui.input.as;
|
|
140
|
+
let isDisabled = !!props.isDisabled;
|
|
141
|
+
if (isFormControlDisabled) isDisabled = true;
|
|
142
|
+
const maskedPasswordValue = inputType === "password" && `${staticValue}`.length > 0 ? "•".repeat(`${staticValue}`.length) : staticValue;
|
|
143
|
+
const displayValue = maskedPasswordValue == null ? "" : `${maskedPasswordValue}`;
|
|
144
|
+
const hasValue = displayValue !== "";
|
|
145
|
+
const dataAttributes = {
|
|
146
|
+
dataIsEmpty: !hasValue,
|
|
147
|
+
dataIsFilled: hasValue,
|
|
148
|
+
dataIsDirty: props.isDirty,
|
|
149
|
+
dataIsRequired: props.isRequired,
|
|
150
|
+
dataIsDisabled: isDisabled,
|
|
151
|
+
dataDisabled: isDisabled,
|
|
152
|
+
dataInvalid: !!props.error,
|
|
153
|
+
dataHasSelection: hasValue
|
|
154
|
+
};
|
|
155
|
+
return /* @__PURE__ */ jsx(InputFrame, {
|
|
156
|
+
...props,
|
|
157
|
+
isDisabled,
|
|
158
|
+
className: clsx("group w-full", as === "inline" && "h-full", props.className),
|
|
159
|
+
dataAttributes,
|
|
160
|
+
renderStatic: true,
|
|
161
|
+
onStaticInteract: renderRealInput,
|
|
162
|
+
inputClassName: props.inputClassName,
|
|
163
|
+
contentClassName: "pr-0!",
|
|
164
|
+
trailingClassName: "py-0! pl-0!",
|
|
165
|
+
wrapContentAndTrailing: true,
|
|
166
|
+
children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
|
|
167
|
+
ref: inputRef,
|
|
168
|
+
type: inputType === "hidden" ? "password" : inputType,
|
|
169
|
+
disabled: isDisabled,
|
|
170
|
+
tabIndex: -1,
|
|
171
|
+
value: displayValue,
|
|
172
|
+
placeholder: as === "floating" ? "" : props.placeholder,
|
|
173
|
+
className: "w-full bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled",
|
|
174
|
+
onChange: (event) => replayStaticInputChange(event.target.value),
|
|
175
|
+
...dataAttributeProps,
|
|
176
|
+
"data-rac": true
|
|
177
|
+
})
|
|
178
|
+
});
|
|
179
|
+
}
|
|
110
180
|
if ("formControl" in props && props.formControl) {
|
|
111
181
|
const { formControl, ref, ...innerProps } = props;
|
|
112
182
|
return /* @__PURE__ */ jsx(Controller, {
|
|
@@ -114,17 +184,22 @@ var TextInput = (props) => {
|
|
|
114
184
|
name: formControl.name,
|
|
115
185
|
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(TextInputBase, {
|
|
116
186
|
...innerProps,
|
|
117
|
-
ref: mergeRefs(ref, field.ref),
|
|
187
|
+
ref: mergeRefs(ref, field.ref, inputRef),
|
|
118
188
|
value: field.value,
|
|
119
189
|
onChange: field.onChange,
|
|
120
190
|
onBlur: field.onBlur,
|
|
121
191
|
isDirty,
|
|
122
192
|
isDisabled: field.disabled || props.isDisabled,
|
|
123
|
-
error: props.error ?? error?.message
|
|
193
|
+
error: props.error ?? error?.message,
|
|
194
|
+
autoFocusOnMount: shouldFocus
|
|
124
195
|
})
|
|
125
196
|
});
|
|
126
197
|
}
|
|
127
|
-
return /* @__PURE__ */ jsx(TextInputBase, {
|
|
198
|
+
return /* @__PURE__ */ jsx(TextInputBase, {
|
|
199
|
+
...props,
|
|
200
|
+
ref: mergeRefs(props.ref, inputRef),
|
|
201
|
+
autoFocusOnMount: shouldFocus
|
|
202
|
+
});
|
|
128
203
|
};
|
|
129
204
|
//#endregion
|
|
130
205
|
export { TextInput };
|
|
@@ -4,7 +4,7 @@ import { Loader } from "../../../status/Loader/Loader.js";
|
|
|
4
4
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
5
5
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
6
6
|
import { InputClear } from "../../shared/InputClear.js";
|
|
7
|
-
import { inputSize } from "../../shared/input.cva.js";
|
|
7
|
+
import { inputContentWrapper, inputSize } from "../../shared/input.cva.js";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { clsx } from "clsx";
|
|
10
10
|
import { isValidElement } from "react";
|
|
@@ -12,21 +12,22 @@ import { isValidElement } from "react";
|
|
|
12
12
|
var InputContent = ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit, isLoading, isDisabled, action, isClearable, value, onChange, onBlur, children, headerProps, as, size }) => {
|
|
13
13
|
const typographyCva = UIStyle.useCva("typography.cva", typography);
|
|
14
14
|
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
15
|
+
const inputContentWrapperCva = UIStyle.useCva("input.contentWrapperCva", inputContentWrapper);
|
|
15
16
|
const isLeadingIconElement = LeadingIcon && isValidElement(LeadingIcon);
|
|
16
17
|
const isTrailingIconElement = TrailingIcon && isValidElement(TrailingIcon);
|
|
17
18
|
const showClear = value != null && value !== "" && !isDisabled;
|
|
18
19
|
return /* @__PURE__ */ jsxs("div", {
|
|
19
20
|
className: "flex w-full items-center gap-input-gap-input-text-to-elements",
|
|
20
21
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
21
|
-
className: clsx(inputSizeCva({
|
|
22
|
+
className: clsx("group/input-content flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", as === "inline" && "h-full", inputSizeCva({
|
|
22
23
|
size,
|
|
23
24
|
as
|
|
24
|
-
})
|
|
25
|
+
})),
|
|
25
26
|
children: [LeadingIcon && /* @__PURE__ */ jsx("div", {
|
|
26
27
|
className: clsx(!isLeadingIconElement && "pointer-events-none"),
|
|
27
28
|
children: isLeadingIconElement ? LeadingIcon : /* @__PURE__ */ jsx(LeadingIcon, { className: "size-6 text-interactive-text-secondary-idle" })
|
|
28
29
|
}), /* @__PURE__ */ jsxs("div", {
|
|
29
|
-
className:
|
|
30
|
+
className: inputContentWrapperCva({ as }),
|
|
30
31
|
children: [as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
31
32
|
as,
|
|
32
33
|
size,
|
|
@@ -34,10 +35,10 @@ var InputContent = ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit
|
|
|
34
35
|
}), children]
|
|
35
36
|
})]
|
|
36
37
|
}), /* @__PURE__ */ jsxs("div", {
|
|
37
|
-
className: clsx(inputSizeCva({
|
|
38
|
+
className: clsx("flex items-center gap-input-gap-trailing-elements py-0! pl-0!", inputSizeCva({
|
|
38
39
|
size,
|
|
39
40
|
as
|
|
40
|
-
}),
|
|
41
|
+
}), !isTrailingIconElement && !action && !(isClearable && showClear) && "pointer-events-none"),
|
|
41
42
|
children: [
|
|
42
43
|
isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
43
44
|
onClear: () => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getStaticNumberDisplayValue: (value: unknown, formatter: Intl.NumberFormat) => string | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/components/inputs/Input/shared/numberStatic.utils.ts
|
|
2
|
+
var getStaticNumberDisplayValue = (value, formatter) => {
|
|
3
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return null;
|
|
4
|
+
return formatter.format(value);
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { getStaticNumberDisplayValue };
|
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
import { ComponentProps, JSXElementConstructor, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { Control, UseFormReturn } from 'react-hook-form';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { Autocomplete } from '../Selection/Autocomplete/Autocomplete';
|
|
5
|
+
import { Select } from '../Selection/Select/Select';
|
|
4
6
|
import { HasRequiredProperty } from '../../../types/common';
|
|
5
7
|
declare const componentRegistry: {
|
|
6
8
|
readonly toggle: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Toggle/Toggle').ControlledToggleProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
readonly checkbox: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Checkbox/Checkbox').ControlledCheckboxProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
readonly numberInput: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Input/NumberInput/NumberInput').ControlledNumberInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
readonly numberInput: <TFieldValues extends import('react-hook-form').FieldValues>({ renderStaticInput, ...props }: import('../Input/NumberInput/NumberInput').ControlledNumberInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
readonly numberRangeInput: <TFieldValues extends import('react-hook-form').FieldValues>({ renderStaticInput, ...props }: import('../Input/NumberRangeInput/NumberRangeInput').ControlledNumberRangeInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
9
12
|
readonly slider: <TFieldValues extends import('react-hook-form').FieldValues, IsRange extends boolean = false>(props: import('../Slider/Slider').ControlledSliderProps<TFieldValues, IsRange>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
readonly textInput: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Input/TextInput/TextInput').ControlledTextInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
readonly textInput: <TFieldValues extends import('react-hook-form').FieldValues>({ renderStaticInput, ...props }: import('../Input/TextInput/TextInput').ControlledTextInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
11
14
|
readonly passwordInput: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Input/PasswordInput/PasswordInput').ControlledPasswordInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
12
15
|
readonly textArea: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../Input/TextArea/TextArea').ControlledTextAreaProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
readonly select:
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
|
|
17
|
-
} ? InferredKey : never>, "onChange" | "value" | "items" | "selectionMode" | "isLoading" | "showSelectionBar" | "showSelectAllOption" | "initialSelection" | "showSelectionContent" | "onSearchChange"> & (import('../Selection/shared/select.types').GroupedSelectControlProps<TFieldValues, Exclude<ReturnType<TQueryFn>["data"], undefined>[0] extends {
|
|
18
|
-
id: infer InferredKey extends import('react-aria').Key;
|
|
19
|
-
} ? InferredKey : never> & {
|
|
20
|
-
query: Parameters<TQueryFn>[0] extends {
|
|
21
|
-
search?: string;
|
|
22
|
-
} ? TQueryFn : never;
|
|
23
|
-
queryParams?: Omit<Parameters<TQueryFn>[0], "search"> | undefined;
|
|
24
|
-
queryOptions?: Parameters<TQueryFn>[1] | undefined;
|
|
25
|
-
})) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
readonly select: typeof Select;
|
|
17
|
+
readonly querySelect: <TFieldValues extends import('react-hook-form').FieldValues, TQueryFn extends import('../Selection/shared/querySelect.utils').QueryFn, TKey extends import('react-aria').Key = import('react-aria').Key>({ query, queryParams, queryOptions, queryMap, ...props }: import('../Selection/Select/QuerySelect.js').QuerySelectProps<TFieldValues, TQueryFn, TKey>) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
readonly autocomplete: typeof Autocomplete;
|
|
19
|
+
readonly queryAutocomplete: <TFieldValues extends import('react-hook-form').FieldValues, TSelectItem extends import('../../..').SelectItem<any>, TQueryFn extends import('../Selection/Autocomplete/queryAutocomplete.types').QueryFn>({ query, queryParams, queryOptions, queryMap, leadingContent, ...props }: import('../Selection/Autocomplete/queryAutocomplete.types').QueryAutocompleteProps<TFieldValues, TSelectItem, TQueryFn>) => import("react/jsx-runtime").JSX.Element;
|
|
26
20
|
readonly segment: <TFieldValues extends import('react-hook-form').FieldValues, TKey extends import('react-aria').Key = import('react-aria').Key>(props: import('../../..').ControlledSegmentProps<TFieldValues, TKey>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
-
readonly datePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, granularity, minValue, maxValue, ...props }: import('../DateTime/DatePicker/DatePicker').ControlledDatePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
readonly dateTimePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, ...props }: import('../DateTime/DateTimePicker/DateTimePicker').ControlledDateTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
readonly timePicker: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../DateTime/TimePicker/TimePicker').ControlledTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
readonly dateRangePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, minValue, maxValue, ...props }: import('../DateTime/DateRangePicker/DateRangePicker').ControlledDateRangePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
readonly datePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, granularity, minValue, maxValue, renderStaticInput, ...props }: import('../DateTime/DatePicker/DatePicker').ControlledDatePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
readonly dateTimePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, renderStaticInput, ...props }: import('../DateTime/DateTimePicker/DateTimePicker').ControlledDateTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
readonly timePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ renderStaticInput, ...props }: import('../DateTime/TimePicker/TimePicker').ControlledTimePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
readonly dateRangePicker: <TFieldValues extends import('react-hook-form').FieldValues>({ fullIso, minValue, maxValue, renderStaticInput, ...props }: import('../DateTime/DateRangePicker/DateRangePicker').ControlledDateRangePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
readonly textEditor: <TFieldValues extends import('react-hook-form').FieldValues>(props: import('../../../text-editor.js').ControlledTextEditorProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
31
26
|
readonly unknown: null;
|
|
32
27
|
};
|
|
33
28
|
export type InputComponentRegistry = typeof componentRegistry;
|
|
@@ -56,8 +51,8 @@ type TypeBasedInputDef<TSchemaType extends Record<string, any>, T extends InputC
|
|
|
56
51
|
interface RenderBasedInputDef<TSchemaType extends Record<string, any>, K extends keyof TSchemaType> {
|
|
57
52
|
type?: never;
|
|
58
53
|
name: K;
|
|
59
|
-
label?:
|
|
60
|
-
placeholder?:
|
|
54
|
+
label?: string;
|
|
55
|
+
placeholder?: string;
|
|
61
56
|
props?: never;
|
|
62
57
|
inputWrapper?: never;
|
|
63
58
|
render: (formControl: {
|
|
@@ -6,6 +6,7 @@ import { DateRangePicker } from "../DateTime/DateRangePicker/DateRangePicker.js"
|
|
|
6
6
|
import { DateTimePicker } from "../DateTime/DateTimePicker/DateTimePicker.js";
|
|
7
7
|
import { TimePicker } from "../DateTime/TimePicker/TimePicker.js";
|
|
8
8
|
import { NumberInput } from "../Input/NumberInput/NumberInput.js";
|
|
9
|
+
import { NumberRangeInput } from "../Input/NumberRangeInput/NumberRangeInput.js";
|
|
9
10
|
import { PasswordInput } from "../Input/PasswordInput/PasswordInput.js";
|
|
10
11
|
import { TextArea } from "../Input/TextArea/TextArea.js";
|
|
11
12
|
import { Autocomplete } from "../Selection/Autocomplete/Autocomplete.js";
|
|
@@ -13,17 +14,21 @@ import { QueryAutocomplete } from "../Selection/Autocomplete/QueryAutocomplete.j
|
|
|
13
14
|
import { Slider } from "../Slider/Slider.js";
|
|
14
15
|
import { Toggle } from "../Toggle/Toggle.js";
|
|
15
16
|
import { Segment } from "../../segment/Segment.js";
|
|
17
|
+
import { QuerySelect } from "../Selection/Select/QuerySelect.js";
|
|
18
|
+
import { TextEditor } from "../TextEditor/TextEditor.js";
|
|
16
19
|
import { jsx } from "react/jsx-runtime";
|
|
17
20
|
//#region src/components/inputs/Inputs/InputItem.tsx
|
|
18
21
|
var componentRegistry = {
|
|
19
22
|
toggle: Toggle,
|
|
20
23
|
checkbox: Checkbox,
|
|
21
24
|
numberInput: NumberInput,
|
|
25
|
+
numberRangeInput: NumberRangeInput,
|
|
22
26
|
slider: Slider,
|
|
23
27
|
textInput: TextInput,
|
|
24
28
|
passwordInput: PasswordInput,
|
|
25
29
|
textArea: TextArea,
|
|
26
30
|
select: Select,
|
|
31
|
+
querySelect: QuerySelect,
|
|
27
32
|
autocomplete: Autocomplete,
|
|
28
33
|
queryAutocomplete: QueryAutocomplete,
|
|
29
34
|
segment: Segment,
|
|
@@ -31,6 +36,7 @@ var componentRegistry = {
|
|
|
31
36
|
dateTimePicker: DateTimePicker,
|
|
32
37
|
timePicker: TimePicker,
|
|
33
38
|
dateRangePicker: DateRangePicker,
|
|
39
|
+
textEditor: TextEditor,
|
|
34
40
|
unknown: null
|
|
35
41
|
};
|
|
36
42
|
function InputItem({ form, inputDef }) {
|
|
@@ -4,7 +4,8 @@ import { FieldValues } from 'react-hook-form';
|
|
|
4
4
|
import { FormFieldProps } from '../FormField/FormField';
|
|
5
5
|
import { RadioVariantProps } from './radio.cva';
|
|
6
6
|
import { ControlProps } from '../shared/form.types';
|
|
7
|
-
|
|
7
|
+
import { InputVariantProps } from '../shared/input.cva';
|
|
8
|
+
interface RadioGroupBaseProps extends Omit<FormFieldProps, "variant">, RadioVariantProps, Omit<InputVariantProps, "variant">, Omit<AriaRadioGroupProps, "className"> {
|
|
8
9
|
ref?: Ref<HTMLDivElement>;
|
|
9
10
|
options: {
|
|
10
11
|
label: string | ReactElement;
|
|
@@ -1,19 +1,44 @@
|
|
|
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";
|
|
4
6
|
import { FormField } from "../FormField/FormField.js";
|
|
5
|
-
import {
|
|
7
|
+
import { TooltipWrapper } from "../shared/TooltipWrapper.js";
|
|
8
|
+
import { radio, radioContentClassName, radioContentRow, radioContentWrapper, radioIndicatorClass, radioTypography } from "./radio.cva.js";
|
|
6
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
10
|
import { clsx } from "clsx";
|
|
8
11
|
import { Radio, RadioGroup } from "react-aria-components";
|
|
12
|
+
import { useLabel } from "react-aria";
|
|
9
13
|
import { mergeRefs } from "@react-aria/utils";
|
|
10
14
|
import { Controller } from "react-hook-form";
|
|
11
15
|
//#region src/components/inputs/RadioGroup/RadioGroup.tsx
|
|
12
16
|
var RadioGroupBase = (props) => {
|
|
13
17
|
const ui = UIConfig.useConfig();
|
|
14
18
|
const radioCva = UIStyle.useCva("radio.cva", radio);
|
|
19
|
+
const radioContentWrapperCva = UIStyle.useCva("radio.contentWrapperCva", radioContentWrapper);
|
|
20
|
+
const radioContentRowCva = UIStyle.useCva("radio.contentRowCva", radioContentRow);
|
|
21
|
+
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
22
|
+
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
15
23
|
const radioTypographyMap = UIStyle.useMapper("radio.typography", radioTypography);
|
|
16
|
-
const
|
|
24
|
+
const radioContentClassNameMap = UIStyle.useMapper("radio.contentClassName", radioContentClassName);
|
|
25
|
+
const { ref, label, tooltipText, helperText, isDirty, isRequired, rightContent, isDisabled, headerClassName, errorClassName, labelClassName, inputClassName, isHeaderHidden, error, className, options, value, defaultValue, as: asProp, size: sizeProp, variant: variantProp, hideLabel: hideLabelProp, ...rest } = props;
|
|
26
|
+
const as = asProp ?? ui.input.as;
|
|
27
|
+
const size = sizeProp ?? ui.input.size;
|
|
28
|
+
const variant = variantProp ?? ui.radioGroup.variant;
|
|
29
|
+
const hideLabel = hideLabelProp ?? ui.radioGroup.hideLabel;
|
|
30
|
+
const radioClassName = radioCva({
|
|
31
|
+
variant,
|
|
32
|
+
...rest
|
|
33
|
+
});
|
|
34
|
+
const radioTypographyProps = radioTypographyMap({
|
|
35
|
+
variant,
|
|
36
|
+
...rest
|
|
37
|
+
});
|
|
38
|
+
const radioContentClassNameValue = radioContentClassNameMap({
|
|
39
|
+
variant,
|
|
40
|
+
...rest
|
|
41
|
+
});
|
|
17
42
|
const formFieldProps = {
|
|
18
43
|
className,
|
|
19
44
|
error,
|
|
@@ -22,37 +47,93 @@ var RadioGroupBase = (props) => {
|
|
|
22
47
|
helperText,
|
|
23
48
|
isRequired,
|
|
24
49
|
rightContent,
|
|
25
|
-
isHeaderHidden,
|
|
50
|
+
isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
|
|
26
51
|
hideLabel,
|
|
27
52
|
isDisabled,
|
|
28
53
|
headerClassName,
|
|
29
54
|
errorClassName
|
|
30
55
|
};
|
|
31
|
-
|
|
32
|
-
|
|
56
|
+
const { labelProps, fieldProps } = useLabel({ label });
|
|
57
|
+
const headerProps = {
|
|
58
|
+
label,
|
|
59
|
+
tooltipText,
|
|
60
|
+
helperText,
|
|
61
|
+
isRequired,
|
|
62
|
+
rightContent,
|
|
63
|
+
isHeaderHidden: hideLabel || isHeaderHidden,
|
|
33
64
|
isDisabled,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
65
|
+
className: headerClassName,
|
|
66
|
+
labelProps
|
|
67
|
+
};
|
|
68
|
+
const selectedValue = value ?? defaultValue;
|
|
69
|
+
const shouldRenderInputFrame = as !== "default";
|
|
70
|
+
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
71
|
+
as,
|
|
72
|
+
error,
|
|
73
|
+
triggerTabIndex: as === "inline" ? -1 : void 0,
|
|
74
|
+
children: /* @__PURE__ */ jsx(RadioGroup, {
|
|
75
|
+
...rest,
|
|
76
|
+
...fieldProps,
|
|
77
|
+
ref,
|
|
78
|
+
value,
|
|
79
|
+
defaultValue,
|
|
80
|
+
isDisabled,
|
|
81
|
+
isInvalid: !!error,
|
|
82
|
+
"data-is-dirty": isDirty || void 0,
|
|
83
|
+
"data-is-required": isRequired || void 0,
|
|
84
|
+
children: /* @__PURE__ */ jsx(FormField, {
|
|
85
|
+
...formFieldProps,
|
|
86
|
+
as,
|
|
87
|
+
labelProps,
|
|
88
|
+
className: clsx("w-full", as === "inline" && "h-full", className),
|
|
89
|
+
tabIndex: as === "inline" ? -1 : void 0,
|
|
90
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
91
|
+
className: clsx("group/radio-group-content relative", shouldRenderInputFrame && inputBaseCva({
|
|
92
|
+
variant: ui.input.variant,
|
|
93
|
+
as
|
|
94
|
+
}), inputClassName),
|
|
95
|
+
"data-rac": "",
|
|
96
|
+
"data-disabled": isDisabled || void 0,
|
|
97
|
+
"data-is-disabled": isDisabled || void 0,
|
|
98
|
+
"data-invalid": !!error || void 0,
|
|
99
|
+
"data-has-selection": selectedValue != null && selectedValue !== "" ? true : void 0,
|
|
100
|
+
"data-radio-group-content": "",
|
|
101
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
102
|
+
className: clsx(radioContentWrapperCva({
|
|
49
103
|
variant,
|
|
104
|
+
as,
|
|
105
|
+
hasInputFrame: shouldRenderInputFrame,
|
|
50
106
|
...rest
|
|
51
|
-
}),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
107
|
+
}), shouldRenderInputFrame && inputSizeCva({
|
|
108
|
+
as,
|
|
109
|
+
size
|
|
110
|
+
})),
|
|
111
|
+
"data-is-dirty": isDirty || void 0,
|
|
112
|
+
"data-is-required": isRequired || void 0,
|
|
113
|
+
children: [as && ["filter", "floating"].includes(as) && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
114
|
+
as,
|
|
115
|
+
size,
|
|
116
|
+
...headerProps
|
|
117
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
118
|
+
className: radioContentRowCva({
|
|
119
|
+
variant,
|
|
120
|
+
as,
|
|
121
|
+
hasInputFrame: shouldRenderInputFrame,
|
|
122
|
+
...rest
|
|
123
|
+
}),
|
|
124
|
+
children: options.map((option) => /* @__PURE__ */ jsxs(Radio, {
|
|
125
|
+
value: option.value,
|
|
126
|
+
className: clsx("relative", radioIndicatorClass),
|
|
127
|
+
children: [/* @__PURE__ */ jsx("div", { className: radioClassName }), /* @__PURE__ */ jsx(CheckContent, {
|
|
128
|
+
typography: radioTypographyProps,
|
|
129
|
+
contentClassName: radioContentClassNameValue,
|
|
130
|
+
className: labelClassName,
|
|
131
|
+
children: option.label
|
|
132
|
+
})]
|
|
133
|
+
}, option.value))
|
|
134
|
+
})]
|
|
135
|
+
})
|
|
136
|
+
})
|
|
56
137
|
})
|
|
57
138
|
})
|
|
58
139
|
});
|
|
@@ -5,7 +5,24 @@ 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
|
+
}
|
|
8
22
|
export declare const radioIndicatorClass = "group flex items-center gap-2";
|
|
9
23
|
export declare const radioTypography: (props: {
|
|
10
24
|
variant?: "default" | null | undefined;
|
|
11
25
|
}) => TypographyVariantProps | undefined;
|
|
26
|
+
export declare const radioContentClassName: (props: {
|
|
27
|
+
variant?: "default" | null | undefined;
|
|
28
|
+
}) => string | undefined;
|
|
@@ -25,11 +25,52 @@ 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
|
+
});
|
|
28
68
|
var radioIndicatorClass = "group flex items-center gap-2";
|
|
29
69
|
var radioTypography = compoundMapper({ default: {
|
|
30
70
|
size: "label-1",
|
|
31
71
|
sizeMobile: "label-1",
|
|
32
72
|
variant: "default"
|
|
33
73
|
} });
|
|
74
|
+
var radioContentClassName = compoundMapper({ default: "text-text-default-2" });
|
|
34
75
|
//#endregion
|
|
35
|
-
export { radio, radioIndicatorClass, radioTypography };
|
|
76
|
+
export { radio, radioContentClassName, radioContentRow, radioContentWrapper, radioIndicatorClass, radioTypography };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
1
2
|
import { Key } from 'react-aria-components';
|
|
2
3
|
import { FieldValues } from 'react-hook-form';
|
|
3
4
|
import { SelectBaseProps } from '../shared/SelectBase';
|
|
4
5
|
import { DefaultInitialSelectItem, GroupedSelectControlProps, GroupedSelectProps } from '../shared/select.types';
|
|
5
6
|
import { OmitDiscriminatedUnion } from '../../../../types/common';
|
|
6
|
-
export type AutocompleteProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = OmitDiscriminatedUnion<SelectBaseProps<TKey, TInitialSelectItem>, "isSearchable"
|
|
7
|
+
export type AutocompleteProps<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = OmitDiscriminatedUnion<SelectBaseProps<TKey, TInitialSelectItem>, "isSearchable"> & {
|
|
8
|
+
renderStaticInput?: boolean;
|
|
9
|
+
};
|
|
7
10
|
export type ControlledAutocompleteProps<TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>> = Omit<AutocompleteProps<TKey, TInitialSelectItem>, keyof GroupedSelectProps> & GroupedSelectControlProps<TFieldValues, TKey, TInitialSelectItem>;
|
|
8
|
-
export declare
|
|
11
|
+
export declare function Autocomplete<TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: AutocompleteProps<TKey, TInitialSelectItem>): ReactElement;
|
|
12
|
+
export declare function Autocomplete<TFieldValues extends FieldValues, TKey extends Key = Key, TInitialSelectItem = DefaultInitialSelectItem<TKey>>(props: ControlledAutocompleteProps<TFieldValues, TKey, TInitialSelectItem>): ReactElement;
|