@kanso-labs/kanso-ui 0.44.0 → 0.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/app-bar/index.d.ts +9 -5
- package/dist/components/app-bar/index.js +400 -170
- package/dist/components/app-bar/index.js.map +1 -1
- package/dist/components/checkbox/index.js +2 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/dialog/index.js +65 -71
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/sheet/index.js +39 -46
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/switch/index.js +1 -0
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/time-picker/index.js +37 -41
- package/dist/components/time-picker/index.js.map +1 -1
- package/dist/control/index.js +1 -1
- package/dist/control/index.js.map +1 -1
- package/dist/control/styles.js +0 -1
- package/dist/control/styles.js.map +1 -1
- package/dist/field/index.js +148 -139
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +50 -7
- package/dist/field/styles.js.map +1 -1
- package/dist/hooks/useRipple.js +1 -1
- package/dist/layout.d.ts +4 -1
- package/dist/layout.js +4 -1
- package/dist/layout.js.map +1 -1
- package/dist/row/styles.js +2 -1
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/overlay.js +0 -5
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles.css +123 -22
- package/package.json +1 -1
- package/dist/overlay/modal.js +0 -7
- package/dist/overlay/modal.js.map +0 -1
package/dist/field/index.js
CHANGED
|
@@ -62,7 +62,7 @@ function boxContent(label, children, endInset, floatingLabel, isFocused, isPopul
|
|
|
62
62
|
* for them. See the outlined variant's note above.
|
|
63
63
|
*/
|
|
64
64
|
function BoxContent(t0) {
|
|
65
|
-
const $ = c(
|
|
65
|
+
const $ = c(50);
|
|
66
66
|
const { children, endInset, floatingLabel, isFocused, isPopulated, isRequired, label, leading, multiline, state, trailing, trigger, variant } = t0;
|
|
67
67
|
const read = useFieldPopulated();
|
|
68
68
|
const populated = isPopulated ?? read;
|
|
@@ -74,7 +74,7 @@ function BoxContent(t0) {
|
|
|
74
74
|
if ($[0] !== endInset || $[1] !== floated || $[2] !== focused || $[3] !== isRequired || $[4] !== label || $[5] !== leading || $[6] !== outlined || $[7] !== trailing) {
|
|
75
75
|
t2 = outlined ? /* @__PURE__ */ jsx("fieldset", {
|
|
76
76
|
"aria-hidden": "true",
|
|
77
|
-
...props(fieldChromeStyles.outline, leading !== void 0 && fieldChromeStyles.outlineLeading, trailing !== void 0 && fieldChromeStyles.
|
|
77
|
+
...props(fieldChromeStyles.outline, focused && fieldChromeStyles.outlineFocused, leading !== void 0 && (focused ? fieldChromeStyles.outlineLeadingFocused : fieldChromeStyles.outlineLeading), trailing !== void 0 && (focused ? fieldChromeStyles.outlineTrailingFocused : fieldChromeStyles.outlineTrailing), endInset !== "0px" && fieldChromeStyles.outlineEndInset(`calc(${spacing.lg} - ${spacing.xs} - ${focused ? "2px" : "1px"} + ${endInset})`)),
|
|
78
78
|
children: /* @__PURE__ */ jsx("legend", {
|
|
79
79
|
...props(fieldChromeStyles.outlineNotch, floated && fieldChromeStyles.outlineNotchOpen),
|
|
80
80
|
children: floated ? /* @__PURE__ */ jsxs(Fragment$1, { children: [label, isRequired ? REQUIRED_MARK : null] }) : null
|
|
@@ -126,45 +126,49 @@ function BoxContent(t0) {
|
|
|
126
126
|
$[24] = t6;
|
|
127
127
|
} else t6 = $[24];
|
|
128
128
|
let t7;
|
|
129
|
-
if ($[25] !== isRequired || $[26] !== label || $[27] !==
|
|
129
|
+
if ($[25] !== isRequired || $[26] !== label || $[27] !== outlined || $[28] !== t5 || $[29] !== t6) {
|
|
130
130
|
t7 = /* @__PURE__ */ jsx(FieldLabel, {
|
|
131
131
|
isRequired,
|
|
132
|
+
outlined,
|
|
132
133
|
state: t5,
|
|
133
134
|
...t6,
|
|
134
135
|
children: label
|
|
135
136
|
});
|
|
136
137
|
$[25] = isRequired;
|
|
137
138
|
$[26] = label;
|
|
138
|
-
$[27] =
|
|
139
|
-
$[28] =
|
|
140
|
-
$[29] =
|
|
141
|
-
|
|
139
|
+
$[27] = outlined;
|
|
140
|
+
$[28] = t5;
|
|
141
|
+
$[29] = t6;
|
|
142
|
+
$[30] = t7;
|
|
143
|
+
} else t7 = $[30];
|
|
142
144
|
let t8;
|
|
143
|
-
if ($[
|
|
145
|
+
if ($[31] !== children || $[32] !== t4 || $[33] !== t7) {
|
|
144
146
|
t8 = /* @__PURE__ */ jsxs("div", {
|
|
145
147
|
...t4,
|
|
146
148
|
children: [t7, children]
|
|
147
149
|
});
|
|
148
|
-
$[
|
|
149
|
-
$[
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
} else t8 = $[
|
|
150
|
+
$[31] = children;
|
|
151
|
+
$[32] = t4;
|
|
152
|
+
$[33] = t7;
|
|
153
|
+
$[34] = t8;
|
|
154
|
+
} else t8 = $[34];
|
|
153
155
|
let t9;
|
|
154
|
-
if ($[
|
|
156
|
+
if ($[35] !== focused || $[36] !== multiline || $[37] !== outlined || $[38] !== state.isDisabled || $[39] !== state.isHovered || $[40] !== state.isInvalid || $[41] !== trailing) {
|
|
155
157
|
t9 = trailing === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
156
|
-
...props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isInvalid && fieldChromeStyles.iconError, state.isDisabled && fieldChromeStyles.iconDisabled),
|
|
158
|
+
...props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isInvalid && (state.isHovered && !focused ? fieldChromeStyles.iconErrorHovered : fieldChromeStyles.iconError), state.isDisabled && fieldChromeStyles.iconDisabled),
|
|
157
159
|
children: trailing
|
|
158
160
|
});
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
|
|
161
|
+
$[35] = focused;
|
|
162
|
+
$[36] = multiline;
|
|
163
|
+
$[37] = outlined;
|
|
164
|
+
$[38] = state.isDisabled;
|
|
165
|
+
$[39] = state.isHovered;
|
|
166
|
+
$[40] = state.isInvalid;
|
|
167
|
+
$[41] = trailing;
|
|
168
|
+
$[42] = t9;
|
|
169
|
+
} else t9 = $[42];
|
|
166
170
|
let t10;
|
|
167
|
-
if ($[
|
|
171
|
+
if ($[43] !== t1 || $[44] !== t2 || $[45] !== t3 || $[46] !== t8 || $[47] !== t9 || $[48] !== trigger) {
|
|
168
172
|
t10 = /* @__PURE__ */ jsxs(BoxContext, {
|
|
169
173
|
value: t1,
|
|
170
174
|
children: [
|
|
@@ -175,19 +179,19 @@ function BoxContent(t0) {
|
|
|
175
179
|
t9
|
|
176
180
|
]
|
|
177
181
|
});
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
} else t10 = $[
|
|
182
|
+
$[43] = t1;
|
|
183
|
+
$[44] = t2;
|
|
184
|
+
$[45] = t3;
|
|
185
|
+
$[46] = t8;
|
|
186
|
+
$[47] = t9;
|
|
187
|
+
$[48] = trigger;
|
|
188
|
+
$[49] = t10;
|
|
189
|
+
} else t10 = $[49];
|
|
186
190
|
return t10;
|
|
187
191
|
}
|
|
188
192
|
function boxStyles(floatingLabel, isFocused, multiline, leading, trailing, variant) {
|
|
189
193
|
const outlined = variant === "outlined";
|
|
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));
|
|
194
|
+
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), !outlined && state.isHovered && (state.isInvalid ? fieldChromeStyles.boxErrorHovered : fieldChromeStyles.boxHovered), isFocused && focusedStyle(outlined, state.isInvalid), state.isDisabled && (outlined ? fieldChromeStyles.boxOutlinedDisabled : fieldChromeStyles.boxDisabled));
|
|
191
195
|
}
|
|
192
196
|
/**
|
|
193
197
|
* The control's `onInput`, which also commits the field's validation while it
|
|
@@ -343,7 +347,7 @@ function FieldBox(t0) {
|
|
|
343
347
|
*/
|
|
344
348
|
function FieldInput(t0) {
|
|
345
349
|
const $ = c(24);
|
|
346
|
-
const { leftToRight: t1, numeric: t2, placeholder, prefix, suffix, ...props$
|
|
350
|
+
const { leftToRight: t1, numeric: t2, placeholder, prefix, suffix, ...props$3 } = t0;
|
|
347
351
|
const leftToRight = t1 === void 0 ? false : t1;
|
|
348
352
|
const numeric = t2 === void 0 ? false : t2;
|
|
349
353
|
const box = useContext(BoxContext);
|
|
@@ -351,31 +355,31 @@ function FieldInput(t0) {
|
|
|
351
355
|
const prefixId = useId();
|
|
352
356
|
const suffixId = useId();
|
|
353
357
|
const field = useSlottedContext(InputContext);
|
|
354
|
-
const describedBy = idsOf(prefix === void 0 ? void 0 : prefixId, suffix === void 0 ? void 0 : suffixId, field?.["aria-describedby"], props$
|
|
358
|
+
const describedBy = idsOf(prefix === void 0 ? void 0 : prefixId, suffix === void 0 ? void 0 : suffixId, field?.["aria-describedby"], props$3["aria-describedby"]);
|
|
355
359
|
const T0 = Input;
|
|
356
360
|
const t3 = placeholder ?? (box.label === "floating" ? " " : void 0);
|
|
357
|
-
const t4 = commitWhileInvalid(validation?.isInvalid ?? false, props$
|
|
361
|
+
const t4 = commitWhileInvalid(validation?.isInvalid ?? false, props$3.onInput);
|
|
358
362
|
let t5;
|
|
359
363
|
if ($[0] !== box || $[1] !== leftToRight || $[2] !== numeric) {
|
|
360
|
-
t5 = (state) => props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === "floating" && fieldChromeStyles.inputUnderFloatingLabel, numeric && fieldChromeStyles.numeric, leftToRight && fieldChromeStyles.leftToRight, state.isDisabled && fieldChromeStyles.inputDisabled);
|
|
364
|
+
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);
|
|
361
365
|
$[0] = box;
|
|
362
366
|
$[1] = leftToRight;
|
|
363
367
|
$[2] = numeric;
|
|
364
368
|
$[3] = t5;
|
|
365
369
|
} else t5 = $[3];
|
|
366
|
-
const t6 = mergeStatefulStyles(t5, props$
|
|
370
|
+
const t6 = mergeStatefulStyles(t5, props$3);
|
|
367
371
|
let t7;
|
|
368
|
-
if ($[4] !== T0 || $[5] !== describedBy || $[6] !== props$
|
|
372
|
+
if ($[4] !== T0 || $[5] !== describedBy || $[6] !== props$3 || $[7] !== t3 || $[8] !== t4 || $[9] !== t6) {
|
|
369
373
|
t7 = /* @__PURE__ */ jsx(T0, {
|
|
370
374
|
placeholder: t3,
|
|
371
|
-
...props$
|
|
375
|
+
...props$3,
|
|
372
376
|
"aria-describedby": describedBy,
|
|
373
377
|
onInput: t4,
|
|
374
378
|
...t6
|
|
375
379
|
});
|
|
376
380
|
$[4] = T0;
|
|
377
381
|
$[5] = describedBy;
|
|
378
|
-
$[6] = props$
|
|
382
|
+
$[6] = props$3;
|
|
379
383
|
$[7] = t3;
|
|
380
384
|
$[8] = t4;
|
|
381
385
|
$[9] = t6;
|
|
@@ -490,7 +494,7 @@ function FieldTextArea(t0) {
|
|
|
490
494
|
const t3 = commitWhileInvalid(validation?.isInvalid ?? false, props$2.onInput);
|
|
491
495
|
let t4;
|
|
492
496
|
if ($[0] !== autosize || $[1] !== box) {
|
|
493
|
-
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);
|
|
497
|
+
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);
|
|
494
498
|
$[0] = autosize;
|
|
495
499
|
$[1] = box;
|
|
496
500
|
$[2] = t4;
|
|
@@ -557,21 +561,21 @@ function FieldTextArea(t0) {
|
|
|
557
561
|
* the fill, the underline and the focus indicator, and it lights up while
|
|
558
562
|
* this has focus because the indicator follows focus within.
|
|
559
563
|
*/
|
|
560
|
-
function FieldTrigger(props$
|
|
564
|
+
function FieldTrigger(props$4) {
|
|
561
565
|
const $ = c(5);
|
|
562
566
|
let t0;
|
|
563
|
-
if ($[0] !== props$
|
|
564
|
-
t0 = mergeStatefulStyles(props(fieldChromeStyles.trigger), props$
|
|
565
|
-
$[0] = props$
|
|
567
|
+
if ($[0] !== props$4) {
|
|
568
|
+
t0 = mergeStatefulStyles(props(fieldChromeStyles.trigger), props$4);
|
|
569
|
+
$[0] = props$4;
|
|
566
570
|
$[1] = t0;
|
|
567
571
|
} else t0 = $[1];
|
|
568
572
|
let t1;
|
|
569
|
-
if ($[2] !== props$
|
|
573
|
+
if ($[2] !== props$4 || $[3] !== t0) {
|
|
570
574
|
t1 = /* @__PURE__ */ jsx(Button, {
|
|
571
|
-
...props$
|
|
575
|
+
...props$4,
|
|
572
576
|
...t0
|
|
573
577
|
});
|
|
574
|
-
$[2] = props$
|
|
578
|
+
$[2] = props$4;
|
|
575
579
|
$[3] = t0;
|
|
576
580
|
$[4] = t1;
|
|
577
581
|
} else t1 = $[4];
|
|
@@ -595,19 +599,19 @@ function FieldTrigger(props$5) {
|
|
|
595
599
|
*/
|
|
596
600
|
function FieldValue(t0) {
|
|
597
601
|
const $ = c(3);
|
|
598
|
-
const { isFocused: t1, isPlaceholder: t2, ...props$
|
|
602
|
+
const { isFocused: t1, isPlaceholder: t2, ...props$1 } = t0;
|
|
599
603
|
const isFocused = t1 === void 0 ? false : t1;
|
|
600
604
|
const isPlaceholder = t2 === void 0 ? false : t2;
|
|
601
605
|
const box = useContext(BoxContext);
|
|
602
606
|
const hidden = isPlaceholder && box.label === "floating" && !isFocused;
|
|
603
|
-
const t3 = mergeStyles(props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props$
|
|
607
|
+
const t3 = mergeStyles(props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props$1);
|
|
604
608
|
let t4;
|
|
605
|
-
if ($[0] !== props$
|
|
609
|
+
if ($[0] !== props$1 || $[1] !== t3) {
|
|
606
610
|
t4 = /* @__PURE__ */ jsx("span", {
|
|
607
|
-
...props$
|
|
611
|
+
...props$1,
|
|
608
612
|
...t3
|
|
609
613
|
});
|
|
610
|
-
$[0] = props$
|
|
614
|
+
$[0] = props$1;
|
|
611
615
|
$[1] = t3;
|
|
612
616
|
$[2] = t4;
|
|
613
617
|
} else t4 = $[2];
|
|
@@ -670,18 +674,21 @@ function FieldLabel(t0) {
|
|
|
670
674
|
let t1;
|
|
671
675
|
let t2;
|
|
672
676
|
if ($[0] !== t0) {
|
|
673
|
-
const { children: t3, isRequired: t4,
|
|
677
|
+
const { children: t3, isRequired: t4, outlined: t5, state: t6, variant: t7, ...props$5 } = t0;
|
|
674
678
|
children = t3;
|
|
675
679
|
isRequired = t4 === void 0 ? false : t4;
|
|
676
|
-
const
|
|
677
|
-
const
|
|
678
|
-
const
|
|
679
|
-
const isDisabled
|
|
680
|
-
const
|
|
681
|
-
const
|
|
680
|
+
const outlined = t5 === void 0 ? false : t5;
|
|
681
|
+
const state = t6 === void 0 ? NO_STATE : t6;
|
|
682
|
+
const variant = t7 === void 0 ? "field" : t7;
|
|
683
|
+
const { isDisabled: t8, isFocusWithin: t9, isHovered: t10, isInvalid: t11 } = state;
|
|
684
|
+
const isDisabled = t8 === void 0 ? false : t8;
|
|
685
|
+
const isFocusWithin = t9 === void 0 ? false : t9;
|
|
686
|
+
const isHovered = t10 === void 0 ? false : t10;
|
|
687
|
+
const isInvalid = t11 === void 0 ? false : t11;
|
|
688
|
+
const hovered = !isDisabled && !isFocusWithin && isHovered;
|
|
682
689
|
T0 = Label;
|
|
683
|
-
t1 = props$
|
|
684
|
-
t2 = mergeStyles(props(fieldChromeStyles.label, variant === "group" && groupStyles.label, isDisabled && fieldChromeStyles.labelDisabled, isInvalid && fieldChromeStyles.labelError, !isDisabled && !isInvalid && isFocusWithin && fieldChromeStyles.labelFocused), props$
|
|
690
|
+
t1 = props$5;
|
|
691
|
+
t2 = mergeStyles(props(fieldChromeStyles.label, variant === "group" && groupStyles.label, isDisabled && fieldChromeStyles.labelDisabled, isInvalid && fieldChromeStyles.labelError, !isDisabled && !isInvalid && isFocusWithin && fieldChromeStyles.labelFocused, hovered && isInvalid && fieldChromeStyles.labelErrorHovered, hovered && !isInvalid && outlined && fieldChromeStyles.labelHovered), props$5);
|
|
685
692
|
$[0] = t0;
|
|
686
693
|
$[1] = T0;
|
|
687
694
|
$[2] = children;
|
|
@@ -722,12 +729,13 @@ function FieldLabel(t0) {
|
|
|
722
729
|
* the field's validation state is read for.
|
|
723
730
|
*/
|
|
724
731
|
function FieldMessage(t0) {
|
|
725
|
-
const $ = c(
|
|
726
|
-
const { characterCount: t1, characterLimitLabel, characterLimitReachedLabel, description, error, errorId,
|
|
732
|
+
const $ = c(41);
|
|
733
|
+
const { characterCount: t1, characterLimitLabel, characterLimitReachedLabel, description, error, errorId, indent: t2, inset: t3, isDisabled: t4, maxLength, reserve: t5 } = t0;
|
|
727
734
|
const characterCount = t1 === void 0 ? false : t1;
|
|
728
|
-
const
|
|
729
|
-
const
|
|
730
|
-
const
|
|
735
|
+
const indent = t2 === void 0 ? false : t2;
|
|
736
|
+
const inset = t3 === void 0 ? true : t3;
|
|
737
|
+
const isDisabled = t4 === void 0 ? false : t4;
|
|
738
|
+
const reserve = t5 === void 0 ? true : t5;
|
|
731
739
|
const validation = useContext(FieldErrorContext);
|
|
732
740
|
const invalid = error !== void 0 || (validation?.isInvalid ?? false);
|
|
733
741
|
const { locale } = useLocale();
|
|
@@ -736,18 +744,18 @@ function FieldMessage(t0) {
|
|
|
736
744
|
const textArea = useSlottedContext(TextAreaContext);
|
|
737
745
|
const insideForm = useInsideForm();
|
|
738
746
|
const text = useContext(TextContext);
|
|
739
|
-
let
|
|
747
|
+
let t6;
|
|
740
748
|
if ($[0] !== characterLimitLabel || $[1] !== maxLength || $[2] !== messages) {
|
|
741
|
-
|
|
749
|
+
t6 = maxLength === void 0 ? void 0 : characterLimitLabel ?? messages.characterLimit(maxLength);
|
|
742
750
|
$[0] = characterLimitLabel;
|
|
743
751
|
$[1] = maxLength;
|
|
744
752
|
$[2] = messages;
|
|
745
|
-
$[3] =
|
|
746
|
-
} else
|
|
747
|
-
const limit =
|
|
748
|
-
let
|
|
753
|
+
$[3] = t6;
|
|
754
|
+
} else t6 = $[3];
|
|
755
|
+
const limit = t6;
|
|
756
|
+
let t7;
|
|
749
757
|
if ($[4] !== limit) {
|
|
750
|
-
|
|
758
|
+
t7 = limit === void 0 ? null : /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
751
759
|
elementType: "span",
|
|
752
760
|
children: /* @__PURE__ */ jsx(Text, {
|
|
753
761
|
slot: "description",
|
|
@@ -755,17 +763,17 @@ function FieldMessage(t0) {
|
|
|
755
763
|
})
|
|
756
764
|
});
|
|
757
765
|
$[4] = limit;
|
|
758
|
-
$[5] =
|
|
759
|
-
} else
|
|
760
|
-
const hidden =
|
|
766
|
+
$[5] = t7;
|
|
767
|
+
} else t7 = $[5];
|
|
768
|
+
const hidden = t7;
|
|
761
769
|
const collapsed = !invalid && description === void 0 && !characterCount && !(insideForm && reserve);
|
|
762
770
|
const value = input?.value ?? textArea?.value ?? "";
|
|
763
771
|
const length = String(value).length;
|
|
764
772
|
const hint = invalid ? void 0 : description;
|
|
765
773
|
const reached = characterCount && maxLength !== void 0 && length >= maxLength ? characterLimitReachedLabel ?? messages.characterLimitReached : null;
|
|
766
|
-
let
|
|
774
|
+
let t8;
|
|
767
775
|
if ($[6] !== hidden || $[7] !== hint || $[8] !== isDisabled || $[9] !== limit) {
|
|
768
|
-
|
|
776
|
+
t8 = hint === void 0 ? hidden : /* @__PURE__ */ jsxs(Text, {
|
|
769
777
|
slot: "description",
|
|
770
778
|
...props(fieldChromeStyles.message, isDisabled && fieldChromeStyles.messageDisabled),
|
|
771
779
|
children: [hint, limit === void 0 ? null : /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
@@ -777,19 +785,19 @@ function FieldMessage(t0) {
|
|
|
777
785
|
$[7] = hint;
|
|
778
786
|
$[8] = isDisabled;
|
|
779
787
|
$[9] = limit;
|
|
780
|
-
$[10] =
|
|
781
|
-
} else
|
|
782
|
-
const described =
|
|
788
|
+
$[10] = t8;
|
|
789
|
+
} else t8 = $[10];
|
|
790
|
+
const described = t8;
|
|
783
791
|
const errorSlot = text !== null && typeof text === "object" && "slots" in text && text.slots?.errorMessage !== void 0;
|
|
784
|
-
let t8;
|
|
785
|
-
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
786
|
-
t8 = props(fieldChromeStyles.message, fieldChromeStyles.messageError);
|
|
787
|
-
$[11] = t8;
|
|
788
|
-
} else t8 = $[11];
|
|
789
|
-
const messageStyles = t8;
|
|
790
792
|
let t9;
|
|
793
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
794
|
+
t9 = props(fieldChromeStyles.message, fieldChromeStyles.messageError);
|
|
795
|
+
$[11] = t9;
|
|
796
|
+
} else t9 = $[11];
|
|
797
|
+
const messageStyles = t9;
|
|
798
|
+
let t10;
|
|
791
799
|
if ($[12] !== error || $[13] !== errorId || $[14] !== errorSlot) {
|
|
792
|
-
|
|
800
|
+
t10 = errorSlot ? /* @__PURE__ */ jsx(Text, {
|
|
793
801
|
slot: "errorMessage",
|
|
794
802
|
...messageStyles,
|
|
795
803
|
children: error
|
|
@@ -801,81 +809,82 @@ function FieldMessage(t0) {
|
|
|
801
809
|
$[12] = error;
|
|
802
810
|
$[13] = errorId;
|
|
803
811
|
$[14] = errorSlot;
|
|
804
|
-
$[15] =
|
|
805
|
-
} else
|
|
806
|
-
const written =
|
|
807
|
-
let t10;
|
|
808
|
-
if ($[16] !== collapsed || $[17] !== inset) {
|
|
809
|
-
t10 = props(fieldChromeStyles.message, fieldChromeStyles.messageLine, inset && fieldChromeStyles.messageInset, collapsed && fieldChromeStyles.messageLineCollapsed);
|
|
810
|
-
$[16] = collapsed;
|
|
811
|
-
$[17] = inset;
|
|
812
|
-
$[18] = t10;
|
|
813
|
-
} else t10 = $[18];
|
|
812
|
+
$[15] = t10;
|
|
813
|
+
} else t10 = $[15];
|
|
814
|
+
const written = t10;
|
|
814
815
|
let t11;
|
|
815
|
-
if ($[
|
|
816
|
-
t11 = props(fieldChromeStyles.
|
|
816
|
+
if ($[16] !== collapsed || $[17] !== indent || $[18] !== inset) {
|
|
817
|
+
t11 = props(fieldChromeStyles.message, fieldChromeStyles.messageLine, indent && fieldChromeStyles.messageIndent, inset && fieldChromeStyles.messageInset, collapsed && fieldChromeStyles.messageLineCollapsed);
|
|
818
|
+
$[16] = collapsed;
|
|
819
|
+
$[17] = indent;
|
|
820
|
+
$[18] = inset;
|
|
817
821
|
$[19] = t11;
|
|
818
822
|
} else t11 = $[19];
|
|
819
823
|
let t12;
|
|
820
|
-
if ($[20]
|
|
821
|
-
t12 =
|
|
824
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
825
|
+
t12 = props(fieldChromeStyles.messageRegion);
|
|
826
|
+
$[20] = t12;
|
|
827
|
+
} else t12 = $[20];
|
|
828
|
+
let t13;
|
|
829
|
+
if ($[21] !== error || $[22] !== validation || $[23] !== written) {
|
|
830
|
+
t13 = /* @__PURE__ */ jsx("span", {
|
|
822
831
|
"aria-atomic": "true",
|
|
823
832
|
"aria-live": "polite",
|
|
824
|
-
...
|
|
833
|
+
...t12,
|
|
825
834
|
children: validation === null && error !== void 0 ? written : /* @__PURE__ */ jsx(FieldError, {
|
|
826
835
|
...props(fieldChromeStyles.message, fieldChromeStyles.messageError),
|
|
827
836
|
children: error
|
|
828
837
|
})
|
|
829
838
|
});
|
|
830
|
-
$[
|
|
831
|
-
$[
|
|
832
|
-
$[
|
|
833
|
-
$[
|
|
834
|
-
} else
|
|
835
|
-
let
|
|
836
|
-
if ($[
|
|
837
|
-
|
|
839
|
+
$[21] = error;
|
|
840
|
+
$[22] = validation;
|
|
841
|
+
$[23] = written;
|
|
842
|
+
$[24] = t13;
|
|
843
|
+
} else t13 = $[24];
|
|
844
|
+
let t14;
|
|
845
|
+
if ($[25] !== characterCount || $[26] !== invalid || $[27] !== length || $[28] !== locale || $[29] !== maxLength) {
|
|
846
|
+
t14 = characterCount ? /* @__PURE__ */ jsx("span", {
|
|
838
847
|
"aria-hidden": "true",
|
|
839
848
|
...props(fieldChromeStyles.message, fieldChromeStyles.counter, invalid && fieldChromeStyles.messageError),
|
|
840
849
|
children: countIn(locale, length, maxLength)
|
|
841
850
|
}) : null;
|
|
842
|
-
$[
|
|
843
|
-
$[
|
|
844
|
-
$[
|
|
845
|
-
$[
|
|
846
|
-
$[
|
|
847
|
-
$[
|
|
848
|
-
} else
|
|
849
|
-
let
|
|
850
|
-
if ($[
|
|
851
|
-
|
|
851
|
+
$[25] = characterCount;
|
|
852
|
+
$[26] = invalid;
|
|
853
|
+
$[27] = length;
|
|
854
|
+
$[28] = locale;
|
|
855
|
+
$[29] = maxLength;
|
|
856
|
+
$[30] = t14;
|
|
857
|
+
} else t14 = $[30];
|
|
858
|
+
let t15;
|
|
859
|
+
if ($[31] !== characterCount || $[32] !== maxLength || $[33] !== reached) {
|
|
860
|
+
t15 = characterCount && maxLength !== void 0 ? /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
852
861
|
elementType: "output",
|
|
853
862
|
children: reached
|
|
854
863
|
}) : null;
|
|
855
|
-
$[
|
|
856
|
-
$[
|
|
857
|
-
$[
|
|
858
|
-
$[
|
|
859
|
-
} else
|
|
860
|
-
let
|
|
861
|
-
if ($[
|
|
862
|
-
|
|
863
|
-
...
|
|
864
|
+
$[31] = characterCount;
|
|
865
|
+
$[32] = maxLength;
|
|
866
|
+
$[33] = reached;
|
|
867
|
+
$[34] = t15;
|
|
868
|
+
} else t15 = $[34];
|
|
869
|
+
let t16;
|
|
870
|
+
if ($[35] !== described || $[36] !== t11 || $[37] !== t13 || $[38] !== t14 || $[39] !== t15) {
|
|
871
|
+
t16 = /* @__PURE__ */ jsxs("div", {
|
|
872
|
+
...t11,
|
|
864
873
|
children: [
|
|
865
|
-
t12,
|
|
866
|
-
described,
|
|
867
874
|
t13,
|
|
868
|
-
|
|
875
|
+
described,
|
|
876
|
+
t14,
|
|
877
|
+
t15
|
|
869
878
|
]
|
|
870
879
|
});
|
|
871
|
-
$[
|
|
872
|
-
$[
|
|
873
|
-
$[36] = t12;
|
|
880
|
+
$[35] = described;
|
|
881
|
+
$[36] = t11;
|
|
874
882
|
$[37] = t13;
|
|
875
883
|
$[38] = t14;
|
|
876
884
|
$[39] = t15;
|
|
877
|
-
|
|
878
|
-
|
|
885
|
+
$[40] = t16;
|
|
886
|
+
} else t16 = $[40];
|
|
887
|
+
return t16;
|
|
879
888
|
}
|
|
880
889
|
/**
|
|
881
890
|
* The same asterisk for a label that is not a field's own — a checkbox's, a
|