@newtone-dev/ui-react-web 0.2.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 (304) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +83 -0
  3. package/dist/accordion/accordion.css +239 -0
  4. package/dist/accordion/accordion.d.ts +106 -0
  5. package/dist/accordion/accordion.d.ts.map +1 -0
  6. package/dist/accordion/accordion.js +15 -0
  7. package/dist/accordion/accordion.js.map +1 -0
  8. package/dist/accordion/index.d.ts +4 -0
  9. package/dist/accordion/index.d.ts.map +1 -0
  10. package/dist/accordion/index.js +3 -0
  11. package/dist/accordion/index.js.map +1 -0
  12. package/dist/action/action.css +86 -0
  13. package/dist/action/action.d.ts +62 -0
  14. package/dist/action/action.d.ts.map +1 -0
  15. package/dist/action/action.js +59 -0
  16. package/dist/action/action.js.map +1 -0
  17. package/dist/action/index.d.ts +4 -0
  18. package/dist/action/index.d.ts.map +1 -0
  19. package/dist/action/index.js +3 -0
  20. package/dist/action/index.js.map +1 -0
  21. package/dist/avatar/avatar.css +39 -0
  22. package/dist/avatar/avatar.d.ts +43 -0
  23. package/dist/avatar/avatar.d.ts.map +1 -0
  24. package/dist/avatar/avatar.js +38 -0
  25. package/dist/avatar/avatar.js.map +1 -0
  26. package/dist/avatar/index.d.ts +4 -0
  27. package/dist/avatar/index.d.ts.map +1 -0
  28. package/dist/avatar/index.js +3 -0
  29. package/dist/avatar/index.js.map +1 -0
  30. package/dist/button/button.css +112 -0
  31. package/dist/button/button.d.ts +36 -0
  32. package/dist/button/button.d.ts.map +1 -0
  33. package/dist/button/button.js +24 -0
  34. package/dist/button/button.js.map +1 -0
  35. package/dist/button/index.d.ts +3 -0
  36. package/dist/button/index.d.ts.map +1 -0
  37. package/dist/button/index.js +2 -0
  38. package/dist/button/index.js.map +1 -0
  39. package/dist/card-box/card-box.css +75 -0
  40. package/dist/card-box/card-box.d.ts +114 -0
  41. package/dist/card-box/card-box.d.ts.map +1 -0
  42. package/dist/card-box/card-box.js +9 -0
  43. package/dist/card-box/card-box.js.map +1 -0
  44. package/dist/card-box/index.d.ts +4 -0
  45. package/dist/card-box/index.d.ts.map +1 -0
  46. package/dist/card-box/index.js +3 -0
  47. package/dist/card-box/index.js.map +1 -0
  48. package/dist/card-grid/card-grid.css +97 -0
  49. package/dist/card-grid/card-grid.d.ts +63 -0
  50. package/dist/card-grid/card-grid.d.ts.map +1 -0
  51. package/dist/card-grid/card-grid.js +27 -0
  52. package/dist/card-grid/card-grid.js.map +1 -0
  53. package/dist/card-grid/index.d.ts +4 -0
  54. package/dist/card-grid/index.d.ts.map +1 -0
  55. package/dist/card-grid/index.js +3 -0
  56. package/dist/card-grid/index.js.map +1 -0
  57. package/dist/color/gamut.d.ts +20 -0
  58. package/dist/color/gamut.d.ts.map +1 -0
  59. package/dist/color/gamut.js +72 -0
  60. package/dist/color/gamut.js.map +1 -0
  61. package/dist/color/index.d.ts +8 -0
  62. package/dist/color/index.d.ts.map +1 -0
  63. package/dist/color/index.js +21 -0
  64. package/dist/color/index.js.map +1 -0
  65. package/dist/color/oklch.d.ts +35 -0
  66. package/dist/color/oklch.d.ts.map +1 -0
  67. package/dist/color/oklch.js +103 -0
  68. package/dist/color/oklch.js.map +1 -0
  69. package/dist/color/scale.d.ts +20 -0
  70. package/dist/color/scale.d.ts.map +1 -0
  71. package/dist/color/scale.js +75 -0
  72. package/dist/color/scale.js.map +1 -0
  73. package/dist/color/seeds.d.ts +33 -0
  74. package/dist/color/seeds.d.ts.map +1 -0
  75. package/dist/color/seeds.js +148 -0
  76. package/dist/color/seeds.js.map +1 -0
  77. package/dist/control/control.css +203 -0
  78. package/dist/control/control.d.ts +112 -0
  79. package/dist/control/control.d.ts.map +1 -0
  80. package/dist/control/control.js +107 -0
  81. package/dist/control/control.js.map +1 -0
  82. package/dist/control/index.d.ts +4 -0
  83. package/dist/control/index.d.ts.map +1 -0
  84. package/dist/control/index.js +3 -0
  85. package/dist/control/index.js.map +1 -0
  86. package/dist/data-list/data-list.css +52 -0
  87. package/dist/data-list/data-list.d.ts +55 -0
  88. package/dist/data-list/data-list.d.ts.map +1 -0
  89. package/dist/data-list/data-list.js +51 -0
  90. package/dist/data-list/data-list.js.map +1 -0
  91. package/dist/data-list/index.d.ts +5 -0
  92. package/dist/data-list/index.d.ts.map +1 -0
  93. package/dist/data-list/index.js +3 -0
  94. package/dist/data-list/index.js.map +1 -0
  95. package/dist/data-list/row/row.d.ts +16 -0
  96. package/dist/data-list/row/row.d.ts.map +1 -0
  97. package/dist/data-list/row/row.js +15 -0
  98. package/dist/data-list/row/row.js.map +1 -0
  99. package/dist/feature-card/feature-card.css +93 -0
  100. package/dist/feature-card/feature-card.d.ts +68 -0
  101. package/dist/feature-card/feature-card.d.ts.map +1 -0
  102. package/dist/feature-card/feature-card.js +11 -0
  103. package/dist/feature-card/feature-card.js.map +1 -0
  104. package/dist/feature-card/index.d.ts +4 -0
  105. package/dist/feature-card/index.d.ts.map +1 -0
  106. package/dist/feature-card/index.js +3 -0
  107. package/dist/feature-card/index.js.map +1 -0
  108. package/dist/framed-icon/framed-icon.css +77 -0
  109. package/dist/framed-icon/framed-icon.d.ts +61 -0
  110. package/dist/framed-icon/framed-icon.d.ts.map +1 -0
  111. package/dist/framed-icon/framed-icon.js +14 -0
  112. package/dist/framed-icon/framed-icon.js.map +1 -0
  113. package/dist/framed-icon/index.d.ts +4 -0
  114. package/dist/framed-icon/index.d.ts.map +1 -0
  115. package/dist/framed-icon/index.js +3 -0
  116. package/dist/framed-icon/index.js.map +1 -0
  117. package/dist/gallery/gallery.css +165 -0
  118. package/dist/gallery/gallery.d.ts +85 -0
  119. package/dist/gallery/gallery.d.ts.map +1 -0
  120. package/dist/gallery/gallery.js +75 -0
  121. package/dist/gallery/gallery.js.map +1 -0
  122. package/dist/gallery/index.d.ts +4 -0
  123. package/dist/gallery/index.d.ts.map +1 -0
  124. package/dist/gallery/index.js +3 -0
  125. package/dist/gallery/index.js.map +1 -0
  126. package/dist/icon/icon.css +83 -0
  127. package/dist/icon/icon.d.ts +69 -0
  128. package/dist/icon/icon.d.ts.map +1 -0
  129. package/dist/icon/icon.js +18 -0
  130. package/dist/icon/icon.js.map +1 -0
  131. package/dist/icon/index.d.ts +4 -0
  132. package/dist/icon/index.d.ts.map +1 -0
  133. package/dist/icon/index.js +3 -0
  134. package/dist/icon/index.js.map +1 -0
  135. package/dist/icon-link/icon-link.css +57 -0
  136. package/dist/icon-link/icon-link.d.ts +47 -0
  137. package/dist/icon-link/icon-link.d.ts.map +1 -0
  138. package/dist/icon-link/icon-link.js +35 -0
  139. package/dist/icon-link/icon-link.js.map +1 -0
  140. package/dist/icon-link/index.d.ts +4 -0
  141. package/dist/icon-link/index.d.ts.map +1 -0
  142. package/dist/icon-link/index.js +3 -0
  143. package/dist/icon-link/index.js.map +1 -0
  144. package/dist/identity/identity.d.ts +25 -0
  145. package/dist/identity/identity.d.ts.map +1 -0
  146. package/dist/identity/identity.js +25 -0
  147. package/dist/identity/identity.js.map +1 -0
  148. package/dist/identity/index.d.ts +3 -0
  149. package/dist/identity/index.d.ts.map +1 -0
  150. package/dist/identity/index.js +2 -0
  151. package/dist/identity/index.js.map +1 -0
  152. package/dist/index.d.ts +57 -0
  153. package/dist/index.d.ts.map +1 -0
  154. package/dist/index.js +29 -0
  155. package/dist/index.js.map +1 -0
  156. package/dist/link/index.d.ts +3 -0
  157. package/dist/link/index.d.ts.map +1 -0
  158. package/dist/link/index.js +2 -0
  159. package/dist/link/index.js.map +1 -0
  160. package/dist/link/link.css +65 -0
  161. package/dist/link/link.d.ts +38 -0
  162. package/dist/link/link.d.ts.map +1 -0
  163. package/dist/link/link.js +22 -0
  164. package/dist/link/link.js.map +1 -0
  165. package/dist/logo-marquee/index.d.ts +4 -0
  166. package/dist/logo-marquee/index.d.ts.map +1 -0
  167. package/dist/logo-marquee/index.js +3 -0
  168. package/dist/logo-marquee/index.js.map +1 -0
  169. package/dist/logo-marquee/logo-marquee.css +227 -0
  170. package/dist/logo-marquee/logo-marquee.d.ts +69 -0
  171. package/dist/logo-marquee/logo-marquee.d.ts.map +1 -0
  172. package/dist/logo-marquee/logo-marquee.js +11 -0
  173. package/dist/logo-marquee/logo-marquee.js.map +1 -0
  174. package/dist/media-plate/index.d.ts +4 -0
  175. package/dist/media-plate/index.d.ts.map +1 -0
  176. package/dist/media-plate/index.js +3 -0
  177. package/dist/media-plate/index.js.map +1 -0
  178. package/dist/media-plate/media-plate.css +41 -0
  179. package/dist/media-plate/media-plate.d.ts +45 -0
  180. package/dist/media-plate/media-plate.d.ts.map +1 -0
  181. package/dist/media-plate/media-plate.js +5 -0
  182. package/dist/media-plate/media-plate.js.map +1 -0
  183. package/dist/media-window/media-window.css +82 -0
  184. package/dist/navbar/actions/actions.d.ts +14 -0
  185. package/dist/navbar/actions/actions.d.ts.map +1 -0
  186. package/dist/navbar/actions/actions.js +12 -0
  187. package/dist/navbar/actions/actions.js.map +1 -0
  188. package/dist/navbar/brand/brand.d.ts +12 -0
  189. package/dist/navbar/brand/brand.d.ts.map +1 -0
  190. package/dist/navbar/brand/brand.js +10 -0
  191. package/dist/navbar/brand/brand.js.map +1 -0
  192. package/dist/navbar/context.d.ts +12 -0
  193. package/dist/navbar/context.d.ts.map +1 -0
  194. package/dist/navbar/context.js +13 -0
  195. package/dist/navbar/context.js.map +1 -0
  196. package/dist/navbar/index.d.ts +8 -0
  197. package/dist/navbar/index.d.ts.map +1 -0
  198. package/dist/navbar/index.js +8 -0
  199. package/dist/navbar/index.js.map +1 -0
  200. package/dist/navbar/link/drawer/drawer.css +50 -0
  201. package/dist/navbar/link/drawer/drawer.d.ts +20 -0
  202. package/dist/navbar/link/drawer/drawer.d.ts.map +1 -0
  203. package/dist/navbar/link/drawer/drawer.js +44 -0
  204. package/dist/navbar/link/drawer/drawer.js.map +1 -0
  205. package/dist/navbar/link/link.css +54 -0
  206. package/dist/navbar/link/link.d.ts +30 -0
  207. package/dist/navbar/link/link.d.ts.map +1 -0
  208. package/dist/navbar/link/link.js +29 -0
  209. package/dist/navbar/link/link.js.map +1 -0
  210. package/dist/navbar/links/links.d.ts +14 -0
  211. package/dist/navbar/links/links.d.ts.map +1 -0
  212. package/dist/navbar/links/links.js +14 -0
  213. package/dist/navbar/links/links.js.map +1 -0
  214. package/dist/navbar/menu-button/menu-button.css +20 -0
  215. package/dist/navbar/menu-button/menu-button.d.ts +13 -0
  216. package/dist/navbar/menu-button/menu-button.d.ts.map +1 -0
  217. package/dist/navbar/menu-button/menu-button.js +20 -0
  218. package/dist/navbar/menu-button/menu-button.js.map +1 -0
  219. package/dist/navbar/navbar.css +179 -0
  220. package/dist/navbar/navbar.d.ts +58 -0
  221. package/dist/navbar/navbar.d.ts.map +1 -0
  222. package/dist/navbar/navbar.js +96 -0
  223. package/dist/navbar/navbar.js.map +1 -0
  224. package/dist/numbered-list/index.d.ts +4 -0
  225. package/dist/numbered-list/index.d.ts.map +1 -0
  226. package/dist/numbered-list/index.js +3 -0
  227. package/dist/numbered-list/index.js.map +1 -0
  228. package/dist/numbered-list/numbered-list.css +46 -0
  229. package/dist/numbered-list/numbered-list.d.ts +31 -0
  230. package/dist/numbered-list/numbered-list.d.ts.map +1 -0
  231. package/dist/numbered-list/numbered-list.js +26 -0
  232. package/dist/numbered-list/numbered-list.js.map +1 -0
  233. package/dist/on-media/on-media.css +198 -0
  234. package/dist/quick-action/index.d.ts +4 -0
  235. package/dist/quick-action/index.d.ts.map +1 -0
  236. package/dist/quick-action/index.js +3 -0
  237. package/dist/quick-action/index.js.map +1 -0
  238. package/dist/quick-action/quick-action.css +70 -0
  239. package/dist/quick-action/quick-action.d.ts +68 -0
  240. package/dist/quick-action/quick-action.d.ts.map +1 -0
  241. package/dist/quick-action/quick-action.js +54 -0
  242. package/dist/quick-action/quick-action.js.map +1 -0
  243. package/dist/segmented-control/index.d.ts +4 -0
  244. package/dist/segmented-control/index.d.ts.map +1 -0
  245. package/dist/segmented-control/index.js +3 -0
  246. package/dist/segmented-control/index.js.map +1 -0
  247. package/dist/segmented-control/segmented-control.css +206 -0
  248. package/dist/segmented-control/segmented-control.d.ts +91 -0
  249. package/dist/segmented-control/segmented-control.d.ts.map +1 -0
  250. package/dist/segmented-control/segmented-control.js +9 -0
  251. package/dist/segmented-control/segmented-control.js.map +1 -0
  252. package/dist/stat-card/index.d.ts +4 -0
  253. package/dist/stat-card/index.d.ts.map +1 -0
  254. package/dist/stat-card/index.js +3 -0
  255. package/dist/stat-card/index.js.map +1 -0
  256. package/dist/stat-card/stat-card.css +56 -0
  257. package/dist/stat-card/stat-card.d.ts +48 -0
  258. package/dist/stat-card/stat-card.d.ts.map +1 -0
  259. package/dist/stat-card/stat-card.js +11 -0
  260. package/dist/stat-card/stat-card.js.map +1 -0
  261. package/dist/surface/index.d.ts +3 -0
  262. package/dist/surface/index.d.ts.map +1 -0
  263. package/dist/surface/index.js +2 -0
  264. package/dist/surface/index.js.map +1 -0
  265. package/dist/surface/surface.d.ts +40 -0
  266. package/dist/surface/surface.d.ts.map +1 -0
  267. package/dist/surface/surface.js +22 -0
  268. package/dist/surface/surface.js.map +1 -0
  269. package/dist/tag/index.d.ts +4 -0
  270. package/dist/tag/index.d.ts.map +1 -0
  271. package/dist/tag/index.js +3 -0
  272. package/dist/tag/index.js.map +1 -0
  273. package/dist/tag/tag.css +77 -0
  274. package/dist/tag/tag.d.ts +80 -0
  275. package/dist/tag/tag.d.ts.map +1 -0
  276. package/dist/tag/tag.js +16 -0
  277. package/dist/tag/tag.js.map +1 -0
  278. package/dist/text/index.d.ts +3 -0
  279. package/dist/text/index.d.ts.map +1 -0
  280. package/dist/text/index.js +2 -0
  281. package/dist/text/index.js.map +1 -0
  282. package/dist/text/text.css +232 -0
  283. package/dist/text/text.d.ts +64 -0
  284. package/dist/text/text.d.ts.map +1 -0
  285. package/dist/text/text.js +37 -0
  286. package/dist/text/text.js.map +1 -0
  287. package/dist/video-lightbox/index.d.ts +4 -0
  288. package/dist/video-lightbox/index.d.ts.map +1 -0
  289. package/dist/video-lightbox/index.js +3 -0
  290. package/dist/video-lightbox/index.js.map +1 -0
  291. package/dist/video-lightbox/video-lightbox.css +167 -0
  292. package/dist/video-lightbox/video-lightbox.d.ts +92 -0
  293. package/dist/video-lightbox/video-lightbox.d.ts.map +1 -0
  294. package/dist/video-lightbox/video-lightbox.js +31 -0
  295. package/dist/video-lightbox/video-lightbox.js.map +1 -0
  296. package/dist/wrapper/index.d.ts +3 -0
  297. package/dist/wrapper/index.d.ts.map +1 -0
  298. package/dist/wrapper/index.js +2 -0
  299. package/dist/wrapper/index.js.map +1 -0
  300. package/dist/wrapper/wrapper.d.ts +113 -0
  301. package/dist/wrapper/wrapper.d.ts.map +1 -0
  302. package/dist/wrapper/wrapper.js +83 -0
  303. package/dist/wrapper/wrapper.js.map +1 -0
  304. package/package.json +184 -0
