@kanso-labs/kanso-ui 0.40.7 → 0.40.9
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/badge/index.js +15 -0
- package/dist/badge/index.js.map +1 -0
- package/dist/components/avatar/index.d.ts +7 -0
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.js +96 -48
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +6 -1
- package/dist/components/dialog/index.js +54 -24
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/form/index.d.ts +5 -4
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/link/index.js +16 -5
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/menu/index.js +29 -21
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/navigation-bar/index.js +134 -54
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/navigation-rail/index.js +56 -37
- package/dist/components/navigation-rail/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +13 -2
- package/dist/components/number-field/index.js +95 -84
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +4 -1
- package/dist/components/popover/index.js +239 -137
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/product-icon/index.d.ts +3 -1
- package/dist/components/product-icon/index.js.map +1 -1
- package/dist/components/progress-indicator/index.js +1 -1
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/search-field/index.js +7 -3
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +17 -1
- package/dist/components/segmented-button/index.js +132 -59
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/sheet/index.d.ts +8 -1
- package/dist/components/sheet/index.js +45 -29
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +4 -0
- package/dist/components/snackbar/index.js +54 -49
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/field/index.js +314 -284
- package/dist/field/index.js.map +1 -1
- package/dist/field/press.js +27 -0
- package/dist/field/press.js.map +1 -0
- package/dist/field/root.js +8 -8
- package/dist/field/root.js.map +1 -1
- package/dist/field/styles.js +22 -0
- package/dist/field/styles.js.map +1 -1
- package/dist/hooks/useBottomEdge.js +83 -0
- package/dist/hooks/useBottomEdge.js.map +1 -0
- package/dist/mark/initials.js +41 -26
- package/dist/mark/initials.js.map +1 -1
- package/dist/navigation/context.js.map +1 -1
- package/dist/navigation/index.js +16 -4
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/styles.js +35 -1
- package/dist/navigation/styles.js.map +1 -1
- package/dist/row/styles.js +2 -1
- package/dist/row/styles.js.map +1 -1
- package/dist/styles.css +110 -32
- package/package.json +2 -2
package/dist/field/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { props } from "../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
2
|
+
import { spacing } from "../tokens/design.tokens.stylex.js";
|
|
2
3
|
import { mergeStatefulStyles, mergeStyles } from "../styles/merge.js";
|
|
3
4
|
import { useMessages } from "../i18n/index.js";
|
|
5
|
+
import { focusesControl } from "./press.js";
|
|
4
6
|
import { useInsideForm } from "./root.js";
|
|
5
7
|
import { fieldChromeStyles, groupStyles } from "./styles.js";
|
|
6
8
|
import { c } from "react/compiler-runtime";
|
|
@@ -35,8 +37,9 @@ const BOX_CONTROLS = {
|
|
|
35
37
|
}
|
|
36
38
|
};
|
|
37
39
|
const BoxContext = createContext(OUTSIDE_BOX);
|
|
38
|
-
function boxContent(label, children, floatingLabel, isFocused, isPopulated, isRequired, leading, multiline, trailing, trigger, variant) {
|
|
40
|
+
function boxContent(label, children, endInset, floatingLabel, isFocused, isPopulated, isRequired, leading, multiline, trailing, trigger, variant) {
|
|
39
41
|
return (state) => /* @__PURE__ */ jsx(BoxContent, {
|
|
42
|
+
endInset,
|
|
40
43
|
floatingLabel,
|
|
41
44
|
isFocused,
|
|
42
45
|
isPopulated,
|
|
@@ -59,8 +62,8 @@ function boxContent(label, children, floatingLabel, isFocused, isPopulated, isRe
|
|
|
59
62
|
* for them. See the outlined variant's note above.
|
|
60
63
|
*/
|
|
61
64
|
function BoxContent(t0) {
|
|
62
|
-
const $ = c(
|
|
63
|
-
const { children, floatingLabel, isFocused, isPopulated, isRequired, label, leading, multiline, state, trailing, trigger, variant } = t0;
|
|
65
|
+
const $ = c(47);
|
|
66
|
+
const { children, endInset, floatingLabel, isFocused, isPopulated, isRequired, label, leading, multiline, state, trailing, trigger, variant } = t0;
|
|
64
67
|
const read = useFieldPopulated();
|
|
65
68
|
const populated = isPopulated ?? read;
|
|
66
69
|
const outlined = variant === "outlined";
|
|
@@ -68,98 +71,100 @@ function BoxContent(t0) {
|
|
|
68
71
|
const floated = !floatingLabel || focused || populated;
|
|
69
72
|
const t1 = BOX_CONTROLS[variant][floatingLabel ? "floating" : "fixed"];
|
|
70
73
|
let t2;
|
|
71
|
-
if ($[0] !==
|
|
74
|
+
if ($[0] !== endInset || $[1] !== floated || $[2] !== focused || $[3] !== isRequired || $[4] !== label || $[5] !== leading || $[6] !== outlined || $[7] !== trailing) {
|
|
72
75
|
t2 = outlined ? /* @__PURE__ */ jsx("fieldset", {
|
|
73
76
|
"aria-hidden": "true",
|
|
74
|
-
...props(fieldChromeStyles.outline, leading !== void 0 && fieldChromeStyles.outlineLeading, trailing !== void 0 && fieldChromeStyles.outlineTrailing, focused && fieldChromeStyles.outlineFocused),
|
|
77
|
+
...props(fieldChromeStyles.outline, leading !== void 0 && fieldChromeStyles.outlineLeading, trailing !== void 0 && fieldChromeStyles.outlineTrailing, focused && fieldChromeStyles.outlineFocused, endInset !== "0px" && fieldChromeStyles.outlineEndInset(`calc(${spacing.lg} - ${spacing.xs} + ${endInset})`)),
|
|
75
78
|
children: /* @__PURE__ */ jsx("legend", {
|
|
76
79
|
...props(fieldChromeStyles.outlineNotch, floated && fieldChromeStyles.outlineNotchOpen),
|
|
77
80
|
children: floated ? /* @__PURE__ */ jsxs(Fragment$1, { children: [label, isRequired ? REQUIRED_MARK : null] }) : null
|
|
78
81
|
})
|
|
79
82
|
}) : null;
|
|
80
|
-
$[0] =
|
|
81
|
-
$[1] =
|
|
82
|
-
$[2] =
|
|
83
|
-
$[3] =
|
|
84
|
-
$[4] =
|
|
85
|
-
$[5] =
|
|
86
|
-
$[6] =
|
|
87
|
-
$[7] =
|
|
88
|
-
|
|
83
|
+
$[0] = endInset;
|
|
84
|
+
$[1] = floated;
|
|
85
|
+
$[2] = focused;
|
|
86
|
+
$[3] = isRequired;
|
|
87
|
+
$[4] = label;
|
|
88
|
+
$[5] = leading;
|
|
89
|
+
$[6] = outlined;
|
|
90
|
+
$[7] = trailing;
|
|
91
|
+
$[8] = t2;
|
|
92
|
+
} else t2 = $[8];
|
|
89
93
|
let t3;
|
|
90
|
-
if ($[
|
|
94
|
+
if ($[9] !== leading || $[10] !== multiline || $[11] !== outlined || $[12] !== state.isDisabled) {
|
|
91
95
|
t3 = leading === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
92
96
|
...props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isDisabled && fieldChromeStyles.iconDisabled),
|
|
93
97
|
children: leading
|
|
94
98
|
});
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
} else t3 = $[
|
|
99
|
+
$[9] = leading;
|
|
100
|
+
$[10] = multiline;
|
|
101
|
+
$[11] = outlined;
|
|
102
|
+
$[12] = state.isDisabled;
|
|
103
|
+
$[13] = t3;
|
|
104
|
+
} else t3 = $[13];
|
|
101
105
|
let t4;
|
|
102
|
-
if ($[
|
|
106
|
+
if ($[14] !== floatingLabel || $[15] !== state.isDisabled) {
|
|
103
107
|
t4 = props(fieldChromeStyles.column, floatingLabel && fieldChromeStyles.columnFloating, state.isDisabled && (floatingLabel ? fieldChromeStyles.columnDisabledFloating : fieldChromeStyles.columnDisabled));
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
$[
|
|
107
|
-
} else t4 = $[
|
|
108
|
+
$[14] = floatingLabel;
|
|
109
|
+
$[15] = state.isDisabled;
|
|
110
|
+
$[16] = t4;
|
|
111
|
+
} else t4 = $[16];
|
|
108
112
|
let t5;
|
|
109
|
-
if ($[
|
|
113
|
+
if ($[17] !== focused || $[18] !== state) {
|
|
110
114
|
t5 = withFocus(state, focused);
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
} else t5 = $[
|
|
115
|
+
$[17] = focused;
|
|
116
|
+
$[18] = state;
|
|
117
|
+
$[19] = t5;
|
|
118
|
+
} else t5 = $[19];
|
|
115
119
|
let t6;
|
|
116
|
-
if ($[
|
|
117
|
-
t6 = props(fieldChromeStyles.boxLabel, floatingLabel && floated && fieldChromeStyles.boxLabelFloated, outlined && fieldChromeStyles.boxLabelOutlined, outlined && floated && fieldChromeStyles.boxLabelOutlinedFloated);
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
121
|
-
$[
|
|
122
|
-
|
|
120
|
+
if ($[20] !== endInset || $[21] !== floated || $[22] !== floatingLabel || $[23] !== outlined) {
|
|
121
|
+
t6 = 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})`));
|
|
122
|
+
$[20] = endInset;
|
|
123
|
+
$[21] = floated;
|
|
124
|
+
$[22] = floatingLabel;
|
|
125
|
+
$[23] = outlined;
|
|
126
|
+
$[24] = t6;
|
|
127
|
+
} else t6 = $[24];
|
|
123
128
|
let t7;
|
|
124
|
-
if ($[
|
|
129
|
+
if ($[25] !== isRequired || $[26] !== label || $[27] !== t5 || $[28] !== t6) {
|
|
125
130
|
t7 = /* @__PURE__ */ jsx(FieldLabel, {
|
|
126
131
|
isRequired,
|
|
127
132
|
state: t5,
|
|
128
133
|
...t6,
|
|
129
134
|
children: label
|
|
130
135
|
});
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
} else t7 = $[
|
|
136
|
+
$[25] = isRequired;
|
|
137
|
+
$[26] = label;
|
|
138
|
+
$[27] = t5;
|
|
139
|
+
$[28] = t6;
|
|
140
|
+
$[29] = t7;
|
|
141
|
+
} else t7 = $[29];
|
|
137
142
|
let t8;
|
|
138
|
-
if ($[
|
|
143
|
+
if ($[30] !== children || $[31] !== t4 || $[32] !== t7) {
|
|
139
144
|
t8 = /* @__PURE__ */ jsxs("div", {
|
|
140
145
|
...t4,
|
|
141
146
|
children: [t7, children]
|
|
142
147
|
});
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
} else t8 = $[
|
|
148
|
+
$[30] = children;
|
|
149
|
+
$[31] = t4;
|
|
150
|
+
$[32] = t7;
|
|
151
|
+
$[33] = t8;
|
|
152
|
+
} else t8 = $[33];
|
|
148
153
|
let t9;
|
|
149
|
-
if ($[
|
|
154
|
+
if ($[34] !== multiline || $[35] !== outlined || $[36] !== state.isDisabled || $[37] !== state.isInvalid || $[38] !== trailing) {
|
|
150
155
|
t9 = trailing === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
151
156
|
...props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isInvalid && fieldChromeStyles.iconError, state.isDisabled && fieldChromeStyles.iconDisabled),
|
|
152
157
|
children: trailing
|
|
153
158
|
});
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
} else t9 = $[
|
|
159
|
+
$[34] = multiline;
|
|
160
|
+
$[35] = outlined;
|
|
161
|
+
$[36] = state.isDisabled;
|
|
162
|
+
$[37] = state.isInvalid;
|
|
163
|
+
$[38] = trailing;
|
|
164
|
+
$[39] = t9;
|
|
165
|
+
} else t9 = $[39];
|
|
161
166
|
let t10;
|
|
162
|
-
if ($[
|
|
167
|
+
if ($[40] !== t1 || $[41] !== t2 || $[42] !== t3 || $[43] !== t8 || $[44] !== t9 || $[45] !== trigger) {
|
|
163
168
|
t10 = /* @__PURE__ */ jsxs(BoxContext, {
|
|
164
169
|
value: t1,
|
|
165
170
|
children: [
|
|
@@ -170,14 +175,14 @@ function BoxContent(t0) {
|
|
|
170
175
|
t9
|
|
171
176
|
]
|
|
172
177
|
});
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
$[
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
} else t10 = $[
|
|
178
|
+
$[40] = t1;
|
|
179
|
+
$[41] = t2;
|
|
180
|
+
$[42] = t3;
|
|
181
|
+
$[43] = t8;
|
|
182
|
+
$[44] = t9;
|
|
183
|
+
$[45] = trigger;
|
|
184
|
+
$[46] = t10;
|
|
185
|
+
} else t10 = $[46];
|
|
181
186
|
return t10;
|
|
182
187
|
}
|
|
183
188
|
function boxStyles(floatingLabel, isFocused, multiline, leading, trailing, variant) {
|
|
@@ -185,6 +190,29 @@ function boxStyles(floatingLabel, isFocused, multiline, leading, trailing, varia
|
|
|
185
190
|
return (state) => props(fieldChromeStyles.box, floatingLabel ? fieldChromeStyles.boxFloating : fieldChromeStyles.boxFixed, multiline && fieldChromeStyles.boxMultiline, leading && fieldChromeStyles.boxLeading, trailing && fieldChromeStyles.boxTrailing, outlined && fieldChromeStyles.boxOutlined, outlined && floatingLabel && fieldChromeStyles.boxOutlinedFloating, outlined && multiline && fieldChromeStyles.boxOutlinedMultiline, state.isInvalid && (outlined ? fieldChromeStyles.boxOutlinedError : fieldChromeStyles.boxError), outlined && state.isHovered && (state.isInvalid ? fieldChromeStyles.boxOutlinedErrorHovered : fieldChromeStyles.boxOutlinedHovered), isFocused && focusedStyle(outlined, state.isInvalid), state.isDisabled && (outlined ? fieldChromeStyles.boxOutlinedDisabled : fieldChromeStyles.boxDisabled));
|
|
186
191
|
}
|
|
187
192
|
/**
|
|
193
|
+
* The control's `onInput`, which also commits the field's validation while it
|
|
194
|
+
* shows an error, so an edit that fixes the value clears the error as it is
|
|
195
|
+
* typed rather than once focus leaves.
|
|
196
|
+
*
|
|
197
|
+
* React Aria commits a field's validation — the moment a server's error is
|
|
198
|
+
* cleared, or the browser's own is checked again — on the control's native
|
|
199
|
+
* `change` event, and a text control fires that only on blur. So a reader
|
|
200
|
+
* typing the fix saw the error, red and `aria-invalid`, until they tabbed
|
|
201
|
+
* away from a value that was already right. Re-dispatching `change` on input
|
|
202
|
+
* is what commits early, through React Aria's own listener.
|
|
203
|
+
*
|
|
204
|
+
* Only while the field is invalid. A valid field still commits on blur, so
|
|
205
|
+
* nothing new is flagged in the middle of typing a value: an error is shown
|
|
206
|
+
* late and taken back early. React's `onChange` does not run a second time
|
|
207
|
+
* for it, since the value it tracks has not moved since the input.
|
|
208
|
+
*/
|
|
209
|
+
function commitWhileInvalid(isInvalid, onInput) {
|
|
210
|
+
return (event) => {
|
|
211
|
+
onInput?.(event);
|
|
212
|
+
if (isInvalid) event.currentTarget.dispatchEvent(new Event("change", { bubbles: true }));
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
188
216
|
* The box a control sits in, filled or outlined, with its label. React
|
|
189
217
|
* Aria's `Group`, so
|
|
190
218
|
* the field around it hands down `isDisabled` and `isInvalid` through context
|
|
@@ -193,9 +221,10 @@ function boxStyles(floatingLabel, isFocused, multiline, leading, trailing, varia
|
|
|
193
221
|
* on a button rather than an input — passes the two states itself.
|
|
194
222
|
*/
|
|
195
223
|
function FieldBox(t0) {
|
|
196
|
-
const $ = c(
|
|
224
|
+
const $ = c(36);
|
|
197
225
|
let T0;
|
|
198
226
|
let children;
|
|
227
|
+
let endInset;
|
|
199
228
|
let floatingLabel;
|
|
200
229
|
let isFocused;
|
|
201
230
|
let isPopulated;
|
|
@@ -210,18 +239,19 @@ function FieldBox(t0) {
|
|
|
210
239
|
let trigger;
|
|
211
240
|
let variant;
|
|
212
241
|
if ($[0] !== t0) {
|
|
213
|
-
const { children: t4,
|
|
242
|
+
const { children: t4, endInset: t5, floatingLabel: t6, isFocused: t7, isPopulated: t8, isRequired: t9, label: t10, leading: t11, multiline: t12, trailing: t13, trigger: t14, variant: t15, ...props } = t0;
|
|
214
243
|
children = t4;
|
|
215
|
-
isPopulated =
|
|
216
|
-
label =
|
|
217
|
-
leading =
|
|
218
|
-
trailing =
|
|
219
|
-
trigger =
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
244
|
+
isPopulated = t8;
|
|
245
|
+
label = t10;
|
|
246
|
+
leading = t11;
|
|
247
|
+
trailing = t13;
|
|
248
|
+
trigger = t14;
|
|
249
|
+
endInset = t5 === void 0 ? "0px" : t5;
|
|
250
|
+
floatingLabel = t6 === void 0 ? true : t6;
|
|
251
|
+
isFocused = t7 === void 0 ? false : t7;
|
|
252
|
+
isRequired = t9 === void 0 ? false : t9;
|
|
253
|
+
multiline = t12 === void 0 ? false : t12;
|
|
254
|
+
variant = t15 === void 0 ? "filled" : t15;
|
|
225
255
|
T0 = Group;
|
|
226
256
|
t1 = props;
|
|
227
257
|
t2 = trigger === void 0 ? focusesControl(props.onPointerDown) : props.onPointerDown;
|
|
@@ -229,70 +259,72 @@ function FieldBox(t0) {
|
|
|
229
259
|
$[0] = t0;
|
|
230
260
|
$[1] = T0;
|
|
231
261
|
$[2] = children;
|
|
232
|
-
$[3] =
|
|
233
|
-
$[4] =
|
|
234
|
-
$[5] =
|
|
235
|
-
$[6] =
|
|
236
|
-
$[7] =
|
|
237
|
-
$[8] =
|
|
238
|
-
$[9] =
|
|
239
|
-
$[10] =
|
|
240
|
-
$[11] =
|
|
241
|
-
$[12] =
|
|
242
|
-
$[13] =
|
|
243
|
-
$[14] =
|
|
244
|
-
$[15] =
|
|
262
|
+
$[3] = endInset;
|
|
263
|
+
$[4] = floatingLabel;
|
|
264
|
+
$[5] = isFocused;
|
|
265
|
+
$[6] = isPopulated;
|
|
266
|
+
$[7] = isRequired;
|
|
267
|
+
$[8] = label;
|
|
268
|
+
$[9] = leading;
|
|
269
|
+
$[10] = multiline;
|
|
270
|
+
$[11] = t1;
|
|
271
|
+
$[12] = t2;
|
|
272
|
+
$[13] = t3;
|
|
273
|
+
$[14] = trailing;
|
|
274
|
+
$[15] = trigger;
|
|
275
|
+
$[16] = variant;
|
|
245
276
|
} else {
|
|
246
277
|
T0 = $[1];
|
|
247
278
|
children = $[2];
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
279
|
+
endInset = $[3];
|
|
280
|
+
floatingLabel = $[4];
|
|
281
|
+
isFocused = $[5];
|
|
282
|
+
isPopulated = $[6];
|
|
283
|
+
isRequired = $[7];
|
|
284
|
+
label = $[8];
|
|
285
|
+
leading = $[9];
|
|
286
|
+
multiline = $[10];
|
|
287
|
+
t1 = $[11];
|
|
288
|
+
t2 = $[12];
|
|
289
|
+
t3 = $[13];
|
|
290
|
+
trailing = $[14];
|
|
291
|
+
trigger = $[15];
|
|
292
|
+
variant = $[16];
|
|
261
293
|
}
|
|
262
294
|
let t4;
|
|
263
|
-
if ($[
|
|
264
|
-
t4 = boxContent(label, children, floatingLabel, isFocused, isPopulated, isRequired, leading, multiline, trailing, trigger, variant);
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
|
|
295
|
+
if ($[17] !== children || $[18] !== endInset || $[19] !== floatingLabel || $[20] !== isFocused || $[21] !== isPopulated || $[22] !== isRequired || $[23] !== label || $[24] !== leading || $[25] !== multiline || $[26] !== trailing || $[27] !== trigger || $[28] !== variant) {
|
|
296
|
+
t4 = boxContent(label, children, endInset, floatingLabel, isFocused, isPopulated, isRequired, leading, multiline, trailing, trigger, variant);
|
|
297
|
+
$[17] = children;
|
|
298
|
+
$[18] = endInset;
|
|
299
|
+
$[19] = floatingLabel;
|
|
300
|
+
$[20] = isFocused;
|
|
301
|
+
$[21] = isPopulated;
|
|
302
|
+
$[22] = isRequired;
|
|
303
|
+
$[23] = label;
|
|
304
|
+
$[24] = leading;
|
|
305
|
+
$[25] = multiline;
|
|
306
|
+
$[26] = trailing;
|
|
307
|
+
$[27] = trigger;
|
|
308
|
+
$[28] = variant;
|
|
309
|
+
$[29] = t4;
|
|
310
|
+
} else t4 = $[29];
|
|
278
311
|
let t5;
|
|
279
|
-
if ($[
|
|
312
|
+
if ($[30] !== T0 || $[31] !== t1 || $[32] !== t2 || $[33] !== t3 || $[34] !== t4) {
|
|
280
313
|
t5 = /* @__PURE__ */ jsx(T0, {
|
|
281
314
|
...t1,
|
|
282
315
|
onPointerDown: t2,
|
|
283
316
|
...t3,
|
|
284
317
|
children: t4
|
|
285
318
|
});
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
} else t5 = $[
|
|
319
|
+
$[30] = T0;
|
|
320
|
+
$[31] = t1;
|
|
321
|
+
$[32] = t2;
|
|
322
|
+
$[33] = t3;
|
|
323
|
+
$[34] = t4;
|
|
324
|
+
$[35] = t5;
|
|
325
|
+
} else t5 = $[35];
|
|
293
326
|
return t5;
|
|
294
327
|
}
|
|
295
|
-
const PRESSABLE = "a, button, input, textarea, select, [role=\"button\"], [contenteditable=\"true\"]";
|
|
296
328
|
/**
|
|
297
329
|
* A field's text control, in a {@link FieldBox} or on its own. React Aria's
|
|
298
330
|
* `Input`, which takes its label association, value and validation from the
|
|
@@ -305,76 +337,80 @@ const PRESSABLE = "a, button, input, textarea, select, [role=\"button\"], [conte
|
|
|
305
337
|
* placeholder it was given in every state.
|
|
306
338
|
*/
|
|
307
339
|
function FieldInput(t0) {
|
|
308
|
-
const $ = c(
|
|
340
|
+
const $ = c(20);
|
|
309
341
|
const { numeric: t1, placeholder, prefix, suffix, ...props$3 } = t0;
|
|
310
342
|
const numeric = t1 === void 0 ? false : t1;
|
|
311
343
|
const box = useContext(BoxContext);
|
|
344
|
+
const validation = useContext(FieldErrorContext);
|
|
312
345
|
const T0 = Input;
|
|
313
346
|
const t2 = placeholder ?? (box.label === "floating" ? " " : void 0);
|
|
314
|
-
|
|
347
|
+
const t3 = commitWhileInvalid(validation?.isInvalid ?? false, props$3.onInput);
|
|
348
|
+
let t4;
|
|
315
349
|
if ($[0] !== box || $[1] !== numeric) {
|
|
316
|
-
|
|
350
|
+
t4 = (state) => props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === "floating" && fieldChromeStyles.inputUnderFloatingLabel, numeric && fieldChromeStyles.numeric, state.isDisabled && fieldChromeStyles.inputDisabled);
|
|
317
351
|
$[0] = box;
|
|
318
352
|
$[1] = numeric;
|
|
319
|
-
$[2] =
|
|
320
|
-
} else
|
|
321
|
-
const
|
|
322
|
-
let
|
|
323
|
-
if ($[3] !== T0 || $[4] !== props$3 || $[5] !== t2 || $[6] !==
|
|
324
|
-
|
|
353
|
+
$[2] = t4;
|
|
354
|
+
} else t4 = $[2];
|
|
355
|
+
const t5 = mergeStatefulStyles(t4, props$3);
|
|
356
|
+
let t6;
|
|
357
|
+
if ($[3] !== T0 || $[4] !== props$3 || $[5] !== t2 || $[6] !== t3 || $[7] !== t5) {
|
|
358
|
+
t6 = /* @__PURE__ */ jsx(T0, {
|
|
325
359
|
placeholder: t2,
|
|
326
360
|
...props$3,
|
|
327
|
-
|
|
361
|
+
onInput: t3,
|
|
362
|
+
...t5
|
|
328
363
|
});
|
|
329
364
|
$[3] = T0;
|
|
330
365
|
$[4] = props$3;
|
|
331
366
|
$[5] = t2;
|
|
332
|
-
$[6] =
|
|
367
|
+
$[6] = t3;
|
|
333
368
|
$[7] = t5;
|
|
334
|
-
} else t5 = $[7];
|
|
335
|
-
const control = t5;
|
|
336
|
-
if (prefix === void 0 && suffix === void 0) return control;
|
|
337
|
-
let t6;
|
|
338
|
-
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
339
|
-
t6 = props(fieldChromeStyles.affixLine);
|
|
340
369
|
$[8] = t6;
|
|
341
370
|
} else t6 = $[8];
|
|
371
|
+
const control = t6;
|
|
372
|
+
if (prefix === void 0 && suffix === void 0) return control;
|
|
342
373
|
let t7;
|
|
343
|
-
if ($[9]
|
|
344
|
-
t7 =
|
|
374
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
375
|
+
t7 = props(fieldChromeStyles.affixLine);
|
|
376
|
+
$[9] = t7;
|
|
377
|
+
} else t7 = $[9];
|
|
378
|
+
let t8;
|
|
379
|
+
if ($[10] !== box || $[11] !== prefix) {
|
|
380
|
+
t8 = prefix === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
345
381
|
...props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel),
|
|
346
382
|
children: prefix
|
|
347
383
|
});
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
350
|
-
$[
|
|
351
|
-
} else
|
|
352
|
-
let
|
|
353
|
-
if ($[
|
|
354
|
-
|
|
384
|
+
$[10] = box;
|
|
385
|
+
$[11] = prefix;
|
|
386
|
+
$[12] = t8;
|
|
387
|
+
} else t8 = $[12];
|
|
388
|
+
let t9;
|
|
389
|
+
if ($[13] !== box || $[14] !== suffix) {
|
|
390
|
+
t9 = suffix === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
355
391
|
...props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel),
|
|
356
392
|
children: suffix
|
|
357
393
|
});
|
|
358
|
-
$[
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
} else
|
|
362
|
-
let
|
|
363
|
-
if ($[
|
|
364
|
-
|
|
365
|
-
...
|
|
394
|
+
$[13] = box;
|
|
395
|
+
$[14] = suffix;
|
|
396
|
+
$[15] = t9;
|
|
397
|
+
} else t9 = $[15];
|
|
398
|
+
let t10;
|
|
399
|
+
if ($[16] !== control || $[17] !== t8 || $[18] !== t9) {
|
|
400
|
+
t10 = /* @__PURE__ */ jsxs("span", {
|
|
401
|
+
...t7,
|
|
366
402
|
children: [
|
|
367
|
-
|
|
403
|
+
t8,
|
|
368
404
|
control,
|
|
369
|
-
|
|
405
|
+
t9
|
|
370
406
|
]
|
|
371
407
|
});
|
|
372
|
-
$[
|
|
373
|
-
$[16] = t7;
|
|
408
|
+
$[16] = control;
|
|
374
409
|
$[17] = t8;
|
|
375
410
|
$[18] = t9;
|
|
376
|
-
|
|
377
|
-
|
|
411
|
+
$[19] = t10;
|
|
412
|
+
} else t10 = $[19];
|
|
413
|
+
return t10;
|
|
378
414
|
}
|
|
379
415
|
/**
|
|
380
416
|
* A date or a time's segments, in a {@link FieldBox}: React Aria's
|
|
@@ -425,70 +461,74 @@ function FieldSegments(t0) {
|
|
|
425
461
|
* of the two is taller.
|
|
426
462
|
*/
|
|
427
463
|
function FieldTextArea(t0) {
|
|
428
|
-
const $ = c(
|
|
429
|
-
const { autosize: t1, placeholder, ...props$
|
|
464
|
+
const $ = c(18);
|
|
465
|
+
const { autosize: t1, placeholder, ...props$1 } = t0;
|
|
430
466
|
const autosize = t1 === void 0 ? false : t1;
|
|
431
467
|
const box = useContext(BoxContext);
|
|
432
468
|
const context = useSlottedContext(TextAreaContext);
|
|
469
|
+
const validation = useContext(FieldErrorContext);
|
|
433
470
|
const value = typeof context?.value === "string" ? context.value : "";
|
|
434
471
|
const T0 = TextArea;
|
|
435
472
|
const t2 = placeholder ?? (box.label === "floating" ? " " : void 0);
|
|
436
|
-
|
|
473
|
+
const t3 = commitWhileInvalid(validation?.isInvalid ?? false, props$1.onInput);
|
|
474
|
+
let t4;
|
|
437
475
|
if ($[0] !== autosize || $[1] !== box) {
|
|
438
|
-
|
|
476
|
+
t4 = (state) => props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === "floating" && fieldChromeStyles.inputUnderFloatingLabel, fieldChromeStyles.textArea, autosize && fieldChromeStyles.textAreaAutosize, autosize && fieldChromeStyles.autosizeCell, state.isDisabled && fieldChromeStyles.inputDisabled);
|
|
439
477
|
$[0] = autosize;
|
|
440
478
|
$[1] = box;
|
|
441
|
-
$[2] =
|
|
442
|
-
} else
|
|
443
|
-
const
|
|
444
|
-
let
|
|
445
|
-
if ($[3] !== T0 || $[4] !== props$
|
|
446
|
-
|
|
479
|
+
$[2] = t4;
|
|
480
|
+
} else t4 = $[2];
|
|
481
|
+
const t5 = mergeStatefulStyles(t4, props$1);
|
|
482
|
+
let t6;
|
|
483
|
+
if ($[3] !== T0 || $[4] !== props$1 || $[5] !== t2 || $[6] !== t3 || $[7] !== t5) {
|
|
484
|
+
t6 = /* @__PURE__ */ jsx(T0, {
|
|
447
485
|
placeholder: t2,
|
|
448
|
-
...props$
|
|
449
|
-
|
|
486
|
+
...props$1,
|
|
487
|
+
onInput: t3,
|
|
488
|
+
...t5
|
|
450
489
|
});
|
|
451
490
|
$[3] = T0;
|
|
452
|
-
$[4] = props$
|
|
491
|
+
$[4] = props$1;
|
|
453
492
|
$[5] = t2;
|
|
454
|
-
$[6] =
|
|
493
|
+
$[6] = t3;
|
|
455
494
|
$[7] = t5;
|
|
456
|
-
} else t5 = $[7];
|
|
457
|
-
const control = t5;
|
|
458
|
-
if (!autosize) return control;
|
|
459
|
-
let t6;
|
|
460
|
-
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
461
|
-
t6 = props(fieldChromeStyles.autosize);
|
|
462
495
|
$[8] = t6;
|
|
463
496
|
} else t6 = $[8];
|
|
497
|
+
const control = t6;
|
|
498
|
+
if (!autosize) return control;
|
|
464
499
|
let t7;
|
|
465
|
-
if ($[9]
|
|
466
|
-
t7 = props(fieldChromeStyles.
|
|
467
|
-
$[9] =
|
|
468
|
-
|
|
469
|
-
} else t7 = $[10];
|
|
500
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
501
|
+
t7 = props(fieldChromeStyles.autosize);
|
|
502
|
+
$[9] = t7;
|
|
503
|
+
} else t7 = $[9];
|
|
470
504
|
let t8;
|
|
471
|
-
if ($[
|
|
472
|
-
t8 =
|
|
505
|
+
if ($[10] !== box.underLabel) {
|
|
506
|
+
t8 = props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, fieldChromeStyles.replica, fieldChromeStyles.autosizeCell);
|
|
507
|
+
$[10] = box.underLabel;
|
|
508
|
+
$[11] = t8;
|
|
509
|
+
} else t8 = $[11];
|
|
510
|
+
let t9;
|
|
511
|
+
if ($[12] !== t8 || $[13] !== value) {
|
|
512
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
473
513
|
"aria-hidden": "true",
|
|
474
|
-
...
|
|
514
|
+
...t8,
|
|
475
515
|
children: [value, " "]
|
|
476
516
|
});
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
$[
|
|
480
|
-
} else
|
|
481
|
-
let
|
|
482
|
-
if ($[
|
|
483
|
-
|
|
484
|
-
...
|
|
485
|
-
children: [control,
|
|
517
|
+
$[12] = t8;
|
|
518
|
+
$[13] = value;
|
|
519
|
+
$[14] = t9;
|
|
520
|
+
} else t9 = $[14];
|
|
521
|
+
let t10;
|
|
522
|
+
if ($[15] !== control || $[16] !== t9) {
|
|
523
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
524
|
+
...t7,
|
|
525
|
+
children: [control, t9]
|
|
486
526
|
});
|
|
487
|
-
$[
|
|
488
|
-
$[15] = t8;
|
|
527
|
+
$[15] = control;
|
|
489
528
|
$[16] = t9;
|
|
490
|
-
|
|
491
|
-
|
|
529
|
+
$[17] = t10;
|
|
530
|
+
} else t10 = $[17];
|
|
531
|
+
return t10;
|
|
492
532
|
}
|
|
493
533
|
/**
|
|
494
534
|
* The press target over a {@link FieldBox} whose whole surface opens
|
|
@@ -500,21 +540,21 @@ function FieldTextArea(t0) {
|
|
|
500
540
|
* the fill, the underline and the focus indicator, and it lights up while
|
|
501
541
|
* this has focus because the indicator follows focus within.
|
|
502
542
|
*/
|
|
503
|
-
function FieldTrigger(props$
|
|
543
|
+
function FieldTrigger(props$2) {
|
|
504
544
|
const $ = c(5);
|
|
505
545
|
let t0;
|
|
506
|
-
if ($[0] !== props$
|
|
507
|
-
t0 = mergeStatefulStyles(props(fieldChromeStyles.trigger), props$
|
|
508
|
-
$[0] = props$
|
|
546
|
+
if ($[0] !== props$2) {
|
|
547
|
+
t0 = mergeStatefulStyles(props(fieldChromeStyles.trigger), props$2);
|
|
548
|
+
$[0] = props$2;
|
|
509
549
|
$[1] = t0;
|
|
510
550
|
} else t0 = $[1];
|
|
511
551
|
let t1;
|
|
512
|
-
if ($[2] !== props$
|
|
552
|
+
if ($[2] !== props$2 || $[3] !== t0) {
|
|
513
553
|
t1 = /* @__PURE__ */ jsx(Button, {
|
|
514
|
-
...props$
|
|
554
|
+
...props$2,
|
|
515
555
|
...t0
|
|
516
556
|
});
|
|
517
|
-
$[2] = props$
|
|
557
|
+
$[2] = props$2;
|
|
518
558
|
$[3] = t0;
|
|
519
559
|
$[4] = t1;
|
|
520
560
|
} else t1 = $[4];
|
|
@@ -538,19 +578,19 @@ function FieldTrigger(props$5) {
|
|
|
538
578
|
*/
|
|
539
579
|
function FieldValue(t0) {
|
|
540
580
|
const $ = c(3);
|
|
541
|
-
const { isFocused: t1, isPlaceholder: t2, ...props$
|
|
581
|
+
const { isFocused: t1, isPlaceholder: t2, ...props$4 } = t0;
|
|
542
582
|
const isFocused = t1 === void 0 ? false : t1;
|
|
543
583
|
const isPlaceholder = t2 === void 0 ? false : t2;
|
|
544
584
|
const box = useContext(BoxContext);
|
|
545
585
|
const hidden = isPlaceholder && box.label === "floating" && !isFocused;
|
|
546
|
-
const t3 = mergeStyles(props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props$
|
|
586
|
+
const t3 = mergeStyles(props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props$4);
|
|
547
587
|
let t4;
|
|
548
|
-
if ($[0] !== props$
|
|
588
|
+
if ($[0] !== props$4 || $[1] !== t3) {
|
|
549
589
|
t4 = /* @__PURE__ */ jsx("span", {
|
|
550
|
-
...props$
|
|
590
|
+
...props$4,
|
|
551
591
|
...t3
|
|
552
592
|
});
|
|
553
|
-
$[0] = props$
|
|
593
|
+
$[0] = props$4;
|
|
554
594
|
$[1] = t3;
|
|
555
595
|
$[2] = t4;
|
|
556
596
|
} else t4 = $[2];
|
|
@@ -560,27 +600,6 @@ function focusedStyle(outlined, invalid) {
|
|
|
560
600
|
if (outlined) return invalid ? fieldChromeStyles.boxOutlinedErrorFocused : fieldChromeStyles.boxOutlinedFocused;
|
|
561
601
|
return invalid ? fieldChromeStyles.boxErrorFocused : fieldChromeStyles.boxFocused;
|
|
562
602
|
}
|
|
563
|
-
const CONTROL = "input:not([type=\"hidden\"]), textarea, [contenteditable=\"true\"]";
|
|
564
|
-
/**
|
|
565
|
-
* The box's press handler: a press anywhere on the box focuses the control
|
|
566
|
-
* in it, as the whole of a native text field's box does. The box is 56dp
|
|
567
|
-
* and the control's line 24dp of it, so the padding above and below the
|
|
568
|
-
* line, the padding at either end and the icons were dead to a press —
|
|
569
|
-
* nothing took focus, and nothing said why. Built by a call rather than
|
|
570
|
-
* written at the prop, which is what react-perf's no-new-function-as-prop is
|
|
571
|
-
* after; the React Compiler memoises it on the call site's own handler,
|
|
572
|
-
* which runs first.
|
|
573
|
-
*/
|
|
574
|
-
function focusesControl(onPointerDown) {
|
|
575
|
-
return (event) => {
|
|
576
|
-
onPointerDown?.(event);
|
|
577
|
-
if (event.defaultPrevented || event.button !== 0 || !(event.target instanceof Element) || event.target.closest(PRESSABLE) !== null) return;
|
|
578
|
-
const control = event.currentTarget.querySelector(CONTROL);
|
|
579
|
-
if (control === null || control.matches(":disabled")) return;
|
|
580
|
-
event.preventDefault();
|
|
581
|
-
control.focus();
|
|
582
|
-
};
|
|
583
|
-
}
|
|
584
603
|
function returnToStart(event) {
|
|
585
604
|
if (!event.currentTarget.contains(event.relatedTarget)) event.currentTarget.scrollLeft = 0;
|
|
586
605
|
}
|
|
@@ -622,7 +641,7 @@ function FieldLabel(t0) {
|
|
|
622
641
|
let t1;
|
|
623
642
|
let t2;
|
|
624
643
|
if ($[0] !== t0) {
|
|
625
|
-
const { children: t3, isRequired: t4, state: t5, variant: t6, ...props$
|
|
644
|
+
const { children: t3, isRequired: t4, state: t5, variant: t6, ...props$5 } = t0;
|
|
626
645
|
children = t3;
|
|
627
646
|
isRequired = t4 === void 0 ? false : t4;
|
|
628
647
|
const state = t5 === void 0 ? NO_STATE : t5;
|
|
@@ -632,8 +651,8 @@ function FieldLabel(t0) {
|
|
|
632
651
|
const isFocusWithin = t8 === void 0 ? false : t8;
|
|
633
652
|
const isInvalid = t9 === void 0 ? false : t9;
|
|
634
653
|
T0 = Label;
|
|
635
|
-
t1 = props$
|
|
636
|
-
t2 = mergeStyles(props(fieldChromeStyles.label, variant === "group" && groupStyles.label, isDisabled && fieldChromeStyles.labelDisabled, isInvalid && fieldChromeStyles.labelError, !isDisabled && !isInvalid && isFocusWithin && fieldChromeStyles.labelFocused), props$
|
|
654
|
+
t1 = props$5;
|
|
655
|
+
t2 = mergeStyles(props(fieldChromeStyles.label, variant === "group" && groupStyles.label, isDisabled && fieldChromeStyles.labelDisabled, isInvalid && fieldChromeStyles.labelError, !isDisabled && !isInvalid && isFocusWithin && fieldChromeStyles.labelFocused), props$5);
|
|
637
656
|
$[0] = t0;
|
|
638
657
|
$[1] = T0;
|
|
639
658
|
$[2] = children;
|
|
@@ -674,7 +693,7 @@ function FieldLabel(t0) {
|
|
|
674
693
|
* the field's validation state is read for.
|
|
675
694
|
*/
|
|
676
695
|
function FieldMessage(t0) {
|
|
677
|
-
const $ = c(
|
|
696
|
+
const $ = c(34);
|
|
678
697
|
const { characterCount: t1, characterLimitLabel, description, error, errorId, inset: t2, maxLength, reserve: t3 } = t0;
|
|
679
698
|
const characterCount = t1 === void 0 ? false : t1;
|
|
680
699
|
const inset = t2 === void 0 ? true : t2;
|
|
@@ -709,7 +728,7 @@ function FieldMessage(t0) {
|
|
|
709
728
|
$[5] = t5;
|
|
710
729
|
} else t5 = $[5];
|
|
711
730
|
const hidden = t5;
|
|
712
|
-
|
|
731
|
+
const collapsed = !invalid && description === void 0 && !characterCount && !(insideForm && reserve);
|
|
713
732
|
const value = input?.value ?? textArea?.value ?? "";
|
|
714
733
|
const length = String(value).length;
|
|
715
734
|
const hint = invalid ? void 0 : description;
|
|
@@ -754,53 +773,64 @@ function FieldMessage(t0) {
|
|
|
754
773
|
} else t8 = $[14];
|
|
755
774
|
const written = t8;
|
|
756
775
|
let t9;
|
|
757
|
-
if ($[15] !== inset) {
|
|
758
|
-
t9 = props(fieldChromeStyles.message, fieldChromeStyles.messageLine, inset && fieldChromeStyles.messageInset);
|
|
759
|
-
$[15] =
|
|
760
|
-
$[16] =
|
|
761
|
-
|
|
776
|
+
if ($[15] !== collapsed || $[16] !== inset) {
|
|
777
|
+
t9 = props(fieldChromeStyles.message, fieldChromeStyles.messageLine, inset && fieldChromeStyles.messageInset, collapsed && fieldChromeStyles.messageLineCollapsed);
|
|
778
|
+
$[15] = collapsed;
|
|
779
|
+
$[16] = inset;
|
|
780
|
+
$[17] = t9;
|
|
781
|
+
} else t9 = $[17];
|
|
762
782
|
let t10;
|
|
763
|
-
if ($[
|
|
764
|
-
t10 =
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
});
|
|
768
|
-
$[17] = error;
|
|
769
|
-
$[18] = validation;
|
|
770
|
-
$[19] = written;
|
|
771
|
-
$[20] = t10;
|
|
772
|
-
} else t10 = $[20];
|
|
783
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
784
|
+
t10 = props(fieldChromeStyles.messageRegion);
|
|
785
|
+
$[18] = t10;
|
|
786
|
+
} else t10 = $[18];
|
|
773
787
|
let t11;
|
|
774
|
-
if ($[
|
|
775
|
-
t11 =
|
|
788
|
+
if ($[19] !== error || $[20] !== validation || $[21] !== written) {
|
|
789
|
+
t11 = /* @__PURE__ */ jsx("span", {
|
|
790
|
+
"aria-atomic": "true",
|
|
791
|
+
"aria-live": "polite",
|
|
792
|
+
...t10,
|
|
793
|
+
children: validation === null && error !== void 0 ? written : /* @__PURE__ */ jsx(FieldError, {
|
|
794
|
+
...props(fieldChromeStyles.message, fieldChromeStyles.messageError),
|
|
795
|
+
children: error
|
|
796
|
+
})
|
|
797
|
+
});
|
|
798
|
+
$[19] = error;
|
|
799
|
+
$[20] = validation;
|
|
800
|
+
$[21] = written;
|
|
801
|
+
$[22] = t11;
|
|
802
|
+
} else t11 = $[22];
|
|
803
|
+
let t12;
|
|
804
|
+
if ($[23] !== characterCount || $[24] !== invalid || $[25] !== length || $[26] !== locale || $[27] !== maxLength) {
|
|
805
|
+
t12 = characterCount ? /* @__PURE__ */ jsx("span", {
|
|
776
806
|
"aria-hidden": "true",
|
|
777
807
|
...props(fieldChromeStyles.message, fieldChromeStyles.counter, invalid && fieldChromeStyles.messageError),
|
|
778
808
|
children: countIn(locale, length, maxLength)
|
|
779
809
|
}) : null;
|
|
780
|
-
$[
|
|
781
|
-
$[
|
|
782
|
-
$[
|
|
783
|
-
$[
|
|
784
|
-
$[
|
|
785
|
-
$[
|
|
786
|
-
} else
|
|
787
|
-
let
|
|
788
|
-
if ($[
|
|
789
|
-
|
|
810
|
+
$[23] = characterCount;
|
|
811
|
+
$[24] = invalid;
|
|
812
|
+
$[25] = length;
|
|
813
|
+
$[26] = locale;
|
|
814
|
+
$[27] = maxLength;
|
|
815
|
+
$[28] = t12;
|
|
816
|
+
} else t12 = $[28];
|
|
817
|
+
let t13;
|
|
818
|
+
if ($[29] !== described || $[30] !== t11 || $[31] !== t12 || $[32] !== t9) {
|
|
819
|
+
t13 = /* @__PURE__ */ jsxs("div", {
|
|
790
820
|
...t9,
|
|
791
821
|
children: [
|
|
792
|
-
|
|
822
|
+
t11,
|
|
793
823
|
described,
|
|
794
|
-
|
|
824
|
+
t12
|
|
795
825
|
]
|
|
796
826
|
});
|
|
797
|
-
$[
|
|
798
|
-
$[
|
|
799
|
-
$[29] = t11;
|
|
800
|
-
$[30] = t9;
|
|
827
|
+
$[29] = described;
|
|
828
|
+
$[30] = t11;
|
|
801
829
|
$[31] = t12;
|
|
802
|
-
|
|
803
|
-
|
|
830
|
+
$[32] = t9;
|
|
831
|
+
$[33] = t13;
|
|
832
|
+
} else t13 = $[33];
|
|
833
|
+
return t13;
|
|
804
834
|
}
|
|
805
835
|
/**
|
|
806
836
|
* The same asterisk for a label that is not a field's own — a checkbox's, a
|