@delacour/react-native-ui 0.4.1-alpha.20261021072908 → 0.4.1-alpha.20261021114607

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 (174) hide show
  1. package/package.json +1 -1
  2. package/src/{lib/cn.parity.test.ts → cn.parity.test.ts} +3 -3
  3. package/src/components/accordion/AGENTS.md +2 -2
  4. package/src/components/accordion/accordion.variants.test.ts +1 -3
  5. package/src/components/accordion/accordion.variants.ts +4 -6
  6. package/src/components/alert/AGENTS.md +1 -1
  7. package/src/components/alert/alert-glyphs.ts +1 -1
  8. package/src/components/alert/alert.variants.test.ts +2 -3
  9. package/src/components/alert/alert.variants.ts +1 -2
  10. package/src/components/animated-badge/AGENTS.md +1 -1
  11. package/src/components/animated-badge/animated-badge-glyph.tsx +1 -1
  12. package/src/components/attachment/AGENTS.md +1 -1
  13. package/src/components/attachment/attachment.utils.ts +1 -1
  14. package/src/components/avatar/avatar.utils.ts +1 -1
  15. package/src/components/badge/AGENTS.md +1 -1
  16. package/src/components/badge/badge.variants.ts +2 -3
  17. package/src/components/bottom-sheet/AGENTS.md +1 -1
  18. package/src/components/breadcrumb/AGENTS.md +1 -1
  19. package/src/components/breadcrumb/breadcrumb.variants.test.ts +1 -4
  20. package/src/components/button/AGENTS.md +3 -3
  21. package/src/components/button/button-group-separator.tsx +1 -1
  22. package/src/components/button/button.variants.ts +11 -12
  23. package/src/components/card/AGENTS.md +1 -1
  24. package/src/components/card/card.variants.ts +1 -2
  25. package/src/components/carousel/carousel.variants.ts +1 -2
  26. package/src/components/chart/chart.variants.ts +4 -5
  27. package/src/components/checkbox/AGENTS.md +8 -9
  28. package/src/components/checkbox/checkbox.variants.ts +12 -14
  29. package/src/components/chip/chip.variants.ts +2 -2
  30. package/src/components/circular-text/circular-text.variants.ts +1 -1
  31. package/src/components/collapsible/AGENTS.md +2 -4
  32. package/src/components/collapsible/collapsible.variants.test.ts +1 -4
  33. package/src/components/collapsible/collapsible.variants.ts +1 -1
  34. package/src/components/color-picker/color-picker.color.ts +1 -1
  35. package/src/components/combobox/combobox.filter.ts +1 -1
  36. package/src/components/combobox/combobox.variants.ts +2 -3
  37. package/src/components/compare/AGENTS.md +1 -1
  38. package/src/components/context-menu/context-menu.variants.ts +1 -1
  39. package/src/components/date-time-picker/date-time-picker.value.ts +1 -1
  40. package/src/components/dialog/AGENTS.md +2 -2
  41. package/src/components/dialog/dialog.variants.ts +1 -1
  42. package/src/components/direction/AGENTS.md +3 -1
  43. package/src/components/direction/direction.variants.ts +2 -2
  44. package/src/components/drawer/AGENTS.md +3 -2
  45. package/src/components/empty-state/empty-state.variants.ts +1 -2
  46. package/src/components/fab/AGENTS.md +1 -1
  47. package/src/components/feedback/AGENTS.md +4 -4
  48. package/src/components/feedback/feedback.variants.ts +3 -3
  49. package/src/components/field/AGENTS.md +4 -4
  50. package/src/components/field/field.variants.ts +6 -8
  51. package/src/components/flip-card/AGENTS.md +2 -3
  52. package/src/components/frame/frame.variants.ts +1 -2
  53. package/src/components/grid-item/grid-item.layout.ts +1 -2
  54. package/src/components/icon/AGENTS.md +1 -1
  55. package/src/components/icon/icon.variants.ts +2 -3
  56. package/src/components/image-viewer/AGENTS.md +1 -1
  57. package/src/components/image-viewer/image-viewer.variants.ts +1 -2
  58. package/src/components/input/AGENTS.md +5 -6
  59. package/src/components/input/input-group.tsx +1 -2
  60. package/src/components/input/input.tsx +1 -1
  61. package/src/components/input/input.variants.ts +15 -15
  62. package/src/components/item/AGENTS.md +4 -3
  63. package/src/components/item/item.variants.ts +2 -2
  64. package/src/components/label/AGENTS.md +3 -3
  65. package/src/components/label/label.variants.ts +5 -5
  66. package/src/components/list-group/list-group.variants.ts +2 -2
  67. package/src/components/map/AGENTS.md +4 -4
  68. package/src/components/markdown-editor/AGENTS.md +1 -1
  69. package/src/components/marquee/AGENTS.md +1 -1
  70. package/src/components/menu/menu.variants.ts +1 -1
  71. package/src/components/message-scroller/message-scroller.utils.ts +2 -2
  72. package/src/components/number-input/AGENTS.md +1 -1
  73. package/src/components/number-input/number-input.format.ts +2 -2
  74. package/src/components/number-input/number-input.variants.ts +2 -2
  75. package/src/components/number-input/use-step-repeat.ts +1 -1
  76. package/src/components/otp-input/otp-input.logic.ts +1 -1
  77. package/src/components/otp-input/otp-input.variants.ts +3 -3
  78. package/src/components/overlay/AGENTS.md +1 -1
  79. package/src/components/page-header/page-header.utils.ts +1 -2
  80. package/src/components/pagination/pagination.variants.test.ts +1 -5
  81. package/src/components/planner/planner-dates.ts +1 -1
  82. package/src/components/popover/AGENTS.md +1 -1
  83. package/src/components/popover/popover.position.ts +1 -2
  84. package/src/components/post/AGENTS.md +3 -2
  85. package/src/components/post/post.utils.ts +2 -2
  86. package/src/components/post/post.variants.ts +2 -2
  87. package/src/components/pressable/pressable.variants.ts +4 -4
  88. package/src/components/progress/progress.variants.ts +2 -2
  89. package/src/components/provider/AGENTS.md +1 -1
  90. package/src/components/qr-code/AGENTS.md +5 -5
  91. package/src/components/qr-code/qr-code.constants.ts +1 -1
  92. package/src/components/qr-code/qr-code.path.ts +2 -2
  93. package/src/components/qr-code/qr-code.tables.ts +2 -2
  94. package/src/components/qr-code/qr-code.variants.ts +2 -2
  95. package/src/components/questionnaire/AGENTS.md +1 -1
  96. package/src/components/questionnaire/questionnaire.logic.ts +1 -1
  97. package/src/components/radio/AGENTS.md +6 -7
  98. package/src/components/radio/radio-indicator.tsx +2 -2
  99. package/src/components/radio/radio.tsx +1 -1
  100. package/src/components/radio/radio.variants.test.ts +1 -4
  101. package/src/components/radio/radio.variants.ts +6 -6
  102. package/src/components/rating/AGENTS.md +2 -2
  103. package/src/components/screen/AGENTS.md +1 -1
  104. package/src/components/screen/screen.variants.ts +9 -9
  105. package/src/components/scroll-canvas/AGENTS.md +1 -1
  106. package/src/components/scroll-canvas/scroll-canvas.variants.ts +2 -2
  107. package/src/components/scroll-fade/AGENTS.md +1 -1
  108. package/src/components/scroll-header/AGENTS.md +2 -2
  109. package/src/components/scroll-text/AGENTS.md +1 -1
  110. package/src/components/search-bar/search-bar.debounce.ts +2 -2
  111. package/src/components/search-bar/search-bar.variants.ts +2 -2
  112. package/src/components/section-progress/AGENTS.md +2 -2
  113. package/src/components/select/AGENTS.md +2 -1
  114. package/src/components/select/select.variants.ts +5 -5
  115. package/src/components/separator/AGENTS.md +1 -1
  116. package/src/components/separator/separator.tsx +3 -3
  117. package/src/components/signature/AGENTS.md +1 -1
  118. package/src/components/signature/signature.stroke.ts +1 -1
  119. package/src/components/skeleton/AGENTS.md +1 -1
  120. package/src/components/sketch/AGENTS.md +2 -2
  121. package/src/components/sketch/sketch.paths.ts +2 -2
  122. package/src/components/slider/AGENTS.md +2 -2
  123. package/src/components/slider/slider-fill.tsx +3 -3
  124. package/src/components/slider/slider.variants.ts +7 -7
  125. package/src/components/sortable/sortable.variants.test.ts +1 -4
  126. package/src/components/spinner/AGENTS.md +1 -1
  127. package/src/components/spinner/spinner.variants.ts +3 -3
  128. package/src/components/splitter/AGENTS.md +5 -6
  129. package/src/components/splitter/splitter.math.ts +1 -1
  130. package/src/components/steps/AGENTS.md +2 -2
  131. package/src/components/steps/steps.variants.test.ts +1 -5
  132. package/src/components/steps/steps.variants.ts +1 -1
  133. package/src/components/support/AGENTS.md +3 -2
  134. package/src/components/surface/surface.variants.test.ts +2 -3
  135. package/src/components/surface/surface.variants.ts +1 -1
  136. package/src/components/switch/AGENTS.md +1 -2
  137. package/src/components/switch/switch.tsx +2 -3
  138. package/src/components/switch/switch.variants.test.ts +1 -5
  139. package/src/components/switch/switch.variants.ts +5 -5
  140. package/src/components/tabs/AGENTS.md +2 -2
  141. package/src/components/tabs/tabs-label.tsx +1 -1
  142. package/src/components/tabs/tabs.variants.ts +2 -2
  143. package/src/components/tag-input/AGENTS.md +1 -1
  144. package/src/components/tag-input/tag-input.logic.ts +2 -2
  145. package/src/components/tag-input/tag-input.variants.ts +2 -2
  146. package/src/components/text/text.tsx +2 -2
  147. package/src/components/text/text.variants.ts +3 -3
  148. package/src/components/text-animation/AGENTS.md +4 -4
  149. package/src/components/textarea/AGENTS.md +2 -2
  150. package/src/components/textarea/textarea.variants.test.ts +1 -4
  151. package/src/components/textarea/textarea.variants.ts +6 -7
  152. package/src/components/theme-selector/theme-selector.logic.ts +1 -1
  153. package/src/components/theme-selector/theme-selector.variants.ts +1 -1
  154. package/src/components/time-picker/time-picker.time.ts +1 -1
  155. package/src/components/time-picker/time-picker.variants.ts +2 -2
  156. package/src/components/toast/AGENTS.md +2 -2
  157. package/src/components/toast/toast.timer.ts +1 -2
  158. package/src/components/toggle-button/toggle-button.variants.ts +3 -3
  159. package/src/components/tooltip/AGENTS.md +2 -2
  160. package/src/components/tree/tree.variants.test.ts +1 -4
  161. package/src/components/tree/tree.variants.ts +1 -1
  162. package/src/hooks/use-keyboard-state-sync.tsx +1 -1
  163. package/src/hooks/use-navigation-theme.ts +1 -1
  164. package/src/lib/cn.ts +1 -1
  165. package/src/lib/color.ts +2 -2
  166. package/src/lib/keyboard-animation.ts +2 -3
  167. package/src/lib/navigation-theme.ts +2 -3
  168. package/src/lib/paging.ts +1 -1
  169. package/src/lib/scroll-edges.ts +1 -1
  170. package/src/lib/scroll-maths.ts +2 -2
  171. package/src/lib/wrap-text-children.ts +1 -1
  172. package/src/styles/theme-tokens.test.ts +9 -2
  173. package/src/styles/theme.css +4 -5
  174. package/src/styles/tokens.css +1 -1
