@oxy.so/bloom 2.12.4 → 3.0.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 (285) hide show
  1. package/README.md +4 -4
  2. package/docs/button-group.mdx +46 -4
  3. package/docs/composition.mdx +159 -0
  4. package/docs/field.mdx +39 -1
  5. package/docs/glass.mdx +61 -0
  6. package/docs/layout.mdx +72 -4
  7. package/docs/migrating-to-3.0.mdx +169 -0
  8. package/docs/page-header.mdx +237 -36
  9. package/lib/commonjs/button/Button.js +2 -0
  10. package/lib/commonjs/button/Button.js.map +1 -1
  11. package/lib/commonjs/button-group/ButtonGroup.js +124 -19
  12. package/lib/commonjs/button-group/ButtonGroup.js.map +1 -1
  13. package/lib/commonjs/control-surface/ControlSurface.js +46 -0
  14. package/lib/commonjs/control-surface/ControlSurface.js.map +1 -0
  15. package/lib/commonjs/control-surface/context.js +84 -0
  16. package/lib/commonjs/control-surface/context.js.map +1 -0
  17. package/lib/commonjs/control-surface/index.js +26 -0
  18. package/lib/commonjs/control-surface/index.js.map +1 -0
  19. package/lib/commonjs/control-surface/types.js +6 -0
  20. package/lib/commonjs/control-surface/types.js.map +1 -0
  21. package/lib/commonjs/field/Field.js +71 -26
  22. package/lib/commonjs/field/Field.js.map +1 -1
  23. package/lib/commonjs/field/context.js +80 -0
  24. package/lib/commonjs/field/context.js.map +1 -0
  25. package/lib/commonjs/field/index.js +7 -0
  26. package/lib/commonjs/field/index.js.map +1 -1
  27. package/lib/commonjs/floating/TriggerSlot.js +32 -0
  28. package/lib/commonjs/floating/TriggerSlot.js.map +1 -1
  29. package/lib/commonjs/glass/GlassIsland.js +107 -0
  30. package/lib/commonjs/glass/GlassIsland.js.map +1 -0
  31. package/lib/commonjs/glass/GlassSurface.js +4 -1
  32. package/lib/commonjs/glass/GlassSurface.js.map +1 -1
  33. package/lib/commonjs/glass/index.js +7 -0
  34. package/lib/commonjs/glass/index.js.map +1 -1
  35. package/lib/commonjs/index.js +564 -517
  36. package/lib/commonjs/index.js.map +1 -1
  37. package/lib/commonjs/index.web.js +564 -517
  38. package/lib/commonjs/index.web.js.map +1 -1
  39. package/lib/commonjs/label/Label.js +4 -1
  40. package/lib/commonjs/label/Label.js.map +1 -1
  41. package/lib/commonjs/layout/bottom-edge.js +3 -42
  42. package/lib/commonjs/layout/bottom-edge.js.map +1 -1
  43. package/lib/commonjs/layout/edge-store.js +65 -0
  44. package/lib/commonjs/layout/edge-store.js.map +1 -0
  45. package/lib/commonjs/layout/index.js +32 -0
  46. package/lib/commonjs/layout/index.js.map +1 -1
  47. package/lib/commonjs/layout/scroll-offset.js +83 -0
  48. package/lib/commonjs/layout/scroll-offset.js.map +1 -0
  49. package/lib/commonjs/layout/top-edge.js +109 -0
  50. package/lib/commonjs/layout/top-edge.js.map +1 -0
  51. package/lib/commonjs/page-header/EdgeScrim.js +136 -0
  52. package/lib/commonjs/page-header/EdgeScrim.js.map +1 -0
  53. package/lib/commonjs/page-header/PageHeader.js +236 -61
  54. package/lib/commonjs/page-header/PageHeader.js.map +1 -1
  55. package/lib/commonjs/provider/BloomProvider.js +5 -2
  56. package/lib/commonjs/provider/BloomProvider.js.map +1 -1
  57. package/lib/commonjs/social-button/OxyMark.js +2 -2
  58. package/lib/commonjs/social-button/OxyMark.js.map +1 -1
  59. package/lib/commonjs/social-button/SocialButton.js +2 -2
  60. package/lib/commonjs/social-button/SocialButton.js.map +1 -1
  61. package/lib/commonjs/styles/svg-id.js +29 -0
  62. package/lib/commonjs/styles/svg-id.js.map +1 -0
  63. package/lib/commonjs/text-field/TextField.js +39 -6
  64. package/lib/commonjs/text-field/TextField.js.map +1 -1
  65. package/lib/commonjs/theme/glass-colors.js +81 -1
  66. package/lib/commonjs/theme/glass-colors.js.map +1 -1
  67. package/lib/module/button/Button.js +2 -0
  68. package/lib/module/button/Button.js.map +1 -1
  69. package/lib/module/button-group/ButtonGroup.js +124 -19
  70. package/lib/module/button-group/ButtonGroup.js.map +1 -1
  71. package/lib/module/control-surface/ControlSurface.js +41 -0
  72. package/lib/module/control-surface/ControlSurface.js.map +1 -0
  73. package/lib/module/control-surface/context.js +77 -0
  74. package/lib/module/control-surface/context.js.map +1 -0
  75. package/lib/module/control-surface/index.js +5 -0
  76. package/lib/module/control-surface/index.js.map +1 -0
  77. package/lib/module/control-surface/types.js +4 -0
  78. package/lib/module/control-surface/types.js.map +1 -0
  79. package/lib/module/field/Field.js +72 -27
  80. package/lib/module/field/Field.js.map +1 -1
  81. package/lib/module/field/context.js +74 -0
  82. package/lib/module/field/context.js.map +1 -0
  83. package/lib/module/field/index.js +1 -0
  84. package/lib/module/field/index.js.map +1 -1
  85. package/lib/module/floating/TriggerSlot.js +33 -1
  86. package/lib/module/floating/TriggerSlot.js.map +1 -1
  87. package/lib/module/glass/GlassIsland.js +102 -0
  88. package/lib/module/glass/GlassIsland.js.map +1 -0
  89. package/lib/module/glass/GlassSurface.js +5 -2
  90. package/lib/module/glass/GlassSurface.js.map +1 -1
  91. package/lib/module/glass/index.js +1 -0
  92. package/lib/module/glass/index.js.map +1 -1
  93. package/lib/module/index.js +2 -1
  94. package/lib/module/index.js.map +1 -1
  95. package/lib/module/index.web.js +2 -1
  96. package/lib/module/index.web.js.map +1 -1
  97. package/lib/module/label/Label.js +4 -1
  98. package/lib/module/label/Label.js.map +1 -1
  99. package/lib/module/layout/bottom-edge.js +2 -41
  100. package/lib/module/layout/bottom-edge.js.map +1 -1
  101. package/lib/module/layout/edge-store.js +58 -0
  102. package/lib/module/layout/edge-store.js.map +1 -0
  103. package/lib/module/layout/index.js +8 -3
  104. package/lib/module/layout/index.js.map +1 -1
  105. package/lib/module/layout/scroll-offset.js +77 -0
  106. package/lib/module/layout/scroll-offset.js.map +1 -0
  107. package/lib/module/layout/top-edge.js +102 -0
  108. package/lib/module/layout/top-edge.js.map +1 -0
  109. package/lib/module/page-header/EdgeScrim.js +132 -0
  110. package/lib/module/page-header/EdgeScrim.js.map +1 -0
  111. package/lib/module/page-header/PageHeader.js +233 -58
  112. package/lib/module/page-header/PageHeader.js.map +1 -1
  113. package/lib/module/provider/BloomProvider.js +5 -2
  114. package/lib/module/provider/BloomProvider.js.map +1 -1
  115. package/lib/module/social-button/OxyMark.js +1 -1
  116. package/lib/module/social-button/OxyMark.js.map +1 -1
  117. package/lib/module/social-button/SocialButton.js +1 -1
  118. package/lib/module/social-button/SocialButton.js.map +1 -1
  119. package/lib/module/styles/svg-id.js +26 -0
  120. package/lib/module/styles/svg-id.js.map +1 -0
  121. package/lib/module/text-field/TextField.js +39 -6
  122. package/lib/module/text-field/TextField.js.map +1 -1
  123. package/lib/module/theme/glass-colors.js +79 -0
  124. package/lib/module/theme/glass-colors.js.map +1 -1
  125. package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/button-group/ButtonGroup.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/button-group/types.d.ts +61 -5
  128. package/lib/typescript/commonjs/button-group/types.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/control-surface/ControlSurface.d.ts +4 -0
  130. package/lib/typescript/commonjs/control-surface/ControlSurface.d.ts.map +1 -0
  131. package/lib/typescript/commonjs/control-surface/context.d.ts +21 -0
  132. package/lib/typescript/commonjs/control-surface/context.d.ts.map +1 -0
  133. package/lib/typescript/commonjs/control-surface/index.d.ts +4 -0
  134. package/lib/typescript/commonjs/control-surface/index.d.ts.map +1 -0
  135. package/lib/typescript/commonjs/control-surface/types.d.ts +37 -0
  136. package/lib/typescript/commonjs/control-surface/types.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/field/Field.d.ts +1 -1
  138. package/lib/typescript/commonjs/field/Field.d.ts.map +1 -1
  139. package/lib/typescript/commonjs/field/context.d.ts +55 -0
  140. package/lib/typescript/commonjs/field/context.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/field/index.d.ts +2 -0
  142. package/lib/typescript/commonjs/field/index.d.ts.map +1 -1
  143. package/lib/typescript/commonjs/field/types.d.ts +22 -3
  144. package/lib/typescript/commonjs/field/types.d.ts.map +1 -1
  145. package/lib/typescript/commonjs/floating/TriggerSlot.d.ts.map +1 -1
  146. package/lib/typescript/commonjs/glass/GlassIsland.d.ts +4 -0
  147. package/lib/typescript/commonjs/glass/GlassIsland.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/glass/GlassSurface.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/glass/index.d.ts +2 -1
  150. package/lib/typescript/commonjs/glass/index.d.ts.map +1 -1
  151. package/lib/typescript/commonjs/glass/types.d.ts +43 -0
  152. package/lib/typescript/commonjs/glass/types.d.ts.map +1 -1
  153. package/lib/typescript/commonjs/index.d.ts +2 -1
  154. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/index.web.d.ts +2 -1
  156. package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
  157. package/lib/typescript/commonjs/label/Label.d.ts.map +1 -1
  158. package/lib/typescript/commonjs/label/types.d.ts +7 -1
  159. package/lib/typescript/commonjs/label/types.d.ts.map +1 -1
  160. package/lib/typescript/commonjs/layout/bottom-edge.d.ts.map +1 -1
  161. package/lib/typescript/commonjs/layout/edge-store.d.ts +31 -0
  162. package/lib/typescript/commonjs/layout/edge-store.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/layout/index.d.ts +8 -3
  164. package/lib/typescript/commonjs/layout/index.d.ts.map +1 -1
  165. package/lib/typescript/commonjs/layout/scroll-offset.d.ts +16 -0
  166. package/lib/typescript/commonjs/layout/scroll-offset.d.ts.map +1 -0
  167. package/lib/typescript/commonjs/layout/top-edge.d.ts +77 -0
  168. package/lib/typescript/commonjs/layout/top-edge.d.ts.map +1 -0
  169. package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts +95 -0
  170. package/lib/typescript/commonjs/page-header/EdgeScrim.d.ts.map +1 -0
  171. package/lib/typescript/commonjs/page-header/PageHeader.d.ts +1 -1
  172. package/lib/typescript/commonjs/page-header/PageHeader.d.ts.map +1 -1
  173. package/lib/typescript/commonjs/page-header/index.d.ts +1 -1
  174. package/lib/typescript/commonjs/page-header/index.d.ts.map +1 -1
  175. package/lib/typescript/commonjs/page-header/types.d.ts +97 -10
  176. package/lib/typescript/commonjs/page-header/types.d.ts.map +1 -1
  177. package/lib/typescript/commonjs/provider/BloomProvider.d.ts.map +1 -1
  178. package/lib/typescript/commonjs/styles/svg-id.d.ts +20 -0
  179. package/lib/typescript/commonjs/styles/svg-id.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/text-field/TextField.d.ts.map +1 -1
  181. package/lib/typescript/commonjs/theme/glass-colors.d.ts +67 -0
  182. package/lib/typescript/commonjs/theme/glass-colors.d.ts.map +1 -1
  183. package/lib/typescript/module/button/Button.d.ts.map +1 -1
  184. package/lib/typescript/module/button-group/ButtonGroup.d.ts.map +1 -1
  185. package/lib/typescript/module/button-group/types.d.ts +61 -5
  186. package/lib/typescript/module/button-group/types.d.ts.map +1 -1
  187. package/lib/typescript/module/control-surface/ControlSurface.d.ts +4 -0
  188. package/lib/typescript/module/control-surface/ControlSurface.d.ts.map +1 -0
  189. package/lib/typescript/module/control-surface/context.d.ts +21 -0
  190. package/lib/typescript/module/control-surface/context.d.ts.map +1 -0
  191. package/lib/typescript/module/control-surface/index.d.ts +4 -0
  192. package/lib/typescript/module/control-surface/index.d.ts.map +1 -0
  193. package/lib/typescript/module/control-surface/types.d.ts +37 -0
  194. package/lib/typescript/module/control-surface/types.d.ts.map +1 -0
  195. package/lib/typescript/module/field/Field.d.ts +1 -1
  196. package/lib/typescript/module/field/Field.d.ts.map +1 -1
  197. package/lib/typescript/module/field/context.d.ts +55 -0
  198. package/lib/typescript/module/field/context.d.ts.map +1 -0
  199. package/lib/typescript/module/field/index.d.ts +2 -0
  200. package/lib/typescript/module/field/index.d.ts.map +1 -1
  201. package/lib/typescript/module/field/types.d.ts +22 -3
  202. package/lib/typescript/module/field/types.d.ts.map +1 -1
  203. package/lib/typescript/module/floating/TriggerSlot.d.ts.map +1 -1
  204. package/lib/typescript/module/glass/GlassIsland.d.ts +4 -0
  205. package/lib/typescript/module/glass/GlassIsland.d.ts.map +1 -0
  206. package/lib/typescript/module/glass/GlassSurface.d.ts.map +1 -1
  207. package/lib/typescript/module/glass/index.d.ts +2 -1
  208. package/lib/typescript/module/glass/index.d.ts.map +1 -1
  209. package/lib/typescript/module/glass/types.d.ts +43 -0
  210. package/lib/typescript/module/glass/types.d.ts.map +1 -1
  211. package/lib/typescript/module/index.d.ts +2 -1
  212. package/lib/typescript/module/index.d.ts.map +1 -1
  213. package/lib/typescript/module/index.web.d.ts +2 -1
  214. package/lib/typescript/module/index.web.d.ts.map +1 -1
  215. package/lib/typescript/module/label/Label.d.ts.map +1 -1
  216. package/lib/typescript/module/label/types.d.ts +7 -1
  217. package/lib/typescript/module/label/types.d.ts.map +1 -1
  218. package/lib/typescript/module/layout/bottom-edge.d.ts.map +1 -1
  219. package/lib/typescript/module/layout/edge-store.d.ts +31 -0
  220. package/lib/typescript/module/layout/edge-store.d.ts.map +1 -0
  221. package/lib/typescript/module/layout/index.d.ts +8 -3
  222. package/lib/typescript/module/layout/index.d.ts.map +1 -1
  223. package/lib/typescript/module/layout/scroll-offset.d.ts +16 -0
  224. package/lib/typescript/module/layout/scroll-offset.d.ts.map +1 -0
  225. package/lib/typescript/module/layout/top-edge.d.ts +77 -0
  226. package/lib/typescript/module/layout/top-edge.d.ts.map +1 -0
  227. package/lib/typescript/module/page-header/EdgeScrim.d.ts +95 -0
  228. package/lib/typescript/module/page-header/EdgeScrim.d.ts.map +1 -0
  229. package/lib/typescript/module/page-header/PageHeader.d.ts +1 -1
  230. package/lib/typescript/module/page-header/PageHeader.d.ts.map +1 -1
  231. package/lib/typescript/module/page-header/index.d.ts +1 -1
  232. package/lib/typescript/module/page-header/index.d.ts.map +1 -1
  233. package/lib/typescript/module/page-header/types.d.ts +97 -10
  234. package/lib/typescript/module/page-header/types.d.ts.map +1 -1
  235. package/lib/typescript/module/provider/BloomProvider.d.ts.map +1 -1
  236. package/lib/typescript/module/styles/svg-id.d.ts +20 -0
  237. package/lib/typescript/module/styles/svg-id.d.ts.map +1 -0
  238. package/lib/typescript/module/text-field/TextField.d.ts.map +1 -1
  239. package/lib/typescript/module/theme/glass-colors.d.ts +67 -0
  240. package/lib/typescript/module/theme/glass-colors.d.ts.map +1 -1
  241. package/package.json +15 -1
  242. package/src/button/Button.tsx +10 -1
  243. package/src/button-group/ButtonGroup.tsx +146 -19
  244. package/src/button-group/types.ts +68 -5
  245. package/src/control-surface/ControlSurface.tsx +41 -0
  246. package/src/control-surface/context.ts +81 -0
  247. package/src/control-surface/index.ts +4 -0
  248. package/src/control-surface/types.ts +40 -0
  249. package/src/field/Field.tsx +84 -27
  250. package/src/field/context.ts +110 -0
  251. package/src/field/index.ts +3 -0
  252. package/src/field/types.ts +22 -3
  253. package/src/floating/TriggerSlot.tsx +35 -1
  254. package/src/glass/GlassIsland.tsx +109 -0
  255. package/src/glass/GlassSurface.tsx +26 -2
  256. package/src/glass/index.ts +3 -0
  257. package/src/glass/types.ts +45 -0
  258. package/src/index.ts +6 -0
  259. package/src/index.web.ts +6 -0
  260. package/src/label/Label.tsx +3 -1
  261. package/src/label/types.ts +7 -1
  262. package/src/layout/bottom-edge.tsx +3 -56
  263. package/src/layout/edge-store.ts +69 -0
  264. package/src/layout/index.ts +8 -3
  265. package/src/layout/scroll-offset.ts +76 -0
  266. package/src/layout/top-edge.tsx +109 -0
  267. package/src/page-header/EdgeScrim.tsx +118 -0
  268. package/src/page-header/PageHeader.tsx +253 -61
  269. package/src/page-header/index.ts +9 -1
  270. package/src/page-header/types.ts +103 -10
  271. package/src/provider/BloomProvider.tsx +12 -1
  272. package/src/social-button/OxyMark.tsx +1 -1
  273. package/src/social-button/SocialButton.tsx +1 -1
  274. package/src/styles/svg-id.ts +23 -0
  275. package/src/text-field/TextField.tsx +44 -5
  276. package/src/theme/glass-colors.ts +80 -0
  277. package/lib/commonjs/social-button/use-svg-id.js +0 -16
  278. package/lib/commonjs/social-button/use-svg-id.js.map +0 -1
  279. package/lib/module/social-button/use-svg-id.js +0 -13
  280. package/lib/module/social-button/use-svg-id.js.map +0 -1
  281. package/lib/typescript/commonjs/social-button/use-svg-id.d.ts +0 -7
  282. package/lib/typescript/commonjs/social-button/use-svg-id.d.ts.map +0 -1
  283. package/lib/typescript/module/social-button/use-svg-id.d.ts +0 -7
  284. package/lib/typescript/module/social-button/use-svg-id.d.ts.map +0 -1
  285. package/src/social-button/use-svg-id.ts +0 -10
