@kanso-labs/react-native-kanso-ui 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/LICENSE.md +20 -0
  2. package/README.md +205 -2
  3. package/dist/button/index.d.ts +56 -0
  4. package/dist/button/index.js +169 -0
  5. package/dist/button/index.js.map +1 -0
  6. package/dist/button/palettes.js +47 -0
  7. package/dist/button/palettes.js.map +1 -0
  8. package/dist/chip/index.js +194 -0
  9. package/dist/chip/index.js.map +1 -0
  10. package/dist/chip/styles.js +36 -0
  11. package/dist/chip/styles.js.map +1 -0
  12. package/dist/clipboard/index.js +58 -0
  13. package/dist/clipboard/index.js.map +1 -0
  14. package/dist/components/avatar/index.d.ts +82 -0
  15. package/dist/components/avatar/index.js +62 -0
  16. package/dist/components/avatar/index.js.map +1 -0
  17. package/dist/components/button/index.d.ts +87 -0
  18. package/dist/components/button/index.js +377 -0
  19. package/dist/components/button/index.js.map +1 -0
  20. package/dist/components/card/index.d.ts +78 -0
  21. package/dist/components/card/index.js +315 -0
  22. package/dist/components/card/index.js.map +1 -0
  23. package/dist/components/checkbox/index.d.ts +76 -0
  24. package/dist/components/checkbox/index.js +360 -0
  25. package/dist/components/checkbox/index.js.map +1 -0
  26. package/dist/components/chip/index.d.ts +84 -0
  27. package/dist/components/chip/index.js +257 -0
  28. package/dist/components/chip/index.js.map +1 -0
  29. package/dist/components/chip-group/index.d.ts +143 -0
  30. package/dist/components/chip-group/index.js +669 -0
  31. package/dist/components/chip-group/index.js.map +1 -0
  32. package/dist/components/copy-field/index.d.ts +60 -0
  33. package/dist/components/copy-field/index.js +277 -0
  34. package/dist/components/copy-field/index.js.map +1 -0
  35. package/dist/components/currency/index.d.ts +69 -0
  36. package/dist/components/currency/index.js +162 -0
  37. package/dist/components/currency/index.js.map +1 -0
  38. package/dist/components/form/index.d.ts +84 -0
  39. package/dist/components/form/index.js +95 -0
  40. package/dist/components/form/index.js.map +1 -0
  41. package/dist/components/icon-button/index.d.ts +68 -0
  42. package/dist/components/icon-button/index.js +289 -0
  43. package/dist/components/icon-button/index.js.map +1 -0
  44. package/dist/components/link/index.d.ts +59 -0
  45. package/dist/components/link/index.js +191 -0
  46. package/dist/components/link/index.js.map +1 -0
  47. package/dist/components/number-field/index.d.ts +151 -0
  48. package/dist/components/number-field/index.js +832 -0
  49. package/dist/components/number-field/index.js.map +1 -0
  50. package/dist/components/product-icon/index.d.ts +70 -0
  51. package/dist/components/product-icon/index.js +60 -0
  52. package/dist/components/product-icon/index.js.map +1 -0
  53. package/dist/components/radio-group/index.d.ts +105 -0
  54. package/dist/components/radio-group/index.js +597 -0
  55. package/dist/components/radio-group/index.js.map +1 -0
  56. package/dist/components/search-field/index.d.ts +98 -0
  57. package/dist/components/search-field/index.js +521 -0
  58. package/dist/components/search-field/index.js.map +1 -0
  59. package/dist/components/segmented-button/index.d.ts +113 -0
  60. package/dist/components/segmented-button/index.js +937 -0
  61. package/dist/components/segmented-button/index.js.map +1 -0
  62. package/dist/components/separator/index.d.ts +45 -0
  63. package/dist/components/separator/index.js +109 -0
  64. package/dist/components/separator/index.js.map +1 -0
  65. package/dist/components/stack/index.d.ts +70 -0
  66. package/dist/components/stack/index.js +107 -0
  67. package/dist/components/stack/index.js.map +1 -0
  68. package/dist/components/switch/index.d.ts +76 -0
  69. package/dist/components/switch/index.js +591 -0
  70. package/dist/components/switch/index.js.map +1 -0
  71. package/dist/components/text/index.d.ts +44 -0
  72. package/dist/components/text/index.js +78 -0
  73. package/dist/components/text/index.js.map +1 -0
  74. package/dist/components/text-field/index.d.ts +146 -0
  75. package/dist/components/text-field/index.js +228 -0
  76. package/dist/components/text-field/index.js.map +1 -0
  77. package/dist/control/index.js +117 -0
  78. package/dist/control/index.js.map +1 -0
  79. package/dist/control/styles.js +36 -0
  80. package/dist/control/styles.js.map +1 -0
  81. package/dist/field/index.d.ts +13 -0
  82. package/dist/field/index.js +1007 -0
  83. package/dist/field/index.js.map +1 -0
  84. package/dist/field/styles.js +131 -0
  85. package/dist/field/styles.js.map +1 -0
  86. package/dist/form/index.d.ts +24 -0
  87. package/dist/form/index.js +209 -0
  88. package/dist/form/index.js.map +1 -0
  89. package/dist/glyphs/icon-style.d.ts +25 -0
  90. package/dist/glyphs/icon-style.js +22 -0
  91. package/dist/glyphs/icon-style.js.map +1 -0
  92. package/dist/glyphs/index.js +170 -0
  93. package/dist/glyphs/index.js.map +1 -0
  94. package/dist/glyphs/styles.js +7 -0
  95. package/dist/glyphs/styles.js.map +1 -0
  96. package/dist/hooks/useWindowSizeClass.d.ts +25 -0
  97. package/dist/hooks/useWindowSizeClass.js +39 -0
  98. package/dist/hooks/useWindowSizeClass.js.map +1 -0
  99. package/dist/index.d.ts +31 -0
  100. package/dist/index.js +27 -0
  101. package/dist/mark/image.js +61 -0
  102. package/dist/mark/image.js.map +1 -0
  103. package/dist/mark/index.d.ts +9 -0
  104. package/dist/mark/index.js +234 -0
  105. package/dist/mark/index.js.map +1 -0
  106. package/dist/mark/initials.js +65 -0
  107. package/dist/mark/initials.js.map +1 -0
  108. package/dist/mark/styles.d.ts +1 -0
  109. package/dist/mark/styles.js +73 -0
  110. package/dist/mark/styles.js.map +1 -0
  111. package/dist/number/parser.js +321 -0
  112. package/dist/number/parser.js.map +1 -0
  113. package/dist/number/state.js +235 -0
  114. package/dist/number/state.js.map +1 -0
  115. package/dist/overlay/host.js +111 -0
  116. package/dist/overlay/host.js.map +1 -0
  117. package/dist/press/index.js +350 -0
  118. package/dist/press/index.js.map +1 -0
  119. package/dist/press/styles.js +31 -0
  120. package/dist/press/styles.js.map +1 -0
  121. package/dist/router/index.d.ts +28 -0
  122. package/dist/router/index.js +82 -0
  123. package/dist/router/index.js.map +1 -0
  124. package/dist/theme/color.js +25 -0
  125. package/dist/theme/color.js.map +1 -0
  126. package/dist/theme/resolve.d.ts +6 -0
  127. package/dist/theme/resolve.js +310 -0
  128. package/dist/theme/resolve.js.map +1 -0
  129. package/dist/theme/scope.d.ts +42 -0
  130. package/dist/theme/scope.js +80 -0
  131. package/dist/theme/scope.js.map +1 -0
  132. package/dist/theme/styles.js +39 -0
  133. package/dist/theme/styles.js.map +1 -0
  134. package/dist/theme-scope.d.ts +56 -0
  135. package/dist/theme-scope.js +127 -0
  136. package/dist/theme-scope.js.map +1 -0
  137. package/dist/tokens/defaults.d.ts +407 -0
  138. package/dist/tokens/defaults.js +403 -0
  139. package/dist/tokens/defaults.js.map +1 -0
  140. package/dist/typography/fonts.js +84 -0
  141. package/dist/typography/fonts.js.map +1 -0
  142. package/dist/typography/roles.d.ts +10 -0
  143. package/dist/typography/roles.js +82 -0
  144. package/dist/typography/roles.js.map +1 -0
  145. package/package.json +132 -4