@@ -79,8 +79,8 @@ is part of the context's own shape, so it lives beside it.
79
79
  - **The colour is a token read with `useThemeColor`, not a class.** A path's
80
80
  `fill` is a paint prop no `className` reaches. `RATING_FILL_TOKEN` names the
81
81
  token per colour and `resolveRatingPaint` settles it, so the whole paint matrix
82
- is reachable from `bun test`, which also checks every token it names exists in
83
- both variants of `theme.css`.
82
+ is unit-testable<!-- registry:omit -->, and `bun test` also checks every token it names exists in
83
+ both variants of `theme.css`<!-- /registry:omit -->.
84
84
  - **An empty star is `muted-foreground` at 40% — the same chrome at every colour.**
85
85
  No token sits where an empty star needs to: `border` and `input` vanish against
86
86
  a light card, and `muted-foreground` at full strength reads as a disabled
@@ -196,7 +196,7 @@ whole-screen states.
196
196
  flush against the chrome wants the line from the first frame — with the fade
197
197
  always on, screens re-added a border by hand, which is the signal the default
198
198
  was wrong. Both ramps are written out rather than calling Reanimated's
199
- `interpolate`, so they stay reachable from `bun test`, and both clamp at each
199
+ `interpolate`, so they stay unit-testable, and both clamp at each
200
200
  end because a rubber-banded overscroll reports a negative offset.
