@kanso-labs/kanso-ui 0.40.8 → 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.
@@ -2,6 +2,7 @@ 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";
5
6
  import { useInsideForm } from "./root.js";
6
7
  import { fieldChromeStyles, groupStyles } from "./styles.js";
7
8
  import { c } from "react/compiler-runtime";
@@ -324,7 +325,6 @@ function FieldBox(t0) {
324
325
  } else t5 = $[35];
325
326
  return t5;
326
327
  }
327
- const PRESSABLE = "a, button, input, textarea, select, [role=\"button\"], [contenteditable=\"true\"]";
328
328
  /**
329
329
  * A field's text control, in a {@link FieldBox} or on its own. React Aria's
330
330
  * `Input`, which takes its label association, value and validation from the
@@ -338,13 +338,13 @@ const PRESSABLE = "a, button, input, textarea, select, [role=\"button\"], [conte
338
338
  */
339
339
  function FieldInput(t0) {
340
340
  const $ = c(20);
341
- const { numeric: t1, placeholder, prefix, suffix, ...props$1 } = t0;
341
+ const { numeric: t1, placeholder, prefix, suffix, ...props$3 } = t0;
342
342
  const numeric = t1 === void 0 ? false : t1;
343
343
  const box = useContext(BoxContext);
344
344
  const validation = useContext(FieldErrorContext);
345
345
  const T0 = Input;
346
346
  const t2 = placeholder ?? (box.label === "floating" ? " " : void 0);
347
- const t3 = commitWhileInvalid(validation?.isInvalid ?? false, props$1.onInput);
347
+ const t3 = commitWhileInvalid(validation?.isInvalid ?? false, props$3.onInput);
348
348
  let t4;
349
349
  if ($[0] !== box || $[1] !== numeric) {
350
350
  t4 = (state) => props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === "floating" && fieldChromeStyles.inputUnderFloatingLabel, numeric && fieldChromeStyles.numeric, state.isDisabled && fieldChromeStyles.inputDisabled);
@@ -352,17 +352,17 @@ function FieldInput(t0) {
352
352
  $[1] = numeric;
353
353
  $[2] = t4;
354
354
  } else t4 = $[2];
355
- const t5 = mergeStatefulStyles(t4, props$1);
355
+ const t5 = mergeStatefulStyles(t4, props$3);
356
356
  let t6;
357
- if ($[3] !== T0 || $[4] !== props$1 || $[5] !== t2 || $[6] !== t3 || $[7] !== t5) {
357
+ if ($[3] !== T0 || $[4] !== props$3 || $[5] !== t2 || $[6] !== t3 || $[7] !== t5) {
358
358
  t6 = /* @__PURE__ */ jsx(T0, {
359
359
  placeholder: t2,
360
- ...props$1,
360
+ ...props$3,
361
361
  onInput: t3,
362
362
  ...t5
363
363
  });
364
364
  $[3] = T0;
365
- $[4] = props$1;
365
+ $[4] = props$3;
366
366
  $[5] = t2;
367
367
  $[6] = t3;
368
368
  $[7] = t5;
@@ -462,7 +462,7 @@ function FieldSegments(t0) {
462
462
  */
463
463
  function FieldTextArea(t0) {
464
464
  const $ = c(18);
465
- const { autosize: t1, placeholder, ...props$4 } = t0;
465
+ const { autosize: t1, placeholder, ...props$1 } = t0;
466
466
  const autosize = t1 === void 0 ? false : t1;
467
467
  const box = useContext(BoxContext);
468
468
  const context = useSlottedContext(TextAreaContext);
@@ -470,7 +470,7 @@ function FieldTextArea(t0) {
470
470
  const value = typeof context?.value === "string" ? context.value : "";
471
471
  const T0 = TextArea;
472
472
  const t2 = placeholder ?? (box.label === "floating" ? " " : void 0);
473
- const t3 = commitWhileInvalid(validation?.isInvalid ?? false, props$4.onInput);
473
+ const t3 = commitWhileInvalid(validation?.isInvalid ?? false, props$1.onInput);
474
474
  let t4;
475
475
  if ($[0] !== autosize || $[1] !== box) {
476
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);
@@ -478,17 +478,17 @@ function FieldTextArea(t0) {
478
478
  $[1] = box;
479
479
  $[2] = t4;
480
480
  } else t4 = $[2];
481
- const t5 = mergeStatefulStyles(t4, props$4);
481
+ const t5 = mergeStatefulStyles(t4, props$1);
482
482
  let t6;
483
- if ($[3] !== T0 || $[4] !== props$4 || $[5] !== t2 || $[6] !== t3 || $[7] !== t5) {
483
+ if ($[3] !== T0 || $[4] !== props$1 || $[5] !== t2 || $[6] !== t3 || $[7] !== t5) {
484
484
  t6 = /* @__PURE__ */ jsx(T0, {
485
485
  placeholder: t2,
486
- ...props$4,
486
+ ...props$1,
487
487
  onInput: t3,
488
488
  ...t5
489
489
  });
490
490
  $[3] = T0;
491
- $[4] = props$4;
491
+ $[4] = props$1;
492
492
  $[5] = t2;
493
493
  $[6] = t3;
494
494
  $[7] = t5;
@@ -540,21 +540,21 @@ function FieldTextArea(t0) {
540
540
  * the fill, the underline and the focus indicator, and it lights up while
541
541
  * this has focus because the indicator follows focus within.
542
542
  */
543
- function FieldTrigger(props$5) {
543
+ function FieldTrigger(props$2) {
544
544
  const $ = c(5);
545
545
  let t0;
546
- if ($[0] !== props$5) {
547
- t0 = mergeStatefulStyles(props(fieldChromeStyles.trigger), props$5);
548
- $[0] = props$5;
546
+ if ($[0] !== props$2) {
547
+ t0 = mergeStatefulStyles(props(fieldChromeStyles.trigger), props$2);
548
+ $[0] = props$2;
549
549
  $[1] = t0;
550
550
  } else t0 = $[1];
551
551
  let t1;
552
- if ($[2] !== props$5 || $[3] !== t0) {
552
+ if ($[2] !== props$2 || $[3] !== t0) {
553
553
  t1 = /* @__PURE__ */ jsx(Button, {
554
- ...props$5,
554
+ ...props$2,
555
555
  ...t0
556
556
  });
557
- $[2] = props$5;
557
+ $[2] = props$2;
558
558
  $[3] = t0;
559
559
  $[4] = t1;
560
560
  } else t1 = $[4];
@@ -578,19 +578,19 @@ function FieldTrigger(props$5) {
578
578
  */
579
579
  function FieldValue(t0) {
580
580
  const $ = c(3);
581
- const { isFocused: t1, isPlaceholder: t2, ...props$3 } = t0;
581
+ const { isFocused: t1, isPlaceholder: t2, ...props$4 } = t0;
582
582
  const isFocused = t1 === void 0 ? false : t1;
583
583
  const isPlaceholder = t2 === void 0 ? false : t2;
584
584
  const box = useContext(BoxContext);
585
585
  const hidden = isPlaceholder && box.label === "floating" && !isFocused;
586
- const t3 = mergeStyles(props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props$3);
586
+ const t3 = mergeStyles(props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props$4);
587
587
  let t4;
588
- if ($[0] !== props$3 || $[1] !== t3) {
588
+ if ($[0] !== props$4 || $[1] !== t3) {
589
589
  t4 = /* @__PURE__ */ jsx("span", {
590
- ...props$3,
590
+ ...props$4,
591
591
  ...t3
592
592
  });
593
- $[0] = props$3;
593
+ $[0] = props$4;
594
594
  $[1] = t3;
595
595
  $[2] = t4;
596
596
  } else t4 = $[2];
@@ -600,27 +600,6 @@ function focusedStyle(outlined, invalid) {
600
600
  if (outlined) return invalid ? fieldChromeStyles.boxOutlinedErrorFocused : fieldChromeStyles.boxOutlinedFocused;
601
601
  return invalid ? fieldChromeStyles.boxErrorFocused : fieldChromeStyles.boxFocused;
602
602
  }
603
- const CONTROL = "input:not([type=\"hidden\"]), textarea, [contenteditable=\"true\"]";
604
- /**
605
- * The box's press handler: a press anywhere on the box focuses the control
606
- * in it, as the whole of a native text field's box does. The box is 56dp
607
- * and the control's line 24dp of it, so the padding above and below the
608
- * line, the padding at either end and the icons were dead to a press —
609
- * nothing took focus, and nothing said why. Built by a call rather than
610
- * written at the prop, which is what react-perf's no-new-function-as-prop is
611
- * after; the React Compiler memoises it on the call site's own handler,
612
- * which runs first.
613
- */
614
- function focusesControl(onPointerDown) {
615
- return (event) => {
616
- onPointerDown?.(event);
617
- if (event.defaultPrevented || event.button !== 0 || !(event.target instanceof Element) || event.target.closest(PRESSABLE) !== null) return;
618
- const control = event.currentTarget.querySelector(CONTROL);
619
- if (control === null || control.matches(":disabled")) return;
620
- event.preventDefault();
621
- control.focus();
622
- };
623
- }
624
603
  function returnToStart(event) {
625
604
  if (!event.currentTarget.contains(event.relatedTarget)) event.currentTarget.scrollLeft = 0;
626
605
  }
@@ -662,7 +641,7 @@ function FieldLabel(t0) {
662
641
  let t1;
663
642
  let t2;
664
643
  if ($[0] !== t0) {
665
- const { children: t3, isRequired: t4, state: t5, variant: t6, ...props$2 } = t0;
644
+ const { children: t3, isRequired: t4, state: t5, variant: t6, ...props$5 } = t0;
666
645
  children = t3;
667
646
  isRequired = t4 === void 0 ? false : t4;
668
647
  const state = t5 === void 0 ? NO_STATE : t5;
@@ -672,8 +651,8 @@ function FieldLabel(t0) {
672
651
  const isFocusWithin = t8 === void 0 ? false : t8;
673
652
  const isInvalid = t9 === void 0 ? false : t9;
674
653
  T0 = Label;
675
- t1 = props$2;
676
- t2 = mergeStyles(props(fieldChromeStyles.label, variant === "group" && groupStyles.label, isDisabled && fieldChromeStyles.labelDisabled, isInvalid && fieldChromeStyles.labelError, !isDisabled && !isInvalid && isFocusWithin && fieldChromeStyles.labelFocused), props$2);
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);
677
656
  $[0] = t0;
678
657
  $[1] = T0;
679
658
  $[2] = children;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["FocusEvent","HTMLAttributes","InputEventHandler","PointerEvent","ReactNode","Ref","RefAttributes","ButtonProps","GroupProps","GroupRenderProps","InputProps","InputRenderProps","LabelProps","TextAreaProps","stylex","createContext","useContext","FieldError","FieldErrorContext","Group","Input","InputContext","Label","Button","RACButton","SelectStateContext","Text","TextArea","TextAreaContext","TextContext","useLocale","useSlottedContext","VisuallyHidden","useMessages","mergeStatefulStyles","mergeStyles","spacing","useInsideForm","fieldChromeStyles","groupStyles","BoxControl","label","BoxLabel","underLabel","FieldBoxProps","Omit","children","endInset","floatingLabel","isFocused","isPopulated","isRequired","leading","multiline","ref","HTMLDivElement","trailing","trigger","variant","FieldVariant","FieldInputProps","numeric","prefix","suffix","FieldLabelProps","state","Partial","FieldLabelState","FieldLabelVariant","Pick","FieldMessageProps","characterCount","characterLimitLabel","description","error","errorId","inset","maxLength","reserve","FieldTextAreaProps","autosize","FieldTriggerProps","FieldValueProps","HTMLElement","isPlaceholder","OUTSIDE_BOX","BOX_CONTROLS","filled","fixed","floating","outlined","Record","BoxContext","boxContent","BoxContent","t0","$","_c","read","useFieldPopulated","populated","focused","isFocusWithin","floated","t1","t2","props","outline","undefined","outlineLeading","outlineTrailing","outlineFocused","outlineEndInset","lg","xs","outlineNotch","outlineNotchOpen","REQUIRED_MARK","t3","isDisabled","icon","iconMultiline","iconOutlined","iconDisabled","t4","column","columnFloating","columnDisabledFloating","columnDisabled","t5","withFocus","t6","boxLabel","boxLabelFloated","boxLabelOutlined","boxLabelOutlinedFloated","boxLabelEndInset","t7","t8","t9","isInvalid","iconError","t10","boxStyles","box","boxFloating","boxFixed","boxMultiline","boxLeading","boxTrailing","boxOutlined","boxOutlinedFloating","boxOutlinedMultiline","boxOutlinedError","boxError","isHovered","boxOutlinedErrorHovered","boxOutlinedHovered","focusedStyle","boxOutlinedDisabled","boxDisabled","commitWhileInvalid","onInput","E","event","currentTarget","dispatchEvent","Event","bubbles","FieldBox","T0","t11","t12","t13","t14","t15","focusesControl","onPointerDown","PRESSABLE","FieldInput","placeholder","validation","input","inputUnderLabel","inputUnderFloatingLabel","inputDisabled","control","Symbol","for","affixLine","affix","FieldSegments","segments","returnToStart","FieldTextArea","context","value","textArea","textAreaAutosize","autosizeCell","replica","FieldTrigger","FieldValue","hidden","valuePlaceholder","valuePlaceholderHidden","invalid","boxOutlinedErrorFocused","boxOutlinedFocused","boxErrorFocused","boxFocused","CONTROL","defaultPrevented","button","target","Element","closest","querySelector","matches","preventDefault","focus","contains","relatedTarget","scrollLeft","select","selectionManager","selectedKeys","size","String","length","NO_STATE","FieldLabel","labelDisabled","labelError","labelFocused","FieldMessage","locale","messages","insideForm","text","characterLimit","limit","collapsed","hint","message","described","errorSlot","slots","errorMessage","messageError","messageStyles","written","messageLine","messageInset","messageLineCollapsed","messageRegion","counter","countIn","RequiredMark","counterFormatters","Map","Intl","NumberFormat","formatter","get","set","format","_c","stylex.props","props","RACButton"],"sources":["../../src/field/index.tsx"],"sourcesContent":["import type { FocusEvent, HTMLAttributes, InputEventHandler, PointerEvent, ReactNode, Ref, RefAttributes } from 'react';\nimport type { ButtonProps, GroupProps, GroupRenderProps, InputProps, InputRenderProps, LabelProps, TextAreaProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { FieldError, FieldErrorContext, Group, Input, InputContext, Label, Button as RACButton, SelectStateContext, Text, TextArea, TextAreaContext, TextContext, useLocale, useSlottedContext, VisuallyHidden } from 'react-aria-components';\nimport { useMessages } from '../i18n';\nimport { mergeStatefulStyles, mergeStyles } from '../styles/merge';\nimport { spacing } from '../tokens/design.tokens.stylex';\nimport { useInsideForm } from './root';\nimport { fieldChromeStyles, groupStyles } from './styles';\n\n// The chrome every field shares: the filled box with its label at the top, the\n// control inside it, and the line of supporting text under it. TextField drew\n// all of it on its own until the coverage plan brought a dozen more fields,\n// each of which would otherwise have written the same box a second time.\n//\n// Not a component of the library's own and not exported. Each field is still\n// React Aria's field component — TextField, NumberField, DateField — and these\n// are the parts it renders inside, which is what keeps the label association,\n// the description and error wiring, and validation on React Aria's side.\n//\n// Neither the notch nor the label can select on the state that drives them.\n// Both are children of the box and the state is the box's, and the filled\n// label reads it in CSS only because it changes type alone, which the box\n// hands down inherited — where the notch changes what it holds and the\n// label changes where it sits, and neither of those inherits. So the box's\n// content computes that state in React instead: focus from the box's own\n// render state, and a value from the control's context, which is where the\n// character counter reads it too. The border's colour is the box's,\n// inherited, which is what carries the hover, focus, error and disabled\n// roles to it.\n\n// What a control needs to know about the box around it: how the label is\n// drawn, and whether the control clears it with a margin — it does under\n// the filled box's label, and not under the outlined box's, whose label\n// sits on the outline rather than over the value.\ninterface BoxControl {\n label: BoxLabel;\n underLabel: boolean;\n}\n\n// How the box draws its label, for the control inside it — see the context\n// below.\ntype BoxLabel = 'fixed' | 'floating' | 'none';\ntype FieldBoxProps = Omit<GroupProps, 'children'> & {\n children?: ReactNode;\n /**\n * How much of the inline end of the column the control's own parts take,\n * beside the control, as a CSS length: a number field's steppers. The\n * label, and the outlined box's notch with it, stop that far short of the\n * column's end, so a long label is cut short beside them rather than\n * drawn under them. A part in `trailing` needs none of this, since it sits\n * outside the column.\n * @default '0px'\n */\n endInset?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * Whether the field holds focus somewhere the box cannot see, so the box\n * draws its focused state — the floated label, the focused indicator and\n * the label's colour — without focus inside it. A select's open list is\n * the case: opening it moves focus into the list, on an overlay outside\n * the box, and left to `:focus-within` the label fell back onto the\n * placeholder the select still showed.\n * @default false\n */\n isFocused?: boolean;\n /**\n * Whether the control is holding anything, for a field whose control the\n * chrome cannot ask. It reads an input, a text area and a select's own\n * state; a control that is none of those — a token field's editable area,\n * say — says so here, and the floating label floats on it.\n */\n isPopulated?: boolean;\n /**\n * Whether the field must be filled, which marks its label with an\n * asterisk. The field passes its own `isRequired` on, since the group the\n * box is reports none.\n * @default false\n */\n isRequired?: boolean;\n /** What the field is for. */\n label: string;\n /** An icon at the start of the box, before the label and the control. */\n leading?: ReactNode;\n /**\n * Whether the box takes its height from the control inside it rather\n * than the page's 56dp, for a text area.\n * @default false\n */\n multiline?: boolean;\n /**\n * The box's own element. A field whose box is what something else is\n * anchored to needs it — a select's list is positioned against the box and\n * takes its width from it, which is what makes the two the same width.\n */\n ref?: Ref<HTMLDivElement>;\n /** An icon at the end of the box, after the control. */\n trailing?: ReactNode;\n /**\n * A press target covering the whole box, for a field whose box opens\n * something rather than taking a keystroke — {@link FieldTrigger}. Drawn\n * in the box itself rather than in the column the label and the control\n * share, so the padding and the icons open it too.\n */\n trigger?: ReactNode;\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n// `prefix` is also an HTML attribute — the RDFa one, which nothing here\n// wants — and React's element types carry it as a string, so it is left out\n// of the props taken from React Aria to make room for the affix.\ntype FieldInputProps = Omit<InputProps, 'prefix'> & {\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column.\n * @default false\n */\n numeric?: boolean;\n /**\n * Text before the value on its line, shown while the field is focused or\n * holds a value.\n */\n prefix?: ReactNode;\n /**\n * Text after the value on its line, shown while the field is focused or\n * holds a value.\n */\n suffix?: ReactNode;\n};\ntype FieldLabelProps = LabelProps & {\n /**\n * Whether the field must be filled, which ends the label in an asterisk in\n * the label's own colour.\n * @default false\n */\n isRequired?: boolean;\n /**\n * The states the colour follows. Disabled wins over error, and error over\n * focus, so a focused invalid field keeps its error colour.\n */\n state?: Partial<FieldLabelState>;\n /**\n * Where the label sits. `field` is inside a box, positioned and typed by\n * whatever renders it. `group` is above a group of controls, which has no\n * box to float a label in, so this one carries its type itself.\n * @default 'field'\n */\n variant?: FieldLabelVariant;\n};\ntype FieldLabelState = Pick<GroupRenderProps, 'isDisabled' | 'isFocusWithin' | 'isInvalid'>;\ntype FieldLabelVariant = 'field' | 'group';\ninterface FieldMessageProps {\n /**\n * Whether to count the characters the control holds at the end of the\n * line, against `maxLength` where there is one. The count is read off the\n * field's own input or text area context, and written in the locale's\n * digits and grouping.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * It is read with the field on focus rather than as the value changes, so\n * it names the limit and not what is left of it. Left out, it is the\n * sentence for it in the I18nProvider's locale — \"Up to 20 characters\" in\n * English, singular for a limit of one.\n */\n characterLimitLabel?: string | undefined;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string | undefined;\n /** The problem with the current value, in words. */\n error?: string | undefined;\n /**\n * The id the error takes, for a field that points `aria-describedby` at it\n * itself because its React Aria component generates no error id of its\n * own. Used only where the message is written out rather than slotted.\n */\n errorId?: string | undefined;\n /**\n * Whether the line is indented to a box's inline padding, so it starts\n * where a value above it does. Off for a field with no box to line up with.\n * @default true\n */\n inset?: boolean;\n /** The limit the count is shown against. */\n maxLength?: number | undefined;\n /**\n * Whether an empty line is kept inside a `Form`, where a message can\n * arrive after the fact. Off for a field no message can reach — a\n * checkbox in a group, whose group owns the one line — which would\n * otherwise keep a line nothing will ever fill.\n * @default true\n */\n reserve?: boolean;\n}\ntype FieldTextAreaProps = TextAreaProps & {\n /**\n * Whether the control grows with the text it holds, from the rows it asks\n * for. Off, it keeps its rows and scrolls.\n * @default false\n */\n autosize?: boolean;\n};\ntype FieldTriggerProps = ButtonProps;\ntype FieldValueProps = HTMLAttributes<HTMLElement> & {\n /**\n * Whether the field has focus. A hidden placeholder appears while it does,\n * the way an input's does.\n * @default false\n */\n isFocused?: boolean;\n /**\n * Whether nothing has been chosen yet, so what is drawn is the placeholder\n * rather than a value.\n * @default false\n */\n isPlaceholder?: boolean;\n};\ntype FieldVariant = 'filled' | 'outlined';\n\n// A control under a floating label carries a placeholder so the box can\n// tell when it is populated, shown only while focused. The default is what\n// a control rendered outside any box gets — a search bar's, which has no\n// label over it and shows its placeholder in every state. The four a box\n// provides are hoisted so each is one stable object.\nconst OUTSIDE_BOX: BoxControl = {\n label: 'none',\n underLabel: false\n};\nconst BOX_CONTROLS = {\n filled: {\n fixed: {\n label: 'fixed',\n underLabel: true\n },\n floating: {\n label: 'floating',\n underLabel: true\n }\n },\n outlined: {\n fixed: {\n label: 'fixed',\n underLabel: false\n },\n floating: {\n label: 'floating',\n underLabel: false\n }\n }\n} satisfies Record<FieldVariant, Record<'fixed' | 'floating', BoxControl>>;\nconst BoxContext = createContext<BoxControl>(OUTSIDE_BOX);\n\n// Written as calls rather than function literals at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// each result on its inputs.\nfunction boxContent(label: string, children: ReactNode, endInset: string, floatingLabel: boolean, isFocused: boolean, isPopulated: boolean | undefined, isRequired: boolean, leading: ReactNode, multiline: boolean, trailing: ReactNode, trigger: ReactNode, variant: FieldVariant) {\n return (state: GroupRenderProps) => <BoxContent endInset={endInset} floatingLabel={floatingLabel} isFocused={isFocused} isPopulated={isPopulated} isRequired={isRequired} label={label} leading={leading} multiline={multiline} state={state} trailing={trailing} trigger={trigger} variant={variant}>\n {children}\n </BoxContent>;\n}\n\n/**\n * What a box holds: its icons, its label and the control between them, plus\n * the outline when it has one. A component rather than the render function\n * itself, so it can read whether the control holds a value — which is what\n * the outlined box's notch and label follow, and what CSS cannot express\n * for them. See the outlined variant's note above.\n */\nfunction BoxContent({\n children,\n endInset,\n floatingLabel,\n isFocused,\n isPopulated,\n isRequired,\n label,\n leading,\n multiline,\n state,\n trailing,\n trigger,\n variant\n}: {\n children: ReactNode;\n endInset: string;\n floatingLabel: boolean;\n isFocused: boolean;\n isPopulated: boolean | undefined;\n isRequired: boolean;\n label: string;\n leading: ReactNode;\n multiline: boolean;\n state: GroupRenderProps;\n trailing: ReactNode;\n trigger: ReactNode;\n variant: FieldVariant;\n}) {\n const read = useFieldPopulated();\n const populated = isPopulated ?? read;\n const outlined = variant === 'outlined';\n const focused = state.isFocusWithin || isFocused;\n const floated = !floatingLabel || focused || populated;\n return <BoxContext value={BOX_CONTROLS[variant][floatingLabel ? 'floating' : 'fixed']}>\n {outlined ? <fieldset aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.outline, leading !== undefined && fieldChromeStyles.outlineLeading, trailing !== undefined && fieldChromeStyles.outlineTrailing, focused && fieldChromeStyles.outlineFocused, endInset !== '0px' && fieldChromeStyles.outlineEndInset(`calc(${spacing.lg} - ${spacing.xs} + ${endInset})`))}>\n <legend {...stylex.props(fieldChromeStyles.outlineNotch, floated && fieldChromeStyles.outlineNotchOpen)}>\n {floated ? <>\n {label}\n {isRequired ? REQUIRED_MARK : null}\n </> : null}\n </legend>\n </fieldset> : null}\n {trigger}\n {leading === undefined ? null : <span {...stylex.props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isDisabled && fieldChromeStyles.iconDisabled)}>\n {leading}\n </span>}\n <div {...stylex.props(fieldChromeStyles.column, floatingLabel && fieldChromeStyles.columnFloating, state.isDisabled && (floatingLabel ? fieldChromeStyles.columnDisabledFloating : fieldChromeStyles.columnDisabled))}>\n <FieldLabel isRequired={isRequired} state={withFocus(state, focused)} {...stylex.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})`))}>\n {label}\n </FieldLabel>\n {children}\n </div>\n {trailing === undefined ? null : <span {...stylex.props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isInvalid && fieldChromeStyles.iconError, state.isDisabled && fieldChromeStyles.iconDisabled)}>\n {trailing}\n </span>}\n </BoxContext>;\n}\nfunction boxStyles(floatingLabel: boolean, isFocused: boolean, multiline: boolean, leading: boolean, trailing: boolean, variant: FieldVariant) {\n const outlined = variant === 'outlined';\n return (state: GroupRenderProps) => stylex.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));\n}\n\n/**\n * The control's `onInput`, which also commits the field's validation while it\n * shows an error, so an edit that fixes the value clears the error as it is\n * typed rather than once focus leaves.\n *\n * React Aria commits a field's validation — the moment a server's error is\n * cleared, or the browser's own is checked again — on the control's native\n * `change` event, and a text control fires that only on blur. So a reader\n * typing the fix saw the error, red and `aria-invalid`, until they tabbed\n * away from a value that was already right. Re-dispatching `change` on input\n * is what commits early, through React Aria's own listener.\n *\n * Only while the field is invalid. A valid field still commits on blur, so\n * nothing new is flagged in the middle of typing a value: an error is shown\n * late and taken back early. React's `onChange` does not run a second time\n * for it, since the value it tracks has not moved since the input.\n */\nfunction commitWhileInvalid<E extends HTMLElement>(isInvalid: boolean, onInput: InputEventHandler<E> | undefined): InputEventHandler<E> {\n return event => {\n onInput?.(event);\n if (isInvalid) {\n event.currentTarget.dispatchEvent(new Event('change', {\n bubbles: true\n }));\n }\n };\n}\n\n/**\n * The box a control sits in, filled or outlined, with its label. React\n * Aria's `Group`, so\n * the field around it hands down `isDisabled` and `isInvalid` through context\n * and the box reports focus within it as render state, which is what the\n * label's colour follows. A field that provides no group context — one built\n * on a button rather than an input — passes the two states itself.\n */\nfunction FieldBox({\n children,\n endInset = '0px',\n floatingLabel = true,\n isFocused = false,\n isPopulated,\n isRequired = false,\n label,\n leading,\n multiline = false,\n trailing,\n trigger,\n variant = 'filled',\n ...props\n}: FieldBoxProps) {\n return <Group {...props}\n // A box with a press target of its own has it covering the box, so it\n // is only a box without one that answers a press itself.\n onPointerDown={trigger === undefined ? focusesControl(props.onPointerDown) : props.onPointerDown} {...mergeStatefulStyles(boxStyles(floatingLabel, isFocused, multiline, leading !== undefined, trailing !== undefined, variant), props)}>\n {boxContent(label, children, endInset, floatingLabel, isFocused, isPopulated, isRequired, leading, multiline, trailing, trigger, variant)}\n </Group>;\n}\n\n// What a press inside a box leaves to the element it lands on: anything that\n// acts on a press of its own, and the control itself, where the browser\n// places the caret.\nconst PRESSABLE = 'a, button, input, textarea, select, [role=\"button\"], [contenteditable=\"true\"]';\n\n/**\n * A field's text control, in a {@link FieldBox} or on its own. React Aria's\n * `Input`, which takes its label association, value and validation from the\n * field around it and reports its disabled state as render state.\n *\n * In a box it clears the label at the top, and under a floating label it\n * always carries a placeholder, since that is what the box reads to tell a\n * populated control from an empty one: its own where it was given one, a\n * blank otherwise. Outside a box it has no label over it and shows the\n * placeholder it was given in every state.\n */\nfunction FieldInput({\n numeric = false,\n placeholder,\n prefix,\n suffix,\n ...props\n}: FieldInputProps & RefAttributes<HTMLInputElement>) {\n const box = useContext(BoxContext);\n const validation = useContext(FieldErrorContext);\n const control = <Input placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} onInput={commitWhileInvalid(validation?.isInvalid ?? false, props.onInput)} {...mergeStatefulStyles((state: InputRenderProps) => stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === 'floating' && fieldChromeStyles.inputUnderFloatingLabel, numeric && fieldChromeStyles.numeric, state.isDisabled && fieldChromeStyles.inputDisabled), props)} />;\n if (prefix === undefined && suffix === undefined) {\n return control;\n }\n return <span {...stylex.props(fieldChromeStyles.affixLine)}>\n {prefix === undefined ? null : <span {...stylex.props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {prefix}\n </span>}\n {control}\n {suffix === undefined ? null : <span {...stylex.props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {suffix}\n </span>}\n </span>;\n}\n\n/**\n * A date or a time's segments, in a {@link FieldBox}: React Aria's\n * `DateInput`, or the group holding a range's two. This is what carries the\n * control's type and its place on the line, clearing the label at the top,\n * as {@link FieldValue} does for a value that was chosen.\n *\n * A typed value longer than its box behaves as an input's text does. It is\n * clipped rather than cut short, since every segment on the line is still a\n * place to type. The browser scrolls whichever segment has focus into view,\n * as it scrolls to an input's caret. And when focus leaves the segments the\n * line goes back to its start, as an input's text does on blur, so a value\n * at rest reads from its beginning rather than from wherever it was left.\n */\nfunction FieldSegments({\n children\n}: {\n children: ReactNode;\n}) {\n const box = useContext(BoxContext);\n return <span onBlur={returnToStart} {...stylex.props(fieldChromeStyles.input, fieldChromeStyles.segments, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {children}\n </span>;\n}\n\n/**\n * A field's multi-line text control, in a {@link FieldBox} drawn `multiline`.\n * React Aria's `TextArea`, with the same label association, value and\n * validation {@link FieldInput} takes from the field around it, and the same\n * placeholder under a floating label.\n *\n * Given `autosize` it grows with its text from the rows it asks for. The\n * value it grows to fit is read off the field's context rather than\n * measured: the box holds a hidden replica of it in the control's own type,\n * in the same grid cell as the control, and the cell is as tall as whichever\n * of the two is taller.\n */\nfunction FieldTextArea({\n autosize = false,\n placeholder,\n ...props\n}: FieldTextAreaProps & RefAttributes<HTMLTextAreaElement>) {\n const box = useContext(BoxContext);\n const context = useSlottedContext(TextAreaContext);\n const validation = useContext(FieldErrorContext);\n const value = typeof context?.value === 'string' ? context.value : '';\n const control = <TextArea placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} onInput={commitWhileInvalid(validation?.isInvalid ?? false, props.onInput)} {...mergeStatefulStyles((state: InputRenderProps) => stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === 'floating' && fieldChromeStyles.inputUnderFloatingLabel, fieldChromeStyles.textArea, autosize && fieldChromeStyles.textAreaAutosize, autosize && fieldChromeStyles.autosizeCell, state.isDisabled && fieldChromeStyles.inputDisabled), props)} />;\n if (!autosize) {\n return control;\n }\n\n // A trailing space keeps a final line break of the value as a line of the\n // replica, which is how the control renders it.\n return <div {...stylex.props(fieldChromeStyles.autosize)}>\n {control}\n <div aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, fieldChromeStyles.replica, fieldChromeStyles.autosizeCell)}>\n {value}{' '}\n </div>\n </div>;\n}\n\n/**\n * The press target over a {@link FieldBox} whose whole surface opens\n * something — a select's list, a picker's calendar. React Aria's `Button`,\n * which takes the trigger's props from the field around it through context.\n *\n * It covers the box rather than sitting on its value's line, so the box's\n * own padding opens the field too. It draws nothing: the box already carries\n * the fill, the underline and the focus indicator, and it lights up while\n * this has focus because the indicator follows focus within.\n */\nfunction FieldTrigger(props: FieldTriggerProps) {\n return <RACButton {...props} {...mergeStatefulStyles(stylex.props(fieldChromeStyles.trigger), props)} />;\n}\n\n/**\n * A field's value where it was chosen rather than typed, in a\n * {@link FieldBox}. Put React Aria's own element inside it — a select's\n * `SelectValue` — and this is what carries the input's type and its place on\n * the line, clearing the label at the top and truncating rather than\n * wrapping. A date or a time is typed, segment by segment, and takes\n * {@link FieldSegments} instead.\n *\n * The wrapper is the styled one rather than React Aria's element, because\n * this is the box's flex item: styling the element inside instead left it\n * sizing itself against a parent that had already shrink-wrapped to it.\n *\n * `isPlaceholder` says nothing has been chosen, which takes the muted role;\n * under a floating label it is hidden until the field is focused, exactly as\n * an input's placeholder is.\n */\nfunction FieldValue({\n isFocused = false,\n isPlaceholder = false,\n ...props\n}: FieldValueProps) {\n const box = useContext(BoxContext);\n const hidden = isPlaceholder && box.label === 'floating' && !isFocused;\n return <span {...props} {...mergeStyles(stylex.props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props)} />;\n}\n\n// What `:focus-within` draws on the box, for a box told it is focused — see\n// `isFocused`. The error's own colour wins over primary, as it does there.\nfunction focusedStyle(outlined: boolean, invalid: boolean) {\n if (outlined) {\n return invalid ? fieldChromeStyles.boxOutlinedErrorFocused : fieldChromeStyles.boxOutlinedFocused;\n }\n return invalid ? fieldChromeStyles.boxErrorFocused : fieldChromeStyles.boxFocused;\n}\n\n// What a press on the box focuses: the field's text control, or the first\n// editable element where the control is not an input — a token field's\n// editable area, a date field's first segment. Never the hidden input a\n// segmented field carries its value to a form in.\nconst CONTROL = 'input:not([type=\"hidden\"]), textarea, [contenteditable=\"true\"]';\n\n/**\n * The box's press handler: a press anywhere on the box focuses the control\n * in it, as the whole of a native text field's box does. The box is 56dp\n * and the control's line 24dp of it, so the padding above and below the\n * line, the padding at either end and the icons were dead to a press —\n * nothing took focus, and nothing said why. Built by a call rather than\n * written at the prop, which is what react-perf's no-new-function-as-prop is\n * after; the React Compiler memoises it on the call site's own handler,\n * which runs first.\n */\nfunction focusesControl(onPointerDown: ((event: PointerEvent<HTMLDivElement>) => void) | undefined) {\n return (event: PointerEvent<HTMLDivElement>) => {\n onPointerDown?.(event);\n if (event.defaultPrevented || event.button !== 0 || !(event.target instanceof Element) || event.target.closest(PRESSABLE) !== null) {\n return;\n }\n const control = event.currentTarget.querySelector<HTMLElement>(CONTROL);\n if (control === null || control.matches(':disabled')) {\n return;\n }\n // Held, so the press does not move focus to the page on its way down\n // and away from the control the line below hands it to.\n event.preventDefault();\n control.focus();\n };\n}\n\n// Back to the start of the line once focus has left every segment on it —\n// not while it moves from one segment to the next. The start is 0 in either\n// writing direction: a right-to-left line scrolls towards negative values.\nfunction returnToStart(event: FocusEvent<HTMLElement>) {\n if (!event.currentTarget.contains(event.relatedTarget)) {\n event.currentTarget.scrollLeft = 0;\n }\n}\nfunction useFieldPopulated() {\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n // A field whose value is chosen rather than typed holds no input at all,\n // so being populated is a question for its own state — without this a\n // select's floating label never floats, however much is chosen.\n const select = useContext(SelectStateContext);\n if (select !== null) {\n return select.selectionManager.selectedKeys.size > 0;\n }\n const value = input?.value ?? textArea?.value ?? '';\n return String(value).length > 0;\n}\n\n// The box's render state with focus as the box draws it, for its label,\n// whose colour follows focus. Built by a call rather than written at the\n// prop, which is what react-perf's no-new-object-as-prop is after.\nfunction withFocus(state: GroupRenderProps, focused: boolean) {\n return focused === state.isFocusWithin ? state : {\n ...state,\n isFocusWithin: focused\n };\n}\n\n/**\n * Whether the control in this box is holding anything, read off React\n * Aria's context for whichever control the field renders. The filled box\n * reads the same thing in CSS through `:placeholder-shown`; this is for\n * what CSS cannot express — see the outlined variant's note above.\n */\n/**\n * A field's label: the colour alone, positioned and given its type by whatever\n * renders it. React Aria's `Label`, which the field around it associates with\n * its control through context.\n */\n// Hoisted rather than written as the parameter's default, which would be a\n// new object on every render.\nconst NO_STATE: Partial<FieldLabelState> = {};\n\n// The asterisk after a required field's label, which is how the text fields\n// page marks one, and Material Design's own web text field draws it unless\n// told not to. Hidden from assistive technology: the control already says it\n// is required, and read out as well the label would end in \"star\". It is in\n// the label rather than beside it, so it floats and takes the label's colour\n// with it — the error role once the field is invalid.\nconst REQUIRED_MARK = <span aria-hidden=\"true\">*</span>;\nfunction FieldLabel({\n children,\n isRequired = false,\n state = NO_STATE,\n variant = 'field',\n ...props\n}: FieldLabelProps) {\n const {\n isDisabled = false,\n isFocusWithin = false,\n isInvalid = false\n } = state;\n return <Label {...props} {...mergeStyles(stylex.props(fieldChromeStyles.label, variant === 'group' && groupStyles.label, isDisabled && fieldChromeStyles.labelDisabled, isInvalid && fieldChromeStyles.labelError, !isDisabled && !isInvalid && isFocusWithin && fieldChromeStyles.labelFocused), props)}>\n {children}\n {isRequired ? REQUIRED_MARK : null}\n </Label>;\n}\n\n/**\n * The line under a field: the error while there is one, the description\n * otherwise. The error goes through React Aria's `FieldError`, which renders\n * only while the field is invalid and falls back to whatever validation\n * errors the field carries when no message is given — which is how a `Form`\n * with server-side errors, or the browser's own, reaches it without any\n * field changing. The description steps aside for those too, which is what\n * the field's validation state is read for.\n */\nfunction FieldMessage({\n characterCount = false,\n characterLimitLabel,\n description,\n error,\n errorId,\n inset = true,\n maxLength,\n reserve = true\n}: FieldMessageProps) {\n const validation = useContext(FieldErrorContext);\n const invalid = error !== undefined || (validation?.isInvalid ?? false);\n const {\n locale\n } = useLocale();\n const messages = useMessages();\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n const insideForm = useInsideForm();\n // Read directly rather than through `useSlottedContext`, which throws for\n // a missing slot exactly as `Text` does — the throw is the thing being\n // avoided. What it is for is below, at `written`.\n const text = useContext(TextContext);\n\n // The limit, in words, for the description React Aria reads out with the\n // field. `maxLength` alone reaches the control as the native attribute,\n // which is not reliably announced, and the count beside the message is\n // hidden — so without this a reader is never told there is a limit.\n const limit = maxLength === undefined ? undefined : characterLimitLabel ?? messages.characterLimit(maxLength);\n const hidden = limit === undefined ? null : <VisuallyHidden elementType=\"span\">\n <Text slot=\"description\">{limit}</Text>\n </VisuallyHidden>;\n\n // Nothing to say: the field ends at its control. Inside a form the line is\n // drawn anyway, empty, since a form is where a message appears after the\n // fact — a server's answer, or the browser's own on submit — and every\n // field below this one would otherwise move by the line's height when it\n // does.\n //\n // Outside one the line is still there, collapsed out of the flow so the\n // field is no taller for it, because it holds the live region below: a\n // region has to be in the document before the error it announces arrives,\n // and one mounted with its text already in it is not read out. A limit to\n // announce rides in it the same way, rather than drawing the line for\n // something nobody can see.\n const collapsed = !invalid && description === undefined && !characterCount && !(insideForm && reserve);\n const value = input?.value ?? textArea?.value ?? '';\n const length = String(value).length;\n const hint = invalid ? undefined : description;\n\n // One slotted description, never two. React Aria hands every element in\n // its description slot the same generated id, so a second one puts a\n // duplicate id in the document and axe fails the story. The limit rides\n // inside the hint where there is one, and carries the whole slot where\n // there is not — hidden either way, since the count already draws it.\n //\n // Hidden by clipping rather than by leaving it out of the row, and the\n // difference is a gap: the row is a flex line with 16dp between its parts,\n // and an element with no width is still a part. Clipping takes it out of\n // flow, so a field with a limit and no hint has the line it had before.\n const described = hint === undefined ? hidden : <Text slot=\"description\" {...stylex.props(fieldChromeStyles.message)}>\n {hint}\n {limit === undefined ? null :\n // The space is load-bearing: a description is read as the text\n // content of one element, and two spans run together without it.\n <VisuallyHidden elementType=\"span\">{` ${limit}`}</VisuallyHidden>}\n </Text>;\n\n // Outside a field that validates there is nothing to hand React Aria's\n // `FieldError`, and it draws nothing without it — a group of chips is a\n // group rather than a form control, so the error it was given is written\n // out instead.\n //\n // Through the group's error slot where there is one, which is what makes\n // the message reach a screen reader at all: React Aria generates the id\n // its `aria-describedby` points at up front, then keeps it only while\n // something in the document carries it, so an element outside the slot is\n // drawn and never announced. The description beside it has always gone\n // through its own slot, which is why that half worked.\n //\n // Not every group has one. `TagGroup` wires up a description and an error;\n // `TokenField` wires up a description alone and generates no error id at\n // all, so the field names the message itself with `errorId` and points its\n // editable area at it — see TokenField.\n const errorSlot = text !== null && typeof text === 'object' && 'slots' in text && text.slots?.errorMessage !== undefined;\n const messageStyles = stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageError);\n const written = errorSlot ? <Text slot=\"errorMessage\" {...messageStyles}>\n {error}\n </Text> : <span id={errorId} {...messageStyles}>\n {error}\n </span>;\n return <div {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageLine, inset && fieldChromeStyles.messageInset, collapsed && fieldChromeStyles.messageLineCollapsed)}>\n {/*\n * The error, read out politely as it appears, since the move into\n * `aria-describedby` that associates it is not: a screen reader does\n * not re-read a description that changes under a control it is on,\n * and after a submit, focus is on the submit button rather than the\n * field. Typing-time, blur-time and a server's errors all arrive this\n * way.\n *\n * The error alone rather than the whole line, so the description\n * coming back once the error clears is not read out, and neither is\n * the limit beside it. Atomic, so a changed message is read whole.\n */}\n <span aria-atomic=\"true\" aria-live=\"polite\" {...stylex.props(fieldChromeStyles.messageRegion)}>\n {validation === null && error !== undefined ? written : <FieldError {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageError)}>\n {error}\n </FieldError>}\n </span>\n {described}\n {characterCount ?\n // Hidden from the tree, and the limit above is why. A count is the\n // one piece of supporting text that changes on every keystroke, and\n // a screen reader reading it back at that rate is worse than not\n // hearing it — the limit said once on focus is what a reader needs,\n // and this is the same fact drawn for whoever is looking.\n <span aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.counter, invalid && fieldChromeStyles.messageError)}>\n {countIn(locale, length, maxLength)}\n </span> : null}\n </div>;\n}\n\n/**\n * The same asterisk for a label that is not a field's own — a checkbox's, a\n * switch's — so every required control is marked by one element.\n */\nfunction RequiredMark() {\n return REQUIRED_MARK;\n}\n\n// The count in the reader's digits and grouping, as React Aria writes a\n// number field's value and a meter's percentage beside it — Arabic-Indic\n// under ar-EG, `1 200` under fr-FR, and `1,200` in English. One formatter per\n// locale, for the reason Currency keeps its own: building one is about ten\n// times dearer than reusing it, and the count changes on every keystroke.\nconst counterFormatters = new Map<string, Intl.NumberFormat>();\nfunction countIn(locale: string, length: number, maxLength: number | undefined) {\n let formatter = counterFormatters.get(locale);\n if (formatter === undefined) {\n formatter = new Intl.NumberFormat(locale);\n counterFormatters.set(locale, formatter);\n }\n return maxLength === undefined ? formatter.format(length) : `${formatter.format(length)}/${formatter.format(maxLength)}`;\n}\nexport type { FieldBoxProps, FieldInputProps, FieldLabelProps, FieldLabelState, FieldLabelVariant, FieldMessageProps, FieldTextAreaProps, FieldVariant };\nexport { FieldBox, FieldInput, FieldLabel, FieldMessage, FieldSegments, FieldTextArea, FieldTrigger, FieldValue, RequiredMark };"],"mappings":";;;;;;;;;;;AAiPA,MA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oCAAoB,IAAIC,IAA+B;AAC7D,SAASH,QAAQrB,QAAgBP,QAAgBxJ,WAA+B;CAC9E,IAAI0L,YAAYJ,kBAAkBK,IAAI5B,MAAM;CAC5C,IAAI2B,cAAc3J,KAAAA,GAAW;EAC3B2J,YAAY,IAAIF,KAAKC,aAAa1B,MAAM;EACxCuB,kBAAkBM,IAAI7B,QAAQ2B,SAAS;CACzC;CACA,OAAO1L,cAAc+B,KAAAA,IAAY2J,UAAUG,OAAOrC,MAAM,IAAI,GAAGkC,UAAUG,OAAOrC,MAAM,EAAC,GAAIkC,UAAUG,OAAO7L,SAAS;AACvH"}
1
+ {"version":3,"file":"index.js","names":["FocusEvent","HTMLAttributes","InputEventHandler","ReactNode","Ref","RefAttributes","ButtonProps","GroupProps","GroupRenderProps","InputProps","InputRenderProps","LabelProps","TextAreaProps","stylex","createContext","useContext","FieldError","FieldErrorContext","Group","Input","InputContext","Label","Button","RACButton","SelectStateContext","Text","TextArea","TextAreaContext","TextContext","useLocale","useSlottedContext","VisuallyHidden","useMessages","mergeStatefulStyles","mergeStyles","spacing","focusesControl","useInsideForm","fieldChromeStyles","groupStyles","BoxControl","label","BoxLabel","underLabel","FieldBoxProps","Omit","children","endInset","floatingLabel","isFocused","isPopulated","isRequired","leading","multiline","ref","HTMLDivElement","trailing","trigger","variant","FieldVariant","FieldInputProps","numeric","prefix","suffix","FieldLabelProps","state","Partial","FieldLabelState","FieldLabelVariant","Pick","FieldMessageProps","characterCount","characterLimitLabel","description","error","errorId","inset","maxLength","reserve","FieldTextAreaProps","autosize","FieldTriggerProps","FieldValueProps","HTMLElement","isPlaceholder","OUTSIDE_BOX","BOX_CONTROLS","filled","fixed","floating","outlined","Record","BoxContext","boxContent","BoxContent","t0","$","_c","read","useFieldPopulated","populated","focused","isFocusWithin","floated","t1","t2","props","outline","undefined","outlineLeading","outlineTrailing","outlineFocused","outlineEndInset","lg","xs","outlineNotch","outlineNotchOpen","REQUIRED_MARK","t3","isDisabled","icon","iconMultiline","iconOutlined","iconDisabled","t4","column","columnFloating","columnDisabledFloating","columnDisabled","t5","withFocus","t6","boxLabel","boxLabelFloated","boxLabelOutlined","boxLabelOutlinedFloated","boxLabelEndInset","t7","t8","t9","isInvalid","iconError","t10","boxStyles","box","boxFloating","boxFixed","boxMultiline","boxLeading","boxTrailing","boxOutlined","boxOutlinedFloating","boxOutlinedMultiline","boxOutlinedError","boxError","isHovered","boxOutlinedErrorHovered","boxOutlinedHovered","focusedStyle","boxOutlinedDisabled","boxDisabled","commitWhileInvalid","onInput","E","event","currentTarget","dispatchEvent","Event","bubbles","FieldBox","T0","t11","t12","t13","t14","t15","onPointerDown","FieldInput","placeholder","validation","input","inputUnderLabel","inputUnderFloatingLabel","inputDisabled","control","Symbol","for","affixLine","affix","FieldSegments","segments","returnToStart","FieldTextArea","context","value","textArea","textAreaAutosize","autosizeCell","replica","FieldTrigger","FieldValue","hidden","valuePlaceholder","valuePlaceholderHidden","invalid","boxOutlinedErrorFocused","boxOutlinedFocused","boxErrorFocused","boxFocused","contains","relatedTarget","scrollLeft","select","selectionManager","selectedKeys","size","String","length","NO_STATE","FieldLabel","labelDisabled","labelError","labelFocused","FieldMessage","locale","messages","insideForm","text","characterLimit","limit","collapsed","hint","message","described","errorSlot","slots","errorMessage","messageError","messageStyles","written","messageLine","messageInset","messageLineCollapsed","messageRegion","counter","countIn","RequiredMark","counterFormatters","Map","Intl","NumberFormat","formatter","get","set","format","_c","stylex.props","props","RACButton"],"sources":["../../src/field/index.tsx"],"sourcesContent":["import type { FocusEvent, HTMLAttributes, InputEventHandler, ReactNode, Ref, RefAttributes } from 'react';\nimport type { ButtonProps, GroupProps, GroupRenderProps, InputProps, InputRenderProps, LabelProps, TextAreaProps } from 'react-aria-components';\nimport * as stylex from '@stylexjs/stylex';\nimport { createContext, useContext } from 'react';\nimport { FieldError, FieldErrorContext, Group, Input, InputContext, Label, Button as RACButton, SelectStateContext, Text, TextArea, TextAreaContext, TextContext, useLocale, useSlottedContext, VisuallyHidden } from 'react-aria-components';\nimport { useMessages } from '../i18n';\nimport { mergeStatefulStyles, mergeStyles } from '../styles/merge';\nimport { spacing } from '../tokens/design.tokens.stylex';\nimport { focusesControl } from './press';\nimport { useInsideForm } from './root';\nimport { fieldChromeStyles, groupStyles } from './styles';\n\n// The chrome every field shares: the filled box with its label at the top, the\n// control inside it, and the line of supporting text under it. TextField drew\n// all of it on its own until the coverage plan brought a dozen more fields,\n// each of which would otherwise have written the same box a second time.\n//\n// Not a component of the library's own and not exported. Each field is still\n// React Aria's field component — TextField, NumberField, DateField — and these\n// are the parts it renders inside, which is what keeps the label association,\n// the description and error wiring, and validation on React Aria's side.\n//\n// Neither the notch nor the label can select on the state that drives them.\n// Both are children of the box and the state is the box's, and the filled\n// label reads it in CSS only because it changes type alone, which the box\n// hands down inherited — where the notch changes what it holds and the\n// label changes where it sits, and neither of those inherits. So the box's\n// content computes that state in React instead: focus from the box's own\n// render state, and a value from the control's context, which is where the\n// character counter reads it too. The border's colour is the box's,\n// inherited, which is what carries the hover, focus, error and disabled\n// roles to it.\n\n// What a control needs to know about the box around it: how the label is\n// drawn, and whether the control clears it with a margin — it does under\n// the filled box's label, and not under the outlined box's, whose label\n// sits on the outline rather than over the value.\ninterface BoxControl {\n label: BoxLabel;\n underLabel: boolean;\n}\n\n// How the box draws its label, for the control inside it — see the context\n// below.\ntype BoxLabel = 'fixed' | 'floating' | 'none';\ntype FieldBoxProps = Omit<GroupProps, 'children'> & {\n children?: ReactNode;\n /**\n * How much of the inline end of the column the control's own parts take,\n * beside the control, as a CSS length: a number field's steppers. The\n * label, and the outlined box's notch with it, stop that far short of the\n * column's end, so a long label is cut short beside them rather than\n * drawn under them. A part in `trailing` needs none of this, since it sits\n * outside the column.\n * @default '0px'\n */\n endInset?: string;\n /**\n * Whether the label sits in the empty box and floats to the top once the\n * field is focused or holds a value, as the text fields page draws it.\n * `false` keeps it small at the top in every state.\n * @default true\n */\n floatingLabel?: boolean;\n /**\n * Whether the field holds focus somewhere the box cannot see, so the box\n * draws its focused state — the floated label, the focused indicator and\n * the label's colour — without focus inside it. A select's open list is\n * the case: opening it moves focus into the list, on an overlay outside\n * the box, and left to `:focus-within` the label fell back onto the\n * placeholder the select still showed.\n * @default false\n */\n isFocused?: boolean;\n /**\n * Whether the control is holding anything, for a field whose control the\n * chrome cannot ask. It reads an input, a text area and a select's own\n * state; a control that is none of those — a token field's editable area,\n * say — says so here, and the floating label floats on it.\n */\n isPopulated?: boolean;\n /**\n * Whether the field must be filled, which marks its label with an\n * asterisk. The field passes its own `isRequired` on, since the group the\n * box is reports none.\n * @default false\n */\n isRequired?: boolean;\n /** What the field is for. */\n label: string;\n /** An icon at the start of the box, before the label and the control. */\n leading?: ReactNode;\n /**\n * Whether the box takes its height from the control inside it rather\n * than the page's 56dp, for a text area.\n * @default false\n */\n multiline?: boolean;\n /**\n * The box's own element. A field whose box is what something else is\n * anchored to needs it — a select's list is positioned against the box and\n * takes its width from it, which is what makes the two the same width.\n */\n ref?: Ref<HTMLDivElement>;\n /** An icon at the end of the box, after the control. */\n trailing?: ReactNode;\n /**\n * A press target covering the whole box, for a field whose box opens\n * something rather than taking a keystroke — {@link FieldTrigger}. Drawn\n * in the box itself rather than in the column the label and the control\n * share, so the padding and the icons open it too.\n */\n trigger?: ReactNode;\n /**\n * The filled box, or the outlined one: no fill, an outline that thickens\n * and takes the primary role while focused, and the label cutting it once\n * it floats.\n * @default 'filled'\n */\n variant?: FieldVariant;\n};\n\n// `prefix` is also an HTML attribute — the RDFa one, which nothing here\n// wants — and React's element types carry it as a string, so it is left out\n// of the props taken from React Aria to make room for the affix.\ntype FieldInputProps = Omit<InputProps, 'prefix'> & {\n /**\n * Renders the value in the mono face with tabular figures, for amounts and\n * other numbers meant to be compared down a column.\n * @default false\n */\n numeric?: boolean;\n /**\n * Text before the value on its line, shown while the field is focused or\n * holds a value.\n */\n prefix?: ReactNode;\n /**\n * Text after the value on its line, shown while the field is focused or\n * holds a value.\n */\n suffix?: ReactNode;\n};\ntype FieldLabelProps = LabelProps & {\n /**\n * Whether the field must be filled, which ends the label in an asterisk in\n * the label's own colour.\n * @default false\n */\n isRequired?: boolean;\n /**\n * The states the colour follows. Disabled wins over error, and error over\n * focus, so a focused invalid field keeps its error colour.\n */\n state?: Partial<FieldLabelState>;\n /**\n * Where the label sits. `field` is inside a box, positioned and typed by\n * whatever renders it. `group` is above a group of controls, which has no\n * box to float a label in, so this one carries its type itself.\n * @default 'field'\n */\n variant?: FieldLabelVariant;\n};\ntype FieldLabelState = Pick<GroupRenderProps, 'isDisabled' | 'isFocusWithin' | 'isInvalid'>;\ntype FieldLabelVariant = 'field' | 'group';\ninterface FieldMessageProps {\n /**\n * Whether to count the characters the control holds at the end of the\n * line, against `maxLength` where there is one. The count is read off the\n * field's own input or text area context, and written in the locale's\n * digits and grouping.\n * @default false\n */\n characterCount?: boolean;\n /**\n * How the limit is said to a screen reader, where there is a `maxLength`.\n * It is read with the field on focus rather than as the value changes, so\n * it names the limit and not what is left of it. Left out, it is the\n * sentence for it in the I18nProvider's locale — \"Up to 20 characters\" in\n * English, singular for a limit of one.\n */\n characterLimitLabel?: string | undefined;\n /**\n * A hint shown under the field. Replaced by `error` when there is one, so\n * the two never stack.\n */\n description?: string | undefined;\n /** The problem with the current value, in words. */\n error?: string | undefined;\n /**\n * The id the error takes, for a field that points `aria-describedby` at it\n * itself because its React Aria component generates no error id of its\n * own. Used only where the message is written out rather than slotted.\n */\n errorId?: string | undefined;\n /**\n * Whether the line is indented to a box's inline padding, so it starts\n * where a value above it does. Off for a field with no box to line up with.\n * @default true\n */\n inset?: boolean;\n /** The limit the count is shown against. */\n maxLength?: number | undefined;\n /**\n * Whether an empty line is kept inside a `Form`, where a message can\n * arrive after the fact. Off for a field no message can reach — a\n * checkbox in a group, whose group owns the one line — which would\n * otherwise keep a line nothing will ever fill.\n * @default true\n */\n reserve?: boolean;\n}\ntype FieldTextAreaProps = TextAreaProps & {\n /**\n * Whether the control grows with the text it holds, from the rows it asks\n * for. Off, it keeps its rows and scrolls.\n * @default false\n */\n autosize?: boolean;\n};\ntype FieldTriggerProps = ButtonProps;\ntype FieldValueProps = HTMLAttributes<HTMLElement> & {\n /**\n * Whether the field has focus. A hidden placeholder appears while it does,\n * the way an input's does.\n * @default false\n */\n isFocused?: boolean;\n /**\n * Whether nothing has been chosen yet, so what is drawn is the placeholder\n * rather than a value.\n * @default false\n */\n isPlaceholder?: boolean;\n};\ntype FieldVariant = 'filled' | 'outlined';\n\n// A control under a floating label carries a placeholder so the box can\n// tell when it is populated, shown only while focused. The default is what\n// a control rendered outside any box gets — a search bar's, which has no\n// label over it and shows its placeholder in every state. The four a box\n// provides are hoisted so each is one stable object.\nconst OUTSIDE_BOX: BoxControl = {\n label: 'none',\n underLabel: false\n};\nconst BOX_CONTROLS = {\n filled: {\n fixed: {\n label: 'fixed',\n underLabel: true\n },\n floating: {\n label: 'floating',\n underLabel: true\n }\n },\n outlined: {\n fixed: {\n label: 'fixed',\n underLabel: false\n },\n floating: {\n label: 'floating',\n underLabel: false\n }\n }\n} satisfies Record<FieldVariant, Record<'fixed' | 'floating', BoxControl>>;\nconst BoxContext = createContext<BoxControl>(OUTSIDE_BOX);\n\n// Written as calls rather than function literals at the prop, which is what\n// react-perf's no-new-function-as-prop is after; the React Compiler memoises\n// each result on its inputs.\nfunction boxContent(label: string, children: ReactNode, endInset: string, floatingLabel: boolean, isFocused: boolean, isPopulated: boolean | undefined, isRequired: boolean, leading: ReactNode, multiline: boolean, trailing: ReactNode, trigger: ReactNode, variant: FieldVariant) {\n return (state: GroupRenderProps) => <BoxContent endInset={endInset} floatingLabel={floatingLabel} isFocused={isFocused} isPopulated={isPopulated} isRequired={isRequired} label={label} leading={leading} multiline={multiline} state={state} trailing={trailing} trigger={trigger} variant={variant}>\n {children}\n </BoxContent>;\n}\n\n/**\n * What a box holds: its icons, its label and the control between them, plus\n * the outline when it has one. A component rather than the render function\n * itself, so it can read whether the control holds a value — which is what\n * the outlined box's notch and label follow, and what CSS cannot express\n * for them. See the outlined variant's note above.\n */\nfunction BoxContent({\n children,\n endInset,\n floatingLabel,\n isFocused,\n isPopulated,\n isRequired,\n label,\n leading,\n multiline,\n state,\n trailing,\n trigger,\n variant\n}: {\n children: ReactNode;\n endInset: string;\n floatingLabel: boolean;\n isFocused: boolean;\n isPopulated: boolean | undefined;\n isRequired: boolean;\n label: string;\n leading: ReactNode;\n multiline: boolean;\n state: GroupRenderProps;\n trailing: ReactNode;\n trigger: ReactNode;\n variant: FieldVariant;\n}) {\n const read = useFieldPopulated();\n const populated = isPopulated ?? read;\n const outlined = variant === 'outlined';\n const focused = state.isFocusWithin || isFocused;\n const floated = !floatingLabel || focused || populated;\n return <BoxContext value={BOX_CONTROLS[variant][floatingLabel ? 'floating' : 'fixed']}>\n {outlined ? <fieldset aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.outline, leading !== undefined && fieldChromeStyles.outlineLeading, trailing !== undefined && fieldChromeStyles.outlineTrailing, focused && fieldChromeStyles.outlineFocused, endInset !== '0px' && fieldChromeStyles.outlineEndInset(`calc(${spacing.lg} - ${spacing.xs} + ${endInset})`))}>\n <legend {...stylex.props(fieldChromeStyles.outlineNotch, floated && fieldChromeStyles.outlineNotchOpen)}>\n {floated ? <>\n {label}\n {isRequired ? REQUIRED_MARK : null}\n </> : null}\n </legend>\n </fieldset> : null}\n {trigger}\n {leading === undefined ? null : <span {...stylex.props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isDisabled && fieldChromeStyles.iconDisabled)}>\n {leading}\n </span>}\n <div {...stylex.props(fieldChromeStyles.column, floatingLabel && fieldChromeStyles.columnFloating, state.isDisabled && (floatingLabel ? fieldChromeStyles.columnDisabledFloating : fieldChromeStyles.columnDisabled))}>\n <FieldLabel isRequired={isRequired} state={withFocus(state, focused)} {...stylex.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})`))}>\n {label}\n </FieldLabel>\n {children}\n </div>\n {trailing === undefined ? null : <span {...stylex.props(fieldChromeStyles.icon, multiline && fieldChromeStyles.iconMultiline, outlined && fieldChromeStyles.iconOutlined, state.isInvalid && fieldChromeStyles.iconError, state.isDisabled && fieldChromeStyles.iconDisabled)}>\n {trailing}\n </span>}\n </BoxContext>;\n}\nfunction boxStyles(floatingLabel: boolean, isFocused: boolean, multiline: boolean, leading: boolean, trailing: boolean, variant: FieldVariant) {\n const outlined = variant === 'outlined';\n return (state: GroupRenderProps) => stylex.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));\n}\n\n/**\n * The control's `onInput`, which also commits the field's validation while it\n * shows an error, so an edit that fixes the value clears the error as it is\n * typed rather than once focus leaves.\n *\n * React Aria commits a field's validation — the moment a server's error is\n * cleared, or the browser's own is checked again — on the control's native\n * `change` event, and a text control fires that only on blur. So a reader\n * typing the fix saw the error, red and `aria-invalid`, until they tabbed\n * away from a value that was already right. Re-dispatching `change` on input\n * is what commits early, through React Aria's own listener.\n *\n * Only while the field is invalid. A valid field still commits on blur, so\n * nothing new is flagged in the middle of typing a value: an error is shown\n * late and taken back early. React's `onChange` does not run a second time\n * for it, since the value it tracks has not moved since the input.\n */\nfunction commitWhileInvalid<E extends HTMLElement>(isInvalid: boolean, onInput: InputEventHandler<E> | undefined): InputEventHandler<E> {\n return event => {\n onInput?.(event);\n if (isInvalid) {\n event.currentTarget.dispatchEvent(new Event('change', {\n bubbles: true\n }));\n }\n };\n}\n\n/**\n * The box a control sits in, filled or outlined, with its label. React\n * Aria's `Group`, so\n * the field around it hands down `isDisabled` and `isInvalid` through context\n * and the box reports focus within it as render state, which is what the\n * label's colour follows. A field that provides no group context — one built\n * on a button rather than an input — passes the two states itself.\n */\nfunction FieldBox({\n children,\n endInset = '0px',\n floatingLabel = true,\n isFocused = false,\n isPopulated,\n isRequired = false,\n label,\n leading,\n multiline = false,\n trailing,\n trigger,\n variant = 'filled',\n ...props\n}: FieldBoxProps) {\n return <Group {...props}\n // A box with a press target of its own has it covering the box, so it\n // is only a box without one that answers a press itself.\n onPointerDown={trigger === undefined ? focusesControl(props.onPointerDown) : props.onPointerDown} {...mergeStatefulStyles(boxStyles(floatingLabel, isFocused, multiline, leading !== undefined, trailing !== undefined, variant), props)}>\n {boxContent(label, children, endInset, floatingLabel, isFocused, isPopulated, isRequired, leading, multiline, trailing, trigger, variant)}\n </Group>;\n}\n\n/**\n * A field's text control, in a {@link FieldBox} or on its own. React Aria's\n * `Input`, which takes its label association, value and validation from the\n * field around it and reports its disabled state as render state.\n *\n * In a box it clears the label at the top, and under a floating label it\n * always carries a placeholder, since that is what the box reads to tell a\n * populated control from an empty one: its own where it was given one, a\n * blank otherwise. Outside a box it has no label over it and shows the\n * placeholder it was given in every state.\n */\nfunction FieldInput({\n numeric = false,\n placeholder,\n prefix,\n suffix,\n ...props\n}: FieldInputProps & RefAttributes<HTMLInputElement>) {\n const box = useContext(BoxContext);\n const validation = useContext(FieldErrorContext);\n const control = <Input placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} onInput={commitWhileInvalid(validation?.isInvalid ?? false, props.onInput)} {...mergeStatefulStyles((state: InputRenderProps) => stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === 'floating' && fieldChromeStyles.inputUnderFloatingLabel, numeric && fieldChromeStyles.numeric, state.isDisabled && fieldChromeStyles.inputDisabled), props)} />;\n if (prefix === undefined && suffix === undefined) {\n return control;\n }\n return <span {...stylex.props(fieldChromeStyles.affixLine)}>\n {prefix === undefined ? null : <span {...stylex.props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {prefix}\n </span>}\n {control}\n {suffix === undefined ? null : <span {...stylex.props(fieldChromeStyles.affix, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {suffix}\n </span>}\n </span>;\n}\n\n/**\n * A date or a time's segments, in a {@link FieldBox}: React Aria's\n * `DateInput`, or the group holding a range's two. This is what carries the\n * control's type and its place on the line, clearing the label at the top,\n * as {@link FieldValue} does for a value that was chosen.\n *\n * A typed value longer than its box behaves as an input's text does. It is\n * clipped rather than cut short, since every segment on the line is still a\n * place to type. The browser scrolls whichever segment has focus into view,\n * as it scrolls to an input's caret. And when focus leaves the segments the\n * line goes back to its start, as an input's text does on blur, so a value\n * at rest reads from its beginning rather than from wherever it was left.\n */\nfunction FieldSegments({\n children\n}: {\n children: ReactNode;\n}) {\n const box = useContext(BoxContext);\n return <span onBlur={returnToStart} {...stylex.props(fieldChromeStyles.input, fieldChromeStyles.segments, box.underLabel && fieldChromeStyles.inputUnderLabel)}>\n {children}\n </span>;\n}\n\n/**\n * A field's multi-line text control, in a {@link FieldBox} drawn `multiline`.\n * React Aria's `TextArea`, with the same label association, value and\n * validation {@link FieldInput} takes from the field around it, and the same\n * placeholder under a floating label.\n *\n * Given `autosize` it grows with its text from the rows it asks for. The\n * value it grows to fit is read off the field's context rather than\n * measured: the box holds a hidden replica of it in the control's own type,\n * in the same grid cell as the control, and the cell is as tall as whichever\n * of the two is taller.\n */\nfunction FieldTextArea({\n autosize = false,\n placeholder,\n ...props\n}: FieldTextAreaProps & RefAttributes<HTMLTextAreaElement>) {\n const box = useContext(BoxContext);\n const context = useSlottedContext(TextAreaContext);\n const validation = useContext(FieldErrorContext);\n const value = typeof context?.value === 'string' ? context.value : '';\n const control = <TextArea placeholder={placeholder ?? (box.label === 'floating' ? ' ' : undefined)} {...props} onInput={commitWhileInvalid(validation?.isInvalid ?? false, props.onInput)} {...mergeStatefulStyles((state: InputRenderProps) => stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, box.label === 'floating' && fieldChromeStyles.inputUnderFloatingLabel, fieldChromeStyles.textArea, autosize && fieldChromeStyles.textAreaAutosize, autosize && fieldChromeStyles.autosizeCell, state.isDisabled && fieldChromeStyles.inputDisabled), props)} />;\n if (!autosize) {\n return control;\n }\n\n // A trailing space keeps a final line break of the value as a line of the\n // replica, which is how the control renders it.\n return <div {...stylex.props(fieldChromeStyles.autosize)}>\n {control}\n <div aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.input, box.underLabel && fieldChromeStyles.inputUnderLabel, fieldChromeStyles.replica, fieldChromeStyles.autosizeCell)}>\n {value}{' '}\n </div>\n </div>;\n}\n\n/**\n * The press target over a {@link FieldBox} whose whole surface opens\n * something — a select's list, a picker's calendar. React Aria's `Button`,\n * which takes the trigger's props from the field around it through context.\n *\n * It covers the box rather than sitting on its value's line, so the box's\n * own padding opens the field too. It draws nothing: the box already carries\n * the fill, the underline and the focus indicator, and it lights up while\n * this has focus because the indicator follows focus within.\n */\nfunction FieldTrigger(props: FieldTriggerProps) {\n return <RACButton {...props} {...mergeStatefulStyles(stylex.props(fieldChromeStyles.trigger), props)} />;\n}\n\n/**\n * A field's value where it was chosen rather than typed, in a\n * {@link FieldBox}. Put React Aria's own element inside it — a select's\n * `SelectValue` — and this is what carries the input's type and its place on\n * the line, clearing the label at the top and truncating rather than\n * wrapping. A date or a time is typed, segment by segment, and takes\n * {@link FieldSegments} instead.\n *\n * The wrapper is the styled one rather than React Aria's element, because\n * this is the box's flex item: styling the element inside instead left it\n * sizing itself against a parent that had already shrink-wrapped to it.\n *\n * `isPlaceholder` says nothing has been chosen, which takes the muted role;\n * under a floating label it is hidden until the field is focused, exactly as\n * an input's placeholder is.\n */\nfunction FieldValue({\n isFocused = false,\n isPlaceholder = false,\n ...props\n}: FieldValueProps) {\n const box = useContext(BoxContext);\n const hidden = isPlaceholder && box.label === 'floating' && !isFocused;\n return <span {...props} {...mergeStyles(stylex.props(fieldChromeStyles.input, fieldChromeStyles.value, box.underLabel && fieldChromeStyles.inputUnderLabel, isPlaceholder && fieldChromeStyles.valuePlaceholder, hidden && fieldChromeStyles.valuePlaceholderHidden), props)} />;\n}\n\n// What `:focus-within` draws on the box, for a box told it is focused — see\n// `isFocused`. The error's own colour wins over primary, as it does there.\nfunction focusedStyle(outlined: boolean, invalid: boolean) {\n if (outlined) {\n return invalid ? fieldChromeStyles.boxOutlinedErrorFocused : fieldChromeStyles.boxOutlinedFocused;\n }\n return invalid ? fieldChromeStyles.boxErrorFocused : fieldChromeStyles.boxFocused;\n}\n\n// Back to the start of the line once focus has left every segment on it —\n// not while it moves from one segment to the next. The start is 0 in either\n// writing direction: a right-to-left line scrolls towards negative values.\nfunction returnToStart(event: FocusEvent<HTMLElement>) {\n if (!event.currentTarget.contains(event.relatedTarget)) {\n event.currentTarget.scrollLeft = 0;\n }\n}\nfunction useFieldPopulated() {\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n // A field whose value is chosen rather than typed holds no input at all,\n // so being populated is a question for its own state — without this a\n // select's floating label never floats, however much is chosen.\n const select = useContext(SelectStateContext);\n if (select !== null) {\n return select.selectionManager.selectedKeys.size > 0;\n }\n const value = input?.value ?? textArea?.value ?? '';\n return String(value).length > 0;\n}\n\n// The box's render state with focus as the box draws it, for its label,\n// whose colour follows focus. Built by a call rather than written at the\n// prop, which is what react-perf's no-new-object-as-prop is after.\nfunction withFocus(state: GroupRenderProps, focused: boolean) {\n return focused === state.isFocusWithin ? state : {\n ...state,\n isFocusWithin: focused\n };\n}\n\n/**\n * Whether the control in this box is holding anything, read off React\n * Aria's context for whichever control the field renders. The filled box\n * reads the same thing in CSS through `:placeholder-shown`; this is for\n * what CSS cannot express — see the outlined variant's note above.\n */\n/**\n * A field's label: the colour alone, positioned and given its type by whatever\n * renders it. React Aria's `Label`, which the field around it associates with\n * its control through context.\n */\n// Hoisted rather than written as the parameter's default, which would be a\n// new object on every render.\nconst NO_STATE: Partial<FieldLabelState> = {};\n\n// The asterisk after a required field's label, which is how the text fields\n// page marks one, and Material Design's own web text field draws it unless\n// told not to. Hidden from assistive technology: the control already says it\n// is required, and read out as well the label would end in \"star\". It is in\n// the label rather than beside it, so it floats and takes the label's colour\n// with it — the error role once the field is invalid.\nconst REQUIRED_MARK = <span aria-hidden=\"true\">*</span>;\nfunction FieldLabel({\n children,\n isRequired = false,\n state = NO_STATE,\n variant = 'field',\n ...props\n}: FieldLabelProps) {\n const {\n isDisabled = false,\n isFocusWithin = false,\n isInvalid = false\n } = state;\n return <Label {...props} {...mergeStyles(stylex.props(fieldChromeStyles.label, variant === 'group' && groupStyles.label, isDisabled && fieldChromeStyles.labelDisabled, isInvalid && fieldChromeStyles.labelError, !isDisabled && !isInvalid && isFocusWithin && fieldChromeStyles.labelFocused), props)}>\n {children}\n {isRequired ? REQUIRED_MARK : null}\n </Label>;\n}\n\n/**\n * The line under a field: the error while there is one, the description\n * otherwise. The error goes through React Aria's `FieldError`, which renders\n * only while the field is invalid and falls back to whatever validation\n * errors the field carries when no message is given — which is how a `Form`\n * with server-side errors, or the browser's own, reaches it without any\n * field changing. The description steps aside for those too, which is what\n * the field's validation state is read for.\n */\nfunction FieldMessage({\n characterCount = false,\n characterLimitLabel,\n description,\n error,\n errorId,\n inset = true,\n maxLength,\n reserve = true\n}: FieldMessageProps) {\n const validation = useContext(FieldErrorContext);\n const invalid = error !== undefined || (validation?.isInvalid ?? false);\n const {\n locale\n } = useLocale();\n const messages = useMessages();\n const input = useSlottedContext(InputContext);\n const textArea = useSlottedContext(TextAreaContext);\n const insideForm = useInsideForm();\n // Read directly rather than through `useSlottedContext`, which throws for\n // a missing slot exactly as `Text` does — the throw is the thing being\n // avoided. What it is for is below, at `written`.\n const text = useContext(TextContext);\n\n // The limit, in words, for the description React Aria reads out with the\n // field. `maxLength` alone reaches the control as the native attribute,\n // which is not reliably announced, and the count beside the message is\n // hidden — so without this a reader is never told there is a limit.\n const limit = maxLength === undefined ? undefined : characterLimitLabel ?? messages.characterLimit(maxLength);\n const hidden = limit === undefined ? null : <VisuallyHidden elementType=\"span\">\n <Text slot=\"description\">{limit}</Text>\n </VisuallyHidden>;\n\n // Nothing to say: the field ends at its control. Inside a form the line is\n // drawn anyway, empty, since a form is where a message appears after the\n // fact — a server's answer, or the browser's own on submit — and every\n // field below this one would otherwise move by the line's height when it\n // does.\n //\n // Outside one the line is still there, collapsed out of the flow so the\n // field is no taller for it, because it holds the live region below: a\n // region has to be in the document before the error it announces arrives,\n // and one mounted with its text already in it is not read out. A limit to\n // announce rides in it the same way, rather than drawing the line for\n // something nobody can see.\n const collapsed = !invalid && description === undefined && !characterCount && !(insideForm && reserve);\n const value = input?.value ?? textArea?.value ?? '';\n const length = String(value).length;\n const hint = invalid ? undefined : description;\n\n // One slotted description, never two. React Aria hands every element in\n // its description slot the same generated id, so a second one puts a\n // duplicate id in the document and axe fails the story. The limit rides\n // inside the hint where there is one, and carries the whole slot where\n // there is not — hidden either way, since the count already draws it.\n //\n // Hidden by clipping rather than by leaving it out of the row, and the\n // difference is a gap: the row is a flex line with 16dp between its parts,\n // and an element with no width is still a part. Clipping takes it out of\n // flow, so a field with a limit and no hint has the line it had before.\n const described = hint === undefined ? hidden : <Text slot=\"description\" {...stylex.props(fieldChromeStyles.message)}>\n {hint}\n {limit === undefined ? null :\n // The space is load-bearing: a description is read as the text\n // content of one element, and two spans run together without it.\n <VisuallyHidden elementType=\"span\">{` ${limit}`}</VisuallyHidden>}\n </Text>;\n\n // Outside a field that validates there is nothing to hand React Aria's\n // `FieldError`, and it draws nothing without it — a group of chips is a\n // group rather than a form control, so the error it was given is written\n // out instead.\n //\n // Through the group's error slot where there is one, which is what makes\n // the message reach a screen reader at all: React Aria generates the id\n // its `aria-describedby` points at up front, then keeps it only while\n // something in the document carries it, so an element outside the slot is\n // drawn and never announced. The description beside it has always gone\n // through its own slot, which is why that half worked.\n //\n // Not every group has one. `TagGroup` wires up a description and an error;\n // `TokenField` wires up a description alone and generates no error id at\n // all, so the field names the message itself with `errorId` and points its\n // editable area at it — see TokenField.\n const errorSlot = text !== null && typeof text === 'object' && 'slots' in text && text.slots?.errorMessage !== undefined;\n const messageStyles = stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageError);\n const written = errorSlot ? <Text slot=\"errorMessage\" {...messageStyles}>\n {error}\n </Text> : <span id={errorId} {...messageStyles}>\n {error}\n </span>;\n return <div {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageLine, inset && fieldChromeStyles.messageInset, collapsed && fieldChromeStyles.messageLineCollapsed)}>\n {/*\n * The error, read out politely as it appears, since the move into\n * `aria-describedby` that associates it is not: a screen reader does\n * not re-read a description that changes under a control it is on,\n * and after a submit, focus is on the submit button rather than the\n * field. Typing-time, blur-time and a server's errors all arrive this\n * way.\n *\n * The error alone rather than the whole line, so the description\n * coming back once the error clears is not read out, and neither is\n * the limit beside it. Atomic, so a changed message is read whole.\n */}\n <span aria-atomic=\"true\" aria-live=\"polite\" {...stylex.props(fieldChromeStyles.messageRegion)}>\n {validation === null && error !== undefined ? written : <FieldError {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.messageError)}>\n {error}\n </FieldError>}\n </span>\n {described}\n {characterCount ?\n // Hidden from the tree, and the limit above is why. A count is the\n // one piece of supporting text that changes on every keystroke, and\n // a screen reader reading it back at that rate is worse than not\n // hearing it — the limit said once on focus is what a reader needs,\n // and this is the same fact drawn for whoever is looking.\n <span aria-hidden=\"true\" {...stylex.props(fieldChromeStyles.message, fieldChromeStyles.counter, invalid && fieldChromeStyles.messageError)}>\n {countIn(locale, length, maxLength)}\n </span> : null}\n </div>;\n}\n\n/**\n * The same asterisk for a label that is not a field's own — a checkbox's, a\n * switch's — so every required control is marked by one element.\n */\nfunction RequiredMark() {\n return REQUIRED_MARK;\n}\n\n// The count in the reader's digits and grouping, as React Aria writes a\n// number field's value and a meter's percentage beside it — Arabic-Indic\n// under ar-EG, `1 200` under fr-FR, and `1,200` in English. One formatter per\n// locale, for the reason Currency keeps its own: building one is about ten\n// times dearer than reusing it, and the count changes on every keystroke.\nconst counterFormatters = new Map<string, Intl.NumberFormat>();\nfunction countIn(locale: string, length: number, maxLength: number | undefined) {\n let formatter = counterFormatters.get(locale);\n if (formatter === undefined) {\n formatter = new Intl.NumberFormat(locale);\n counterFormatters.set(locale, formatter);\n }\n return maxLength === undefined ? formatter.format(length) : `${formatter.format(length)}/${formatter.format(maxLength)}`;\n}\nexport type { FieldBoxProps, FieldInputProps, FieldLabelProps, FieldLabelState, FieldLabelVariant, FieldMessageProps, FieldTextAreaProps, FieldVariant };\nexport { FieldBox, FieldInput, FieldLabel, FieldMessage, FieldSegments, FieldTextArea, FieldTrigger, FieldValue, RequiredMark };"],"mappings":";;;;;;;;;;;;AAkPA,MAAMqF,cAA0B;CAC9B5C,OAAO;CACPE,YAAY;AACd;AACA,MAAM2C,eAAe;CACnBC,QAAQ;EACNC,OAAO;GACL/C,OAAO;GACPE,YAAY;EACd;EACA8C,UAAU;GACRhD,OAAO;GACPE,YAAY;EACd;CACF;CACA+C,UAAU;EACRF,OAAO;GACL/C,OAAO;GACPE,YAAY;EACd;EACA8C,UAAU;GACRhD,OAAO;GACPE,YAAY;EACd;CACF;AACF;AACA,MAAMiD,aAAa9E,cAA0BuE,WAAW;AAKxD,SAASQ,WAAWpD,OAAeK,UAAqBC,UAAkBC,eAAwBC,WAAoBC,aAAkCC,YAAqBC,S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A,QAAA2E,OAAA3E,EAAA,QAAA4E,OAAA5E,EAAA,QAAA2C,IAAA;EA3BbkC,MAAA,qBAAA,OAAA;GA4BC,GA5BQlC;GAAT,UAAA;IAaHgC;IAKC8D;IACA7D;GASG;;EAAA5E,EAAA,MAAAyI;EAAAzI,EAAA,MAAA2E;EAAA3E,EAAA,MAAA4E;EAAA5E,EAAA,MAAA2C;EAAA3C,EAAA,MAAA6E;CAAA,OAAAA,MAAA7E,EAAA;CAAA,OA5BD6E;AA4BC;;;;;AAOV,SAASyE,eAAe;CACtB,OAAOjI;AACT;AAOA,MAAMkI,oCAAoB,IAAIC,IAA+B;AAC7D,SAASH,QAAQrB,QAAgBP,QAAgB5I,WAA+B;CAC9E,IAAI8K,YAAYJ,kBAAkBK,IAAI5B,MAAM;CAC5C,IAAI2B,cAAc/I,KAAAA,GAAW;EAC3B+I,YAAY,IAAIF,KAAKC,aAAa1B,MAAM;EACxCuB,kBAAkBM,IAAI7B,QAAQ2B,SAAS;CACzC;CACA,OAAO9K,cAAc+B,KAAAA,IAAY+I,UAAUG,OAAOrC,MAAM,IAAI,GAAGkC,UAAUG,OAAOrC,MAAM,EAAC,GAAIkC,UAAUG,OAAOjL,SAAS;AACvH"}
@@ -0,0 +1,27 @@
1
+ //#region src/field/press.ts
2
+ const PRESSABLE = "a, button, input, textarea, select, [role=\"button\"], [contenteditable=\"true\"]";
3
+ const CONTROL = "input:not([type=\"hidden\"]), textarea, [contenteditable=\"true\"]";
4
+ /**
5
+ * The box's press handler: a press anywhere on the box focuses the control
6
+ * in it, as the whole of a native text field's box does. The box is 56dp
7
+ * and the control's line 24dp of it, so the padding above and below the
8
+ * line, the padding at either end and the icons were dead to a press —
9
+ * nothing took focus, and nothing said why. Built by a call rather than
10
+ * written at the prop, which is what react-perf's no-new-function-as-prop is
11
+ * after; the React Compiler memoises it on the call site's own handler,
12
+ * which runs first.
13
+ */
14
+ function focusesControl(onPointerDown) {
15
+ return (event) => {
16
+ onPointerDown?.(event);
17
+ if (event.defaultPrevented || event.button !== 0 || !(event.target instanceof Element) || event.target.closest(PRESSABLE) !== null) return;
18
+ const control = event.currentTarget.querySelector(CONTROL);
19
+ if (control === null || control.matches(":disabled")) return;
20
+ event.preventDefault();
21
+ control.focus();
22
+ };
23
+ }
24
+ //#endregion
25
+ export { focusesControl };
26
+
27
+ //# sourceMappingURL=press.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"press.js","names":["PointerEvent","PRESSABLE","CONTROL","focusesControl","onPointerDown","event","HTMLDivElement","defaultPrevented","button","target","Element","closest","control","currentTarget","querySelector","HTMLElement","matches","preventDefault","focus"],"sources":["../../src/field/press.ts"],"sourcesContent":["import type { PointerEvent } from 'react'\n\n// A field's press handler, apart from ./index.tsx so that file exports\n// components alone, which is what keeps fast refresh working for it. The\n// box every field draws takes it, and so does the search page's bar, which\n// is drawn apart from that box.\n\n// What a press inside a box leaves to the element it lands on: anything that\n// acts on a press of its own, and the control itself, where the browser\n// places the caret.\nconst PRESSABLE =\n 'a, button, input, textarea, select, [role=\"button\"], [contenteditable=\"true\"]'\n\n// What a press on the box focuses: the field's text control, or the first\n// editable element where the control is not an input — a token field's\n// editable area, a date field's first segment. Never the hidden input a\n// segmented field carries its value to a form in.\nconst CONTROL = 'input:not([type=\"hidden\"]), textarea, [contenteditable=\"true\"]'\n\n/**\n * The box's press handler: a press anywhere on the box focuses the control\n * in it, as the whole of a native text field's box does. The box is 56dp\n * and the control's line 24dp of it, so the padding above and below the\n * line, the padding at either end and the icons were dead to a press —\n * nothing took focus, and nothing said why. Built by a call rather than\n * written at the prop, which is what react-perf's no-new-function-as-prop is\n * after; the React Compiler memoises it on the call site's own handler,\n * which runs first.\n */\nfunction focusesControl(\n onPointerDown: ((event: PointerEvent<HTMLDivElement>) => void) | undefined,\n) {\n return (event: PointerEvent<HTMLDivElement>) => {\n onPointerDown?.(event)\n if (\n event.defaultPrevented ||\n event.button !== 0 ||\n !(event.target instanceof Element) ||\n event.target.closest(PRESSABLE) !== null\n ) {\n return\n }\n const control = event.currentTarget.querySelector<HTMLElement>(CONTROL)\n if (control === null || control.matches(':disabled')) {\n return\n }\n // Held, so the press does not move focus to the page on its way down\n // and away from the control the line below hands it to.\n event.preventDefault()\n control.focus()\n }\n}\n\nexport { focusesControl }\n"],"mappings":";AAUA,MAAMC,YACJ;AAMF,MAAMC,UAAU;;;;;;;;;;;AAYhB,SAASC,eACPC,eACA;CACA,QAAQC,UAAwC;EAC9CD,gBAAgBC,KAAK;EACrB,IACEA,MAAME,oBACNF,MAAMG,WAAW,KACjB,EAAEH,MAAMI,kBAAkBC,YAC1BL,MAAMI,OAAOE,QAAQV,SAAS,MAAM,MAEpC;EAEF,MAAMW,UAAUP,MAAMQ,cAAcC,cAA2BZ,OAAO;EACtE,IAAIU,YAAY,QAAQA,QAAQI,QAAQ,WAAW,GACjD;EAIFX,MAAMY,eAAe;EACrBL,QAAQM,MAAM;CAChB;AACF"}