@kanso-labs/react-native-kanso-ui 0.2.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/button/index.d.ts +8 -0
  2. package/dist/button/index.js +38 -26
  3. package/dist/button/index.js.map +1 -1
  4. package/dist/button/slots.js +7 -0
  5. package/dist/button/slots.js.map +1 -0
  6. package/dist/components/avatar/index.d.ts +2 -2
  7. package/dist/components/avatar/index.js.map +1 -1
  8. package/dist/components/button/index.d.ts +3 -3
  9. package/dist/components/button/index.js +115 -109
  10. package/dist/components/button/index.js.map +1 -1
  11. package/dist/components/card/index.d.ts +2 -2
  12. package/dist/components/card/index.js.map +1 -1
  13. package/dist/components/checkbox/index.d.ts +2 -2
  14. package/dist/components/checkbox/index.js.map +1 -1
  15. package/dist/components/chip/index.d.ts +2 -2
  16. package/dist/components/chip/index.js.map +1 -1
  17. package/dist/components/chip-group/index.d.ts +3 -3
  18. package/dist/components/chip-group/index.js.map +1 -1
  19. package/dist/components/copy-field/index.d.ts +2 -2
  20. package/dist/components/copy-field/index.js.map +1 -1
  21. package/dist/components/dialog/index.d.ts +131 -0
  22. package/dist/components/dialog/index.js +861 -0
  23. package/dist/components/dialog/index.js.map +1 -0
  24. package/dist/components/icon-button/index.d.ts +3 -3
  25. package/dist/components/icon-button/index.js +128 -122
  26. package/dist/components/icon-button/index.js.map +1 -1
  27. package/dist/components/link/index.js +1 -1
  28. package/dist/components/link/index.js.map +1 -1
  29. package/dist/components/meter/index.d.ts +2 -2
  30. package/dist/components/meter/index.js.map +1 -1
  31. package/dist/components/number-field/index.d.ts +3 -3
  32. package/dist/components/number-field/index.js.map +1 -1
  33. package/dist/components/product-icon/index.d.ts +2 -2
  34. package/dist/components/product-icon/index.js.map +1 -1
  35. package/dist/components/progress-indicator/index.d.ts +2 -2
  36. package/dist/components/progress-indicator/index.js.map +1 -1
  37. package/dist/components/radio-group/index.d.ts +3 -3
  38. package/dist/components/radio-group/index.js.map +1 -1
  39. package/dist/components/search-field/index.d.ts +3 -3
  40. package/dist/components/search-field/index.js.map +1 -1
  41. package/dist/components/segmented-button/index.d.ts +3 -3
  42. package/dist/components/segmented-button/index.js.map +1 -1
  43. package/dist/components/snackbar/index.d.ts +2 -2
  44. package/dist/components/snackbar/index.js.map +1 -1
  45. package/dist/components/switch/index.d.ts +2 -2
  46. package/dist/components/switch/index.js.map +1 -1
  47. package/dist/components/text-field/index.d.ts +3 -3
  48. package/dist/components/text-field/index.js.map +1 -1
  49. package/dist/field/index.d.ts +1 -1
  50. package/dist/field/index.js.map +1 -1
  51. package/dist/form/index.d.ts +1 -1
  52. package/dist/form/index.js.map +1 -1
  53. package/dist/index.d.ts +2 -1
  54. package/dist/index.js +3 -2
  55. package/dist/mark/index.d.ts +1 -1
  56. package/dist/mark/index.js.map +1 -1
  57. package/dist/overlay/host.js.map +1 -1
  58. package/dist/press/index.js +59 -60
  59. package/dist/press/index.js.map +1 -1
  60. package/package.json +14 -14
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["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","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","described","numeric","prefix","ref","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","counterFormat","Intl","NumberFormat","describedBy","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","descriptionOf","affixPart","webStateOf","OS","INHERITS_DIRECTION","input","numericOf","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","format","parts","map","part","join","said","filter","accessibilityHint","current","focus","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 { 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 { 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<null | TextInput>\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 | 'placeholderTextColor'\n | 'selectionColor'\n | 'style'\n | 'underlineColorAndroid'\n> & {\n /** What describes the control, after its prefix and suffix. */\n readonly described?: readonly FieldDescriptionPart[]\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<TextInput>\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\nlet counterFormat: Intl.NumberFormat | undefined\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 maxLength,\n }: Pick<\n FieldMessageProps,\n 'characterLimitLabel' | 'description' | 'error' | 'maxLength'\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)\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 */\nfunction FieldInput({\n described = NO_PARTS,\n numeric = false,\n prefix,\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\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 placeholderTextColor={muted}\n selectionColor={caret}\n style={composeStyles<TextStyle>(\n role,\n styles.input,\n colorOf(content),\n numeric ? numericOf(mono) : undefined,\n minHeightOf(typography.bodyLargeLineHeight * fontScale),\n affixed ? undefined : clearance,\n )}\n underlineColorAndroid=\"transparent\"\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 limit = limitOf(maxLength, characterLimitLabel)\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)}\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: ViewProps = { 'aria-hidden': true }\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 device's digits and grouping, as web writes it in the\n// reader's locale. One formatter, since the count changes on every keystroke.\nfunction countOf(length: number, maxLength: number | undefined) {\n counterFormat ??= new Intl.NumberFormat()\n\n return maxLength === undefined\n ? counterFormat.format(length)\n : `${counterFormat.format(length)}/${counterFormat.format(maxLength)}`\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<null | TextInput>) {\n return () => {\n control.current?.focus()\n }\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 English, which\n * an app in another language replaces through `characterLimitLabel`.\n */\nfunction limitOf(maxLength: number | undefined, label: string | undefined) {\n if (maxLength === undefined) {\n return undefined\n }\n\n return (\n label ??\n (maxLength === 1\n ? 'Up to 1 character'\n : `Up to ${String(maxLength)} characters`)\n )\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// Says an error on iOS as it arrives. An error the field opened with is not\n// said, and neither is one that has not changed.\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 useFieldFocus,\n useStrokeMotion,\n}\nexport type {\n FieldBoxProps,\n FieldDescriptionPart,\n FieldInputProps,\n FieldMessageProps,\n FieldStatesProps,\n FieldStrokeProps,\n FieldVariant,\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqQA,MAAMmG,YAAY;AAGlB,MAAMC,cAA0B;CAC9BxD,UAAU;CACVC,SAAS;CACTC,SAAS;CACTC,OAAO;CACPC,UAAU;CACVC,YAAY;AACd;AAEA,MAAMoD,aAAa1F,cAA0ByF,WAAW;AAExD,MAAME,WAA4C,CAAA;AAElD,IAAIC;;;;;;;AAQJ,SAASG,YACPvC,IACA,EACEW,qBACAC,aACAC,OACAE,aAK+B;CACjC,MAAMyB,MAAMC,MAAMzC,EAAE;CACpB,MAAM0C,UACJ7B,UAAU8B,KAAAA,IACN;EAAE3C,IAAIwC,IAAI5B;EAAaX,MAAMW,eAAe;CAAG,IAC/C;EAAEZ,IAAIwC,IAAI3B;EAAOZ,MAAMY;CAAM;CACnC,MAAM+B,QAAQC,QAAQ9B,WAAWJ,mBAAmB;CAEpD,OAAO,CACL,GAAI+B,QAAQzC,SAAS,KAAK,CAAA,IAAK,CAACyC,OAAO,GACvC,GAAIE,UAAUD,KAAAA,IAAY,CAAA,IAAK,CAAC;EAAE3C,IAAIwC,IAAII;EAAO3C,MAAM2C;CAAM,CAAC,CAAE;AAEpE;;;;;;AAOA,SAAAE,SAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAkB,MAAA,EAAA/D,UAAAC,SAAAC,KAAAC,eAAA6D,IAAA5D,YAAA6D,IAAA5D,WAAA6D,IAAA5D,WAAA6D,IAAA5D,aAAA6D,IAAA5D,YAAA6D,IAA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C,MAAMgE,YAAYC,OAAOjN,KAAK;CAC1C;AACF"}
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","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","described","numeric","prefix","ref","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","counterFormat","Intl","NumberFormat","describedBy","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","descriptionOf","affixPart","webStateOf","OS","INHERITS_DIRECTION","input","numericOf","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","format","parts","map","part","join","said","filter","accessibilityHint","current","focus","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 { 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 | 'placeholderTextColor'\n | 'selectionColor'\n | 'style'\n | 'underlineColorAndroid'\n> & {\n /** What describes the control, after its prefix and suffix. */\n readonly described?: readonly FieldDescriptionPart[]\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 /** 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\nlet counterFormat: Intl.NumberFormat | undefined\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 maxLength,\n }: Pick<\n FieldMessageProps,\n 'characterLimitLabel' | 'description' | 'error' | 'maxLength'\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)\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 */\nfunction FieldInput({\n described = NO_PARTS,\n numeric = false,\n prefix,\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\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 placeholderTextColor={muted}\n selectionColor={caret}\n style={composeStyles<TextStyle>(\n role,\n styles.input,\n colorOf(content),\n numeric ? numericOf(mono) : undefined,\n minHeightOf(typography.bodyLargeLineHeight * fontScale),\n affixed ? undefined : clearance,\n )}\n underlineColorAndroid=\"transparent\"\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 limit = limitOf(maxLength, characterLimitLabel)\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)}\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 device's digits and grouping, as web writes it in the\n// reader's locale. One formatter, since the count changes on every keystroke.\nfunction countOf(length: number, maxLength: number | undefined) {\n counterFormat ??= new Intl.NumberFormat()\n\n return maxLength === undefined\n ? counterFormat.format(length)\n : `${counterFormat.format(length)}/${counterFormat.format(maxLength)}`\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 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 English, which\n * an app in another language replaces through `characterLimitLabel`.\n */\nfunction limitOf(maxLength: number | undefined, label: string | undefined) {\n if (maxLength === undefined) {\n return undefined\n }\n\n return (\n label ??\n (maxLength === 1\n ? 'Up to 1 character'\n : `Up to ${String(maxLength)} characters`)\n )\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// Says an error on iOS as it arrives. An error the field opened with is not\n// said, and neither is one that has not changed.\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 useFieldFocus,\n useStrokeMotion,\n}\nexport type {\n FieldBoxProps,\n FieldDescriptionPart,\n FieldInputProps,\n FieldMessageProps,\n FieldStatesProps,\n FieldStrokeProps,\n FieldVariant,\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqQA,MAAMoG,YAAY;AAGlB,MAAMC,cAA0B;CAC9BxD,UAAU;CACVC,SAAS;CACTC,SAAS;CACTC,OAAO;CACPC,UAAU;CACVC,YAAY;AACd;AAEA,MAAMoD,aAAa1F,cAA0ByF,WAAW;AAExD,MAAME,WAA4C,CAAA;AAElD,IAAIC;;;;;;;AAQ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1J,QAAuBjE,WAAWiE,OAAO4J,MAAM,CACjD;CACO,MAAAvI,KAAAxF,sBACL6N,eAAAzJ,QAAuBlE,WAAWkE,OAAO2J,MAAM,CACjD;CAAC,IAAAtI;CAAA,IAAAH,EAAA,OAAAD,MAAAC,EAAA,OAAAE,IAAA;EANIC,KAAA;GAAAtB,OACEkB;GAENjB,OACMoB;EAGT;EAACF,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAAA,KAAAH,EAAA;CAAA,OAPMG;AAON;AAGH,SAASiG,WAAWlD,KAAuC;CACzD,IAAIhJ,SAASmM,OAAO,OAClB;CAGF,OAAO;EACL,GAAInD,IAAIvH,UAAU,EAAE,gBAAgB,KAAK,IAAIgE,KAAAA;EAC7C,GAAIuD,IAAIrH,WAAW,EAAE,iBAAiB,KAAK,IAAI8D,KAAAA;CACjD;AACF;AAEA,SAASoE,QAAQjF,OAA0B;CACzC,OAAO,EAAEA,MAAM;AACjB;AAEA,SAASiM,QAAQH,WAAoC;CACnD,QAAQ9C,UAA6B;EACnC8C,UAAU9C,MAAMgE,YAAYC,OAAOjN,KAAK;CAC1C;AACF"}
@@ -1,5 +1,5 @@
1
1
  import { TextInput } from "react-native";
2
- import "react";
2
+ import { ComponentRef } from "react";
3
3
  //#region src/form/index.d.ts
4
4
  /**
5
5
  * `aria` shows a field's error as soon as the field says so, and lets the
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["RefObject","TextInput","createContext","use","useEffect","useId","useRef","useState","FieldValidationOptions","control","error","isDisabled","isEmpty","isReadOnly","isRequired","name","submitted","validate","value","T","ValidationResult","FormEntry","blocks","focus","show","submits","FormRegistry","entries","remove","id","set","entry","FormState","registry","requestSubmit","validationBehavior","FormValidationBehavior","validationErrors","ValidationErrors","FormValues","Readonly","Record","ValidationError","FIELD_VALIDATION_BEHAVIOR","REQUIRED_ERROR","NO_ERRORS","NO_MESSAGES","FormContext","createRegistry","fields","Map","values","delete","focusOf","current","lineOf","messages","length","undefined","join","messagesOf","result","submitOf","onSubmit","blocking","filter","first","at","Object","fromEntries","flatMap","useFieldValidation","t0","$","_c","form","behavior","serverErrors","clearedFrom","setClearedFrom","showing","setShowing","edited","native","barred","server","client","own","shown","t1","t2","t3","Symbol","for","t4","t5","t6","t7","t8","t9","t10","t11","t12","onBlur","onEdit","useInsideForm","_c"],"sources":["../../src/form/index.ts"],"sourcesContent":["import type { RefObject } from 'react'\nimport type { TextInput } from 'react-native'\n\nimport { createContext, use, useEffect, useId, useRef, useState } from 'react'\n\n// What a Form tells the fields inside it, and what each field tells it back,\n// as React Aria's Form and its fields do through context on web. The form\n// hands down how its fields validate and the errors a server sent back, by\n// field name. Each field registers with the form around it while it is\n// mounted, in the order the tree mounts them, which is the order they are\n// drawn in, and the form reads that list when it is submitted: the values by\n// name, and under `native` which fields hold it back and which of them takes\n// focus.\n\ntype FieldValidationOptions<T> = {\n /** The control a failed native submission focuses. */\n readonly control: RefObject<null | TextInput>\n /** The field's own error, which wins over anything the form says. */\n readonly error: string | undefined\n readonly isDisabled: boolean\n /** Whether the value is what a required field must not be left as. */\n readonly isEmpty: boolean\n readonly isReadOnly: boolean\n readonly isRequired: boolean\n readonly name: string | undefined\n /** The value as the form submits it. */\n readonly submitted: string\n readonly validate: ((value: T) => ValidationResult) | undefined\n readonly value: T\n}\n\n/** What a field tells the form it is in, as of its last render. */\ntype FormEntry = {\n /** Whether the field holds a native submission back. */\n readonly blocks: boolean\n /** Moves focus to the field's control. */\n readonly focus: () => void\n /** Shows the field's own error, once a submission it held back is tried. */\n readonly show: () => void\n /** The name and value the field submits, where it submits one. */\n readonly submits: readonly [string, string] | undefined\n}\n\ntype FormRegistry = {\n readonly entries: () => readonly FormEntry[]\n readonly remove: (id: string) => void\n readonly set: (id: string, entry: FormEntry) => void\n}\n\ntype FormState = {\n readonly registry: FormRegistry\n readonly requestSubmit: () => void\n readonly validationBehavior: FormValidationBehavior\n readonly validationErrors: ValidationErrors\n}\n\n/**\n * `aria` shows a field's error as soon as the field says so, and lets the\n * form submit regardless. `native` holds the form back while a field in it is\n * required and empty, or rejected by its `validate`, and shows that field's\n * error once a submission is tried.\n */\ntype FormValidationBehavior = 'aria' | 'native'\n\n/** The values a form submits, as strings by each field's `name`. */\ntype FormValues = Readonly<Record<string, string>>\n\n/** A field's problem in words: one message, or several read as one line. */\ntype ValidationError = readonly string[] | string\n\n/** Errors keyed by each field's `name`, such as a server's answer. */\ntype ValidationErrors = Readonly<Record<string, ValidationError>>\n\n/**\n * What a field's `validate` returns for a value: its problem in words, or\n * `true`, `null` or `undefined` where there is none, as on web.\n */\ntype ValidationResult = null | true | undefined | ValidationError\n\n/**\n * What a field outside a form, and a form told nothing, validates by. The\n * library shows its own message under a field, so an error shows as the\n * field reports it rather than once a submission is tried.\n */\nconst FIELD_VALIDATION_BEHAVIOR: FormValidationBehavior = 'aria'\n\n/** The error a required field left empty shows under `native`. */\nconst REQUIRED_ERROR = 'Fill out this field.'\n\nconst NO_ERRORS: ValidationErrors = {}\n\nconst NO_MESSAGES: readonly string[] = []\n\nconst FormContext = createContext<FormState | null>(null)\n\n/**\n * The fields a form holds, in the order they registered. A field that is\n * already in it keeps its place as it reports again, so the order is the one\n * they mounted in.\n */\nfunction createRegistry(): FormRegistry {\n const fields = new Map<string, FormEntry>()\n\n return {\n entries: () => [...fields.values()],\n remove: (id) => {\n fields.delete(id)\n },\n set: (id, entry) => {\n fields.set(id, entry)\n },\n }\n}\n\n// Focuses a field's control, through the ref the field holds it in.\nfunction focusOf(control: RefObject<null | TextInput>) {\n return () => {\n control.current?.focus()\n }\n}\n\n// One line of a field's messages, or nothing where there are none.\nfunction lineOf(messages: readonly string[]): string | undefined {\n return messages.length === 0 ? undefined : messages.join(' ')\n}\n\n// A validation result as the messages it holds.\nfunction messagesOf(result: ValidationResult): readonly string[] {\n if (typeof result === 'string') {\n return result === '' ? NO_MESSAGES : [result]\n }\n\n return result === null || result === undefined || result === true\n ? NO_MESSAGES\n : result\n}\n\n/**\n * Submits a form: under `native`, holds it back while any field blocks,\n * showing each blocking field's error and focusing the first, and otherwise\n * hands `onSubmit` every named field's value.\n */\nfunction submitOf(\n registry: FormRegistry,\n validationBehavior: FormValidationBehavior,\n onSubmit: ((values: FormValues) => void) | undefined,\n) {\n return () => {\n const entries = registry.entries()\n\n if (validationBehavior === 'native') {\n const blocking = entries.filter((entry) => entry.blocks)\n const first = blocking.at(0)\n\n if (first !== undefined) {\n for (const entry of blocking) {\n entry.show()\n }\n first.focus()\n return\n }\n }\n\n onSubmit?.(\n Object.fromEntries(\n entries.flatMap((entry) =>\n entry.submits === undefined ? [] : [entry.submits],\n ),\n ),\n )\n }\n}\n\n/**\n * A field's validation, as React Aria's is on web, and its place in the form\n * around it. It hands back the error the field shows, and two handlers the\n * field calls: `onEdit` as its value is edited, and `onBlur` as its control\n * loses focus.\n *\n * The error is the field's own `error` where it has one. Otherwise it is the\n * server's, from the form's `validationErrors` under the field's `name`,\n * until the field is edited; a new `validationErrors` from the form shows it\n * again. Otherwise, under `aria`, it is what `validate` says about the value\n * as it changes.\n *\n * Under `native` that last one, or the required field's own error when it is\n * empty, is shown late and taken back early, as on web: once a submission it\n * holds back is tried, or once the control loses focus after an edit, and no\n * longer once the value is right, so a field shows nothing new in the middle\n * of being typed in. A disabled or read-only field holds nothing back, and a\n * disabled one submits nothing, as a browser bars both from validation and\n * leaves a disabled input out of what a form submits.\n */\nfunction useFieldValidation<T>({\n control,\n error,\n isDisabled,\n isEmpty,\n isReadOnly,\n isRequired,\n name,\n submitted,\n validate,\n value,\n}: FieldValidationOptions<T>) {\n const form = use(FormContext)\n const id = useId()\n const behavior = form?.validationBehavior ?? FIELD_VALIDATION_BEHAVIOR\n const serverErrors = form?.validationErrors ?? NO_ERRORS\n const registry = form?.registry\n // The errors object the field was edited under. Its server error stays\n // cleared until the form is handed a new one.\n const [clearedFrom, setClearedFrom] = useState<null | ValidationErrors>(null)\n const [showing, setShowing] = useState(false)\n // Whether the value has been edited since the control last lost focus,\n // which is when a browser fires `change`, and so when React Aria commits.\n const edited = useRef(false)\n const native = behavior === 'native'\n const barred = isDisabled || isReadOnly\n const server =\n name === undefined || clearedFrom === serverErrors\n ? NO_MESSAGES\n : messagesOf(serverErrors[name])\n const client =\n validate === undefined ? NO_MESSAGES : messagesOf(validate(value))\n const own =\n client.length > 0\n ? client\n : native && isRequired && isEmpty && !barred\n ? [REQUIRED_ERROR]\n : NO_MESSAGES\n\n // Taken back as soon as the value is right, however it got there.\n if (showing && own.length === 0) {\n setShowing(false)\n }\n\n const shown = native ? (showing ? own : NO_MESSAGES) : client\n const entry: FormEntry = {\n blocks:\n !barred && (error !== undefined || server.length > 0 || own.length > 0),\n focus: focusOf(control),\n show: () => {\n setShowing(true)\n },\n submits: isDisabled || name === undefined ? undefined : [name, submitted],\n }\n\n // Reported after every render, so the form reads what the field shows.\n useEffect(() => {\n registry?.set(id, entry)\n })\n\n useEffect(\n () => () => {\n registry?.remove(id)\n },\n [id, registry],\n )\n\n return {\n error: error ?? lineOf(server) ?? lineOf(shown),\n onBlur: () => {\n if (edited.current) {\n edited.current = false\n setClearedFrom(serverErrors)\n setShowing(native)\n }\n },\n onEdit: () => {\n edited.current = true\n setClearedFrom(serverErrors)\n },\n }\n}\n\n/** Whether the field is inside a form, which keeps its message line drawn. */\nfunction useInsideForm() {\n return use(FormContext) !== null\n}\n\nexport {\n createRegistry,\n FIELD_VALIDATION_BEHAVIOR,\n FormContext,\n submitOf,\n useFieldValidation,\n useInsideForm,\n}\nexport type {\n FormValidationBehavior,\n FormValues,\n ValidationError,\n ValidationErrors,\n ValidationResult,\n}\n"],"mappings":";;;;;;;;AAoFA,MAAM2C,4BAAoD;;AAG1D,MAAMC,iBAAiB;AAEvB,MAAMC,YAA8B,CAAC;AAErC,MAAMC,cAAiC,CAAA;AAEvC,MAAMC,cAAc7C,cAAgC,IAAI;;;;;;AAOxD,SAAS8C,iBAA+B;CACtC,MAAMC,yBAAS,IAAIC,IAAuB;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iC,KAAK;CAAC,IAAAY;CAAA,IAAA3B,EAAA,QAAAU,UAAAV,EAAA,QAAAI,cAAA;EACvCuB,YAAA;GACN,IAAIlB,OAAM5B,SAAQ;IAChB4B,OAAM5B,UAAW;IACjByB,eAAeF,YAAY;IAC3BI,WAAWE,MAAM;GAAC;EACnB;EACFV,EAAA,MAAAU;EAAAV,EAAA,MAAAI;EAAAJ,EAAA,MAAA2B;CAAA,OAAAA,MAAA3B,EAAA;CAAA,IAAA4B;CAAA,IAAA5B,EAAA,QAAAI,cAAA;EACOwB,YAAA;GACNnB,OAAM5B,UAAW;GACjByB,eAAeF,YAAY;EAAC;EAC7BJ,EAAA,MAAAI;EAAAJ,EAAA,MAAA4B;CAAA,OAAAA,MAAA5B,EAAA;CAAA,IAAA6B;CAAA,IAAA7B,EAAA,QAAA2B,OAAA3B,EAAA,QAAA4B,OAAA5B,EAAA,QAAA0B,IAAA;EAZIG,MAAA;GAAA5F,OACEyF;GAAwCI,QACvCH;GAMPI,QACOH;EAIV;EAAC5B,EAAA,MAAA2B;EAAA3B,EAAA,MAAA4B;EAAA5B,EAAA,MAAA0B;EAAA1B,EAAA,MAAA6B;CAAA,OAAAA,MAAA7B,EAAA;CAAA,OAbM6B;AAaN;;AAIH,SAASG,gBAAgB;CACvB,OAAOtG,IAAI4C,WAAW,MAAM;AAC9B"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","RefObject","TextInput","createContext","use","useEffect","useId","useRef","useState","FieldValidationOptions","control","error","isDisabled","isEmpty","isReadOnly","isRequired","name","submitted","validate","value","T","ValidationResult","FormEntry","blocks","focus","show","submits","FormRegistry","entries","remove","id","set","entry","FormState","registry","requestSubmit","validationBehavior","FormValidationBehavior","validationErrors","ValidationErrors","FormValues","Readonly","Record","ValidationError","FIELD_VALIDATION_BEHAVIOR","REQUIRED_ERROR","NO_ERRORS","NO_MESSAGES","FormContext","createRegistry","fields","Map","values","delete","focusOf","current","lineOf","messages","length","undefined","join","messagesOf","result","submitOf","onSubmit","blocking","filter","first","at","Object","fromEntries","flatMap","useFieldValidation","t0","$","_c","form","behavior","serverErrors","clearedFrom","setClearedFrom","showing","setShowing","edited","native","barred","server","client","own","shown","t1","t2","t3","Symbol","for","t4","t5","t6","t7","t8","t9","t10","t11","t12","onBlur","onEdit","useInsideForm","_c"],"sources":["../../src/form/index.ts"],"sourcesContent":["import type { ComponentRef, RefObject } from 'react'\nimport type { TextInput } from 'react-native'\n\nimport { createContext, use, useEffect, useId, useRef, useState } from 'react'\n\n// What a Form tells the fields inside it, and what each field tells it back,\n// as React Aria's Form and its fields do through context on web. The form\n// hands down how its fields validate and the errors a server sent back, by\n// field name. Each field registers with the form around it while it is\n// mounted, in the order the tree mounts them, which is the order they are\n// drawn in, and the form reads that list when it is submitted: the values by\n// name, and under `native` which fields hold it back and which of them takes\n// focus.\n\ntype FieldValidationOptions<T> = {\n /** The control a failed native submission focuses. */\n readonly control: RefObject<ComponentRef<typeof TextInput> | null>\n /** The field's own error, which wins over anything the form says. */\n readonly error: string | undefined\n readonly isDisabled: boolean\n /** Whether the value is what a required field must not be left as. */\n readonly isEmpty: boolean\n readonly isReadOnly: boolean\n readonly isRequired: boolean\n readonly name: string | undefined\n /** The value as the form submits it. */\n readonly submitted: string\n readonly validate: ((value: T) => ValidationResult) | undefined\n readonly value: T\n}\n\n/** What a field tells the form it is in, as of its last render. */\ntype FormEntry = {\n /** Whether the field holds a native submission back. */\n readonly blocks: boolean\n /** Moves focus to the field's control. */\n readonly focus: () => void\n /** Shows the field's own error, once a submission it held back is tried. */\n readonly show: () => void\n /** The name and value the field submits, where it submits one. */\n readonly submits: readonly [string, string] | undefined\n}\n\ntype FormRegistry = {\n readonly entries: () => readonly FormEntry[]\n readonly remove: (id: string) => void\n readonly set: (id: string, entry: FormEntry) => void\n}\n\ntype FormState = {\n readonly registry: FormRegistry\n readonly requestSubmit: () => void\n readonly validationBehavior: FormValidationBehavior\n readonly validationErrors: ValidationErrors\n}\n\n/**\n * `aria` shows a field's error as soon as the field says so, and lets the\n * form submit regardless. `native` holds the form back while a field in it is\n * required and empty, or rejected by its `validate`, and shows that field's\n * error once a submission is tried.\n */\ntype FormValidationBehavior = 'aria' | 'native'\n\n/** The values a form submits, as strings by each field's `name`. */\ntype FormValues = Readonly<Record<string, string>>\n\n/** A field's problem in words: one message, or several read as one line. */\ntype ValidationError = readonly string[] | string\n\n/** Errors keyed by each field's `name`, such as a server's answer. */\ntype ValidationErrors = Readonly<Record<string, ValidationError>>\n\n/**\n * What a field's `validate` returns for a value: its problem in words, or\n * `true`, `null` or `undefined` where there is none, as on web.\n */\ntype ValidationResult = null | true | undefined | ValidationError\n\n/**\n * What a field outside a form, and a form told nothing, validates by. The\n * library shows its own message under a field, so an error shows as the\n * field reports it rather than once a submission is tried.\n */\nconst FIELD_VALIDATION_BEHAVIOR: FormValidationBehavior = 'aria'\n\n/** The error a required field left empty shows under `native`. */\nconst REQUIRED_ERROR = 'Fill out this field.'\n\nconst NO_ERRORS: ValidationErrors = {}\n\nconst NO_MESSAGES: readonly string[] = []\n\nconst FormContext = createContext<FormState | null>(null)\n\n/**\n * The fields a form holds, in the order they registered. A field that is\n * already in it keeps its place as it reports again, so the order is the one\n * they mounted in.\n */\nfunction createRegistry(): FormRegistry {\n const fields = new Map<string, FormEntry>()\n\n return {\n entries: () => [...fields.values()],\n remove: (id) => {\n fields.delete(id)\n },\n set: (id, entry) => {\n fields.set(id, entry)\n },\n }\n}\n\n// Focuses a field's control, through the ref the field holds it in.\nfunction focusOf(control: RefObject<ComponentRef<typeof TextInput> | null>) {\n return () => {\n control.current?.focus()\n }\n}\n\n// One line of a field's messages, or nothing where there are none.\nfunction lineOf(messages: readonly string[]): string | undefined {\n return messages.length === 0 ? undefined : messages.join(' ')\n}\n\n// A validation result as the messages it holds.\nfunction messagesOf(result: ValidationResult): readonly string[] {\n if (typeof result === 'string') {\n return result === '' ? NO_MESSAGES : [result]\n }\n\n return result === null || result === undefined || result === true\n ? NO_MESSAGES\n : result\n}\n\n/**\n * Submits a form: under `native`, holds it back while any field blocks,\n * showing each blocking field's error and focusing the first, and otherwise\n * hands `onSubmit` every named field's value.\n */\nfunction submitOf(\n registry: FormRegistry,\n validationBehavior: FormValidationBehavior,\n onSubmit: ((values: FormValues) => void) | undefined,\n) {\n return () => {\n const entries = registry.entries()\n\n if (validationBehavior === 'native') {\n const blocking = entries.filter((entry) => entry.blocks)\n const first = blocking.at(0)\n\n if (first !== undefined) {\n for (const entry of blocking) {\n entry.show()\n }\n first.focus()\n return\n }\n }\n\n onSubmit?.(\n Object.fromEntries(\n entries.flatMap((entry) =>\n entry.submits === undefined ? [] : [entry.submits],\n ),\n ),\n )\n }\n}\n\n/**\n * A field's validation, as React Aria's is on web, and its place in the form\n * around it. It hands back the error the field shows, and two handlers the\n * field calls: `onEdit` as its value is edited, and `onBlur` as its control\n * loses focus.\n *\n * The error is the field's own `error` where it has one. Otherwise it is the\n * server's, from the form's `validationErrors` under the field's `name`,\n * until the field is edited; a new `validationErrors` from the form shows it\n * again. Otherwise, under `aria`, it is what `validate` says about the value\n * as it changes.\n *\n * Under `native` that last one, or the required field's own error when it is\n * empty, is shown late and taken back early, as on web: once a submission it\n * holds back is tried, or once the control loses focus after an edit, and no\n * longer once the value is right, so a field shows nothing new in the middle\n * of being typed in. A disabled or read-only field holds nothing back, and a\n * disabled one submits nothing, as a browser bars both from validation and\n * leaves a disabled input out of what a form submits.\n */\nfunction useFieldValidation<T>({\n control,\n error,\n isDisabled,\n isEmpty,\n isReadOnly,\n isRequired,\n name,\n submitted,\n validate,\n value,\n}: FieldValidationOptions<T>) {\n const form = use(FormContext)\n const id = useId()\n const behavior = form?.validationBehavior ?? FIELD_VALIDATION_BEHAVIOR\n const serverErrors = form?.validationErrors ?? NO_ERRORS\n const registry = form?.registry\n // The errors object the field was edited under. Its server error stays\n // cleared until the form is handed a new one.\n const [clearedFrom, setClearedFrom] = useState<null | ValidationErrors>(null)\n const [showing, setShowing] = useState(false)\n // Whether the value has been edited since the control last lost focus,\n // which is when a browser fires `change`, and so when React Aria commits.\n const edited = useRef(false)\n const native = behavior === 'native'\n const barred = isDisabled || isReadOnly\n const server =\n name === undefined || clearedFrom === serverErrors\n ? NO_MESSAGES\n : messagesOf(serverErrors[name])\n const client =\n validate === undefined ? NO_MESSAGES : messagesOf(validate(value))\n const own =\n client.length > 0\n ? client\n : native && isRequired && isEmpty && !barred\n ? [REQUIRED_ERROR]\n : NO_MESSAGES\n\n // Taken back as soon as the value is right, however it got there.\n if (showing && own.length === 0) {\n setShowing(false)\n }\n\n const shown = native ? (showing ? own : NO_MESSAGES) : client\n const entry: FormEntry = {\n blocks:\n !barred && (error !== undefined || server.length > 0 || own.length > 0),\n focus: focusOf(control),\n show: () => {\n setShowing(true)\n },\n submits: isDisabled || name === undefined ? undefined : [name, submitted],\n }\n\n // Reported after every render, so the form reads what the field shows.\n useEffect(() => {\n registry?.set(id, entry)\n })\n\n useEffect(\n () => () => {\n registry?.remove(id)\n },\n [id, registry],\n )\n\n return {\n error: error ?? lineOf(server) ?? lineOf(shown),\n onBlur: () => {\n if (edited.current) {\n edited.current = false\n setClearedFrom(serverErrors)\n setShowing(native)\n }\n },\n onEdit: () => {\n edited.current = true\n setClearedFrom(serverErrors)\n },\n }\n}\n\n/** Whether the field is inside a form, which keeps its message line drawn. */\nfunction useInsideForm() {\n return use(FormContext) !== null\n}\n\nexport {\n createRegistry,\n FIELD_VALIDATION_BEHAVIOR,\n FormContext,\n submitOf,\n useFieldValidation,\n useInsideForm,\n}\nexport type {\n FormValidationBehavior,\n FormValues,\n ValidationError,\n ValidationErrors,\n ValidationResult,\n}\n"],"mappings":";;;;;;;;AAoFA,MAAM4C,4BAAoD;;AAG1D,MAAMC,iBAAiB;AAEvB,MAAMC,YAA8B,CAAC;AAErC,MAAMC,cAAiC,CAAA;AAEvC,MAAMC,cAAc7C,cAAgC,IAAI;;;;;;AAOxD,SAAS8C,iBAA+B;CACtC,MAAMC,yBAAS,IAAIC,IAAuB;CAE1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KAAK;CAAC,IAAAY;CAAA,IAAA3B,EAAA,QAAAU,UAAAV,EAAA,QAAAI,cAAA;EACvCuB,YAAA;GACN,IAAIlB,OAAM5B,SAAQ;IAChB4B,OAAM5B,UAAW;IACjByB,eAAeF,YAAY;IAC3BI,WAAWE,MAAM;GAAC;EACnB;EACFV,EAAA,MAAAU;EAAAV,EAAA,MAAAI;EAAAJ,EAAA,MAAA2B;CAAA,OAAAA,MAAA3B,EAAA;CAAA,IAAA4B;CAAA,IAAA5B,EAAA,QAAAI,cAAA;EACOwB,YAAA;GACNnB,OAAM5B,UAAW;GACjByB,eAAeF,YAAY;EAAC;EAC7BJ,EAAA,MAAAI;EAAAJ,EAAA,MAAA4B;CAAA,OAAAA,MAAA5B,EAAA;CAAA,IAAA6B;CAAA,IAAA7B,EAAA,QAAA2B,OAAA3B,EAAA,QAAA4B,OAAA5B,EAAA,QAAA0B,IAAA;EAZIG,MAAA;GAAA5F,OACEyF;GAAwCI,QACvCH;GAMPI,QACOH;EAIV;EAAC5B,EAAA,MAAA2B;EAAA3B,EAAA,MAAA4B;EAAA5B,EAAA,MAAA0B;EAAA1B,EAAA,MAAA6B;CAAA,OAAAA,MAAA7B,EAAA;CAAA,OAbM6B;AAaN;;AAIH,SAASG,gBAAgB;CACvB,OAAOtG,IAAI4C,WAAW,MAAM;AAC9B"}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ import { Chip, ChipActionProps, ChipFilterProps, ChipProps, ChipVariant } from "
6
6
  import { ChipGroup, ChipGroupChip, ChipGroupChipProps, ChipGroupProps } from "./components/chip-group/index.js";
7
7
  import { CopyField, CopyFieldProps } from "./components/copy-field/index.js";
8
8
  import { Currency, CurrencyProps, CurrencySignDisplay, CurrencyTone } from "./components/currency/index.js";
9
+ import { Dialog, DialogBody, DialogBodyProps, DialogContent, DialogContentProps, DialogFooter, DialogHeader, DialogPartProps, DialogProps, DialogTitle, DialogTitleProps } from "./components/dialog/index.js";
9
10
  import { Form, FormHandle, FormProps } from "./components/form/index.js";
10
11
  import { IconButton, IconButtonProps, IconButtonSize, IconButtonVariant } from "./components/icon-button/index.js";
11
12
  import { Link, LinkProps, LinkTone, LinkUnderline } from "./components/link/index.js";
@@ -31,4 +32,4 @@ import { RouterProvider, RouterProviderProps } from "./router/index.js";
31
32
  import { ThemeScope, ThemeScopeProps } from "./theme-scope.js";
32
33
  import { ResolvedTheme, useTheme } from "./theme/scope.js";
33
34
  import { Key, Selection } from "react-stately";
34
- export { Avatar, type AvatarProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, type FieldVariant, Form, type FormHandle, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, Meter, type MeterProps, type MeterTone, NumberField, type NumberFieldProps, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps, type ResolvedTheme, RouterProvider, type RouterProviderProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, Snackbar, type SnackbarAction, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Text, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, type TypeRole, type WindowSizeClass, useIconStyle, useTheme, useWindowSizeClass };
35
+ export { Avatar, type AvatarProps, Button, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Card, type CardProps, type CardVariant, Checkbox, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, Dialog, DialogBody, type DialogBodyProps, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogPartProps, type DialogProps, DialogTitle, type DialogTitleProps, type FieldVariant, Form, type FormHandle, type FormProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type IconStyle, type Key, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, Meter, type MeterProps, type MeterTone, NumberField, type NumberFieldProps, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupOrientation, type RadioGroupProps, type RadioProps, type ResolvedTheme, RouterProvider, type RouterProviderProps, SearchField, type SearchFieldProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, Snackbar, type SnackbarAction, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, Switch, type SwitchProps, Text, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, type TypeRole, type WindowSizeClass, useIconStyle, useTheme, useWindowSizeClass };
package/dist/index.js CHANGED
@@ -11,6 +11,8 @@ import { Chip } from "./components/chip/index.js";
11
11
  import { ChipGroup, ChipGroupChip } from "./components/chip-group/index.js";
12
12
  import { CopyField } from "./components/copy-field/index.js";
13
13
  import { Currency } from "./components/currency/index.js";
14
+ import { useWindowSizeClass } from "./hooks/useWindowSizeClass.js";
15
+ import { Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle } from "./components/dialog/index.js";
14
16
  import { Form } from "./components/form/index.js";
15
17
  import { IconButton } from "./components/icon-button/index.js";
16
18
  import { Link } from "./components/link/index.js";
@@ -21,10 +23,9 @@ import { Radio, RadioGroup } from "./components/radio-group/index.js";
21
23
  import { SearchField } from "./components/search-field/index.js";
22
24
  import { SegmentedButton, SegmentedButtonSegment } from "./components/segmented-button/index.js";
23
25
  import { Separator } from "./components/separator/index.js";
24
- import { useWindowSizeClass } from "./hooks/useWindowSizeClass.js";
25
26
  import { Snackbar } from "./components/snackbar/index.js";
26
27
  import { Stack } from "./components/stack/index.js";
27
28
  import { Switch } from "./components/switch/index.js";
28
29
  import { TextField } from "./components/text-field/index.js";
29
30
  import { ThemeScope } from "./theme-scope.js";
30
- export { Avatar, Button, Card, Checkbox, Chip, ChipGroup, ChipGroupChip, CopyField, Currency, Form, IconButton, Link, Meter, NumberField, ProductIcon, ProgressIndicator, Radio, RadioGroup, RouterProvider, SearchField, SegmentedButton, SegmentedButtonSegment, Separator, Snackbar, Stack, Switch, Text, TextField, ThemeScope, useIconStyle, useTheme, useWindowSizeClass };
31
+ export { Avatar, Button, Card, Checkbox, Chip, ChipGroup, ChipGroupChip, CopyField, Currency, Dialog, DialogBody, DialogContent, DialogFooter, DialogHeader, DialogTitle, Form, IconButton, Link, Meter, NumberField, ProductIcon, ProgressIndicator, Radio, RadioGroup, RouterProvider, SearchField, SegmentedButton, SegmentedButtonSegment, Separator, Snackbar, Stack, Switch, Text, TextField, ThemeScope, useIconStyle, useTheme, useWindowSizeClass };
@@ -1,6 +1,6 @@
1
1
  import "./styles.js";
2
2
  import { ImageProps, StyleProp, View, ViewProps, ViewStyle } from "react-native";
3
- import { Ref } from "react";
3
+ import { ComponentRef, Ref } from "react";
4
4
  //#region src/mark/index.d.ts
5
5
  /** The native props a picture's own `Image` takes, as Avatar and ProductIcon take them. */
6
6
  type MarkImageProps = Pick<ImageProps, 'crossOrigin' | 'fadeDuration' | 'progressiveRenderingEnabled' | 'referrerPolicy' | 'resizeMethod'>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Ref","ImageProps","ImageSourcePropType","ImageStyle","StyleProp","TextStyle","ViewProps","ViewStyle","Image","Text","NativeText","View","ResolvedTheme","MarkSize","MarkTone","PersonGlyph","useTheme","composeStyles","useTypeRole","useImageLoadingStatus","initialOfThing","initialsOfPerson","DIAMETERS","GLYPH_SHARE","initialsStylesOf","markStyles","markStylesOf","MarkImageProps","Pick","MarkProps","Omit","decorative","imgProps","kind","KINDS","name","ref","showPersonIcon","size","src","style","tone","person","initials","resizeMode","shape","tintsFallback","thing","const","CONTENT","Readonly","Record","negative","positive","primary","secondary","tertiary","Mark","t0","$","_c","props","t1","t2","undefined","theme","label","handlersFor","previous","status","T0","initialsNode","t3","t4","t5","t6","t7","t8","own","text","t9","fallback","named","trim","showsPicture","t10","colors","initialsText","base","sourceOf","image","imagePending","t11","uri","_c","NativeText"],"sources":["../../src/mark/index.tsx"],"sourcesContent":["import type { Ref } from 'react'\nimport type {\n ImageProps,\n ImageSourcePropType,\n ImageStyle,\n StyleProp,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport { Image, Text as NativeText, View } from 'react-native'\n\nimport type { ResolvedTheme } from '../theme/scope'\nimport type { MarkSize, MarkTone } from './styles'\n\nimport { PersonGlyph } from '../glyphs'\nimport { useTheme } from '../theme/scope'\nimport { composeStyles } from '../theme/styles'\nimport { useTypeRole } from '../typography/roles'\nimport { useImageLoadingStatus } from './image'\nimport { initialOfThing, initialsOfPerson } from './initials'\nimport {\n DIAMETERS,\n GLYPH_SHARE,\n initialsStylesOf,\n markStyles,\n markStylesOf,\n} from './styles'\n\n/** The native props a picture's own `Image` takes, as Avatar and ProductIcon take them. */\ntype MarkImageProps = Pick<\n ImageProps,\n | 'crossOrigin'\n | 'fadeDuration'\n | 'progressiveRenderingEnabled'\n | 'referrerPolicy'\n | 'resizeMethod'\n>\n\ntype MarkProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * Hides the mark from screen readers, for one beside the name it stands\n * for, which would otherwise be announced twice.\n */\n readonly decorative?: boolean\n /** Props for the picture's own `Image`. */\n readonly imgProps?: MarkImageProps\n /** A person, which Avatar draws, or anything else, which ProductIcon does. */\n readonly kind: keyof typeof KINDS\n /** Supplies the fallback's initials, and the accessible name unless decorative. */\n readonly name: string\n readonly ref?: Ref<View>\n /**\n * Whether a person with no initials to take, a blank name, draws the\n * anonymous person, or an empty disc, as a loading skeleton wants.\n */\n readonly showPersonIcon?: boolean\n readonly size: MarkSize\n /** A picture to show in place of the initials once it has loaded. */\n readonly src?: string\n readonly style?: StyleProp<ViewStyle>\n readonly tone: MarkTone\n}\n\n// What each kind of mark is drawn as. The header of `./styles` says why the\n// two differ where they do; everything not in this table is the same for\n// both.\nconst KINDS = {\n person: {\n initials: initialsOfPerson,\n resizeMode: 'cover',\n shape: 'circle',\n tintsFallback: false,\n },\n thing: {\n initials: initialOfThing,\n resizeMode: 'contain',\n shape: 'square',\n tintsFallback: true,\n },\n} as const\n\n// The role each tone draws the anonymous person in.\nconst CONTENT: Readonly<Record<MarkTone, keyof ResolvedTheme['colors']>> = {\n negative: 'onNegativeContainer',\n positive: 'onPositiveContainer',\n primary: 'onPrimaryContainer',\n secondary: 'onSecondaryContainer',\n tertiary: 'onTertiaryContainer',\n}\n\n/**\n * The small identity mark Avatar and ProductIcon both render: a picture once\n * it has loaded, initials until then or if it fails, named for whoever or\n * whatever it stands for. Shared rather than written into each, so a fix to\n * one reaches both, as on web. Not a component of the library's own, and not\n * exported from the package.\n */\nfunction Mark({\n decorative = false,\n imgProps,\n kind,\n name,\n showPersonIcon = true,\n size,\n src,\n style,\n tone,\n ...props\n}: MarkProps) {\n const { initials, resizeMode, shape, tintsFallback } = KINDS[kind]\n const theme = useTheme()\n const label = useTypeRole('labelLarge')\n const { handlersFor, previous, status } = useImageLoadingStatus(src)\n\n const own = markStylesOf(theme)\n const text = initialsStylesOf(theme)\n const fallback = initials(name)\n\n // Announced as an image named for whoever or whatever it stands for,\n // rather than letting the initials be read: \"AL\" is not what anyone means\n // to announce. A blank name names nothing, so the mark is then a plain\n // view, which a screen reader passes over rather than reading as an image\n // with no name. A decorative mark is hidden outright, its initials with it.\n const named = !decorative && name.trim() !== ''\n\n // The initials while no picture shows: before the first loads, and once\n // one fails. They are left out under a picture rather than kept beneath\n // it, since a letterboxed logo would show them through its transparent\n // parts.\n const showsPicture = status === 'loaded' || previous !== undefined\n let initialsNode = null\n if (!showsPicture && kind === 'person' && fallback === '') {\n // A person with no initials to take, a blank name or one still loading,\n // draws Material Design's anonymous person in the tone's on-container\n // colour. The glyph hides itself from screen readers.\n initialsNode = showPersonIcon ? (\n <PersonGlyph\n color={theme.colors[CONTENT[tone]]}\n size={DIAMETERS[size] * GLYPH_SHARE}\n />\n ) : null\n } else if (!showsPicture) {\n // The initials keep their size whatever the device's text size asks\n // for: the mark is a fixed size and clips what runs past it, and the\n // name a screen reader reads is what they stand for.\n const initialsText = (\n <NativeText\n allowFontScaling={false}\n style={composeStyles<TextStyle>(label, text[size], text[tone])}\n >\n {fallback}\n </NativeText>\n )\n initialsNode = tintsFallback ? (\n <View style={composeStyles<ViewStyle>(markStyles.fallback, own[tone])}>\n {initialsText}\n </View>\n ) : (\n initialsText\n )\n }\n\n return (\n <View\n accessible={named ? true : undefined}\n aria-hidden={decorative ? true : undefined}\n aria-label={named ? name : undefined}\n role={named ? 'img' : undefined}\n {...props}\n style={composeStyles<ViewStyle>(\n own.base,\n own[shape],\n markStyles[size],\n tintsFallback ? undefined : own[tone],\n style,\n )}\n >\n {initialsNode}\n {/* Two pictures at most, laid over the initials. The one last loaded\n stays while a new `src` loads, and the new one is drawn on top of\n it from the start, hidden until it has loaded. Neither is inverted\n by the iOS Smart Invert setting, which is meant for interface\n colours rather than pictures. */}\n {previous === undefined ? null : (\n <Image\n accessibilityIgnoresInvertColors\n key={previous}\n resizeMode={resizeMode}\n source={sourceOf(previous)}\n style={markStyles.image}\n />\n )}\n {src === undefined || status === 'error' ? null : (\n <Image\n accessibilityIgnoresInvertColors\n key={src}\n {...imgProps}\n {...handlersFor(src)}\n resizeMode={resizeMode}\n source={sourceOf(src)}\n style={composeStyles<ImageStyle>(\n markStyles.image,\n status === 'loaded' ? undefined : markStyles.imagePending,\n )}\n />\n )}\n </View>\n )\n}\n\n// An address as the source `Image` takes. The compiler keeps the one it made\n// for as long as the address is the same, so a re-render hands the image the\n// object it already had.\nfunction sourceOf(uri: string): ImageSourcePropType {\n return { uri }\n}\n\nexport type { MarkImageProps, MarkProps }\n\nexport { Mark }\n"],"mappings":";;;;;;;;;;;AAoEA,MAAMkC,QAAQ;CACZQ,QAAQ;EACNC,UAAUtB;EACVuB,YAAY;EACZC,OAAO;EACPC,eAAe;CACjB;CACAC,OAAO;EACLJ,UAAUvB;EACVwB,YAAY;EACZC,OAAO;EACPC,eAAe;CACjB;AACF;AAGA,MAAMG,UAAqE;CACzEG,UAAU;CACVC,UAAU;CACVC,SAAS;CACTC,WAAW;CACXC,UAAU;AACZ;;;;;;;;AASA,SAAAC,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAA5B;CAAA,IAAAC;CAAA,IAAAE;CAAA,IAAA0B;CAAA,IAAAvB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAsB;CAAA,IAAAC;CAAA,IAAAtB;CAAA,IAAAkB,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAA3B,YAAA+B,IAAA9B,UAAAC,MAAAE,MAAAE,gBAAA0B,IAAAzB,MAAAC,KAAAC,OAAAC,MAAA,GAAAoB,SAAAH;EAWFC,EAAA,KAAAD;EAAAC,EAAA,KAAA3B;EAAA2B,EAAA,KAAA1B;EAAA0B,EAAA,KAAAxB;EAAAwB,EAAA,KAAAE;EAAAF,EAAA,KAAArB;EAAAqB,EAAA,KAAApB;EAAAoB,EAAA,KAAAnB;EAAAmB,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,MAAAlB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GACb,OAAAtB,cACLQ,WAAUiE,OACVrB,WAAW,WAAXL,KAAAA,IAAkCvC,WAAUkE,YAC9C;EAAC,GARIpD,GAQJ;EAEJoB,EAAA,MAAAQ;EAAAR,EAAA,MAAA3B;EAAA2B,EAAA,MAAAf;EAAAe,EAAA,MAAApB;EAAAoB,EAAA,MAAAU;EAAAV,EAAA,MAAA0B;CAAA,OAAAA,MAAA1B,EAAA;CAAA,IAAAiC;CAAA,IAAAjC,EAAA,QAAAW,MAAAX,EAAA,QAAAY,gBAAAZ,EAAA,QAAA0B,OAAA1B,EAAA,QAAAa,MAAAb,EAAA,QAAAc,MAAAd,EAAA,QAAAe,MAAAf,EAAA,QAAAgB,MAAAhB,EAAA,QAAAiB,MAAAjB,EAAA,QAAAkB,MAAAlB,EAAA,QAAAqB,IAAA;EA1CHY,MAAA,qBAAC,IAAD;GACc,YAAApB;GACC,eAAAC;GACD,cAAAC;GACN,MAAAC;GAAyB,GAC3Bd;GACG,OAAAgB;GANT,UAAA;IAcGN;IAMAS;IASAK;GA7BE;;EA2CE1B,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAA0B;EAAA1B,EAAA,MAAAa;EAAAb,EAAA,MAAAc;EAAAd,EAAA,MAAAe;EAAAf,EAAA,MAAAgB;EAAAhB,EAAA,MAAAiB;EAAAjB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAqB;EAAArB,EAAA,MAAAiC;CAAA,OAAAA,MAAAjC,EAAA;CAAA,OA3CPiC;AA2CO;AAOX,SAASH,SAASI,KAAkC;CAClD,OAAO,EAAEA,IAAI;AACf"}
1
+ {"version":3,"file":"index.js","names":["ComponentRef","Ref","ImageProps","ImageSourcePropType","ImageStyle","StyleProp","TextStyle","ViewProps","ViewStyle","Image","Text","NativeText","View","ResolvedTheme","MarkSize","MarkTone","PersonGlyph","useTheme","composeStyles","useTypeRole","useImageLoadingStatus","initialOfThing","initialsOfPerson","DIAMETERS","GLYPH_SHARE","initialsStylesOf","markStyles","markStylesOf","MarkImageProps","Pick","MarkProps","Omit","decorative","imgProps","kind","KINDS","name","ref","showPersonIcon","size","src","style","tone","person","initials","resizeMode","shape","tintsFallback","thing","const","CONTENT","Readonly","Record","negative","positive","primary","secondary","tertiary","Mark","t0","$","_c","props","t1","t2","undefined","theme","label","handlersFor","previous","status","T0","initialsNode","t3","t4","t5","t6","t7","t8","own","text","t9","fallback","named","trim","showsPicture","t10","colors","initialsText","base","sourceOf","image","imagePending","t11","uri","_c","NativeText"],"sources":["../../src/mark/index.tsx"],"sourcesContent":["import type { ComponentRef, Ref } from 'react'\nimport type {\n ImageProps,\n ImageSourcePropType,\n ImageStyle,\n StyleProp,\n TextStyle,\n ViewProps,\n ViewStyle,\n} from 'react-native'\n\nimport { Image, Text as NativeText, View } from 'react-native'\n\nimport type { ResolvedTheme } from '../theme/scope'\nimport type { MarkSize, MarkTone } from './styles'\n\nimport { PersonGlyph } from '../glyphs'\nimport { useTheme } from '../theme/scope'\nimport { composeStyles } from '../theme/styles'\nimport { useTypeRole } from '../typography/roles'\nimport { useImageLoadingStatus } from './image'\nimport { initialOfThing, initialsOfPerson } from './initials'\nimport {\n DIAMETERS,\n GLYPH_SHARE,\n initialsStylesOf,\n markStyles,\n markStylesOf,\n} from './styles'\n\n/** The native props a picture's own `Image` takes, as Avatar and ProductIcon take them. */\ntype MarkImageProps = Pick<\n ImageProps,\n | 'crossOrigin'\n | 'fadeDuration'\n | 'progressiveRenderingEnabled'\n | 'referrerPolicy'\n | 'resizeMethod'\n>\n\ntype MarkProps = Omit<ViewProps, 'children' | 'style'> & {\n /**\n * Hides the mark from screen readers, for one beside the name it stands\n * for, which would otherwise be announced twice.\n */\n readonly decorative?: boolean\n /** Props for the picture's own `Image`. */\n readonly imgProps?: MarkImageProps\n /** A person, which Avatar draws, or anything else, which ProductIcon does. */\n readonly kind: keyof typeof KINDS\n /** Supplies the fallback's initials, and the accessible name unless decorative. */\n readonly name: string\n readonly ref?: Ref<ComponentRef<typeof View>>\n /**\n * Whether a person with no initials to take, a blank name, draws the\n * anonymous person, or an empty disc, as a loading skeleton wants.\n */\n readonly showPersonIcon?: boolean\n readonly size: MarkSize\n /** A picture to show in place of the initials once it has loaded. */\n readonly src?: string\n readonly style?: StyleProp<ViewStyle>\n readonly tone: MarkTone\n}\n\n// What each kind of mark is drawn as. The header of `./styles` says why the\n// two differ where they do; everything not in this table is the same for\n// both.\nconst KINDS = {\n person: {\n initials: initialsOfPerson,\n resizeMode: 'cover',\n shape: 'circle',\n tintsFallback: false,\n },\n thing: {\n initials: initialOfThing,\n resizeMode: 'contain',\n shape: 'square',\n tintsFallback: true,\n },\n} as const\n\n// The role each tone draws the anonymous person in.\nconst CONTENT: Readonly<Record<MarkTone, keyof ResolvedTheme['colors']>> = {\n negative: 'onNegativeContainer',\n positive: 'onPositiveContainer',\n primary: 'onPrimaryContainer',\n secondary: 'onSecondaryContainer',\n tertiary: 'onTertiaryContainer',\n}\n\n/**\n * The small identity mark Avatar and ProductIcon both render: a picture once\n * it has loaded, initials until then or if it fails, named for whoever or\n * whatever it stands for. Shared rather than written into each, so a fix to\n * one reaches both, as on web. Not a component of the library's own, and not\n * exported from the package.\n */\nfunction Mark({\n decorative = false,\n imgProps,\n kind,\n name,\n showPersonIcon = true,\n size,\n src,\n style,\n tone,\n ...props\n}: MarkProps) {\n const { initials, resizeMode, shape, tintsFallback } = KINDS[kind]\n const theme = useTheme()\n const label = useTypeRole('labelLarge')\n const { handlersFor, previous, status } = useImageLoadingStatus(src)\n\n const own = markStylesOf(theme)\n const text = initialsStylesOf(theme)\n const fallback = initials(name)\n\n // Announced as an image named for whoever or whatever it stands for,\n // rather than letting the initials be read: \"AL\" is not what anyone means\n // to announce. A blank name names nothing, so the mark is then a plain\n // view, which a screen reader passes over rather than reading as an image\n // with no name. A decorative mark is hidden outright, its initials with it.\n const named = !decorative && name.trim() !== ''\n\n // The initials while no picture shows: before the first loads, and once\n // one fails. They are left out under a picture rather than kept beneath\n // it, since a letterboxed logo would show them through its transparent\n // parts.\n const showsPicture = status === 'loaded' || previous !== undefined\n let initialsNode = null\n if (!showsPicture && kind === 'person' && fallback === '') {\n // A person with no initials to take, a blank name or one still loading,\n // draws Material Design's anonymous person in the tone's on-container\n // colour. The glyph hides itself from screen readers.\n initialsNode = showPersonIcon ? (\n <PersonGlyph\n color={theme.colors[CONTENT[tone]]}\n size={DIAMETERS[size] * GLYPH_SHARE}\n />\n ) : null\n } else if (!showsPicture) {\n // The initials keep their size whatever the device's text size asks\n // for: the mark is a fixed size and clips what runs past it, and the\n // name a screen reader reads is what they stand for.\n const initialsText = (\n <NativeText\n allowFontScaling={false}\n style={composeStyles<TextStyle>(label, text[size], text[tone])}\n >\n {fallback}\n </NativeText>\n )\n initialsNode = tintsFallback ? (\n <View style={composeStyles<ViewStyle>(markStyles.fallback, own[tone])}>\n {initialsText}\n </View>\n ) : (\n initialsText\n )\n }\n\n return (\n <View\n accessible={named ? true : undefined}\n aria-hidden={decorative ? true : undefined}\n aria-label={named ? name : undefined}\n role={named ? 'img' : undefined}\n {...props}\n style={composeStyles<ViewStyle>(\n own.base,\n own[shape],\n markStyles[size],\n tintsFallback ? undefined : own[tone],\n style,\n )}\n >\n {initialsNode}\n {/* Two pictures at most, laid over the initials. The one last loaded\n stays while a new `src` loads, and the new one is drawn on top of\n it from the start, hidden until it has loaded. Neither is inverted\n by the iOS Smart Invert setting, which is meant for interface\n colours rather than pictures. */}\n {previous === undefined ? null : (\n <Image\n accessibilityIgnoresInvertColors\n key={previous}\n resizeMode={resizeMode}\n source={sourceOf(previous)}\n style={markStyles.image}\n />\n )}\n {src === undefined || status === 'error' ? null : (\n <Image\n accessibilityIgnoresInvertColors\n key={src}\n {...imgProps}\n {...handlersFor(src)}\n resizeMode={resizeMode}\n source={sourceOf(src)}\n style={composeStyles<ImageStyle>(\n markStyles.image,\n status === 'loaded' ? undefined : markStyles.imagePending,\n )}\n />\n )}\n </View>\n )\n}\n\n// An address as the source `Image` takes. The compiler keeps the one it made\n// for as long as the address is the same, so a re-render hands the image the\n// object it already had.\nfunction sourceOf(uri: string): ImageSourcePropType {\n return { uri }\n}\n\nexport type { MarkImageProps, MarkProps }\n\nexport { Mark }\n"],"mappings":";;;;;;;;;;;AAoEA,MAAMmC,QAAQ;CACZQ,QAAQ;EACNC,UAAUtB;EACVuB,YAAY;EACZC,OAAO;EACPC,eAAe;CACjB;CACAC,OAAO;EACLJ,UAAUvB;EACVwB,YAAY;EACZC,OAAO;EACPC,eAAe;CACjB;AACF;AAGA,MAAMG,UAAqE;CACzEG,UAAU;CACVC,UAAU;CACVC,SAAS;CACTC,WAAW;CACXC,UAAU;AACZ;;;;;;;;AASA,SAAAC,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAA5B;CAAA,IAAAC;CAAA,IAAAE;CAAA,IAAA0B;CAAA,IAAAvB;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAsB;CAAA,IAAAC;CAAA,IAAAtB;CAAA,IAAAkB,EAAA,OAAAD,IAAA;EAAc,CAAA,CAAA3B,YAAA+B,IAAA9B,UAAAC,MAAAE,MAAAE,gBAAA0B,IAAAzB,MAAAC,KAAAC,OAAAC,MAAA,GAAAoB,SAAAH;EAWFC,EAAA,KAAAD;EAAAC,EAAA,KAAA3B;EAAA2B,EAAA,KAAA1B;EAAA0B,EAAA,KAAAxB;EAAAwB,EAAA,KAAAE;EAAAF,EAAA,KAAArB;EAAAqB,EAAA,KAAApB;EAAAoB,EAAA,KAAAnB;EAAAmB,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,MAAAlB;CAAA,OAAA;EAAAT,WAAA2B,EAAA;EAAA1B,OAAA0B,EAAA;EAAAxB,OAAAwB,EAAA;EAAAE,QAAAF,EAAA;EAAArB,OAAAqB,EAAA;EAAApB,MAAAoB,EAAA;EAAAnB,QAAAmB,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAlB,OAAAkB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AAA0B;CAAA,OAAAA,MAAA1B,EAAA;CAAA,IAAAiC;CAAA,IAAAjC,EAAA,QAAAW,MAAAX,EAAA,QAAAY,gBAAAZ,EAAA,QAAA0B,OAAA1B,EAAA,QAAAa,MAAAb,EAAA,QAAAc,MAAAd,EAAA,QAAAe,MAAAf,EAAA,QAAAgB,MAAAhB,EAAA,QAAAiB,MAAAjB,EAAA,QAAAkB,MAAAlB,EAAA,QAAAqB,IAAA;EA1CHY,MAAA,qBAAC,IAAD;GACc,YAAApB;GACC,eAAAC;GACD,cAAAC;GACN,MAAAC;GAAyB,GAC3Bd;GACG,OAAAgB;GANT,UAAA;IAcGN;IAMAS;IASAK;GA7BE;;EA2CE1B,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAA0B;EAAA1B,EAAA,MAAAa;EAAAb,EAAA,MAAAc;EAAAd,EAAA,MAAAe;EAAAf,EAAA,MAAAgB;EAAAhB,EAAA,MAAAiB;EAAAjB,EAAA,MAAAkB;EAAAlB,EAAA,MAAAqB;EAAArB,EAAA,MAAAiC;CAAA,OAAAA,MAAAjC,EAAA;CAAA,OA3CPiC;AA2CO;AAOX,SAASH,SAASI,KAAkC;CAClD,OAAO,EAAEA,IAAI;AACf"}
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","names":["ReactNode","createContext","use","useId","useLayoutEffect","useState","useSyncExternalStore","StyleSheet","View","ScopeContext","useScope","Entry","key","content","OverlayStore","attach","layer","entries","remove","set","subscribe","listener","OverlayHostContext","styles","create","fill","bottom","left","pointerEvents","position","right","top","Overlay","t0","$","_c","children","store","scope","Error","t1","t2","t3","t4","OverlayHost","storeFor","OverlayLayer","map","_temp","Map","listeners","Set","changed","view","delete","node","add","_c"],"sources":["../../src/overlay/host.tsx"],"sourcesContent":["import type { ReactNode } from 'react'\n\nimport {\n createContext,\n use,\n useId,\n useLayoutEffect,\n useState,\n useSyncExternalStore,\n} from 'react'\nimport { StyleSheet, View } from 'react-native'\n\nimport { ScopeContext, useScope } from '../theme/scope'\n\ntype Entry = readonly [key: string, content: ReactNode]\n\n/** What an overlay reaches its host through. */\ntype OverlayStore = {\n /** Takes the layer the host draws its overlays in, as its ref. */\n readonly attach: (layer: null | View) => void\n readonly entries: () => readonly Entry[]\n /** The layer the host draws its overlays in, for placing one in it. */\n readonly layer: () => null | View\n readonly remove: (key: string) => void\n readonly set: (key: string, content: ReactNode) => void\n readonly subscribe: (listener: () => void) => () => void\n}\n\nconst OverlayHostContext = createContext<null | OverlayStore>(null)\n\nconst styles = StyleSheet.create({\n // Each overlay fills the layer on a box of its own, so one laid out in the\n // flow, as a bar along an edge is, is laid out against the screen rather\n // than after the overlay before it.\n fill: {\n bottom: 0,\n left: 0,\n pointerEvents: 'box-none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n})\n\n/**\n * Draws its content above the screen, in the overlay host of the app's\n * outermost `ThemeScope`, for as long as it is mounted. A later overlay draws\n * above an earlier one.\n *\n * The content reads the `ThemeScope` around the `Overlay`, as anything else\n * there would. Other context set between the host and the `Overlay` does not\n * reach it: an overlay is a surface of its own, as web's `OverlayScope` makes\n * one, so it starts from what is around the app rather than from what is\n * around the control that opened it.\n */\nfunction Overlay({ children }: { readonly children?: ReactNode }) {\n const store = use(OverlayHostContext)\n const scope = useScope()\n const key = useId()\n\n if (store === null) {\n throw new Error(\n 'An overlay draws in the host of the outermost ThemeScope, and there is no ThemeScope around this one. Wrap the app in a ThemeScope.',\n )\n }\n\n // Set before paint, so an overlay opening never draws a frame without it,\n // and replaced in place on an update, so it keeps its place in the stack.\n useLayoutEffect(() => {\n store.set(key, <ScopeContext value={scope}>{children}</ScopeContext>)\n }, [children, key, scope, store])\n\n useLayoutEffect(\n () => () => {\n store.remove(key)\n },\n [key, store],\n )\n\n return null\n}\n\n/**\n * Hosts the overlays drawn inside it: its children, then a layer over them\n * that fills the view around the host. Mounting or unmounting an overlay\n * renders the layer alone, so the screen under it keeps its state.\n *\n * The outermost `ThemeScope` renders one, so an app has one at its root.\n */\nfunction OverlayHost({ children }: { readonly children?: ReactNode }) {\n const [store] = useState(storeFor)\n\n return (\n <OverlayHostContext value={store}>\n {children}\n <OverlayLayer attach={store.attach} store={store} />\n </OverlayHostContext>\n )\n}\n\n// The layer passes a touch through to the screen wherever no overlay is\n// drawn, so an open overlay leaves the screen around it usable. It takes its\n// ref apart from the store, since the compiler reads an object a ref is taken\n// from as a ref itself, and the store is read during render.\nfunction OverlayLayer({\n attach,\n store,\n}: {\n readonly attach: OverlayStore['attach']\n readonly store: OverlayStore\n}) {\n const entries = useSyncExternalStore(store.subscribe, store.entries)\n\n return (\n <View ref={attach} style={styles.fill}>\n {entries.map(([key, content]) => (\n <View key={key} style={styles.fill}>\n {content}\n </View>\n ))}\n </View>\n )\n}\n\nfunction storeFor(): OverlayStore {\n const content = new Map<string, ReactNode>()\n const listeners = new Set<() => void>()\n let entries: readonly Entry[] = []\n let layer: null | View = null\n\n const changed = () => {\n entries = [...content]\n for (const listener of listeners) {\n listener()\n }\n }\n\n return {\n attach: (view) => {\n layer = view\n },\n entries: () => entries,\n layer: () => layer,\n remove: (key) => {\n if (content.delete(key)) {\n changed()\n }\n },\n set: (key, node) => {\n content.set(key, node)\n changed()\n },\n subscribe: (listener) => {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n }\n}\n\nexport type { OverlayStore }\n\nexport { Overlay, OverlayHost, OverlayHostContext }\n"],"mappings":";;;;;;AA4BA,MAAMsB,qBAAqBrB,cAAmC,IAAI;AAElE,MAAMsB,SAAShB,WAAWiB,OAAO,EAI/BC,MAAM;CACJC,QAAQ;CACRC,MAAM;CACNC,eAAe;CACfC,UAAU;CACVC,OAAO;CACPC,KAAK;AACP,EACF,CAAC;;;;;;;;;;;;AAaD,SAAAC,QAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAiB,MAAA,EAAAC,aAAAH;CACf,MAAAI,QAAcnC,IAAIoB,kBAAkB;CACpC,MAAAgB,QAAc5B,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pBnC,UAAU,CAAC,GAAGJ,OAAO;EACrB,KAAK,MAAMQ,YAAY6B,WACrB7B,SAAS;CAEb;CAEA,OAAO;EACLN,SAASsC,SAAS;GAChBrC,QAAQqC;EACV;EACApC,eAAeA;EACfD,aAAaA;EACbE,SAASN,QAAQ;GACf,IAAIC,QAAQyC,OAAO1C,GAAG,GACpBwC,QAAQ;EAEZ;EACAjC,MAAMP,KAAK2C,SAAS;GAClB1C,QAAQM,IAAIP,KAAK2C,IAAI;GACrBH,QAAQ;EACV;EACAhC,YAAYC,aAAa;GACvB6B,UAAUM,IAAInC,QAAQ;GACtB,aAAa;IACX6B,UAAUI,OAAOjC,QAAQ;GAC3B;EACF;CACF;AACF"}
1
+ {"version":3,"file":"host.js","names":["ComponentRef","ReactNode","createContext","use","useId","useLayoutEffect","useState","useSyncExternalStore","StyleSheet","View","ScopeContext","useScope","Entry","key","content","OverlayStore","attach","layer","entries","remove","set","subscribe","listener","OverlayHostContext","styles","create","fill","bottom","left","pointerEvents","position","right","top","Overlay","t0","$","_c","children","store","scope","Error","t1","t2","t3","t4","OverlayHost","storeFor","OverlayLayer","map","_temp","Map","listeners","Set","changed","view","delete","node","add","_c"],"sources":["../../src/overlay/host.tsx"],"sourcesContent":["import type { ComponentRef, ReactNode } from 'react'\n\nimport {\n createContext,\n use,\n useId,\n useLayoutEffect,\n useState,\n useSyncExternalStore,\n} from 'react'\nimport { StyleSheet, View } from 'react-native'\n\nimport { ScopeContext, useScope } from '../theme/scope'\n\ntype Entry = readonly [key: string, content: ReactNode]\n\n/** What an overlay reaches its host through. */\ntype OverlayStore = {\n /** Takes the layer the host draws its overlays in, as its ref. */\n readonly attach: (layer: ComponentRef<typeof View> | null) => void\n readonly entries: () => readonly Entry[]\n /** The layer the host draws its overlays in, for placing one in it. */\n readonly layer: () => ComponentRef<typeof View> | null\n readonly remove: (key: string) => void\n readonly set: (key: string, content: ReactNode) => void\n readonly subscribe: (listener: () => void) => () => void\n}\n\nconst OverlayHostContext = createContext<null | OverlayStore>(null)\n\nconst styles = StyleSheet.create({\n // Each overlay fills the layer on a box of its own, so one laid out in the\n // flow, as a bar along an edge is, is laid out against the screen rather\n // than after the overlay before it.\n fill: {\n bottom: 0,\n left: 0,\n pointerEvents: 'box-none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n})\n\n/**\n * Draws its content above the screen, in the overlay host of the app's\n * outermost `ThemeScope`, for as long as it is mounted. A later overlay draws\n * above an earlier one.\n *\n * The content reads the `ThemeScope` around the `Overlay`, as anything else\n * there would. Other context set between the host and the `Overlay` does not\n * reach it: an overlay is a surface of its own, as web's `OverlayScope` makes\n * one, so it starts from what is around the app rather than from what is\n * around the control that opened it.\n */\nfunction Overlay({ children }: { readonly children?: ReactNode }) {\n const store = use(OverlayHostContext)\n const scope = useScope()\n const key = useId()\n\n if (store === null) {\n throw new Error(\n 'An overlay draws in the host of the outermost ThemeScope, and there is no ThemeScope around this one. Wrap the app in a ThemeScope.',\n )\n }\n\n // Set before paint, so an overlay opening never draws a frame without it,\n // and replaced in place on an update, so it keeps its place in the stack.\n useLayoutEffect(() => {\n store.set(key, <ScopeContext value={scope}>{children}</ScopeContext>)\n }, [children, key, scope, store])\n\n useLayoutEffect(\n () => () => {\n store.remove(key)\n },\n [key, store],\n )\n\n return null\n}\n\n/**\n * Hosts the overlays drawn inside it: its children, then a layer over them\n * that fills the view around the host. Mounting or unmounting an overlay\n * renders the layer alone, so the screen under it keeps its state.\n *\n * The outermost `ThemeScope` renders one, so an app has one at its root.\n */\nfunction OverlayHost({ children }: { readonly children?: ReactNode }) {\n const [store] = useState(storeFor)\n\n return (\n <OverlayHostContext value={store}>\n {children}\n <OverlayLayer attach={store.attach} store={store} />\n </OverlayHostContext>\n )\n}\n\n// The layer passes a touch through to the screen wherever no overlay is\n// drawn, so an open overlay leaves the screen around it usable. It takes its\n// ref apart from the store, since the compiler reads an object a ref is taken\n// from as a ref itself, and the store is read during render.\nfunction OverlayLayer({\n attach,\n store,\n}: {\n readonly attach: OverlayStore['attach']\n readonly store: OverlayStore\n}) {\n const entries = useSyncExternalStore(store.subscribe, store.entries)\n\n return (\n <View ref={attach} style={styles.fill}>\n {entries.map(([key, content]) => (\n <View key={key} style={styles.fill}>\n {content}\n </View>\n ))}\n </View>\n )\n}\n\nfunction storeFor(): OverlayStore {\n const content = new Map<string, ReactNode>()\n const listeners = new Set<() => void>()\n let entries: readonly Entry[] = []\n let layer: ComponentRef<typeof View> | null = null\n\n const changed = () => {\n entries = [...content]\n for (const listener of listeners) {\n listener()\n }\n }\n\n return {\n attach: (view) => {\n layer = view\n },\n entries: () => entries,\n layer: () => layer,\n remove: (key) => {\n if (content.delete(key)) {\n changed()\n }\n },\n set: (key, node) => {\n content.set(key, node)\n changed()\n },\n subscribe: (listener) => {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n }\n}\n\nexport type { OverlayStore }\n\nexport { Overlay, OverlayHost, OverlayHostContext }\n"],"mappings":";;;;;;AA4BA,MAAMuB,qBAAqBrB,cAAmC,IAAI;AAElE,MAAMsB,SAAShB,WAAWiB,OAAO,EAI/BC,MAAM;CACJC,QAAQ;CACRC,MAAM;CACNC,eAAe;CACfC,UAAU;CACVC,OAAO;CACPC,KAAK;AACP,EACF,CAAC;;;;;;;;;;;;AAaD,SAAAC,QAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAiB,MAAA,EAAAC,aAAAH;CACf,MAAAI,QAAcnC,IAAIoB,kBAAkB;CACpC,MAAAgB,QAAc5B,SAAS;CACvB,MAAAE,MAAYT,MAAM;CAElB,IAAIkC,UAAU,MACZ,MAAM,IAAIE,MACR,qIACF;CACD,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAE,YAAAF,EAAA,OAAAtB,OAAAsB,EAAA,OAAAI,SAAAJ,EAAA,OAAAG,OAAA;EAIeG,WAAA;GACdH,MAAKlB,IAAKP,KAAK,oBAAC,cAAD;IAAqB0B,OAAAA;IAAQF;GAAhB,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