@kanso-labs/kanso-ui 0.43.7 → 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/README.md +1 -0
- package/dist/calendar/index.js +34 -10
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js +30 -0
- package/dist/calendar/styles.js.map +1 -1
- package/dist/chip/index.js +27 -18
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/label.js +32 -0
- package/dist/chip/label.js.map +1 -0
- package/dist/chip/styles.js +32 -2
- package/dist/chip/styles.js.map +1 -1
- package/dist/collection/text.js +24 -3
- package/dist/collection/text.js.map +1 -1
- 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/button/index.js.map +1 -1
- package/dist/components/calendar/index.d.ts +8 -1
- package/dist/components/calendar/index.js +129 -73
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/checkbox/index.js +31 -31
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox-group/index.js +4 -2
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip-group/index.d.ts +35 -5
- package/dist/components/chip-group/index.js +137 -97
- package/dist/components/chip-group/index.js.map +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/copy-field/index.js.map +1 -1
- package/dist/components/currency/index.d.ts +64 -6
- package/dist/components/currency/index.js +117 -40
- package/dist/components/currency/index.js.map +1 -1
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/dialog/index.d.ts +3 -1
- package/dist/components/dialog/index.js +115 -81
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/disclosure-group/index.js +1 -1
- package/dist/components/disclosure-group/index.js.map +1 -1
- package/dist/components/icon-button/index.js +18 -1
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/keycap/index.d.ts +3 -0
- package/dist/components/keycap/index.js +30 -44
- package/dist/components/keycap/index.js.map +1 -1
- package/dist/components/list/index.d.ts +16 -2
- package/dist/components/list/index.js +124 -69
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-detail/index.d.ts +11 -3
- package/dist/components/list-detail/index.js +13 -6
- package/dist/components/list-detail/index.js.map +1 -1
- package/dist/components/list-item/index.d.ts +16 -1
- package/dist/components/list-item/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +6 -2
- package/dist/components/menu/index.js +22 -15
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/meter/index.d.ts +4 -1
- package/dist/components/meter/index.js +6 -0
- package/dist/components/meter/index.js.map +1 -1
- package/dist/components/navigation-bar/index.d.ts +14 -4
- package/dist/components/navigation-bar/index.js +77 -50
- package/dist/components/navigation-bar/index.js.map +1 -1
- package/dist/components/navigation-rail/index.d.ts +3 -2
- package/dist/components/navigation-rail/index.js +59 -52
- package/dist/components/navigation-rail/index.js.map +1 -1
- package/dist/components/navigation-tree/index.js +4 -1
- package/dist/components/navigation-tree/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +3 -2
- package/dist/components/number-field/index.js +91 -115
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +3 -1
- package/dist/components/popover/index.js +102 -100
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/progress-indicator/index.d.ts +4 -2
- package/dist/components/progress-indicator/index.js +4 -3
- package/dist/components/progress-indicator/index.js.map +1 -1
- package/dist/components/radio-group/index.js +34 -24
- package/dist/components/radio-group/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +11 -1
- package/dist/components/search-field/index.js +32 -28
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/segmented-button/index.d.ts +9 -2
- package/dist/components/segmented-button/index.js +1 -1
- package/dist/components/segmented-button/index.js.map +1 -1
- package/dist/components/separator/index.d.ts +19 -7
- package/dist/components/separator/index.js +36 -13
- package/dist/components/separator/index.js.map +1 -1
- package/dist/components/sheet/index.js +29 -25
- package/dist/components/sheet/index.js.map +1 -1
- package/dist/components/snackbar/index.d.ts +4 -1
- package/dist/components/snackbar/index.js +140 -55
- package/dist/components/snackbar/index.js.map +1 -1
- package/dist/components/stack/index.d.ts +6 -3
- package/dist/components/stack/index.js +48 -31
- package/dist/components/stack/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +16 -6
- package/dist/components/switch/index.js +116 -62
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/text-area/index.d.ts +10 -1
- package/dist/components/text-area/index.js +21 -19
- package/dist/components/text-area/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +16 -2
- package/dist/components/text-field/index.js +49 -43
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/time-picker/index.js +1 -1
- package/dist/components/tooltip/index.d.ts +3 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tree/index.d.ts +15 -3
- package/dist/components/tree/index.js +41 -28
- package/dist/components/tree/index.js.map +1 -1
- package/dist/control/index.js +26 -23
- package/dist/control/index.js.map +1 -1
- package/dist/control/styles.js +7 -1
- package/dist/control/styles.js.map +1 -1
- package/dist/field/index.js +220 -193
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +64 -8
- package/dist/field/styles.js.map +1 -1
- package/dist/glyphs/index.js +37 -1
- package/dist/glyphs/index.js.map +1 -1
- package/dist/hooks/useClippedTitle.js +44 -0
- package/dist/hooks/useClippedTitle.js.map +1 -0
- package/dist/hooks/useRipple.js +7 -6
- package/dist/hooks/useRipple.js.map +1 -1
- package/dist/hooks/useScrollStop.js +133 -0
- package/dist/hooks/useScrollStop.js.map +1 -0
- package/dist/i18n/index.js +1 -0
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +34 -0
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/indicator/index.js +18 -16
- package/dist/indicator/index.js.map +1 -1
- package/dist/indicator/styles.js +3 -0
- package/dist/indicator/styles.js.map +1 -1
- package/dist/keycap/context.js +7 -0
- package/dist/keycap/context.js.map +1 -0
- package/dist/layout.d.ts +4 -1
- package/dist/layout.js +4 -1
- package/dist/layout.js.map +1 -1
- package/dist/navigation/index.d.ts +16 -2
- package/dist/navigation/index.js +145 -44
- package/dist/navigation/index.js.map +1 -1
- package/dist/navigation/styles.js +79 -16
- package/dist/navigation/styles.js.map +1 -1
- package/dist/row/index.js +92 -89
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +26 -2
- package/dist/row/styles.js.map +1 -1
- package/dist/styles/overlay.d.ts +6 -2
- package/dist/styles/overlay.js +4 -1
- package/dist/styles/overlay.js.map +1 -1
- package/dist/styles.css +296 -38
- package/dist/theme-scope.d.ts +5 -1
- package/dist/theme-scope.js +100 -51
- package/dist/theme-scope.js.map +1 -1
- package/dist/tokens/design.tokens.stylex.js.map +1 -1
- package/package.json +21 -20
- package/dist/hooks/useScrollable.js +0 -69
- package/dist/hooks/useScrollable.js.map +0 -1
package/dist/field/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import { props } from "../node_modules/@stylexjs/stylex/lib/es/stylex.js";
|
|
|
2
2
|
import { spacing } from "../tokens/design.tokens.stylex.js";
|
|
3
3
|
import { mergeStatefulStyles, mergeStyles } from "../styles/merge.js";
|
|
4
4
|
import { useMessages } from "../i18n/index.js";
|
|
5
|
-
import { focusesControl } from "./press.js";
|
|
6
5
|
import { useInsideForm } from "./root.js";
|
|
7
6
|
import { fieldChromeStyles, groupStyles } from "./styles.js";
|
|
7
|
+
import { focusesControl } from "./press.js";
|
|
8
8
|
import { c } from "react/compiler-runtime";
|
|
9
9
|
import { createContext, useContext, useId } from "react";
|
|
10
10
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -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
|
|
@@ -342,90 +346,92 @@ function FieldBox(t0) {
|
|
|
342
346
|
* it was in no name and no description, and a reader heard the label alone.
|
|
343
347
|
*/
|
|
344
348
|
function FieldInput(t0) {
|
|
345
|
-
const $ = c(
|
|
346
|
-
const {
|
|
347
|
-
const
|
|
349
|
+
const $ = c(24);
|
|
350
|
+
const { leftToRight: t1, numeric: t2, placeholder, prefix, suffix, ...props$3 } = t0;
|
|
351
|
+
const leftToRight = t1 === void 0 ? false : t1;
|
|
352
|
+
const numeric = t2 === void 0 ? false : t2;
|
|
348
353
|
const box = useContext(BoxContext);
|
|
349
354
|
const validation = useContext(FieldErrorContext);
|
|
350
355
|
const prefixId = useId();
|
|
351
356
|
const suffixId = useId();
|
|
352
357
|
const field = useSlottedContext(InputContext);
|
|
353
|
-
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"]);
|
|
354
359
|
const T0 = Input;
|
|
355
|
-
const
|
|
356
|
-
const
|
|
357
|
-
let
|
|
358
|
-
if ($[0] !== box || $[1] !== numeric) {
|
|
359
|
-
|
|
360
|
+
const t3 = placeholder ?? (box.label === "floating" ? " " : void 0);
|
|
361
|
+
const t4 = commitWhileInvalid(validation?.isInvalid ?? false, props$3.onInput);
|
|
362
|
+
let t5;
|
|
363
|
+
if ($[0] !== box || $[1] !== leftToRight || $[2] !== numeric) {
|
|
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);
|
|
360
365
|
$[0] = box;
|
|
361
|
-
$[1] =
|
|
362
|
-
$[2] =
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
366
|
+
$[1] = leftToRight;
|
|
367
|
+
$[2] = numeric;
|
|
368
|
+
$[3] = t5;
|
|
369
|
+
} else t5 = $[3];
|
|
370
|
+
const t6 = mergeStatefulStyles(t5, props$3);
|
|
371
|
+
let t7;
|
|
372
|
+
if ($[4] !== T0 || $[5] !== describedBy || $[6] !== props$3 || $[7] !== t3 || $[8] !== t4 || $[9] !== t6) {
|
|
373
|
+
t7 = /* @__PURE__ */ jsx(T0, {
|
|
374
|
+
placeholder: t3,
|
|
375
|
+
...props$3,
|
|
370
376
|
"aria-describedby": describedBy,
|
|
371
|
-
onInput:
|
|
372
|
-
...
|
|
377
|
+
onInput: t4,
|
|
378
|
+
...t6
|
|
373
379
|
});
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[6] = t2;
|
|
380
|
+
$[4] = T0;
|
|
381
|
+
$[5] = describedBy;
|
|
382
|
+
$[6] = props$3;
|
|
378
383
|
$[7] = t3;
|
|
379
|
-
$[8] =
|
|
384
|
+
$[8] = t4;
|
|
380
385
|
$[9] = t6;
|
|
381
|
-
} else t6 = $[9];
|
|
382
|
-
const control = t6;
|
|
383
|
-
if (prefix === void 0 && suffix === void 0) return control;
|
|
384
|
-
let t7;
|
|
385
|
-
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
386
|
-
t7 = props(fieldChromeStyles.affixLine);
|
|
387
386
|
$[10] = t7;
|
|
388
387
|
} else t7 = $[10];
|
|
388
|
+
const control = t7;
|
|
389
|
+
if (prefix === void 0 && suffix === void 0) return control;
|
|
389
390
|
let t8;
|
|
390
|
-
if ($[11]
|
|
391
|
-
t8 =
|
|
391
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
392
|
+
t8 = props(fieldChromeStyles.affixLine);
|
|
393
|
+
$[11] = t8;
|
|
394
|
+
} else t8 = $[11];
|
|
395
|
+
let t9;
|
|
396
|
+
if ($[12] !== box || $[13] !== prefix || $[14] !== prefixId) {
|
|
397
|
+
t9 = prefix === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
392
398
|
id: prefixId,
|
|
393
399
|
...props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel),
|
|
394
400
|
children: prefix
|
|
395
401
|
});
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
} else
|
|
401
|
-
let
|
|
402
|
-
if ($[
|
|
403
|
-
|
|
402
|
+
$[12] = box;
|
|
403
|
+
$[13] = prefix;
|
|
404
|
+
$[14] = prefixId;
|
|
405
|
+
$[15] = t9;
|
|
406
|
+
} else t9 = $[15];
|
|
407
|
+
let t10;
|
|
408
|
+
if ($[16] !== box || $[17] !== suffix || $[18] !== suffixId) {
|
|
409
|
+
t10 = suffix === void 0 ? null : /* @__PURE__ */ jsx("span", {
|
|
404
410
|
id: suffixId,
|
|
405
411
|
...props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel),
|
|
406
412
|
children: suffix
|
|
407
413
|
});
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
$[
|
|
412
|
-
} else
|
|
413
|
-
let
|
|
414
|
-
if ($[
|
|
415
|
-
|
|
416
|
-
...
|
|
414
|
+
$[16] = box;
|
|
415
|
+
$[17] = suffix;
|
|
416
|
+
$[18] = suffixId;
|
|
417
|
+
$[19] = t10;
|
|
418
|
+
} else t10 = $[19];
|
|
419
|
+
let t11;
|
|
420
|
+
if ($[20] !== control || $[21] !== t10 || $[22] !== t9) {
|
|
421
|
+
t11 = /* @__PURE__ */ jsxs("span", {
|
|
422
|
+
...t8,
|
|
417
423
|
children: [
|
|
418
|
-
|
|
424
|
+
t9,
|
|
419
425
|
control,
|
|
420
|
-
|
|
426
|
+
t10
|
|
421
427
|
]
|
|
422
428
|
});
|
|
423
|
-
$[
|
|
424
|
-
$[
|
|
425
|
-
$[
|
|
426
|
-
$[
|
|
427
|
-
} else
|
|
428
|
-
return
|
|
429
|
+
$[20] = control;
|
|
430
|
+
$[21] = t10;
|
|
431
|
+
$[22] = t9;
|
|
432
|
+
$[23] = t11;
|
|
433
|
+
} else t11 = $[23];
|
|
434
|
+
return t11;
|
|
429
435
|
}
|
|
430
436
|
/**
|
|
431
437
|
* A date or a time's segments, in a {@link FieldBox}: React Aria's
|
|
@@ -488,7 +494,7 @@ function FieldTextArea(t0) {
|
|
|
488
494
|
const t3 = commitWhileInvalid(validation?.isInvalid ?? false, props$2.onInput);
|
|
489
495
|
let t4;
|
|
490
496
|
if ($[0] !== autosize || $[1] !== box) {
|
|
491
|
-
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);
|
|
492
498
|
$[0] = autosize;
|
|
493
499
|
$[1] = box;
|
|
494
500
|
$[2] = t4;
|
|
@@ -555,21 +561,21 @@ function FieldTextArea(t0) {
|
|
|
555
561
|
* the fill, the underline and the focus indicator, and it lights up while
|
|
556
562
|
* this has focus because the indicator follows focus within.
|
|
557
563
|
*/
|
|
558
|
-
function FieldTrigger(props$
|
|
564
|
+
function FieldTrigger(props$4) {
|
|
559
565
|
const $ = c(5);
|
|
560
566
|
let t0;
|
|
561
|
-
if ($[0] !== props$
|
|
562
|
-
t0 = mergeStatefulStyles(props(fieldChromeStyles.trigger), props$
|
|
563
|
-
$[0] = props$
|
|
567
|
+
if ($[0] !== props$4) {
|
|
568
|
+
t0 = mergeStatefulStyles(props(fieldChromeStyles.trigger), props$4);
|
|
569
|
+
$[0] = props$4;
|
|
564
570
|
$[1] = t0;
|
|
565
571
|
} else t0 = $[1];
|
|
566
572
|
let t1;
|
|
567
|
-
if ($[2] !== props$
|
|
573
|
+
if ($[2] !== props$4 || $[3] !== t0) {
|
|
568
574
|
t1 = /* @__PURE__ */ jsx(Button, {
|
|
569
|
-
...props$
|
|
575
|
+
...props$4,
|
|
570
576
|
...t0
|
|
571
577
|
});
|
|
572
|
-
$[2] = props$
|
|
578
|
+
$[2] = props$4;
|
|
573
579
|
$[3] = t0;
|
|
574
580
|
$[4] = t1;
|
|
575
581
|
} else t1 = $[4];
|
|
@@ -593,19 +599,19 @@ function FieldTrigger(props$5) {
|
|
|
593
599
|
*/
|
|
594
600
|
function FieldValue(t0) {
|
|
595
601
|
const $ = c(3);
|
|
596
|
-
const { isFocused: t1, isPlaceholder: t2, ...props$
|
|
602
|
+
const { isFocused: t1, isPlaceholder: t2, ...props$1 } = t0;
|
|
597
603
|
const isFocused = t1 === void 0 ? false : t1;
|
|
598
604
|
const isPlaceholder = t2 === void 0 ? false : t2;
|
|
599
605
|
const box = useContext(BoxContext);
|
|
600
606
|
const hidden = isPlaceholder && box.label === "floating" && !isFocused;
|
|
601
|
-
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);
|
|
602
608
|
let t4;
|
|
603
|
-
if ($[0] !== props$
|
|
609
|
+
if ($[0] !== props$1 || $[1] !== t3) {
|
|
604
610
|
t4 = /* @__PURE__ */ jsx("span", {
|
|
605
|
-
...props$
|
|
611
|
+
...props$1,
|
|
606
612
|
...t3
|
|
607
613
|
});
|
|
608
|
-
$[0] = props$
|
|
614
|
+
$[0] = props$1;
|
|
609
615
|
$[1] = t3;
|
|
610
616
|
$[2] = t4;
|
|
611
617
|
} else t4 = $[2];
|
|
@@ -668,18 +674,21 @@ function FieldLabel(t0) {
|
|
|
668
674
|
let t1;
|
|
669
675
|
let t2;
|
|
670
676
|
if ($[0] !== t0) {
|
|
671
|
-
const { children: t3, isRequired: t4,
|
|
677
|
+
const { children: t3, isRequired: t4, outlined: t5, state: t6, variant: t7, ...props$5 } = t0;
|
|
672
678
|
children = t3;
|
|
673
679
|
isRequired = t4 === void 0 ? false : t4;
|
|
674
|
-
const
|
|
675
|
-
const
|
|
676
|
-
const
|
|
677
|
-
const isDisabled
|
|
678
|
-
const
|
|
679
|
-
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;
|
|
680
689
|
T0 = Label;
|
|
681
|
-
t1 = props$
|
|
682
|
-
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);
|
|
683
692
|
$[0] = t0;
|
|
684
693
|
$[1] = T0;
|
|
685
694
|
$[2] = children;
|
|
@@ -720,11 +729,13 @@ function FieldLabel(t0) {
|
|
|
720
729
|
* the field's validation state is read for.
|
|
721
730
|
*/
|
|
722
731
|
function FieldMessage(t0) {
|
|
723
|
-
const $ = c(
|
|
724
|
-
const { characterCount: t1, characterLimitLabel, 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;
|
|
725
734
|
const characterCount = t1 === void 0 ? false : t1;
|
|
726
|
-
const
|
|
727
|
-
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;
|
|
728
739
|
const validation = useContext(FieldErrorContext);
|
|
729
740
|
const invalid = error !== void 0 || (validation?.isInvalid ?? false);
|
|
730
741
|
const { locale } = useLocale();
|
|
@@ -733,18 +744,18 @@ function FieldMessage(t0) {
|
|
|
733
744
|
const textArea = useSlottedContext(TextAreaContext);
|
|
734
745
|
const insideForm = useInsideForm();
|
|
735
746
|
const text = useContext(TextContext);
|
|
736
|
-
let
|
|
747
|
+
let t6;
|
|
737
748
|
if ($[0] !== characterLimitLabel || $[1] !== maxLength || $[2] !== messages) {
|
|
738
|
-
|
|
749
|
+
t6 = maxLength === void 0 ? void 0 : characterLimitLabel ?? messages.characterLimit(maxLength);
|
|
739
750
|
$[0] = characterLimitLabel;
|
|
740
751
|
$[1] = maxLength;
|
|
741
752
|
$[2] = messages;
|
|
742
|
-
$[3] =
|
|
743
|
-
} else
|
|
744
|
-
const limit =
|
|
745
|
-
let
|
|
753
|
+
$[3] = t6;
|
|
754
|
+
} else t6 = $[3];
|
|
755
|
+
const limit = t6;
|
|
756
|
+
let t7;
|
|
746
757
|
if ($[4] !== limit) {
|
|
747
|
-
|
|
758
|
+
t7 = limit === void 0 ? null : /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
748
759
|
elementType: "span",
|
|
749
760
|
children: /* @__PURE__ */ jsx(Text, {
|
|
750
761
|
slot: "description",
|
|
@@ -752,18 +763,19 @@ function FieldMessage(t0) {
|
|
|
752
763
|
})
|
|
753
764
|
});
|
|
754
765
|
$[4] = limit;
|
|
755
|
-
$[5] =
|
|
756
|
-
} else
|
|
757
|
-
const hidden =
|
|
766
|
+
$[5] = t7;
|
|
767
|
+
} else t7 = $[5];
|
|
768
|
+
const hidden = t7;
|
|
758
769
|
const collapsed = !invalid && description === void 0 && !characterCount && !(insideForm && reserve);
|
|
759
770
|
const value = input?.value ?? textArea?.value ?? "";
|
|
760
771
|
const length = String(value).length;
|
|
761
772
|
const hint = invalid ? void 0 : description;
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
773
|
+
const reached = characterCount && maxLength !== void 0 && length >= maxLength ? characterLimitReachedLabel ?? messages.characterLimitReached : null;
|
|
774
|
+
let t8;
|
|
775
|
+
if ($[6] !== hidden || $[7] !== hint || $[8] !== isDisabled || $[9] !== limit) {
|
|
776
|
+
t8 = hint === void 0 ? hidden : /* @__PURE__ */ jsxs(Text, {
|
|
765
777
|
slot: "description",
|
|
766
|
-
...props(fieldChromeStyles.message),
|
|
778
|
+
...props(fieldChromeStyles.message, isDisabled && fieldChromeStyles.messageDisabled),
|
|
767
779
|
children: [hint, limit === void 0 ? null : /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
768
780
|
elementType: "span",
|
|
769
781
|
children: ` ${limit}`
|
|
@@ -771,20 +783,21 @@ function FieldMessage(t0) {
|
|
|
771
783
|
});
|
|
772
784
|
$[6] = hidden;
|
|
773
785
|
$[7] = hint;
|
|
774
|
-
$[8] =
|
|
775
|
-
$[9] =
|
|
776
|
-
|
|
777
|
-
|
|
786
|
+
$[8] = isDisabled;
|
|
787
|
+
$[9] = limit;
|
|
788
|
+
$[10] = t8;
|
|
789
|
+
} else t8 = $[10];
|
|
790
|
+
const described = t8;
|
|
778
791
|
const errorSlot = text !== null && typeof text === "object" && "slots" in text && text.slots?.errorMessage !== void 0;
|
|
779
|
-
let
|
|
780
|
-
if ($[
|
|
781
|
-
|
|
782
|
-
$[
|
|
783
|
-
} else
|
|
784
|
-
const messageStyles =
|
|
785
|
-
let
|
|
786
|
-
if ($[
|
|
787
|
-
|
|
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;
|
|
799
|
+
if ($[12] !== error || $[13] !== errorId || $[14] !== errorSlot) {
|
|
800
|
+
t10 = errorSlot ? /* @__PURE__ */ jsx(Text, {
|
|
788
801
|
slot: "errorMessage",
|
|
789
802
|
...messageStyles,
|
|
790
803
|
children: error
|
|
@@ -793,71 +806,85 @@ function FieldMessage(t0) {
|
|
|
793
806
|
...messageStyles,
|
|
794
807
|
children: error
|
|
795
808
|
});
|
|
796
|
-
$[
|
|
797
|
-
$[
|
|
798
|
-
$[
|
|
799
|
-
$[
|
|
800
|
-
} else
|
|
801
|
-
const written =
|
|
802
|
-
let t9;
|
|
803
|
-
if ($[15] !== collapsed || $[16] !== inset) {
|
|
804
|
-
t9 = props(fieldChromeStyles.message, fieldChromeStyles.messageLine, inset && fieldChromeStyles.messageInset, collapsed && fieldChromeStyles.messageLineCollapsed);
|
|
805
|
-
$[15] = collapsed;
|
|
806
|
-
$[16] = inset;
|
|
807
|
-
$[17] = t9;
|
|
808
|
-
} else t9 = $[17];
|
|
809
|
-
let t10;
|
|
810
|
-
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
811
|
-
t10 = props(fieldChromeStyles.messageRegion);
|
|
812
|
-
$[18] = t10;
|
|
813
|
-
} else t10 = $[18];
|
|
809
|
+
$[12] = error;
|
|
810
|
+
$[13] = errorId;
|
|
811
|
+
$[14] = errorSlot;
|
|
812
|
+
$[15] = t10;
|
|
813
|
+
} else t10 = $[15];
|
|
814
|
+
const written = t10;
|
|
814
815
|
let t11;
|
|
815
|
-
if ($[
|
|
816
|
-
t11 =
|
|
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;
|
|
821
|
+
$[19] = t11;
|
|
822
|
+
} else t11 = $[19];
|
|
823
|
+
let 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", {
|
|
817
831
|
"aria-atomic": "true",
|
|
818
832
|
"aria-live": "polite",
|
|
819
|
-
...
|
|
833
|
+
...t12,
|
|
820
834
|
children: validation === null && error !== void 0 ? written : /* @__PURE__ */ jsx(FieldError, {
|
|
821
835
|
...props(fieldChromeStyles.message, fieldChromeStyles.messageError),
|
|
822
836
|
children: error
|
|
823
837
|
})
|
|
824
838
|
});
|
|
825
|
-
$[
|
|
826
|
-
$[
|
|
827
|
-
$[
|
|
828
|
-
$[
|
|
829
|
-
} else
|
|
830
|
-
let
|
|
831
|
-
if ($[
|
|
832
|
-
|
|
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", {
|
|
833
847
|
"aria-hidden": "true",
|
|
834
848
|
...props(fieldChromeStyles.message, fieldChromeStyles.counter, invalid && fieldChromeStyles.messageError),
|
|
835
849
|
children: countIn(locale, length, maxLength)
|
|
836
850
|
}) : null;
|
|
837
|
-
$[
|
|
838
|
-
$[
|
|
839
|
-
$[
|
|
840
|
-
$[
|
|
841
|
-
$[
|
|
842
|
-
$[
|
|
843
|
-
} else
|
|
844
|
-
let
|
|
845
|
-
if ($[
|
|
846
|
-
|
|
847
|
-
|
|
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, {
|
|
861
|
+
elementType: "output",
|
|
862
|
+
children: reached
|
|
863
|
+
}) : null;
|
|
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,
|
|
848
873
|
children: [
|
|
849
|
-
|
|
874
|
+
t13,
|
|
850
875
|
described,
|
|
851
|
-
|
|
876
|
+
t14,
|
|
877
|
+
t15
|
|
852
878
|
]
|
|
853
879
|
});
|
|
854
|
-
$[
|
|
855
|
-
$[
|
|
856
|
-
$[
|
|
857
|
-
$[
|
|
858
|
-
$[
|
|
859
|
-
|
|
860
|
-
|
|
880
|
+
$[35] = described;
|
|
881
|
+
$[36] = t11;
|
|
882
|
+
$[37] = t13;
|
|
883
|
+
$[38] = t14;
|
|
884
|
+
$[39] = t15;
|
|
885
|
+
$[40] = t16;
|
|
886
|
+
} else t16 = $[40];
|
|
887
|
+
return t16;
|
|
861
888
|
}
|
|
862
889
|
/**
|
|
863
890
|
* The same asterisk for a label that is not a field's own — a checkbox's, a
|