@opsinjs/react 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 (266) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE +21 -0
  3. package/README.md +114 -2
  4. package/dist/components/accordion.d.ts +82 -0
  5. package/dist/components/accordion.d.ts.map +1 -0
  6. package/dist/components/accordion.js +154 -0
  7. package/dist/components/accordion.js.map +1 -0
  8. package/dist/components/alert-banner.d.ts +291 -0
  9. package/dist/components/alert-banner.d.ts.map +1 -0
  10. package/dist/components/alert-banner.js +529 -0
  11. package/dist/components/alert-banner.js.map +1 -0
  12. package/dist/components/avatar.d.ts +45 -0
  13. package/dist/components/avatar.d.ts.map +1 -0
  14. package/dist/components/avatar.js +159 -0
  15. package/dist/components/avatar.js.map +1 -0
  16. package/dist/components/badge.d.ts +78 -0
  17. package/dist/components/badge.d.ts.map +1 -0
  18. package/dist/components/badge.js +32 -0
  19. package/dist/components/badge.js.map +1 -0
  20. package/dist/components/body-map.d.ts +51 -0
  21. package/dist/components/body-map.d.ts.map +1 -0
  22. package/dist/components/body-map.js +190 -0
  23. package/dist/components/body-map.js.map +1 -0
  24. package/dist/components/button.d.ts +260 -0
  25. package/dist/components/button.d.ts.map +1 -0
  26. package/dist/components/button.js +609 -0
  27. package/dist/components/button.js.map +1 -0
  28. package/dist/components/callout.d.ts +99 -0
  29. package/dist/components/callout.d.ts.map +1 -0
  30. package/dist/components/callout.js +285 -0
  31. package/dist/components/callout.js.map +1 -0
  32. package/dist/components/card.d.ts +156 -0
  33. package/dist/components/card.d.ts.map +1 -0
  34. package/dist/components/card.js +396 -0
  35. package/dist/components/card.js.map +1 -0
  36. package/dist/components/care-card.d.ts +182 -0
  37. package/dist/components/care-card.d.ts.map +1 -0
  38. package/dist/components/care-card.js +544 -0
  39. package/dist/components/care-card.js.map +1 -0
  40. package/dist/components/checkbox.d.ts +58 -0
  41. package/dist/components/checkbox.d.ts.map +1 -0
  42. package/dist/components/checkbox.js +167 -0
  43. package/dist/components/checkbox.js.map +1 -0
  44. package/dist/components/combobox.d.ts +71 -0
  45. package/dist/components/combobox.d.ts.map +1 -0
  46. package/dist/components/combobox.js +204 -0
  47. package/dist/components/combobox.js.map +1 -0
  48. package/dist/components/consent-sheet.d.ts +186 -0
  49. package/dist/components/consent-sheet.d.ts.map +1 -0
  50. package/dist/components/consent-sheet.js +452 -0
  51. package/dist/components/consent-sheet.js.map +1 -0
  52. package/dist/components/dialog.d.ts +108 -0
  53. package/dist/components/dialog.d.ts.map +1 -0
  54. package/dist/components/dialog.js +573 -0
  55. package/dist/components/dialog.js.map +1 -0
  56. package/dist/components/disclaimer-note.d.ts +144 -0
  57. package/dist/components/disclaimer-note.d.ts.map +1 -0
  58. package/dist/components/disclaimer-note.js +486 -0
  59. package/dist/components/disclaimer-note.js.map +1 -0
  60. package/dist/components/divider.d.ts +76 -0
  61. package/dist/components/divider.d.ts.map +1 -0
  62. package/dist/components/divider.js +101 -0
  63. package/dist/components/divider.js.map +1 -0
  64. package/dist/components/dose-tracker.d.ts +137 -0
  65. package/dist/components/dose-tracker.d.ts.map +1 -0
  66. package/dist/components/dose-tracker.js +154 -0
  67. package/dist/components/dose-tracker.js.map +1 -0
  68. package/dist/components/empty-state.d.ts +171 -0
  69. package/dist/components/empty-state.d.ts.map +1 -0
  70. package/dist/components/empty-state.js +387 -0
  71. package/dist/components/empty-state.js.map +1 -0
  72. package/dist/components/field.d.ts +195 -0
  73. package/dist/components/field.d.ts.map +1 -0
  74. package/dist/components/field.js +282 -0
  75. package/dist/components/field.js.map +1 -0
  76. package/dist/components/goal-ring.d.ts +114 -0
  77. package/dist/components/goal-ring.d.ts.map +1 -0
  78. package/dist/components/goal-ring.js +254 -0
  79. package/dist/components/goal-ring.js.map +1 -0
  80. package/dist/components/icon-button.d.ts +124 -0
  81. package/dist/components/icon-button.d.ts.map +1 -0
  82. package/dist/components/icon-button.js +113 -0
  83. package/dist/components/icon-button.js.map +1 -0
  84. package/dist/components/link.d.ts +122 -0
  85. package/dist/components/link.d.ts.map +1 -0
  86. package/dist/components/link.js +164 -0
  87. package/dist/components/link.js.map +1 -0
  88. package/dist/components/log-sheet.d.ts +259 -0
  89. package/dist/components/log-sheet.d.ts.map +1 -0
  90. package/dist/components/log-sheet.js +437 -0
  91. package/dist/components/log-sheet.js.map +1 -0
  92. package/dist/components/menu.d.ts +69 -0
  93. package/dist/components/menu.d.ts.map +1 -0
  94. package/dist/components/menu.js +190 -0
  95. package/dist/components/menu.js.map +1 -0
  96. package/dist/components/metric-tile.d.ts +301 -0
  97. package/dist/components/metric-tile.d.ts.map +1 -0
  98. package/dist/components/metric-tile.js +533 -0
  99. package/dist/components/metric-tile.js.map +1 -0
  100. package/dist/components/number-field.d.ts +62 -0
  101. package/dist/components/number-field.d.ts.map +1 -0
  102. package/dist/components/number-field.js +134 -0
  103. package/dist/components/number-field.js.map +1 -0
  104. package/dist/components/popover.d.ts +70 -0
  105. package/dist/components/popover.d.ts.map +1 -0
  106. package/dist/components/popover.js +174 -0
  107. package/dist/components/popover.js.map +1 -0
  108. package/dist/components/progress.d.ts +83 -0
  109. package/dist/components/progress.d.ts.map +1 -0
  110. package/dist/components/progress.js +140 -0
  111. package/dist/components/progress.js.map +1 -0
  112. package/dist/components/questionnaire.d.ts +123 -0
  113. package/dist/components/questionnaire.d.ts.map +1 -0
  114. package/dist/components/questionnaire.js +148 -0
  115. package/dist/components/questionnaire.js.map +1 -0
  116. package/dist/components/radio-group.d.ts +66 -0
  117. package/dist/components/radio-group.d.ts.map +1 -0
  118. package/dist/components/radio-group.js +186 -0
  119. package/dist/components/radio-group.js.map +1 -0
  120. package/dist/components/range-bar.d.ts +172 -0
  121. package/dist/components/range-bar.d.ts.map +1 -0
  122. package/dist/components/range-bar.js +578 -0
  123. package/dist/components/range-bar.js.map +1 -0
  124. package/dist/components/range-legend.d.ts +97 -0
  125. package/dist/components/range-legend.d.ts.map +1 -0
  126. package/dist/components/range-legend.js +166 -0
  127. package/dist/components/range-legend.js.map +1 -0
  128. package/dist/components/reading-input.d.ts +225 -0
  129. package/dist/components/reading-input.d.ts.map +1 -0
  130. package/dist/components/reading-input.js +651 -0
  131. package/dist/components/reading-input.js.map +1 -0
  132. package/dist/components/relative-time.d.ts +177 -0
  133. package/dist/components/relative-time.d.ts.map +1 -0
  134. package/dist/components/relative-time.js +603 -0
  135. package/dist/components/relative-time.js.map +1 -0
  136. package/dist/components/result-card.d.ts +319 -0
  137. package/dist/components/result-card.d.ts.map +1 -0
  138. package/dist/components/result-card.js +614 -0
  139. package/dist/components/result-card.js.map +1 -0
  140. package/dist/components/scale-input.d.ts +58 -0
  141. package/dist/components/scale-input.d.ts.map +1 -0
  142. package/dist/components/scale-input.js +170 -0
  143. package/dist/components/scale-input.js.map +1 -0
  144. package/dist/components/score-dial.d.ts +205 -0
  145. package/dist/components/score-dial.d.ts.map +1 -0
  146. package/dist/components/score-dial.js +728 -0
  147. package/dist/components/score-dial.js.map +1 -0
  148. package/dist/components/scroll-area.d.ts +38 -0
  149. package/dist/components/scroll-area.d.ts.map +1 -0
  150. package/dist/components/scroll-area.js +138 -0
  151. package/dist/components/scroll-area.js.map +1 -0
  152. package/dist/components/segmented-control.d.ts +69 -0
  153. package/dist/components/segmented-control.d.ts.map +1 -0
  154. package/dist/components/segmented-control.js +259 -0
  155. package/dist/components/segmented-control.js.map +1 -0
  156. package/dist/components/select.d.ts +72 -0
  157. package/dist/components/select.d.ts.map +1 -0
  158. package/dist/components/select.js +205 -0
  159. package/dist/components/select.js.map +1 -0
  160. package/dist/components/sheet.d.ts +192 -0
  161. package/dist/components/sheet.d.ts.map +1 -0
  162. package/dist/components/sheet.js +952 -0
  163. package/dist/components/sheet.js.map +1 -0
  164. package/dist/components/skeleton.d.ts +104 -0
  165. package/dist/components/skeleton.d.ts.map +1 -0
  166. package/dist/components/skeleton.js +266 -0
  167. package/dist/components/skeleton.js.map +1 -0
  168. package/dist/components/slider.d.ts +55 -0
  169. package/dist/components/slider.d.ts.map +1 -0
  170. package/dist/components/slider.js +170 -0
  171. package/dist/components/slider.js.map +1 -0
  172. package/dist/components/source-citation.d.ts +127 -0
  173. package/dist/components/source-citation.d.ts.map +1 -0
  174. package/dist/components/source-citation.js +391 -0
  175. package/dist/components/source-citation.js.map +1 -0
  176. package/dist/components/spinner.d.ts +86 -0
  177. package/dist/components/spinner.d.ts.map +1 -0
  178. package/dist/components/spinner.js +97 -0
  179. package/dist/components/spinner.js.map +1 -0
  180. package/dist/components/status-pill.d.ts +90 -0
  181. package/dist/components/status-pill.d.ts.map +1 -0
  182. package/dist/components/status-pill.js +259 -0
  183. package/dist/components/status-pill.js.map +1 -0
  184. package/dist/components/stepper.d.ts +99 -0
  185. package/dist/components/stepper.d.ts.map +1 -0
  186. package/dist/components/stepper.js +152 -0
  187. package/dist/components/stepper.js.map +1 -0
  188. package/dist/components/surface.d.ts +92 -0
  189. package/dist/components/surface.d.ts.map +1 -0
  190. package/dist/components/surface.js +261 -0
  191. package/dist/components/surface.js.map +1 -0
  192. package/dist/components/switch.d.ts +48 -0
  193. package/dist/components/switch.d.ts.map +1 -0
  194. package/dist/components/switch.js +152 -0
  195. package/dist/components/switch.js.map +1 -0
  196. package/dist/components/symptom-picker.d.ts +69 -0
  197. package/dist/components/symptom-picker.d.ts.map +1 -0
  198. package/dist/components/symptom-picker.js +170 -0
  199. package/dist/components/symptom-picker.js.map +1 -0
  200. package/dist/components/tab-bar.d.ts +110 -0
  201. package/dist/components/tab-bar.d.ts.map +1 -0
  202. package/dist/components/tab-bar.js +118 -0
  203. package/dist/components/tab-bar.js.map +1 -0
  204. package/dist/components/table.d.ts +117 -0
  205. package/dist/components/table.d.ts.map +1 -0
  206. package/dist/components/table.js +65 -0
  207. package/dist/components/table.js.map +1 -0
  208. package/dist/components/tabs.d.ts +106 -0
  209. package/dist/components/tabs.d.ts.map +1 -0
  210. package/dist/components/tabs.js +136 -0
  211. package/dist/components/tabs.js.map +1 -0
  212. package/dist/components/term.d.ts +243 -0
  213. package/dist/components/term.d.ts.map +1 -0
  214. package/dist/components/term.js +562 -0
  215. package/dist/components/term.js.map +1 -0
  216. package/dist/components/textarea.d.ts +157 -0
  217. package/dist/components/textarea.d.ts.map +1 -0
  218. package/dist/components/textarea.js +66 -0
  219. package/dist/components/textarea.js.map +1 -0
  220. package/dist/components/timeline-entry.d.ts +99 -0
  221. package/dist/components/timeline-entry.d.ts.map +1 -0
  222. package/dist/components/timeline-entry.js +47 -0
  223. package/dist/components/timeline-entry.js.map +1 -0
  224. package/dist/components/toast.d.ts +80 -0
  225. package/dist/components/toast.d.ts.map +1 -0
  226. package/dist/components/toast.js +266 -0
  227. package/dist/components/toast.js.map +1 -0
  228. package/dist/components/tooltip.d.ts +48 -0
  229. package/dist/components/tooltip.d.ts.map +1 -0
  230. package/dist/components/tooltip.js +159 -0
  231. package/dist/components/tooltip.js.map +1 -0
  232. package/dist/components/trend-sparkline.d.ts +188 -0
  233. package/dist/components/trend-sparkline.d.ts.map +1 -0
  234. package/dist/components/trend-sparkline.js +796 -0
  235. package/dist/components/trend-sparkline.js.map +1 -0
  236. package/dist/components/value.d.ts +150 -0
  237. package/dist/components/value.d.ts.map +1 -0
  238. package/dist/components/value.js +402 -0
  239. package/dist/components/value.js.map +1 -0
  240. package/dist/components/visually-hidden.d.ts +61 -0
  241. package/dist/components/visually-hidden.d.ts.map +1 -0
  242. package/dist/components/visually-hidden.js +172 -0
  243. package/dist/components/visually-hidden.js.map +1 -0
  244. package/dist/index.d.ts +63 -0
  245. package/dist/index.d.ts.map +1 -0
  246. package/dist/index.js +72 -0
  247. package/dist/index.js.map +1 -0
  248. package/dist/opsinjs.d.ts +443 -0
  249. package/dist/opsinjs.d.ts.map +1 -0
  250. package/dist/opsinjs.js +906 -0
  251. package/dist/opsinjs.js.map +1 -0
  252. package/dist/status.d.ts +111 -0
  253. package/dist/status.d.ts.map +1 -0
  254. package/dist/status.js +125 -0
  255. package/dist/status.js.map +1 -0
  256. package/dist/styles.css +2 -0
  257. package/dist/utils.d.ts +20 -0
  258. package/dist/utils.d.ts.map +1 -0
  259. package/dist/utils.js +82 -0
  260. package/dist/utils.js.map +1 -0
  261. package/package.json +86 -3
  262. package/styles/base.css +132 -0
  263. package/styles/roles.css +412 -0
  264. package/styles/standalone.css +20 -0
  265. package/styles/tailwind.css +18 -0
  266. package/styles/theme.css +309 -0