@@ -13,6 +13,7 @@ import { useReducedMotion } from 'react-native-reanimated';
13
13
 
14
14
  import { useTheme } from '../theme/use-theme';
15
15
  import { useInteractionState } from '../hooks/use-interaction-state';
16
+ import { useFieldControl } from '../field/context';
16
17
  import { mergeRefs } from '../hooks/merge-refs';
17
18
  import {
18
19
  atoms as a,
@@ -338,7 +339,15 @@ export function TextFieldInput({
338
339
  // Read directly rather than through `useTextFieldContext`: a missing root is
339
340
  // not an error here, it is the branch below.
340
341
  const ctx = useContext(Context);
341
- const inputDisabled = disabled === true || rest.editable === false;
342
+ // The enclosing `Field`, when there is one. This is the input's half of the
343
+ // association contract (`field/context.ts`): the field owns the id the label
344
+ // points at, which hint is currently described, the invalid state and the
345
+ // disabled state, and the input applies them. `disabled` combines with `||`
346
+ // because it is a constraint — a field that is off cannot be turned back on
347
+ // from inside it — while the id and the name DEFER to the field, so the
348
+ // visible label and the announced name cannot disagree.
349
+ const field = useFieldControl();
350
+ const inputDisabled = disabled === true || rest.editable === false || field?.disabled === true;
342
351
  const setInputDisabled = ctx?.setInputDisabled;
343
352
 
344
353
  // Report up, so the icon and suffix beside the input dim with it.
@@ -349,8 +358,16 @@ export function TextFieldInput({
349
358
  }, [setInputDisabled, inputDisabled]);
350
359
 
351
360
  if (ctx === null) {
361
+ // A standalone input wraps ITSELF in a field shell. The shell has to carry
362
+ // the enclosing `Field`'s invalid and disabled state too, or the chrome
363
+ // paints as if nothing were wrong while the input inside it is inert — the
364
+ // one arrangement where the two halves of the control disagree.
352
365
  return (
353
- <TextField isInvalid={isInvalid} disabled={disabled} size={size}>
366
+ <TextField
367
+ isInvalid={isInvalid || field?.invalid === true}
368
+ disabled={disabled || field?.disabled === true}
369
+ size={size}
370
+ >
354
371
  <TextFieldInput
355
372
  label={label}
356
373
  placeholder={placeholder}
@@ -375,7 +392,7 @@ export function TextFieldInput({
375
392
  ),
376
393
  );
377
394
 
378
- const invalid = ctx.isInvalid || isInvalid === true;
395
+ const invalid = ctx.isInvalid || isInvalid === true || field?.invalid === true;
379
396
  const fieldDisabled = ctx.disabled || inputDisabled;
380
397
  const state = {
381
398
  hovered: ctx.hovered,
@@ -392,12 +409,32 @@ export function TextFieldInput({
392
409
  'aria-disabled': fieldDisabled || undefined,
393
410
  'aria-invalid': invalid || undefined,
394
411
  };
412
+ // The enclosing `Field`'s wiring. `rest` is spread BEFORE these, so an
413
+ // explicit `nativeID` or `aria-describedby` on the input still wins — an app
414
+ // that already wired its own association keeps it.
415
+ const fieldProps = field
416
+ ? {
417
+ nativeID: rest.nativeID ?? field.controlId,
418
+ 'aria-describedby': (rest as Record<string, unknown>)['aria-describedby'] ?? field.describedBy,
419
+ 'aria-required': field.required || undefined,
420
+ }
421
+ : undefined;
422
+ // On web the `<label for>` already names the input, but `aria-label` would
423
+ // OVERRIDE it — so when the field has a text label the two must be the same
424
+ // string rather than two spellings of it. On native there is no association
425
+ // at all and this prop is the only name the control has.
426
+ const accessibleName = field?.labelText ?? label;
395
427
  const webDisabled = IS_WEB && fieldDisabled ? ({ disabled: true } as Record<string, unknown>) : undefined;
396
428
 
397
429
  if (floatingLabel) {
430
+ // The ids and the described-by still travel, so the error is announced —
431
+ // but a floating label inside a `Field` that also draws a label shows the
432
+ // same words twice, once above the box and once inside it. They are
433
+ // alternatives, not layers: use one or the other. `docs/field.mdx` says so
434
+ // where a caller will read it.
398
435
  return (
399
436
  <FloatingLabelInput
400
- label={label}
437
+ label={accessibleName}
401
438
  value={value}
402
439
  onChangeText={onChangeText}
403
440
  onFocus={onFocus}
@@ -406,6 +443,7 @@ export function TextFieldInput({
406
443
  refs={refs}
407
444
  style={style}
408
445
  {...rest}
446
+ {...fieldProps}
409
447
  {...disabledProps}
410
448
  {...webDisabled}
411
449
  />
@@ -462,9 +500,10 @@ export function TextFieldInput({
462
500
  accessibilityHint={undefined}
463
501
  hitSlop={{ top: 20, bottom: 20, left: 20, right: 20 }}
464
502
  {...rest}
503
+ {...fieldProps}
465
504
  {...disabledProps}
466
505
  {...webDisabled}
467
- accessibilityLabel={label}
506
+ accessibilityLabel={accessibleName}
468
507
  ref={refs}
469
508
  value={value}
470
509
  onChangeText={onChangeText}
@@ -271,3 +271,83 @@ export function resolveGlassColors(fill: string): GlassColors {
271
271
  hairlineWidth: BORDER_WIDTH.hairline,
272
272
  };
273
273
  }
274
+
275
+ /**
276
+ * The CHROME alpha — the neutral counterpart of {@link GLASS_FILL_ALPHA}.
277
+ *
278
+ * ── WHY A SECOND ALPHA AND NOT THE SAME ONE ─────────────────────────────────
279
+ *
280
+ * {@link GLASS_FILL_ALPHA} prices a BRAND fill: a `primary` button whose label
281
+ * is that fill's own on-colour, sitting on one of Bloom's five neutral
282
+ * surfaces. A page header's island is neither of those things. It is a NEUTRAL
283
+ * surface off the existing ladder (`styles/surface-levels`, rung 1 — the same
284
+ * fill a card and a menu panel paint) and it floats over content Bloom does not
285
+ * own: a photograph, a video still, a map, a list that scrolls under it. Its
286
+ * label is the theme's own `text`, not an on-fill token.
287
+ *
288
+ * So the two materials are priced against different backdrops, and the number
289
+ * that is right for one is wrong for the other in a measurable direction:
290
+ *
291
+ * brand fill backdrop ∈ Bloom's own five surfaces worst case: light mode,
292
+ * a white-ish page LIFTS
293
+ * the pane under a white
294
+ * label
295
+ * chrome fill backdrop ∈ [black, white] — anything worst case: DARK mode
296
+ * over a WHITE backdrop,
297
+ * which lifts a dark pane
298
+ * under a white label
299
+ *
300
+ * That is why dark carries the HIGHER alpha here and light the lower one, which
301
+ * is the opposite of the intuition that a dark UI can afford more transparency.
302
+ * A dark island has the whole luminance range above it to be washed out INTO; a
303
+ * light island over the same white backdrop barely moves, because it is already
304
+ * near white.
305
+ *
306
+ * ── WHAT THESE TWO VALUES BUY ───────────────────────────────────────────────
307
+ *
308
+ * Measured over 64 presets x the two extremes of the backdrop range, with the
309
+ * theme's own `text` as the label, in `theme/__tests__/glass-colors.test.ts`.
310
+ * The gate pins the floors EXACTLY, in both directions, so a hundredth in
311
+ * either direction has to be a decision:
312
+ *
313
+ * light 0.72 worst AA ratio over the range …pinned by the gate
314
+ * dark 0.80 worst AA ratio over the range …pinned by the gate
315
+ *
316
+ * and both remain genuinely translucent: the gate also measures how far the
317
+ * PAINTED pane moves between a black and a white backdrop, asserts that
318
+ * movement is non-zero, and asserts it is monotonic in the alpha — so an alpha
319
+ * quietly raised to 1.0 to buy contrast fails on the translucency side rather
320
+ * than passing on the legibility side.
321
+ */
322
+ export const GLASS_CHROME_ALPHA = { light: 0.72, dark: 0.8 } as const;
323
+
324
+ /**
325
+ * Resolve the pane around a NEUTRAL chrome fill — an island of controls
326
+ * floating over content.
327
+ *
328
+ * Both arguments are resolved colour strings the caller already holds, for the
329
+ * same reason {@link resolveGlassColors} takes one: the caller is the only one
330
+ * who knows which rung of the surface ladder its container sits on. In practice
331
+ * that is `resolveSurfaceLevel(theme, 1)` — `.background` for `fill`, `.border`
332
+ * for `hairline` — which is the fill a card and a menu panel already paint, so
333
+ * an island reads as Bloom chrome rather than as a fourth material.
334
+ *
335
+ * The LABEL is not returned, exactly as in `resolveGlassColors`: a neutral pane
336
+ * carries the theme's own `text`, and the rungs under it come from
337
+ * `surfaceTextOn(theme, fill)` — the caller is already holding both.
338
+ */
339
+ export function resolveChromeGlassColors(
340
+ fill: string,
341
+ hairline: string,
342
+ isDark: boolean,
343
+ ): GlassColors {
344
+ return {
345
+ fill: withAlpha(fill, GLASS_CHROME_ALPHA[isDark ? 'dark' : 'light']),
346
+ // The hairline keeps a little more body than the pane it edges: it is the
347
+ // lip of the island, and a hairline that dissolves at the same rate as the
348
+ // fill stops reading as an edge at exactly the moment the fill stops
349
+ // reading as a surface.
350
+ hairline: withAlpha(hairline, Math.min(1, GLASS_CHROME_ALPHA[isDark ? 'dark' : 'light'] + 0.12)),
351
+ hairlineWidth: BORDER_WIDTH.hairline,
352
+ };
353
+ }
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useSvgIdPrefix = useSvgIdPrefix;
7
- var _react = require("react");
8
- /**
9
- * A DOM-safe id prefix, per component instance. Two marks of one brand on a
10
- * page must not resolve each other's `url(#…)`, and React's `useId` carries
11
- * characters an SVG id cannot.
12
- */
13
- function useSvgIdPrefix(prefix) {
14
- return `${prefix}-${(0, _react.useId)().replace(/[^a-zA-Z0-9]/g, '')}-`;
15
- }
16
- //# sourceMappingURL=use-svg-id.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","useSvgIdPrefix","prefix","useId","replace"],"sourceRoot":"../../../src","sources":["social-button/use-svg-id.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAACC,MAAc,EAAU;EACrD,OAAO,GAAGA,MAAM,IAAI,IAAAC,YAAK,EAAC,CAAC,CAACC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,GAAG;AAC7D","ignoreList":[]}
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- import { useId } from 'react';
4
-
5
- /**
6
- * A DOM-safe id prefix, per component instance. Two marks of one brand on a
7
- * page must not resolve each other's `url(#…)`, and React's `useId` carries
8
- * characters an SVG id cannot.
9
- */
10
- export function useSvgIdPrefix(prefix) {
11
- return `${prefix}-${useId().replace(/[^a-zA-Z0-9]/g, '')}-`;
12
- }
13
- //# sourceMappingURL=use-svg-id.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useId","useSvgIdPrefix","prefix","replace"],"sourceRoot":"../../../src","sources":["social-button/use-svg-id.ts"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,OAAO;;AAE7B;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACC,MAAc,EAAU;EACrD,OAAO,GAAGA,MAAM,IAAIF,KAAK,CAAC,CAAC,CAACG,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,GAAG;AAC7D","ignoreList":[]}
@@ -1,7 +0,0 @@
1
- /**
2
- * A DOM-safe id prefix, per component instance. Two marks of one brand on a
3
- * page must not resolve each other's `url(#…)`, and React's `useId` carries
4
- * characters an SVG id cannot.
5
- */
6
- export declare function useSvgIdPrefix(prefix: string): string;
7
- //# sourceMappingURL=use-svg-id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-svg-id.d.ts","sourceRoot":"","sources":["../../../../src/social-button/use-svg-id.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD"}
@@ -1,7 +0,0 @@
1
- /**
2
- * A DOM-safe id prefix, per component instance. Two marks of one brand on a
3
- * page must not resolve each other's `url(#…)`, and React's `useId` carries
4
- * characters an SVG id cannot.
5
- */
6
- export declare function useSvgIdPrefix(prefix: string): string;
7
- //# sourceMappingURL=use-svg-id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-svg-id.d.ts","sourceRoot":"","sources":["../../../../src/social-button/use-svg-id.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD"}
@@ -1,10 +0,0 @@
1
- import { useId } from 'react';
2
-
3
- /**
4
- * A DOM-safe id prefix, per component instance. Two marks of one brand on a
5
- * page must not resolve each other's `url(#…)`, and React's `useId` carries
6
- * characters an SVG id cannot.
7
- */
8
- export function useSvgIdPrefix(prefix: string): string {
9
- return `${prefix}-${useId().replace(/[^a-zA-Z0-9]/g, '')}-`;
10
- }