@povio/ui 2.3.0-rc.39 → 2.3.0-rc.40
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/Checkbox/Checkbox.js +50 -45
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +25 -6
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +31 -7
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +18 -5
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +97 -68
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +131 -136
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +39 -37
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +9 -1
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +43 -7
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +16 -8
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +43 -40
- package/dist/components/inputs/File/InputUpload.js +1 -1
- package/dist/components/inputs/File/shared/InputUploadFilled.js +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +103 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +2 -2
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +52 -29
- package/dist/components/inputs/Input/TextArea/TextArea.js +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +2 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +29 -43
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +1 -0
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
- package/dist/components/inputs/Selection/Select/QuerySelect.js +45 -63
- package/dist/components/inputs/Selection/Select/Select.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +54 -53
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -2
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +12 -1
- package/dist/components/inputs/Selection/shared/select.context.js +3 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +100 -92
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +170 -156
- package/dist/components/inputs/TextEditor/TextEditor.js +1 -1
- package/dist/components/inputs/Toggle/Toggle.js +70 -64
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/InputClear.js +71 -61
- package/dist/components/inputs/shared/input.cva.js +22 -10
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/overlays/BottomSheet/BottomSheet.js +26 -2
- package/dist/config/uiConfig.context.d.ts +3 -1
- package/dist/config/uiConfig.context.js +2 -1
- package/dist/tw-ui-plugin.js +6 -1
- package/dist/utils/date-time.utils.d.ts +5 -0
- package/dist/utils/date-time.utils.js +10 -0
- package/dist/utils/dom.utils.js +1 -1
- package/package.json +1 -1
|
@@ -10,130 +10,138 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
10
10
|
import { Controller } from "react-hook-form";
|
|
11
11
|
//#region src/components/inputs/Slider/Slider.tsx
|
|
12
12
|
var SliderBase = (props) => {
|
|
13
|
-
const $ = c(
|
|
13
|
+
const $ = c(61);
|
|
14
14
|
const ui = UIConfig.useConfig();
|
|
15
|
-
let
|
|
16
|
-
let
|
|
17
|
-
let
|
|
18
|
-
let helperText;
|
|
19
|
-
let hideLabelProp;
|
|
15
|
+
let T0;
|
|
16
|
+
let formFieldProps;
|
|
17
|
+
let getTrackFillStyle;
|
|
20
18
|
let isDisabled;
|
|
21
|
-
let
|
|
22
|
-
let
|
|
23
|
-
let
|
|
24
|
-
let
|
|
25
|
-
let
|
|
26
|
-
let
|
|
27
|
-
let
|
|
28
|
-
let
|
|
19
|
+
let maxValue;
|
|
20
|
+
let minValue;
|
|
21
|
+
let onBlur;
|
|
22
|
+
let t0;
|
|
23
|
+
let t1;
|
|
24
|
+
let t2;
|
|
25
|
+
let t3;
|
|
26
|
+
let t4;
|
|
27
|
+
let t5;
|
|
29
28
|
let unit;
|
|
30
|
-
if ($[0] !== props) {
|
|
31
|
-
|
|
29
|
+
if ($[0] !== props || $[1] !== ui) {
|
|
30
|
+
const { label, tooltipText, helperText, isRequired, rightContent, isDisabled: t6, headerClassName, errorClassName, isHeaderHidden, error, unit: t7, hideLabel: hideLabelProp, minValue: minValueProp, maxValue: maxValueProp, onBlur: t8, ...rest } = props;
|
|
31
|
+
isDisabled = t6;
|
|
32
|
+
unit = t7;
|
|
33
|
+
onBlur = t8;
|
|
34
|
+
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
35
|
+
minValue = minValueProp ?? ui.slider.minValue;
|
|
36
|
+
maxValue = maxValueProp ?? ui.slider.maxValue;
|
|
37
|
+
let t9;
|
|
38
|
+
if ($[16] !== error || $[17] !== errorClassName || $[18] !== headerClassName || $[19] !== helperText || $[20] !== hideLabel || $[21] !== isDisabled || $[22] !== isHeaderHidden || $[23] !== isRequired || $[24] !== label || $[25] !== rightContent || $[26] !== tooltipText) {
|
|
39
|
+
t9 = {
|
|
40
|
+
error,
|
|
41
|
+
label,
|
|
42
|
+
tooltipText,
|
|
43
|
+
helperText,
|
|
44
|
+
isRequired,
|
|
45
|
+
rightContent,
|
|
46
|
+
isHeaderHidden,
|
|
47
|
+
hideLabel,
|
|
48
|
+
isDisabled,
|
|
49
|
+
headerClassName,
|
|
50
|
+
errorClassName
|
|
51
|
+
};
|
|
52
|
+
$[16] = error;
|
|
53
|
+
$[17] = errorClassName;
|
|
54
|
+
$[18] = headerClassName;
|
|
55
|
+
$[19] = helperText;
|
|
56
|
+
$[20] = hideLabel;
|
|
57
|
+
$[21] = isDisabled;
|
|
58
|
+
$[22] = isHeaderHidden;
|
|
59
|
+
$[23] = isRequired;
|
|
60
|
+
$[24] = label;
|
|
61
|
+
$[25] = rightContent;
|
|
62
|
+
$[26] = tooltipText;
|
|
63
|
+
$[27] = t9;
|
|
64
|
+
} else t9 = $[27];
|
|
65
|
+
formFieldProps = t9;
|
|
66
|
+
let t10;
|
|
67
|
+
if ($[28] !== minValue || $[29] !== props.defaultValue || $[30] !== props.isRange) {
|
|
68
|
+
t10 = props.defaultValue ?? (props.isRange ? [minValue, minValue] : minValue);
|
|
69
|
+
$[28] = minValue;
|
|
70
|
+
$[29] = props.defaultValue;
|
|
71
|
+
$[30] = props.isRange;
|
|
72
|
+
$[31] = t10;
|
|
73
|
+
} else t10 = $[31];
|
|
74
|
+
const defaultValue = t10;
|
|
75
|
+
let t11;
|
|
76
|
+
if ($[32] !== props.isRange) {
|
|
77
|
+
t11 = (state) => {
|
|
78
|
+
const p0 = state.getThumbPercent(0);
|
|
79
|
+
const p1 = state.getThumbPercent(1);
|
|
80
|
+
return {
|
|
81
|
+
left: props.isRange ? `${p0 * 100}%` : 0,
|
|
82
|
+
width: props.isRange ? `${(p1 - p0) * 100}%` : `${p0 * 100}%`
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
$[32] = props.isRange;
|
|
86
|
+
$[33] = t11;
|
|
87
|
+
} else t11 = $[33];
|
|
88
|
+
getTrackFillStyle = t11;
|
|
89
|
+
T0 = Slider;
|
|
90
|
+
t0 = rest;
|
|
91
|
+
t1 = defaultValue;
|
|
92
|
+
t2 = minValue;
|
|
93
|
+
t3 = maxValue;
|
|
94
|
+
t4 = isDisabled;
|
|
95
|
+
t5 = clsx("group", rest.className);
|
|
32
96
|
$[0] = props;
|
|
33
|
-
$[1] =
|
|
34
|
-
$[2] =
|
|
35
|
-
$[3] =
|
|
36
|
-
$[4] =
|
|
37
|
-
$[5] =
|
|
38
|
-
$[6] =
|
|
39
|
-
$[7] =
|
|
40
|
-
$[8] =
|
|
41
|
-
$[9] =
|
|
42
|
-
$[10] =
|
|
43
|
-
$[11] =
|
|
44
|
-
$[12] =
|
|
45
|
-
$[13] =
|
|
46
|
-
$[14] =
|
|
97
|
+
$[1] = ui;
|
|
98
|
+
$[2] = T0;
|
|
99
|
+
$[3] = formFieldProps;
|
|
100
|
+
$[4] = getTrackFillStyle;
|
|
101
|
+
$[5] = isDisabled;
|
|
102
|
+
$[6] = maxValue;
|
|
103
|
+
$[7] = minValue;
|
|
104
|
+
$[8] = onBlur;
|
|
105
|
+
$[9] = t0;
|
|
106
|
+
$[10] = t1;
|
|
107
|
+
$[11] = t2;
|
|
108
|
+
$[12] = t3;
|
|
109
|
+
$[13] = t4;
|
|
110
|
+
$[14] = t5;
|
|
47
111
|
$[15] = unit;
|
|
48
112
|
} else {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
tooltipText = $[14];
|
|
113
|
+
T0 = $[2];
|
|
114
|
+
formFieldProps = $[3];
|
|
115
|
+
getTrackFillStyle = $[4];
|
|
116
|
+
isDisabled = $[5];
|
|
117
|
+
maxValue = $[6];
|
|
118
|
+
minValue = $[7];
|
|
119
|
+
onBlur = $[8];
|
|
120
|
+
t0 = $[9];
|
|
121
|
+
t1 = $[10];
|
|
122
|
+
t2 = $[11];
|
|
123
|
+
t3 = $[12];
|
|
124
|
+
t4 = $[13];
|
|
125
|
+
t5 = $[14];
|
|
63
126
|
unit = $[15];
|
|
64
127
|
}
|
|
65
|
-
|
|
66
|
-
const minValue = minValueProp ?? ui.slider.minValue;
|
|
67
|
-
const maxValue = maxValueProp ?? ui.slider.maxValue;
|
|
68
|
-
let t0;
|
|
69
|
-
if ($[16] !== error || $[17] !== errorClassName || $[18] !== headerClassName || $[19] !== helperText || $[20] !== hideLabel || $[21] !== isDisabled || $[22] !== isHeaderHidden || $[23] !== isRequired || $[24] !== label || $[25] !== rightContent || $[26] !== tooltipText) {
|
|
70
|
-
t0 = {
|
|
71
|
-
error,
|
|
72
|
-
label,
|
|
73
|
-
tooltipText,
|
|
74
|
-
helperText,
|
|
75
|
-
isRequired,
|
|
76
|
-
rightContent,
|
|
77
|
-
isHeaderHidden,
|
|
78
|
-
hideLabel,
|
|
79
|
-
isDisabled,
|
|
80
|
-
headerClassName,
|
|
81
|
-
errorClassName
|
|
82
|
-
};
|
|
83
|
-
$[16] = error;
|
|
84
|
-
$[17] = errorClassName;
|
|
85
|
-
$[18] = headerClassName;
|
|
86
|
-
$[19] = helperText;
|
|
87
|
-
$[20] = hideLabel;
|
|
88
|
-
$[21] = isDisabled;
|
|
89
|
-
$[22] = isHeaderHidden;
|
|
90
|
-
$[23] = isRequired;
|
|
91
|
-
$[24] = label;
|
|
92
|
-
$[25] = rightContent;
|
|
93
|
-
$[26] = tooltipText;
|
|
94
|
-
$[27] = t0;
|
|
95
|
-
} else t0 = $[27];
|
|
96
|
-
const formFieldProps = t0;
|
|
97
|
-
let t1;
|
|
98
|
-
if ($[28] !== minValue || $[29] !== props.defaultValue || $[30] !== props.isRange) {
|
|
99
|
-
t1 = props.defaultValue ?? (props.isRange ? [minValue, minValue] : minValue);
|
|
100
|
-
$[28] = minValue;
|
|
101
|
-
$[29] = props.defaultValue;
|
|
102
|
-
$[30] = props.isRange;
|
|
103
|
-
$[31] = t1;
|
|
104
|
-
} else t1 = $[31];
|
|
105
|
-
const defaultValue = t1;
|
|
106
|
-
let t2;
|
|
107
|
-
if ($[32] !== props.isRange) {
|
|
108
|
-
t2 = (state) => {
|
|
109
|
-
const p0 = state.getThumbPercent(0);
|
|
110
|
-
const p1 = state.getThumbPercent(1);
|
|
111
|
-
return {
|
|
112
|
-
left: props.isRange ? `${p0 * 100}%` : 0,
|
|
113
|
-
width: props.isRange ? `${(p1 - p0) * 100}%` : `${p0 * 100}%`
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
$[32] = props.isRange;
|
|
117
|
-
$[33] = t2;
|
|
118
|
-
} else t2 = $[33];
|
|
119
|
-
const getTrackFillStyle = t2;
|
|
120
|
-
let t3;
|
|
128
|
+
let t6;
|
|
121
129
|
if ($[34] !== minValue || $[35] !== unit) {
|
|
122
|
-
|
|
130
|
+
t6 = /* @__PURE__ */ jsxs(Typography, {
|
|
123
131
|
className: "min-w-10 px-slider-side-leading-and-trailing py-slider-height-leading-and-trailing text-text-default-3",
|
|
124
132
|
size: "label-2",
|
|
125
133
|
children: [minValue, unit]
|
|
126
134
|
});
|
|
127
135
|
$[34] = minValue;
|
|
128
136
|
$[35] = unit;
|
|
129
|
-
$[36] =
|
|
130
|
-
} else
|
|
131
|
-
let
|
|
132
|
-
if ($[37] !== getTrackFillStyle || $[38] !== isDisabled || $[39] !== props.isDisabled) {
|
|
133
|
-
|
|
137
|
+
$[36] = t6;
|
|
138
|
+
} else t6 = $[36];
|
|
139
|
+
let t7;
|
|
140
|
+
if ($[37] !== getTrackFillStyle || $[38] !== isDisabled || $[39] !== onBlur || $[40] !== props.isDisabled) {
|
|
141
|
+
t7 = /* @__PURE__ */ jsx(SliderTrack, {
|
|
134
142
|
className: "relative mx-2 h-6 w-full",
|
|
135
|
-
children: (
|
|
136
|
-
const { state: state_0 } =
|
|
143
|
+
children: (t8) => {
|
|
144
|
+
const { state: state_0 } = t8;
|
|
137
145
|
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
138
146
|
className: "absolute top-1/2 h-1 w-full -translate-y-1/2 overflow-hidden rounded-full bg-elevation-outline-default-1",
|
|
139
147
|
children: /* @__PURE__ */ jsx("div", {
|
|
@@ -143,70 +151,75 @@ var SliderBase = (props) => {
|
|
|
143
151
|
}), state_0.values.map((_, i) => /* @__PURE__ */ jsx(SliderThumb, {
|
|
144
152
|
index: i,
|
|
145
153
|
className: clsx("absolute top-1/2 size-4 cursor-pointer rounded-full bg-interactive-contained-primary-idle disabled:cursor-default", "dragging:bg-interactive-contained-primary-pressed hover:bg-interactive-contained-primary-hover focus-visible:outline-interactive-contained-primary-focus disabled:bg-interactive-contained-primary-disabled", uiOutlineClass),
|
|
146
|
-
isDisabled
|
|
154
|
+
isDisabled,
|
|
155
|
+
onBlur: (event) => onBlur?.({ target: event.target })
|
|
147
156
|
}, i))] });
|
|
148
157
|
}
|
|
149
158
|
});
|
|
150
159
|
$[37] = getTrackFillStyle;
|
|
151
160
|
$[38] = isDisabled;
|
|
152
|
-
$[39] =
|
|
153
|
-
$[40] =
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
161
|
+
$[39] = onBlur;
|
|
162
|
+
$[40] = props.isDisabled;
|
|
163
|
+
$[41] = t7;
|
|
164
|
+
} else t7 = $[41];
|
|
165
|
+
let t8;
|
|
166
|
+
if ($[42] !== maxValue || $[43] !== unit) {
|
|
167
|
+
t8 = /* @__PURE__ */ jsxs(Typography, {
|
|
158
168
|
className: "min-w-10 px-slider-side-leading-and-trailing py-slider-height-leading-and-trailing text-text-default-3",
|
|
159
169
|
size: "label-2",
|
|
160
170
|
children: [maxValue, unit]
|
|
161
171
|
});
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
} else
|
|
166
|
-
let
|
|
167
|
-
if ($[
|
|
168
|
-
|
|
172
|
+
$[42] = maxValue;
|
|
173
|
+
$[43] = unit;
|
|
174
|
+
$[44] = t8;
|
|
175
|
+
} else t8 = $[44];
|
|
176
|
+
let t9;
|
|
177
|
+
if ($[45] !== t6 || $[46] !== t7 || $[47] !== t8) {
|
|
178
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
169
179
|
className: "flex items-center justify-between",
|
|
170
180
|
children: [
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
181
|
+
t6,
|
|
182
|
+
t7,
|
|
183
|
+
t8
|
|
174
184
|
]
|
|
175
185
|
});
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
} else
|
|
181
|
-
let
|
|
182
|
-
if ($[
|
|
183
|
-
|
|
186
|
+
$[45] = t6;
|
|
187
|
+
$[46] = t7;
|
|
188
|
+
$[47] = t8;
|
|
189
|
+
$[48] = t9;
|
|
190
|
+
} else t9 = $[48];
|
|
191
|
+
let t10;
|
|
192
|
+
if ($[49] !== formFieldProps || $[50] !== t9) {
|
|
193
|
+
t10 = /* @__PURE__ */ jsx(FormField, {
|
|
184
194
|
...formFieldProps,
|
|
185
|
-
children:
|
|
195
|
+
children: t9
|
|
186
196
|
});
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
} else
|
|
191
|
-
let
|
|
192
|
-
if ($[
|
|
193
|
-
|
|
194
|
-
...
|
|
195
|
-
defaultValue,
|
|
196
|
-
minValue,
|
|
197
|
-
maxValue,
|
|
198
|
-
isDisabled,
|
|
199
|
-
|
|
197
|
+
$[49] = formFieldProps;
|
|
198
|
+
$[50] = t9;
|
|
199
|
+
$[51] = t10;
|
|
200
|
+
} else t10 = $[51];
|
|
201
|
+
let t11;
|
|
202
|
+
if ($[52] !== T0 || $[53] !== t0 || $[54] !== t1 || $[55] !== t10 || $[56] !== t2 || $[57] !== t3 || $[58] !== t4 || $[59] !== t5) {
|
|
203
|
+
t11 = /* @__PURE__ */ jsx(T0, {
|
|
204
|
+
...t0,
|
|
205
|
+
defaultValue: t1,
|
|
206
|
+
minValue: t2,
|
|
207
|
+
maxValue: t3,
|
|
208
|
+
isDisabled: t4,
|
|
209
|
+
className: t5,
|
|
210
|
+
children: t10
|
|
200
211
|
});
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
|
|
209
|
-
|
|
212
|
+
$[52] = T0;
|
|
213
|
+
$[53] = t0;
|
|
214
|
+
$[54] = t1;
|
|
215
|
+
$[55] = t10;
|
|
216
|
+
$[56] = t2;
|
|
217
|
+
$[57] = t3;
|
|
218
|
+
$[58] = t4;
|
|
219
|
+
$[59] = t5;
|
|
220
|
+
$[60] = t11;
|
|
221
|
+
} else t11 = $[60];
|
|
222
|
+
return t11;
|
|
210
223
|
};
|
|
211
224
|
var Slider$1 = (props) => {
|
|
212
225
|
const $ = c(15);
|
|
@@ -234,6 +247,7 @@ var Slider$1 = (props) => {
|
|
|
234
247
|
...innerProps,
|
|
235
248
|
ref: mergeRefs(ref, field.ref),
|
|
236
249
|
value: field.value,
|
|
250
|
+
onBlur: field.onBlur,
|
|
237
251
|
onChange: field.onChange,
|
|
238
252
|
isDisabled: field.disabled || props.isDisabled,
|
|
239
253
|
error: props.error ?? error?.message
|
|
@@ -11,7 +11,7 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
11
11
|
import { Controller } from "react-hook-form";
|
|
12
12
|
//#region src/components/inputs/Toggle/Toggle.tsx
|
|
13
13
|
var ToggleBase = (props) => {
|
|
14
|
-
const $ = c(
|
|
14
|
+
const $ = c(50);
|
|
15
15
|
const ui = UIConfig.useConfig();
|
|
16
16
|
const toggleCva = UIStyle.useCva("toggle.cva", toggle);
|
|
17
17
|
const toggleTypographyMap = UIStyle.useMapper("toggle.typography", toggleTypography);
|
|
@@ -29,48 +29,50 @@ var ToggleBase = (props) => {
|
|
|
29
29
|
let t6;
|
|
30
30
|
let t7;
|
|
31
31
|
let t8;
|
|
32
|
+
let t9;
|
|
32
33
|
if ($[0] !== props || $[1] !== toggleContentClassNameMap || $[2] !== toggleCva || $[3] !== toggleTypographyMap || $[4] !== ui) {
|
|
33
|
-
const { className, children:
|
|
34
|
-
children =
|
|
34
|
+
const { className, children: t10, isDisabled, error, variant: variantProp, fireBlurOnChange: fireBlurOnChangeProp, onChange, onBlur, ...rest } = props;
|
|
35
|
+
children = t10;
|
|
35
36
|
const variant = variantProp ?? ui.toggle.variant;
|
|
36
37
|
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.toggle.fireBlurOnChange;
|
|
37
|
-
let
|
|
38
|
-
if ($[
|
|
39
|
-
|
|
38
|
+
let t11;
|
|
39
|
+
if ($[19] !== error || $[20] !== isDisabled) {
|
|
40
|
+
t11 = {
|
|
40
41
|
error,
|
|
41
42
|
isDisabled
|
|
42
43
|
};
|
|
43
|
-
$[
|
|
44
|
-
$[
|
|
45
|
-
$[
|
|
46
|
-
} else
|
|
47
|
-
formFieldErrorProps =
|
|
48
|
-
let
|
|
49
|
-
if ($[
|
|
50
|
-
|
|
44
|
+
$[19] = error;
|
|
45
|
+
$[20] = isDisabled;
|
|
46
|
+
$[21] = t11;
|
|
47
|
+
} else t11 = $[21];
|
|
48
|
+
formFieldErrorProps = t11;
|
|
49
|
+
let t12;
|
|
50
|
+
if ($[22] !== fireBlurOnChange || $[23] !== onBlur || $[24] !== onChange) {
|
|
51
|
+
t12 = (isSelected) => {
|
|
51
52
|
onChange?.(isSelected);
|
|
52
53
|
if (fireBlurOnChange) onBlur?.({});
|
|
53
54
|
};
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
58
|
-
} else
|
|
59
|
-
const handleChange =
|
|
55
|
+
$[22] = fireBlurOnChange;
|
|
56
|
+
$[23] = onBlur;
|
|
57
|
+
$[24] = onChange;
|
|
58
|
+
$[25] = t12;
|
|
59
|
+
} else t12 = $[25];
|
|
60
|
+
const handleChange = t12;
|
|
60
61
|
T1 = Switch;
|
|
61
62
|
t2 = rest;
|
|
62
63
|
t3 = props.isDirty || void 0;
|
|
63
64
|
t4 = props.isRequired || void 0;
|
|
64
65
|
t5 = isDisabled;
|
|
65
66
|
t6 = handleChange;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
$[26] =
|
|
71
|
-
$[27] =
|
|
72
|
-
|
|
73
|
-
t8 =
|
|
67
|
+
t7 = onBlur;
|
|
68
|
+
const t13 = !isDisabled && "cursor-pointer";
|
|
69
|
+
if ($[26] !== className || $[27] !== t13) {
|
|
70
|
+
t8 = clsx("group flex items-center gap-2", t13, className);
|
|
71
|
+
$[26] = className;
|
|
72
|
+
$[27] = t13;
|
|
73
|
+
$[28] = t8;
|
|
74
|
+
} else t8 = $[28];
|
|
75
|
+
t9 = /* @__PURE__ */ jsx("div", { className: toggleCva({
|
|
74
76
|
variant,
|
|
75
77
|
...rest
|
|
76
78
|
}) });
|
|
@@ -101,6 +103,7 @@ var ToggleBase = (props) => {
|
|
|
101
103
|
$[15] = t6;
|
|
102
104
|
$[16] = t7;
|
|
103
105
|
$[17] = t8;
|
|
106
|
+
$[18] = t9;
|
|
104
107
|
} else {
|
|
105
108
|
T0 = $[5];
|
|
106
109
|
T1 = $[6];
|
|
@@ -115,56 +118,59 @@ var ToggleBase = (props) => {
|
|
|
115
118
|
t6 = $[15];
|
|
116
119
|
t7 = $[16];
|
|
117
120
|
t8 = $[17];
|
|
121
|
+
t9 = $[18];
|
|
118
122
|
}
|
|
119
|
-
let
|
|
120
|
-
if ($[
|
|
121
|
-
|
|
123
|
+
let t10;
|
|
124
|
+
if ($[29] !== T0 || $[30] !== children || $[31] !== t0 || $[32] !== t1) {
|
|
125
|
+
t10 = /* @__PURE__ */ jsx(T0, {
|
|
122
126
|
typography: t0,
|
|
123
127
|
contentClassName: t1,
|
|
124
128
|
children
|
|
125
129
|
});
|
|
126
|
-
$[
|
|
127
|
-
$[
|
|
128
|
-
$[
|
|
129
|
-
$[
|
|
130
|
-
$[
|
|
131
|
-
} else
|
|
132
|
-
let
|
|
133
|
-
if ($[
|
|
134
|
-
|
|
130
|
+
$[29] = T0;
|
|
131
|
+
$[30] = children;
|
|
132
|
+
$[31] = t0;
|
|
133
|
+
$[32] = t1;
|
|
134
|
+
$[33] = t10;
|
|
135
|
+
} else t10 = $[33];
|
|
136
|
+
let t11;
|
|
137
|
+
if ($[34] !== T1 || $[35] !== t10 || $[36] !== t2 || $[37] !== t3 || $[38] !== t4 || $[39] !== t5 || $[40] !== t6 || $[41] !== t7 || $[42] !== t8 || $[43] !== t9) {
|
|
138
|
+
t11 = /* @__PURE__ */ jsxs(T1, {
|
|
135
139
|
...t2,
|
|
136
140
|
"data-is-dirty": t3,
|
|
137
141
|
"data-is-required": t4,
|
|
138
142
|
isDisabled: t5,
|
|
139
143
|
onChange: t6,
|
|
140
|
-
|
|
141
|
-
|
|
144
|
+
onBlur: t7,
|
|
145
|
+
className: t8,
|
|
146
|
+
children: [t9, t10]
|
|
142
147
|
});
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
} else t10 = $[42];
|
|
154
|
-
let t11;
|
|
155
|
-
if ($[43] !== formFieldErrorProps) {
|
|
156
|
-
t11 = /* @__PURE__ */ jsx(FormFieldError, { ...formFieldErrorProps });
|
|
157
|
-
$[43] = formFieldErrorProps;
|
|
148
|
+
$[34] = T1;
|
|
149
|
+
$[35] = t10;
|
|
150
|
+
$[36] = t2;
|
|
151
|
+
$[37] = t3;
|
|
152
|
+
$[38] = t4;
|
|
153
|
+
$[39] = t5;
|
|
154
|
+
$[40] = t6;
|
|
155
|
+
$[41] = t7;
|
|
156
|
+
$[42] = t8;
|
|
157
|
+
$[43] = t9;
|
|
158
158
|
$[44] = t11;
|
|
159
159
|
} else t11 = $[44];
|
|
160
160
|
let t12;
|
|
161
|
-
if ($[45] !==
|
|
162
|
-
t12 = /* @__PURE__ */
|
|
163
|
-
$[45] =
|
|
164
|
-
$[46] =
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
if ($[45] !== formFieldErrorProps) {
|
|
162
|
+
t12 = /* @__PURE__ */ jsx(FormFieldError, { ...formFieldErrorProps });
|
|
163
|
+
$[45] = formFieldErrorProps;
|
|
164
|
+
$[46] = t12;
|
|
165
|
+
} else t12 = $[46];
|
|
166
|
+
let t13;
|
|
167
|
+
if ($[47] !== t11 || $[48] !== t12) {
|
|
168
|
+
t13 = /* @__PURE__ */ jsxs(Fragment, { children: [t11, t12] });
|
|
169
|
+
$[47] = t11;
|
|
170
|
+
$[48] = t12;
|
|
171
|
+
$[49] = t13;
|
|
172
|
+
} else t13 = $[49];
|
|
173
|
+
return t13;
|
|
168
174
|
};
|
|
169
175
|
var Toggle = (props) => {
|
|
170
176
|
const $ = c(15);
|
|
@@ -17,7 +17,8 @@ var toggle = cva(["h-6 w-10 rounded-full before:m-0-5 before:block before:aspect
|
|
|
17
17
|
"group-disabled:before:bg-interactive-contained-secondary-on-disabled",
|
|
18
18
|
"group-selected:before:bg-interactive-contained-primary-on-idle",
|
|
19
19
|
"group-selected:group-hover:before:bg-interactive-contained-primary-on-hover",
|
|
20
|
-
"group-selected:group-pressed:before:bg-interactive-contained-primary-on-pressed"
|
|
20
|
+
"group-selected:group-pressed:before:bg-interactive-contained-primary-on-pressed",
|
|
21
|
+
"group-selected:group-disabled:bg-interactive-contained-primary-disabled"
|
|
21
22
|
] } },
|
|
22
23
|
defaultVariants: { variant: "default" }
|
|
23
24
|
});
|