@@ -0,0 +1,18 @@
1
+ /* ==========================================================================
2
+ tailwind.css is the opsinjs entry for an app built with Tailwind CSS v4.
3
+
4
+ @import "tailwindcss";
5
+ @import "@opsinjs/react/tailwind.css";
6
+
7
+ It loads the generated tokens, the role layer and the theme bridge, and it
8
+ points Tailwind at the compiled components so their class names are
9
+ generated in your build. Add `@import "@opsinjs/react/base.css";` as well
10
+ when opsinjs styles the whole page. An app without Tailwind imports
11
+ `@opsinjs/react/styles.css` instead.
12
+ ========================================================================== */
13
+
14
+ @import "@opsinjs/tokens/tokens.css";
15
+ @import "./roles.css";
16
+ @import "./theme.css";
17
+
18
+ @source "../dist";
@@ -0,0 +1,309 @@
1
+ /* ==========================================================================
2
+ theme.css is the Tailwind v4 bridge for opsinjs.
3
+
4
+ `@theme inline` turns the opsinjs roles into Tailwind utilities
5
+ (bg-background, text-opsin-headline, radius-opsin-*, ease-opsin-* and the
6
+ rest), and the dark variant follows the `.dark` class. Only Tailwind reads
7
+ this file. tailwind.css imports it for an app that has Tailwind, and the
8
+ precompiled styles.css is built from it for an app that does not.
9
+ ========================================================================== */
10
+
11
+ @theme inline {
12
+ --color-background: var(--background);
13
+ --color-foreground: var(--foreground);
14
+ --color-card: var(--card);
15
+ --color-card-foreground: var(--card-foreground);
16
+ --color-muted: var(--muted);
17
+ --color-muted-foreground: var(--muted-foreground);
18
+ --color-border: var(--border);
19
+ --color-input: var(--input);
20
+ --color-ring: var(--ring);
21
+ --color-edge: var(--edge);
22
+ --color-brand: var(--brand);
23
+ --color-brand-foreground: var(--brand-foreground);
24
+ --color-brand-edge: var(--brand-edge);
25
+ --color-brand-ink: var(--brand-ink);
26
+ --color-primary-edge: var(--primary-edge);
27
+
28
+ /* The drop under a card, so a component that paints its own card rather
29
+ than wrapping Surface takes the same lift: `shadow-card`. */
30
+ --shadow-card: var(--opsin-material-card-shadow);
31
+ --shadow-raised: var(--opsin-material-raised-shadow);
32
+
33
+ /* Placeholder roles for the loading Skeleton. Only fill and line are bridged,
34
+ because those are the two the component paints as bg-placeholder-fill and
35
+ border-placeholder-line. The sheen is read straight from the custom
36
+ property by the skeleton stylesheet as a gradient stop, and a Tailwind
37
+ utility for a stop nothing else consumes would be a name with no second
38
+ caller, so it is not bridged. */
39
+ --color-placeholder-fill: var(--opsin-placeholder-fill);
40
+ --color-placeholder-line: var(--opsin-placeholder-line);
41
+ --color-primary: var(--primary);
42
+ --color-primary-foreground: var(--primary-foreground);
43
+
44
+ /* Bridge the interaction state fills so bg-state-hover, bg-state-press,
45
+ bg-state-primary-hover and bg-state-primary-press compile. */
46
+ --color-state-hover: var(--state-hover);
47
+ --color-state-press: var(--state-press);
48
+ --color-state-primary-hover: var(--state-primary-hover);
49
+ --color-state-primary-press: var(--state-primary-press);
50
+
51
+ --color-status-steady: var(--opsin-status-steady-line);
52
+ --color-status-steady-surface: var(--opsin-status-steady-surface);
53
+ --color-status-steady-ink: var(--opsin-status-steady-ink);
54
+ --color-status-steady-accent: var(--opsin-status-steady-accent);
55
+ --color-status-watch: var(--opsin-status-watch-line);
56
+ --color-status-watch-surface: var(--opsin-status-watch-surface);
57
+ --color-status-watch-ink: var(--opsin-status-watch-ink);
58
+ --color-status-watch-accent: var(--opsin-status-watch-accent);
59
+ --color-status-attention: var(--opsin-status-attention-line);
60
+ --color-status-attention-surface: var(--opsin-status-attention-surface);
61
+ --color-status-attention-ink: var(--opsin-status-attention-ink);
62
+ --color-status-attention-accent: var(--opsin-status-attention-accent);
63
+ --color-status-urgent: var(--opsin-status-urgent-line);
64
+ --color-status-urgent-surface: var(--opsin-status-urgent-surface);
65
+ --color-status-urgent-ink: var(--opsin-status-urgent-ink);
66
+ --color-status-urgent-accent: var(--opsin-status-urgent-accent);
67
+ --color-status-unknown: var(--opsin-status-unknown-line);
68
+ --color-status-unknown-surface: var(--opsin-status-unknown-surface);
69
+ --color-status-unknown-ink: var(--opsin-status-unknown-ink);
70
+ --color-status-unknown-accent: var(--opsin-status-unknown-accent);
71
+
72
+ /* --- Category bridge, and there is deliberately NO surface utility here.
73
+ A category surface and a status surface at the same neutral ladder step
74
+ measure Lc 0.00 and WCAG 1.00 against each other, so a card tinted by
75
+ category would be indistinguishable from a card tinted by status, which is
76
+ the one misreading this system exists to prevent. Lowering category chroma
77
+ widens the hue gap between two categories but does nothing for the gap
78
+ against a status tint, so it makes the collision worse rather than better.
79
+ A category may therefore paint its accent (`--color-category-<id>`), its
80
+ line and its ink, and never a card fill. The `--opsin-category-<id>-surface`
81
+ custom properties are kept above and in @opsinjs/tokens/tokens.css as a role a
82
+ consuming theme may opt into deliberately, and are what <ColorScale>
83
+ renders; they are simply not exposed as a Tailwind `bg-*` utility. --- */
84
+ --color-category-sleep: var(--opsin-category-sleep-accent);
85
+ --color-category-sleep-line: var(--opsin-category-sleep-line);
86
+ --color-category-sleep-ink: var(--opsin-category-sleep-ink);
87
+ --color-category-heart: var(--opsin-category-heart-accent);
88
+ --color-category-heart-line: var(--opsin-category-heart-line);
89
+ --color-category-heart-ink: var(--opsin-category-heart-ink);
90
+ --color-category-activity: var(--opsin-category-activity-accent);
91
+ --color-category-activity-line: var(--opsin-category-activity-line);
92
+ --color-category-activity-ink: var(--opsin-category-activity-ink);
93
+ --color-category-nutrition: var(--opsin-category-nutrition-accent);
94
+ --color-category-nutrition-line: var(--opsin-category-nutrition-line);
95
+ --color-category-nutrition-ink: var(--opsin-category-nutrition-ink);
96
+ --color-category-mind: var(--opsin-category-mind-accent);
97
+ --color-category-mind-line: var(--opsin-category-mind-line);
98
+ --color-category-mind-ink: var(--opsin-category-mind-ink);
99
+ --color-category-labs: var(--opsin-category-labs-accent);
100
+ --color-category-labs-line: var(--opsin-category-labs-line);
101
+ --color-category-labs-ink: var(--opsin-category-labs-ink);
102
+
103
+ /* --- Type. Twelve steps, and each one carries all four of its properties
104
+ rather than only a size. Tailwind's --text-* namespace takes three
105
+ sub-keys, so `text-opsin-body` sets font-size, line-height, letter-spacing
106
+ and font-weight together. The three are --text-<step>--line-height,
107
+ --text-<step>--letter-spacing and --text-<step>--font-weight.
108
+
109
+ Bridging only the size would have been worse than not bridging at all: a
110
+ component would take its size from the ramp and its leading from whatever
111
+ Tailwind's default for that size happens to be, and the leading is the part
112
+ that was tuned for reading a number at arm's length. `headline` and `body`
113
+ are the proof. They have the same size, the same leading and the same
114
+ tracking, and they differ ONLY in weight (600 against 400), so a bridge
115
+ without the weight sub-key would make them the same step. The twelfth step,
116
+ `subheadlineEmphasis`, is exactly that pairing one step down: it shares the
117
+ subheadline geometry and takes the headline weight, which is what a compact
118
+ control needs so that smaller does not mean less deliberate.
119
+
120
+ Every size is a rem in tokens/type.json, so the whole ramp scales with
121
+ [data-text-size] and with the reader's own root font size. Never write a px
122
+ font size in a component; there is now no reason to. --- */
123
+ --text-opsin-large-title: var(--opsin-text-large-title-size);
124
+ --text-opsin-large-title--line-height: var(--opsin-text-large-title-leading);
125
+ --text-opsin-large-title--letter-spacing: var(--opsin-text-large-title-tracking);
126
+ --text-opsin-large-title--font-weight: var(--opsin-text-large-title-weight);
127
+ --text-opsin-title1: var(--opsin-text-title1-size);
128
+ --text-opsin-title1--line-height: var(--opsin-text-title1-leading);
129
+ --text-opsin-title1--letter-spacing: var(--opsin-text-title1-tracking);
130
+ --text-opsin-title1--font-weight: var(--opsin-text-title1-weight);
131
+ --text-opsin-title2: var(--opsin-text-title2-size);
132
+ --text-opsin-title2--line-height: var(--opsin-text-title2-leading);
133
+ --text-opsin-title2--letter-spacing: var(--opsin-text-title2-tracking);
134
+ --text-opsin-title2--font-weight: var(--opsin-text-title2-weight);
135
+ --text-opsin-title3: var(--opsin-text-title3-size);
136
+ --text-opsin-title3--line-height: var(--opsin-text-title3-leading);
137
+ --text-opsin-title3--letter-spacing: var(--opsin-text-title3-tracking);
138
+ --text-opsin-title3--font-weight: var(--opsin-text-title3-weight);
139
+ --text-opsin-headline: var(--opsin-text-headline-size);
140
+ --text-opsin-headline--line-height: var(--opsin-text-headline-leading);
141
+ --text-opsin-headline--letter-spacing: var(--opsin-text-headline-tracking);
142
+ --text-opsin-headline--font-weight: var(--opsin-text-headline-weight);
143
+ --text-opsin-body: var(--opsin-text-body-size);
144
+ --text-opsin-body--line-height: var(--opsin-text-body-leading);
145
+ --text-opsin-body--letter-spacing: var(--opsin-text-body-tracking);
146
+ --text-opsin-body--font-weight: var(--opsin-text-body-weight);
147
+ --text-opsin-callout: var(--opsin-text-callout-size);
148
+ --text-opsin-callout--line-height: var(--opsin-text-callout-leading);
149
+ --text-opsin-callout--letter-spacing: var(--opsin-text-callout-tracking);
150
+ --text-opsin-callout--font-weight: var(--opsin-text-callout-weight);
151
+ --text-opsin-subheadline: var(--opsin-text-subheadline-size);
152
+ --text-opsin-subheadline--line-height: var(--opsin-text-subheadline-leading);
153
+ --text-opsin-subheadline--letter-spacing: var(--opsin-text-subheadline-tracking);
154
+ --text-opsin-subheadline--font-weight: var(--opsin-text-subheadline-weight);
155
+ --text-opsin-subheadline-emphasis: var(--opsin-text-subheadline-emphasis-size);
156
+ --text-opsin-subheadline-emphasis--line-height: var(--opsin-text-subheadline-emphasis-leading);
157
+ --text-opsin-subheadline-emphasis--letter-spacing: var(--opsin-text-subheadline-emphasis-tracking);
158
+ --text-opsin-subheadline-emphasis--font-weight: var(--opsin-text-subheadline-emphasis-weight);
159
+ --text-opsin-footnote: var(--opsin-text-footnote-size);
160
+ --text-opsin-footnote--line-height: var(--opsin-text-footnote-leading);
161
+ --text-opsin-footnote--letter-spacing: var(--opsin-text-footnote-tracking);
162
+ --text-opsin-footnote--font-weight: var(--opsin-text-footnote-weight);
163
+ --text-opsin-caption1: var(--opsin-text-caption1-size);
164
+ --text-opsin-caption1--line-height: var(--opsin-text-caption1-leading);
165
+ --text-opsin-caption1--letter-spacing: var(--opsin-text-caption1-tracking);
166
+ --text-opsin-caption1--font-weight: var(--opsin-text-caption1-weight);
167
+ --text-opsin-caption2: var(--opsin-text-caption2-size);
168
+ --text-opsin-caption2--line-height: var(--opsin-text-caption2-leading);
169
+ --text-opsin-caption2--letter-spacing: var(--opsin-text-caption2-tracking);
170
+ --text-opsin-caption2--font-weight: var(--opsin-text-caption2-weight);
171
+
172
+ /* --- Fonts. `--font-sans` above is what <html> actually uses and it keeps a
173
+ `ui-sans-serif` head that the generated stack does not have; these three
174
+ are the token-layer stacks, for a component that wants to name the family
175
+ it is asking for rather than inherit. `font-opsin-numeric` is about the
176
+ FAMILY only. Tabular figures come from `[data-opsinjs-value]` in the base
177
+ layer below, not from this utility, so setting the family is not a
178
+ substitute for stamping the attribute on a rendered measurement. --- */
179
+ --font-opsin-sans: var(--opsin-font-sans);
180
+ --font-opsin-mono: var(--opsin-font-mono);
181
+ --font-opsin-numeric: var(--opsin-font-numeric);
182
+
183
+ --radius-sm: var(--opsin-radius-sm);
184
+ --radius-md: var(--opsin-radius-base);
185
+ --radius-lg: var(--opsin-radius-lg);
186
+ --radius-xl: var(--opsin-radius-xl);
187
+
188
+ /* --- Radius, the generated ladder, and the only ladder. `--radius-sm`,
189
+ `--radius-md`, `--radius-lg` and `--radius-xl` alias the tokens/shape.json
190
+ steps rather than deriving a second set of multiples, so `rounded-lg` and
191
+ `rounded-opsin-lg` now resolve to the same token and every product radius
192
+ is a shape.json step. A component keeps the system's own shape wherever it
193
+ lands rather than taking the shape of whatever shell it is dropped into.
194
+
195
+ Note that `--opsin-radius-base` and `--opsin-radius-md` are the same value
196
+ today (0.875rem); they are separate tokens because they answer different
197
+ questions, and a component should ask for the one it means.
198
+
199
+ There is deliberately no `rounded-opsin-full`. `--opsin-radius-full` is
200
+ not generated by the token pipeline, and bridging a name the token
201
+ pipeline does not own is exactly how `ease-opsin-spring` became a utility
202
+ backed by a fallback nobody maintained. That bridge has since been removed
203
+ for that reason. Use `rounded-full`. --- */
204
+ --radius-opsin-none: var(--opsin-radius-none);
205
+ --radius-opsin-xs: var(--opsin-radius-xs);
206
+ --radius-opsin-sm: var(--opsin-radius-sm);
207
+ --radius-opsin-base: var(--opsin-radius-base);
208
+ --radius-opsin-md: var(--opsin-radius-md);
209
+ --radius-opsin-lg: var(--opsin-radius-lg);
210
+ --radius-opsin-xl: var(--opsin-radius-xl);
211
+
212
+ --ease-opsin-standard: var(--opsin-ease-standard);
213
+
214
+ /* --- Easing, the rest of it. This file no longer bridges a base
215
+ `ease-opsin-spring`, because nothing consumed it; the four below are the
216
+ real springs, sampled from the stiffness/damping/mass triples in
217
+ tokens/motion.json.
218
+
219
+ A sampled spring is only itself when it is paired with its own duration. A
220
+ `linear()` stop list is normalised to 0-1, so running spring-calm's curve
221
+ over spring-snap's 283ms is a different spring, not a faster one. Write
222
+ `ease-opsin-spring-calm duration-(--opsin-duration-spring-calm)` and never
223
+ cross the pairs.
224
+
225
+ `spring-calm` is the only one of the four cleared to carry a health value,
226
+ and only for a figure that CHANGES while the reader is already looking at
227
+ it: a bar re-filling from one reading to the next, a dial travelling
228
+ between two values they have already been shown. Never a first paint and
229
+ never a first reveal. A value arrives at its final figure, with no
230
+ count-up, no dial sweep and no line drawing itself in
231
+ (health/motion-in-health-ui rule 2). It is cleared for the morph because it
232
+ is overdamped: it reaches its target without passing it, and a number that
233
+ overshoots has displayed, for one frame, a figure that is not true.
234
+
235
+ Overdamping is necessary and not sufficient, so do not reason your way to a
236
+ second candidate. `spring-sheet` is overdamped too (zeta 1.025, zero
237
+ overshoot) and is still not cleared: 483ms of travel is a surface's settle,
238
+ and a figure that takes half a second to arrive reads as a figure the system
239
+ is unsure of. `spring-settle` and `spring-snap` overshoot by 0.88% and 1.52%
240
+ and are ruled out on the frame-of-untruth argument alone.
241
+ tokens/motion.json carries the same rule on each token itself. --- */
242
+ --ease-opsin-enter: var(--opsin-ease-enter);
243
+ --ease-opsin-exit: var(--opsin-ease-exit);
244
+ --ease-opsin-spring-calm: var(--opsin-ease-spring-calm);
245
+ --ease-opsin-spring-settle: var(--opsin-ease-spring-settle);
246
+ --ease-opsin-spring-sheet: var(--opsin-ease-spring-sheet);
247
+ --ease-opsin-spring-snap: var(--opsin-ease-spring-snap);
248
+
249
+ /* --- Durations, in Tailwind's --animate-duration-* shape, extended with the
250
+ four spring settle times.
251
+
252
+ Know what it does and does not give you. Tailwind 4 has no `--duration-*`
253
+ theme namespace. `duration-150` is a bare numeric utility, and a named
254
+ duration therefore cannot become a `duration-*` class. `--animate-*` is an
255
+ animation shorthand namespace, so `animate-duration-base` sets `animation`,
256
+ which is almost never what a transition wants. For a transition, reference
257
+ the token itself: `duration-(--opsin-duration-base)`, or plain
258
+ `var(--opsin-duration-base)` in a hand-written rule. Both resolve against
259
+ the real custom property, so both pick up the reduced-motion collapse
260
+ declared above. --- */
261
+ --animate-duration-instant: var(--opsin-duration-instant);
262
+ --animate-duration-fast: var(--opsin-duration-fast);
263
+ --animate-duration-base: var(--opsin-duration-base);
264
+ --animate-duration-slow: var(--opsin-duration-slow);
265
+ --animate-duration-deliberate: var(--opsin-duration-deliberate);
266
+ --animate-duration-spring-calm: var(--opsin-duration-spring-calm);
267
+ --animate-duration-spring-settle: var(--opsin-duration-spring-settle);
268
+ --animate-duration-spring-sheet: var(--opsin-duration-spring-sheet);
269
+ --animate-duration-spring-snap: var(--opsin-duration-spring-snap);
270
+
271
+ /* --- Space, the named steps, ALONGSIDE the density-scaled default scale and
272
+ never instead of it. Both must coexist, and the choice between them is a
273
+ real decision:
274
+
275
+ `p-4` is 4 x `--spacing`, which is 0.25rem at the default density and
276
+ 0.21875rem under [data-density="compact"], its 0.875 multiple. There is no
277
+ [data-density="comfortable"] block, because comfortable is the default.
278
+ Use it for padding and gaps that SHOULD breathe or tighten when a reader
279
+ changes density. The inside of a card and the gap between rows in a list
280
+ are two of them.
281
+
282
+ `p-opsin-4` is `--opsin-space-4`, a fixed 1rem that density does not move.
283
+ Use it where the measurement carries meaning and must not shrink because
284
+ somebody asked for a denser list: the separation between two touch targets,
285
+ a focus-ring offset, the gap that stops two tappable rows from merging.
286
+
287
+ The half step is `opsin-0-5`, hyphen and not full stop, because
288
+ `--spacing-opsin-0.5` is not a valid custom property. After `0` the `.5`
289
+ is a fresh token and the declaration is dropped silently. `p-opsin-px` is
290
+ `--opsin-space-px` at 0.0625rem, which is 1px at a 16px root and grows with
291
+ the root; Tailwind's own `p-px` is a device pixel and does not. --- */
292
+ --spacing-opsin-px: var(--opsin-space-px);
293
+ --spacing-opsin-0: var(--opsin-space-0);
294
+ --spacing-opsin-0-5: var(--opsin-space-0-5);
295
+ --spacing-opsin-1: var(--opsin-space-1);
296
+ --spacing-opsin-2: var(--opsin-space-2);
297
+ --spacing-opsin-3: var(--opsin-space-3);
298
+ --spacing-opsin-4: var(--opsin-space-4);
299
+ --spacing-opsin-5: var(--opsin-space-5);
300
+ --spacing-opsin-6: var(--opsin-space-6);
301
+ --spacing-opsin-8: var(--opsin-space-8);
302
+ --spacing-opsin-10: var(--opsin-space-10);
303
+ --spacing-opsin-12: var(--opsin-space-12);
304
+ --spacing-opsin-16: var(--opsin-space-16);
305
+ --spacing-opsin-20: var(--opsin-space-20);
306
+ --spacing-opsin-24: var(--opsin-space-24);
307
+ }
308
+
309
+ @custom-variant dark (&:where(.dark, .dark *));