@@ -0,0 +1,167 @@
1
+ /* The film tile's sheet: a box that is a picture with three things pinned in it, and the panel that
2
+ * opens over the page. Every colour is a channel out of styles/on-media.css; none is written. See
3
+ * the repo blueprint, sections 4.1.11 and 4.2.
4
+ *
5
+ * ---- the floor, and the ratio it does NOT state at the wide size -----------
6
+ *
7
+ * `20rem` is 320px, the live tile's floor, and it is `achievement-card`'s and `feature-card`'s
8
+ * number -- so the tenth block width written by hand here and no new number.
9
+ * issues/done/030-the-block-width-family.md holds the count.
10
+ *
11
+ * `flex-grow` is `1` against the gallery's `1.4`, which is the pair the live row spends. The
12
+ * argument for putting both factors in the cards' own sheets rather than in card-grid/ is in
13
+ * gallery.css beside the number that carries it.
14
+ *
15
+ * **This tile states no `aspect-ratio` above the phone width and that is the arrangement rather
16
+ * than an omission.** The gallery beside it takes its height from a ratio; this one stretches to
17
+ * whatever that produced, so the two share a bottom edge **by construction and not by tuning** --
18
+ * measured 383 x 315 beside 505 x 315 at 1280 on the live page.
19
+ *
20
+ * **A flex row's own `align-items: stretch` is what does it, and stating a height is what BREAKS
21
+ * it.** This rule carried `height: 100%` for one measurement: stretch applies only where the cross
22
+ * size is `auto`, so a stated height opts the item out of it, and the tile came back 320 tall
23
+ * beside a 429 gallery -- its floor, not its neighbour's height. Both are gone and the row's
24
+ * default does the work. `min-height` stays, and it is what keeps the tile from collapsing once
25
+ * the row has stacked and there is no gallery beside it to be as tall as.
26
+ *
27
+ * **Below the phone width it takes `16 / 9`**, which is the second file in this repo allowed to
28
+ * state a ratio -- section 5's window row was widened for it in the same pass, with the four
29
+ * reasons this tile is not a window written out in video-lightbox.tsx. `48rem` and not the
30
+ * reference's 960px: gallery.css carries why, and it is the same give-way in the same band.
31
+ *
32
+ * ---- the pinning ----------------------------------------------------------
33
+ *
34
+ * The button is the positioning context and everything in it is absolute except the label, which is
35
+ * absolute too -- so nothing here participates in a layout and the tile's own height is entirely
36
+ * the row's business. `overflow: hidden` plus the corner is what makes the poster a picture in a
37
+ * shaped box, and it is two declarations rather than the window's five.
38
+ *
39
+ * **The disc's hover is painted from the TILE's hover and not its own**, because the pointer is over
40
+ * the button and only incidentally over the disc. That rule has to live here, and it is the reason
41
+ * on-media.css publishes channels rather than only classes: this sheet writes
42
+ * `var(--newtone-on-media-control-bg-hover)` and no literal. Same specificity as `.newtone-on-media-control:hover`,
43
+ * and site.css loads on-media.css first, so this wins by order.
44
+ *
45
+ * **The disc does not scale on hover where the reference's does.** Section 8 defers a motion
46
+ * vocabulary and this band has already spent its two moving things; a transform with a hand-written
47
+ * duration on a third would be a number nobody could justify, and the fill change says the same
48
+ * thing.
49
+ *
50
+ * ---- the panel ------------------------------------------------------------
51
+ *
52
+ * **The cap is a token read as a length, which is the first time that has happened here.** The
53
+ * reference writes `min(90vw, 1100px)`; 1100 is its number and it has no source in this repo, so
54
+ * copying it would be an eleventh hand-written block width chosen for agreeing with nothing.
55
+ * `--newtone-breakpoint-wide` is 1280 and it is the width this whole family already means by *a
56
+ * large screen* -- reused rather than chosen, which is `--gutter`'s argument and `48rem`'s. **A
57
+ * media query cannot read a custom property and a declaration can**, which is the half of
58
+ * issues/done/022-breakpoint-vocabulary.md's finding nothing had spent until now. So this number is
59
+ * not one of issues/done/030-the-block-width-family.md's: it is not written by hand.
60
+ *
61
+ * `overflow: visible` on the dialog so the close row can sit above the player's rounded corner
62
+ * rather than inside it.
63
+ *
64
+ * `object-fit` is not set on the player: an iframe is not a replaced element with intrinsic
65
+ * dimensions, and the 16 / 9 box is what the film is played into. */
66
+
67
+ .newtone-video-lightbox {
68
+ position: relative;
69
+ display: block;
70
+ min-height: 20rem;
71
+ flex: 1 1 min(20rem, 100%);
72
+ min-width: min(20rem, 100%);
73
+ padding: 0;
74
+ background: none;
75
+ border: 0;
76
+ border-radius: var(--newtone-video-lightbox-radius);
77
+ overflow: hidden;
78
+ cursor: pointer;
79
+ }
80
+
81
+ .newtone-video-lightbox:focus-visible {
82
+ outline: 2px solid var(--newtone-on-media-ring);
83
+ outline-offset: -4px;
84
+ }
85
+
86
+ .newtone-video-lightbox-poster {
87
+ position: absolute;
88
+ inset: 0;
89
+ width: 100%;
90
+ height: 100%;
91
+ object-fit: cover;
92
+ }
93
+
94
+ /* A wash rather than a gradient with an edge, because the label and the disc are both near the
95
+ * middle and neither has a reading edge to stand on. */
96
+ .newtone-video-lightbox-shade {
97
+ position: absolute;
98
+ inset: 0;
99
+ background: var(--newtone-on-media-scrim-soft);
100
+ }
101
+
102
+ .newtone-video-lightbox-disc {
103
+ position: absolute;
104
+ left: 50%;
105
+ top: 50%;
106
+ translate: -50% -50%;
107
+ }
108
+
109
+ .newtone-video-lightbox:hover .newtone-video-lightbox-disc {
110
+ background-color: var(--newtone-on-media-control-bg-hover);
111
+ }
112
+
113
+ .newtone-video-lightbox:active .newtone-video-lightbox-disc {
114
+ background-color: var(--newtone-on-media-control-bg-press);
115
+ }
116
+
117
+ /* Under the disc: half the disc plus the gap, measured from the tile's middle. Written as a sum so
118
+ * the two numbers it depends on are visible -- change the disc's size and this line says which
119
+ * half of it moved. */
120
+ .newtone-video-lightbox-label {
121
+ position: absolute;
122
+ left: 50%;
123
+ top: calc(50% + 1.5rem + var(--newtone-video-lightbox-label-offset));
124
+ translate: -50% 0;
125
+ inline-size: max-content;
126
+ max-inline-size: calc(100% - 2 * var(--newtone-video-lightbox-label-margin));
127
+ text-align: center;
128
+ }
129
+
130
+ .newtone-video-lightbox-panel {
131
+ width: min(90vw, var(--newtone-video-lightbox-panel-max-width));
132
+ margin: auto;
133
+ padding: 0;
134
+ background: none;
135
+ border: 0;
136
+ overflow: visible;
137
+ }
138
+
139
+ .newtone-video-lightbox-panel::backdrop {
140
+ background: var(--newtone-on-media-scrim-strong);
141
+ }
142
+
143
+ .newtone-video-lightbox-frame {
144
+ display: flex;
145
+ flex-direction: column;
146
+ gap: var(--newtone-video-lightbox-frame-gap);
147
+ }
148
+
149
+ .newtone-video-lightbox-close-row {
150
+ display: flex;
151
+ justify-content: flex-end;
152
+ }
153
+
154
+ .newtone-video-lightbox-player {
155
+ display: block;
156
+ width: 100%;
157
+ aspect-ratio: 16 / 9;
158
+ border: 0;
159
+ border-radius: var(--newtone-video-lightbox-radius);
160
+ }
161
+
162
+ @media (max-width: 48rem) {
163
+ .newtone-video-lightbox {
164
+ min-height: 0;
165
+ aspect-ratio: 16 / 9;
166
+ }
167
+ }
@@ -0,0 +1,92 @@
1
+ import { type HTMLAttributes } from 'react';
2
+ /**
3
+ * A poster with a play button on it, and a panel that opens over the page holding the film.
4
+ *
5
+ * Its first consumer renders one of these, beside a gallery. See the repo blueprint, section 3.
6
+ *
7
+ * ---- why this file has a directive, which is the decision worth reading ----
8
+ *
9
+ * **A panel can open over a page with no script at all** -- `popover` and `popovertarget` -- and
10
+ * that route was refused. **The price runs the opposite way from where anybody would look for it.**
11
+ * A markup-only panel puts the player's address in an `<iframe src>` in the document the server
12
+ * sends, so the browser fetches it on load and the video host is contacted by **every reader**,
13
+ * including everyone who never asks for the film. This tile builds its `<iframe>` on click and
14
+ * contacts nobody until somebody does.
15
+ *
16
+ * **So the saving would have been ours and the cost would have been theirs**, which is the shape
17
+ * that makes it not a trade to make quietly. `showModal()` needs a directive; the directive is what
18
+ * it costs.
19
+ *
20
+ * **The claim is about the REQUEST and not about the string, and that was checked rather than
21
+ * assumed.** Next serialises a client component's props into the payload it embeds in the HTML, so
22
+ * `player.vimeo.com/video/857845583` **is** in the bytes the server sends -- one `grep` finds it.
23
+ * What is not sent is a request: `performance.getEntriesByType('resource')` counts **0** entries for
24
+ * that host on load and **1** after the tile is pressed, measured on 2026-09-06 through
25
+ * `tools/ask.mjs`. A URL in a document tells nobody anything; a fetch tells its host who is reading.
26
+ * governance/evidence/verify-what-renders-not-what-was-written.md -- the version of this argument that says
27
+ * *the src is not in the document* would have been wrong, and nothing but looking would have said
28
+ * so.
29
+ *
30
+ * **A third route was named so it would not be found by accident**: a popover holding the poster and
31
+ * a plain link out to Vimeo. It contacts nobody and needs nothing -- and it is a **different
32
+ * control**, one that leaves the site to play a film the page we are rebuilding plays in place.
33
+ * governance/voice/an-omission-costs-nothing-a-placeholder-makes-a-claim.md cuts that way here: a control
34
+ * that looks like the live page's and behaves differently is the placeholder.
35
+ *
36
+ * ---- the embed, which is content and not a dependency ----------------------
37
+ *
38
+ * **This is the first thing on any of the three sites that reaches outside its own repository at
39
+ * render.** The eleven portraits, the eight marks, the two study-mode photographs and this band's
40
+ * seven pictures were all copied in, on the decision taken at `faculty`'s costing with its cost
41
+ * named: a picture the university updates updates their page and not ours. **A film cannot be**, and
42
+ * the reasoning for allowing it is a distinction rather than an exception --
43
+ * governance/code/minimize-third-party-dependence.md is about **dependencies**, services and code we
44
+ * could build and own, and not about **content that lives somewhere else.** The clause was amended
45
+ * on 2026-09-06 to say so.
46
+ *
47
+ * **`src` is a prop and the URL is copy.** It is the band's string, in
48
+ * master-page.content.ts, with `dnt=1` on it -- the live page's own parameter, and dropping it would
49
+ * be a choice nobody made in the direction of telling Vimeo more.
50
+ *
51
+ * ---- the tile is not a picture window, and that was the second open decision
52
+ *
53
+ * Newtone's `.newtone-media-window` is what two cards wear and what the gallery beside this one
54
+ * wears. **This tile wears none of it**, and section 8's overlay exemption -- one selector letting a
55
+ * mark sit inside a window unstretched -- was not built, because four of the window's five
56
+ * declarations are wrong here:
57
+ *
58
+ * - it states **no ratio at the wide size**, on purpose, so it stretches to whatever height the
59
+ * gallery's ratio produced and the two share a bottom edge by construction rather than by
60
+ * tuning. A window with no `--newtone-media-window-ratio` shrink-wraps, deliberately.
61
+ * - it has to **grow in the row**, where a window is `flex: none` so it never absorbs a squeeze.
62
+ * - **four things are pinned inside it** -- a poster, a shade, a disc, a label -- where
63
+ * `.newtone-media-window > *` exists to make ONE child fill the slot.
64
+ * - only the corner and the clip survive, which is two lines.
65
+ *
66
+ * **One contradiction is a hatch; four is a second problem.** `faculty`'s two-rules-two-problems
67
+ * finding, fourth outing, and the same test that kept this page's three hairlines from becoming one
68
+ * shape.
69
+ *
70
+ * ---- the small ones -------------------------------------------------------
71
+ *
72
+ * **The disc is `aria-hidden` and the label is not.** The tile is one button with one accessible
73
+ * name, and that name is the label's words; a play glyph announced beside them would be one control
74
+ * named twice, which is `portrait/`'s and `mode-card/`'s refusal for the same reason.
75
+ *
76
+ * **The poster is `alt=""`.** The label under it already says what the film is.
77
+ *
78
+ * **`aria-haspopup="dialog"`** so the tile says what pressing it does before it is pressed.
79
+ *
80
+ * **The iframe is unmounted on close**, not hidden. A hidden player is a player still playing.
81
+ */
82
+ export interface VideoLightboxProps extends HTMLAttributes<HTMLElement> {
83
+ /** The still behind the play button, served by the consuming app. Decorative -- the label names the
84
+ * film. */
85
+ poster: string;
86
+ /** The words on the tile, which are also the panel's accessible name. */
87
+ label: string;
88
+ /** The player's full address, from the copy. */
89
+ src: string;
90
+ }
91
+ export declare function VideoLightbox({ poster, label, src, className, ...rest }: VideoLightboxProps): import("react").JSX.Element;
92
+ //# sourceMappingURL=video-lightbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-lightbox.d.ts","sourceRoot":"","sources":["../../src/video-lightbox/video-lightbox.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,MAAM,WAAW,kBAAmB,SAAQ,cAAc,CAAC,WAAW,CAAC;IACnE;gBACY;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,kBAAkB,+BA6E3F"}
@@ -0,0 +1,31 @@
1
+ 'use client';
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ // The subpath, not the barrel. `@newtone-dev/ui-react-web` re-exports Navbar, and Navbar calls hooks --
4
+ // which this file could survive, being a client component already, but the rule is about the import
5
+ // graph rather than about who can afford it. See the repo blueprint, section 4.3.
6
+ import { Text } from '../text/index.js';
7
+ import { useRef, useState } from 'react';
8
+ import { Icon } from '../icon/index.js';
9
+ export function VideoLightbox({ poster, label, src, className, ...rest }) {
10
+ const panel = useRef(null);
11
+ const [playing, setPlaying] = useState(false);
12
+ function open() {
13
+ // The order matters and only one way round works: the panel has to be in the top layer
14
+ // before the player mounts, or the first frame of the iframe is laid out in the page.
15
+ panel.current?.showModal();
16
+ setPlaying(true);
17
+ }
18
+ return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", className: ['newtone-video-lightbox', className].filter(Boolean).join(' '), "aria-haspopup": "dialog", onClick: open, ...rest, children: [_jsx("img", { className: "newtone-video-lightbox-poster", src: poster, alt: "", loading: "lazy", draggable: false }), _jsx("span", { className: "newtone-video-lightbox-shade", "aria-hidden": true }), _jsx("span", { className: "newtone-on-media-control newtone-video-lightbox-disc", "aria-hidden": true, children: _jsx(Icon, { name: "play_arrow", size: "lg", fill: true }) }), _jsx("span", { className: "newtone-on-media-text newtone-video-lightbox-label", children: _jsx(Text, { scale: "body", children: label }) })] }), _jsx("dialog", { ref: panel, className: "newtone-video-lightbox-panel", "aria-label": label,
19
+ // A `<dialog>`'s own box is the panel and its backdrop is a pseudo-element, so a
20
+ // click that lands ON the dialog element and not on anything inside it is a click
21
+ // on the backdrop. That is the whole test; there is no overlay to add.
22
+ onClick: (event) => {
23
+ if (event.target === panel.current)
24
+ panel.current?.close();
25
+ },
26
+ // `Escape` closes a modal dialog without anything here listening for it, and this
27
+ // is what makes that path stop the film as well -- one handler for both ways out
28
+ // rather than a key listener that has to agree with the close button.
29
+ onClose: () => setPlaying(false), children: _jsxs("div", { className: "newtone-video-lightbox-frame", children: [_jsx("div", { className: "newtone-video-lightbox-close-row", children: _jsx("button", { type: "button", className: "newtone-on-media-control", "aria-label": "Close video", onClick: () => panel.current?.close(), children: _jsx(Icon, { name: "close" }) }) }), playing && (_jsx("iframe", { className: "newtone-video-lightbox-player", src: src, title: label, allow: "autoplay; fullscreen; picture-in-picture", allowFullScreen: true }))] }) })] }));
30
+ }
31
+ //# sourceMappingURL=video-lightbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-lightbox.js","sourceRoot":"","sources":["../../src/video-lightbox/video-lightbox.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,wGAAwG;AACxG,oGAAoG;AACpG,kFAAkF;AAClF,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAuB,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AA4FvC,MAAM,UAAU,aAAa,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,IAAI,EAAsB;IACxF,MAAM,KAAK,GAAG,MAAM,CAAoB,IA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hC,eAAK,SAAS,EAAC,8BAA8B,aACzC,cAAK,SAAS,EAAC,kCAAkC,YAC7C,iBACI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,0BAA0B,gBACzB,aAAa,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,YAErC,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,GAAG,GAChB,GACP,EACL,OAAO,IAAI,CACR,iBACI,SAAS,EAAC,+BAA+B,EACzC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,KAAK,EAAC,0CAA0C,EAChD,eAAe,SACjB,CACL,IACC,GACD,IACV,CACN,CAAA;AACL,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Wrapper } from './wrapper.js';
2
+ export type { WrapperProps, WrapperDirection, WrapperAlign, WrapperPadding, SpaceStep, } from './wrapper.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,YAAY,EACR,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,SAAS,GACZ,MAAM,cAAc,CAAA"}
@@ -0,0 +1,2 @@
1
+ export { Wrapper } from './wrapper.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA"}
@@ -0,0 +1,113 @@
1
+ import { type ElementType, type HTMLAttributes } from 'react';
2
+ /**
3
+ * A step on the tokens' spacing scale. These thirteen are the ones `newtone_ui_tokens` emits as
4
+ * `--newtone-space-*`; there is no 7 and no 9.
5
+ *
6
+ * **A step that is not on this list resolves to nothing and the declaration is dropped, in
7
+ * silence** -- `var(--newtone-space-7)` is not an error, it is an undefined custom property with
8
+ * no fallback. That is why this union is closed rather than `number`, and why the blueprint's
9
+ * section 5 carries a one-line check comparing it against the emitted stylesheet.
10
+ */
11
+ export type SpaceStep = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24;
12
+ export type WrapperDirection = 'row' | 'column';
13
+ /**
14
+ * Where the contents sit, as one of the nine positions of a 3x3 grid.
15
+ *
16
+ * **One control rather than two, because which CSS axis a visual axis lands on depends on
17
+ * `direction`.** `center` is `justify-content` in a row and `align-items` in a column;
18
+ * `middle-left` is both, swapped. Spelling it as two CSS props would make every call site
19
+ * re-derive that, and would silently invert the day somebody changed a row into a column.
20
+ *
21
+ * **Vertical first, without exception.** The system this was measured against writes `top-left`
22
+ * for the outer rows and `left-middle` for the middle one, which is two orders in one vocabulary.
23
+ *
24
+ * **`left` and `right` are physical and the values they resolve to are not.** Under a
25
+ * right-to-left writing mode `top-left` puts the group on the right. Nothing here has an RTL
26
+ * story; the blueprint's section 3 records that as a known cost with its trigger.
27
+ */
28
+ export type WrapperAlign = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
29
+ /** Uniform on all sides, or split by logical axis. Per-side is deferred -- blueprint section 8. */
30
+ export type WrapperPadding = SpaceStep | {
31
+ block?: SpaceStep;
32
+ inline?: SpaceStep;
33
+ };
34
+ /**
35
+ * The five layout props, plus the attribute surface of whatever element `as` renders.
36
+ *
37
+ * **`HTMLAttributes<HTMLElement>` is `Link`'s answer applied to a box**, and it is the same answer
38
+ * because there is only one: a component carries the attributes of the element it renders, and
39
+ * those are not props this contract names. `LinkProps` omits `children` and `href` because it
40
+ * narrows both; a box narrows nothing, so it omits nothing -- which is why `className`, `style` and
41
+ * `children` are no longer written out here. They arrive from the base at identical types.
42
+ *
43
+ * **It was counted rather than picked, and the count is three attributes**: `id` on the band, `id`
44
+ * on the band that paints, and `role` + `aria-label` on a control that gave up and wrote its own
45
+ * element. The alternative was a named few -- `id`, `role`, `aria-*`, `data-*` -- and it lost on a
46
+ * measurement rather than on taste. **Two of those four were already getting through.** TypeScript
47
+ * does not check a JSX attribute whose name is not a valid identifier, so before this change
48
+ * `<Wrapper aria-label={5} />` compiled and `<Wrapper id="x" />` did not: the spread below was open
49
+ * to exactly the half of the surface the compiler declines to look at.
50
+ *
51
+ * **So the wide answer starts checking what was already arriving**, which is what makes it better
52
+ * than the narrow one and not merely cheaper. What it costs is `onClick` and every other DOM event
53
+ * handler on a box that has never wanted one; `Link` has carried the same since 2026-09-01, so it
54
+ * is one exception rather than two. **Trigger to look again:** a call site that puts behaviour on a
55
+ * box, which is a different question from whether a box may be named.
56
+ *
57
+ * The blueprint's section 3 carries the compiled table and
58
+ * `issues/done/026-a-box-cannot-carry-an-attribute.md` the nine sittings it took to get two boxes.
59
+ */
60
+ export interface WrapperProps extends HTMLAttributes<HTMLElement> {
61
+ /** Which way the contents run. */
62
+ direction?: WrapperDirection;
63
+ /** The space BETWEEN the contents, as a step on the tokens' spacing scale. */
64
+ gap?: SpaceStep;
65
+ /** The space AROUND them: one step for every side, or `{ block, inline }`. */
66
+ padding?: WrapperPadding;
67
+ /** Where the contents sit as a group -- one of the nine positions. */
68
+ align?: WrapperAlign;
69
+ /** Let contents that no longer fit run onto a new line. */
70
+ wrap?: boolean;
71
+ as?: ElementType;
72
+ }
73
+ /**
74
+ * A box, and layout is the whole of it.
75
+ *
76
+ * **It declares no colour of any kind, and that is a consequence rather than a preference.** A box
77
+ * that paints has to read a role, and blueprints/newtone/contracts/roles.md section 3 forbids a
78
+ * component from reading one: a role answers *how much contrast is enough* once, for everything
79
+ * that reads it, which is only meaningful where the area is fixed by what the thing is. A
80
+ * component's area is its own business. `Surface` already answers the colour question without
81
+ * reading anything -- it writes attributes and the emitted stylesheet redefines the eleven roles
82
+ * for everything inside.
83
+ *
84
+ * **A `Surface` DECIDES colour and does not apply it, and this docblock said it paints until
85
+ * 2026-09-09.** `dist/newtone.css` carries zero `background` declarations; the roles are redefined
86
+ * for the subtree and a rule of the consuming site's own is what spends them. Nothing about the
87
+ * argument above moves -- a box still may not read a role -- and what moves is what a caller owes a
88
+ * Surface, which is a rule setting `background` and `color` together. The library's own part-file
89
+ * for `Surface` carries it in full.
90
+ *
91
+ * **So a themed box is two elements**, a `Surface` around a `Wrapper`. The system this was
92
+ * measured against puts both on one element and has to: its theming is a React context provider,
93
+ * which must physically enclose what reads it. Newtone's is inherited attributes, so the second
94
+ * element costs one tag and no decisions. The blueprint's section 8 carries the row for collapsing
95
+ * them, with `Identity` as the shape it would take.
96
+ *
97
+ * **It is always a flex container.** There is no `display` prop and nothing is inferred. A box
98
+ * that wanted to be a grid is a named, recurring arrangement, which is a class in a site's own
99
+ * sheet rather than a value typed at one call site.
100
+ *
101
+ * **It has no stylesheet**, because everything it emits is per-instance -- this gap, at this one
102
+ * place. Three things follow and all three are wanted: no `exports` key, so nothing to wire; no
103
+ * class name added to the published interface; and no load-order question. **The hazard runs one
104
+ * way and it is the price of that:** an inline declaration out-specifies every class, so a site
105
+ * must never pass a prop for a property its own class already sets. Set `gap` here and a `gap` in
106
+ * the class is dead.
107
+ *
108
+ * **The prop list is five and it was cut by counting rather than by reading.** 102 call sites
109
+ * across a 78-component library; what is missing is in the blueprint's section 8 with the count
110
+ * behind each one. `knowledge/newtone/the-box-that-does-not-paint.md` is the story.
111
+ */
112
+ export declare function Wrapper({ direction, gap, padding, align, wrap, as, style, ...rest }: WrapperProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
113
+ //# sourceMappingURL=wrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/wrapper/wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAEhG;;;;;;;;GAQG;AACH,MAAM,M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flex-start', middle: 'center', end: 'flex-end' };
4
+ /**
5
+ * Split one of the nine positions into its vertical and horizontal halves, then hand each to the
6
+ * axis it drives for this `direction`. In a row the horizontal half is the main axis; in a column
7
+ * it is the cross one. `center` is the only member that names neither half, so it is expanded.
8
+ */
9
+ function resolveAlign(align, direction) {
10
+ const [v, h] = align === 'center' ? ['middle', 'center'] : align.split('-');
11
+ const vertical = MAIN[v === 'top' ? 'start' : v === 'bottom' ? 'end' : 'middle'];
12
+ const horizontal = MAIN[h === 'left' ? 'start' : h === 'right' ? 'end' : 'middle'];
13
+ return direction === 'row'
14
+ ? { justifyContent: horizontal, alignItems: vertical }
15
+ : { justifyContent: vertical, alignItems: horizontal };
16
+ }
17
+ /**
18
+ * A box, and layout is the whole of it.
19
+ *
20
+ * **It declares no colour of any kind, and that is a consequence rather than a preference.** A box
21
+ * that paints has to read a role, and blueprints/newtone/contracts/roles.md section 3 forbids a
22
+ * component from reading one: a role answers *how much contrast is enough* once, for everything
23
+ * that reads it, which is only meaningful where the area is fixed by what the thing is. A
24
+ * component's area is its own business. `Surface` already answers the colour question without
25
+ * reading anything -- it writes attributes and the emitted stylesheet redefines the eleven roles
26
+ * for everything inside.
27
+ *
28
+ * **A `Surface` DECIDES colour and does not apply it, and this docblock said it paints until
29
+ * 2026-09-09.** `dist/newtone.css` carries zero `background` declarations; the roles are redefined
30
+ * for the subtree and a rule of the consuming site's own is what spends them. Nothing about the
31
+ * argument above moves -- a box still may not read a role -- and what moves is what a caller owes a
32
+ * Surface, which is a rule setting `background` and `color` together. The library's own part-file
33
+ * for `Surface` carries it in full.
34
+ *
35
+ * **So a themed box is two elements**, a `Surface` around a `Wrapper`. The system this was
36
+ * measured against puts both on one element and has to: its theming is a React context provider,
37
+ * which must physically enclose what reads it. Newtone's is inherited attributes, so the second
38
+ * element costs one tag and no decisions. The blueprint's section 8 carries the row for collapsing
39
+ * them, with `Identity` as the shape it would take.
40
+ *
41
+ * **It is always a flex container.** There is no `display` prop and nothing is inferred. A box
42
+ * that wanted to be a grid is a named, recurring arrangement, which is a class in a site's own
43
+ * sheet rather than a value typed at one call site.
44
+ *
45
+ * **It has no stylesheet**, because everything it emits is per-instance -- this gap, at this one
46
+ * place. Three things follow and all three are wanted: no `exports` key, so nothing to wire; no
47
+ * class name added to the published interface; and no load-order question. **The hazard runs one
48
+ * way and it is the price of that:** an inline declaration out-specifies every class, so a site
49
+ * must never pass a prop for a property its own class already sets. Set `gap` here and a `gap` in
50
+ * the class is dead.
51
+ *
52
+ * **The prop list is five and it was cut by counting rather than by reading.** 102 call sites
53
+ * across a 78-component library; what is missing is in the blueprint's section 8 with the count
54
+ * behind each one. `knowledge/newtone/the-box-that-does-not-paint.md` is the story.
55
+ */
56
+ export function Wrapper({ direction = 'column', gap, padding, align, wrap, as = 'div', style, ...rest }) {
57
+ const layout = {
58
+ display: 'flex',
59
+ flexDirection: direction,
60
+ // A flex child whose contents are wider than its track refuses to shrink and pushes the
61
+ // layout out. Both of the reference's own base classes carry this line for the same
62
+ // reason. It is a fix, not a default anybody chose, and there is no prop to undo it.
63
+ minWidth: 0,
64
+ ...(wrap ? { flexWrap: 'wrap' } : null),
65
+ ...(gap !== undefined ? { gap: SPACE(gap) } : null),
66
+ ...resolvePadding(padding),
67
+ ...(align ? resolveAlign(align, direction) : null),
68
+ // The caller's own style goes LAST so it wins any tie with what this component wrote.
69
+ ...style,
70
+ };
71
+ return createElement(as, { style: layout, ...rest });
72
+ }
73
+ function resolvePadding(padding) {
74
+ if (padding === undefined)
75
+ return {};
76
+ if (typeof padding === 'number')
77
+ return { padding: SPACE(padding) };
78
+ return {
79
+ ...(padding.block !== undefined ? { paddingBlock: SPACE(padding.block) } : null),
80
+ ...(padding.inline !== undefined ? { paddingInline: SPACE(padding.inline) } : null),
81
+ };
82
+ }
83
+ //# sourceMappingURL=wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/wrapper/wrapper.tsx"],"names":[],"mappings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