201
201
 
202
202
  ## ScrollShadow
@@ -11,7 +11,7 @@ export type ScreenPlacement = (typeof SCREEN_PLACEMENTS)[number];
11
11
  *
12
12
  * Structurally `Edge` from react-native-safe-area-context, restated here so
13
13
  * this module keeps its promise of importing nothing — the whole reason it is
14
- * reachable from `bun test`.
14
+ * unit-testable.
15
15
  */
16
16
  export const SCREEN_EDGES = ["top", "right", "bottom", "left"] as const;
17
17
 
@@ -39,8 +39,8 @@ export type ScreenEdge = (typeof SCREEN_EDGES)[number];
39
39
  * navbar's own box, and the safe-area band has to be painted too or the status
40
40
  * bar shows content scrolling underneath it.
41
41
  *
42
- * Free of React Native imports so it stays unit-testable — `bun test` cannot
43
- * parse React Native's Flow-typed source. See AGENTS.md.
42
+ * Free of React Native imports so it stays unit-testable — it must not
43
+ * pull in React Native's Flow-typed source. See AGENTS.md.
44
44
  */
45
45
  export const screenVariants = tv({
46
46
  slots: {
@@ -179,7 +179,7 @@ export const SCREEN_BORDER_FADE_DISTANCE = 20;
179
179
  * a rubber-banded overscroll reports a negative offset, which would otherwise
180
180
  * drive the opacity below zero.
181
181
  *
182
- * Pure, so the whole ramp is reachable from `bun test`. Written out rather than
182
+ * Pure, so the whole ramp is unit-testable. Written out rather than
183
183
  * calling Reanimated's `interpolate` so this module keeps its promise of
184
184
  * importing nothing. See AGENTS.md.
185
185
  */
@@ -208,7 +208,7 @@ export function resolveNavbarBorderOpacity(scrollY: number, fadeOnScroll: boolea
208
208
  * treated as "draw it": before any scroll a screen tall enough to scroll does
209
209
  * have content below, and a screen too short to scroll never contradicts it.
210
210
  *
211
- * Pure, so the whole ramp is reachable from `bun test`. See AGENTS.md.
211
+ * Pure, so the whole ramp is unit-testable. See AGENTS.md.
212
212
  */
213
213
  export function resolveFooterBorderOpacity(state: {
214
214
  /** Live scroll offset. */
@@ -257,7 +257,7 @@ export type ScreenEdgePadding = {
257
257
  * is that a caller's className belongs on a different box entirely — see
258
258
  * `screen-header.tsx`.
259
259
  *
260
- * Pure, so the whole matrix is reachable from `bun test`. See AGENTS.md.
260
+ * Pure, so the whole matrix is unit-testable. See AGENTS.md.
261
261
  */
262
262
  export function resolveScreenEdgePadding(
263
263
  edges: readonly ScreenEdge[] | undefined,
@@ -378,7 +378,7 @@ export type ScreenScrollInsetMode = (typeof SCREEN_SCROLL_INSET_MODES)[number];
378
378
  * With no footer mounted the reserve is the bare safe-area band, which fades out
379
379
  * as the keyboard covers it — the inset is meaningless behind a keyboard.
380
380
  *
381
- * Pure, so the whole matrix is reachable from `bun test`. See AGENTS.md.
381
+ * Pure, so the whole matrix is unit-testable. See AGENTS.md.
382
382
  */
383
383
  export function resolveScrollBottomInset(state: {
384
384
  mode: ScreenScrollInsetMode;
@@ -429,7 +429,7 @@ export function resolveScrollBottomInset(state: {
429
429
  *
430
430
  * A `static` navbar contributes nothing: it already took its space in the flow.
431
431
  *
432
- * Pure, so the whole matrix is reachable from `bun test`. See AGENTS.md.
432
+ * Pure, so the whole matrix is unit-testable. See AGENTS.md.
433
433
  */
434
434
  export function resolveScrollTopInset(state: {
435
435
  navbarHeight: number;
@@ -448,7 +448,7 @@ export function resolveScrollTopInset(state: {
448
448
  * screen with no navbar still clears the notch. A `static` navbar or footer
449
449
  * contributes nothing: it already took its space in the flow.
450
450
  *
451
- * Pure, so the whole matrix is reachable from `bun test`. See AGENTS.md.
451
+ * Pure, so the whole matrix is unit-testable. See AGENTS.md.
452
452
  */
453
453
  export function resolveScreenViewPadding(state: {
454
454
  navbarHeight: number;
@@ -90,7 +90,7 @@ thumb. The frame is the layout; only what is inside it moves. A single component
90
90
 
91
91
  ## Verification notes
92
92
 
93
- `bun test` covers the maths, the slots and the props union. Rendering was checked
93
+ The maths, the slots and the props union are unit-tested. Rendering was checked
94
94
  on an iOS simulator (iPhone 17, warden lease, agent-device) on 2026-10-05:
95
95
 
96
96
  - **Parallax** drifts the picture down through the frame as the page rises and
@@ -8,11 +8,11 @@ import { tv } from "../../lib/tv";
8
8
  * **Every resolver is a self-contained `"worklet"`.** They run inside
9
9
  * `useDerivedValue` / `useAnimatedStyle` on the UI thread, and a module-scope
10
10
  * helper called from a worklet can be missing from its closure there —
11
- * `undefined is not a function` mid-scroll, invisible to `bun test`. So each
11
+ * `undefined is not a function` mid-scroll, invisible to unit tests. So each
12
12
  * writes its own clamp inline and none calls another; do not tidy the
13
13
  * repetition into a helper.
14
14
  *
15
- * Free of React Native imports, so the whole table is reachable from `bun test`.
15
+ * Free of React Native imports, so the whole table is unit-testable.
16
16
  */
17
17
 
18
18
  /** What moves inside the still frame. */
@@ -86,7 +86,7 @@ Their rules and tests live with them. Nothing here keeps a copy.
86
86
  values; the gradient itself is static and only its opacity moves.
87
87
  - **Every worklet in `scroll-maths.ts` and `scroll-edges.ts` is self-contained.** A module-scope helper
88
88
  called from inside a worklet can be missing from its closure on the UI thread
89
- — `undefined is not a function` mid-scroll, invisible to `bun test`. Each
89
+ — `undefined is not a function` mid-scroll, invisible to unit tests. Each
90
90
  function writes its own clamp inline and calls no other. Do not tidy that into
91
91
  a shared helper.
92
92
  - **No calm-motion branch.** The opacity follows the user's own finger; nothing
@@ -137,8 +137,8 @@ from the scroller's testID with `momentum: false` and returns to rest, so the lo
137
137
  | `blur-bar` | collapse under the blur bar, back open | The blur bar |
138
138
  | `react-to-collapse` | collapse (avatar and Follow arrive), back open | Reacting to collapse |
139
139
 
140
- `early-handover` and `no-large` stay gallery-only (`align: "stretch"`). Recapture with
141
- `bun run previews -- -- --only scroll-header`; `cover` loads a remote image, so it needs network.
140
+ `early-handover` and `no-large` stay gallery-only (`align: "stretch"`). `cover` loads a remote image, so it needs network.
141
+ <!-- registry:omit -->Recapture with `bun run previews -- -- --only scroll-header`.<!-- /registry:omit -->
142
142
 
143
143
  ## Simulator check
144
144
 
@@ -70,7 +70,7 @@ measuring text inherit the identical class.
70
70
  come from `useThemeColor` once per theme and reach each unit as plain strings, so a frame
71
71
  interpolates two constants. The stagger (`resolveRevealProgress`) and the effect
72
72
  (`resolveEffectFrame`) are pure worklet functions in the variants file, which is how the whole
73
- motion model is under `bun test`.
73
+ motion model is unit-testable.
74
74
  - **The stagger fits inside the window.** Slot `span = 1 / (1 + (n−1)(1−overlap))`, step
75
75
  `span·(1−overlap)`; the last unit ends exactly at 1, so the block is fully revealed the moment its
76
76
  top reaches `end`, whatever `n` and `overlap` are.
@@ -1,6 +1,6 @@
1
1
  /**
2
- * A debouncer with its clock injected, so every rule below is reachable from
3
- * `bun test` with a fake one and no real timer.
2
+ * A debouncer with its clock injected, so every rule below is unit-testable
3
+ * with a fake one and no real timer.
4
4
  *
5
5
  * `H` is whatever the scheduler hands back — `ReturnType<typeof setTimeout>` in
6
6
  * the component, a plain number in the test.
@@ -56,8 +56,8 @@ export const SEARCH_BAR_CLEAR_FADE_DURATION = 100;
56
56
  * `Input.Group`'s, drawn by `inputVariants`' `root` slot, and none of it is
57
57
  * restated here: the `field` slot adds only the shape's corner on top. A second
58
58
  * border or height would be a second definition of one box, and the drift
59
- * would be a pixel nobody notices until it ships. `search-bar.variants.test.ts`
60
- * asserts the slot stays free of chrome.
59
+ * would be a pixel nobody notices until it ships. The slot
60
+ * must stay free of chrome.
61
61
  *
62
62
  * `root` is the row holding the field and the Cancel action, with no gap: the
63
63
  * gap lives inside Cancel's own measured width, so it collapses with it rather
@@ -71,8 +71,8 @@ rule keeps such a type in its consumer's file.
71
71
  rule between it and the list. Closed, it wears its own capsule. One `SectionProgressPill` renders
72
72
  both, so the two can never disagree.
73
73
  - **The list scrolls past six rows.** Rows are `min-h-11` — a 44pt touch target — and the list's
74
- max height is six of them plus its `py-1`. `section-progress.variants.test.ts` reads both numbers
75
- back out of the slots, so retuning a row moves the threshold with it.
74
+ max height is six of them plus its `py-1`. Both numbers are read
75
+ back out of the slots, so retuning a row moves the threshold with it<!-- registry:omit --> (`section-progress.variants.test.ts` pins this)<!-- /registry:omit -->.
76
76
  - **A transparent full-screen scrim closes the panel on an outside tap.** It is a `Pressable` with
77
77
  `feedback="none"`, hidden from assistive technology — the escape gesture is VoiceOver's way out.
78
78
  - **The label is capped at sixty percent of the window, on one line.** `resolveLabelMaxWidth`.
@@ -25,7 +25,8 @@ engine. An app that imports no picker still never resolves it.
25
25
  | `select.context.tsx` | `SelectProvider`, `useSelect()`, `useSelectContext()`, `useSelectPart()` |
26
26
  | `select.types.ts` | `SelectOption`, `SelectOptionGroup`, `SelectRowOption`, `SelectEntry`, `SelectListRow`, `SelectHighlightRange` |
27
27
  | `select.variants.ts` | Pure `tv()` slots + every resolver, no RN imports |
28
- | `select.variants.test.ts`, `select.collect.test.ts` | |
28
+ | `select.variants.test.ts` | |
29
+ | `select.collect.test.ts` | |
29
30
 
30
31
  ## Design
31
32
 
@@ -75,8 +75,8 @@ export function resolveSelectSheetMaxHeight({
75
75
  * reached through `resolveInputGroupClass` — the same row a decorated field
76
76
  * wears — so a select sitting under a text field in a form is the same box
77
77
  * rather than a lookalike. The `trigger` slot adds only what a trigger has and
78
- * a field does not. `select.variants.test.ts` sweeps every variant, size and
79
- * state and asserts every utility of the field's box is present on the trigger.
78
+ * a field does not. Every utility of the field's box, in every
79
+ * variant, size and state, must be present on the trigger.
80
80
  *
81
81
  * **A row's floor is ListGroup's.** `min-h-12/14/16` at `sm/md/lg`, so a row in
82
82
  * the sheet sits level with a `ListGroup` row on the screen behind it; the test
@@ -91,8 +91,8 @@ export function resolveSelectSheetMaxHeight({
91
91
  * `../checkbox`, whose animated, measured box is a control in its own right and
92
92
  * would answer presses the row already answers.
93
93
  *
94
- * Free of React Native imports so it stays unit-testable — `bun test` cannot
95
- * parse React Native's Flow-typed source. See AGENTS.md.
94
+ * Free of React Native imports so it stays unit-testable — it must not
95
+ * pull in React Native's Flow-typed source. See AGENTS.md.
96
96
  */
97
97
  export const selectVariants = tv({
98
98
  slots: {
@@ -197,7 +197,7 @@ export type SelectVariantProps = VariantProps<typeof selectVariants>;
197
197
  * `isFocused` is the sheet being open — the ring says which field the sheet
198
198
  * belongs to. Invalid outranks it, exactly as it does on a field.
199
199
  *
200
- * Pure, so the whole matrix is reachable from `bun test`. See AGENTS.md.
200
+ * Pure, so the whole matrix is unit-testable. See AGENTS.md.
201
201
  */
202
202
  export function resolveSelectTriggerClass({
203
203
  className,
@@ -16,7 +16,7 @@ carries nothing a screen reader can use, and announcing them buries the rows.
16
16
 
17
17
  - **`separatorVariants` lives in `separator.tsx`**, above the component, not in a
18
18
  `*.variants.ts` sibling — the pattern C carve-out. That file imports React
19
- Native, so the `tv()` is not reachable from `bun test`; the exclusive-axis and
19
+ Native, so the `tv()` is not unit-testable; the exclusive-axis and
20
20
  `self-stretch` rules below are stated in its doc comment instead of asserted.
21
21
  - **Orientations**: `horizontal` (default), `vertical`.
22
22
  - **The long axis is `self-stretch`, never `w-full` / `h-full`.** Yoga resolves
@@ -25,9 +25,9 @@ export type SeparatorOrientation = (typeof SEPARATOR_ORIENTATIONS)[number];
25
25
  *
26
26
  * Declared here rather than in a `*.variants.ts` sibling because a separator is
27
27
  * a single styled element with no compound parts and no pure resolvers — there
28
- * is no slot set for another file to share. The cost is that `bun test` cannot
29
- * reach it: this module imports React Native, whose Flow-typed source Bun's
30
- * transpiler cannot parse. See AGENTS.md.
28
+ * is no slot set for another file to share. The cost is that a plain
29
+ * unit test cannot reach it: this module imports React Native, whose Flow-typed
30
+ * source a bare JS runtime cannot parse. See AGENTS.md.
31
31
  */
32
32
  export const separatorVariants = tv({
33
33
  base: "self-stretch bg-border",
@@ -68,7 +68,7 @@ a standalone SVG document.
68
68
  - **The history is a pure reducer, and a no-op returns the same reference.** That
69
69
  is what lets the root skip both the render and `onValueChange` for an undo with
70
70
  nothing to undo, and what makes undo, redo and the redo-dropped-by-a-new-stroke
71
- rule reachable from `bun test`.
71
+ rule unit-testable.
72
72
  - **Clear is final.** It empties the redo stack too and is not undoable. A clear
73
73
  that undo could reverse is a clear that needs explaining, and the button is
74
74
  labelled "Clear signature" because that label is the only warning there is.
@@ -5,7 +5,7 @@ import type { SignatureExportOptions, SignaturePoint, SignatureStroke, Signature
5
5
  * The pure half of a signature: smoothing, the undo history, bounds, re-fitting
6
6
  * and SVG export.
7
7
  *
8
- * Free of React Native imports so `bun test` reaches all of it. The smoother and
8
+ * Free of React Native imports so a unit test reaches all of it. The smoother and
9
9
  * the point filter carry `"worklet"`, because the live stroke is rebuilt from
10
10
  * them on the UI thread on every move — the same function that draws the
11
11
  * finished path, so a stroke does not shift when it is committed.
@@ -102,7 +102,7 @@ with a glint sweeping across it, or a pulse, on the UI thread. Compound root plu
102
102
  each line. Once loaded the skeleton contributes no accessibility props at all
103
103
  and the content speaks for itself. `resolveSkeletonAccessibility` returns a
104
104
  discriminated union (`hidden` / `status` / `content`) so the three cases are
105
- pinned in `bun test`.
105
+ pinned by a unit test.
106
106
  - **An unlabelled group takes no role.** It may hold real content beside its
107
107
  placeholders, and hiding the group would hide that too; each skeleton already
108
108
  hides itself.
@@ -205,8 +205,8 @@ Drawing is a pointer task; the goal is operable and honest, not equivalent.
205
205
 
206
206
  ## Verification
207
207
 
208
- - `bun test packages/react-native-ui/src/components/sketch` covers the leaf and
209
- the resolvers.
208
+ - <!-- registry:omit -->`bun test packages/react-native-ui/src/components/sketch` covers the leaf and
209
+ the resolvers.<!-- /registry:omit -->
210
210
  - **Checked on Skia (iPhone 17 Pro simulator, dev client, 2026-10-06):** the
211
211
  seeded picture renders; a red stroke drawn with no pause after the swatch tap
212
212
  is red; the eraser clears earlier marks and a later pen stroke over the gap is
@@ -6,7 +6,7 @@
6
6
  * not `react-native-svg` — not even a sibling. A freehand signature is the same
7
7
  * stroke pipeline with fixed ink, and it should take this file rather than fork
8
8
  * it; anything imported here would be a dependency of every such reuse.
9
- * `sketch.paths.test.ts` asserts the file has no `import` at all.
9
+ * The file must have no `import` at all.
10
10
  *
11
11
  * **Strings, not points.** A stroke is built as a path string, one segment
12
12
  * appended per touch sample, because the live stroke is drawn from a string on
@@ -14,7 +14,7 @@
14
14
  * array copy per sample and a join per frame.
15
15
  *
16
16
  * The functions the gesture calls are marked `"worklet"` and are still plain
17
- * functions to `bun test`. They read no module-scope binding but each other, and
17
+ * functions to a unit test. They read no module-scope binding but each other, and
18
18
  * every number they need is inlined — see AGENTS.md on worklet capture.
19
19
  */
20
20
 
@@ -158,7 +158,7 @@ package's first drag-driven control, and its first `Gesture.Pan()`.
158
158
  - **Every length is measured, never tabulated.** `trackSize` and `thumbSize` come
159
159
  from their own `onLayout` — `size-5` cannot be read from JavaScript, and a
160
160
  table of numbers here would be `tokens.css` restated in TypeScript, the drift
161
- `tokens.test.ts` exists to catch everywhere else. A measured `0` therefore means
161
+ that would otherwise go uncaught everywhere else. A measured `0` therefore means
162
162
  **not measured yet**, never "a track with no length": every geometry helper
163
163
  guards `travel <= 0` and the thumb renders at `opacity: 0` until the track has
164
164
  reported, because a thumb drawn before then sits at a garbage offset for a frame
@@ -229,7 +229,7 @@ package's first drag-driven control, and its first `Gesture.Pan()`.
229
229
  300pt track is a step every three points, and a flick crosses a hundred of them
230
230
  in a fifth of a second — a buzz, and a hundred synchronous calls into the haptic
231
231
  engine to produce it. `shouldTickHaptic` gates on `SLIDER_HAPTIC_MIN_TRAVEL`,
232
- which keeps the rule pure so `bun test` reaches it and makes it degrade the right
232
+ which keeps the rule pure so a unit test reaches it and makes it degrade the right
233
233
  way: a coarse scale ticks on every stop, a fine one thins to a cadence a hand can
234
234
  feel. Either **end** of the range always ticks — it is the one moment a slider
235
235
  has something to say the screen does not already show. The grab itself always
@@ -14,18 +14,18 @@ export type SliderFillProps = Omit<ViewProps, "children" | "style"> & {
14
14
  * A lone thumb fills from the start of the track, because that is what a single
15
15
  * value means — how far along. A range fills *between* its own thumbs, because
16
16
  * the ends are what the caller excluded. {@link fillBounds} is that decision and
17
- * is pure, so `bun test` sweeps it.
17
+ * is pure, so a unit test sweeps it.
18
18
  *
19
19
  * **The far end lands on the thumb's far edge**, which is what makes both extremes
20
20
  * exact: one thumb's width of fill at the minimum, so the handle covers it
21
21
  * completely and a slider at rest shows a plain track, and the track's full length
22
22
  * at the maximum, with no sliver of empty groove past the handle. That works only
23
23
  * because the thumb's diameter is the track's thickness — {@link fillExtent} is
24
- * where the arithmetic lives, and where `bun test` can hold it down.
24
+ * where the arithmetic lives, and where a unit test can hold it down.
25
25
  *
26
26
  * The extent is an animated style rather than a class because it is a measured
27
27
  * length in points, and a class cannot name one. The *colour* is a class, which
28
- * is what keeps the whole colour matrix inside `bun test`.
28
+ * is what keeps the whole colour matrix inside unit tests.
29
29
  *
30
30
  * Nothing here reads React state: the fill follows the shared value the pan
31
31
  * writes, so it tracks the finger at the display's refresh rate rather than at
@@ -74,8 +74,8 @@ export const SLIDER_OUTPUT_TEXT_SIZE: Record<SliderSize, TextSize> = { sm: "sm",
74
74
  * in a fifth of a second. That is not a hundred ticks, it is a buzz — and a
75
75
  * hundred synchronous calls into the haptic engine to produce it.
76
76
  *
77
- * Gating on distance rather than on a clock keeps the rule pure, so `bun test`
78
- * reaches it, and makes it degrade the right way: a coarse step scale ticks on
77
+ * Gating on distance rather than on a clock keeps the rule pure, so a unit
78
+ * test reaches it, and makes it degrade the right way: a coarse step scale ticks on
79
79
  * every stop, and a fine one thins out to a cadence a hand can actually feel.
80
80
  */
81
81
  export const SLIDER_HAPTIC_MIN_TRAVEL = 6;
@@ -172,7 +172,7 @@ export const SLIDER_RANGE_SEPARATOR = " – ";
172
172
  * No slot worn by a `View` carries `text-*` or `font-*`: `Slider.Output` renders
173
173
  * a `Text` preset and names a step — see {@link SLIDER_OUTPUT_TEXT_SIZE}.
174
174
  *
175
- * Free of React Native imports so it stays unit-testable — `bun test` cannot parse
175
+ * Free of React Native imports so it stays unit-testable — a bare JS runtime cannot parse
176
176
  * React Native's Flow-typed source. See AGENTS.md.
177
177
  */
178
178
  export const sliderVariants = tv({
@@ -478,7 +478,7 @@ export function fillBounds(
478
478
  * Inset the thumb inside the track and every one of them is off by the inset — a
479
479
  * few points of stray colour at one end and of empty groove at the other, at every
480
480
  * size. This is the arithmetic that pays for that proportion, so it is the
481
- * arithmetic `bun test` has to be able to reach.
481
+ * arithmetic a unit test has to be able to reach.
482
482
  *
483
483
  * It replaced a `+ thumbSize / 2`, which stopped the fill at the thumb's *centre*.
484
484
  * That was correct but invisible while a large disc overhung a hairline groove; it
@@ -537,7 +537,7 @@ export function formatSliderValue(values: readonly number[], formatOptions?: Int
537
537
  * - otherwise the drag must have travelled {@link SLIDER_HAPTIC_MIN_TRAVEL}
538
538
  * points since the last tick.
539
539
  *
540
- * Pure, so the whole ladder is reachable from `bun test`, and flat, so it is safe
540
+ * Pure, so the whole ladder is unit-testable, and flat, so it is safe
541
541
  * to call from the pan's worklet. See AGENTS.md.
542
542
  */
543
543
  export function shouldTickHaptic({
@@ -591,7 +591,7 @@ export type SliderAxes = Required<SliderOwnAxes>;
591
591
  * A `Field` reaches the two *state* axes only. It carries no colour, size or
592
592
  * orientation, and a test pins that it cannot acquire one by accident.
593
593
  *
594
- * Pure, so the whole matrix is reachable from `bun test`. See AGENTS.md.
594
+ * Pure, so the whole matrix is unit-testable. See AGENTS.md.
595
595
  */
596
596
  export function resolveSliderAxes({ own, field }: { own?: SliderOwnAxes; field?: SliderFieldAxes | null }): SliderAxes {
597
597
  return {
@@ -626,7 +626,7 @@ export const SLIDER_THUMB_NAMES = { minimum: "Minimum", maximum: "Maximum", thum
626
626
  * since two thumbs reading the same bare number are indistinguishable. Past two
627
627
  * thumbs there are no ends to name, so they count: "Stops, 2 of 3".
628
628
  *
629
- * Pure, so the whole ladder is reachable from `bun test`. See AGENTS.md.
629
+ * Pure, so the whole ladder is unit-testable. See AGENTS.md.
630
630
  */
631
631
  export function resolveThumbAccessibilityLabel({
632
632
  label,
@@ -1,6 +1,5 @@
1
1
  import { describe, expect, test } from "bun:test";
2
- import { readFileSync } from "node:fs";
3
- import { join } from "node:path";
2
+ import { THEME_CSS } from "../../styles/theme-tokens.test";
4
3
  import {
5
4
  clampAutoscrollStep,
6
5
  computeOffsets,
@@ -24,8 +23,6 @@ import {
24
23
  sortableVariants,
25
24
  } from "./sortable.variants";
26
25
 
27
- const THEME_CSS = readFileSync(join(import.meta.dirname, "../../styles/theme.css"), "utf-8");
28
-
29
26
  /** The resting geometry of a column of rows, the way the root derives it on the UI thread. */
30
27
  function column(heights: number[], gap = 0) {
31
28
  const order = heights.map((_, index) => `r${index}`);
@@ -63,7 +63,7 @@ that rotates.
63
63
  reads as a bright chunk beside a flat grey quadrant rather than as an even
64
64
  comet. `spinnerArcStops` places each stop at the offset the arc actually
65
65
  occupies at that angle while stepping the opacity evenly, which inverts the
66
- skew; it is pure, so `bun test` pins the whole ladder.
66
+ skew; it is pure, so a unit test pins the whole ladder.
67
67
  `gradientUnits="userSpaceOnUse"` then keeps the endpoints exact, where an
68
68
  object bounding box would leave open whether a given renderer includes the
69
69
  stroke — which shifts both ends off 0 and 1 and clips the head and the tail.
@@ -69,7 +69,7 @@ export type SpinnerArcStop = { offset: number; opacity: number };
69
69
  * angle while its opacity steps evenly, which inverts the skew. Both half-rings
70
70
  * share the resulting offset ladder; only the endpoints differ.
71
71
  *
72
- * Pure, so the whole ladder is reachable from `bun test`. See AGENTS.md.
72
+ * Pure, so the whole ladder is unit-testable. See AGENTS.md.
73
73
  */
74
74
  export function spinnerArcStops(from: number, to: number): SpinnerArcStop[] {
75
75
  return Array.from({ length: SPINNER_ARC_STOP_COUNT + 1 }, (_unused, index) => {
@@ -103,7 +103,7 @@ export const SPINNER_FALLBACK_COLOR: SpinnerColor = "default";
103
103
  * Neither slot carries a colour: the glyph is an SVG stroke, which takes a
104
104
  * resolved value rather than a class. See {@link SPINNER_COLOR_TOKEN}.
105
105
  *
106
- * Free of React Native imports so it stays unit-testable — `bun test` cannot
106
+ * Free of React Native imports so it stays unit-testable — a bare JS runtime cannot
107
107
  * parse React Native's Flow-typed source. See AGENTS.md.
108
108
  */
109
109
  export const spinnerVariants = tv({
@@ -147,7 +147,7 @@ export function isSpinnerSize(size: SpinnerSize | number | undefined): size is S
147
147
  * Precedence matches {@link resolveSpinnerColor}, and the rule `Icon` follows,
148
148
  * so a spinner composed into a button matches it without being told to.
149
149
  *
150
- * Pure, so the whole ladder is reachable from `bun test`. See AGENTS.md.
150
+ * Pure, so the whole ladder is unit-testable. See AGENTS.md.
151
151
  */
152
152
  export function resolveSpinnerRootClass({
153
153
  size,
@@ -135,7 +135,7 @@ imports this folder's maths leaf rather than copying it.
135
135
  - **Actions**: `increment` / `decrement` move the seam by `step` and land on the
136
136
  step grid; `reset` ("Reset sizes"); and `collapse` / `expand` when a pane beside
137
137
  the handle is collapsible. `resolveSplitterAction` maps an action to what the
138
- root does, as a discriminated union, so the mapping is reachable from `bun test`.
138
+ root does, as a discriminated union, so the mapping is unit-testable.
139
139
  - **`accessibilityState.expanded`** reports the adjacent collapsible pane;
140
140
  `disabled` reports a frozen seam.
141
141
  - **A collapsed pane is hidden from screen readers**, with everything in it —
@@ -151,8 +151,7 @@ imports this folder's maths leaf rather than copying it.
151
151
 
152
152
  - **`splitter.math.ts` is the one copy of the size maths.** `SplitView` imports
153
153
  it as a leaf — `../splitter/splitter.math`, never `../splitter`. It imports
154
- nothing and every export carries `"worklet"`; `splitter.math.test.ts` pins both
155
- by reading the source. Keep its API stable: `clamp`, `snapToStep`,
154
+ nothing and every export carries `"worklet"`; both are pinned by reading the source. Keep its API stable: `clamp`, `snapToStep`,
156
155
  `percentToFraction`, `fractionToPercent`, `nearestSnapIndex`, `projectSnap`,
157
156
  `DEFAULT_DECELERATION_RATE`.
158
157
  - `nearestSnapIndex` and `projectSnap` are unused here — no snap points — and
@@ -160,10 +159,10 @@ imports this folder's maths leaf rather than copying it.
160
159
  - **A worklet helper is declared above its first caller.** The worklets plugin
161
160
  captures a worklet's closure where the function is *declared*, so a worklet
162
161
  calling a helper further down the file captures `undefined` and throws
163
- "undefined is not a function" on a device — while `bun test`, which runs no
162
+ "undefined is not a function" on a device — while a plain unit test, which runs no
164
163
  plugin, passes. It shipped once (`resolveInitialLayout → sumDefaults`); the
165
- "worklet declaration order" test in `splitter.variants.test.ts` now reads the
166
- source and fails by name.
164
+ <!-- registry:omit -->"worklet declaration order" test in `splitter.variants.test.ts` now reads the
165
+ source and fails by name.<!-- /registry:omit -->
167
166
 
168
167
  ## Out of scope
169
168
 
@@ -6,7 +6,7 @@
6
6
  * compound in and risk a cycle. Two rules hold it together, and a test pins both:
7
7
  *
8
8
  * - **It imports nothing.** No React Native, no Reanimated, no `tv`. It is
9
- * reachable from `bun test` and from any worklet without dragging a renderer in.
9
+ * unit-testable and from any worklet without dragging a renderer in.
10
10
  * - **Every export is a worklet.** These run inside gesture callbacks on the UI
11
11
  * thread; a function without the directive throws there, and only on a device.
12
12
  *
@@ -73,8 +73,8 @@ internal and drawn by the items themselves.
73
73
  outside the count — the usual cause is one-based indices.
74
74
  - **A vertical title is padded down to sit level with its circle** — by half the
75
75
  circle's edge less the title's line height. It is the one number derived from
76
- another, and `steps.variants.test.ts` recomputes it from the slot classes, so a
77
- retuned circle or title step fails the suite instead of drifting half a line.
76
+ another, so it is recomputed from the slot classes and a
77
+ retuned circle or title step cannot drift half a line.
78
78
 
79
79
  ## Interaction
80
80
 
@@ -1,6 +1,5 @@
1
1
  import { describe, expect, test } from "bun:test";
2
- import { readFileSync } from "node:fs";
3
- import { join } from "node:path";
2
+ import { THEME_CSS, TOKENS_CSS } from "../../styles/theme-tokens.test";
4
3
  import { TEXT_SIZES } from "../text/text.variants";
5
4
  import {
6
5
  isConnectorComplete,
@@ -24,9 +23,6 @@ import {
24
23
  stepsVariants,
25
24
  } from "./steps.variants";
26
25
 
27
- const TOKENS_CSS = readFileSync(join(import.meta.dirname, "../../styles/tokens.css"), "utf-8");
28
- const THEME_CSS = readFileSync(join(import.meta.dirname, "../../styles/theme.css"), "utf-8");
29
-
30
26
  /** Tailwind's own spacing scale, in points. `size-8` is thirty-two. */
31
27
  const SPACING_STEP_PX = 4;
32
28
 
@@ -290,7 +290,7 @@ export function resolveIndicatorForeground({
290
290
  * has passed (a skipped optional step) but never demotes the current one, which
291
291
  * would leave a stepper with nowhere the user is.
292
292
  *
293
- * Pure, so the whole matrix is reachable from `bun test`.
293
+ * Pure, so the whole matrix is unit-testable.
294
294
  */
295
295
  export function resolveStepStatus({
296
296
  step,
@@ -31,7 +31,8 @@ above the composer and the closing question. Compound root plus seventeen option
31
31
  | `support.types.ts` | `SupportAvailability`, `SupportTicketStatus`, their tuples, `SupportSectionProps` |
32
32
  | `support.variants.ts` | The slotted `tv()`, the badge/chip/icon-token constants, `resolveReplyColor` |
33
33
  | `support.utils.ts` | Labels, spoken labels, the dot and the topic resolvers — no RN imports |
34
- | `support.variants.test.ts`, `support.utils.test.ts` | |
34
+ | `support.variants.test.ts` | |
35
+ | `support.utils.test.ts` | |
35
36
 
36
37
  ## Scope
37
38
 
@@ -129,7 +130,7 @@ above the composer and the closing question. Compound root plus seventeen option
129
130
 
130
131
  ## Previews (follow-up)
131
132
 
132
- No demo carries `capture` yet: a captured demo with no manifest entry fails `demos.test.ts`, and
133
+ No demo carries `capture` yet: a captured demo needs a manifest entry, and
133
134
  the media are shot after integration. The five to capture, all `align: "stretch"`: `help-screen`
134
135
  (**hero**), `availability` (flow `support/availability`), `topics` (flow `support/topics`),
135
136
  `conversations`, and `thread` (flow `support/thread`). The three flows are already written under
@@ -1,6 +1,5 @@
1
1
  import { describe, expect, test } from "bun:test";
2
- import { readFileSync } from "node:fs";
3
- import { join } from "node:path";
2
+ import { THEME_CSS } from "../../styles/theme-tokens.test";
4
3
  import {
5
4
  resolveSurfacePlane,
6
5
  resolveSurfaceVariant,
@@ -117,7 +116,7 @@ describe("SURFACE_FOREGROUND_TOKENS", () => {
117
116
  // Every token named here has to exist, or the class compiles to nothing and
118
117
  // the text keeps whatever colour it inherited.
119
118
  test("every token is declared in theme.css", () => {
120
- const css = readFileSync(join(import.meta.dir, "../../styles/theme.css"), "utf8");
119
+ const css = THEME_CSS;
121
120
  for (const token of Object.values(SURFACE_FOREGROUND_TOKENS)) {
122
121
  expect(css).toContain(`--color-${token}: var(--${token})`);
123
122
  }
@@ -80,7 +80,7 @@ const NEXT_PLANE = {
80
80
  * The root carries no `text-*`: a React Native `View` does not cascade colour
81
81
  * to a `Text` descendant, so a class here would reach nothing.
82
82
  *
83
- * Free of React Native imports so it stays unit-testable — `bun test` cannot
83
+ * Free of React Native imports so it stays unit-testable — a bare JS runtime cannot
84
84
  * parse React Native's Flow-typed source. See AGENTS.md.
85
85
  */
86
86
  export const surfaceVariants = tv({
@@ -198,8 +198,7 @@ section to read first — what follows is only where a switch differs.
198
198
  component. The failure is silent and nearly invisible: detection returns false,
199
199
  a second knob is composed on top of the caller's, and because the two are the
200
200
  same size and colour the only symptom is that **anything inside the caller's
201
- knob disappears**. `displayName` survives all of it — rule 12 requires one and
202
- `display-name.test.ts` enforces that they are present and unique — so that is
201
+ knob disappears**. `displayName` survives all of it — rule 12 requires one, present and unique — so that is
203
202
  what `isSwitchThumbElement` asks for, with reference equality kept only as the
204
203
  fast path.
205
204