@povio/ui 2.2.9-rc.23 → 2.2.9-rc.24
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/inputs/DateTime/shared/DatePickerInput.js +5 -4
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +1 -0
- package/dist/components/inputs/File/FileUpload.js +1 -0
- package/dist/components/inputs/File/shared/InputUploadContent.js +1 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +31 -31
- package/dist/components/inputs/Input/shared/InputContent.js +4 -4
- package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +1 -0
- package/package.json +1 -1
|
@@ -75,15 +75,16 @@ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, buttonP
|
|
|
75
75
|
const pickerIcon = isDateTime ? uiConfig.dateInput.dateTimeIcon : uiConfig.dateInput.calendarIcon;
|
|
76
76
|
return /* @__PURE__ */ jsxs("div", {
|
|
77
77
|
ref: containerRef,
|
|
78
|
-
className: clsx(inputBaseCva({
|
|
78
|
+
className: clsx("group/date-picker-content relative flex min-w-input-width-min-width items-center justify-between gap-2", inputBaseCva({
|
|
79
79
|
variant,
|
|
80
80
|
as,
|
|
81
81
|
...props
|
|
82
|
-
}),
|
|
82
|
+
}), className),
|
|
83
83
|
"data-rac": "",
|
|
84
84
|
"data-datetime-input": "",
|
|
85
85
|
"data-hovered": isHovered || void 0,
|
|
86
86
|
"data-disabled": isDisabled || void 0,
|
|
87
|
+
"data-is-disabled": isDisabled || void 0,
|
|
87
88
|
"data-invalid": isInvalid || void 0,
|
|
88
89
|
"data-is-empty": fieldProps.value === null || void 0,
|
|
89
90
|
"data-focus-within": isFocused || void 0,
|
|
@@ -96,10 +97,10 @@ var DatePickerInput = ({ ref, as, groupProps, fieldProps, endFieldProps, buttonP
|
|
|
96
97
|
...focusWithinProps,
|
|
97
98
|
...hoverProps,
|
|
98
99
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
99
|
-
className: clsx(inputSizeCva({
|
|
100
|
+
className: clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
|
|
100
101
|
size,
|
|
101
102
|
as
|
|
102
|
-
})
|
|
103
|
+
})),
|
|
103
104
|
children: [as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
104
105
|
as,
|
|
105
106
|
...headerProps
|
|
@@ -33,6 +33,7 @@ var TimePickerInput = ({ ref, as, fieldProps, state, isDisabled, isDirty, isRequ
|
|
|
33
33
|
"data-datetime-input": "",
|
|
34
34
|
"data-hovered": isHovered || void 0,
|
|
35
35
|
"data-disabled": isDisabled || void 0,
|
|
36
|
+
"data-is-disabled": isDisabled || void 0,
|
|
36
37
|
"data-invalid": isInvalid || void 0,
|
|
37
38
|
"data-is-empty": state.value === null || void 0,
|
|
38
39
|
"data-focus-within": isFocused || void 0,
|
|
@@ -128,6 +128,7 @@ var FileUploadBase = (props) => {
|
|
|
128
128
|
...rest,
|
|
129
129
|
"data-rac": "",
|
|
130
130
|
"data-disabled": isDisabled || void 0,
|
|
131
|
+
"data-is-disabled": isDisabled || void 0,
|
|
131
132
|
"data-invalid": !!error || void 0,
|
|
132
133
|
"data-multiple": allowsMultiple || void 0,
|
|
133
134
|
"data-has-files": uploadState.length > 0 || void 0,
|
|
@@ -21,6 +21,7 @@ var InputUploadContent = (props) => {
|
|
|
21
21
|
children: /* @__PURE__ */ jsxs("div", {
|
|
22
22
|
"data-rac": "",
|
|
23
23
|
"data-disabled": isDisabled || void 0,
|
|
24
|
+
"data-is-disabled": isDisabled || void 0,
|
|
24
25
|
"data-invalid": !!error || void 0,
|
|
25
26
|
className: inputUploadButton({
|
|
26
27
|
variant,
|
|
@@ -27,7 +27,7 @@ var normalizeRangeValue = (value, minValue, maxValue) => {
|
|
|
27
27
|
max: maxValue ?? null
|
|
28
28
|
};
|
|
29
29
|
};
|
|
30
|
-
var NumberRangeField = ({ label, value, placeholder, isDisabled, isInvalid, isRequired, formatOptions, hideInnerLabels, autoFocusOnMount, className, onChange, onBlur, ...rest }) => {
|
|
30
|
+
var NumberRangeField = ({ label, value, placeholder, isDisabled, isInvalid, isRequired, formatOptions, hideInnerLabels, autoFocusOnMount, isClearable, className, onChange, onClear, onBlur, ...rest }) => {
|
|
31
31
|
const ui = UIConfig.useConfig();
|
|
32
32
|
const { locale } = useLocale();
|
|
33
33
|
const { isFocusVisible } = useFocusVisible();
|
|
@@ -40,7 +40,7 @@ var NumberRangeField = ({ label, value, placeholder, isDisabled, isInvalid, isRe
|
|
|
40
40
|
const numberProps = {
|
|
41
41
|
...rest,
|
|
42
42
|
label,
|
|
43
|
-
value: value ??
|
|
43
|
+
value: value ?? NaN,
|
|
44
44
|
placeholder,
|
|
45
45
|
isDisabled,
|
|
46
46
|
isInvalid,
|
|
@@ -59,15 +59,21 @@ var NumberRangeField = ({ label, value, placeholder, isDisabled, isInvalid, isRe
|
|
|
59
59
|
isRequired,
|
|
60
60
|
isDisabled,
|
|
61
61
|
className: clsx(hideInnerLabels && "sr-only")
|
|
62
|
-
}), /* @__PURE__ */
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
63
|
+
className: "flex items-center gap-input-gap-trailing-elements",
|
|
64
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
65
|
+
...inputProps,
|
|
66
|
+
ref: mergeRefs(inputRef, numberFieldRef),
|
|
67
|
+
placeholder: inputProps.placeholder,
|
|
68
|
+
className: clsx("w-full min-w-0 bg-transparent outline-none", className),
|
|
69
|
+
onFocus: (e) => {
|
|
70
|
+
inputProps.onFocus?.(e);
|
|
71
|
+
if (isFocusVisible) e.target.select();
|
|
72
|
+
}
|
|
73
|
+
}), isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
74
|
+
onClear,
|
|
75
|
+
show: value !== null && !isDisabled
|
|
76
|
+
})]
|
|
71
77
|
})]
|
|
72
78
|
});
|
|
73
79
|
};
|
|
@@ -121,11 +127,8 @@ var NumberRangeInputBase = (props) => {
|
|
|
121
127
|
if (side === "min") onMinChange?.(nextValue);
|
|
122
128
|
else onMaxChange?.(nextValue);
|
|
123
129
|
};
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
onChange?.(nextRange);
|
|
127
|
-
onMinChange?.(null);
|
|
128
|
-
onMaxChange?.(null);
|
|
130
|
+
const clearRangeSide = (side) => {
|
|
131
|
+
updateRange(side, null);
|
|
129
132
|
onBlur?.({ target: { value: "" } });
|
|
130
133
|
};
|
|
131
134
|
return /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
@@ -138,7 +141,7 @@ var NumberRangeInputBase = (props) => {
|
|
|
138
141
|
as,
|
|
139
142
|
className: clsx("group w-full", className),
|
|
140
143
|
tabIndex: as === "inline" ? -1 : void 0,
|
|
141
|
-
children: /* @__PURE__ */
|
|
144
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
142
145
|
className: clsx(inputBaseCva({
|
|
143
146
|
variant,
|
|
144
147
|
as
|
|
@@ -146,6 +149,7 @@ var NumberRangeInputBase = (props) => {
|
|
|
146
149
|
"data-rac": "",
|
|
147
150
|
"data-hovered": isHovered || void 0,
|
|
148
151
|
"data-disabled": isDisabled || void 0,
|
|
152
|
+
"data-is-disabled": isDisabled || void 0,
|
|
149
153
|
"data-invalid": !!effectiveError || void 0,
|
|
150
154
|
"data-is-empty": isEmpty || void 0,
|
|
151
155
|
"data-focus-within": isFocused || void 0,
|
|
@@ -156,7 +160,7 @@ var NumberRangeInputBase = (props) => {
|
|
|
156
160
|
"data-is-filled": !isEmpty || void 0,
|
|
157
161
|
...focusWithinProps,
|
|
158
162
|
...hoverProps,
|
|
159
|
-
children:
|
|
163
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
160
164
|
className: clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
|
|
161
165
|
size,
|
|
162
166
|
as
|
|
@@ -180,6 +184,10 @@ var NumberRangeInputBase = (props) => {
|
|
|
180
184
|
isRequired,
|
|
181
185
|
hideInnerLabels,
|
|
182
186
|
autoFocusOnMount,
|
|
187
|
+
isClearable,
|
|
188
|
+
onClear: () => {
|
|
189
|
+
clearRangeSide("min");
|
|
190
|
+
},
|
|
183
191
|
className: minInputClassName
|
|
184
192
|
}),
|
|
185
193
|
/* @__PURE__ */ jsx("span", {
|
|
@@ -199,19 +207,14 @@ var NumberRangeInputBase = (props) => {
|
|
|
199
207
|
isInvalid: !!effectiveError,
|
|
200
208
|
isRequired,
|
|
201
209
|
hideInnerLabels,
|
|
210
|
+
isClearable,
|
|
211
|
+
onClear: () => {
|
|
212
|
+
clearRangeSide("max");
|
|
213
|
+
},
|
|
202
214
|
className: maxInputClassName
|
|
203
215
|
})
|
|
204
216
|
]
|
|
205
|
-
})
|
|
206
|
-
className: clsx("flex items-center gap-input-gap-trailing-elements py-0! pl-0!", inputSizeCva({
|
|
207
|
-
size,
|
|
208
|
-
as
|
|
209
|
-
})),
|
|
210
|
-
children: isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
211
|
-
onClear,
|
|
212
|
-
show: !isEmpty && !isDisabled
|
|
213
|
-
})
|
|
214
|
-
})]
|
|
217
|
+
})
|
|
215
218
|
})
|
|
216
219
|
})
|
|
217
220
|
});
|
|
@@ -258,7 +261,6 @@ var NumberRangeInput = ({ renderStaticInput, ...props }) => {
|
|
|
258
261
|
const size = props.size ?? ui.input.size;
|
|
259
262
|
const variant = props.variant ?? ui.input.variant;
|
|
260
263
|
const hideLabel = props.hideLabel ?? ui.input.hideLabel;
|
|
261
|
-
const isClearable = props.isClearable ?? ui.input.isClearable;
|
|
262
264
|
const isHeaderHidden = props.isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
|
|
263
265
|
let isDisabled = !!props.isDisabled;
|
|
264
266
|
if (isFormControlDisabled) isDisabled = true;
|
|
@@ -278,8 +280,6 @@ var NumberRangeInput = ({ renderStaticInput, ...props }) => {
|
|
|
278
280
|
className: clsx("group w-full", as === "inline" && "h-full", props.className),
|
|
279
281
|
inputClassName: props.inputClassName,
|
|
280
282
|
displayValue,
|
|
281
|
-
isEmpty: !hasValue,
|
|
282
|
-
hasClearIcon: !props.isDisabled && isClearable,
|
|
283
283
|
dataAttributes: {
|
|
284
284
|
dataIsEmpty: !hasValue,
|
|
285
285
|
dataIsFilled: hasValue,
|
|
@@ -18,10 +18,10 @@ var InputContent = ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit
|
|
|
18
18
|
return /* @__PURE__ */ jsxs("div", {
|
|
19
19
|
className: "flex w-full items-center gap-input-gap-input-text-to-elements",
|
|
20
20
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
21
|
-
className: clsx(inputSizeCva({
|
|
21
|
+
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
22
|
size,
|
|
23
23
|
as
|
|
24
|
-
})
|
|
24
|
+
})),
|
|
25
25
|
children: [LeadingIcon && /* @__PURE__ */ jsx("div", {
|
|
26
26
|
className: clsx(!isLeadingIconElement && "pointer-events-none"),
|
|
27
27
|
children: isLeadingIconElement ? LeadingIcon : /* @__PURE__ */ jsx(LeadingIcon, { className: "size-6 text-interactive-text-secondary-idle" })
|
|
@@ -34,10 +34,10 @@ var InputContent = ({ leadingIcon: LeadingIcon, trailingIcon: TrailingIcon, unit
|
|
|
34
34
|
}), children]
|
|
35
35
|
})]
|
|
36
36
|
}), /* @__PURE__ */ jsxs("div", {
|
|
37
|
-
className: clsx(inputSizeCva({
|
|
37
|
+
className: clsx("flex items-center gap-input-gap-trailing-elements py-0! pl-0!", inputSizeCva({
|
|
38
38
|
size,
|
|
39
39
|
as
|
|
40
|
-
}),
|
|
40
|
+
}), !isTrailingIconElement && !action && !(isClearable && showClear) && "pointer-events-none"),
|
|
41
41
|
children: [
|
|
42
42
|
isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
43
43
|
onClear: () => {
|
|
@@ -71,6 +71,7 @@ var SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvalid,
|
|
|
71
71
|
}),
|
|
72
72
|
"data-rac": "",
|
|
73
73
|
"data-disabled": isDisabled || void 0,
|
|
74
|
+
"data-is-disabled": isDisabled || void 0,
|
|
74
75
|
"data-hovered": isHovered || void 0,
|
|
75
76
|
"data-focused": isOpen || isFocused || void 0,
|
|
76
77
|
"data-focus-within": isFocused || void 0,
|
|
@@ -106,6 +106,7 @@ var TextEditorBase = ({ ref, as = "default", placeholder, label, hideLabel, tool
|
|
|
106
106
|
"data-rac": "",
|
|
107
107
|
"data-hovered": isHovered || void 0,
|
|
108
108
|
"data-disabled": isDisabled || void 0,
|
|
109
|
+
"data-is-disabled": isDisabled || void 0,
|
|
109
110
|
"data-focus-within": isFocused || void 0,
|
|
110
111
|
"data-focus-visible": isFocused && isFocusVisible || void 0,
|
|
111
112
|
"data-is-filled": !editor?.isEmpty,
|