@@ -0,0 +1,98 @@
1
+ import { ValidationResult } from "../../form/index.js";
2
+ import { StyleProp, TextInput, TextInputProps, View, ViewStyle } from "react-native";
3
+ import { Ref } from "react";
4
+ //#region src/components/search-field/index.d.ts
5
+ type SearchFieldProps = Omit<TextInputProps, 'accessibilityHint' | 'accessibilityLabel' | 'aria-disabled' | 'aria-label' | 'children' | 'cursorColor' | 'defaultValue' | 'editable' | 'multiline' | 'numberOfLines' | 'onChange' | 'onChangeText' | 'placeholderTextColor' | 'readOnly' | 'returnKeyType' | 'role' | 'selectionColor' | 'style' | 'underlineColorAndroid' | 'value'> & {
6
+ /**
7
+ * The name of the button that clears the field, for a screen reader.
8
+ * Left out, it is "Clear search", the English name web's takes from React
9
+ * Aria.
10
+ */
11
+ readonly clearLabel?: string;
12
+ /** The value the field opens with, when it keeps its own. */
13
+ readonly defaultValue?: string;
14
+ /**
15
+ * A hint shown under the bar. Replaced by `error` when there is one, so the
16
+ * two never stack.
17
+ */
18
+ readonly description?: string;
19
+ /**
20
+ * The problem with the current value, in words. Its presence is what puts
21
+ * the field in its error state: the message, the ring in the error role,
22
+ * and the invalid state a screen reader reads all follow from it. The line
23
+ * under the bar arrives with the message, so the field grows when this
24
+ * does, unless it is inside a `Form`, which keeps the line drawn. It wins
25
+ * over what `validate` and the form say, and holds a `native` form back.
26
+ */
27
+ readonly error?: string;
28
+ /**
29
+ * A ref to the field's own `TextInput`, which is what a call site moves
30
+ * focus to. `ref` is the field as a whole.
31
+ */
32
+ readonly inputRef?: Ref<TextInput>;
33
+ /**
34
+ * Draws the field disabled: it takes no focus and no input, and its clear
35
+ * button no press.
36
+ * @default false
37
+ */
38
+ readonly isDisabled?: boolean;
39
+ /**
40
+ * Whether the field has to be filled in, which a screen reader reads.
41
+ * Inside a `native` form, an empty one holds the submission back and shows
42
+ * its error once a submission is tried. The bar draws no label, so there
43
+ * is no asterisk to show it.
44
+ * @default false
45
+ */
46
+ readonly isRequired?: boolean;
47
+ /**
48
+ * What the field searches, for a screen reader. The bar draws no label, so
49
+ * this is read and never shown; `placeholder` is what is seen.
50
+ */
51
+ readonly label: string;
52
+ /**
53
+ * The name the value is submitted under by the `Form` around the field,
54
+ * and the key its `validationErrors` reach the field by.
55
+ */
56
+ readonly name?: string;
57
+ /** Called with the new value as it is edited, and with `''` once cleared. */
58
+ readonly onChange?: (value: string) => void;
59
+ /** Called once the field is emptied, from its clear button or Escape. */
60
+ readonly onClear?: () => void;
61
+ /** Called with the value when the keyboard's search key submits it. */
62
+ readonly onSubmit?: (value: string) => void;
63
+ /** The supporting text in the empty bar, which is what a person reads. */
64
+ readonly placeholder?: string;
65
+ readonly ref?: Ref<View>;
66
+ /** Positions and sizes the field as a whole. */
67
+ readonly style?: StyleProp<ViewStyle>;
68
+ /**
69
+ * Checks the value, and returns its problem in words, or several, where
70
+ * there is one, and `true`, `null` or `undefined` where there is none.
71
+ * Under the default `aria` validation the error shows as the value
72
+ * changes; inside a `native` form it shows once a submission is tried, or
73
+ * once the field loses focus after an edit, and holds the form back.
74
+ */
75
+ readonly validate?: (value: string) => ValidationResult;
76
+ /** The value, when the call site keeps it. */
77
+ readonly value?: string;
78
+ };
79
+ /**
80
+ * A search bar: a keyword typed into a pill, submitted with the keyboard's
81
+ * search key and cleared with its button. Pass `value` with `onChange` to
82
+ * control it, or `defaultValue` to let it keep its own; `onSubmit` is handed
83
+ * the value when the search key is pressed, and `onClear` is called when the
84
+ * field is emptied.
85
+ *
86
+ * The bar is the search page's rather than the box the other fields share;
87
+ * the control and the line under it are the field chrome in `src/field`.
88
+ * React Native's own `TextInput` props reach the control; `style` and `ref`
89
+ * are the field as a whole, and `inputRef` the control.
90
+ *
91
+ * ```tsx
92
+ * <SearchField label="Label" placeholder="Supporting text" />
93
+ * ```
94
+ */
95
+ declare function SearchField({ clearLabel, defaultValue, description, error, inputRef, isDisabled, isRequired, label, name, onBlur, onChange, onClear, onFocus, onKeyPress, onSubmit, onSubmitEditing, ref, style, validate, value, ...props }: SearchFieldProps): import("react").JSX.Element;
96
+ //#endregion
97
+ export { SearchField, type SearchFieldProps };
98
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,521 @@
1
+ import { IconStyleContext } from "../../glyphs/icon-style.js";
2
+ import { CloseGlyph, SearchGlyph } from "../../glyphs/index.js";
3
+ import { useTheme } from "../../theme/scope.js";
4
+ import { composeStyles, themedStyles } from "../../theme/styles.js";
5
+ import { useFieldValidation } from "../../form/index.js";
6
+ import { withOpacity } from "../../theme/color.js";
7
+ import { usePressFeedback } from "../../press/index.js";
8
+ import { IconButton } from "../icon-button/index.js";
9
+ import { FieldInput, FieldMessage, FieldStates, FieldStroke, describedBy, useFieldFocus, useStrokeMotion } from "../../field/index.js";
10
+ import { c } from "react/compiler-runtime";
11
+ import { Pressable, StyleSheet, View, useWindowDimensions } from "react-native";
12
+ import { useId, useImperativeHandle, useRef, useState } from "react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ //#region src/components/search-field/index.tsx
15
+ const ICON_SIZE = 24;
16
+ const MAX_WIDTH = 720;
17
+ const CLEAR_LABEL = "Clear search";
18
+ const stylesOf = themedStyles(({ colors, radii, spacing, stateLayerOpacity }) => StyleSheet.create({
19
+ bar: {
20
+ alignItems: "center",
21
+ backgroundColor: colors.surfaceContainerHigh,
22
+ borderRadius: radii.pill,
23
+ flexDirection: "row",
24
+ gap: spacing.lg,
25
+ maxWidth: MAX_WIDTH,
26
+ paddingEnd: spacing.lg,
27
+ paddingStart: spacing.lg + spacing.md
28
+ },
29
+ barDisabled: { backgroundColor: withOpacity(colors.onSurface, stateLayerOpacity.disabledContainer) },
30
+ clear: { marginEnd: spacing.xs },
31
+ ring: {
32
+ borderRadius: radii.pill,
33
+ bottom: 0,
34
+ left: 0,
35
+ pointerEvents: "none",
36
+ position: "absolute",
37
+ right: 0,
38
+ top: 0
39
+ }
40
+ }));
41
+ function blurThen(onBlur, then) {
42
+ return (event) => {
43
+ onBlur();
44
+ then?.(event);
45
+ };
46
+ }
47
+ function clearFrom(onClear, control) {
48
+ return () => {
49
+ onClear();
50
+ control.current?.focus();
51
+ };
52
+ }
53
+ function clearInto(setOwn, onChange, onClear, onEdit) {
54
+ return () => {
55
+ setOwn("");
56
+ onEdit();
57
+ onChange?.("");
58
+ onClear?.();
59
+ };
60
+ }
61
+ function editInto(setOwn, onChange, onEdit) {
62
+ return (text) => {
63
+ setOwn(text);
64
+ onEdit();
65
+ onChange?.(text);
66
+ };
67
+ }
68
+ function focusOf(control) {
69
+ return () => {
70
+ control.current?.focus();
71
+ };
72
+ }
73
+ function iconStyleOf(color) {
74
+ return {
75
+ color,
76
+ size: ICON_SIZE
77
+ };
78
+ }
79
+ function keyInto(clear, onKeyPress) {
80
+ return (event) => {
81
+ if (clear !== void 0 && event.nativeEvent.key === "Escape") clear();
82
+ onKeyPress?.(event);
83
+ };
84
+ }
85
+ function minHeightOf(minHeight) {
86
+ return { minHeight };
87
+ }
88
+ /**
89
+ * The bar around the control: the pill with its state layer and ring, the
90
+ * magnifier at the start and the clear button at the end. A press anywhere on
91
+ * it focuses the control.
92
+ */
93
+ function SearchBar(t0) {
94
+ const $ = c(48);
95
+ const { children, clearLabel, control, isDisabled, isFocused, isInvalid, isRequired, onClear, showsClear } = t0;
96
+ const theme = useTheme();
97
+ const styles = stylesOf(theme);
98
+ const { fontScale } = useWindowDimensions();
99
+ const { colors, radii, sizing, stateLayerOpacity, typography } = theme;
100
+ let t1;
101
+ if ($[0] !== radii.pill) {
102
+ t1 = { borderRadius: radii.pill };
103
+ $[0] = radii.pill;
104
+ $[1] = t1;
105
+ } else t1 = $[1];
106
+ let t2;
107
+ if ($[2] !== colors.onSurface || $[3] !== isDisabled || $[4] !== t1) {
108
+ t2 = {
109
+ color: colors.onSurface,
110
+ corners: t1,
111
+ disabled: isDisabled,
112
+ disableRipple: true
113
+ };
114
+ $[2] = colors.onSurface;
115
+ $[3] = isDisabled;
116
+ $[4] = t1;
117
+ $[5] = t2;
118
+ } else t2 = $[5];
119
+ const feedback = usePressFeedback(t2);
120
+ const ring = useStrokeMotion(isInvalid ? colors.error : colors.primary, isDisabled ? 0 : isFocused ? 2 : isInvalid ? 1 : 0);
121
+ const T0 = Pressable;
122
+ const t3 = false;
123
+ const t4 = false;
124
+ const t5 = feedback.handlers.onHoverIn;
125
+ const t6 = feedback.handlers.onHoverOut;
126
+ let t7;
127
+ if ($[6] !== control) {
128
+ t7 = focusOf(control);
129
+ $[6] = control;
130
+ $[7] = t7;
131
+ } else t7 = $[7];
132
+ const t8 = feedback.handlers.onPressIn;
133
+ const t9 = feedback.handlers.onPressOut;
134
+ const t10 = composeStyles(styles.bar, isDisabled ? styles.barDisabled : void 0, minHeightOf(sizing.controlLg + typography.bodyLargeLineHeight * (fontScale - 1)));
135
+ const t11 = feedback.layer;
136
+ let t12;
137
+ if ($[8] !== ring.color || $[9] !== ring.width || $[10] !== styles.ring) {
138
+ t12 = /* @__PURE__ */ jsx(FieldStroke, {
139
+ color: ring.color,
140
+ sides: "all",
141
+ style: styles.ring,
142
+ width: ring.width
143
+ });
144
+ $[8] = ring.color;
145
+ $[9] = ring.width;
146
+ $[10] = styles.ring;
147
+ $[11] = t12;
148
+ } else t12 = $[11];
149
+ let t13;
150
+ if ($[12] !== colors.onSurface || $[13] !== colors.onSurfaceVariant || $[14] !== isDisabled || $[15] !== stateLayerOpacity) {
151
+ t13 = isDisabled ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent) : colors.onSurfaceVariant;
152
+ $[12] = colors.onSurface;
153
+ $[13] = colors.onSurfaceVariant;
154
+ $[14] = isDisabled;
155
+ $[15] = stateLayerOpacity;
156
+ $[16] = t13;
157
+ } else t13 = $[16];
158
+ let t14;
159
+ if ($[17] !== t13) {
160
+ t14 = iconStyleOf(t13);
161
+ $[17] = t13;
162
+ $[18] = t14;
163
+ } else t14 = $[18];
164
+ let t15;
165
+ if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
166
+ t15 = /* @__PURE__ */ jsx(SearchGlyph, {});
167
+ $[19] = t15;
168
+ } else t15 = $[19];
169
+ let t16;
170
+ if ($[20] !== t14) {
171
+ t16 = /* @__PURE__ */ jsx(IconStyleContext, {
172
+ value: t14,
173
+ children: t15
174
+ });
175
+ $[20] = t14;
176
+ $[21] = t16;
177
+ } else t16 = $[21];
178
+ let t17;
179
+ if ($[22] !== children || $[23] !== isDisabled || $[24] !== isInvalid || $[25] !== isRequired) {
180
+ t17 = /* @__PURE__ */ jsx(FieldStates, {
181
+ isDisabled,
182
+ isInvalid,
183
+ isRequired,
184
+ children
185
+ });
186
+ $[22] = children;
187
+ $[23] = isDisabled;
188
+ $[24] = isInvalid;
189
+ $[25] = isRequired;
190
+ $[26] = t17;
191
+ } else t17 = $[26];
192
+ let t18;
193
+ if ($[27] !== clearLabel || $[28] !== control || $[29] !== isDisabled || $[30] !== onClear || $[31] !== showsClear || $[32] !== styles.clear) {
194
+ t18 = showsClear ? /* @__PURE__ */ jsx(IconButton, {
195
+ "aria-label": clearLabel,
196
+ isDisabled,
197
+ onPress: clearFrom(onClear, control),
198
+ style: styles.clear,
199
+ children: /* @__PURE__ */ jsx(CloseGlyph, {})
200
+ }) : null;
201
+ $[27] = clearLabel;
202
+ $[28] = control;
203
+ $[29] = isDisabled;
204
+ $[30] = onClear;
205
+ $[31] = showsClear;
206
+ $[32] = styles.clear;
207
+ $[33] = t18;
208
+ } else t18 = $[33];
209
+ let t19;
210
+ if ($[34] !== T0 || $[35] !== feedback.handlers.onHoverIn || $[36] !== feedback.handlers.onHoverOut || $[37] !== feedback.handlers.onPressIn || $[38] !== feedback.handlers.onPressOut || $[39] !== feedback.layer || $[40] !== isDisabled || $[41] !== t10 || $[42] !== t12 || $[43] !== t16 || $[44] !== t17 || $[45] !== t18 || $[46] !== t7) {
211
+ t19 = /* @__PURE__ */ jsxs(T0, {
212
+ accessible: t3,
213
+ disabled: isDisabled,
214
+ focusable: t4,
215
+ onHoverIn: t5,
216
+ onHoverOut: t6,
217
+ onPress: t7,
218
+ onPressIn: t8,
219
+ onPressOut: t9,
220
+ style: t10,
221
+ children: [
222
+ t11,
223
+ t12,
224
+ t16,
225
+ t17,
226
+ t18
227
+ ]
228
+ });
229
+ $[34] = T0;
230
+ $[35] = feedback.handlers.onHoverIn;
231
+ $[36] = feedback.handlers.onHoverOut;
232
+ $[37] = feedback.handlers.onPressIn;
233
+ $[38] = feedback.handlers.onPressOut;
234
+ $[39] = feedback.layer;
235
+ $[40] = isDisabled;
236
+ $[41] = t10;
237
+ $[42] = t12;
238
+ $[43] = t16;
239
+ $[44] = t17;
240
+ $[45] = t18;
241
+ $[46] = t7;
242
+ $[47] = t19;
243
+ } else t19 = $[47];
244
+ return t19;
245
+ }
246
+ /**
247
+ * A search bar: a keyword typed into a pill, submitted with the keyboard's
248
+ * search key and cleared with its button. Pass `value` with `onChange` to
249
+ * control it, or `defaultValue` to let it keep its own; `onSubmit` is handed
250
+ * the value when the search key is pressed, and `onClear` is called when the
251
+ * field is emptied.
252
+ *
253
+ * The bar is the search page's rather than the box the other fields share;
254
+ * the control and the line under it are the field chrome in `src/field`.
255
+ * React Native's own `TextInput` props reach the control; `style` and `ref`
256
+ * are the field as a whole, and `inputRef` the control.
257
+ *
258
+ * ```tsx
259
+ * <SearchField label="Label" placeholder="Supporting text" />
260
+ * ```
261
+ */
262
+ function SearchField(t0) {
263
+ const $ = c(80);
264
+ let description;
265
+ let error;
266
+ let inputRef;
267
+ let label;
268
+ let name;
269
+ let onBlur;
270
+ let onChange;
271
+ let onClear;
272
+ let onFocus;
273
+ let onKeyPress;
274
+ let onSubmit;
275
+ let onSubmitEditing;
276
+ let props;
277
+ let ref;
278
+ let style;
279
+ let t1;
280
+ let t2;
281
+ let t3;
282
+ let t4;
283
+ let validate;
284
+ let value;
285
+ if ($[0] !== t0) {
286
+ ({clearLabel: t1, defaultValue: t2, description, error, inputRef, isDisabled: t3, isRequired: t4, label, name, onBlur, onChange, onClear, onFocus, onKeyPress, onSubmit, onSubmitEditing, ref, style, validate, value, ...props} = t0);
287
+ $[0] = t0;
288
+ $[1] = description;
289
+ $[2] = error;
290
+ $[3] = inputRef;
291
+ $[4] = label;
292
+ $[5] = name;
293
+ $[6] = onBlur;
294
+ $[7] = onChange;
295
+ $[8] = onClear;
296
+ $[9] = onFocus;
297
+ $[10] = onKeyPress;
298
+ $[11] = onSubmit;
299
+ $[12] = onSubmitEditing;
300
+ $[13] = props;
301
+ $[14] = ref;
302
+ $[15] = style;
303
+ $[16] = t1;
304
+ $[17] = t2;
305
+ $[18] = t3;
306
+ $[19] = t4;
307
+ $[20] = validate;
308
+ $[21] = value;
309
+ } else {
310
+ description = $[1];
311
+ error = $[2];
312
+ inputRef = $[3];
313
+ label = $[4];
314
+ name = $[5];
315
+ onBlur = $[6];
316
+ onChange = $[7];
317
+ onClear = $[8];
318
+ onFocus = $[9];
319
+ onKeyPress = $[10];
320
+ onSubmit = $[11];
321
+ onSubmitEditing = $[12];
322
+ props = $[13];
323
+ ref = $[14];
324
+ style = $[15];
325
+ t1 = $[16];
326
+ t2 = $[17];
327
+ t3 = $[18];
328
+ t4 = $[19];
329
+ validate = $[20];
330
+ value = $[21];
331
+ }
332
+ const clearLabel = t1 === void 0 ? CLEAR_LABEL : t1;
333
+ const defaultValue = t2 === void 0 ? "" : t2;
334
+ const isDisabled = t3 === void 0 ? false : t3;
335
+ const isRequired = t4 === void 0 ? false : t4;
336
+ const id = useId();
337
+ const control = useRef(null);
338
+ const [own, setOwn] = useState(defaultValue);
339
+ const current = value ?? own;
340
+ const t5 = current === "";
341
+ let t6;
342
+ if ($[22] !== current || $[23] !== error || $[24] !== isDisabled || $[25] !== isRequired || $[26] !== name || $[27] !== t5 || $[28] !== validate) {
343
+ t6 = {
344
+ control,
345
+ error,
346
+ isDisabled,
347
+ isEmpty: t5,
348
+ isReadOnly: false,
349
+ isRequired,
350
+ name,
351
+ submitted: current,
352
+ validate,
353
+ value: current
354
+ };
355
+ $[22] = current;
356
+ $[23] = error;
357
+ $[24] = isDisabled;
358
+ $[25] = isRequired;
359
+ $[26] = name;
360
+ $[27] = t5;
361
+ $[28] = validate;
362
+ $[29] = t6;
363
+ } else t6 = $[29];
364
+ const validation = useFieldValidation(t6);
365
+ let t7;
366
+ if ($[30] !== onBlur || $[31] !== validation.onBlur) {
367
+ t7 = blurThen(validation.onBlur, onBlur);
368
+ $[30] = onBlur;
369
+ $[31] = validation.onBlur;
370
+ $[32] = t7;
371
+ } else t7 = $[32];
372
+ let t8;
373
+ if ($[33] !== onFocus || $[34] !== t7) {
374
+ t8 = {
375
+ onBlur: t7,
376
+ onFocus
377
+ };
378
+ $[33] = onFocus;
379
+ $[34] = t7;
380
+ $[35] = t8;
381
+ } else t8 = $[35];
382
+ const focus = useFieldFocus(t8);
383
+ const clear = clearInto(setOwn, onChange, onClear, validation.onEdit);
384
+ const shownError = validation.error;
385
+ let t10;
386
+ let t9;
387
+ if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
388
+ t9 = () => control.current;
389
+ t10 = [];
390
+ $[36] = t10;
391
+ $[37] = t9;
392
+ } else {
393
+ t10 = $[36];
394
+ t9 = $[37];
395
+ }
396
+ useImperativeHandle(inputRef, t9, t10);
397
+ const T0 = View;
398
+ const T1 = SearchBar;
399
+ const t11 = focus.focused;
400
+ const t12 = shownError !== void 0;
401
+ const t13 = current !== "";
402
+ const T2 = FieldInput;
403
+ const t14 = focus.handlers;
404
+ let t15;
405
+ if ($[38] !== description || $[39] !== id || $[40] !== shownError) {
406
+ t15 = describedBy(id, {
407
+ description,
408
+ error: shownError
409
+ });
410
+ $[38] = description;
411
+ $[39] = id;
412
+ $[40] = shownError;
413
+ $[41] = t15;
414
+ } else t15 = $[41];
415
+ const t16 = !isDisabled;
416
+ let t17;
417
+ if ($[42] !== onChange || $[43] !== validation.onEdit) {
418
+ t17 = editInto(setOwn, onChange, validation.onEdit);
419
+ $[42] = onChange;
420
+ $[43] = validation.onEdit;
421
+ $[44] = t17;
422
+ } else t17 = $[44];
423
+ const t18 = keyInto(current === "" || isDisabled ? void 0 : clear, onKeyPress);
424
+ let t19;
425
+ if ($[45] !== current || $[46] !== onSubmit || $[47] !== onSubmitEditing) {
426
+ t19 = submitInto(current, onSubmit, onSubmitEditing);
427
+ $[45] = current;
428
+ $[46] = onSubmit;
429
+ $[47] = onSubmitEditing;
430
+ $[48] = t19;
431
+ } else t19 = $[48];
432
+ let t20;
433
+ if ($[49] !== T2 || $[50] !== current || $[51] !== focus.handlers || $[52] !== label || $[53] !== props || $[54] !== t15 || $[55] !== t16 || $[56] !== t17 || $[57] !== t18 || $[58] !== t19) {
434
+ t20 = /* @__PURE__ */ jsx(T2, {
435
+ ...props,
436
+ ...t14,
437
+ "aria-label": label,
438
+ described: t15,
439
+ editable: t16,
440
+ onChangeText: t17,
441
+ onKeyPress: t18,
442
+ onSubmitEditing: t19,
443
+ ref: control,
444
+ returnKeyType: "search",
445
+ role: "searchbox",
446
+ value: current
447
+ });
448
+ $[49] = T2;
449
+ $[50] = current;
450
+ $[51] = focus.handlers;
451
+ $[52] = label;
452
+ $[53] = props;
453
+ $[54] = t15;
454
+ $[55] = t16;
455
+ $[56] = t17;
456
+ $[57] = t18;
457
+ $[58] = t19;
458
+ $[59] = t20;
459
+ } else t20 = $[59];
460
+ let t21;
461
+ if ($[60] !== T1 || $[61] !== clear || $[62] !== clearLabel || $[63] !== focus.focused || $[64] !== isDisabled || $[65] !== isRequired || $[66] !== t12 || $[67] !== t13 || $[68] !== t20) {
462
+ t21 = /* @__PURE__ */ jsx(T1, {
463
+ clearLabel,
464
+ control,
465
+ isDisabled,
466
+ isFocused: t11,
467
+ isInvalid: t12,
468
+ isRequired,
469
+ onClear: clear,
470
+ showsClear: t13,
471
+ children: t20
472
+ });
473
+ $[60] = T1;
474
+ $[61] = clear;
475
+ $[62] = clearLabel;
476
+ $[63] = focus.focused;
477
+ $[64] = isDisabled;
478
+ $[65] = isRequired;
479
+ $[66] = t12;
480
+ $[67] = t13;
481
+ $[68] = t20;
482
+ $[69] = t21;
483
+ } else t21 = $[69];
484
+ let t22;
485
+ if ($[70] !== description || $[71] !== id || $[72] !== shownError) {
486
+ t22 = /* @__PURE__ */ jsx(FieldMessage, {
487
+ description,
488
+ error: shownError,
489
+ id
490
+ });
491
+ $[70] = description;
492
+ $[71] = id;
493
+ $[72] = shownError;
494
+ $[73] = t22;
495
+ } else t22 = $[73];
496
+ let t23;
497
+ if ($[74] !== T0 || $[75] !== ref || $[76] !== style || $[77] !== t21 || $[78] !== t22) {
498
+ t23 = /* @__PURE__ */ jsxs(T0, {
499
+ ref,
500
+ style,
501
+ children: [t21, t22]
502
+ });
503
+ $[74] = T0;
504
+ $[75] = ref;
505
+ $[76] = style;
506
+ $[77] = t21;
507
+ $[78] = t22;
508
+ $[79] = t23;
509
+ } else t23 = $[79];
510
+ return t23;
511
+ }
512
+ function submitInto(value, onSubmit, onSubmitEditing) {
513
+ return (event) => {
514
+ onSubmit?.(value);
515
+ onSubmitEditing?.(event);
516
+ };
517
+ }
518
+ //#endregion
519
+ export { SearchField };
520
+
521
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["ReactNode","Ref","RefObject","StyleProp","TextInput","TextInputKeyPressEvent","TextInputProps","TextInputSubmitEditingEvent","ViewStyle","useId","useImperativeHandle","useRef","useState","Pressable","StyleSheet","useWindowDimensions","View","ValidationResult","IconStyle","describedBy","FieldInput","FieldMessage","FieldStates","FieldStroke","useFieldFocus","useStrokeMotion","useFieldValidation","CloseGlyph","SearchGlyph","IconStyleContext","usePressFeedback","withOpacity","useTheme","composeStyles","themedStyles","IconButton","SearchBarProps","children","clearLabel","control","isDisabled","isFocused","isInvalid","isRequired","onClear","showsClear","SearchFieldProps","Omit","defaultValue","description","error","inputRef","label","name","onChange","value","onSubmit","placeholder","ref","style","validate","ICON_SIZE","MAX_WIDTH","CLEAR_LABEL","stylesOf","colors","radii","spacing","stateLayerOpacity","create","bar","alignItems","backgroundColor","surfaceContainerHigh","borderRadius","pill","flexDirection","gap","lg","maxWidth","paddingEnd","paddingStart","md","barDisabled","onSurface","disabledContainer","clear","marginEnd","xs","ring","bottom","left","pointerEvents","position","right","top","blurThen","onBlur","then","event","clearFrom","current","focus","clearInto","setOwn","onEdit","editInto","text","focusOf","iconStyleOf","color","size","keyInto","onKeyPress","undefined","nativeEvent","key","minHeightOf","minHeight","SearchBar","t0","$","_c","theme","styles","fontScale","sizing","typography","t1","t2","corners","disabled","disableRipple","feedback","primary","T0","t3","t4","t5","handlers","onHoverIn","t6","onHoverOut","t7","t8","onPressIn","t9","onPressOut","t10","controlLg","bodyLargeLineHeight","t11","layer","t12","width","t13","onSurfaceVariant","disabledContent","t14","t15","Symbol","for","t16","t17","t18","t19","SearchField","onFocus","onSubmitEditing","props","id","own","isEmpty","isReadOnly","submitted","validation","shownError","T1","focused","T2","submitInto","t20","t21","t22","t23","_c"],"sources":["../../../src/components/search-field/index.tsx"],"sourcesContent":["import type { ReactNode, Ref, RefObject } from 'react'\nimport type {\n StyleProp,\n TextInput,\n TextInputKeyPressEvent,\n TextInputProps,\n TextInputSubmitEditingEvent,\n ViewStyle,\n} from 'react-native'\n\nimport { useId, useImperativeHandle, useRef, useState } from 'react'\nimport { Pressable, StyleSheet, useWindowDimensions, View } from 'react-native'\n\nimport type { ValidationResult } from '../../form'\nimport type { IconStyle } from '../../glyphs/icon-style'\n\nimport {\n describedBy,\n FieldInput,\n FieldMessage,\n FieldStates,\n FieldStroke,\n useFieldFocus,\n useStrokeMotion,\n} from '../../field'\nimport { useFieldValidation } from '../../form'\nimport { CloseGlyph, SearchGlyph } from '../../glyphs'\nimport { IconStyleContext } from '../../glyphs/icon-style'\nimport { usePressFeedback } from '../../press'\nimport { withOpacity } from '../../theme/color'\nimport { useTheme } from '../../theme/scope'\nimport { composeStyles, themedStyles } from '../../theme/styles'\nimport { IconButton } from '../icon-button'\n\n// kanso-ui's SearchField: the search page's search bar on its own, rather\n// than the box the other fields share. A pill on surface container high, the\n// page's 24dp magnifier in on surface variant at the start, the value in body\n// large on surface, and a clear button at the end while the field holds\n// anything. The page's 16dp of padding is to a 48dp tap target and the icon\n// sits 12dp inside that, so the magnifier starts 28dp in and the value 4dp\n// past the target, at 68dp. The clear button is the medium icon button, 40dp\n// around a 24dp icon, 4dp in from the padding, so its icon ends 28dp from the\n// end. The bar follows its own width up to the page's 720dp; the page's 360dp\n// floor is left to the call site, since a phone's width less its margins is\n// under it.\n//\n// The bar is the large control height, 56dp, as web's is, and grows by as\n// much as the value's line does at the device's text size.\n//\n// Under a pointer and while pressed, the bar draws the state layer every\n// control draws through `usePressFeedback`, on surface at the hover and\n// pressed opacities, and a press anywhere on it focuses the control, as a\n// press anywhere on the other fields' boxes does. The page names a focused\n// state and draws nothing for it, so the bar takes the 2dp primary ring the\n// text fields page gives a focused field, inside the pill, as web's does. An\n// error is the text fields page's too, which the search page does not name:\n// the ring in the error role, 1dp at rest and 2dp once focused. The ring is a\n// border on a view of its own over the bar rather than a shadow, so the\n// colour and the width ease together and showing it moves nothing.\n//\n// **Disabled is the chrome's, translucent**, on surface at the disabled\n// opacities over whatever the bar sits on, as the text field's box is, rather\n// than mixed over the surface role as web's is.\n//\n// The label is the control's name and is never drawn, since the bar has no\n// place for one: the placeholder is what a person reads.\n\ntype SearchBarProps = {\n /** The field's input, between the magnifier and the clear button. */\n readonly children: ReactNode\n readonly clearLabel: string\n /** The control a press on the bar, or on the clear button, focuses. */\n readonly control: RefObject<null | TextInput>\n readonly isDisabled: boolean\n readonly isFocused: boolean\n readonly isInvalid: boolean\n readonly isRequired: boolean\n /** Empties the field, from the clear button. */\n readonly onClear: () => void\n /** Whether the field holds anything, which shows the clear button. */\n readonly showsClear: boolean\n}\n\ntype SearchFieldProps = Omit<\n TextInputProps,\n | 'accessibilityHint'\n | 'accessibilityLabel'\n | 'aria-disabled'\n | 'aria-label'\n | 'children'\n | 'cursorColor'\n | 'defaultValue'\n | 'editable'\n | 'multiline'\n | 'numberOfLines'\n | 'onChange'\n | 'onChangeText'\n | 'placeholderTextColor'\n | 'readOnly'\n | 'returnKeyType'\n | 'role'\n | 'selectionColor'\n | 'style'\n | 'underlineColorAndroid'\n | 'value'\n> & {\n /**\n * The name of the button that clears the field, for a screen reader.\n * Left out, it is \"Clear search\", the English name web's takes from React\n * Aria.\n */\n readonly clearLabel?: string\n /** The value the field opens with, when it keeps its own. */\n readonly defaultValue?: string\n /**\n * A hint shown under the bar. Replaced by `error` when there is one, so the\n * two never stack.\n */\n readonly description?: string\n /**\n * The problem with the current value, in words. Its presence is what puts\n * the field in its error state: the message, the ring in the error role,\n * and the invalid state a screen reader reads all follow from it. The line\n * under the bar arrives with the message, so the field grows when this\n * does, unless it is inside a `Form`, which keeps the line drawn. It wins\n * over what `validate` and the form say, and holds a `native` form back.\n */\n readonly error?: string\n /**\n * A ref to the field's own `TextInput`, which is what a call site moves\n * focus to. `ref` is the field as a whole.\n */\n readonly inputRef?: Ref<TextInput>\n /**\n * Draws the field disabled: it takes no focus and no input, and its clear\n * button no press.\n * @default false\n */\n readonly isDisabled?: boolean\n /**\n * Whether the field has to be filled in, which a screen reader reads.\n * Inside a `native` form, an empty one holds the submission back and shows\n * its error once a submission is tried. The bar draws no label, so there\n * is no asterisk to show it.\n * @default false\n */\n readonly isRequired?: boolean\n /**\n * What the field searches, for a screen reader. The bar draws no label, so\n * this is read and never shown; `placeholder` is what is seen.\n */\n readonly label: string\n /**\n * The name the value is submitted under by the `Form` around the field,\n * and the key its `validationErrors` reach the field by.\n */\n readonly name?: string\n /** Called with the new value as it is edited, and with `''` once cleared. */\n readonly onChange?: (value: string) => void\n /** Called once the field is emptied, from its clear button or Escape. */\n readonly onClear?: () => void\n /** Called with the value when the keyboard's search key submits it. */\n readonly onSubmit?: (value: string) => void\n /** The supporting text in the empty bar, which is what a person reads. */\n readonly placeholder?: string\n readonly ref?: Ref<View>\n /** Positions and sizes the field as a whole. */\n readonly style?: StyleProp<ViewStyle>\n /**\n * Checks the value, and returns its problem in words, or several, where\n * there is one, and `true`, `null` or `undefined` where there is none.\n * Under the default `aria` validation the error shows as the value\n * changes; inside a `native` form it shows once a submission is tried, or\n * once the field loses focus after an edit, and holds the form back.\n */\n readonly validate?: (value: string) => ValidationResult\n /** The value, when the call site keeps it. */\n readonly value?: string\n}\n\n// The page's icon, which the magnifier is drawn at.\nconst ICON_SIZE = 24\n\n// The widest the page draws a search bar.\nconst MAX_WIDTH = 720\n\n// The clear button's name when the call site gives none, as React Aria names\n// web's in English.\nconst CLEAR_LABEL = 'Clear search'\n\nconst stylesOf = themedStyles(({ colors, radii, spacing, stateLayerOpacity }) =>\n StyleSheet.create({\n bar: {\n alignItems: 'center',\n backgroundColor: colors.surfaceContainerHigh,\n borderRadius: radii.pill,\n flexDirection: 'row',\n gap: spacing.lg,\n maxWidth: MAX_WIDTH,\n paddingEnd: spacing.lg,\n paddingStart: spacing.lg + spacing.md,\n },\n barDisabled: {\n backgroundColor: withOpacity(\n colors.onSurface,\n stateLayerOpacity.disabledContainer,\n ),\n },\n // 4dp in from the padding, so the icon inside the 40dp button ends\n // 28dp from the end, where the page's 48dp target puts it.\n clear: {\n marginEnd: spacing.xs,\n },\n // The ring, over the whole bar and its corners. It takes no touches,\n // so a press lands on the bar under it.\n ring: {\n borderRadius: radii.pill,\n bottom: 0,\n left: 0,\n pointerEvents: 'none',\n position: 'absolute',\n right: 0,\n top: 0,\n },\n }),\n)\n\n// Empties the field: the value goes, and the call site is told twice over.\n// The field's own blur handling, then the call site's.\nfunction blurThen(\n onBlur: () => void,\n then: TextInputProps['onBlur'],\n): TextInputProps['onBlur'] {\n return (event) => {\n onBlur()\n then?.(event)\n }\n}\n\n// Empties the field from its button, and hands focus back to the control, so\n// the next keyword is typed straight in.\nfunction clearFrom(onClear: () => void, control: RefObject<null | TextInput>) {\n return () => {\n onClear()\n control.current?.focus()\n }\n}\n\nfunction clearInto(\n setOwn: (value: string) => void,\n onChange: ((value: string) => void) | undefined,\n onClear: (() => void) | undefined,\n onEdit: () => void,\n) {\n return () => {\n setOwn('')\n onEdit()\n onChange?.('')\n onClear?.()\n }\n}\n\n// Keeps an edit as the field's own value and reports it, so a field the call\n// site controls is told and one it does not still shows what was typed, and\n// tells the field's validation it was edited.\nfunction editInto(\n setOwn: (value: string) => void,\n onChange: ((value: string) => void) | undefined,\n onEdit: () => void,\n) {\n return (text: string) => {\n setOwn(text)\n onEdit()\n onChange?.(text)\n }\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\n// Escape empties a field that holds anything, from a hardware keyboard or\n// under React Native Web, as it does web's. The call site's own handler is\n// called after.\nfunction keyInto(\n clear: (() => void) | undefined,\n onKeyPress: TextInputProps['onKeyPress'],\n) {\n return (event: TextInputKeyPressEvent) => {\n if (clear !== undefined && event.nativeEvent.key === 'Escape') {\n clear()\n }\n onKeyPress?.(event)\n }\n}\n\nfunction minHeightOf(minHeight: number): ViewStyle {\n return { minHeight }\n}\n\n/**\n * The bar around the control: the pill with its state layer and ring, the\n * magnifier at the start and the clear button at the end. A press anywhere on\n * it focuses the control.\n */\nfunction SearchBar({\n children,\n clearLabel,\n control,\n isDisabled,\n isFocused,\n isInvalid,\n isRequired,\n onClear,\n showsClear,\n}: SearchBarProps) {\n const theme = useTheme()\n const styles = stylesOf(theme)\n const { fontScale } = useWindowDimensions()\n const { colors, radii, sizing, stateLayerOpacity, typography } = theme\n const feedback = usePressFeedback({\n color: colors.onSurface,\n corners: { borderRadius: radii.pill },\n disabled: isDisabled,\n disableRipple: true,\n })\n const ring = useStrokeMotion(\n isInvalid ? colors.error : colors.primary,\n isDisabled ? 0 : isFocused ? 2 : isInvalid ? 1 : 0,\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 onPressIn={feedback.handlers.onPressIn}\n onPressOut={feedback.handlers.onPressOut}\n style={composeStyles<ViewStyle>(\n styles.bar,\n isDisabled ? styles.barDisabled : undefined,\n minHeightOf(\n sizing.controlLg + typography.bodyLargeLineHeight * (fontScale - 1),\n ),\n )}\n >\n {feedback.layer}\n <FieldStroke\n color={ring.color}\n sides=\"all\"\n style={styles.ring}\n width={ring.width}\n />\n <IconStyleContext\n value={iconStyleOf(\n isDisabled\n ? withOpacity(colors.onSurface, stateLayerOpacity.disabledContent)\n : colors.onSurfaceVariant,\n )}\n >\n <SearchGlyph />\n </IconStyleContext>\n <FieldStates\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isRequired={isRequired}\n >\n {children}\n </FieldStates>\n {showsClear ? (\n <IconButton\n aria-label={clearLabel}\n isDisabled={isDisabled}\n onPress={clearFrom(onClear, control)}\n style={styles.clear}\n >\n <CloseGlyph />\n </IconButton>\n ) : null}\n </Pressable>\n )\n}\n\n/**\n * A search bar: a keyword typed into a pill, submitted with the keyboard's\n * search key and cleared with its button. Pass `value` with `onChange` to\n * control it, or `defaultValue` to let it keep its own; `onSubmit` is handed\n * the value when the search key is pressed, and `onClear` is called when the\n * field is emptied.\n *\n * The bar is the search page's rather than the box the other fields share;\n * the control and the line under it are the field chrome in `src/field`.\n * React Native's own `TextInput` props reach the control; `style` and `ref`\n * are the field as a whole, and `inputRef` the control.\n *\n * ```tsx\n * <SearchField label=\"Label\" placeholder=\"Supporting text\" />\n * ```\n */\nfunction SearchField({\n clearLabel = CLEAR_LABEL,\n defaultValue = '',\n description,\n error,\n inputRef,\n isDisabled = false,\n isRequired = false,\n label,\n name,\n onBlur,\n onChange,\n onClear,\n onFocus,\n onKeyPress,\n onSubmit,\n onSubmitEditing,\n ref,\n style,\n validate,\n value,\n ...props\n}: SearchFieldProps) {\n const id = useId()\n const control = useRef<TextInput>(null)\n const [own, setOwn] = useState(defaultValue)\n const current = value ?? own\n const validation = useFieldValidation({\n control,\n error,\n isDisabled,\n isEmpty: current === '',\n isReadOnly: false,\n isRequired,\n name,\n submitted: current,\n validate,\n value: current,\n })\n const focus = useFieldFocus({\n onBlur: blurThen(validation.onBlur, onBlur),\n onFocus,\n })\n const clear = clearInto(setOwn, onChange, onClear, validation.onEdit)\n const shownError = validation.error\n\n useImperativeHandle<null | TextInput, null | TextInput>(\n inputRef,\n () => control.current,\n [],\n )\n\n return (\n <View ref={ref} style={style}>\n <SearchBar\n clearLabel={clearLabel}\n control={control}\n isDisabled={isDisabled}\n isFocused={focus.focused}\n isInvalid={shownError !== undefined}\n isRequired={isRequired}\n onClear={clear}\n showsClear={current !== ''}\n >\n <FieldInput\n {...props}\n {...focus.handlers}\n aria-label={label}\n described={describedBy(id, { description, error: shownError })}\n editable={!isDisabled}\n onChangeText={editInto(setOwn, onChange, validation.onEdit)}\n onKeyPress={keyInto(\n current === '' || isDisabled ? undefined : clear,\n onKeyPress,\n )}\n onSubmitEditing={submitInto(current, onSubmit, onSubmitEditing)}\n ref={control}\n returnKeyType=\"search\"\n role=\"searchbox\"\n value={current}\n />\n </SearchBar>\n <FieldMessage description={description} error={shownError} id={id} />\n </View>\n )\n}\n\n// Hands the value to `onSubmit` when the keyboard's search key is pressed,\n// and the event to the call site's own handler after.\nfunction submitInto(\n value: string,\n onSubmit: ((value: string) => void) | undefined,\n onSubmitEditing: TextInputProps['onSubmitEditing'],\n) {\n return (event: TextInputSubmitEditingEvent) => {\n onSubmit?.(value)\n onSubmitEditing?.(event)\n }\n}\n\nexport { SearchField }\nexport type { SearchFieldProps }\n"],"mappings":";;;;;;;;;;;;;;AAqLA,MAAM6D,YAAY;AAGlB,MAAMC,YAAY;AAIlB,MAAMC,cAAc;AAEpB,MAAMC,WAAW9B,cAAc,EAAE+B,QAAQC,OAAOC,SAASC,wBACvDtD,WAAWuD,OAAO;CAChBC,KAAK;EACHC,YAAY;EACZC,iBAAiBP,OAAOQ;EACxBC,cAAcR,MAAMS;EACpBC,eAAe;EACfC,KAAKV,QAAQW;EACbC,UAAUjB;EACVkB,YAAYb,QAAQW;EACpBG,cAAcd,QAAQW,KAAKX,QAAQe;CACrC;CACAC,aAAa,EACXX,iBAAiBzC,YACfkC,OAAOmB,WACPhB,kBAAkBiB,iBACpB,EACF;CAGAC,OAAO,EACLC,WAAWpB,QAAQqB,GACrB;CAGAC,MAAM;EACJf,cAAcR,MAAMS;EACpBe,QAAQ;EACRC,MAAM;EACNC,eAAe;EACfC,UAAU;EACVC,OAAO;EACPC,KAAK;CACP;AACF,CAAC,CACH;AAIA,SAASC,SACPC,QACAC,MAC0B;CAC1B,QAAQC,UAAU;EAChBF,OAAO;EACPC,OAAOC,KAAK;CACd;AACF;AAIA,SAASC,UAAUxD,SAAqBL,SAAsC;CAC5E,aAAa;EACXK,QAAQ;EACRL,QAAQ8D,SAASC,MAAM;CACzB;AACF;AAEA,SAASC,UACPC,QACAlD,UACAV,SACA6D,QACA;CACA,aAAa;EACXD,OAAO,EAAE;EACTC,OAAO;EACPnD,WAAW,EAAE;EACbV,UAAU;CACZ;AACF;AAKA,SAAS8D,SACPF,QACAlD,UACAmD,QACA;CACA,QAAQE,SAAiB;EACvBH,OAAOG,IAAI;EACXF,OAAO;EACPnD,WAAWqD,IAAI;CACjB;AACF;AAEA,SAASC,QAAQrE,SAAsC;CACrD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