@voidable/theme 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. package/README.md +133 -8
  2. package/dist/base.css +20 -0
  3. package/dist/base.min.css +1 -0
  4. package/dist/component-tokens.json +1015 -0
  5. package/dist/components/accordion.css +149 -0
  6. package/dist/components/accordion.min.css +1 -0
  7. package/dist/components/action-input.css +416 -0
  8. package/dist/components/action-input.min.css +1 -0
  9. package/dist/components/alert.css +151 -0
  10. package/dist/components/alert.min.css +1 -0
  11. package/dist/components/avatar.css +73 -0
  12. package/dist/components/avatar.min.css +1 -0
  13. package/dist/components/badge.css +108 -0
  14. package/dist/components/badge.min.css +1 -0
  15. package/dist/components/banner.css +149 -0
  16. package/dist/components/banner.min.css +1 -0
  17. package/dist/components/bar-chart.css +101 -0
  18. package/dist/components/bar-chart.min.css +1 -0
  19. package/dist/components/breadcrumbs.css +82 -0
  20. package/dist/components/breadcrumbs.min.css +1 -0
  21. package/dist/components/button.css +237 -0
  22. package/dist/components/button.min.css +1 -0
  23. package/dist/components/calendar.css +669 -0
  24. package/dist/components/calendar.min.css +1 -0
  25. package/dist/components/card.css +161 -0
  26. package/dist/components/card.min.css +1 -0
  27. package/dist/components/carousel.css +223 -0
  28. package/dist/components/carousel.min.css +1 -0
  29. package/dist/components/checkbox-group.css +68 -0
  30. package/dist/components/checkbox-group.min.css +1 -0
  31. package/dist/components/checkbox.css +169 -0
  32. package/dist/components/checkbox.min.css +1 -0
  33. package/dist/components/collapsible.css +152 -0
  34. package/dist/components/collapsible.min.css +1 -0
  35. package/dist/components/color-picker.css +364 -0
  36. package/dist/components/color-picker.min.css +1 -0
  37. package/dist/components/combobox.css +548 -0
  38. package/dist/components/combobox.min.css +1 -0
  39. package/dist/components/compose-input.css +117 -0
  40. package/dist/components/compose-input.min.css +1 -0
  41. package/dist/components/dialog.css +175 -0
  42. package/dist/components/dialog.min.css +1 -0
  43. package/dist/components/divider.css +84 -0
  44. package/dist/components/divider.min.css +1 -0
  45. package/dist/components/donut-chart.css +122 -0
  46. package/dist/components/donut-chart.min.css +1 -0
  47. package/dist/components/drawer.css +230 -0
  48. package/dist/components/drawer.min.css +1 -0
  49. package/dist/components/dropdown-menu.css +274 -0
  50. package/dist/components/dropdown-menu.min.css +1 -0
  51. package/dist/components/editable.css +141 -0
  52. package/dist/components/editable.min.css +1 -0
  53. package/dist/components/error-fallback.css +129 -0
  54. package/dist/components/error-fallback.min.css +1 -0
  55. package/dist/components/field.css +103 -0
  56. package/dist/components/field.min.css +1 -0
  57. package/dist/components/file-upload.css +156 -0
  58. package/dist/components/file-upload.min.css +1 -0
  59. package/dist/components/gauge.css +186 -0
  60. package/dist/components/gauge.min.css +1 -0
  61. package/dist/components/hamburger.css +114 -0
  62. package/dist/components/hamburger.min.css +1 -0
  63. package/dist/components/hover-card.css +220 -0
  64. package/dist/components/hover-card.min.css +1 -0
  65. package/dist/components/indicator.css +159 -0
  66. package/dist/components/indicator.min.css +1 -0
  67. package/dist/components/input.css +134 -0
  68. package/dist/components/input.min.css +1 -0
  69. package/dist/components/line-chart.css +157 -0
  70. package/dist/components/line-chart.min.css +1 -0
  71. package/dist/components/list.css +90 -0
  72. package/dist/components/list.min.css +1 -0
  73. package/dist/components/menu.css +208 -0
  74. package/dist/components/menu.min.css +1 -0
  75. package/dist/components/multiselect.css +397 -0
  76. package/dist/components/multiselect.min.css +1 -0
  77. package/dist/components/nav-bar.css +75 -0
  78. package/dist/components/nav-bar.min.css +1 -0
  79. package/dist/components/nav-menu.css +173 -0
  80. package/dist/components/nav-menu.min.css +1 -0
  81. package/dist/components/number-input.css +272 -0
  82. package/dist/components/number-input.min.css +1 -0
  83. package/dist/components/pagination.css +128 -0
  84. package/dist/components/pagination.min.css +1 -0
  85. package/dist/components/panel.css +96 -0
  86. package/dist/components/panel.min.css +1 -0
  87. package/dist/components/pin-input.css +185 -0
  88. package/dist/components/pin-input.min.css +1 -0
  89. package/dist/components/popover.css +227 -0
  90. package/dist/components/popover.min.css +1 -0
  91. package/dist/components/progress.css +148 -0
  92. package/dist/components/progress.min.css +1 -0
  93. package/dist/components/radio-group.css +64 -0
  94. package/dist/components/radio-group.min.css +1 -0
  95. package/dist/components/radio.css +174 -0
  96. package/dist/components/radio.min.css +1 -0
  97. package/dist/components/scroll-area.css +83 -0
  98. package/dist/components/scroll-area.min.css +1 -0
  99. package/dist/components/segmented-control.css +158 -0
  100. package/dist/components/segmented-control.min.css +1 -0
  101. package/dist/components/select.css +207 -0
  102. package/dist/components/select.min.css +1 -0
  103. package/dist/components/sidebar.css +62 -0
  104. package/dist/components/sidebar.min.css +1 -0
  105. package/dist/components/skeleton.css +85 -0
  106. package/dist/components/skeleton.min.css +1 -0
  107. package/dist/components/slider.css +193 -0
  108. package/dist/components/slider.min.css +1 -0
  109. package/dist/components/spinner.css +100 -0
  110. package/dist/components/spinner.min.css +1 -0
  111. package/dist/components/stat.css +177 -0
  112. package/dist/components/stat.min.css +1 -0
  113. package/dist/components/status-dot.css +60 -0
  114. package/dist/components/status-dot.min.css +1 -0
  115. package/dist/components/stepper.css +114 -0
  116. package/dist/components/stepper.min.css +1 -0
  117. package/dist/components/switch.css +175 -0
  118. package/dist/components/switch.min.css +1 -0
  119. package/dist/components/table.css +416 -0
  120. package/dist/components/table.min.css +1 -0
  121. package/dist/components/tabs.css +185 -0
  122. package/dist/components/tabs.min.css +1 -0
  123. package/dist/components/tag.css +134 -0
  124. package/dist/components/tag.min.css +1 -0
  125. package/dist/components/tags-input.css +267 -0
  126. package/dist/components/tags-input.min.css +1 -0
  127. package/dist/components/textarea.css +127 -0
  128. package/dist/components/textarea.min.css +1 -0
  129. package/dist/components/toast.css +200 -0
  130. package/dist/components/toast.min.css +1 -0
  131. package/dist/components/toggle-group.css +59 -0
  132. package/dist/components/toggle-group.min.css +1 -0
  133. package/dist/components/toggle.css +139 -0
  134. package/dist/components/toggle.min.css +1 -0
  135. package/dist/components/tooltip.css +221 -0
  136. package/dist/components/tooltip.min.css +1 -0
  137. package/dist/core.css +9657 -0
  138. package/dist/core.min.css +1 -0
  139. package/dist/dtcg/aurora.dark.tokens.json +4723 -0
  140. package/dist/dtcg/aurora.light.tokens.json +4723 -0
  141. package/dist/dtcg/capsule.dark.tokens.json +4723 -0
  142. package/dist/dtcg/capsule.light.tokens.json +4723 -0
  143. package/dist/dtcg/console.dark.tokens.json +4723 -0
  144. package/dist/dtcg/console.light.tokens.json +4723 -0
  145. package/dist/dtcg/dune.dark.tokens.json +4723 -0
  146. package/dist/dtcg/dune.light.tokens.json +4723 -0
  147. package/dist/dtcg/iris.dark.tokens.json +4723 -0
  148. package/dist/dtcg/iris.light.tokens.json +4723 -0
  149. package/dist/dtcg/loft.dark.tokens.json +5203 -0
  150. package/dist/dtcg/loft.light.tokens.json +5203 -0
  151. package/dist/dtcg/orbit.dark.tokens.json +4723 -0
  152. package/dist/dtcg/orbit.light.tokens.json +4723 -0
  153. package/dist/dtcg/paper.dark.tokens.json +4723 -0
  154. package/dist/dtcg/paper.light.tokens.json +4723 -0
  155. package/dist/dtcg/slab.dark.tokens.json +4969 -0
  156. package/dist/dtcg/slab.light.tokens.json +4969 -0
  157. package/dist/dtcg/void.dark.tokens.json +4723 -0
  158. package/dist/dtcg/void.light.tokens.json +4723 -0
  159. package/dist/dtcg/voidable.resolver.json +117 -0
  160. package/dist/exports.json +708 -0
  161. package/dist/json/aurora.dark.json +394 -0
  162. package/dist/json/aurora.light.json +394 -0
  163. package/dist/json/capsule.dark.json +394 -0
  164. package/dist/json/capsule.light.json +394 -0
  165. package/dist/json/console.dark.json +394 -0
  166. package/dist/json/console.light.json +394 -0
  167. package/dist/json/dune.dark.json +394 -0
  168. package/dist/json/dune.light.json +394 -0
  169. package/dist/json/iris.dark.json +394 -0
  170. package/dist/json/iris.light.json +394 -0
  171. package/dist/json/loft.dark.json +423 -0
  172. package/dist/json/loft.light.json +423 -0
  173. package/dist/json/orbit.dark.json +394 -0
  174. package/dist/json/orbit.light.json +394 -0
  175. package/dist/json/paper.dark.json +394 -0
  176. package/dist/json/paper.light.json +394 -0
  177. package/dist/json/slab.dark.json +412 -0
  178. package/dist/json/slab.light.json +412 -0
  179. package/dist/json/void.dark.json +394 -0
  180. package/dist/json/void.light.json +394 -0
  181. package/dist/knobs.css +21 -0
  182. package/dist/knobs.json +362 -0
  183. package/dist/knobs.min.css +1 -0
  184. package/dist/layers.css +2 -0
  185. package/dist/layers.min.css +1 -0
  186. package/dist/names.d.ts +519 -0
  187. package/dist/names.js +719 -0
  188. package/dist/patterns/app-shell.css +136 -0
  189. package/dist/patterns/app-shell.min.css +1 -0
  190. package/dist/patterns/data.css +430 -0
  191. package/dist/patterns/data.min.css +1 -0
  192. package/dist/patterns/media.css +288 -0
  193. package/dist/patterns/media.min.css +1 -0
  194. package/dist/patterns/page.css +323 -0
  195. package/dist/patterns/page.min.css +1 -0
  196. package/dist/patterns/shell.css +328 -0
  197. package/dist/patterns/shell.min.css +1 -0
  198. package/dist/primitives.css +175 -0
  199. package/dist/primitives.min.css +1 -0
  200. package/dist/reset.css +44 -0
  201. package/dist/reset.min.css +1 -0
  202. package/dist/skin.d.ts +14 -0
  203. package/dist/skin.js +158 -0
  204. package/dist/skins/loft.css +94 -0
  205. package/dist/skins/loft.min.css +1 -0
  206. package/dist/skins/slab.css +99 -0
  207. package/dist/skins/slab.min.css +1 -0
  208. package/dist/themes/aurora.css +18 -0
  209. package/dist/themes/aurora.min.css +1 -0
  210. package/dist/themes/capsule.css +18 -0
  211. package/dist/themes/capsule.min.css +1 -0
  212. package/dist/themes/console.css +18 -0
  213. package/dist/themes/console.min.css +1 -0
  214. package/dist/themes/dune.css +18 -0
  215. package/dist/themes/dune.min.css +1 -0
  216. package/dist/themes/iris.css +18 -0
  217. package/dist/themes/iris.min.css +1 -0
  218. package/dist/themes/orbit.css +18 -0
  219. package/dist/themes/orbit.min.css +1 -0
  220. package/dist/themes/paper.css +19 -0
  221. package/dist/themes/paper.min.css +1 -0
  222. package/dist/themes/void.css +18 -0
  223. package/dist/themes/void.min.css +1 -0
  224. package/dist/tokens.css +695 -0
  225. package/dist/tokens.min.css +1 -0
  226. package/dist/type.css +99 -0
  227. package/dist/type.min.css +1 -0
  228. package/dist/void.css +9673 -0
  229. package/dist/void.min.css +1 -0
  230. package/package.json +66 -8
  231. package/src/app-shell/detail.css +7 -5
  232. package/src/app-shell/subtable.css +7 -6
  233. package/src/base.css +28 -0
  234. package/src/components/accordion.css +96 -19
  235. package/src/components/action-input.css +51 -61
  236. package/src/components/alert.css +63 -23
  237. package/src/components/avatar.css +0 -2
  238. package/src/components/badge.css +35 -25
  239. package/src/components/banner.css +60 -19
  240. package/src/components/bar-chart.css +10 -3
  241. package/src/components/breadcrumbs.css +20 -16
  242. package/src/components/button.css +130 -55
  243. package/src/components/calendar.css +40 -17
  244. package/src/components/card.css +122 -23
  245. package/src/components/carousel.css +85 -118
  246. package/src/components/checkbox-group.css +3 -1
  247. package/src/components/checkbox.css +18 -23
  248. package/src/components/collapsible.css +95 -29
  249. package/src/components/color-picker.css +10 -10
  250. package/src/components/combobox.css +47 -29
  251. package/src/components/compose-input.css +3 -3
  252. package/src/components/dialog.css +115 -41
  253. package/src/components/divider.css +7 -4
  254. package/src/components/donut-chart.css +25 -15
  255. package/src/components/drawer.css +135 -68
  256. package/src/components/dropdown-menu.css +21 -43
  257. package/src/components/editable.css +7 -7
  258. package/src/components/error-fallback.css +48 -27
  259. package/src/components/field.css +12 -5
  260. package/src/components/file-upload.css +2 -1
  261. package/src/components/gauge.css +35 -23
  262. package/src/components/hamburger.css +10 -10
  263. package/src/components/hover-card.css +13 -113
  264. package/src/components/indicator.css +22 -18
  265. package/src/components/input.css +15 -12
  266. package/src/components/line-chart.css +10 -10
  267. package/src/components/list.css +28 -7
  268. package/src/components/menu.css +48 -33
  269. package/src/components/multiselect.css +57 -40
  270. package/src/components/nav-bar.css +23 -14
  271. package/src/components/nav-menu.css +31 -22
  272. package/src/components/number-input.css +56 -79
  273. package/src/components/overlay.css +215 -0
  274. package/src/components/pagination.css +42 -31
  275. package/src/components/panel.css +37 -11
  276. package/src/components/pin-input.css +23 -22
  277. package/src/components/popover.css +19 -35
  278. package/src/components/progress.css +19 -10
  279. package/src/components/radio-group.css +2 -1
  280. package/src/components/radio.css +15 -20
  281. package/src/components/scroll-area.css +3 -3
  282. package/src/components/segmented-control.css +46 -29
  283. package/src/components/select.css +99 -31
  284. package/src/components/sidebar.css +8 -4
  285. package/src/components/skeleton.css +8 -3
  286. package/src/components/slider.css +4 -2
  287. package/src/components/spinner.css +5 -4
  288. package/src/components/stat.css +59 -52
  289. package/src/components/status-dot.css +0 -1
  290. package/src/components/switch.css +18 -26
  291. package/src/components/table.css +443 -16
  292. package/src/components/tabs.css +92 -29
  293. package/src/components/tag.css +44 -20
  294. package/src/components/tags-input.css +43 -55
  295. package/src/components/textarea.css +15 -12
  296. package/src/components/toast.css +84 -22
  297. package/src/components/toggle.css +35 -42
  298. package/src/components/tooltip.css +19 -38
  299. package/src/core.css +98 -0
  300. package/src/forced-colors.css +134 -0
  301. package/src/index.css +4 -77
  302. package/src/knobs.css +101 -0
  303. package/src/layers.css +38 -0
  304. package/src/media/media.css +258 -0
  305. package/src/media/surface.css +143 -0
  306. package/src/patterns/data.css +461 -0
  307. package/src/patterns/page.css +348 -0
  308. package/src/patterns/shell.css +371 -0
  309. package/src/pre-upgrade.css +202 -0
  310. package/src/primitives.css +19 -97
  311. package/src/reset.css +45 -21
  312. package/src/skins/loft.css +114 -0
  313. package/src/skins/slab.css +107 -0
  314. package/src/themes/aurora.css +16 -0
  315. package/src/themes/capsule.css +16 -0
  316. package/src/themes/console.css +16 -0
  317. package/src/themes/dune.css +16 -0
  318. package/src/themes/iris.css +16 -0
  319. package/src/themes/orbit.css +16 -0
  320. package/src/themes/paper.css +18 -0
  321. package/src/themes/void.css +16 -0
  322. package/src/tokens.css +552 -98
  323. package/src/type.css +103 -0
