@kanso-labs/kanso-ui 0.47.4 → 0.48.0
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/button/hooks.js +35 -1
- package/dist/button/hooks.js.map +1 -1
- package/dist/button/index.js +78 -65
- package/dist/button/index.js.map +1 -1
- package/dist/calendar/styles.js +5 -5
- package/dist/calendar/styles.js.map +1 -1
- package/dist/chip/styles.js +1 -1
- package/dist/chip/styles.js.map +1 -1
- package/dist/collection/context.js +6 -0
- package/dist/collection/context.js.map +1 -0
- package/dist/collection/styles.js +29 -6
- package/dist/collection/styles.js.map +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/calendar/index.js +7 -0
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/checkbox/index.js +10 -7
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.js +2 -1
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/chip-group/index.js +69 -66
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/color-swatch-picker/index.js +1 -0
- package/dist/components/color-swatch-picker/index.js.map +1 -1
- package/dist/components/combo-box/index.js +5 -1
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/drop-zone/styles.js +11 -11
- package/dist/components/drop-zone/styles.js.map +1 -1
- package/dist/components/fab-menu/index.js +3 -3
- package/dist/components/fab-menu/index.js.map +1 -1
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/list/index.js +58 -11
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.js +82 -103
- package/dist/components/list-box/index.js.map +1 -1
- package/dist/components/navigation-rail/index.js +4 -4
- package/dist/components/navigation-rail/index.js.map +1 -1
- package/dist/components/number-field/index.js +3 -3
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.js +3 -3
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/radio-group/index.js +12 -11
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/search-field/index.js +4 -4
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/select/index.js +5 -1
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/slider/index.js +2 -2
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/snackbar/index.js +3 -3
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/split-button/index.js +53 -41
- package/dist/components/split-button/index.js.map +1 -1
- package/dist/components/table/index.js +58 -45
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/tabs/index.js +81 -30
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/time-picker/index.js +5 -5
- package/dist/components/time-picker/index.js.map +1 -1
- package/dist/components/tree/index.js +78 -21
- package/dist/components/tree/index.js.map +1 -1
- package/dist/field/index.js +103 -104
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +1 -1
- package/dist/field/styles.js.map +1 -1
- package/dist/hooks/useScrollEdges.js +73 -0
- package/dist/hooks/useScrollEdges.js.map +1 -0
- package/dist/navigation/styles.js +5 -5
- package/dist/navigation/styles.js.map +1 -1
- package/dist/row/styles.js +7 -7
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/color.js +16 -16
- package/dist/styles/color.js.map +1 -1
- package/dist/styles/focus.js +4 -4
- package/dist/styles/focus.js.map +1 -1
- package/dist/styles/overlay.js +3 -3
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles/scroll-fade.js +33 -0
- package/dist/styles/scroll-fade.js.map +1 -0
- package/dist/styles.css +61 -20
- package/package.json +9 -9
package/dist/field/index.js
CHANGED
|
@@ -41,13 +41,16 @@ function boxContent(label, children, endInset, floatingLabel, isFocused, isPopul
|
|
|
41
41
|
return (state) => /* @__PURE__ */ jsx(BoxContent, {
|
|
42
42
|
endInset,
|
|
43
43
|
floatingLabel,
|
|
44
|
+
isDisabled: state.isDisabled,
|
|
44
45
|
isFocused,
|
|
46
|
+
isFocusWithin: state.isFocusWithin,
|
|
47
|
+
isHovered: state.isHovered,
|
|
48
|
+
isInvalid: state.isInvalid,
|
|
45
49
|
isPopulated,
|
|
46
50
|
isRequired,
|
|
47
51
|
label,
|
|
48
52
|
leading,
|
|
49
53
|
multiline,
|
|
50
|
-
state,
|
|
51
54
|
trailing,
|
|
52
55
|
trigger,
|
|
53
56
|
variant,
|
|
@@ -60,14 +63,20 @@ function boxContent(label, children, endInset, floatingLabel, isFocused, isPopul
|
|
|
60
63
|
* itself, so it can read whether the control holds a value — which is what
|
|
61
64
|
* the outlined box's notch and label follow, and what CSS cannot express
|
|
62
65
|
* for them. See the outlined variant's note above.
|
|
66
|
+
*
|
|
67
|
+
* It takes the four flags it reads off the box's render state rather than
|
|
68
|
+
* the state itself, for the reason `FieldLabelProps` gives: the state is a
|
|
69
|
+
* new object on every keystroke, and handed down it re-rendered the label
|
|
70
|
+
* and the outline with each one. It still re-renders on every keystroke
|
|
71
|
+
* itself, since it reads the value; what it hands down holds.
|
|
63
72
|
*/
|
|
64
73
|
function BoxContent(t0) {
|
|
65
74
|
const $ = c(50);
|
|
66
|
-
const { children, endInset, floatingLabel, isFocused, isPopulated, isRequired, label, leading, multiline,
|
|
75
|
+
const { children, endInset, floatingLabel, isDisabled, isFocused, isFocusWithin, isHovered, isInvalid, isPopulated, isRequired, label, leading, multiline, trailing, trigger, variant } = t0;
|
|
67
76
|
const read = useFieldPopulated();
|
|
68
77
|
const populated = isPopulated ?? read;
|
|
69
78
|
const outlined = variant === "outlined";
|
|
70
|
-
const focused =
|
|
79
|
+
const focused = isFocusWithin || isFocused;
|
|
71
80
|
const floated = !floatingLabel || focused || populated;
|
|
72
81
|
const t1 = BOX_CONTROLS[variant][floatingLabel ? "floating" : "fixed"];
|
|
73
82
|
let t2;
|
|
@@ -91,103 +100,102 @@ function BoxContent(t0) {
|
|
|
91
100
|
$[8] = t2;
|
|
92
101
|
} else t2 = $[8];
|
|
93
102
|
let t3;
|
|
94
|
-
if ($[9] !==
|
|
103
|
+
if ($[9] !== isDisabled || $[10] !== leading || $[11] !== multiline || $[12] !== outlined) {
|
|
95
104
|
t3 = leading === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
96
|
-
...props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined,
|
|
105
|
+
...props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, isDisabled && fieldChromeStyles.iconDisabled),
|
|
97
106
|
children: leading
|
|
98
107
|
});
|
|
99
|
-
$[9] =
|
|
100
|
-
$[10] =
|
|
101
|
-
$[11] =
|
|
102
|
-
$[12] =
|
|
108
|
+
$[9] = isDisabled;
|
|
109
|
+
$[10] = leading;
|
|
110
|
+
$[11] = multiline;
|
|
111
|
+
$[12] = outlined;
|
|
103
112
|
$[13] = t3;
|
|
104
113
|
} else t3 = $[13];
|
|
105
114
|
let t4;
|
|
106
|
-
if ($[14] !== floatingLabel || $[15] !==
|
|
107
|
-
t4 = props(fieldChromeStyles.column, floatingLabel && fieldChromeStyles.columnFloating,
|
|
115
|
+
if ($[14] !== floatingLabel || $[15] !== isDisabled) {
|
|
116
|
+
t4 = props(fieldChromeStyles.column, floatingLabel && fieldChromeStyles.columnFloating, isDisabled && (floatingLabel ? fieldChromeStyles.columnDisabledFloating : fieldChromeStyles.columnDisabled));
|
|
108
117
|
$[14] = floatingLabel;
|
|
109
|
-
$[15] =
|
|
118
|
+
$[15] = isDisabled;
|
|
110
119
|
$[16] = t4;
|
|
111
120
|
} else t4 = $[16];
|
|
112
121
|
let t5;
|
|
113
|
-
if ($[17] !==
|
|
114
|
-
t5 =
|
|
115
|
-
$[17] =
|
|
116
|
-
$[18] =
|
|
117
|
-
$[19] =
|
|
118
|
-
|
|
122
|
+
if ($[17] !== endInset || $[18] !== floated || $[19] !== floatingLabel || $[20] !== outlined) {
|
|
123
|
+
t5 = props(fieldChromeStyles.boxLabel, floatingLabel && floated && fieldChromeStyles.boxLabelFloated, outlined && fieldChromeStyles.boxLabelOutlined, outlined && floated && fieldChromeStyles.boxLabelOutlinedFloated, endInset !== "0px" && fieldChromeStyles.boxLabelEndInset(outlined ? `calc(100% + 2 * ${spacing.xs} - ${endInset})` : `calc(100% - ${endInset})`));
|
|
124
|
+
$[17] = endInset;
|
|
125
|
+
$[18] = floated;
|
|
126
|
+
$[19] = floatingLabel;
|
|
127
|
+
$[20] = outlined;
|
|
128
|
+
$[21] = t5;
|
|
129
|
+
} else t5 = $[21];
|
|
119
130
|
let t6;
|
|
120
|
-
if ($[
|
|
121
|
-
t6 =
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
$[24] = t6;
|
|
127
|
-
} else t6 = $[24];
|
|
128
|
-
let t7;
|
|
129
|
-
if ($[25] !== isRequired || $[26] !== label || $[27] !== outlined || $[28] !== t5 || $[29] !== t6) {
|
|
130
|
-
t7 = /* @__PURE__ */ jsx(FieldLabel, {
|
|
131
|
+
if ($[22] !== focused || $[23] !== isDisabled || $[24] !== isHovered || $[25] !== isInvalid || $[26] !== isRequired || $[27] !== label || $[28] !== outlined || $[29] !== t5) {
|
|
132
|
+
t6 = /* @__PURE__ */ jsx(FieldLabel, {
|
|
133
|
+
isDisabled,
|
|
134
|
+
isFocused: focused,
|
|
135
|
+
isHovered,
|
|
136
|
+
isInvalid,
|
|
131
137
|
isRequired,
|
|
132
138
|
outlined,
|
|
133
|
-
|
|
134
|
-
...t6,
|
|
139
|
+
...t5,
|
|
135
140
|
children: label
|
|
136
141
|
});
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
142
|
+
$[22] = focused;
|
|
143
|
+
$[23] = isDisabled;
|
|
144
|
+
$[24] = isHovered;
|
|
145
|
+
$[25] = isInvalid;
|
|
146
|
+
$[26] = isRequired;
|
|
147
|
+
$[27] = label;
|
|
148
|
+
$[28] = outlined;
|
|
149
|
+
$[29] = t5;
|
|
150
|
+
$[30] = t6;
|
|
151
|
+
} else t6 = $[30];
|
|
152
|
+
let t7;
|
|
153
|
+
if ($[31] !== children || $[32] !== t4 || $[33] !== t6) {
|
|
154
|
+
t7 = /* @__PURE__ */ jsxs("div", {
|
|
147
155
|
...t4,
|
|
148
|
-
children: [
|
|
156
|
+
children: [t6, children]
|
|
149
157
|
});
|
|
150
158
|
$[31] = children;
|
|
151
159
|
$[32] = t4;
|
|
152
|
-
$[33] =
|
|
153
|
-
$[34] =
|
|
154
|
-
} else
|
|
155
|
-
let
|
|
156
|
-
if ($[35] !== focused || $[36] !==
|
|
157
|
-
|
|
158
|
-
...props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined,
|
|
160
|
+
$[33] = t6;
|
|
161
|
+
$[34] = t7;
|
|
162
|
+
} else t7 = $[34];
|
|
163
|
+
let t8;
|
|
164
|
+
if ($[35] !== focused || $[36] !== isDisabled || $[37] !== isHovered || $[38] !== isInvalid || $[39] !== multiline || $[40] !== outlined || $[41] !== trailing) {
|
|
165
|
+
t8 = trailing === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
166
|
+
...props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, isInvalid && (isHovered && !focused ? fieldChromeStyles.iconErrorHovered : fieldChromeStyles.iconError), isDisabled && fieldChromeStyles.iconDisabled),
|
|
159
167
|
children: trailing
|
|
160
168
|
});
|
|
161
169
|
$[35] = focused;
|
|
162
|
-
$[36] =
|
|
163
|
-
$[37] =
|
|
164
|
-
$[38] =
|
|
165
|
-
$[39] =
|
|
166
|
-
$[40] =
|
|
170
|
+
$[36] = isDisabled;
|
|
171
|
+
$[37] = isHovered;
|
|
172
|
+
$[38] = isInvalid;
|
|
173
|
+
$[39] = multiline;
|
|
174
|
+
$[40] = outlined;
|
|
167
175
|
$[41] = trailing;
|
|
168
|
-
$[42] =
|
|
169
|
-
} else
|
|
170
|
-
let
|
|
171
|
-
if ($[43] !== t1 || $[44] !== t2 || $[45] !== t3 || $[46] !==
|
|
172
|
-
|
|
176
|
+
$[42] = t8;
|
|
177
|
+
} else t8 = $[42];
|
|
178
|
+
let t9;
|
|
179
|
+
if ($[43] !== t1 || $[44] !== t2 || $[45] !== t3 || $[46] !== t7 || $[47] !== t8 || $[48] !== trigger) {
|
|
180
|
+
t9 = /* @__PURE__ */ jsxs(BoxContext, {
|
|
173
181
|
value: t1,
|
|
174
182
|
children: [
|
|
175
183
|
t2,
|
|
176
184
|
trigger,
|
|
177
185
|
t3,
|
|
178
|
-
|
|
179
|
-
|
|
186
|
+
t7,
|
|
187
|
+
t8
|
|
180
188
|
]
|
|
181
189
|
});
|
|
182
190
|
$[43] = t1;
|
|
183
191
|
$[44] = t2;
|
|
184
192
|
$[45] = t3;
|
|
185
|
-
$[46] =
|
|
186
|
-
$[47] =
|
|
193
|
+
$[46] = t7;
|
|
194
|
+
$[47] = t8;
|
|
187
195
|
$[48] = trigger;
|
|
188
|
-
$[49] =
|
|
189
|
-
} else
|
|
190
|
-
return
|
|
196
|
+
$[49] = t9;
|
|
197
|
+
} else t9 = $[49];
|
|
198
|
+
return t9;
|
|
191
199
|
}
|
|
192
200
|
function boxStyles(floatingLabel, isFocused, multiline, leading, trailing, variant) {
|
|
193
201
|
const outlined = variant === "outlined";
|
|
@@ -347,7 +355,7 @@ function FieldBox(t0) {
|
|
|
347
355
|
*/
|
|
348
356
|
function FieldInput(t0) {
|
|
349
357
|
const $ = c(24);
|
|
350
|
-
const { leftToRight: t1, numeric: t2, placeholder, prefix, suffix, ...props$
|
|
358
|
+
const { leftToRight: t1, numeric: t2, placeholder, prefix, suffix, ...props$2 } = t0;
|
|
351
359
|
const leftToRight = t1 === void 0 ? false : t1;
|
|
352
360
|
const numeric = t2 === void 0 ? false : t2;
|
|
353
361
|
const box = useContext(BoxContext);
|
|
@@ -355,10 +363,10 @@ function FieldInput(t0) {
|
|
|
355
363
|
const prefixId = useId();
|
|
356
364
|
const suffixId = useId();
|
|
357
365
|
const field = useSlottedContext(InputContext);
|
|
358
|
-
const describedBy = idsOf(prefix === void 0 ? void 0 : prefixId, suffix === void 0 ? void 0 : suffixId, field?.["aria-describedby"], props$
|
|
366
|
+
const describedBy = idsOf(prefix === void 0 ? void 0 : prefixId, suffix === void 0 ? void 0 : suffixId, field?.["aria-describedby"], props$2["aria-describedby"]);
|
|
359
367
|
const T0 = Input;
|
|
360
368
|
const t3 = placeholder ?? (box.label === "floating" ? " " : void 0);
|
|
361
|
-
const t4 = commitWhileInvalid(validation?.isInvalid ?? false, props$
|
|
369
|
+
const t4 = commitWhileInvalid(validation?.isInvalid ?? false, props$2.onInput);
|
|
362
370
|
let t5;
|
|
363
371
|
if ($[0] !== box || $[1] !== leftToRight || $[2] !== numeric) {
|
|
364
372
|
t5 = (state) => props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === "floating" && fieldChromeStyles.inputUnderFloatingLabel, numeric && fieldChromeStyles.numeric, leftToRight && fieldChromeStyles.leftToRight, state.isInvalid && fieldChromeStyles.inputInvalid, state.isDisabled && fieldChromeStyles.inputDisabled);
|
|
@@ -367,19 +375,19 @@ function FieldInput(t0) {
|
|
|
367
375
|
$[2] = numeric;
|
|
368
376
|
$[3] = t5;
|
|
369
377
|
} else t5 = $[3];
|
|
370
|
-
const t6 = mergeStatefulStyles(t5, props$
|
|
378
|
+
const t6 = mergeStatefulStyles(t5, props$2);
|
|
371
379
|
let t7;
|
|
372
|
-
if ($[4] !== T0 || $[5] !== describedBy || $[6] !== props$
|
|
380
|
+
if ($[4] !== T0 || $[5] !== describedBy || $[6] !== props$2 || $[7] !== t3 || $[8] !== t4 || $[9] !== t6) {
|
|
373
381
|
t7 = /* @__PURE__ */ jsx(T0, {
|
|
374
382
|
placeholder: t3,
|
|
375
|
-
...props$
|
|
383
|
+
...props$2,
|
|
376
384
|
"aria-describedby": describedBy,
|
|
377
385
|
onInput: t4,
|
|
378
386
|
...t6
|
|
379
387
|
});
|
|
380
388
|
$[4] = T0;
|
|
381
389
|
$[5] = describedBy;
|
|
382
|
-
$[6] = props$
|
|
390
|
+
$[6] = props$2;
|
|
383
391
|
$[7] = t3;
|
|
384
392
|
$[8] = t4;
|
|
385
393
|
$[9] = t6;
|
|
@@ -483,7 +491,7 @@ function FieldSegments(t0) {
|
|
|
483
491
|
*/
|
|
484
492
|
function FieldTextArea(t0) {
|
|
485
493
|
const $ = c(18);
|
|
486
|
-
const { autosize: t1, placeholder, ...props$
|
|
494
|
+
const { autosize: t1, placeholder, ...props$1 } = t0;
|
|
487
495
|
const autosize = t1 === void 0 ? false : t1;
|
|
488
496
|
const box = useContext(BoxContext);
|
|
489
497
|
const context = useSlottedContext(TextAreaContext);
|
|
@@ -491,7 +499,7 @@ function FieldTextArea(t0) {
|
|
|
491
499
|
const value = typeof context?.value === "string" ? context.value : "";
|
|
492
500
|
const T0 = TextArea;
|
|
493
501
|
const t2 = placeholder ?? (box.label === "floating" ? " " : void 0);
|
|
494
|
-
const t3 = commitWhileInvalid(validation?.isInvalid ?? false, props$
|
|
502
|
+
const t3 = commitWhileInvalid(validation?.isInvalid ?? false, props$1.onInput);
|
|
495
503
|
let t4;
|
|
496
504
|
if ($[0] !== autosize || $[1] !== box) {
|
|
497
505
|
t4 = (state) => props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === "floating" && fieldChromeStyles.inputUnderFloatingLabel, fieldChromeStyles.textArea, autosize && fieldChromeStyles.textAreaAutosize, autosize && fieldChromeStyles.autosizeCell, state.isInvalid && fieldChromeStyles.inputInvalid, state.isDisabled && fieldChromeStyles.inputDisabled);
|
|
@@ -499,17 +507,17 @@ function FieldTextArea(t0) {
|
|
|
499
507
|
$[1] = box;
|
|
500
508
|
$[2] = t4;
|
|
501
509
|
} else t4 = $[2];
|
|
502
|
-
const t5 = mergeStatefulStyles(t4, props$
|
|
510
|
+
const t5 = mergeStatefulStyles(t4, props$1);
|
|
503
511
|
let t6;
|
|
504
|
-
if ($[3] !== T0 || $[4] !== props$
|
|
512
|
+
if ($[3] !== T0 || $[4] !== props$1 || $[5] !== t2 || $[6] !== t3 || $[7] !== t5) {
|
|
505
513
|
t6 = /* @__PURE__ */ jsx(T0, {
|
|
506
514
|
placeholder: t2,
|
|
507
|
-
...props$
|
|
515
|
+
...props$1,
|
|
508
516
|
onInput: t3,
|
|
509
517
|
...t5
|
|
510
518
|
});
|
|
511
519
|
$[3] = T0;
|
|
512
|
-
$[4] = props$
|
|
520
|
+
$[4] = props$1;
|
|
513
521
|
$[5] = t2;
|
|
514
522
|
$[6] = t3;
|
|
515
523
|
$[7] = t5;
|
|
@@ -599,19 +607,19 @@ function FieldTrigger(props$4) {
|
|
|
599
607
|
*/
|
|
600
608
|
function FieldValue(t0) {
|
|
601
609
|
const $ = c(3);
|
|
602
|
-
const { isFocused: t1, isPlaceholder: t2, ...props$
|
|
610
|
+
const { isFocused: t1, isPlaceholder: t2, ...props$5 } = t0;
|
|
603
611
|
const isFocused = t1 === void 0 ? false : t1;
|
|
604
612
|
const isPlaceholder = t2 === void 0 ? false : t2;
|
|
605
613
|
const box = useContext(BoxContext);
|
|
606
614
|
const hidden = isPlaceholder && box.label === "floating" && !isFocused;
|
|
607
|
-
const t3 = mergeStyles(props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props$
|
|
615
|
+
const t3 = mergeStyles(props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props$5);
|
|
608
616
|
let t4;
|
|
609
|
-
if ($[0] !== props$
|
|
617
|
+
if ($[0] !== props$5 || $[1] !== t3) {
|
|
610
618
|
t4 = /* @__PURE__ */ jsx("span", {
|
|
611
|
-
...props$
|
|
619
|
+
...props$5,
|
|
612
620
|
...t3
|
|
613
621
|
});
|
|
614
|
-
$[0] = props$
|
|
622
|
+
$[0] = props$5;
|
|
615
623
|
$[1] = t3;
|
|
616
624
|
$[2] = t4;
|
|
617
625
|
} else t4 = $[2];
|
|
@@ -644,12 +652,6 @@ function useFieldPopulated() {
|
|
|
644
652
|
const value = input?.value ?? textArea?.value ?? "";
|
|
645
653
|
return String(value).length > 0;
|
|
646
654
|
}
|
|
647
|
-
function withFocus(state, focused) {
|
|
648
|
-
return focused === state.isFocusWithin ? state : {
|
|
649
|
-
...state,
|
|
650
|
-
isFocusWithin: focused
|
|
651
|
-
};
|
|
652
|
-
}
|
|
653
655
|
/**
|
|
654
656
|
* Whether the control in this box is holding anything, read off React
|
|
655
657
|
* Aria's context for whichever control the field renders. The filled box
|
|
@@ -661,7 +663,6 @@ function withFocus(state, focused) {
|
|
|
661
663
|
* renders it. React Aria's `Label`, which the field around it associates with
|
|
662
664
|
* its control through context.
|
|
663
665
|
*/
|
|
664
|
-
const NO_STATE = {};
|
|
665
666
|
const REQUIRED_MARK = /* @__PURE__ */ jsx("span", {
|
|
666
667
|
"aria-hidden": "true",
|
|
667
668
|
children: "*"
|
|
@@ -674,21 +675,19 @@ function FieldLabel(t0) {
|
|
|
674
675
|
let t1;
|
|
675
676
|
let t2;
|
|
676
677
|
if ($[0] !== t0) {
|
|
677
|
-
const { children: t3,
|
|
678
|
+
const { children: t3, isDisabled: t4, isFocused: t5, isHovered: t6, isInvalid: t7, isRequired: t8, outlined: t9, variant: t10, ...props$3 } = t0;
|
|
678
679
|
children = t3;
|
|
679
|
-
|
|
680
|
-
const
|
|
681
|
-
const
|
|
682
|
-
const
|
|
683
|
-
|
|
684
|
-
const
|
|
685
|
-
const
|
|
686
|
-
const
|
|
687
|
-
const isInvalid = t11 === void 0 ? false : t11;
|
|
688
|
-
const hovered = !isDisabled && !isFocusWithin && isHovered;
|
|
680
|
+
const isDisabled = t4 === void 0 ? false : t4;
|
|
681
|
+
const isFocused = t5 === void 0 ? false : t5;
|
|
682
|
+
const isHovered = t6 === void 0 ? false : t6;
|
|
683
|
+
const isInvalid = t7 === void 0 ? false : t7;
|
|
684
|
+
isRequired = t8 === void 0 ? false : t8;
|
|
685
|
+
const outlined = t9 === void 0 ? false : t9;
|
|
686
|
+
const variant = t10 === void 0 ? "field" : t10;
|
|
687
|
+
const hovered = !isDisabled && !isFocused && isHovered;
|
|
689
688
|
T0 = Label;
|
|
690
|
-
t1 = props$
|
|
691
|
-
t2 = mergeStyles(props(fieldChromeStyles.label, variant === "group" && groupStyles.label, isDisabled && fieldChromeStyles.labelDisabled, isInvalid && fieldChromeStyles.labelError, !isDisabled && !isInvalid &&
|
|
689
|
+
t1 = props$3;
|
|
690
|
+
t2 = mergeStyles(props(fieldChromeStyles.label, variant === "group" && groupStyles.label, isDisabled && fieldChromeStyles.labelDisabled, isInvalid && fieldChromeStyles.labelError, !isDisabled && !isInvalid && isFocused && fieldChromeStyles.labelFocused, hovered && isInvalid && fieldChromeStyles.labelErrorHovered, hovered && !isInvalid && outlined && fieldChromeStyles.labelHovered), props$3);
|
|
692
691
|
$[0] = t0;
|
|
693
692
|
$[1] = T0;
|
|
694
693
|
$[2] = children;
|