@kanso-labs/react-native-kanso-ui 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/autocomplete/index.js +15 -1
- package/dist/autocomplete/index.js.map +1 -1
- package/dist/button/group.d.ts +5 -0
- package/dist/button/group.js +115 -0
- package/dist/button/group.js.map +1 -0
- package/dist/button/index.d.ts +4 -1
- package/dist/button/index.js +44 -22
- package/dist/button/index.js.map +1 -1
- package/dist/button/slots.js +2 -1
- package/dist/button/slots.js.map +1 -1
- package/dist/calendar/index.js +351 -182
- package/dist/calendar/index.js.map +1 -1
- package/dist/calendar/styles.js +33 -2
- package/dist/calendar/styles.js.map +1 -1
- package/dist/carousel/arrangement.d.ts +5 -0
- package/dist/carousel/arrangement.js +123 -0
- package/dist/carousel/arrangement.js.map +1 -0
- package/dist/chequer/index.js +95 -0
- package/dist/chequer/index.js.map +1 -0
- package/dist/collection/index.d.ts +157 -0
- package/dist/collection/index.js +1331 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/color-thumb/index.js +56 -0
- package/dist/color-thumb/index.js.map +1 -0
- package/dist/components/button/index.d.ts +4 -2
- package/dist/components/button/index.js +227 -188
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button-group/index.d.ts +87 -0
- package/dist/components/button-group/index.js +275 -0
- package/dist/components/button-group/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +11 -3
- package/dist/components/calendar/index.js +60 -45
- package/dist/components/calendar/index.js.map +1 -1
- package/dist/components/carousel/index.d.ts +72 -0
- package/dist/components/carousel/index.js +496 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/checkbox-group/index.d.ts +3 -4
- package/dist/components/checkbox-group/index.js +1 -1
- package/dist/components/checkbox-group/index.js.map +1 -1
- package/dist/components/color-area/index.d.ts +85 -0
- package/dist/components/color-area/index.js +630 -0
- package/dist/components/color-area/index.js.map +1 -0
- package/dist/components/color-field/index.d.ts +144 -0
- package/dist/components/color-field/index.js +516 -0
- package/dist/components/color-field/index.js.map +1 -0
- package/dist/components/color-picker/index.d.ts +74 -0
- package/dist/components/color-picker/index.js +317 -0
- package/dist/components/color-picker/index.js.map +1 -0
- package/dist/components/color-slider/index.d.ts +82 -0
- package/dist/components/color-slider/index.js +456 -0
- package/dist/components/color-slider/index.js.map +1 -0
- package/dist/components/color-swatch/index.d.ts +46 -0
- package/dist/components/color-swatch/index.js +127 -0
- package/dist/components/color-swatch/index.js.map +1 -0
- package/dist/components/color-swatch-picker/index.d.ts +81 -0
- package/dist/components/color-swatch-picker/index.js +287 -0
- package/dist/components/color-swatch-picker/index.js.map +1 -0
- package/dist/components/color-wheel/index.d.ts +71 -0
- package/dist/components/color-wheel/index.js +407 -0
- package/dist/components/color-wheel/index.js.map +1 -0
- package/dist/components/combo-box/index.d.ts +193 -0
- package/dist/components/combo-box/index.js +616 -0
- package/dist/components/combo-box/index.js.map +1 -0
- package/dist/components/date-field/index.d.ts +120 -0
- package/dist/components/date-field/index.js +111 -0
- package/dist/components/date-field/index.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +130 -0
- package/dist/components/date-picker/index.js +310 -0
- package/dist/components/date-picker/index.js.map +1 -0
- package/dist/components/date-range-picker/index.d.ts +139 -0
- package/dist/components/date-range-picker/index.js +421 -0
- package/dist/components/date-range-picker/index.js.map +1 -0
- package/dist/components/disclosure/index.d.ts +94 -0
- package/dist/components/disclosure/index.js +365 -0
- package/dist/components/disclosure/index.js.map +1 -0
- package/dist/components/disclosure-group/index.d.ts +61 -0
- package/dist/components/disclosure-group/index.js +100 -0
- package/dist/components/disclosure-group/index.js.map +1 -0
- package/dist/components/drop-zone/index.d.ts +113 -0
- package/dist/components/drop-zone/index.js +304 -0
- package/dist/components/drop-zone/index.js.map +1 -0
- package/dist/components/fab/index.d.ts +1 -1
- package/dist/components/fab/index.js +91 -76
- package/dist/components/fab/index.js.map +1 -1
- package/dist/components/form/index.d.ts +3 -2
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +4 -2
- package/dist/components/icon-button/index.js +204 -171
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/list/index.d.ts +15 -158
- package/dist/components/list/index.js +21 -1047
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list-box/index.d.ts +73 -0
- package/dist/components/list-box/index.js +82 -0
- package/dist/components/list-box/index.js.map +1 -0
- package/dist/components/loading-indicator/index.d.ts +32 -0
- package/dist/components/loading-indicator/index.js +174 -0
- package/dist/components/loading-indicator/index.js.map +1 -0
- package/dist/components/navigation-tree/index.d.ts +117 -0
- package/dist/components/navigation-tree/index.js +135 -0
- package/dist/components/navigation-tree/index.js.map +1 -0
- package/dist/components/number-field/index.js +132 -143
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/range-calendar/index.d.ts +69 -0
- package/dist/components/range-calendar/index.js +144 -0
- package/dist/components/range-calendar/index.js.map +1 -0
- package/dist/components/search-view/index.d.ts +78 -0
- package/dist/components/search-view/index.js +570 -0
- package/dist/components/search-view/index.js.map +1 -0
- package/dist/components/select/index.d.ts +152 -0
- package/dist/components/select/index.js +419 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/slider/index.d.ts +111 -0
- package/dist/components/slider/index.js +673 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/split-button/index.d.ts +77 -0
- package/dist/components/split-button/index.js +354 -0
- package/dist/components/split-button/index.js.map +1 -0
- package/dist/components/tabs/index.d.ts +196 -0
- package/dist/components/tabs/index.js +1137 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/time-field/index.d.ts +43 -0
- package/dist/components/time-field/index.js +107 -0
- package/dist/components/time-field/index.js.map +1 -0
- package/dist/components/time-picker/index.d.ts +65 -0
- package/dist/components/time-picker/index.js +1168 -0
- package/dist/components/time-picker/index.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +101 -0
- package/dist/components/tooltip/index.js +223 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/components/tree/index.d.ts +112 -0
- package/dist/components/tree/index.js +157 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/disclosure/chevron.js +75 -0
- package/dist/disclosure/chevron.js.map +1 -0
- package/dist/disclosure/index.js +7 -0
- package/dist/disclosure/index.js.map +1 -0
- package/dist/drop/index.d.ts +54 -0
- package/dist/drop/index.js +161 -0
- package/dist/drop/index.js.map +1 -0
- package/dist/field/chevron.js +74 -0
- package/dist/field/chevron.js.map +1 -0
- package/dist/field/index.d.ts +2 -1
- package/dist/field/index.js +310 -154
- package/dist/field/index.js.map +1 -1
- package/dist/field/styles.js +9 -0
- package/dist/field/styles.js.map +1 -1
- package/dist/files/index.d.ts +18 -0
- package/dist/files/index.js +107 -0
- package/dist/files/index.js.map +1 -0
- package/dist/form/index.d.ts +5 -2
- package/dist/form/index.js +64 -85
- package/dist/form/index.js.map +1 -1
- package/dist/glyphs/index.js +92 -1
- package/dist/glyphs/index.js.map +1 -1
- package/dist/i18n/index.js +20 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/i18n/messages.js +1394 -34
- package/dist/i18n/messages.js.map +1 -1
- package/dist/index.d.ts +35 -3
- package/dist/index.js +34 -3
- package/dist/indicator/paths.js +23 -1
- package/dist/indicator/paths.js.map +1 -1
- package/dist/modal/index.js +92 -77
- package/dist/modal/index.js.map +1 -1
- package/dist/number/keyboard.js +16 -0
- package/dist/number/keyboard.js.map +1 -0
- package/dist/overlay/anchored.js +68 -38
- package/dist/overlay/anchored.js.map +1 -1
- package/dist/overlay/keyboard.js +57 -0
- package/dist/overlay/keyboard.js.map +1 -0
- package/dist/overlay/panel.js +173 -19
- package/dist/overlay/panel.js.map +1 -1
- package/dist/overlay/placement.js +13 -1
- package/dist/overlay/placement.js.map +1 -1
- package/dist/picker/index.js +322 -0
- package/dist/picker/index.js.map +1 -0
- package/dist/press/index.d.ts +2 -0
- package/dist/press/index.js +102 -100
- package/dist/press/index.js.map +1 -1
- package/dist/row/index.js +77 -69
- package/dist/row/index.js.map +1 -1
- package/dist/row/styles.js +13 -2
- package/dist/row/styles.js.map +1 -1
- package/dist/segments/field.js +277 -0
- package/dist/segments/field.js.map +1 -0
- package/dist/segments/index.js +574 -0
- package/dist/segments/index.js.map +1 -0
- package/dist/segments/styles.js +24 -0
- package/dist/segments/styles.js.map +1 -0
- package/dist/slider/index.js +145 -0
- package/dist/slider/index.js.map +1 -0
- package/dist/swatch/index.js +56 -0
- package/dist/swatch/index.js.map +1 -0
- package/package.json +11 -2
package/dist/field/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","RefObject","LayoutChangeEvent","StyleProp","TextInputProps","TextStyle","ViewProps","ViewStyle","AnimatedStyle","DerivedValue","createContext","use","useEffect","useId","useMemo","useRef","useState","AccessibilityInfo","Text","NativeText","Platform","Pressable","TextInput","useWindowDimensions","View","Animated","Easing","useAnimatedStyle","useDerivedValue","useReducedMotion","withTiming","IconStyle","ResolvedTheme","useInsideForm","IconStyleContext","limitFor","useLocaleOf","formatCount","usePressFeedback","withOpacity","useTheme","composeStyles","useFontFamily","useTypeRole","fieldStylesOf","BoxControl","disabled","floated","invalid","label","required","underLabel","DescribedBy","Pick","FieldBoxProps","children","control","end","floatingLabel","isDisabled","isFocused","isInvalid","isPopulated","isRequired","leading","trailing","variant","FieldVariant","FieldDescriptionPart","id","text","FieldInputProps","Omit","autosize","described","multiline","numeric","prefix","ref","rows","suffix","FieldMessageProps","characterCount","characterLimitLabel","description","error","length","maxLength","FieldState","focused","hovered","FieldStatesProps","FieldStrokeProps","StrokeMotion","sides","style","LabelPlace","fontSize","letterSpacing","lineHeight","top","color","width","WebState","ICON_SIZE","OUTSIDE_BOX","BoxContext","NO_PARTS","describedBy","locale","ids","idsOf","message","undefined","limit","limitOf","FieldBox","t0","$","_c","t1","t2","t3","t4","t5","t6","t7","theme","styles","fontScale","notch","setNotch","colors","radii","spacing","stateLayerOpacity","typography","t8","xs","borderTopEndRadius","borderTopStartRadius","t9","onSurface","corners","disableRipple","feedback","outlined","t10","state","rule","useRuleMotion","t11","t12","boxControlOf","boxControl","t13","disabledContent","T0","t14","t15","t16","handlers","onHoverIn","t17","onHoverOut","t18","focusOf","t19","box","boxLeading","boxTrailing","boxOutlined","boxDisabled","minHeightOf","lg","bodyLargeLineHeight","sm","bodySmallLineHeight","t20","outline","outlineStart","widthOf","outlineInset","outlineStartBox","outlineNotch","outlineNotchBox","outlineEnd","minWidthOf","outlineEndBox","layer","indicator","t21","onSurfaceVariant","icon","iconStyleOf","t22","t23","t24","t25","column","t26","t27","FieldInput","props","role","mono","fontFamilyMono","content","caret","primary","muted","affixed","clearance","marginTopOf","affixStyle","colorOf","lines","copied","OS","extent","heightOf","descriptionOf","affixPart","webStateOf","INHERITS_DIRECTION","input","numericOf","inputMultiline","inputOverCopy","copy","value","affixLine","FieldMessage","insideForm","collapsed","messageStyle","SHRINKS","useErrorAnnouncement","messageLine","messageLineCollapsed","OUT_OF_FLOW","ATOMIC","HIDDEN","NOT_DRAWN","counter","countOf","FieldStates","states","useFieldFocus","onBlur","onFocus","setFocused","event","event_0","const","dir","display","position","flexShrink","Affix","motion","reduceMotion","opacity","timing","duration","durationShort3","easing","bezier","easingStandard","fade","affix","String","BoxLabel","large","small","smallRole","place","bodyLargeSize","bodyLargeTracking","motionStyle","labelOutlined","labelTextOutlined","REQUIRED_MARK","parts","map","part","join","said","filter","accessibilityHint","current","focus","height","size","marginTop","minHeight","minWidth","NotchMeasure","onMeasure","notchMeasure","T1","widthTo","fontFamily","fontVariant","md","FieldStroke","stroke","borderColor","get","borderWidth","borderTopWidth","announceForAccessibility","onErrorContainer","disabledContainer","useStrokeMotion","durationShort2","nativeEvent","layout","_c","state","NativeText","color"],"sources":["../../src/field/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref, RefObject } from 'react'\nimport type {\n LayoutChangeEvent,\n StyleProp,\n TextInputProps,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle, DerivedValue } from 'react-native-reanimated'\n\nimport {\n createContext,\n use,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport {\n AccessibilityInfo,\n Text as NativeText,\n Platform,\n Pressable,\n TextInput,\n useWindowDimensions,\n View,\n} from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useDerivedValue,\n useReducedMotion,\n withTiming,\n} from 'react-native-reanimated'\n\nimport type { IconStyle } from '../glyphs/icon-style'\nimport type { ResolvedTheme } from '../theme/scope'\n\nimport { useInsideForm } from '../form'\nimport { IconStyleContext } from '../glyphs/icon-style'\nimport { limitFor } from '../i18n'\nimport { useLocaleOf } from '../i18n/provider'\nimport { formatCount } from '../number/count'\nimport { usePressFeedback } from '../press'\nimport { withOpacity } from '../theme/color'\nimport { useTheme } from '../theme/scope'\nimport { composeStyles } from '../theme/styles'\nimport { useFontFamily } from '../typography/fonts'\nimport { useTypeRole } from '../typography/roles'\nimport { fieldStylesOf } from './styles'\n\n// The chrome every field shares, as on web: the box with its label, the\n// control inside it, and the line of supporting text under it. Each field is\n// the parts it renders inside a root of its own, and these are not exported\n// from the package.\n//\n// The text fields page draws two boxes. The filled one carries surface\n// container highest with an active indicator along its bottom, 1dp in the\n// outline role at rest and 2dp in primary while focused, and its label floats\n// within it. The outlined one has no fill and a 1dp outline all round that\n// thickens the same way, and its label floats up onto the outline, cutting a\n// notch in it.\n//\n// **The label floats by changing its type and its place**, eased by\n// Reanimated over `durationShort3` on the standard curve, as web transitions\n// them: body large on the value's line while the field is empty and\n// unfocused, body small at the top once it is focused or holds a value.\n// `floatingLabel={false}` keeps it small at the top in label medium, as web's\n// fixed label is. Under reduced motion it moves at once.\n//\n// **The box grows with the device's text size.** Its height is a floor rather\n// than a height, the padding above and below plus the lines it holds, and the\n// lines are the type tokens' line heights at the device's font scale, which\n// is what React Native draws the text at. So the 56dp the page gives is the\n// floor at the default text size, and a larger one makes the box taller\n// rather than running the value out of it.\n//\n// **The outline is drawn from views**, since there is no fieldset to cut it:\n// three pieces in a row, the stretch before the label, the notch under it,\n// which draws only the bottom of the outline, and the stretch after it. The\n// notch is the label's width in its floated type, measured from a copy of it\n// out of sight, as web's legend holds one. Before the label floats it is\n// closed, and the two stretches meet.\n//\n// **A pointer over the filled box draws the state layer**, the one every\n// control draws through `usePressFeedback`, on surface at the hover opacity,\n// and turns the indicator on surface, as the page's hovered state does; one\n// over the outlined box turns the outline on surface. Web's filled box draws\n// neither. Focus wins over hover, and an error takes the\n// error role, or on error container under a pointer.\n//\n// **Disabled is the page's colour at an opacity, translucent**: the filled\n// container and the rule are on surface at the `disabledContainer` opacity,\n// and the label, the value and the icons on surface at `disabledContent`,\n// over whatever the field sits on rather than mixed over the surface role as\n// web's are.\n\n// What a control needs to know about the box around it: how the label is\n// drawn, whether the control clears it, and the states it takes its colours\n// from.\ntype BoxControl = {\n readonly disabled: boolean\n readonly floated: boolean\n readonly invalid: boolean\n readonly label: 'fixed' | 'floating' | 'none'\n readonly required: boolean\n readonly underLabel: boolean\n}\n\ntype DescribedBy = Pick<ViewProps, 'accessibilityHint'> & {\n readonly 'aria-describedby'?: string\n}\n\ntype FieldBoxProps = {\n readonly children?: ReactNode\n /**\n * The control the box focuses when it is pressed anywhere, as the whole\n * of a native text field's box takes a press.\n */\n readonly control: RefObject<ComponentRef<typeof TextInput> | null>\n /**\n * What the box holds after the label and the control's column, drawn as\n * it is rather than in an icon's slot, for a part laid out against the\n * box's own edges: a number field's steppers. The column, and the label\n * in it, end where this starts, 16dp before it.\n */\n readonly end?: ReactNode\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. `false` keeps it small at the top.\n * @default true\n */\n readonly floatingLabel?: boolean\n /** @default false */\n readonly isDisabled?: boolean\n /** Whether the control has focus, which the box draws. */\n readonly isFocused?: boolean\n /** @default false */\n readonly isInvalid?: boolean\n /** Whether the control holds anything, which floats the label. */\n readonly isPopulated?: boolean\n /**\n * Marks the label with an asterisk, as the text fields page marks a field\n * that must be filled.\n * @default false\n */\n readonly isRequired?: boolean\n /** What the field is for. */\n readonly label: string\n /** An icon at the start of the box, before the label and the control. */\n readonly leading?: ReactNode\n /** An icon at the end of the box, after the control. */\n readonly trailing?: ReactNode\n /** @default 'filled' */\n readonly variant?: FieldVariant\n}\n\n/**\n * One piece of what describes a field's control: the text a screen reader\n * hears on iOS and Android, and the id of the element showing it, which the\n * control points at under React Native Web.\n */\ntype FieldDescriptionPart = {\n readonly id: string\n readonly text: string\n}\n\ntype FieldInputProps = Omit<\n TextInputProps,\n | 'accessibilityHint'\n | 'cursorColor'\n | 'multiline'\n | 'numberOfLines'\n | 'placeholderTextColor'\n | 'rows'\n | 'selectionColor'\n | 'style'\n | 'underlineColorAndroid'\n> & {\n /**\n * Whether a multi-line control grows with the text it holds, from `rows`\n * up. `false` holds it at `rows` and scrolls the text inside.\n * @default true\n */\n readonly autosize?: boolean\n /** What describes the control, after its prefix and suffix. */\n readonly described?: readonly FieldDescriptionPart[]\n /**\n * Whether the control holds several lines rather than one, the return key\n * starting a new one.\n * @default false\n */\n readonly multiline?: boolean\n /**\n * The value in the mono face with tabular figures.\n * @default false\n */\n readonly numeric?: boolean\n /** Text before the value on its line. */\n readonly prefix?: ReactNode\n readonly ref?: Ref<ComponentRef<typeof TextInput>>\n /**\n * How many lines a multi-line control shows: the least it shows while it\n * grows, or all it shows when it does not.\n * @default 1\n */\n readonly rows?: number\n /** Text after the value on its line. */\n readonly suffix?: ReactNode\n}\n\ntype FieldMessageProps = {\n /**\n * Counts the characters, against `maxLength` where there is one.\n * @default false\n */\n readonly characterCount?: boolean\n /** How the limit is said to a screen reader. */\n readonly characterLimitLabel?: string | undefined\n /** The hint, which the error replaces while there is one. */\n readonly description?: string | undefined\n /** The problem with the value, in words. */\n readonly error?: string | undefined\n /** The field's id, as handed to {@link describedBy}. */\n readonly id: string\n /** How many characters the control holds. */\n readonly length?: number\n readonly maxLength?: number | undefined\n}\n\ntype FieldState = {\n readonly disabled: boolean\n readonly focused: boolean\n readonly hovered: boolean\n readonly invalid: boolean\n}\n\ntype FieldStatesProps = {\n readonly children?: ReactNode\n /** @default false */\n readonly isDisabled?: boolean\n /** @default false */\n readonly isInvalid?: boolean\n /** @default false */\n readonly isRequired?: boolean\n}\n\ntype FieldStrokeProps = StrokeMotion & {\n /** Every side of the view, or the top alone. */\n readonly sides: 'all' | 'top'\n readonly style: StyleProp<ViewStyle>\n}\n\n/**\n * The filled box, or the outlined one: no fill, an outline that thickens and\n * takes the primary role while focused, and the label cutting it once it\n * floats, the text fields page's two fields.\n */\ntype FieldVariant = 'filled' | 'outlined'\n\n// Where the label is and what type it is in, at rest or floated.\ntype LabelPlace = {\n readonly fontSize: number\n readonly letterSpacing: number\n readonly lineHeight: number\n readonly top: number\n}\n\n// The control's state as React Native Web hands it to a browser, which reads\n// `aria-invalid` and `aria-required` off the input. React Native has neither.\n// A rule's colour and width as they ease.\ntype StrokeMotion = {\n readonly color: DerivedValue<string>\n readonly width: DerivedValue<number>\n}\n\ntype WebState = {\n readonly 'aria-invalid'?: true\n readonly 'aria-required'?: true\n}\n\n// The page's icon, which the box's outline is laid out around.\nconst ICON_SIZE = 24\n\n// A control outside any box has no label over it.\nconst OUTSIDE_BOX: BoxControl = {\n disabled: false,\n floated: true,\n invalid: false,\n label: 'none',\n required: false,\n underLabel: false,\n}\n\nconst BoxContext = createContext<BoxControl>(OUTSIDE_BOX)\n\nconst NO_PARTS: readonly FieldDescriptionPart[] = []\n\n/**\n * How a field's control is described by the line under it: the error while\n * there is one, otherwise the description, then the limit where there is a\n * `maxLength`. Hand the result to {@link FieldInput} as `described`, and the\n * same `id` to {@link FieldMessage}.\n */\nfunction describedBy(\n id: string,\n {\n characterLimitLabel,\n description,\n error,\n locale,\n maxLength,\n }: Pick<\n FieldMessageProps,\n 'characterLimitLabel' | 'description' | 'error' | 'maxLength'\n > & {\n /**\n * The locale the limit is said in, the field's `useLocaleOf`, or the\n * device's when left out.\n */\n readonly locale?: string\n },\n): readonly FieldDescriptionPart[] {\n const ids = idsOf(id)\n const message =\n error === undefined\n ? { id: ids.description, text: description ?? '' }\n : { id: ids.error, text: error }\n const limit = limitOf(maxLength, characterLimitLabel, locale)\n\n return [\n ...(message.text === '' ? [] : [message]),\n ...(limit === undefined ? [] : [{ id: ids.limit, text: limit }]),\n ]\n}\n\n/**\n * The box a control sits in, filled or outlined, with its label. Pressed\n * anywhere, it focuses its control. The states it draws are handed to it,\n * since the field around it is what knows them.\n */\nfunction FieldBox({\n children,\n control,\n end,\n floatingLabel = true,\n isDisabled = false,\n isFocused = false,\n isInvalid = false,\n isPopulated = false,\n isRequired = false,\n label,\n leading,\n trailing,\n variant = 'filled',\n}: FieldBoxProps) {\n const theme = useTheme()\n const styles = fieldStylesOf(theme)\n const { fontScale } = useWindowDimensions()\n const [notch, setNotch] = useState(0)\n const { colors, radii, spacing, stateLayerOpacity, typography } = theme\n // The hover layer alone: a text field's box takes no pressed or focus\n // layer, since the indicator and the label are what mark its focus.\n const feedback = usePressFeedback({\n color: colors.onSurface,\n corners: {\n borderTopEndRadius: radii.xs,\n borderTopStartRadius: radii.xs,\n },\n disabled: isDisabled,\n disableRipple: true,\n })\n const outlined = variant === 'outlined'\n const floated = !floatingLabel || isFocused || isPopulated\n const state: FieldState = {\n disabled: isDisabled,\n focused: isFocused,\n hovered: feedback.hovered,\n invalid: isInvalid,\n }\n const rule = useRuleMotion(theme, state)\n const boxControl = useMemo(\n () =>\n boxControlOf(\n floatingLabel,\n floated,\n isDisabled,\n isInvalid,\n isRequired,\n !outlined,\n ),\n [floatingLabel, floated, isDisabled, isInvalid, isRequired, outlined],\n )\n const disabledContent = withOpacity(\n colors.onSurface,\n stateLayerOpacity.disabledContent,\n )\n\n return (\n <Pressable\n accessible={false}\n disabled={isDisabled}\n focusable={false}\n onHoverIn={feedback.handlers.onHoverIn}\n onHoverOut={feedback.handlers.onHoverOut}\n onPress={focusOf(control)}\n style={composeStyles<ViewStyle>(\n styles.box,\n leading === undefined ? undefined : styles.boxLeading,\n trailing === undefined ? undefined : styles.boxTrailing,\n outlined ? styles.boxOutlined : undefined,\n isDisabled && !outlined ? styles.boxDisabled : undefined,\n minHeightOf(\n outlined\n ? 2 * spacing.lg + typography.bodyLargeLineHeight * fontScale\n : 2 * spacing.sm +\n (typography.bodySmallLineHeight +\n typography.bodyLargeLineHeight) *\n fontScale,\n ),\n )}\n >\n {outlined ? (\n <View aria-hidden style={styles.outline}>\n <View\n style={composeStyles<ViewStyle>(\n styles.outlineStart,\n widthOf(outlineInset(spacing, leading)),\n )}\n >\n <FieldStroke\n color={rule.color}\n sides=\"all\"\n style={styles.outlineStartBox}\n width={rule.width}\n />\n </View>\n <View\n style={composeStyles<ViewStyle>(\n styles.outlineNotch,\n widthOf(floated ? notch : 0),\n )}\n >\n <FieldStroke\n color={rule.color}\n sides=\"all\"\n style={styles.outlineNotchBox}\n width={rule.width}\n />\n </View>\n <View\n style={composeStyles<ViewStyle>(\n styles.outlineEnd,\n minWidthOf(outlineInset(spacing, trailing)),\n )}\n >\n <FieldStroke\n color={rule.color}\n sides=\"all\"\n style={styles.outlineEndBox}\n width={rule.width}\n />\n </View>\n </View>\n ) : (\n <>\n {feedback.layer}\n <FieldStroke\n color={rule.color}\n sides=\"top\"\n style={styles.indicator}\n width={rule.width}\n />\n </>\n )}\n {leading === undefined ? null : (\n <View style={styles.icon}>\n <IconStyleContext\n value={iconStyleOf(\n isDisabled ? disabledContent : colors.onSurfaceVariant,\n )}\n >\n {leading}\n </IconStyleContext>\n </View>\n )}\n <View style={styles.column}>\n <BoxLabel\n floated={floated}\n floatingLabel={floatingLabel}\n isDisabled={isDisabled}\n isFocused={isFocused}\n isInvalid={isInvalid}\n isRequired={isRequired}\n variant={variant}\n >\n {label}\n </BoxLabel>\n {outlined ? (\n <NotchMeasure\n floatingLabel={floatingLabel}\n isRequired={isRequired}\n onMeasure={setNotch}\n >\n {label}\n </NotchMeasure>\n ) : null}\n <BoxContext value={boxControl}>{children}</BoxContext>\n </View>\n {end}\n {trailing === undefined ? null : (\n <View style={styles.icon}>\n <IconStyleContext\n value={iconStyleOf(\n isDisabled\n ? disabledContent\n : isInvalid\n ? colors.error\n : colors.onSurfaceVariant,\n )}\n >\n {trailing}\n </IconStyleContext>\n </View>\n )}\n </Pressable>\n )\n}\n\n/**\n * A field's text control, in a {@link FieldBox}, or in {@link FieldStates}\n * inside a container of a field's own. In a box it clears the label at the\n * top where the box is filled, and shows a prefix and a suffix only while the\n * label has floated, since at rest the label sits on their line. It takes the\n * error role for its caret while the field has an error, and draws a\n * placeholder in the muted role.\n *\n * It is described by its prefix and suffix, ahead of what the field hands it\n * in `described`, so a reader hears the unit the value is read against as a\n * sighted one sees it beside the value: on iOS and Android as its hint, and\n * under React Native Web through `aria-describedby`, which drops the hint.\n *\n * `multiline` makes it a text area, `rows` lines of body large tall at the\n * least, its text from the top. iOS and Android grow a multi-line input with\n * what it holds by themselves, so a height floor is all `autosize` asks of\n * them, and `autosize={false}` sets the height instead, which they scroll\n * inside. React Native Web's textarea keeps the height it is given, so there\n * the control lies over a hidden copy of `value` that takes the height the\n * text would, as web's text area lies over its replica. A control that grows\n * is therefore handed its `value`.\n */\nfunction FieldInput({\n autosize = true,\n described = NO_PARTS,\n multiline = false,\n numeric = false,\n prefix,\n rows = 1,\n suffix,\n ...props\n}: FieldInputProps) {\n const box = use(BoxContext)\n const theme = useTheme()\n const styles = fieldStylesOf(theme)\n const { fontScale } = useWindowDimensions()\n const role = useTypeRole('bodyLarge')\n const mono = useFontFamily(theme.typography.fontFamilyMono)\n const id = useId()\n const { colors, stateLayerOpacity, typography } = theme\n const content = box.disabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n : colors.onSurface\n const caret = box.invalid ? colors.error : colors.primary\n const muted = box.disabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n : colors.onSurfaceVariant\n const affixed = prefix !== undefined || suffix !== undefined\n const clearance = box.underLabel\n ? marginTopOf(typography.bodySmallLineHeight * fontScale)\n : undefined\n const affixStyle = composeStyles<TextStyle>(role, colorOf(muted))\n const lines =\n typography.bodyLargeLineHeight * fontScale * (multiline ? rows : 1)\n const copied = multiline && autosize && Platform.OS === 'web'\n const extent = multiline && !autosize ? heightOf(lines) : minHeightOf(lines)\n\n const control = (\n <TextInput\n {...(Platform.OS === 'web' ? INHERITS_DIRECTION : undefined)}\n {...props}\n {...descriptionOf([\n ...affixPart(`${id}-prefix`, prefix),\n ...affixPart(`${id}-suffix`, suffix),\n ...described,\n ])}\n {...webStateOf(box)}\n aria-disabled={box.disabled}\n cursorColor={caret}\n multiline={multiline}\n placeholderTextColor={muted}\n selectionColor={caret}\n style={composeStyles<TextStyle>(\n role,\n styles.input,\n colorOf(content),\n numeric ? numericOf(mono) : undefined,\n multiline ? styles.inputMultiline : undefined,\n copied ? styles.inputOverCopy : extent,\n affixed || copied ? undefined : clearance,\n )}\n underlineColorAndroid=\"transparent\"\n />\n )\n\n if (copied) {\n // The space keeps a final line break a line of the copy, as the control\n // draws one.\n return (\n <View style={composeStyles<ViewStyle>(styles.copied, clearance)}>\n <NativeText\n aria-hidden\n style={composeStyles<TextStyle>(role, styles.copy, extent)}\n >\n {`${props.value ?? ''} `}\n </NativeText>\n {control}\n </View>\n )\n }\n\n if (!affixed) {\n return control\n }\n\n return (\n <View style={composeStyles<ViewStyle>(styles.affixLine, clearance)}>\n {prefix === undefined ? null : (\n <Affix floated={box.floated} id={`${id}-prefix`} style={affixStyle}>\n {prefix}\n </Affix>\n )}\n {control}\n {suffix === undefined ? null : (\n <Affix floated={box.floated} id={`${id}-suffix`} style={affixStyle}>\n {suffix}\n </Affix>\n )}\n </View>\n )\n}\n\n/**\n * The line under a field: the error while there is one, the description\n * otherwise, and the count of characters at its end. With nothing to show it\n * is out of the flow, so the field ends at its box. Inside a form it is drawn\n * anyway, empty, since a form is where an error arrives after the fact, from\n * a server or on a submission, and every field below this one would\n * otherwise move by the line's height when it does.\n *\n * On iOS and Android the control reads the line out as its hint, so the line\n * itself is hidden from VoiceOver and TalkBack rather than read twice. An\n * error is announced as it arrives, since a hint that changes is not read\n * again: on iOS through `announceForAccessibility`, and on Android, where the\n * error is left reachable for it, by a polite live region around it, which\n * is also what announces it under React Native Web. An error the field opens\n * with is not announced, as a live region in a browser does not read what it\n * was mounted holding.\n *\n * The count is hidden everywhere. It changes on every keystroke, and read\n * back at that rate it is worse than not hearing it, so the limit is said\n * once in the control's description instead.\n */\nfunction FieldMessage({\n characterCount = false,\n characterLimitLabel,\n description,\n error,\n id,\n length = 0,\n maxLength,\n}: FieldMessageProps) {\n const theme = useTheme()\n const styles = fieldStylesOf(theme)\n const role = useTypeRole('bodySmall')\n const { fontScale } = useWindowDimensions()\n const ids = idsOf(id)\n const invalid = error !== undefined\n const locale = useLocaleOf(undefined)\n const limit = limitOf(maxLength, characterLimitLabel, locale)\n const insideForm = useInsideForm()\n const collapsed =\n !invalid && description === undefined && !characterCount && !insideForm\n const { colors, typography } = theme\n const messageStyle = composeStyles<TextStyle>(\n role,\n colorOf(invalid ? colors.error : colors.onSurfaceVariant),\n SHRINKS,\n )\n\n useErrorAnnouncement(error)\n\n return (\n <View\n style={composeStyles<ViewStyle>(\n styles.messageLine,\n collapsed\n ? styles.messageLineCollapsed\n : minHeightOf(typography.bodySmallLineHeight * fontScale),\n )}\n >\n <View\n aria-live=\"polite\"\n {...(Platform.OS === 'web' ? ATOMIC : undefined)}\n {...(Platform.OS === 'ios' ? HIDDEN : undefined)}\n style={invalid && error !== '' ? SHRINKS : OUT_OF_FLOW}\n >\n {invalid && error !== '' ? (\n <NativeText id={ids.error} style={messageStyle}>\n {error}\n </NativeText>\n ) : null}\n </View>\n {invalid || description === undefined ? null : (\n <NativeText\n {...(Platform.OS === 'web' ? undefined : HIDDEN)}\n id={ids.description}\n style={messageStyle}\n >\n {description}\n </NativeText>\n )}\n {limit === undefined || Platform.OS !== 'web' ? null : (\n <NativeText id={ids.limit} style={NOT_DRAWN}>\n {limit}\n </NativeText>\n )}\n {characterCount ? (\n <NativeText\n aria-hidden\n style={composeStyles<TextStyle>(messageStyle, styles.counter)}\n >\n {countOf(length, maxLength, locale)}\n </NativeText>\n ) : null}\n </View>\n )\n}\n\n/**\n * Hands a control outside a box the states it is drawn in, for a field that\n * draws a container of its own around the control, as SearchField's bar is.\n * The control takes its colours and the state a screen reader reads from\n * these, as it does from the box around it.\n */\nfunction FieldStates({\n children,\n isDisabled = false,\n isInvalid = false,\n isRequired = false,\n}: FieldStatesProps) {\n const states = useMemo(\n () => ({\n ...OUTSIDE_BOX,\n disabled: isDisabled,\n invalid: isInvalid,\n required: isRequired,\n }),\n [isDisabled, isInvalid, isRequired],\n )\n\n return <BoxContext value={states}>{children}</BoxContext>\n}\n\n/**\n * Tracks whether the control has focus, around the handlers the field was\n * given, which are called after.\n */\nfunction useFieldFocus({\n onBlur,\n onFocus,\n}: Pick<TextInputProps, 'onBlur' | 'onFocus'>) {\n const [focused, setFocused] = useState(false)\n\n return {\n focused,\n handlers: {\n onBlur: ((event) => {\n setFocused(false)\n onBlur?.(event)\n }) satisfies TextInputProps['onBlur'],\n onFocus: ((event) => {\n setFocused(true)\n onFocus?.(event)\n }) satisfies TextInputProps['onFocus'],\n },\n }\n}\n\n// What a web-only atomic live region adds, so a changed message is read whole.\n// React Native's types carry no `aria-atomic`, which React Native Web takes.\nconst ATOMIC = { 'aria-atomic': true } as const\n\n// What hides a part of the line under a field from VoiceOver and TalkBack,\n// where the control reads it out as its hint.\nconst HIDDEN = { 'aria-hidden': true } as const\n\n// What leaves the control's writing direction to the page under React Native\n// Web, which gives a TextInput `dir=\"auto\"` otherwise and so aligns a value by\n// its own script: a Latin value at the left of a right-to-left field, away\n// from its label. Null rather than left out, since left out is what it writes\n// `auto` for. React Native's types carry no `dir`.\nconst INHERITS_DIRECTION = { dir: null } as const\n\n// The limit under React Native Web: in the document for the control to point\n// at, and drawn nowhere.\nconst NOT_DRAWN: TextStyle = { display: 'none' }\n\n// The live region with nothing in it, which takes no place in the line.\nconst OUT_OF_FLOW: ViewStyle = { position: 'absolute' }\n\nconst SHRINKS: TextStyle = { flexShrink: 1 }\n\n/**\n * A prefix or a suffix, faded in once the label has floated and out when it\n * comes back to rest, over the label's own `durationShort3`.\n */\nfunction Affix({\n children,\n floated,\n id,\n style,\n}: {\n readonly children: ReactNode\n readonly floated: boolean\n readonly id: string\n readonly style: StyleProp<TextStyle>\n}) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const opacity = floated ? 1 : 0\n const timing = {\n duration: motion.durationShort3,\n easing: Easing.bezier(...motion.easingStandard),\n }\n const fade = useAnimatedStyle(() => {\n 'worklet'\n return {\n opacity: reduceMotion ? opacity : withTiming(opacity, timing),\n }\n })\n\n return (\n <Animated.Text\n id={id}\n style={composeStyles<AnimatedStyle<TextStyle>>(style, fade)}\n >\n {children}\n </Animated.Text>\n )\n}\n\nfunction affixPart(\n id: string,\n affix: ReactNode,\n): readonly FieldDescriptionPart[] {\n if (affix === undefined) {\n return []\n }\n\n return [\n {\n id,\n text:\n typeof affix === 'string' || typeof affix === 'number'\n ? String(affix)\n : '',\n },\n ]\n}\n\nfunction boxControlOf(\n floatingLabel: boolean,\n floated: boolean,\n disabled: boolean,\n invalid: boolean,\n required: boolean,\n underLabel: boolean,\n): BoxControl {\n return {\n disabled,\n floated,\n invalid,\n label: floatingLabel ? 'floating' : 'fixed',\n required,\n underLabel,\n }\n}\n\n/**\n * The box's label: one line, cut short with an ellipsis, moving between its\n * resting place and its floated one. Hidden from screen readers, since the\n * control is named by the same words.\n */\nfunction BoxLabel({\n children,\n floated,\n floatingLabel,\n isDisabled,\n isFocused,\n isInvalid,\n isRequired,\n variant,\n}: {\n readonly children: string\n readonly floated: boolean\n readonly floatingLabel: boolean\n readonly isDisabled: boolean\n readonly isFocused: boolean\n readonly isInvalid: boolean\n readonly isRequired: boolean\n readonly variant: FieldVariant\n}) {\n const theme = useTheme()\n const styles = fieldStylesOf(theme)\n const { fontScale } = useWindowDimensions()\n const reduceMotion = useReducedMotion()\n const large = useTypeRole('bodyLarge')\n const small = useTypeRole(floatingLabel ? 'bodySmall' : 'labelMedium')\n const { colors, motion, spacing, stateLayerOpacity, typography } = theme\n const outlined = variant === 'outlined'\n const smallRole = floatingLabel ? 'bodySmall' : 'labelMedium'\n const place: LabelPlace = floated\n ? {\n fontSize: typography[`${smallRole}Size`],\n letterSpacing: typography[`${smallRole}Tracking`],\n lineHeight: typography[`${smallRole}LineHeight`],\n top: outlined\n ? -(\n spacing.lg +\n (typography[`${smallRole}LineHeight`] * fontScale) / 2\n )\n : 0,\n }\n : {\n fontSize: typography.bodyLargeSize,\n letterSpacing: typography.bodyLargeTracking,\n lineHeight: typography.bodyLargeLineHeight,\n top: outlined ? 0 : (typography.bodySmallLineHeight * fontScale) / 2,\n }\n const color = isDisabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n : isInvalid\n ? colors.error\n : isFocused\n ? colors.primary\n : colors.onSurfaceVariant\n const timing = {\n duration: motion.durationShort3,\n easing: Easing.bezier(...motion.easingStandard),\n }\n\n const motionStyle = useAnimatedStyle(() => {\n 'worklet'\n return {\n color: reduceMotion ? color : withTiming(color, timing),\n fontSize: reduceMotion\n ? place.fontSize\n : withTiming(place.fontSize, timing),\n letterSpacing: reduceMotion\n ? place.letterSpacing\n : withTiming(place.letterSpacing, timing),\n lineHeight: reduceMotion\n ? place.lineHeight\n : withTiming(place.lineHeight, timing),\n top: reduceMotion ? place.top : withTiming(place.top, timing),\n }\n })\n\n return (\n <View\n aria-hidden\n style={composeStyles<ViewStyle>(\n styles.label,\n outlined ? styles.labelOutlined : undefined,\n )}\n >\n <Animated.Text\n numberOfLines={1}\n style={composeStyles<AnimatedStyle<TextStyle>>(\n floated ? small : large,\n outlined ? styles.labelTextOutlined : undefined,\n motionStyle,\n )}\n >\n {children}\n {isRequired ? REQUIRED_MARK : null}\n </Animated.Text>\n </View>\n )\n}\n\nfunction colorOf(color: string): TextStyle {\n return { color }\n}\n\n// The count in the locale's digits and grouping, as web writes it in the\n// provider's.\nfunction countOf(\n length: number,\n maxLength: number | undefined,\n locale: string,\n) {\n return maxLength === undefined\n ? formatCount(length, locale)\n : `${formatCount(length, locale)}/${formatCount(maxLength, locale)}`\n}\n\nfunction descriptionOf(\n parts: readonly FieldDescriptionPart[],\n): DescribedBy | undefined {\n if (Platform.OS === 'web') {\n return parts.length === 0\n ? undefined\n : { 'aria-describedby': parts.map((part) => part.id).join(' ') }\n }\n\n const said = parts.map((part) => part.text).filter((text) => text !== '')\n\n return said.length === 0 ? undefined : { accessibilityHint: said.join(' ') }\n}\n\nfunction focusOf(control: RefObject<ComponentRef<typeof TextInput> | null>) {\n return () => {\n control.current?.focus()\n }\n}\n\nfunction heightOf(height: number): ViewStyle {\n return { height }\n}\n\nfunction iconStyleOf(color: string): IconStyle {\n return { color, size: ICON_SIZE }\n}\n\nfunction idsOf(id: string) {\n return {\n description: `${id}-description`,\n error: `${id}-error`,\n limit: `${id}-limit`,\n }\n}\n\n/**\n * The limit in words where there is one: the field's own, or the library's\n * in `locale`.\n */\nfunction limitOf(\n maxLength: number | undefined,\n label: string | undefined,\n locale: string | undefined,\n) {\n if (maxLength === undefined) {\n return undefined\n }\n\n return label ?? limitFor(maxLength, locale)\n}\n\nfunction marginTopOf(marginTop: number): ViewStyle {\n return { marginTop }\n}\n\nfunction minHeightOf(minHeight: number): ViewStyle {\n return { minHeight }\n}\n\nfunction minWidthOf(minWidth: number): ViewStyle {\n return { minWidth }\n}\n\n/**\n * The label's text in its floated type, out of sight, measured for the\n * outlined box's notch.\n */\nfunction NotchMeasure({\n children,\n floatingLabel,\n isRequired,\n onMeasure,\n}: {\n readonly children: string\n readonly floatingLabel: boolean\n readonly isRequired: boolean\n readonly onMeasure: (width: number) => void\n}) {\n const styles = fieldStylesOf(useTheme())\n const small = useTypeRole(floatingLabel ? 'bodySmall' : 'labelMedium')\n\n return (\n <View\n aria-hidden\n style={composeStyles<ViewStyle>(\n styles.label,\n styles.labelOutlined,\n styles.notchMeasure,\n )}\n >\n <NativeText\n numberOfLines={1}\n onLayout={widthTo(onMeasure)}\n style={composeStyles<TextStyle>(small, styles.labelTextOutlined)}\n >\n {children}\n {isRequired ? REQUIRED_MARK : null}\n </NativeText>\n </View>\n )\n}\n\nfunction numericOf(fontFamily: string | undefined): TextStyle {\n return { fontFamily, fontVariant: ['tabular-nums'] }\n}\n\n// How far an outline stretch reaches along the box before the label's place\n// begins or after it ends: the box's padding at that end, and past an icon\n// the page's 12dp, the icon and its 16dp, less the notch's own 4dp beside the\n// label.\nfunction outlineInset(spacing: ResolvedTheme['spacing'], icon: ReactNode) {\n return (\n (icon === undefined ? spacing.lg : spacing.md + ICON_SIZE + spacing.lg) -\n spacing.xs\n )\n}\n\n// The asterisk after a required field's label, which is how the text fields\n// page marks one. In the label rather than beside it, so it floats and takes\n// the label's colour with it.\nconst REQUIRED_MARK = '*'\n\n/**\n * One view drawing a field's rule in its eased colour and width, from\n * {@link useStrokeMotion}: on every side, for the outlined box's outline,\n * which the piece around it clips, and a bar's ring, or on the top alone,\n * for the filled box's indicator.\n */\nfunction FieldStroke({ color, sides, style, width }: FieldStrokeProps) {\n const stroke = useAnimatedStyle(() => {\n 'worklet'\n return sides === 'all'\n ? { borderColor: color.get(), borderWidth: width.get() }\n : { borderColor: color.get(), borderTopWidth: width.get() }\n })\n\n return (\n <Animated.View\n aria-hidden\n style={composeStyles<AnimatedStyle<ViewStyle>>(style, stroke)}\n />\n )\n}\n\n/**\n * Says an error on iOS as it arrives, where a live region says nothing. An\n * error the field opened with is not said, and neither is one that has not\n * changed.\n */\nfunction useErrorAnnouncement(error: string | undefined) {\n const said = useRef(error)\n\n useEffect(() => {\n if (\n Platform.OS === 'ios' &&\n error !== undefined &&\n error !== '' &&\n error !== said.current\n ) {\n AccessibilityInfo.announceForAccessibility(error)\n }\n said.current = error\n }, [error])\n}\n\n/**\n * The rule the box draws, the filled box's indicator or the outlined box's\n * outline: its colour and its width by state.\n */\nfunction useRuleMotion(theme: ResolvedTheme, state: FieldState) {\n const { colors, stateLayerOpacity } = theme\n const width = !state.disabled && state.focused ? 2 : 1\n const color = state.disabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContainer)\n : state.focused\n ? state.invalid\n ? colors.error\n : colors.primary\n : state.hovered\n ? state.invalid\n ? colors.onErrorContainer\n : colors.onSurface\n : state.invalid\n ? colors.error\n : colors.outline\n\n return useStrokeMotion(color, width)\n}\n\n/**\n * A rule's colour and width, eased to each new pair over `durationShort2` as\n * web transitions them, and moved at once under reduced motion. Hand the\n * result to {@link FieldStroke}.\n */\nfunction useStrokeMotion(color: string, width: number): StrokeMotion {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const timing = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n\n return {\n color: useDerivedValue<string>(() =>\n reduceMotion ? color : withTiming(color, timing),\n ),\n width: useDerivedValue<number>(() =>\n reduceMotion ? width : withTiming(width, timing),\n ),\n }\n}\n\nfunction webStateOf(box: BoxControl): undefined | WebState {\n if (Platform.OS !== 'web') {\n return undefined\n }\n\n return {\n ...(box.invalid ? { 'aria-invalid': true } : undefined),\n ...(box.required ? { 'aria-required': true } : undefined),\n }\n}\n\nfunction widthOf(width: number): ViewStyle {\n return { width }\n}\n\nfunction widthTo(onMeasure: (width: number) => void) {\n return (event: LayoutChangeEvent) => {\n onMeasure(event.nativeEvent.layout.width)\n }\n}\n\nexport {\n describedBy,\n FieldBox,\n FieldInput,\n FieldMessage,\n FieldStates,\n FieldStroke,\n useErrorAnnouncement,\n useFieldFocus,\n useStrokeMotion,\n}\nexport type {\n FieldBoxProps,\n FieldDescriptionPart,\n FieldInputProps,\n FieldMessageProps,\n FieldStatesProps,\n FieldStrokeProps,\n FieldVariant,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4RA,MAAM0G,YAA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,MAAM,CACjD;CACO,MAAA/I,KAAA5F,sBACLyO,eAAA/J,QAAuBxE,WAAWwE,OAAOiK,MAAM,CACjD;CAAC,IAAA9I;CAAA,IAAAH,EAAA,OAAAD,MAAAC,EAAA,OAAAE,IAAA;EANIC,KAAA;GAAApB,OACEgB;GAENf,OACMkB;EAGT;EAACF,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAPMG;AAON;AAGH,SAASsG,WAAWvD,KAAuC;CACzD,IAAIpJ,SAASsM,OAAO,OAClB;CAGF,OAAO;EACL,GAAIlD,IAAIxH,UAAU,EAAE,gBAAgB,KAAK,IAAIiE,KAAAA;EAC7C,GAAIuD,IAAItH,WAAW,EAAE,iBAAiB,KAAK,IAAI+D,KAAAA;CACjD;AACF;AAEA,SAASoE,QAAQ/E,OAA0B;CACzC,OAAO,EAAEA,MAAM;AACjB;AAEA,SAASuM,QAAQH,WAAoC;CACnD,QAAQ9C,UAA6B;EACnC8C,UAAU9C,MAAMgE,YAAYC,OAAOvN,KAAK;CAC1C;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["ComponentRef","ReactNode","Ref","RefObject","HostInstance","LayoutChangeEvent","StyleProp","TextInputProps","TextStyle","ViewProps","ViewStyle","AnimatedStyle","DerivedValue","createContext","use","useEffect","useId","useMemo","useRef","useState","AccessibilityInfo","Text","NativeText","Platform","Pressable","TextInput","useWindowDimensions","View","Animated","Easing","useAnimatedStyle","useDerivedValue","useReducedMotion","withTiming","Focusable","IconStyle","ResolvedTheme","useInsideForm","IconStyleContext","limitFor","useLocaleOf","formatCount","usePressFeedback","withOpacity","useTheme","composeStyles","useFontFamily","useTypeRole","fieldStylesOf","BoxControl","disabled","floated","invalid","label","required","underLabel","DescribedBy","Pick","FieldBoxProps","children","control","end","floatingLabel","isDisabled","isFocused","isInvalid","isPopulated","isRequired","leading","ref","trailing","trigger","FieldTriggerProps","variant","FieldVariant","FieldDescriptionPart","id","text","FieldInputProps","Omit","autosize","chosen","described","multiline","numeric","prefix","rows","suffix","FieldMessageProps","characterCount","characterLimitLabel","description","error","length","maxLength","FieldState","focused","hovered","FieldStatesProps","FieldStrokeProps","StrokeMotion","sides","style","onBlur","onFocus","onPress","testID","FieldValueProps","isPlaceholder","LabelPlace","fontSize","letterSpacing","lineHeight","top","color","width","WebState","ICON_SIZE","OUTSIDE_BOX","BoxContext","SegmentsLineContext","NO_PARTS","describedBy","locale","ids","idsOf","message","undefined","limit","limitOf","FieldBox","t0","$","_c","t1","t2","t3","t4","t5","t6","t7","theme","styles","fontScale","notch","setNotch","colors","radii","spacing","stateLayerOpacity","typography","t8","xs","borderTopEndRadius","borderTopStartRadius","t9","onSurface","corners","disableRipple","feedback","outlined","t10","state","rule","useRuleMotion","t11","t12","boxControlOf","boxControl","t13","disabledContent","T0","t14","NOT_A_CONTROL","triggerOf","t15","handlers","onHoverIn","t16","onHoverOut","t17","focusOf","t18","box","boxTrigger","boxLeading","boxTrailing","boxOutlined","boxDisabled","minHeightOf","lg","bodyLargeLineHeight","sm","bodySmallLineHeight","t19","outline","outlineStart","widthOf","outlineInset","outlineStartBox","outlineNotch","outlineNotchBox","outlineEnd","minWidthOf","outlineEndBox","layer","indicator","t20","onSurfaceVariant","icon","iconStyleOf","t21","t22","t23","t24","column","t25","t26","FieldInput","props","role","mono","fontFamilyMono","content","caret","primary","muted","affixed","holdsChosen","clearance","marginTopOf","affixStyle","colorOf","lines","copied","OS","extent","heightOf","descriptionOf","affixPart","webStateOf","INHERITS_DIRECTION","input","numericOf","inputMultiline","inputOverCopy","CHOSEN_ROOM","bodyLargeSize","copy","value","affixLine","SHRINKS","FieldMessage","insideForm","collapsed","messageStyle","useErrorAnnouncement","messageLine","messageLineCollapsed","OUT_OF_FLOW","ATOMIC","HIDDEN","NOT_DRAWN","counter","countOf","FieldSegments","onLine","segments","FieldStates","states","FieldValue","useFieldFocus","setFocused","event","event_0","const","dir","accessible","focusable","display","position","flexShrink","Affix","motion","reduceMotion","opacity","timing","duration","durationShort3","easing","bezier","easingStandard","fade","affix","String","BoxLabel","large","small","smallRole","place","bodyLargeTracking","motionStyle","labelOutlined","labelTextOutlined","REQUIRED_MARK","parts","map","part","join","said","filter","accessibilityHint","current","focus","height","size","marginTop","minHeight","minWidth","NotchMeasure","onMeasure","notchMeasure","T1","widthTo","fontFamily","fontVariant","md","FieldStroke","stroke","borderColor","get","borderWidth","borderTopWidth","_onPress","announceForAccessibility","onErrorContainer","disabledContainer","useStrokeMotion","durationShort2","nativeEvent","layout","FieldChevron","_c","state","NativeText","color"],"sources":["../../src/field/index.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode, Ref, RefObject } from 'react'\nimport type {\n HostInstance,\n LayoutChangeEvent,\n StyleProp,\n TextInputProps,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\nimport type { AnimatedStyle, DerivedValue } from 'react-native-reanimated'\n\nimport {\n createContext,\n use,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport {\n AccessibilityInfo,\n Text as NativeText,\n Platform,\n Pressable,\n TextInput,\n useWindowDimensions,\n View,\n} from 'react-native'\nimport Animated, {\n Easing,\n useAnimatedStyle,\n useDerivedValue,\n useReducedMotion,\n withTiming,\n} from 'react-native-reanimated'\n\nimport type { Focusable } from '../form'\nimport type { IconStyle } from '../glyphs/icon-style'\nimport type { ResolvedTheme } from '../theme/scope'\n\nimport { useInsideForm } from '../form'\nimport { IconStyleContext } from '../glyphs/icon-style'\nimport { limitFor } from '../i18n'\nimport { useLocaleOf } from '../i18n/provider'\nimport { formatCount } from '../number/count'\nimport { usePressFeedback } from '../press'\nimport { withOpacity } from '../theme/color'\nimport { useTheme } from '../theme/scope'\nimport { composeStyles } from '../theme/styles'\nimport { useFontFamily } from '../typography/fonts'\nimport { useTypeRole } from '../typography/roles'\nimport { fieldStylesOf } from './styles'\n\n// The chrome every field shares, as on web: the box with its label, the\n// control inside it, and the line of supporting text under it. Each field is\n// the parts it renders inside a root of its own, and these are not exported\n// from the package.\n//\n// The text fields page draws two boxes. The filled one carries surface\n// container highest with an active indicator along its bottom, 1dp in the\n// outline role at rest and 2dp in primary while focused, and its label floats\n// within it. The outlined one has no fill and a 1dp outline all round that\n// thickens the same way, and its label floats up onto the outline, cutting a\n// notch in it.\n//\n// **The label floats by changing its type and its place**, eased by\n// Reanimated over `durationShort3` on the standard curve, as web transitions\n// them: body large on the value's line while the field is empty and\n// unfocused, body small at the top once it is focused or holds a value.\n// `floatingLabel={false}` keeps it small at the top in label medium, as web's\n// fixed label is. Under reduced motion it moves at once.\n//\n// **The box grows with the device's text size.** Its height is a floor rather\n// than a height, the padding above and below plus the lines it holds, and the\n// lines are the type tokens' line heights at the device's font scale, which\n// is what React Native draws the text at. So the 56dp the page gives is the\n// floor at the default text size, and a larger one makes the box taller\n// rather than running the value out of it.\n//\n// **The outline is drawn from views**, since there is no fieldset to cut it:\n// three pieces in a row, the stretch before the label, the notch under it,\n// which draws only the bottom of the outline, and the stretch after it. The\n// notch is the label's width in its floated type, measured from a copy of it\n// out of sight, as web's legend holds one. Before the label floats it is\n// closed, and the two stretches meet.\n//\n// **A pointer over the filled box draws the state layer**, the one every\n// control draws through `usePressFeedback`, on surface at the hover opacity,\n// and turns the indicator on surface, as the page's hovered state does; one\n// over the outlined box turns the outline on surface. Web's filled box draws\n// neither. Focus wins over hover, and an error takes the\n// error role, or on error container under a pointer.\n//\n// **Disabled is the page's colour at an opacity, translucent**: the filled\n// container and the rule are on surface at the `disabledContainer` opacity,\n// and the label, the value and the icons on surface at `disabledContent`,\n// over whatever the field sits on rather than mixed over the surface role as\n// web's are.\n\n// What a control needs to know about the box around it: how the label is\n// drawn, whether the control clears it, and the states it takes its colours\n// from.\ntype BoxControl = {\n readonly disabled: boolean\n readonly floated: boolean\n readonly invalid: boolean\n readonly label: 'fixed' | 'floating' | 'none'\n readonly required: boolean\n readonly underLabel: boolean\n}\n\ntype DescribedBy = Pick<ViewProps, 'accessibilityHint'> & {\n readonly 'aria-describedby'?: string\n}\n\ntype FieldBoxProps = {\n readonly children?: ReactNode\n /**\n * The control the box focuses when it is pressed anywhere, as the whole\n * of a native text field's box takes a press.\n */\n readonly control?: RefObject<Focusable | null>\n /**\n * What the box holds after the label and the control's column, drawn as\n * it is rather than in an icon's slot, for a part laid out against the\n * box's own edges: a number field's steppers. The column, and the label\n * in it, end where this starts, 16dp before it.\n */\n readonly end?: ReactNode\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. `false` keeps it small at the top.\n * @default true\n */\n readonly floatingLabel?: boolean\n /** @default false */\n readonly isDisabled?: boolean\n /** Whether the control has focus, which the box draws. */\n readonly isFocused?: boolean\n /** @default false */\n readonly isInvalid?: boolean\n /** Whether the control holds anything, which floats the label. */\n readonly isPopulated?: boolean\n /**\n * Marks the label with an asterisk, as the text fields page marks a field\n * that must be filled.\n * @default false\n */\n readonly isRequired?: boolean\n /** What the field is for. */\n readonly label: string\n /** An icon at the start of the box, before the label and the control. */\n readonly leading?: ReactNode\n /**\n * The box itself, which a field opening a list from it measures to place\n * the list.\n */\n readonly ref?: Ref<HostInstance>\n /** An icon at the end of the box, after the control. */\n readonly trailing?: ReactNode\n /**\n * Makes the box itself the control, for a field holding something chosen\n * rather than typed: a button a screen reader reads by `aria-label`, which\n * a press anywhere on the box runs, in place of a `control` to focus.\n */\n readonly trigger?: FieldTriggerProps\n /** @default 'filled' */\n readonly variant?: FieldVariant\n}\n\n/**\n * One piece of what describes a field's control: the text a screen reader\n * hears on iOS and Android, and the id of the element showing it, which the\n * control points at under React Native Web.\n */\ntype FieldDescriptionPart = {\n readonly id: string\n readonly text: string\n}\n\ntype FieldInputProps = Omit<\n TextInputProps,\n | 'accessibilityHint'\n | 'cursorColor'\n | 'multiline'\n | 'numberOfLines'\n | 'placeholderTextColor'\n | 'rows'\n | 'selectionColor'\n | 'style'\n | 'underlineColorAndroid'\n> & {\n /**\n * Whether a multi-line control grows with the text it holds, from `rows`\n * up. `false` holds it at `rows` and scrolls the text inside.\n * @default true\n */\n readonly autosize?: boolean\n /**\n * The options a field holding several has chosen, written as one list,\n * drawn before the control on its line in the value's own role and cut\n * short with an ellipsis where the line runs out. The control keeps three\n * characters' width beside them at the least, so there is always\n * somewhere to type, and is described by them first.\n */\n readonly chosen?: string\n /** What describes the control, after its prefix and suffix. */\n readonly described?: readonly FieldDescriptionPart[]\n /**\n * Whether the control holds several lines rather than one, the return key\n * starting a new one.\n * @default false\n */\n readonly multiline?: boolean\n /**\n * The value in the mono face with tabular figures.\n * @default false\n */\n readonly numeric?: boolean\n /** Text before the value on its line. */\n readonly prefix?: ReactNode\n readonly ref?: Ref<ComponentRef<typeof TextInput>>\n /**\n * How many lines a multi-line control shows: the least it shows while it\n * grows, or all it shows when it does not.\n * @default 1\n */\n readonly rows?: number\n /** Text after the value on its line. */\n readonly suffix?: ReactNode\n}\n\ntype FieldMessageProps = {\n /**\n * Counts the characters, against `maxLength` where there is one.\n * @default false\n */\n readonly characterCount?: boolean\n /** How the limit is said to a screen reader. */\n readonly characterLimitLabel?: string | undefined\n /** The hint, which the error replaces while there is one. */\n readonly description?: string | undefined\n /** The problem with the value, in words. */\n readonly error?: string | undefined\n /** The field's id, as handed to {@link describedBy}. */\n readonly id: string\n /** How many characters the control holds. */\n readonly length?: number\n readonly maxLength?: number | undefined\n}\n\ntype FieldState = {\n readonly disabled: boolean\n readonly focused: boolean\n readonly hovered: boolean\n readonly invalid: boolean\n}\n\ntype FieldStatesProps = {\n readonly children?: ReactNode\n /** @default false */\n readonly isDisabled?: boolean\n /** @default false */\n readonly isInvalid?: boolean\n /** @default false */\n readonly isRequired?: boolean\n}\n\ntype FieldStrokeProps = StrokeMotion & {\n /** Every side of the view, or the top alone. */\n readonly sides: 'all' | 'top'\n readonly style: StyleProp<ViewStyle>\n}\n\n/**\n * What a box that is itself the control is read and pressed as: web's\n * `FieldTrigger`, which covers the box with one press target.\n */\ntype FieldTriggerProps = {\n /** Whether what the box opens is open, which a screen reader reads. */\n readonly 'aria-expanded'?: boolean\n /** The name a screen reader reads: the label, then the value shown. */\n readonly 'aria-label': string\n /** What describes the box, the line under it, as a control is described. */\n readonly described?: readonly FieldDescriptionPart[]\n readonly onBlur?: () => void\n readonly onFocus?: () => void\n readonly onPress: () => void\n readonly testID?: string\n}\n\ntype FieldValueProps = {\n /** The value, or the placeholder. */\n readonly children?: ReactNode\n /**\n * Whether nothing has been chosen, so what is drawn is the placeholder,\n * in the muted role, and under a label at rest on its line not at all.\n * @default false\n */\n readonly isPlaceholder?: boolean\n}\n\n/**\n * The filled box, or the outlined one: no fill, an outline that thickens and\n * takes the primary role while focused, and the label cutting it once it\n * floats, the text fields page's two fields.\n */\ntype FieldVariant = 'filled' | 'outlined'\n\n// Where the label is and what type it is in, at rest or floated.\ntype LabelPlace = {\n readonly fontSize: number\n readonly letterSpacing: number\n readonly lineHeight: number\n readonly top: number\n}\n\n// The control's state as React Native Web hands it to a browser, which reads\n// `aria-invalid` and `aria-required` off the input. React Native has neither.\n// A rule's colour and width as they ease.\ntype StrokeMotion = {\n readonly color: DerivedValue<string>\n readonly width: DerivedValue<number>\n}\n\ntype WebState = {\n readonly 'aria-invalid'?: true\n readonly 'aria-required'?: true\n}\n\n// The page's icon, which the box's outline is laid out around.\nconst ICON_SIZE = 24\n\n// A control outside any box has no label over it.\nconst OUTSIDE_BOX: BoxControl = {\n disabled: false,\n floated: true,\n invalid: false,\n label: 'none',\n required: false,\n underLabel: false,\n}\n\nconst BoxContext = createContext<BoxControl>(OUTSIDE_BOX)\n\n// Whether a FieldSegments sits on the line of another, as a date range\n// picker's two dates sit on the one line it draws, which clears the label\n// once for both.\nconst SegmentsLineContext = createContext(false)\n\nconst NO_PARTS: readonly FieldDescriptionPart[] = []\n\n/**\n * How a field's control is described by the line under it: the error while\n * there is one, otherwise the description, then the limit where there is a\n * `maxLength`. Hand the result to {@link FieldInput} as `described`, and the\n * same `id` to {@link FieldMessage}.\n */\nfunction describedBy(\n id: string,\n {\n characterLimitLabel,\n description,\n error,\n locale,\n maxLength,\n }: Pick<\n FieldMessageProps,\n 'characterLimitLabel' | 'description' | 'error' | 'maxLength'\n > & {\n /**\n * The locale the limit is said in, the field's `useLocaleOf`, or the\n * device's when left out.\n */\n readonly locale?: string\n },\n): readonly FieldDescriptionPart[] {\n const ids = idsOf(id)\n const message =\n error === undefined\n ? { id: ids.description, text: description ?? '' }\n : { id: ids.error, text: error }\n const limit = limitOf(maxLength, characterLimitLabel, locale)\n\n return [\n ...(message.text === '' ? [] : [message]),\n ...(limit === undefined ? [] : [{ id: ids.limit, text: limit }]),\n ]\n}\n\n/**\n * The box a control sits in, filled or outlined, with its label. Pressed\n * anywhere, it focuses its control, or runs its `trigger` where the box is\n * the control itself. The states it draws are handed to it, since the field\n * around it is what knows them.\n */\nfunction FieldBox({\n children,\n control,\n end,\n floatingLabel = true,\n isDisabled = false,\n isFocused = false,\n isInvalid = false,\n isPopulated = false,\n isRequired = false,\n label,\n leading,\n ref,\n trailing,\n trigger,\n variant = 'filled',\n}: FieldBoxProps) {\n const theme = useTheme()\n const styles = fieldStylesOf(theme)\n const { fontScale } = useWindowDimensions()\n const [notch, setNotch] = useState(0)\n const { colors, radii, spacing, stateLayerOpacity, typography } = theme\n // The hover layer alone: a text field's box takes no pressed or focus\n // layer, since the indicator and the label are what mark its focus.\n const feedback = usePressFeedback({\n color: colors.onSurface,\n corners: {\n borderTopEndRadius: radii.xs,\n borderTopStartRadius: radii.xs,\n },\n disabled: isDisabled,\n disableRipple: true,\n })\n const outlined = variant === 'outlined'\n const floated = !floatingLabel || isFocused || isPopulated\n const state: FieldState = {\n disabled: isDisabled,\n focused: isFocused,\n hovered: feedback.hovered,\n invalid: isInvalid,\n }\n const rule = useRuleMotion(theme, state)\n const boxControl = useMemo(\n () =>\n boxControlOf(\n floatingLabel,\n floated,\n isDisabled,\n isInvalid,\n isRequired,\n !outlined,\n ),\n [floatingLabel, floated, isDisabled, isInvalid, isRequired, outlined],\n )\n const disabledContent = withOpacity(\n colors.onSurface,\n stateLayerOpacity.disabledContent,\n )\n\n return (\n <Pressable\n {...(trigger === undefined ? NOT_A_CONTROL : triggerOf(trigger))}\n disabled={isDisabled}\n onHoverIn={feedback.handlers.onHoverIn}\n onHoverOut={feedback.handlers.onHoverOut}\n onPress={trigger?.onPress ?? focusOf(control)}\n ref={ref}\n style={composeStyles<ViewStyle>(\n styles.box,\n trigger === undefined ? undefined : styles.boxTrigger,\n leading === undefined ? undefined : styles.boxLeading,\n trailing === undefined ? undefined : styles.boxTrailing,\n outlined ? styles.boxOutlined : undefined,\n isDisabled && !outlined ? styles.boxDisabled : undefined,\n minHeightOf(\n outlined\n ? 2 * spacing.lg + typography.bodyLargeLineHeight * fontScale\n : 2 * spacing.sm +\n (typography.bodySmallLineHeight +\n typography.bodyLargeLineHeight) *\n fontScale,\n ),\n )}\n >\n {outlined ? (\n <View aria-hidden style={styles.outline}>\n <View\n style={composeStyles<ViewStyle>(\n styles.outlineStart,\n widthOf(outlineInset(spacing, leading)),\n )}\n >\n <FieldStroke\n color={rule.color}\n sides=\"all\"\n style={styles.outlineStartBox}\n width={rule.width}\n />\n </View>\n <View\n style={composeStyles<ViewStyle>(\n styles.outlineNotch,\n widthOf(floated ? notch : 0),\n )}\n >\n <FieldStroke\n color={rule.color}\n sides=\"all\"\n style={styles.outlineNotchBox}\n width={rule.width}\n />\n </View>\n <View\n style={composeStyles<ViewStyle>(\n styles.outlineEnd,\n minWidthOf(outlineInset(spacing, trailing)),\n )}\n >\n <FieldStroke\n color={rule.color}\n sides=\"all\"\n style={styles.outlineEndBox}\n width={rule.width}\n />\n </View>\n </View>\n ) : (\n <>\n {feedback.layer}\n <FieldStroke\n color={rule.color}\n sides=\"top\"\n style={styles.indicator}\n width={rule.width}\n />\n </>\n )}\n {leading === undefined ? null : (\n <View style={styles.icon}>\n <IconStyleContext\n value={iconStyleOf(\n isDisabled ? disabledContent : colors.onSurfaceVariant,\n )}\n >\n {leading}\n </IconStyleContext>\n </View>\n )}\n <View style={styles.column}>\n <BoxLabel\n floated={floated}\n floatingLabel={floatingLabel}\n isDisabled={isDisabled}\n isFocused={isFocused}\n isInvalid={isInvalid}\n isRequired={isRequired}\n variant={variant}\n >\n {label}\n </BoxLabel>\n {outlined ? (\n <NotchMeasure\n floatingLabel={floatingLabel}\n isRequired={isRequired}\n onMeasure={setNotch}\n >\n {label}\n </NotchMeasure>\n ) : null}\n <BoxContext value={boxControl}>{children}</BoxContext>\n </View>\n {end}\n {trailing === undefined ? null : (\n <View style={styles.icon}>\n <IconStyleContext\n value={iconStyleOf(\n isDisabled\n ? disabledContent\n : isInvalid\n ? colors.error\n : colors.onSurfaceVariant,\n )}\n >\n {trailing}\n </IconStyleContext>\n </View>\n )}\n </Pressable>\n )\n}\n\n/**\n * A field's text control, in a {@link FieldBox}, or in {@link FieldStates}\n * inside a container of a field's own. In a box it clears the label at the\n * top where the box is filled, and shows a prefix and a suffix only while the\n * label has floated, since at rest the label sits on their line. It takes the\n * error role for its caret while the field has an error, and draws a\n * placeholder in the muted role.\n *\n * It is described by what it holds chosen, its prefix and its suffix, ahead\n * of what the field hands it in `described`, so a reader hears the options\n * chosen beside the text and the unit the value is read against as a sighted\n * one sees them on the value's line: on iOS and Android as its hint, and\n * under React Native Web through `aria-describedby`, which drops the hint.\n *\n * `multiline` makes it a text area, `rows` lines of body large tall at the\n * least, its text from the top. iOS and Android grow a multi-line input with\n * what it holds by themselves, so a height floor is all `autosize` asks of\n * them, and `autosize={false}` sets the height instead, which they scroll\n * inside. React Native Web's textarea keeps the height it is given, so there\n * the control lies over a hidden copy of `value` that takes the height the\n * text would, as web's text area lies over its replica. A control that grows\n * is therefore handed its `value`.\n */\nfunction FieldInput({\n autosize = true,\n chosen = '',\n described = NO_PARTS,\n multiline = false,\n numeric = false,\n prefix,\n rows = 1,\n suffix,\n ...props\n}: FieldInputProps) {\n const box = use(BoxContext)\n const theme = useTheme()\n const styles = fieldStylesOf(theme)\n const { fontScale } = useWindowDimensions()\n const role = useTypeRole('bodyLarge')\n const mono = useFontFamily(theme.typography.fontFamilyMono)\n const id = useId()\n const { colors, stateLayerOpacity, typography } = theme\n const content = box.disabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n : colors.onSurface\n const caret = box.invalid ? colors.error : colors.primary\n const muted = box.disabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n : colors.onSurfaceVariant\n const affixed = prefix !== undefined || suffix !== undefined\n const holdsChosen = chosen !== ''\n const clearance = box.underLabel\n ? marginTopOf(typography.bodySmallLineHeight * fontScale)\n : undefined\n const affixStyle = composeStyles<TextStyle>(role, colorOf(muted))\n const lines =\n typography.bodyLargeLineHeight * fontScale * (multiline ? rows : 1)\n const copied = multiline && autosize && Platform.OS === 'web'\n const extent = multiline && !autosize ? heightOf(lines) : minHeightOf(lines)\n\n const control = (\n <TextInput\n {...(Platform.OS === 'web' ? INHERITS_DIRECTION : undefined)}\n {...props}\n {...descriptionOf([\n ...affixPart(`${id}-chosen`, holdsChosen ? chosen : undefined),\n ...affixPart(`${id}-prefix`, prefix),\n ...affixPart(`${id}-suffix`, suffix),\n ...described,\n ])}\n {...webStateOf(box)}\n aria-disabled={box.disabled}\n cursorColor={caret}\n multiline={multiline}\n placeholderTextColor={muted}\n selectionColor={caret}\n style={composeStyles<TextStyle>(\n role,\n styles.input,\n colorOf(content),\n numeric ? numericOf(mono) : undefined,\n multiline ? styles.inputMultiline : undefined,\n copied ? styles.inputOverCopy : extent,\n holdsChosen\n ? minWidthOf(CHOSEN_ROOM * typography.bodyLargeSize * fontScale)\n : undefined,\n affixed || copied || holdsChosen ? undefined : clearance,\n )}\n underlineColorAndroid=\"transparent\"\n />\n )\n\n if (copied) {\n // The space keeps a final line break a line of the copy, as the control\n // draws one.\n return (\n <View style={composeStyles<ViewStyle>(styles.copied, clearance)}>\n <NativeText\n aria-hidden\n style={composeStyles<TextStyle>(role, styles.copy, extent)}\n >\n {`${props.value ?? ''} `}\n </NativeText>\n {control}\n </View>\n )\n }\n\n if (!affixed && !holdsChosen) {\n return control\n }\n\n return (\n <View style={composeStyles<ViewStyle>(styles.affixLine, clearance)}>\n {holdsChosen ? (\n <NativeText\n id={`${id}-chosen`}\n numberOfLines={1}\n style={composeStyles<TextStyle>(role, colorOf(content), SHRINKS)}\n >\n {chosen}\n </NativeText>\n ) : null}\n {prefix === undefined ? null : (\n <Affix floated={box.floated} id={`${id}-prefix`} style={affixStyle}>\n {prefix}\n </Affix>\n )}\n {control}\n {suffix === undefined ? null : (\n <Affix floated={box.floated} id={`${id}-suffix`} style={affixStyle}>\n {suffix}\n </Affix>\n )}\n </View>\n )\n}\n\n/**\n * The line under a field: the error while there is one, the description\n * otherwise, and the count of characters at its end. With nothing to show it\n * is out of the flow, so the field ends at its box. Inside a form it is drawn\n * anyway, empty, since a form is where an error arrives after the fact, from\n * a server or on a submission, and every field below this one would\n * otherwise move by the line's height when it does.\n *\n * On iOS and Android the control reads the line out as its hint, so the line\n * itself is hidden from VoiceOver and TalkBack rather than read twice. An\n * error is announced as it arrives, since a hint that changes is not read\n * again: on iOS through `announceForAccessibility`, and on Android, where the\n * error is left reachable for it, by a polite live region around it, which\n * is also what announces it under React Native Web. An error the field opens\n * with is not announced, as a live region in a browser does not read what it\n * was mounted holding.\n *\n * The count is hidden everywhere. It changes on every keystroke, and read\n * back at that rate it is worse than not hearing it, so the limit is said\n * once in the control's description instead.\n */\nfunction FieldMessage({\n characterCount = false,\n characterLimitLabel,\n description,\n error,\n id,\n length = 0,\n maxLength,\n}: FieldMessageProps) {\n const theme = useTheme()\n const styles = fieldStylesOf(theme)\n const role = useTypeRole('bodySmall')\n const { fontScale } = useWindowDimensions()\n const ids = idsOf(id)\n const invalid = error !== undefined\n const locale = useLocaleOf(undefined)\n const limit = limitOf(maxLength, characterLimitLabel, locale)\n const insideForm = useInsideForm()\n const collapsed =\n !invalid && description === undefined && !characterCount && !insideForm\n const { colors, typography } = theme\n const messageStyle = composeStyles<TextStyle>(\n role,\n colorOf(invalid ? colors.error : colors.onSurfaceVariant),\n SHRINKS,\n )\n\n useErrorAnnouncement(error)\n\n return (\n <View\n style={composeStyles<ViewStyle>(\n styles.messageLine,\n collapsed\n ? styles.messageLineCollapsed\n : minHeightOf(typography.bodySmallLineHeight * fontScale),\n )}\n >\n <View\n aria-live=\"polite\"\n {...(Platform.OS === 'web' ? ATOMIC : undefined)}\n {...(Platform.OS === 'ios' ? HIDDEN : undefined)}\n style={invalid && error !== '' ? SHRINKS : OUT_OF_FLOW}\n >\n {invalid && error !== '' ? (\n <NativeText id={ids.error} style={messageStyle}>\n {error}\n </NativeText>\n ) : null}\n </View>\n {invalid || description === undefined ? null : (\n <NativeText\n {...(Platform.OS === 'web' ? undefined : HIDDEN)}\n id={ids.description}\n style={messageStyle}\n >\n {description}\n </NativeText>\n )}\n {limit === undefined || Platform.OS !== 'web' ? null : (\n <NativeText id={ids.limit} style={NOT_DRAWN}>\n {limit}\n </NativeText>\n )}\n {characterCount ? (\n <NativeText\n aria-hidden\n style={composeStyles<TextStyle>(messageStyle, styles.counter)}\n >\n {countOf(length, maxLength, locale)}\n </NativeText>\n ) : null}\n </View>\n )\n}\n\n/**\n * A date or a time's segments on the value's line of a {@link FieldBox}, in\n * a row, clearing the label at the top where the box is filled, as a control\n * does: web's `FieldSegments`. One inside another is a row on the outer\n * one's line, which has already cleared the label.\n */\nfunction FieldSegments({ children }: { readonly children?: ReactNode }) {\n const box = use(BoxContext)\n const onLine = use(SegmentsLineContext)\n const theme = useTheme()\n const styles = fieldStylesOf(theme)\n const { fontScale } = useWindowDimensions()\n\n return (\n <View\n style={composeStyles<ViewStyle>(\n styles.segments,\n box.underLabel && !onLine\n ? marginTopOf(theme.typography.bodySmallLineHeight * fontScale)\n : undefined,\n )}\n >\n <SegmentsLineContext value>{children}</SegmentsLineContext>\n </View>\n )\n}\n\n/**\n * Hands a control outside a box the states it is drawn in, for a field that\n * draws a container of its own around the control, as SearchField's bar is.\n * The control takes its colours and the state a screen reader reads from\n * these, as it does from the box around it.\n */\nfunction FieldStates({\n children,\n isDisabled = false,\n isInvalid = false,\n isRequired = false,\n}: FieldStatesProps) {\n const states = useMemo(\n () => ({\n ...OUTSIDE_BOX,\n disabled: isDisabled,\n invalid: isInvalid,\n required: isRequired,\n }),\n [isDisabled, isInvalid, isRequired],\n )\n\n return <BoxContext value={states}>{children}</BoxContext>\n}\n\n/**\n * A field's value where it was chosen rather than typed, on the value's line\n * of a {@link FieldBox} whose `trigger` makes the box the control: body\n * large, one line cut short with an ellipsis, clearing the label at the top\n * as a control does. Hidden from a screen reader, which reads the value in\n * the trigger's name.\n *\n * `isPlaceholder` says nothing has been chosen, which takes the muted role;\n * under a floating label at rest it is not drawn until the label floats,\n * exactly as an input's placeholder is, so the two never overlap.\n *\n * On web the value opens with a space, which a browser drops at the start\n * of the line. It keeps the label and the value two words in the box's text,\n * which axe reads as one string with nothing between its parts, and holds to\n * the trigger's name, as WCAG's label in name asks; without it the label\n * runs into the value's first word.\n */\nfunction FieldValue({ children, isPlaceholder = false }: FieldValueProps) {\n const box = use(BoxContext)\n const theme = useTheme()\n const { fontScale } = useWindowDimensions()\n const role = useTypeRole('bodyLarge')\n const { colors, stateLayerOpacity, typography } = theme\n const color =\n isPlaceholder && !box.floated\n ? 'transparent'\n : box.disabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n : isPlaceholder\n ? colors.onSurfaceVariant\n : colors.onSurface\n\n return (\n <NativeText\n aria-hidden\n numberOfLines={1}\n style={composeStyles<TextStyle>(\n role,\n colorOf(color),\n box.underLabel\n ? marginTopOf(typography.bodySmallLineHeight * fontScale)\n : undefined,\n )}\n >\n {Platform.OS === 'web' ? ' ' : null}\n {children}\n </NativeText>\n )\n}\n\n/**\n * Tracks whether the control has focus, around the handlers the field was\n * given, which are called after.\n */\nfunction useFieldFocus({\n onBlur,\n onFocus,\n}: Pick<TextInputProps, 'onBlur' | 'onFocus'>) {\n const [focused, setFocused] = useState(false)\n\n return {\n focused,\n handlers: {\n onBlur: ((event) => {\n setFocused(false)\n onBlur?.(event)\n }) satisfies TextInputProps['onBlur'],\n onFocus: ((event) => {\n setFocused(true)\n onFocus?.(event)\n }) satisfies TextInputProps['onFocus'],\n },\n }\n}\n\n// What a web-only atomic live region adds, so a changed message is read whole.\n// React Native's types carry no `aria-atomic`, which React Native Web takes.\nconst ATOMIC = { 'aria-atomic': true } as const\n\n// What hides a part of the line under a field from VoiceOver and TalkBack,\n// where the control reads it out as its hint.\nconst HIDDEN = { 'aria-hidden': true } as const\n\n// What leaves the control's writing direction to the page under React Native\n// Web, which gives a TextInput `dir=\"auto\"` otherwise and so aligns a value by\n// its own script: a Latin value at the left of a right-to-left field, away\n// from its label. Null rather than left out, since left out is what it writes\n// `auto` for. React Native's types carry no `dir`.\nconst INHERITS_DIRECTION = { dir: null } as const\n\n// A box around a control of its own: the press lands on the box and moves\n// focus to the control, which is what a screen reader and a keyboard reach.\nconst NOT_A_CONTROL = { accessible: false, focusable: false } as const\n\n// The limit under React Native Web: in the document for the control to point\n// at, and drawn nowhere.\nconst NOT_DRAWN: TextStyle = { display: 'none' }\n\n// The live region with nothing in it, which takes no place in the line.\nconst OUT_OF_FLOW: ViewStyle = { position: 'absolute' }\n\nconst SHRINKS: TextStyle = { flexShrink: 1 }\n\n// How many characters' width a control holding chosen options keeps beside\n// them, in its own type's size, web's 3em.\nconst CHOSEN_ROOM = 3\n\n/**\n * A prefix or a suffix, faded in once the label has floated and out when it\n * comes back to rest, over the label's own `durationShort3`.\n */\nfunction Affix({\n children,\n floated,\n id,\n style,\n}: {\n readonly children: ReactNode\n readonly floated: boolean\n readonly id: string\n readonly style: StyleProp<TextStyle>\n}) {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const opacity = floated ? 1 : 0\n const timing = {\n duration: motion.durationShort3,\n easing: Easing.bezier(...motion.easingStandard),\n }\n const fade = useAnimatedStyle(() => {\n 'worklet'\n return {\n opacity: reduceMotion ? opacity : withTiming(opacity, timing),\n }\n })\n\n return (\n <Animated.Text\n id={id}\n style={composeStyles<AnimatedStyle<TextStyle>>(style, fade)}\n >\n {children}\n </Animated.Text>\n )\n}\n\nfunction affixPart(\n id: string,\n affix: ReactNode,\n): readonly FieldDescriptionPart[] {\n if (affix === undefined) {\n return []\n }\n\n return [\n {\n id,\n text:\n typeof affix === 'string' || typeof affix === 'number'\n ? String(affix)\n : '',\n },\n ]\n}\n\nfunction boxControlOf(\n floatingLabel: boolean,\n floated: boolean,\n disabled: boolean,\n invalid: boolean,\n required: boolean,\n underLabel: boolean,\n): BoxControl {\n return {\n disabled,\n floated,\n invalid,\n label: floatingLabel ? 'floating' : 'fixed',\n required,\n underLabel,\n }\n}\n\n/**\n * The box's label: one line, cut short with an ellipsis, moving between its\n * resting place and its floated one. Hidden from screen readers, since the\n * control is named by the same words.\n */\nfunction BoxLabel({\n children,\n floated,\n floatingLabel,\n isDisabled,\n isFocused,\n isInvalid,\n isRequired,\n variant,\n}: {\n readonly children: string\n readonly floated: boolean\n readonly floatingLabel: boolean\n readonly isDisabled: boolean\n readonly isFocused: boolean\n readonly isInvalid: boolean\n readonly isRequired: boolean\n readonly variant: FieldVariant\n}) {\n const theme = useTheme()\n const styles = fieldStylesOf(theme)\n const { fontScale } = useWindowDimensions()\n const reduceMotion = useReducedMotion()\n const large = useTypeRole('bodyLarge')\n const small = useTypeRole(floatingLabel ? 'bodySmall' : 'labelMedium')\n const { colors, motion, spacing, stateLayerOpacity, typography } = theme\n const outlined = variant === 'outlined'\n const smallRole = floatingLabel ? 'bodySmall' : 'labelMedium'\n const place: LabelPlace = floated\n ? {\n fontSize: typography[`${smallRole}Size`],\n letterSpacing: typography[`${smallRole}Tracking`],\n lineHeight: typography[`${smallRole}LineHeight`],\n top: outlined\n ? -(\n spacing.lg +\n (typography[`${smallRole}LineHeight`] * fontScale) / 2\n )\n : 0,\n }\n : {\n fontSize: typography.bodyLargeSize,\n letterSpacing: typography.bodyLargeTracking,\n lineHeight: typography.bodyLargeLineHeight,\n top: outlined ? 0 : (typography.bodySmallLineHeight * fontScale) / 2,\n }\n const color = isDisabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n : isInvalid\n ? colors.error\n : isFocused\n ? colors.primary\n : colors.onSurfaceVariant\n const timing = {\n duration: motion.durationShort3,\n easing: Easing.bezier(...motion.easingStandard),\n }\n\n const motionStyle = useAnimatedStyle(() => {\n 'worklet'\n return {\n color: reduceMotion ? color : withTiming(color, timing),\n fontSize: reduceMotion\n ? place.fontSize\n : withTiming(place.fontSize, timing),\n letterSpacing: reduceMotion\n ? place.letterSpacing\n : withTiming(place.letterSpacing, timing),\n lineHeight: reduceMotion\n ? place.lineHeight\n : withTiming(place.lineHeight, timing),\n top: reduceMotion ? place.top : withTiming(place.top, timing),\n }\n })\n\n return (\n <View\n aria-hidden\n style={composeStyles<ViewStyle>(\n styles.label,\n outlined ? styles.labelOutlined : undefined,\n )}\n >\n <Animated.Text\n numberOfLines={1}\n style={composeStyles<AnimatedStyle<TextStyle>>(\n floated ? small : large,\n outlined ? styles.labelTextOutlined : undefined,\n motionStyle,\n )}\n >\n {children}\n {isRequired ? REQUIRED_MARK : null}\n </Animated.Text>\n </View>\n )\n}\n\nfunction colorOf(color: string): TextStyle {\n return { color }\n}\n\n// The count in the locale's digits and grouping, as web writes it in the\n// provider's.\nfunction countOf(\n length: number,\n maxLength: number | undefined,\n locale: string,\n) {\n return maxLength === undefined\n ? formatCount(length, locale)\n : `${formatCount(length, locale)}/${formatCount(maxLength, locale)}`\n}\n\n/**\n * What describes a control by `parts`, as a field's control is described: the\n * ids of the elements showing them under React Native Web, and their text as\n * the hint VoiceOver and TalkBack read out on iOS and Android.\n */\nfunction descriptionOf(\n parts: readonly FieldDescriptionPart[],\n): DescribedBy | undefined {\n if (Platform.OS === 'web') {\n return parts.length === 0\n ? undefined\n : { 'aria-describedby': parts.map((part) => part.id).join(' ') }\n }\n\n const said = parts.map((part) => part.text).filter((text) => text !== '')\n\n return said.length === 0 ? undefined : { accessibilityHint: said.join(' ') }\n}\n\nfunction focusOf(control: RefObject<Focusable | null> | undefined) {\n return () => {\n control?.current?.focus()\n }\n}\n\nfunction heightOf(height: number): ViewStyle {\n return { height }\n}\n\nfunction iconStyleOf(color: string): IconStyle {\n return { color, size: ICON_SIZE }\n}\n\nfunction idsOf(id: string) {\n return {\n description: `${id}-description`,\n error: `${id}-error`,\n limit: `${id}-limit`,\n }\n}\n\n/**\n * The limit in words where there is one: the field's own, or the library's\n * in `locale`.\n */\nfunction limitOf(\n maxLength: number | undefined,\n label: string | undefined,\n locale: string | undefined,\n) {\n if (maxLength === undefined) {\n return undefined\n }\n\n return label ?? limitFor(maxLength, locale)\n}\n\nfunction marginTopOf(marginTop: number): ViewStyle {\n return { marginTop }\n}\n\nfunction minHeightOf(minHeight: number): ViewStyle {\n return { minHeight }\n}\n\nfunction minWidthOf(minWidth: number): ViewStyle {\n return { minWidth }\n}\n\n/**\n * The label's text in its floated type, out of sight, measured for the\n * outlined box's notch.\n */\nfunction NotchMeasure({\n children,\n floatingLabel,\n isRequired,\n onMeasure,\n}: {\n readonly children: string\n readonly floatingLabel: boolean\n readonly isRequired: boolean\n readonly onMeasure: (width: number) => void\n}) {\n const styles = fieldStylesOf(useTheme())\n const small = useTypeRole(floatingLabel ? 'bodySmall' : 'labelMedium')\n\n return (\n <View\n aria-hidden\n style={composeStyles<ViewStyle>(\n styles.label,\n styles.labelOutlined,\n styles.notchMeasure,\n )}\n >\n <NativeText\n numberOfLines={1}\n onLayout={widthTo(onMeasure)}\n style={composeStyles<TextStyle>(small, styles.labelTextOutlined)}\n >\n {children}\n {isRequired ? REQUIRED_MARK : null}\n </NativeText>\n </View>\n )\n}\n\nfunction numericOf(fontFamily: string | undefined): TextStyle {\n return { fontFamily, fontVariant: ['tabular-nums'] }\n}\n\n// How far an outline stretch reaches along the box before the label's place\n// begins or after it ends: the box's padding at that end, and past an icon\n// the page's 12dp, the icon and its 16dp, less the notch's own 4dp beside the\n// label.\nfunction outlineInset(spacing: ResolvedTheme['spacing'], icon: ReactNode) {\n return (\n (icon === undefined ? spacing.lg : spacing.md + ICON_SIZE + spacing.lg) -\n spacing.xs\n )\n}\n\n// The asterisk after a required field's label, which is how the text fields\n// page marks one. In the label rather than beside it, so it floats and takes\n// the label's colour with it.\nconst REQUIRED_MARK = '*'\n\n/**\n * One view drawing a field's rule in its eased colour and width, from\n * {@link useStrokeMotion}: on every side, for the outlined box's outline,\n * which the piece around it clips, and a bar's ring, or on the top alone,\n * for the filled box's indicator.\n */\nfunction FieldStroke({ color, sides, style, width }: FieldStrokeProps) {\n const stroke = useAnimatedStyle(() => {\n 'worklet'\n return sides === 'all'\n ? { borderColor: color.get(), borderWidth: width.get() }\n : { borderColor: color.get(), borderTopWidth: width.get() }\n })\n\n return (\n <Animated.View\n aria-hidden\n style={composeStyles<AnimatedStyle<ViewStyle>>(style, stroke)}\n />\n )\n}\n\n/**\n * The box as the control: a button named by the trigger and described by the\n * line under the field, which a keyboard and a screen reader reach.\n */\nfunction triggerOf({\n described = NO_PARTS,\n onPress: _onPress,\n ...trigger\n}: FieldTriggerProps) {\n return {\n ...trigger,\n ...descriptionOf(described),\n role: 'button' as const,\n }\n}\n\n/**\n * Says an error on iOS as it arrives, where a live region says nothing. An\n * error the field opened with is not said, and neither is one that has not\n * changed.\n */\nfunction useErrorAnnouncement(error: string | undefined) {\n const said = useRef(error)\n\n useEffect(() => {\n if (\n Platform.OS === 'ios' &&\n error !== undefined &&\n error !== '' &&\n error !== said.current\n ) {\n AccessibilityInfo.announceForAccessibility(error)\n }\n said.current = error\n }, [error])\n}\n\n/**\n * The rule the box draws, the filled box's indicator or the outlined box's\n * outline: its colour and its width by state.\n */\nfunction useRuleMotion(theme: ResolvedTheme, state: FieldState) {\n const { colors, stateLayerOpacity } = theme\n const width = !state.disabled && state.focused ? 2 : 1\n const color = state.disabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContainer)\n : state.focused\n ? state.invalid\n ? colors.error\n : colors.primary\n : state.hovered\n ? state.invalid\n ? colors.onErrorContainer\n : colors.onSurface\n : state.invalid\n ? colors.error\n : colors.outline\n\n return useStrokeMotion(color, width)\n}\n\n/**\n * A rule's colour and width, eased to each new pair over `durationShort2` as\n * web transitions them, and moved at once under reduced motion. Hand the\n * result to {@link FieldStroke}.\n */\nfunction useStrokeMotion(color: string, width: number): StrokeMotion {\n const { motion } = useTheme()\n const reduceMotion = useReducedMotion()\n const timing = {\n duration: motion.durationShort2,\n easing: Easing.bezier(...motion.easingStandard),\n }\n\n return {\n color: useDerivedValue<string>(() =>\n reduceMotion ? color : withTiming(color, timing),\n ),\n width: useDerivedValue<number>(() =>\n reduceMotion ? width : withTiming(width, timing),\n ),\n }\n}\n\nfunction webStateOf(box: BoxControl): undefined | WebState {\n if (Platform.OS !== 'web') {\n return undefined\n }\n\n return {\n ...(box.invalid ? { 'aria-invalid': true } : undefined),\n ...(box.required ? { 'aria-required': true } : undefined),\n }\n}\n\nfunction widthOf(width: number): ViewStyle {\n return { width }\n}\n\nfunction widthTo(onMeasure: (width: number) => void) {\n return (event: LayoutChangeEvent) => {\n onMeasure(event.nativeEvent.layout.width)\n }\n}\n\nexport { FieldChevron } from './chevron'\n\nexport {\n describedBy,\n descriptionOf,\n FieldBox,\n FieldInput,\n FieldMessage,\n FieldSegments,\n FieldStates,\n FieldStroke,\n FieldValue,\n useErrorAnnouncement,\n useFieldFocus,\n useStrokeMotion,\n}\nexport type {\n FieldBoxProps,\n FieldDescriptionPart,\n FieldInputProps,\n FieldMessageProps,\n FieldStatesProps,\n FieldStrokeProps,\n FieldTriggerProps,\n FieldValueProps,\n FieldVariant,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA6UA,MAAMqH,YAAY;AAGlB,MAAMC,cAA0B;CAC9BpE,UAAU;CACVC,SAAS;CACTC,SAAS;CACTC,OAAO;CACPC,UAAU;CACVC,YAAY;AACd;AAE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AgP,eAAqB5P,iBAAiB;CACtC,MAAA8P,SAAe;EAAAC,UACHJ,OAAMuD;EAAejD,QACvBpQ,OAAMqQ,OAAO,GAAIP,OAAMQ,cAAe;CAChD;CAGS,MAAAhK,KAAApG,sBACL6P,eAAA1K,QAAuBjF,WAAWiF,OAAO4K,MAAM,CACjD;CACO,MAAAxJ,KAAAvG,sBACL6P,eAAAzK,QAAuBlF,WAAWkF,OAAO2K,MAAM,CACjD;CAAC,IAAAvJ;CAAA,IAAAH,EAAA,OAAAD,MAAAC,EAAA,OAAAE,IAAA;EANIC,KAAA;GAAArB,OACEiB;GAENhB,OACMmB;EAGT;EAACF,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAPMG;AAON;AAGH,SAASyG,WAAWzD,KAAuC;CACzD,IAAIhK,SAASoN,OAAO,OAClB;CAGF,OAAO;EACL,GAAIpD,IAAInI,UAAU,EAAE,gBAAgB,KAAK,IAAI2E,KAAAA;EAC7C,GAAIwD,IAAIjI,WAAW,EAAE,iBAAiB,KAAK,IAAIyE,KAAAA;CACjD;AACF;AAEA,SAASsE,QAAQlF,OAA0B;CACzC,OAAO,EAAEA,MAAM;AACjB;AAEA,SAASgN,QAAQH,WAAoC;CACnD,QAAQ/C,UAA6B;EACnC+C,UAAU/C,MAAMkE,YAAYC,OAAOjO,KAAK;CAC1C;AACF"}
|
package/dist/field/styles.js
CHANGED
|
@@ -25,6 +25,10 @@ const fieldStylesOf = themedStyles(({ colors, radii, spacing, stateLayerOpacity
|
|
|
25
25
|
paddingVertical: spacing.lg
|
|
26
26
|
},
|
|
27
27
|
boxTrailing: { paddingEnd: spacing.md },
|
|
28
|
+
boxTrigger: {
|
|
29
|
+
outlineStyle: "solid",
|
|
30
|
+
outlineWidth: 0
|
|
31
|
+
},
|
|
28
32
|
column: {
|
|
29
33
|
flexGrow: 1,
|
|
30
34
|
flexShrink: 1,
|
|
@@ -141,6 +145,11 @@ const fieldStylesOf = themedStyles(({ colors, radii, spacing, stateLayerOpacity
|
|
|
141
145
|
position: "absolute",
|
|
142
146
|
start: 0,
|
|
143
147
|
top: 0
|
|
148
|
+
},
|
|
149
|
+
segments: {
|
|
150
|
+
alignItems: "center",
|
|
151
|
+
flexDirection: "row",
|
|
152
|
+
overflow: "hidden"
|
|
144
153
|
}
|
|
145
154
|
}));
|
|
146
155
|
//#endregion
|
package/dist/field/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","names":["StyleSheet","withOpacity","themedStyles","OUTLINE_REACH","fieldStylesOf","colors","radii","spacing","stateLayerOpacity","create","affixLine","alignItems","flexDirection","flexGrow","gap","xxs","box","backgroundColor","surfaceContainerHighest","borderTopEndRadius","xs","borderTopStartRadius","lg","paddingHorizontal","paddingVertical","sm","boxDisabled","onSurface","disabledContainer","boxLeading","paddingStart","md","boxOutlined","boxTrailing","paddingEnd","column","flexShrink","justifyContent","minWidth","copied","copy","opacity","pointerEvents","counter","fontVariant","marginStart","icon","alignSelf","indicator","bottom","end","position","start","input","margin","outlineStyle","outlineWidth","padding","inputMultiline","textAlignVertical","inputOverCopy","overflow","top","label","labelOutlined","labelTextOutlined","messageLine","marginTop","messageLineCollapsed","notchMeasure","outline","left","right","outlineEnd","outlineEndBox","borderRadius","outlineNotch","outlineNotchBox","outlineStart","outlineStartBox"],"sources":["../../src/field/styles.ts"],"sourcesContent":["import { StyleSheet } from 'react-native'\n\nimport { withOpacity } from '../theme/color'\nimport { themedStyles } from '../theme/styles'\n\n// The chrome's styles, apart from ./index.tsx so that file holds components\n// alone. What follows the device's text size, the box's height and the\n// label's places, is worked out where it renders, since a stylesheet is built\n// once per theme and the text size can change under it.\n//\n// The box is a row: an icon slot at either end, if the field has one, with the\n// label and the control in a column between them. The page gives the icons\n// 24dp, 12dp from the box's edge and 16dp from the text, centred in the box's\n// height, which the slot is with the box's padding the same above and below.\n\n/**\n * How far an outline piece's own box reaches past the piece that clips it, so\n * the borders and corners on that side fall outside it. A corner's radius and\n * the thickest border are enough; this is that, with room to spare.\n */\nconst OUTLINE_REACH = 8\n\nconst fieldStylesOf = themedStyles(\n ({ colors, radii, spacing, stateLayerOpacity }) =>\n StyleSheet.create({\n // The control's line, holding the affixes beside it. The 2dp is\n // Compose's padding between the two, since the page gives none.\n affixLine: {\n alignItems: 'baseline',\n flexDirection: 'row',\n flexGrow: 1,\n gap: spacing.xxs,\n },\n // The filled box: surface container highest, the page's 4dp corners at\n // the top and square at the bottom, where the indicator runs the full\n // width. 8dp above the label and below the value, and 16dp at either\n // end, or 12dp beside an icon.\n box: {\n backgroundColor: colors.surfaceContainerHighest,\n borderTopEndRadius: radii.xs,\n borderTopStartRadius: radii.xs,\n flexDirection: 'row',\n gap: spacing.lg,\n paddingHorizontal: spacing.lg,\n paddingVertical: spacing.sm,\n },\n boxDisabled: {\n backgroundColor: withOpacity(\n colors.onSurface,\n stateLayerOpacity.disabledContainer,\n ),\n },\n boxLeading: {\n paddingStart: spacing.md,\n },\n // The outlined box: no fill, and 16dp above and below the value, which\n // centres it, since the label sits on the outline rather than over it.\n boxOutlined: {\n backgroundColor: 'transparent',\n paddingVertical: spacing.lg,\n },\n boxTrailing: {\n paddingEnd: spacing.md,\n },\n // The label and the control's column, which the label is placed\n // against, so it moves past a leading icon with the text.\n column: {\n flexGrow: 1,\n flexShrink: 1,\n justifyContent: 'flex-start',\n minWidth: 0,\n },\n // A multi-line control growing under React Native Web, over the copy\n // of its text that gives it its height.\n copied: {\n flexGrow: 1,\n flexShrink: 1,\n minWidth: 0,\n },\n // The copy: the control's type and wrapping, drawn in nothing.\n copy: {\n opacity: 0,\n pointerEvents: 'none',\n },\n // The count of characters, at the end of the message line in tabular\n // figures so it does not jitter as it counts.\n counter: {\n flexShrink: 0,\n fontVariant: ['tabular-nums'],\n marginStart: 'auto',\n },\n // An icon slot, centred in the box's height whatever it holds: the\n // page's 24dp icon, or an icon button around one.\n icon: {\n alignItems: 'center',\n alignSelf: 'center',\n justifyContent: 'center',\n },\n // The filled box's active indicator: a rule across the bottom, laid\n // over the box so it thickening on focus moves nothing. A border\n // rather than a fill, since a forced palette on the web keeps a\n // border and paints over a background.\n indicator: {\n bottom: 0,\n end: 0,\n position: 'absolute',\n start: 0,\n },\n input: {\n flexGrow: 1,\n flexShrink: 1,\n margin: 0,\n minWidth: 0,\n // The box draws the focus, so a ring around the control inside it\n // would be two treatments for one focus. Solid as well as no width:\n // a browser's own ring is the `auto` style, which ignores the width.\n outlineStyle: 'solid',\n outlineWidth: 0,\n padding: 0,\n },\n // A text area's text starts at the top of its lines, where Android\n // would centre it in them.\n inputMultiline: {\n textAlignVertical: 'top',\n },\n // The growing control, laid over the copy that sizes it.\n inputOverCopy: {\n bottom: 0,\n end: 0,\n overflow: 'hidden',\n position: 'absolute',\n start: 0,\n top: 0,\n },\n // The label's place: the column's width at its top, the label at its\n // start as wide as its text, so it sits at the right end of a\n // right-to-left field whatever script it is in. One line, cut short\n // with an ellipsis where the column ends, which is before an icon at\n // either end. It takes no touches, so a press on it lands on the\n // control or the box under it.\n label: {\n alignItems: 'flex-start',\n end: 0,\n pointerEvents: 'none',\n position: 'absolute',\n start: 0,\n top: 0,\n },\n // Outlined, the label has the page's 4dp either side, which the notch\n // has too, so the two line up and the label's text starts where the\n // value does.\n labelOutlined: {\n end: -spacing.xs,\n start: -spacing.xs,\n },\n labelTextOutlined: {\n paddingHorizontal: spacing.xs,\n },\n // The line under the box: the message at the start, the counter at the\n // end, the page's 4dp under the box and 16dp between the two, indented\n // to the box's own padding so the message starts where the value does.\n messageLine: {\n flexDirection: 'row',\n gap: spacing.lg,\n marginTop: spacing.xs,\n paddingHorizontal: spacing.lg,\n },\n // The line with nothing to show: out of the flow, so the field ends at\n // its box, and still there for the live region inside it, which has to\n // be in place before the error it announces arrives.\n messageLineCollapsed: {\n marginTop: 0,\n position: 'absolute',\n },\n // The label's text in its floated type, out of sight, which is what\n // the notch takes its width from. In the outlined label's own place, so\n // a label with no room is cut short where the label is.\n notchMeasure: {\n opacity: 0,\n },\n // The outline: three pieces in a row over the whole box, the stretch\n // before the label, the notch under it and the stretch after it. Each\n // piece clips a whole outlined box of its own to the part of the\n // outline it draws, so the width and the colour are one shorthand\n // that eases, and the corners turn over with the row in a\n // right-to-left layout.\n outline: {\n bottom: 0,\n flexDirection: 'row',\n left: 0,\n pointerEvents: 'none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n outlineEnd: {\n flexGrow: 1,\n overflow: 'hidden',\n },\n outlineEndBox: {\n borderRadius: radii.xs,\n bottom: 0,\n end: 0,\n position: 'absolute',\n start: -OUTLINE_REACH,\n top: 0,\n },\n // The notch draws only the bottom of the outline, its box reaching past\n // the top and both sides.\n outlineNotch: {\n flexShrink: 1,\n overflow: 'hidden',\n },\n outlineNotchBox: {\n bottom: 0,\n end: -OUTLINE_REACH,\n position: 'absolute',\n start: -OUTLINE_REACH,\n top: -OUTLINE_REACH,\n },\n outlineStart: {\n flexShrink: 0,\n overflow: 'hidden',\n },\n outlineStartBox: {\n borderRadius: radii.xs,\n bottom: 0,\n end: -OUTLINE_REACH,\n position: 'absolute',\n start: 0,\n top: 0,\n },\n }),\n)\n\nexport { fieldStylesOf, OUTLINE_REACH }\n"],"mappings":";;;;AAsBA,MAAMI,gBAAgBF,cACnB,EAAEG,QAAQC,OAAOC,SAASC,wBACzBR,WAAWS,OAAO;CAGhBC,WAAW;EACTC,YAAY;EACZC,eAAe;EACfC,UAAU;EACVC,KAAKP,QAAQQ;CACf;CAKAC,KAAK;EACHC,iBAAiBZ,OAAOa;EACxBC,oBAAoBb,MAAMc;EAC1BC,sBAAsBf,MAAMc;EAC5BR,eAAe;EACfE,KAAKP,QAAQe;EACbC,mBAAmBhB,QAAQe;EAC3BE,iBAAiBjB,QAAQkB;CAC3B;CACAC,aAAa,EACXT,iBAAiBhB,YACfI,OAAOsB,WACPnB,kBAAkBoB,iBACpB,EACF;CACAC,YAAY,EACVC,cAA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V,KAAK;CACP;CACAW,YAAY;EACV5D,UAAU;EACVgD,UAAU;CACZ;CACAa,eAAe;EACbC,cAAcrE,MAAMc;EACpB6B,QAAQ;EACRC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPU,KAAK;CACP;CAGAc,cAAc;EACZxC,YAAY;EACZyB,UAAU;CACZ;CACAgB,iBAAiB;EACf5B,QAAQ;EACRC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPU,KAAK;CACP;CACAgB,cAAc;EACZ1C,YAAY;EACZyB,UAAU;CACZ;CACAkB,iBAAiB;EACfJ,cAAcrE,MAAMc;EACpB6B,QAAQ;EACRC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPU,KAAK;CACP;AACF,CAAC,CACL"}
|
|
1
|
+
{"version":3,"file":"styles.js","names":["StyleSheet","withOpacity","themedStyles","OUTLINE_REACH","fieldStylesOf","colors","radii","spacing","stateLayerOpacity","create","affixLine","alignItems","flexDirection","flexGrow","gap","xxs","box","backgroundColor","surfaceContainerHighest","borderTopEndRadius","xs","borderTopStartRadius","lg","paddingHorizontal","paddingVertical","sm","boxDisabled","onSurface","disabledContainer","boxLeading","paddingStart","md","boxOutlined","boxTrailing","paddingEnd","boxTrigger","outlineStyle","outlineWidth","column","flexShrink","justifyContent","minWidth","copied","copy","opacity","pointerEvents","counter","fontVariant","marginStart","icon","alignSelf","indicator","bottom","end","position","start","input","margin","padding","inputMultiline","textAlignVertical","inputOverCopy","overflow","top","label","labelOutlined","labelTextOutlined","messageLine","marginTop","messageLineCollapsed","notchMeasure","outline","left","right","outlineEnd","outlineEndBox","borderRadius","outlineNotch","outlineNotchBox","outlineStart","outlineStartBox","segments"],"sources":["../../src/field/styles.ts"],"sourcesContent":["import { StyleSheet } from 'react-native'\n\nimport { withOpacity } from '../theme/color'\nimport { themedStyles } from '../theme/styles'\n\n// The chrome's styles, apart from ./index.tsx so that file holds components\n// alone. What follows the device's text size, the box's height and the\n// label's places, is worked out where it renders, since a stylesheet is built\n// once per theme and the text size can change under it.\n//\n// The box is a row: an icon slot at either end, if the field has one, with the\n// label and the control in a column between them. The page gives the icons\n// 24dp, 12dp from the box's edge and 16dp from the text, centred in the box's\n// height, which the slot is with the box's padding the same above and below.\n\n/**\n * How far an outline piece's own box reaches past the piece that clips it, so\n * the borders and corners on that side fall outside it. A corner's radius and\n * the thickest border are enough; this is that, with room to spare.\n */\nconst OUTLINE_REACH = 8\n\nconst fieldStylesOf = themedStyles(\n ({ colors, radii, spacing, stateLayerOpacity }) =>\n StyleSheet.create({\n // The control's line, holding the affixes beside it. The 2dp is\n // Compose's padding between the two, since the page gives none.\n affixLine: {\n alignItems: 'baseline',\n flexDirection: 'row',\n flexGrow: 1,\n gap: spacing.xxs,\n },\n // The filled box: surface container highest, the page's 4dp corners at\n // the top and square at the bottom, where the indicator runs the full\n // width. 8dp above the label and below the value, and 16dp at either\n // end, or 12dp beside an icon.\n box: {\n backgroundColor: colors.surfaceContainerHighest,\n borderTopEndRadius: radii.xs,\n borderTopStartRadius: radii.xs,\n flexDirection: 'row',\n gap: spacing.lg,\n paddingHorizontal: spacing.lg,\n paddingVertical: spacing.sm,\n },\n boxDisabled: {\n backgroundColor: withOpacity(\n colors.onSurface,\n stateLayerOpacity.disabledContainer,\n ),\n },\n boxLeading: {\n paddingStart: spacing.md,\n },\n // The outlined box: no fill, and 16dp above and below the value, which\n // centres it, since the label sits on the outline rather than over it.\n boxOutlined: {\n backgroundColor: 'transparent',\n paddingVertical: spacing.lg,\n },\n boxTrailing: {\n paddingEnd: spacing.md,\n },\n // A box that is itself the control draws its focus with its indicator,\n // as a box around a control does, so a browser's own ring would be a\n // second treatment for one focus: solid and no width, as the control's.\n boxTrigger: {\n outlineStyle: 'solid',\n outlineWidth: 0,\n },\n // The label and the control's column, which the label is placed\n // against, so it moves past a leading icon with the text.\n column: {\n flexGrow: 1,\n flexShrink: 1,\n justifyContent: 'flex-start',\n minWidth: 0,\n },\n // A multi-line control growing under React Native Web, over the copy\n // of its text that gives it its height.\n copied: {\n flexGrow: 1,\n flexShrink: 1,\n minWidth: 0,\n },\n // The copy: the control's type and wrapping, drawn in nothing.\n copy: {\n opacity: 0,\n pointerEvents: 'none',\n },\n // The count of characters, at the end of the message line in tabular\n // figures so it does not jitter as it counts.\n counter: {\n flexShrink: 0,\n fontVariant: ['tabular-nums'],\n marginStart: 'auto',\n },\n // An icon slot, centred in the box's height whatever it holds: the\n // page's 24dp icon, or an icon button around one.\n icon: {\n alignItems: 'center',\n alignSelf: 'center',\n justifyContent: 'center',\n },\n // The filled box's active indicator: a rule across the bottom, laid\n // over the box so it thickening on focus moves nothing. A border\n // rather than a fill, since a forced palette on the web keeps a\n // border and paints over a background.\n indicator: {\n bottom: 0,\n end: 0,\n position: 'absolute',\n start: 0,\n },\n input: {\n flexGrow: 1,\n flexShrink: 1,\n margin: 0,\n minWidth: 0,\n // The box draws the focus, so a ring around the control inside it\n // would be two treatments for one focus. Solid as well as no width:\n // a browser's own ring is the `auto` style, which ignores the width.\n outlineStyle: 'solid',\n outlineWidth: 0,\n padding: 0,\n },\n // A text area's text starts at the top of its lines, where Android\n // would centre it in them.\n inputMultiline: {\n textAlignVertical: 'top',\n },\n // The growing control, laid over the copy that sizes it.\n inputOverCopy: {\n bottom: 0,\n end: 0,\n overflow: 'hidden',\n position: 'absolute',\n start: 0,\n top: 0,\n },\n // The label's place: the column's width at its top, the label at its\n // start as wide as its text, so it sits at the right end of a\n // right-to-left field whatever script it is in. One line, cut short\n // with an ellipsis where the column ends, which is before an icon at\n // either end. It takes no touches, so a press on it lands on the\n // control or the box under it.\n label: {\n alignItems: 'flex-start',\n end: 0,\n pointerEvents: 'none',\n position: 'absolute',\n start: 0,\n top: 0,\n },\n // Outlined, the label has the page's 4dp either side, which the notch\n // has too, so the two line up and the label's text starts where the\n // value does.\n labelOutlined: {\n end: -spacing.xs,\n start: -spacing.xs,\n },\n labelTextOutlined: {\n paddingHorizontal: spacing.xs,\n },\n // The line under the box: the message at the start, the counter at the\n // end, the page's 4dp under the box and 16dp between the two, indented\n // to the box's own padding so the message starts where the value does.\n messageLine: {\n flexDirection: 'row',\n gap: spacing.lg,\n marginTop: spacing.xs,\n paddingHorizontal: spacing.lg,\n },\n // The line with nothing to show: out of the flow, so the field ends at\n // its box, and still there for the live region inside it, which has to\n // be in place before the error it announces arrives.\n messageLineCollapsed: {\n marginTop: 0,\n position: 'absolute',\n },\n // The label's text in its floated type, out of sight, which is what\n // the notch takes its width from. In the outlined label's own place, so\n // a label with no room is cut short where the label is.\n notchMeasure: {\n opacity: 0,\n },\n // The outline: three pieces in a row over the whole box, the stretch\n // before the label, the notch under it and the stretch after it. Each\n // piece clips a whole outlined box of its own to the part of the\n // outline it draws, so the width and the colour are one shorthand\n // that eases, and the corners turn over with the row in a\n // right-to-left layout.\n outline: {\n bottom: 0,\n flexDirection: 'row',\n left: 0,\n pointerEvents: 'none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n outlineEnd: {\n flexGrow: 1,\n overflow: 'hidden',\n },\n outlineEndBox: {\n borderRadius: radii.xs,\n bottom: 0,\n end: 0,\n position: 'absolute',\n start: -OUTLINE_REACH,\n top: 0,\n },\n // The notch draws only the bottom of the outline, its box reaching past\n // the top and both sides.\n outlineNotch: {\n flexShrink: 1,\n overflow: 'hidden',\n },\n outlineNotchBox: {\n bottom: 0,\n end: -OUTLINE_REACH,\n position: 'absolute',\n start: -OUTLINE_REACH,\n top: -OUTLINE_REACH,\n },\n outlineStart: {\n flexShrink: 0,\n overflow: 'hidden',\n },\n outlineStartBox: {\n borderRadius: radii.xs,\n bottom: 0,\n end: -OUTLINE_REACH,\n position: 'absolute',\n start: 0,\n top: 0,\n },\n // A date or a time's segments on the value's line, in a row. Clipped\n // at the box rather than wrapped, since every segment on the line is\n // somewhere to type, so none of it can be drawn as though it were not\n // there.\n segments: {\n alignItems: 'center',\n flexDirection: 'row',\n overflow: 'hidden',\n },\n }),\n)\n\nexport { fieldStylesOf, OUTLINE_REACH }\n"],"mappings":";;;;A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;EACZ0C,KAAK;EACLR,eAAe;EACfS,UAAU;EACVC,OAAO;EACPQ,KAAK;CACP;CAIAE,eAAe;EACbZ,KAAK,CAAC9C,QAAQa;EACdmC,OAAO,CAAChD,QAAQa;CAClB;CACA8C,mBAAmB,EACjB3C,mBAAmBhB,QAAQa,GAC7B;CAIA+C,aAAa;EACXvD,eAAe;EACfE,KAAKP,QAAQe;EACb8C,WAAW7D,QAAQa;EACnBG,mBAAmBhB,QAAQe;CAC7B;CAIA+C,sBAAsB;EACpBD,WAAW;EACXd,UAAU;CACZ;CAIAgB,cAAc,EACZ1B,SAAS,EACX;CAOA2B,SAAS;EACPnB,QAAQ;EACRxC,eAAe;EACf4D,MAAM;EACN3B,eAAe;EACfS,UAAU;EACVmB,OAAO;EACPV,KAAK;CACP;CACAW,YAAY;EACV7D,UAAU;EACViD,UAAU;CACZ;CACAa,eAAe;EACbC,cAActE,MAAMc;EACpBgC,QAAQ;EACRC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPQ,KAAK;CACP;CAGAc,cAAc;EACZtC,YAAY;EACZuB,UAAU;CACZ;CACAgB,iBAAiB;EACf1B,QAAQ;EACRC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPQ,KAAK;CACP;CACAgB,cAAc;EACZxC,YAAY;EACZuB,UAAU;CACZ;CACAkB,iBAAiB;EACfJ,cAActE,MAAMc;EACpBgC,QAAQ;EACRC,KAAK;EACLC,UAAU;EACVC,OAAO;EACPQ,KAAK;CACP;CAKAkB,UAAU;EACRtE,YAAY;EACZC,eAAe;EACfkD,UAAU;CACZ;AACF,CAAC,CACL"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/files/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A file a person picked: what it is called, how big it is and what it is,
|
|
4
|
+
* as web's `File` says, and where it is, which a call site reads it or
|
|
5
|
+
* uploads it from. On iOS and Android that is a `file://` URI in the app's
|
|
6
|
+
* cache, a copy the chooser made, and under React Native Web an object URL.
|
|
7
|
+
*/
|
|
8
|
+
type PickedFile = {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
/** Its size in bytes, where the platform says. */
|
|
11
|
+
readonly size: number | undefined;
|
|
12
|
+
/** Its MIME type, or an empty string where the platform does not say, as on web. */
|
|
13
|
+
readonly type: string;
|
|
14
|
+
readonly uri: string;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export type { PickedFile };
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
//#region src/files/index.ts
|
|
2
|
+
let documentPicker;
|
|
3
|
+
let imagePicker;
|
|
4
|
+
function fromCamera(asset) {
|
|
5
|
+
return {
|
|
6
|
+
name: asset.fileName ?? asset.uri.split("/").at(-1) ?? asset.uri,
|
|
7
|
+
size: asset.fileSize,
|
|
8
|
+
type: asset.mimeType ?? "",
|
|
9
|
+
uri: asset.uri
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function fromDocument(asset) {
|
|
13
|
+
return {
|
|
14
|
+
name: asset.name,
|
|
15
|
+
size: asset.size,
|
|
16
|
+
type: asset.mimeType ?? "",
|
|
17
|
+
uri: asset.uri
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async function importDocumentPicker() {
|
|
21
|
+
try {
|
|
22
|
+
return await import(
|
|
23
|
+
/* @vite-ignore */
|
|
24
|
+
"expo-document-picker"
|
|
25
|
+
);
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function importImagePicker() {
|
|
31
|
+
try {
|
|
32
|
+
return await import(
|
|
33
|
+
/* @vite-ignore */
|
|
34
|
+
"expo-image-picker"
|
|
35
|
+
);
|
|
36
|
+
} catch {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async function loadDocumentPicker() {
|
|
41
|
+
documentPicker ??= importDocumentPicker();
|
|
42
|
+
return documentPicker;
|
|
43
|
+
}
|
|
44
|
+
async function loadImagePicker() {
|
|
45
|
+
imagePicker ??= importImagePicker();
|
|
46
|
+
return imagePicker;
|
|
47
|
+
}
|
|
48
|
+
function mediaTypesOf(accepted) {
|
|
49
|
+
const videos = accepted.some((type) => type.startsWith("video/"));
|
|
50
|
+
return [...!videos || accepted.some((type) => type.startsWith("image/")) ? ["images"] : [], ...videos ? ["videos"] : []];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Opens the system's chooser, or its camera for `defaultCamera`, and settles
|
|
54
|
+
* on the files picked, or on `null` when the person backed out. A camera the
|
|
55
|
+
* person will not let the app use is backing out too.
|
|
56
|
+
*
|
|
57
|
+
* It rejects, naming the package, when the one it needs is not installed:
|
|
58
|
+
* expo-document-picker for the chooser, expo-image-picker for the camera.
|
|
59
|
+
*/
|
|
60
|
+
async function pickFiles(options) {
|
|
61
|
+
const accepted = options.acceptedFileTypes ?? [];
|
|
62
|
+
if (options.defaultCamera !== void 0) {
|
|
63
|
+
const camera = await loadImagePicker();
|
|
64
|
+
if (camera === null) throw new Error("Taking a photo needs expo-image-picker, which is not installed");
|
|
65
|
+
if (!(await camera.requestCameraPermissionsAsync()).granted) return null;
|
|
66
|
+
const shot = await camera.launchCameraAsync({
|
|
67
|
+
cameraType: options.defaultCamera === "user" ? "front" : "back",
|
|
68
|
+
mediaTypes: mediaTypesOf(accepted)
|
|
69
|
+
});
|
|
70
|
+
return shot.canceled ? null : shot.assets.map(fromCamera);
|
|
71
|
+
}
|
|
72
|
+
const picker = await loadDocumentPicker();
|
|
73
|
+
if (picker === null) throw new Error("Picking a file needs expo-document-picker, which is not installed");
|
|
74
|
+
const picked = await picker.getDocumentAsync({
|
|
75
|
+
base64: false,
|
|
76
|
+
multiple: options.allowsMultiple ?? false,
|
|
77
|
+
type: accepted.length === 0 ? "*/*" : [...accepted]
|
|
78
|
+
});
|
|
79
|
+
return picked.canceled ? null : picked.assets.map(fromDocument);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Picks as `pickFiles` does and hands what was picked to `then`, saying
|
|
83
|
+
* nothing when the person backed out. A failure, a missing package among
|
|
84
|
+
* them, is written to the console, where a missing package is a mistake in
|
|
85
|
+
* the app's setup rather than something the person can do anything about.
|
|
86
|
+
*/
|
|
87
|
+
async function pickThen(options, then) {
|
|
88
|
+
let files;
|
|
89
|
+
try {
|
|
90
|
+
files = await pickFiles(options);
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.error(error);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (files !== null) then(files);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Starts importing the picker the options open, so that a press finds it
|
|
99
|
+
* there. A component that picks calls it once it mounts.
|
|
100
|
+
*/
|
|
101
|
+
function preparePicker(options) {
|
|
102
|
+
options.defaultCamera === void 0 ? loadDocumentPicker() : loadImagePicker();
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { pickFiles, pickThen, preparePicker };
|
|
106
|
+
|
|
107
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["DocumentPickerAsset","ImagePickerAsset","DocumentPicker","ImagePicker","PickedFile","name","size","type","uri","PickOptions","acceptedFileTypes","allowsMultiple","defaultCamera","documentPicker","Promise","imagePicker","fromCamera","asset","fileName","split","at","fileSize","mimeType","fromDocument","importDocumentPicker","importImagePicker","loadDocumentPicker","loadImagePicker","mediaTypesOf","accepted","videos","some","startsWith","images","const","pickFiles","options","undefined","camera","Error","requestCameraPermissionsAsync","granted","shot","launchCameraAsync","cameraType","mediaTypes","canceled","assets","map","picker","picked","getDocumentAsync","base64","multiple","length","pickThen","then","files","error","console","preparePicker"],"sources":["../../src/files/index.ts"],"sourcesContent":["import type { DocumentPickerAsset } from 'expo-document-picker'\nimport type { ImagePickerAsset } from 'expo-image-picker'\n\ntype DocumentPicker = typeof import('expo-document-picker')\n\ntype ImagePicker = typeof import('expo-image-picker')\n\n/**\n * A file a person picked: what it is called, how big it is and what it is,\n * as web's `File` says, and where it is, which a call site reads it or\n * uploads it from. On iOS and Android that is a `file://` URI in the app's\n * cache, a copy the chooser made, and under React Native Web an object URL.\n */\ntype PickedFile = {\n readonly name: string\n /** Its size in bytes, where the platform says. */\n readonly size: number | undefined\n /** Its MIME type, or an empty string where the platform does not say, as on web. */\n readonly type: string\n readonly uri: string\n}\n/** What the chooser is asked for, in web's FileTrigger's words. */\ntype PickOptions = {\n /** The MIME types the chooser offers, such as `image/png` or `image/*`. Every type when left out. */\n readonly acceptedFileTypes?: readonly string[] | undefined\n /** Whether more than one file can be picked. */\n readonly allowsMultiple?: boolean | undefined\n /**\n * Opens the camera rather than the chooser, facing away from the person\n * for `environment` or towards them for `user`, as web's `capture` does.\n */\n readonly defaultCamera?: 'environment' | 'user' | undefined\n}\n\n// The two pickers are optional peers, so each is imported where its absence\n// can be caught, as src/clipboard imports expo-clipboard: Metro takes an\n// import inside a `try` as optional and bundles an app without it, which it\n// would not for an import wrapped any other way. Each is imported once, and\n// first when a component that picks mounts, so a press finds it loaded:\n// under React Native Web a chooser opens only while the press that asked for\n// it still counts as one.\nlet documentPicker: Promise<DocumentPicker | null> | undefined\nlet imagePicker: Promise<ImagePicker | null> | undefined\n\n// A photo the camera took is named by the platform where it names one, and\n// by the last part of its URI where it does not.\nfunction fromCamera(asset: ImagePickerAsset): PickedFile {\n return {\n name: asset.fileName ?? asset.uri.split('/').at(-1) ?? asset.uri,\n size: asset.fileSize,\n type: asset.mimeType ?? '',\n uri: asset.uri,\n }\n}\n\nfunction fromDocument(asset: DocumentPickerAsset): PickedFile {\n return {\n name: asset.name,\n size: asset.size,\n type: asset.mimeType ?? '',\n uri: asset.uri,\n }\n}\n\nasync function importDocumentPicker(): Promise<DocumentPicker | null> {\n try {\n return await import(/* @vite-ignore */ 'expo-document-picker')\n } catch {\n return null\n }\n}\n\nasync function importImagePicker(): Promise<ImagePicker | null> {\n try {\n return await import(/* @vite-ignore */ 'expo-image-picker')\n } catch {\n return null\n }\n}\n\nasync function loadDocumentPicker() {\n documentPicker ??= importDocumentPicker()\n return documentPicker\n}\n\nasync function loadImagePicker() {\n imagePicker ??= importImagePicker()\n return imagePicker\n}\n\n// The camera takes photos and videos alone, so it is asked for videos when\n// the accepted types name one and for photos unless they name only videos.\nfunction mediaTypesOf(accepted: readonly string[]) {\n const videos = accepted.some((type) => type.startsWith('video/'))\n const images = !videos || accepted.some((type) => type.startsWith('image/'))\n\n return [\n ...(images ? (['images'] as const) : []),\n ...(videos ? (['videos'] as const) : []),\n ]\n}\n\n/**\n * Opens the system's chooser, or its camera for `defaultCamera`, and settles\n * on the files picked, or on `null` when the person backed out. A camera the\n * person will not let the app use is backing out too.\n *\n * It rejects, naming the package, when the one it needs is not installed:\n * expo-document-picker for the chooser, expo-image-picker for the camera.\n */\nasync function pickFiles(\n options: PickOptions,\n): Promise<null | readonly PickedFile[]> {\n const accepted = options.acceptedFileTypes ?? []\n\n if (options.defaultCamera !== undefined) {\n const camera = await loadImagePicker()\n\n if (camera === null) {\n throw new Error(\n 'Taking a photo needs expo-image-picker, which is not installed',\n )\n }\n if (!(await camera.requestCameraPermissionsAsync()).granted) {\n return null\n }\n\n const shot = await camera.launchCameraAsync({\n cameraType: options.defaultCamera === 'user' ? 'front' : 'back',\n mediaTypes: mediaTypesOf(accepted),\n })\n\n return shot.canceled ? null : shot.assets.map(fromCamera)\n }\n\n const picker = await loadDocumentPicker()\n\n if (picker === null) {\n throw new Error(\n 'Picking a file needs expo-document-picker, which is not installed',\n )\n }\n\n // base64 is off, since the package otherwise reads every file picked into\n // memory, which nothing here asks of it.\n const picked = await picker.getDocumentAsync({\n base64: false,\n multiple: options.allowsMultiple ?? false,\n type: accepted.length === 0 ? '*/*' : [...accepted],\n })\n\n return picked.canceled ? null : picked.assets.map(fromDocument)\n}\n\n/**\n * Picks as `pickFiles` does and hands what was picked to `then`, saying\n * nothing when the person backed out. A failure, a missing package among\n * them, is written to the console, where a missing package is a mistake in\n * the app's setup rather than something the person can do anything about.\n */\nasync function pickThen(\n options: PickOptions,\n then: (files: readonly PickedFile[]) => void,\n): Promise<void> {\n let files: null | readonly PickedFile[]\n\n try {\n files = await pickFiles(options)\n } catch (error) {\n console.error(error)\n return\n }\n if (files !== null) {\n then(files)\n }\n}\n\n/**\n * Starts importing the picker the options open, so that a press finds it\n * there. A component that picks calls it once it mounts.\n */\nfunction preparePicker(options: PickOptions) {\n void (options.defaultCamera === undefined\n ? loadDocumentPicker()\n : loadImagePicker())\n}\n\nexport { pickFiles, pickThen, preparePicker }\nexport type { PickedFile, PickOptions }\n"],"mappings":";AAyCA,IAAIa;AACJ,IAAIE;AAIJ,SAASC,WAAWC,OAAqC;CACvD,OAAO;EACLZ,MAAMY,MAAMC,YAAYD,MAAMT,IAAIW,MAAM,GAAG,CAAC,CAACC,GAAG,EAAE,KAAKH,MAAMT;EAC7DF,MAAMW,MAAMI;EACZd,MAAMU,MAAMK,YAAY;EACxBd,KAAKS,MAAMT;CACb;AACF;AAEA,SAASe,aAAaN,OAAwC;CAC5D,OAAO;EACLZ,MAAMY,MAAMZ;EACZC,MAAMW,MAAMX;EACZC,MAAMU,MAAMK,YAAY;EACxBd,KAAKS,MAAMT;CACb;AACF;AAEA,eAAegB,uBAAuD;CACpE,IAAI;EACF,OAAO,MAAM;;GAA0B;;CACzC,QAAQ;EACN,OAAO;CACT;AACF;AAEA,eAAeC,oBAAiD;CAC9D,IAAI;EACF,OAAO,MAAM;;GAA0B;;CACzC,QAAQ;EACN,OAAO;CACT;AACF;AAEA,eAAeC,qBAAqB;CAClCb,mBAAmBW,qBAAqB;CACxC,OAAOX;AACT;AAEA,eAAec,kBAAkB;CAC/BZ,gBAAgBU,kBAAkB;CAClC,OAAOV;AACT;AAIA,SAASa,aAAaC,UAA6B;CACjD,MAAMC,SAASD,SAASE,MAAMxB,SAASA,KAAKyB,WAAW,QAAQ,CAAC;CAGhE,OAA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