@@ -0,0 +1,371 @@
1
+ /* ============================================================
2
+ Patterns — the recurring pieces of an application screen.
3
+ Every element in this directory is CSS only: an unregistered
4
+ void-* tag that the theme styles. Nothing to import, nothing to
5
+ upgrade, nothing a server morph can break. Semantics come from the
6
+ native elements you put inside (main, h1, h2, dl, a).
7
+ ============================================================ */
8
+
9
+ /* @tokens void-nav-links
10
+ --void-nav-links-item-surface-selected Fill of the link to the current page.
11
+ --void-nav-links-item-ink-selected Text colour of the link to the current page. Set it with the surface: lint:contrast checks the pair. */
12
+
13
+ /* ── void-shell: the frame of an application ──
14
+ <void-shell> top bar, then the page
15
+ <void-nav-bar>…</void-nav-bar>
16
+ <main>…</main>
17
+ </void-shell>
18
+
19
+ <void-shell nav="side"> sidebar beside the page
20
+ <void-shell nav="overlay"> bar laid over the top of the page
21
+ (for a page that opens on a
22
+ media surface) */
23
+ void-shell {
24
+ display: flex;
25
+ flex-direction: column;
26
+ min-height: 100svh;
27
+ background: var(--void-color-bg);
28
+ color: var(--void-color-text);
29
+ font-family: var(--void-font-sans);
30
+ }
31
+
32
+ void-shell > main {
33
+ flex: 1 1 auto;
34
+ min-width: 0;
35
+ }
36
+
37
+ /* The bar's content lines up with the page column below it. */
38
+ void-shell > void-nav-bar {
39
+ padding-inline: var(--void-page-inset);
40
+ flex-wrap: wrap;
41
+ }
42
+
43
+ /* ── Side navigation ── */
44
+ void-shell[nav="side"] {
45
+ flex-direction: row;
46
+ align-items: flex-start;
47
+ }
48
+
49
+ void-shell[nav="side"] > void-sidebar {
50
+ position: sticky;
51
+ top: 0;
52
+ height: 100svh;
53
+ gap: var(--void-gap-stack);
54
+ padding: var(--void-gap-stack) var(--void-gap-inside);
55
+ overflow-y: auto;
56
+ }
57
+
58
+ void-shell[nav="side"] > main {
59
+ align-self: stretch;
60
+ }
61
+
62
+ /* The brand and anything else in the sidebar line up with the text of
63
+ the links, which sit inside their own padding. */
64
+ void-shell[nav="side"] > void-sidebar > :not(void-nav-links) {
65
+ padding-inline: var(--void-control-padding);
66
+ }
67
+
68
+ /* ── Overlay navigation ──
69
+ The bar and the page share one grid cell, so the bar lies over the
70
+ top of the page. It carries the on-media surface (off-white text,
71
+ its own scrim) because the first thing under it is an image. */
72
+ void-shell[nav="overlay"] {
73
+ display: grid;
74
+ grid-template: "shell" minmax(0, 1fr) / minmax(0, 1fr);
75
+ }
76
+
77
+ void-shell[nav="overlay"] > * {
78
+ grid-area: shell;
79
+ }
80
+
81
+ void-shell[nav="overlay"] > void-nav-bar {
82
+ align-self: start;
83
+ z-index: var(--void-z-sticky);
84
+ }
85
+
86
+ /* A media surface that opens the page keeps its content clear of
87
+ the bar lying over it. */
88
+ void-shell[nav="overlay"] {
89
+ --_void-shell-bar-height: calc(var(--void-control-height) + var(--void-space-5));
90
+ }
91
+
92
+ void-shell[nav="overlay"] > main > void-media:first-child > void-media-content {
93
+ padding-top: calc(var(--_void-shell-bar-height) + var(--void-gap-group));
94
+ }
95
+
96
+ @media (max-width: 48rem) {
97
+ void-shell[nav="overlay"] {
98
+ --_void-shell-bar-height: calc(var(--void-control-height) + var(--void-control-height-sm) + var(--void-space-6));
99
+ }
100
+
101
+ /* Stacked, the content is under the image, not under the bar. */
102
+ void-shell[nav="overlay"] > main > void-media[stack]:first-child > void-media-content {
103
+ padding-top: 0;
104
+ }
105
+ }
106
+
107
+ /* Where the browser can tie an animation to scrolling, the bar stays
108
+ with you and becomes a blurred bar once the image has scrolled by.
109
+ Elsewhere it stays at the top of the page and scrolls away. */
110
+ /* The timeline is written through var() on purpose, here and wherever
111
+ else the theme uses a scroll timeline: the build's minifier otherwise
112
+ folds animation-timeline into the animation shorthand, which no browser
113
+ reads, and the animation silently never runs (lint:theme checks the
114
+ built file for this). --_void-timeline is never set. */
115
+ @supports (animation-timeline: scroll()) {
116
+ void-shell[nav="overlay"] > void-nav-bar {
117
+ position: sticky;
118
+ top: 0;
119
+ animation: void-shell-bar-settle linear both;
120
+ animation-timeline: var(--_void-timeline, scroll(root block));
121
+ animation-range: 2rem 12rem;
122
+ }
123
+
124
+ void-shell[nav="overlay"] > void-nav-bar::before {
125
+ animation: void-shell-bar-scrim linear both;
126
+ animation-timeline: var(--_void-timeline, scroll(root block));
127
+ animation-range: 2rem 12rem;
128
+ }
129
+
130
+ @keyframes void-shell-bar-settle {
131
+ to {
132
+ background: var(--void-color-control-fill);
133
+ -webkit-backdrop-filter: blur(var(--void-glass-blur));
134
+ backdrop-filter: blur(var(--void-glass-blur));
135
+ }
136
+ }
137
+
138
+ @keyframes void-shell-bar-scrim {
139
+ to { opacity: 0; }
140
+ }
141
+ }
142
+
143
+ /* How much of the near edge of a scrolling row of links fades: 0 until the
144
+ row has been scrolled (see the narrow-width rules below). */
145
+ @property --_void-nav-links-fade-start {
146
+ syntax: "<length>";
147
+ inherits: false;
148
+ initial-value: 0px;
149
+ }
150
+
151
+ /* ── void-nav-links: the links of a bar or a sidebar ──
152
+ <void-nav-links>
153
+ <a href="/" aria-current="page">Overview</a>
154
+ <a href="/stations">Stations</a>
155
+ </void-nav-links>
156
+ In a bar it is a row that scrolls sideways when it runs out of
157
+ room; in a sidebar it is a column. */
158
+ void-nav-links {
159
+ display: flex;
160
+ align-items: center;
161
+ gap: var(--void-space-1);
162
+ min-width: 0;
163
+ font-family: var(--void-font-sans);
164
+ }
165
+
166
+ void-nav-links > a {
167
+ display: inline-flex;
168
+ align-items: center;
169
+ gap: var(--void-gap-tight);
170
+ flex: none;
171
+ min-height: var(--void-control-height-sm);
172
+ padding: 0 var(--void-control-padding);
173
+ border-radius: var(--void-control-radius);
174
+ color: var(--void-color-text-secondary);
175
+ font-size: var(--void-type-body-size);
176
+ line-height: var(--void-leading-tight);
177
+ text-decoration: none;
178
+ white-space: nowrap;
179
+ transition: color var(--void-duration-fast) var(--void-ease-in-out),
180
+ background var(--void-duration-fast) var(--void-ease-in-out);
181
+ }
182
+
183
+ void-nav-links > a:hover {
184
+ color: var(--void-color-text);
185
+ }
186
+
187
+ void-nav-links > a[aria-current="page"] {
188
+ background: var(--void-nav-links-item-surface-selected, var(--void-item-surface-selected));
189
+ color: var(--void-nav-links-item-ink-selected, var(--void-item-ink-selected));
190
+ }
191
+
192
+ void-nav-links > a:focus-visible {
193
+ outline: var(--void-focus-ring-width) solid var(--void-focus-ring-color);
194
+ outline-offset: calc(var(--void-focus-ring-offset) * -1);
195
+ }
196
+
197
+ void-nav-links[orientation="vertical"],
198
+ void-sidebar void-nav-links {
199
+ flex-direction: column;
200
+ align-items: stretch;
201
+ }
202
+
203
+ void-nav-links[orientation="vertical"] > a,
204
+ void-sidebar void-nav-links > a {
205
+ min-height: var(--void-control-height);
206
+ }
207
+
208
+ /* A label above a group of links in a sidebar. */
209
+ void-nav-links > [data-void-type="label"] {
210
+ padding: var(--void-gap-tight) var(--void-control-padding) var(--void-space-1);
211
+ }
212
+
213
+ /* Pushes what follows it to the far end of a bar or a toolbar. */
214
+ void-spacer {
215
+ flex: 1 1 0;
216
+ min-width: 0;
217
+ }
218
+
219
+ @media (max-width: 48rem) {
220
+ /* Narrow-width navigation (#49). In a bar the links drop to a row of
221
+ their own that scrolls sideways: every destination stays one tap
222
+ away and the application writes no JavaScript, which a menu behind
223
+ void-hamburger would need.
224
+
225
+ The row used to end a few pixels short of the screen and cut the last
226
+ link off mid-word ("Li") with nothing to say there was more. It now
227
+ runs to both edges of the screen, the links snap to its start, and
228
+ the far edge fades out. The fade lies over padding the row adds after
229
+ its last link (--_void-nav-links-fade), so a link is only ever faded
230
+ while there is more to scroll to, and never at the end of the row.
231
+
232
+ --_void-nav-links-bleed is how far the row has to reach to get to the
233
+ edge of the screen: the inline padding of what it sits in. It is the
234
+ one value here that depends on the bar's own padding; keep the two in
235
+ step if that padding changes. */
236
+ void-nav-bar,
237
+ void-sidebar {
238
+ --_void-nav-links-bleed: var(--void-space-4);
239
+ --_void-nav-links-fade: var(--void-space-8);
240
+ }
241
+
242
+ void-shell > void-nav-bar,
243
+ void-shell[nav="side"] > void-sidebar {
244
+ --_void-nav-links-bleed: var(--void-gutter);
245
+ }
246
+
247
+ void-nav-bar void-nav-links,
248
+ void-shell[nav="side"] > void-sidebar void-nav-links {
249
+ order: 1;
250
+ flex: 0 0 calc(100% + 2 * var(--_void-nav-links-bleed));
251
+ margin-inline: calc(var(--_void-nav-links-bleed) * -1);
252
+ /* The first link's text, not its box, lines up with the page column. */
253
+ padding-inline: max(0px, calc(var(--_void-nav-links-bleed) - var(--void-control-padding))) var(--_void-nav-links-fade);
254
+ overflow-x: auto;
255
+ scrollbar-width: none;
256
+ overscroll-behavior-x: contain;
257
+ scroll-snap-type: inline proximity;
258
+ scroll-padding-inline: max(0px, calc(var(--_void-nav-links-bleed) - var(--void-control-padding))) var(--_void-nav-links-fade);
259
+ -webkit-mask-image: linear-gradient(to right, transparent, black var(--_void-nav-links-fade-start), black calc(100% - var(--_void-nav-links-fade)), transparent);
260
+ mask-image: linear-gradient(to right, transparent, black var(--_void-nav-links-fade-start), black calc(100% - var(--_void-nav-links-fade)), transparent);
261
+ }
262
+
263
+ :is(void-nav-bar, void-shell[nav="side"] > void-sidebar) void-nav-links:dir(rtl) {
264
+ -webkit-mask-image: linear-gradient(to left, transparent, black var(--_void-nav-links-fade-start), black calc(100% - var(--_void-nav-links-fade)), transparent);
265
+ mask-image: linear-gradient(to left, transparent, black var(--_void-nav-links-fade-start), black calc(100% - var(--_void-nav-links-fade)), transparent);
266
+ }
267
+
268
+ /* The near edge has no padding to fade over (the first link lines up
269
+ with the page), so it fades only once the row has been scrolled, where
270
+ the browser can tie an animation to the row's scroll position.
271
+ Elsewhere links leave by the edge of the screen unfaded. */
272
+ @supports (animation-timeline: scroll()) {
273
+ void-nav-bar void-nav-links,
274
+ void-shell[nav="side"] > void-sidebar void-nav-links {
275
+ animation: void-nav-links-fade linear both;
276
+ animation-timeline: var(--_void-timeline, scroll(self inline));
277
+ }
278
+
279
+ @keyframes void-nav-links-fade {
280
+ 0% { --_void-nav-links-fade-start: 0px; }
281
+ 25%, 100% { --_void-nav-links-fade-start: var(--_void-nav-links-fade); }
282
+ }
283
+ }
284
+
285
+ :is(void-nav-bar, void-shell[nav="side"] > void-sidebar) void-nav-links > a {
286
+ scroll-snap-align: start;
287
+ }
288
+
289
+ /* Where the browser supports it, the row opens scrolled to the link of
290
+ the current page, so that link is never the one off screen. */
291
+ :is(void-nav-bar, void-shell[nav="side"] > void-sidebar) void-nav-links > a[aria-current="page"] {
292
+ scroll-initial-target: nearest;
293
+ }
294
+
295
+ void-nav-bar void-nav-links::-webkit-scrollbar,
296
+ void-shell[nav="side"] > void-sidebar void-nav-links::-webkit-scrollbar {
297
+ display: none;
298
+ }
299
+
300
+ /* The sidebar becomes a bar across the top; its links scroll
301
+ sideways the same way. */
302
+ void-shell[nav="side"] {
303
+ flex-direction: column;
304
+ align-items: stretch;
305
+ }
306
+
307
+ void-shell[nav="side"] > void-sidebar {
308
+ position: static;
309
+ flex-direction: row;
310
+ flex-wrap: wrap;
311
+ align-items: center;
312
+ width: auto;
313
+ height: auto;
314
+ gap: var(--void-gap-tight) var(--void-gap-inside);
315
+ padding: var(--void-gap-tight) var(--void-gutter);
316
+ border-inline: 0;
317
+ border-bottom: var(--void-sidebar-rule, var(--void-rule));
318
+ overflow: visible;
319
+ }
320
+
321
+ void-shell[nav="side"] > void-sidebar void-nav-links {
322
+ flex-direction: row;
323
+ align-items: center;
324
+ }
325
+
326
+ void-shell[nav="side"] > void-sidebar void-nav-links > a {
327
+ min-height: var(--void-control-height-sm);
328
+ }
329
+
330
+ void-shell[nav="side"] > void-sidebar void-nav-links > [data-void-type="label"] {
331
+ display: none;
332
+ }
333
+ }
334
+
335
+ /* ── void-brand: the product's name (and mark) in a bar ──
336
+ <void-brand><a href="/">Meridian</a></void-brand> */
337
+ void-brand {
338
+ display: inline-flex;
339
+ align-items: center;
340
+ gap: var(--void-gap-tight);
341
+ flex: none;
342
+ font-family: var(--void-type-heading-family);
343
+ font-size: var(--void-type-body-size);
344
+ font-weight: var(--void-type-heading-weight);
345
+ letter-spacing: var(--void-type-heading-tracking);
346
+ color: var(--void-color-text);
347
+ white-space: nowrap;
348
+ }
349
+
350
+ void-brand > a {
351
+ display: inherit;
352
+ align-items: inherit;
353
+ gap: inherit;
354
+ color: inherit;
355
+ text-decoration: none;
356
+ }
357
+
358
+ /* ── Responsive visibility ──
359
+ data-void-hide="narrow" removes an element below 48rem (a table
360
+ column, a secondary action); "wide" removes it above. */
361
+ @media (max-width: 48rem) {
362
+ [data-void-hide="narrow"] {
363
+ display: none !important;
364
+ }
365
+ }
366
+
367
+ @media (min-width: 48.0625rem) {
368
+ [data-void-hide="wide"] {
369
+ display: none !important;
370
+ }
371
+ }
@@ -0,0 +1,202 @@
1
+ /*
2
+ * Pre-upgrade state (`:not(:defined)`).
3
+ *
4
+ * Until a component's script has loaded and defined its tag, the browser treats
5
+ * `<void-*>` as an unknown element: it renders the server-sent children as plain
6
+ * inline content and none of what the component would render itself (tab list,
7
+ * input box, field label). When the script arrives the element upgrades and the
8
+ * page reflows. These rules make the page look and measure the same before and
9
+ * after:
10
+ *
11
+ * - hide what must not show yet: closed overlays, panels of tabs that are not
12
+ * active, closed collapsible bodies, option lists, carousel slides after the
13
+ * first;
14
+ * - reserve the space of what the component will render, using the same
15
+ * tokens its own rules use;
16
+ * - never hide content that means something before upgrade: the text of
17
+ * buttons, badges, tags, cards, alerts, banners and panels stays visible.
18
+ *
19
+ * `:not(:defined)` stops matching the moment `customElements.define()` runs for
20
+ * the tag, so these rules switch themselves off with no JavaScript, no class and
21
+ * no timer. They apply equally to the full bundle, per-component imports and the
22
+ * autoloader (`@voidable/ui/autoloader`).
23
+ *
24
+ * Imported by index.css after the component files, so where a rule here has the
25
+ * same specificity as a component rule (for example `void-dialog[open]`) this
26
+ * one wins. Only tokens that already exist are used.
27
+ *
28
+ * Components with explicit parts (#52: dialog, drawer, popover, hover card,
29
+ * dropdown menu, tooltip, tabs, card, alert, accordion, collapsible, panel,
30
+ * banner, toast, error fallback, combobox, multiselect) need little here: their
31
+ * regions are elements the author wrote, styled the same before and after
32
+ * upgrade, so only what the script reveals (overlay content, an option list)
33
+ * is hidden. `void-select` needs nothing: the author's native `<select>` is the
34
+ * control, styled and working before upgrade.
35
+ */
36
+
37
+ /* ── Closed overlays ───────────────────────────────────────────────────────
38
+ A server may render `open`; the backdrop, panel and focus handling only exist
39
+ after upgrade, so the bare children would flash. Show nothing until then. */
40
+ void-dialog:not(:defined),
41
+ void-drawer:not(:defined),
42
+ void-menu:not(:defined) {
43
+ display: none;
44
+ }
45
+
46
+ /* Anchored content and the option lists of pickers: the component positions
47
+ and reveals them, so before upgrade they are not content. */
48
+ void-popover:not(:defined) > void-popover-content,
49
+ void-hover-card:not(:defined) > void-hover-card-content,
50
+ void-dropdown-menu:not(:defined) > void-dropdown-menu-content,
51
+ void-tooltip:not(:defined) > void-tooltip-content,
52
+ void-multiselect:not(:defined) > void-multiselect-content,
53
+ void-combobox:not(:defined) > void-combobox-content {
54
+ display: none;
55
+ }
56
+
57
+ /* ── Tabs ──────────────────────────────────────────────────────────────────
58
+ The tab list is the author's <void-tabs-list>, so it is already laid out.
59
+ Show one panel: the one the server marked [active], or the first when none
60
+ is marked (render `active` on the selected trigger and panel when the initial
61
+ tab is not the first). Every other panel is already display:none (tabs.css). */
62
+ void-tabs:not(:defined):not(:has(> void-tabs-content[active])) > void-tabs-content:first-of-type {
63
+ display: block;
64
+ }
65
+
66
+ void-tabs:not(:defined):not(:has(void-tabs-trigger[active])) > void-tabs-list > void-tabs-trigger:first-child {
67
+ color: var(--void-color-text);
68
+ border-bottom-color: var(--void-color-accent);
69
+ }
70
+
71
+ /* ── Error fallback ────────────────────────────────────────────────────────
72
+ Written with no parts, it writes its default (heading, message, retry button)
73
+ itself. Show the heading where that title will be, so the box has its height. */
74
+ void-error-fallback:not(:defined):empty::after {
75
+ content: attr(heading);
76
+ display: block;
77
+ font-family: var(--void-type-heading-family);
78
+ font-size: var(--void-type-heading-size);
79
+ line-height: var(--void-type-heading-leading);
80
+ font-weight: var(--void-type-heading-weight);
81
+ letter-spacing: var(--void-type-heading-tracking);
82
+ color: var(--void-type-heading-color);
83
+ }
84
+
85
+ void-error-fallback:not(:defined):empty:not([heading])::after {
86
+ content: 'Something went wrong';
87
+ }
88
+
89
+ /* ── Carousel ──────────────────────────────────────────────────────────────
90
+ The content part is a clipped row and the items are 100% wide (carousel.css),
91
+ the arrows are absolutely placed and the indicators part reserves the height
92
+ of a dot, so the carousel is laid out before upgrade as it is after. */
93
+
94
+ /* ── Field ─────────────────────────────────────────────────────────────────
95
+ Label, helper and error are attributes: show them where the component will
96
+ render them. */
97
+ void-field:not(:defined)[label]::before {
98
+ content: attr(label);
99
+ font-size: var(--void-text-sm);
100
+ font-weight: var(--void-weight-medium);
101
+ color: var(--void-color-text);
102
+ }
103
+
104
+ void-field:not(:defined)[helper]:not([error]:not([error=""]))::after {
105
+ content: attr(helper);
106
+ font-size: var(--void-text-xs);
107
+ color: var(--void-color-text-muted);
108
+ }
109
+
110
+ void-field:not(:defined)[error]:not([error=""])::after {
111
+ content: attr(error);
112
+ font-size: var(--void-text-xs);
113
+ color: var(--void-color-error);
114
+ }
115
+
116
+ /* ── Controls that render their own box ────────────────────────────────────
117
+ One line of text-sm at leading-normal, vertical padding space-2 and a 1px
118
+ border: the height of the native control the component renders. */
119
+ void-input:not(:defined),
120
+ void-number-input:not(:defined),
121
+ void-date-picker:not(:defined),
122
+ void-action-input:not(:defined),
123
+ void-tags-input:not(:defined) {
124
+ display: block;
125
+ box-sizing: border-box;
126
+ background: var(--void-color-bg-secondary);
127
+ border: 1px solid var(--void-color-border-control);
128
+ border-radius: var(--void-radius-md);
129
+ min-height: calc(var(--void-space-2) * 2 + var(--void-text-sm) * var(--void-leading-normal) + 2px); /* token-ok: total height with the 1px border on each side (border-box) */
130
+ }
131
+
132
+ :is(void-input, void-number-input, void-date-picker, void-action-input, void-tags-input)[size="sm"]:not(:defined) {
133
+ min-height: calc(var(--void-space-1) * 2 + var(--void-text-xs) * var(--void-leading-normal) + 2px); /* token-ok: total height with the 1px border on each side (border-box) */
134
+ }
135
+
136
+ :is(void-input, void-number-input, void-date-picker, void-action-input, void-tags-input)[size="lg"]:not(:defined) {
137
+ min-height: calc(var(--void-space-3) * 2 + var(--void-text-base) * var(--void-leading-normal) + 2px); /* token-ok: total height with the 1px border on each side (border-box) */
138
+ }
139
+
140
+ /* The pickers render their field before the content part they hold: the box
141
+ of that field, at the control height the field uses. */
142
+ void-multiselect:not(:defined),
143
+ void-combobox:not(:defined) {
144
+ display: block;
145
+ box-sizing: border-box;
146
+ background: var(--void-field-surface);
147
+ border: var(--void-control-border-width) solid var(--void-field-border);
148
+ border-radius: var(--void-control-radius);
149
+ min-height: var(--void-control-height);
150
+ }
151
+
152
+ :is(void-multiselect, void-combobox)[size="sm"]:not(:defined) { min-height: var(--void-control-height-sm); }
153
+ :is(void-multiselect, void-combobox)[size="lg"]:not(:defined) { min-height: var(--void-control-height-lg); }
154
+
155
+ /* Three rows unless `rows` says otherwise (typed attr() where supported). */
156
+ void-textarea:not(:defined) {
157
+ display: block;
158
+ box-sizing: border-box;
159
+ background: var(--void-color-bg-secondary);
160
+ border: 1px solid var(--void-color-border-control);
161
+ border-radius: var(--void-radius-md);
162
+ min-height: calc(3 * var(--void-text-sm) * var(--void-leading-normal) + var(--void-space-2) * 2 + 2px); /* token-ok: total height with the 1px border on each side (border-box) */
163
+ min-height: calc(attr(rows type(<number>), 3) * var(--void-text-sm) * var(--void-leading-normal) + var(--void-space-2) * 2 + 2px); /* token-ok: total height with the 1px border on each side (border-box) */
164
+ }
165
+
166
+ void-file-upload:not(:defined) {
167
+ display: block;
168
+ box-sizing: border-box;
169
+ border: 2px dashed var(--void-color-border);
170
+ border-radius: var(--void-radius-lg);
171
+ min-height: calc(var(--void-space-6) * 2 + var(--void-text-sm) * var(--void-leading-normal) + 4px); /* token-ok: total height with the 2px dashed border on each side (border-box) */
172
+ }
173
+
174
+ /* One row of boxes, 2.5rem tall at the default size. */
175
+ void-pin-input:not(:defined) {
176
+ display: block;
177
+ min-height: 2.5rem; /* token-ok: one pin box, as pin-input.css */
178
+ }
179
+
180
+ /* ── Meters and placeholders ───────────────────────────────────────────── */
181
+ void-progress:not(:defined)::before {
182
+ content: '';
183
+ display: block;
184
+ height: 0.5rem; /* token-ok: track height, as progress.css */
185
+ background: var(--void-color-bg-hover);
186
+ border-radius: var(--void-radius-full);
187
+ }
188
+
189
+ void-progress[size="sm"]:not(:defined)::before { height: 0.25rem; /* token-ok: as progress.css */ }
190
+ void-progress[size="lg"]:not(:defined)::before { height: 0.75rem; /* token-ok: as progress.css */ }
191
+
192
+ /* Skeleton defaults to the text variant once upgraded. */
193
+ void-skeleton:not(:defined):not([variant]) {
194
+ height: 1em;
195
+ width: 100%;
196
+ border-radius: var(--void-radius-xs);
197
+ }
198
+
199
+ void-calendar:not(:defined) {
200
+ box-sizing: border-box;
201
+ min-height: 16.5rem; /* token-ok: one month grid of the default size */
202
+ }