@lanfermann/ui 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 (216) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +17 -2
  3. package/TRADEMARK.md +10 -0
  4. package/brand/app-icon.svg +1 -0
  5. package/brand/avatar.svg +1 -0
  6. package/brand/favicon.svg +1 -0
  7. package/dist/components/accordion/accordion.d.ts +26 -0
  8. package/dist/components/accordion/accordion.js +78 -0
  9. package/dist/components/alert/alert.d.ts +19 -0
  10. package/dist/components/alert/alert.js +68 -0
  11. package/dist/components/alert-dialog/alert-dialog.d.ts +20 -0
  12. package/dist/components/alert-dialog/alert-dialog.js +75 -0
  13. package/dist/components/anchor-heading/anchor-heading.d.ts +19 -0
  14. package/dist/components/anchor-heading/anchor-heading.js +39 -0
  15. package/dist/components/avatar/avatar.d.ts +14 -0
  16. package/dist/components/avatar/avatar.js +42 -0
  17. package/dist/components/badge/badge.d.ts +12 -0
  18. package/dist/components/badge/badge.js +27 -0
  19. package/dist/components/breadcrumbs/breadcrumbs.d.ts +23 -0
  20. package/dist/components/breadcrumbs/breadcrumbs.js +63 -0
  21. package/dist/components/button/button-variants.d.ts +15 -0
  22. package/dist/components/button/button-variants.js +76 -0
  23. package/dist/components/button/button.d.ts +25 -0
  24. package/dist/components/button/button.js +50 -0
  25. package/dist/components/calendar/calendar-selection.js +216 -0
  26. package/dist/components/calendar/calendar.d.ts +44 -0
  27. package/dist/components/calendar/calendar.js +208 -0
  28. package/dist/components/callout/callout.d.ts +21 -0
  29. package/dist/components/callout/callout.js +75 -0
  30. package/dist/components/card/card.d.ts +16 -0
  31. package/dist/components/card/card.js +53 -0
  32. package/dist/components/checkbox/checkbox.d.ts +9 -0
  33. package/dist/components/checkbox/checkbox.js +33 -0
  34. package/dist/components/checkbox-group/checkbox-group.d.ts +18 -0
  35. package/dist/components/checkbox-group/checkbox-group.js +33 -0
  36. package/dist/components/code/code.d.ts +7 -0
  37. package/dist/components/code/code.js +16 -0
  38. package/dist/components/code-block/code-block-frame.js +146 -0
  39. package/dist/components/code-block/code-block-live.d.ts +45 -0
  40. package/dist/components/code-block/code-block-live.js +51 -0
  41. package/dist/components/code-block/code-block.d.ts +36 -0
  42. package/dist/components/code-block/code-block.js +51 -0
  43. package/dist/components/code-block/code-copy.d.ts +12 -0
  44. package/dist/components/code-block/code-copy.js +71 -0
  45. package/dist/components/code-block/code-lines-view.d.ts +16 -0
  46. package/dist/components/code-block/code-lines-view.js +48 -0
  47. package/dist/components/code-block/code-lines.js +17 -0
  48. package/dist/components/code-block/code-scroll.js +29 -0
  49. package/dist/components/code-block/code-surface.js +13 -0
  50. package/dist/components/code-block/code-tabs-frame.js +85 -0
  51. package/dist/components/code-block/code-tabs-store.js +25 -0
  52. package/dist/components/code-block/code-tabs.d.ts +28 -0
  53. package/dist/components/code-block/code-tabs.js +29 -0
  54. package/dist/components/code-block/highlight.d.ts +34 -0
  55. package/dist/components/code-block/highlight.js +258 -0
  56. package/dist/components/code-block/lines.d.ts +5 -0
  57. package/dist/components/code-block/lines.js +40 -0
  58. package/dist/components/collapsible/collapsible.d.ts +19 -0
  59. package/dist/components/collapsible/collapsible.js +54 -0
  60. package/dist/components/combobox/combobox.d.ts +84 -0
  61. package/dist/components/combobox/combobox.js +169 -0
  62. package/dist/components/container/container.d.ts +16 -0
  63. package/dist/components/container/container.js +30 -0
  64. package/dist/components/copy-pill/copy-pill.d.ts +52 -0
  65. package/dist/components/copy-pill/copy-pill.js +232 -0
  66. package/dist/components/cta/cta.d.ts +109 -0
  67. package/dist/components/cta/cta.js +375 -0
  68. package/dist/components/date-field/date-field.d.ts +40 -0
  69. package/dist/components/date-field/date-field.js +99 -0
  70. package/dist/components/date-range-field/date-range-field.d.ts +41 -0
  71. package/dist/components/date-range-field/date-range-field.js +155 -0
  72. package/dist/components/dialog/dialog.d.ts +29 -0
  73. package/dist/components/dialog/dialog.js +96 -0
  74. package/dist/components/docs-layout/docs-layout.d.ts +17 -0
  75. package/dist/components/docs-layout/docs-layout.js +46 -0
  76. package/dist/components/drawer/drawer.d.ts +39 -0
  77. package/dist/components/drawer/drawer.js +181 -0
  78. package/dist/components/field/field.d.ts +18 -0
  79. package/dist/components/field/field.js +77 -0
  80. package/dist/components/fieldset/fieldset.d.ts +8 -0
  81. package/dist/components/fieldset/fieldset.js +25 -0
  82. package/dist/components/figure/figure.d.ts +14 -0
  83. package/dist/components/figure/figure.js +35 -0
  84. package/dist/components/form/form.d.ts +31 -0
  85. package/dist/components/form/form.js +55 -0
  86. package/dist/components/ground/ground.d.ts +20 -0
  87. package/dist/components/ground/ground.js +31 -0
  88. package/dist/components/heading/heading.d.ts +16 -0
  89. package/dist/components/heading/heading.js +36 -0
  90. package/dist/components/icon/icon.d.ts +22 -0
  91. package/dist/components/icon/icon.js +24 -0
  92. package/dist/components/input/input.d.ts +19 -0
  93. package/dist/components/input/input.js +46 -0
  94. package/dist/components/input-group/input-group.d.ts +34 -0
  95. package/dist/components/input-group/input-group.js +61 -0
  96. package/dist/components/kbd/kbd.d.ts +6 -0
  97. package/dist/components/kbd/kbd.js +15 -0
  98. package/dist/components/link/link-variants.d.ts +13 -0
  99. package/dist/components/link/link-variants.js +27 -0
  100. package/dist/components/link/link.d.ts +9 -0
  101. package/dist/components/link/link.js +18 -0
  102. package/dist/components/logo/logo-paths.js +22 -0
  103. package/dist/components/logo/logomark.d.ts +19 -0
  104. package/dist/components/logo/logomark.js +49 -0
  105. package/dist/components/logo/wordmark.d.ts +35 -0
  106. package/dist/components/logo/wordmark.js +48 -0
  107. package/dist/components/menu/menu.d.ts +26 -0
  108. package/dist/components/menu/menu.js +132 -0
  109. package/dist/components/meter/meter.d.ts +29 -0
  110. package/dist/components/meter/meter.js +68 -0
  111. package/dist/components/navigation-menu/navigation-menu-variants.d.ts +12 -0
  112. package/dist/components/navigation-menu/navigation-menu-variants.js +18 -0
  113. package/dist/components/navigation-menu/navigation-menu.d.ts +42 -0
  114. package/dist/components/navigation-menu/navigation-menu.js +128 -0
  115. package/dist/components/number-field/number-field.d.ts +32 -0
  116. package/dist/components/number-field/number-field.js +85 -0
  117. package/dist/components/page-header/page-header.d.ts +27 -0
  118. package/dist/components/page-header/page-header.js +48 -0
  119. package/dist/components/pager/pager.d.ts +24 -0
  120. package/dist/components/pager/pager.js +51 -0
  121. package/dist/components/parameter-list/parameter-list.d.ts +34 -0
  122. package/dist/components/parameter-list/parameter-list.js +70 -0
  123. package/dist/components/popover/popover.d.ts +15 -0
  124. package/dist/components/popover/popover.js +64 -0
  125. package/dist/components/progress/progress.d.ts +19 -0
  126. package/dist/components/progress/progress.js +67 -0
  127. package/dist/components/prose/prose.d.ts +13 -0
  128. package/dist/components/prose/prose.js +22 -0
  129. package/dist/components/quote/quote.d.ts +21 -0
  130. package/dist/components/quote/quote.js +46 -0
  131. package/dist/components/radio/radio.d.ts +12 -0
  132. package/dist/components/radio/radio.js +37 -0
  133. package/dist/components/reference-entry/reference-entry.d.ts +25 -0
  134. package/dist/components/reference-entry/reference-entry.js +66 -0
  135. package/dist/components/section/section.d.ts +13 -0
  136. package/dist/components/section/section.js +30 -0
  137. package/dist/components/segmented-control/segmented-control.d.ts +42 -0
  138. package/dist/components/segmented-control/segmented-control.js +413 -0
  139. package/dist/components/select/select.d.ts +70 -0
  140. package/dist/components/select/select.js +189 -0
  141. package/dist/components/separator/separator.d.ts +12 -0
  142. package/dist/components/separator/separator.js +29 -0
  143. package/dist/components/side-nav/side-nav.d.ts +48 -0
  144. package/dist/components/side-nav/side-nav.js +89 -0
  145. package/dist/components/site-footer/site-footer-floor.js +48 -0
  146. package/dist/components/site-footer/site-footer.d.ts +38 -0
  147. package/dist/components/site-footer/site-footer.js +96 -0
  148. package/dist/components/site-header/site-header.d.ts +77 -0
  149. package/dist/components/site-header/site-header.js +214 -0
  150. package/dist/components/slider/slider.d.ts +42 -0
  151. package/dist/components/slider/slider.js +279 -0
  152. package/dist/components/spinner/spinner.d.ts +15 -0
  153. package/dist/components/spinner/spinner.js +34 -0
  154. package/dist/components/switch/switch.d.ts +8 -0
  155. package/dist/components/switch/switch.js +28 -0
  156. package/dist/components/table/table.d.ts +83 -0
  157. package/dist/components/table/table.js +123 -0
  158. package/dist/components/table-of-contents/table-of-contents.d.ts +32 -0
  159. package/dist/components/table-of-contents/table-of-contents.js +187 -0
  160. package/dist/components/tabs/tabs.d.ts +28 -0
  161. package/dist/components/tabs/tabs.js +124 -0
  162. package/dist/components/text/text.d.ts +16 -0
  163. package/dist/components/text/text.js +63 -0
  164. package/dist/components/textarea/textarea.d.ts +19 -0
  165. package/dist/components/textarea/textarea.js +30 -0
  166. package/dist/components/time-field/time-field.d.ts +40 -0
  167. package/dist/components/time-field/time-field.js +123 -0
  168. package/dist/components/toast/toast.d.ts +55 -0
  169. package/dist/components/toast/toast.js +129 -0
  170. package/dist/components/tooltip/tooltip.d.ts +16 -0
  171. package/dist/components/tooltip/tooltip.js +41 -0
  172. package/dist/index.d.ts +79 -0
  173. package/dist/index.js +77 -0
  174. package/dist/internal/arrow.js +41 -0
  175. package/dist/internal/disclosure.js +20 -0
  176. package/dist/internal/field-context.js +21 -0
  177. package/dist/internal/field.d.ts +23 -0
  178. package/dist/internal/field.js +49 -0
  179. package/dist/internal/glyphs.js +84 -0
  180. package/dist/internal/iso-date.d.ts +2 -0
  181. package/dist/internal/iso-date.js +268 -0
  182. package/dist/internal/overlay.js +40 -0
  183. package/dist/internal/picker-sheet.js +74 -0
  184. package/dist/internal/popup.js +37 -0
  185. package/dist/internal/range-shape.js +295 -0
  186. package/dist/internal/reduced-motion.js +19 -0
  187. package/dist/internal/scroll-edges.js +45 -0
  188. package/dist/internal/trough.js +39 -0
  189. package/dist/internal/typed-input.d.ts +16 -0
  190. package/dist/internal/typed-input.js +133 -0
  191. package/dist/lib/cn.d.ts +11 -0
  192. package/dist/lib/cn.js +98 -0
  193. package/dist/motion/inertia.js +111 -0
  194. package/dist/motion/spring-step.js +35 -0
  195. package/dist/motion/springs.d.ts +78 -0
  196. package/dist/motion/springs.js +81 -0
  197. package/package.json +107 -4
  198. package/src/styles/base.css +93 -0
  199. package/src/styles/calendar.css +117 -0
  200. package/src/styles/code.css +252 -0
  201. package/src/styles/density.css +53 -0
  202. package/src/styles/depth.css +501 -0
  203. package/src/styles/grounds.css +191 -0
  204. package/src/styles/marks.css +50 -0
  205. package/src/styles/motion.css +55 -0
  206. package/src/styles/motion.generated.css +101 -0
  207. package/src/styles/prose.css +252 -0
  208. package/src/styles/radius.css +20 -0
  209. package/src/styles/segmented.css +208 -0
  210. package/src/styles/slider.css +110 -0
  211. package/src/styles/status.css +108 -0
  212. package/src/styles/tabs.css +39 -0
  213. package/src/styles/toast.css +106 -0
  214. package/src/styles/touch.css +41 -0
  215. package/src/styles/type.css +54 -0
  216. package/src/styles.css +38 -0
@@ -0,0 +1,50 @@
1
+ /*
2
+ * The mark: ring to disc, the system's signature. An open ring is a possibility, the filled disc
3
+ * is the choice. It marks the current tab, the chosen option in a list, a step that is done.
4
+ *
5
+ * The ring is an inset shadow that grows until the hole is closed, so one element carries both
6
+ * states and the change can be reversed mid-flight. It seats with a little bounce and leaves
7
+ * without one.
8
+ */
9
+
10
+ @utility mark {
11
+ flex: none;
12
+ width: 0.5rem;
13
+ height: 0.5rem;
14
+ border-radius: calc(infinity* 1px);
15
+ /* `--mark-ring` lets a part darken the ring under the pointer. */
16
+ box-shadow: inset 0 0 0 1.5px var(--mark-ring, var(--lf-line));
17
+ transition: box-shadow var(--transition-duration-spring-leave) var(--ease-spring-leave);
18
+ }
19
+
20
+ /* In a list of options only the chosen row shows its mark: the ring is there, but invisible. */
21
+ @utility mark-quiet {
22
+ box-shadow: inset 0 0 0 1.5px transparent;
23
+ }
24
+
25
+ @utility mark-on {
26
+ box-shadow: inset 0 0 0 0.25rem var(--lf-accent);
27
+ transition-duration: var(--transition-duration-spring-seat);
28
+ transition-timing-function: var(--ease-spring-seat);
29
+ }
30
+
31
+ /* Forced colours drop box-shadows: draw the ring as an outline and the disc as a fill. */
32
+ @media (forced-colors: active) {
33
+ .mark {
34
+ outline: 1px solid CanvasText;
35
+ outline-offset: -1px;
36
+ }
37
+ .mark-quiet {
38
+ outline-color: transparent;
39
+ }
40
+ .mark-on,
41
+ [class*=":mark-on"]:is(
42
+ [data-active] > .mark,
43
+ [data-selected] > .mark,
44
+ [data-checked] .mark,
45
+ [data-pressed] .mark
46
+ ) {
47
+ outline-color: CanvasText;
48
+ background-color: CanvasText;
49
+ }
50
+ }
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Motion that is not a spring curve. The springs themselves (`spring-snap`, `spring-settle`, …)
3
+ * are generated into motion.generated.css from src/motion/springs.ts.
4
+ *
5
+ * Rules: everything a person triggers is a transition or a spring, never a keyframe animation, so
6
+ * it can be reversed mid-flight. Popups grow out of their trigger (`--transform-origin`). Exits
7
+ * are shorter than entrances and never bounce or travel. Keyboard focus, menu highlight, error
8
+ * colours and page load do not animate.
9
+ */
10
+
11
+ :root {
12
+ /* How far a sheet scales and travels when it enters. Reduced motion zeroes both. */
13
+ --motion-enter-scale: 0.96;
14
+ --motion-enter-offset: 4px;
15
+ --motion-press-scale: 0.98;
16
+ }
17
+
18
+ @media (prefers-reduced-motion: reduce) {
19
+ :root {
20
+ --motion-enter-scale: 1;
21
+ --motion-enter-offset: 0px;
22
+ --motion-press-scale: 1;
23
+ }
24
+ }
25
+
26
+ /*
27
+ * The three keyframe animations in the system. All show ongoing work nobody triggered a state
28
+ * change for: the spinner turns, a progress bar without a known end runs through its trough, and
29
+ * under reduced motion both breathe instead.
30
+ */
31
+ @theme {
32
+ --animate-spinner: spinner 0.75s linear infinite;
33
+ --animate-indeterminate: indeterminate 1.5s ease-in-out infinite;
34
+ --animate-breathe: breathe 1.4s ease-in-out infinite;
35
+
36
+ @keyframes spinner {
37
+ to {
38
+ rotate: 1turn;
39
+ }
40
+ }
41
+ /* A fill two fifths of the trough wide enters at the start and leaves at the end. */
42
+ @keyframes indeterminate {
43
+ from {
44
+ translate: -100%;
45
+ }
46
+ to {
47
+ translate: 250%;
48
+ }
49
+ }
50
+ @keyframes breathe {
51
+ 50% {
52
+ opacity: 0.4;
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,101 @@
1
+ /* GENERATED by scripts/generate-motion-css.ts from src/motion/springs.ts. Do not edit:
2
+ change the spring table and run `bun run gen:motion`. */
3
+
4
+ @theme static {
5
+ --ease-spring-snap: linear(0, 0.4615, 0.8176, 0.9471, 0.9858, 0.9964, 0.9991, 1);
6
+ --transition-duration-spring-snap: 250ms;
7
+ --ease-spring-settle: linear(0, 0.1495, 0.3955, 0.6061, 0.7562, 0.8542, 0.9148, 0.9512, 0.9724, 0.9846, 0.9914, 0.9953, 0.9974, 0.9986, 0.9992, 1, 1);
8
+ --transition-duration-spring-settle: 500ms;
9
+ --ease-spring-seat: linear(0, 0.1254, 0.3663, 0.6012, 0.7825, 0.9027, 0.9722, 1.0062, 1.0185, 1.0194, 1.0156, 1.0106, 1.0063, 1.0032, 1.0013, 1.0002, 1);
10
+ --transition-duration-spring-seat: 500ms;
11
+ --ease-spring-glide: linear(0, 0.0953, 0.2765, 0.4588, 0.6118, 0.7294, 0.8153, 0.876, 0.9177, 0.946, 0.9648, 0.9773, 0.9854, 0.9907, 0.9941, 0.9962, 0.9976, 0.9985, 0.9991, 1);
12
+ --transition-duration-spring-glide: 600ms;
13
+ --ease-spring-sheet: linear(0, 0.0791, 0.2369, 0.4041, 0.5522, 0.6723, 0.7649, 0.8339, 0.884, 0.9198, 0.945, 0.9625, 0.9746, 0.9829, 0.9885, 0.9923, 0.9949, 0.9966, 0.9977, 0.9985, 0.999, 1, 1);
14
+ --transition-duration-spring-sheet: 700ms;
15
+ --ease-spring-leave: linear(0, 0.2794, 0.6159, 0.8186, 0.9198, 0.966, 0.986, 0.9943, 0.9977, 0.9991, 0.9997, 1);
16
+ --transition-duration-spring-leave: 350ms;
17
+ --ease-spring-throw: linear(0, 0.0663, 0.2105, 0.3763, 0.5332, 0.6669, 0.7733, 0.8533, 0.9107, 0.9499, 0.9754, 0.9911, 1, 1.0044, 1.0061, 1.0062, 1.0055, 1.0045, 1.0035, 1.0026, 1.0018, 1.0012, 1.0008, 1, 1);
18
+ --transition-duration-spring-throw: 750ms;
19
+ --ease-spring-recoil: linear(0, 0.0846, 0.2691, 0.4778, 0.6674, 0.8179, 0.9249, 0.9926, 1.0293, 1.0442, 1.0452, 1.0388, 1.0296, 1.0202, 1.0121, 1.0061, 1.0019, 0.9995, 0.9983, 1);
20
+ --transition-duration-spring-recoil: 600ms;
21
+ --ease-spring-rebound: linear(0, 0.1187, 0.3801, 0.6679, 0.9085, 1.069, 1.1478, 1.1617, 1.1346, 1.0894, 1.0435, 1.0072, 0.9844, 0.9745, 0.9743, 0.9797, 0.9873, 0.9945, 0.9999, 1.0031, 1.0043, 1.004, 1.003, 1.0018, 1.0006, 0.9998, 1);
22
+ --transition-duration-spring-rebound: 800ms;
23
+ }
24
+
25
+ @utility spring-snap {
26
+ --tw-ease: var(--ease-spring-snap);
27
+ --tw-duration: var(--transition-duration-spring-snap);
28
+ transition-timing-function: var(--ease-spring-snap);
29
+ transition-duration: var(--transition-duration-spring-snap);
30
+ }
31
+ @utility spring-settle {
32
+ --tw-ease: var(--ease-spring-settle);
33
+ --tw-duration: var(--transition-duration-spring-settle);
34
+ transition-timing-function: var(--ease-spring-settle);
35
+ transition-duration: var(--transition-duration-spring-settle);
36
+ }
37
+ @utility spring-seat {
38
+ --tw-ease: var(--ease-spring-seat);
39
+ --tw-duration: var(--transition-duration-spring-seat);
40
+ transition-timing-function: var(--ease-spring-seat);
41
+ transition-duration: var(--transition-duration-spring-seat);
42
+ }
43
+ @utility spring-glide {
44
+ --tw-ease: var(--ease-spring-glide);
45
+ --tw-duration: var(--transition-duration-spring-glide);
46
+ transition-timing-function: var(--ease-spring-glide);
47
+ transition-duration: var(--transition-duration-spring-glide);
48
+ }
49
+ @utility spring-sheet {
50
+ --tw-ease: var(--ease-spring-sheet);
51
+ --tw-duration: var(--transition-duration-spring-sheet);
52
+ transition-timing-function: var(--ease-spring-sheet);
53
+ transition-duration: var(--transition-duration-spring-sheet);
54
+ }
55
+ @utility spring-leave {
56
+ --tw-ease: var(--ease-spring-leave);
57
+ --tw-duration: var(--transition-duration-spring-leave);
58
+ transition-timing-function: var(--ease-spring-leave);
59
+ transition-duration: var(--transition-duration-spring-leave);
60
+ }
61
+ @utility spring-throw {
62
+ --tw-ease: var(--ease-spring-throw);
63
+ --tw-duration: var(--transition-duration-spring-throw);
64
+ transition-timing-function: var(--ease-spring-throw);
65
+ transition-duration: var(--transition-duration-spring-throw);
66
+ }
67
+ @utility spring-recoil {
68
+ --tw-ease: var(--ease-spring-recoil);
69
+ --tw-duration: var(--transition-duration-spring-recoil);
70
+ transition-timing-function: var(--ease-spring-recoil);
71
+ transition-duration: var(--transition-duration-spring-recoil);
72
+ }
73
+ @utility spring-rebound {
74
+ --tw-ease: var(--ease-spring-rebound);
75
+ --tw-duration: var(--transition-duration-spring-rebound);
76
+ transition-timing-function: var(--ease-spring-rebound);
77
+ transition-duration: var(--transition-duration-spring-rebound);
78
+ }
79
+
80
+ @media (prefers-reduced-motion: reduce) {
81
+ :root {
82
+ --ease-spring-snap: ease-out;
83
+ --transition-duration-spring-snap: 100ms;
84
+ --ease-spring-settle: ease-out;
85
+ --transition-duration-spring-settle: 100ms;
86
+ --ease-spring-seat: ease-out;
87
+ --transition-duration-spring-seat: 100ms;
88
+ --ease-spring-glide: ease-out;
89
+ --transition-duration-spring-glide: 100ms;
90
+ --ease-spring-sheet: ease-out;
91
+ --transition-duration-spring-sheet: 100ms;
92
+ --ease-spring-leave: ease-out;
93
+ --transition-duration-spring-leave: 100ms;
94
+ --ease-spring-throw: ease-out;
95
+ --transition-duration-spring-throw: 100ms;
96
+ --ease-spring-recoil: ease-out;
97
+ --transition-duration-spring-recoil: 100ms;
98
+ --ease-spring-rebound: ease-out;
99
+ --transition-duration-spring-rebound: 100ms;
100
+ }
101
+ }
@@ -0,0 +1,252 @@
1
+ /*
2
+ * Prose: running text that arrives as markup, from Markdown or an editor, where no component
3
+ * can be put on each paragraph. The `Prose` component carries the class.
4
+ *
5
+ * Two jobs, kept apart:
6
+ *
7
+ * - The rhythm between blocks. It applies to every child of the prose, plain element or library
8
+ * component alike: a heading has more air above than below, so it belongs to what follows;
9
+ * a block with an edge (code, a table, a callout, a figure) keeps a little more room.
10
+ * - The look of plain elements (p, lists, quote, rule, strong, link, inline code). It applies
11
+ * only where no library component stands between the prose and the element: a `<p>` inside a
12
+ * callout or a code block belongs to that component, which sets it itself.
13
+ *
14
+ * Everything is in the components layer and inside `:where()`, so a utility class on an element
15
+ * always wins. `not-prose` on an element takes it and its content out.
16
+ *
17
+ * Sizes are written out: theme variables that no utility uses are not emitted, so a stylesheet
18
+ * cannot count on `--text-xl` or `--radius-xs` being there. They match type.css and radius.css.
19
+ */
20
+
21
+ @layer components {
22
+ .prose {
23
+ color: var(--lf-text-body);
24
+ font-size: 1rem;
25
+ /* Long reading: a little more lead than the UI's 1.5. Sofia Sans is small on its em. */
26
+ line-height: 1.625;
27
+ overflow-wrap: break-word;
28
+ }
29
+
30
+ /* --- Rhythm between blocks ------------------------------------------------------------ */
31
+
32
+ .prose > :where(*) {
33
+ margin-block: 0;
34
+ }
35
+
36
+ .prose > :where(* + *) {
37
+ margin-top: 1rem;
38
+ }
39
+
40
+ /* A block with an edge stands a little apart from the text around it. */
41
+ .prose
42
+ > :where(
43
+ [data-slot="code-block"],
44
+ [data-slot="code-tabs"],
45
+ [data-slot="table-container"],
46
+ [data-slot="callout"],
47
+ [data-slot="quote"],
48
+ [data-slot="figure"],
49
+ [data-slot="diagram"],
50
+ [data-slot="parameter-list"],
51
+ pre,
52
+ figure,
53
+ table
54
+ ) {
55
+ margin-top: 1.5rem;
56
+ }
57
+
58
+ .prose
59
+ > :where(
60
+ [data-slot="code-block"],
61
+ [data-slot="code-tabs"],
62
+ [data-slot="table-container"],
63
+ [data-slot="callout"],
64
+ [data-slot="quote"],
65
+ [data-slot="figure"],
66
+ [data-slot="diagram"],
67
+ [data-slot="parameter-list"],
68
+ pre,
69
+ figure,
70
+ table
71
+ )
72
+ + :where(*) {
73
+ margin-top: 1.5rem;
74
+ }
75
+
76
+ /* Example sentences in a row belong together. */
77
+ .prose > :where([data-slot="quote"] + [data-slot="quote"]) {
78
+ margin-top: 0.75rem;
79
+ }
80
+
81
+ /* A heading opens what follows: much air above, little below. */
82
+ .prose > :where(h2) {
83
+ margin-top: 3.5rem;
84
+ }
85
+
86
+ .prose > :where(h3) {
87
+ margin-top: 2.5rem;
88
+ }
89
+
90
+ .prose > :where(h4, h5, h6) {
91
+ margin-top: 2rem;
92
+ }
93
+
94
+ .prose > :where(h2, h3, h4, h5, h6) + :where(*) {
95
+ margin-top: 0.75rem;
96
+ }
97
+
98
+ .prose > :where(:first-child) {
99
+ margin-top: 0;
100
+ }
101
+
102
+ /* --- Plain elements, where no component stands between ------------------------------- */
103
+
104
+ /*
105
+ * `:not(:where(.prose [data-slot] *, …))` reads: not inside a library component that stands
106
+ * inside the prose (a component around the prose, such as the page's layout, does not count).
107
+ * Elements that are a component themselves (`[data-slot]`) are left out where the component
108
+ * renders that element: a `Heading`, a `Link`, a `Code`. Written once per rule, because CSS has
109
+ * no variable for a selector.
110
+ */
111
+
112
+ .prose :where(h2, h3, h4, h5, h6):not(:where(.prose [data-slot] *, [data-slot], .not-prose *)) {
113
+ color: var(--lf-text);
114
+ text-wrap: balance;
115
+ }
116
+
117
+ .prose :where(h2):not(:where(.prose [data-slot] *, [data-slot], .not-prose *)) {
118
+ font-size: 1.5rem;
119
+ line-height: 1.2;
120
+ letter-spacing: -0.008em;
121
+ font-weight: 600;
122
+ }
123
+
124
+ .prose :where(h3):not(:where(.prose [data-slot] *, [data-slot], .not-prose *)) {
125
+ font-size: 1.25rem;
126
+ line-height: 1.4;
127
+ font-weight: 600;
128
+ }
129
+
130
+ .prose :where(h4, h5, h6):not(:where(.prose [data-slot] *, [data-slot], .not-prose *)) {
131
+ font-size: 1rem;
132
+ line-height: 1.5;
133
+ font-weight: 600;
134
+ }
135
+
136
+ .prose :where(ul, ol):not(:where(.prose [data-slot] *, .not-prose, .not-prose *)) {
137
+ padding-left: 1.375rem;
138
+ }
139
+
140
+ .prose :where(ul):not(:where(.prose [data-slot] *, .not-prose, .not-prose *)) {
141
+ list-style-type: disc;
142
+ }
143
+
144
+ .prose :where(ol):not(:where(.prose [data-slot] *, .not-prose, .not-prose *)) {
145
+ list-style-type: decimal;
146
+ }
147
+
148
+ /* A list inside a list item takes the next marker, so the levels can be told apart. */
149
+ .prose :where(li ul):not(:where(.prose [data-slot] *, .not-prose *)) {
150
+ list-style-type: circle;
151
+ }
152
+
153
+ .prose :where(li):not(:where(.prose [data-slot] *, .not-prose *)) {
154
+ padding-left: 0.25rem;
155
+ }
156
+
157
+ .prose :where(li):not(:where(.prose [data-slot] *, .not-prose *))::marker {
158
+ color: var(--lf-text-muted);
159
+ }
160
+
161
+ .prose :where(ol > li):not(:where(.prose [data-slot] *, .not-prose *))::marker {
162
+ font-weight: 500;
163
+ font-variant-numeric: tabular-nums;
164
+ }
165
+
166
+ .prose :where(li + li):not(:where(.prose [data-slot] *, .not-prose *)) {
167
+ margin-top: 0.5rem;
168
+ }
169
+
170
+ /* A loose item holds blocks: paragraphs, code, a list of its own. They keep the text's rhythm. */
171
+ .prose :where(li > * + *):not(:where(.prose [data-slot] *, .not-prose *)) {
172
+ margin-top: 0.75rem;
173
+ }
174
+
175
+ .prose
176
+ :where(
177
+ li
178
+ > :is(
179
+ [data-slot="code-block"],
180
+ [data-slot="code-tabs"],
181
+ [data-slot="callout"],
182
+ [data-slot="quote"],
183
+ [data-slot="table-container"]
184
+ )
185
+ ):not(:where(.prose [data-slot] *)) {
186
+ margin-top: 1rem;
187
+ margin-bottom: 0.25rem;
188
+ }
189
+
190
+ .prose :where(li > ul, li > ol):not(:where(.prose [data-slot] *, .not-prose *)) {
191
+ margin-top: 0.5rem;
192
+ }
193
+
194
+ .prose
195
+ :where(blockquote):not(:where(.prose [data-slot] *, [data-slot], .not-prose, .not-prose *)) {
196
+ border-left: 2px solid var(--lf-line);
197
+ padding-left: 1rem;
198
+ }
199
+
200
+ .prose :where(hr):not(:where(.prose [data-slot] *, [data-slot], .not-prose *)) {
201
+ border: 0;
202
+ border-top: 1px solid var(--lf-hairline);
203
+ margin-block: 3rem;
204
+ }
205
+
206
+ .prose :where(strong, b):not(:where(.prose [data-slot] *, .not-prose *)) {
207
+ color: var(--lf-text);
208
+ font-weight: 600;
209
+ }
210
+
211
+ /* The look of `linkVariants()`'s accent, for a link nobody could give the class. */
212
+ .prose :where(a):not(:where(.prose [data-slot] *, [data-slot], [class], .not-prose *)) {
213
+ border-radius: calc(var(--radius-base) - 3px);
214
+ color: var(--lf-accent);
215
+ font-weight: 500;
216
+ text-decoration-line: underline;
217
+ text-decoration-thickness: 1px;
218
+ text-underline-offset: 0.25em;
219
+ transition: color var(--transition-duration-spring-snap) var(--ease-spring-snap);
220
+ }
221
+
222
+ .prose :where(a):not(:where(.prose [data-slot] *, [data-slot], [class], .not-prose *)):hover {
223
+ color: var(--lf-accent-hover);
224
+ }
225
+
226
+ .prose
227
+ :where(a):not(:where(.prose [data-slot] *, [data-slot], [class], .not-prose *)):focus-visible {
228
+ outline: 2px solid var(--lf-accent);
229
+ outline-offset: 2px;
230
+ }
231
+
232
+ /* The look of `Code`, for inline code nobody could give the component. */
233
+ .prose :where(code):not(:where(.prose [data-slot] *, [data-slot], pre *, .not-prose *)) {
234
+ border: 1px solid var(--lf-hairline);
235
+ border-radius: calc(var(--radius-base) - 3px);
236
+ background-color: var(--lf-well);
237
+ padding-inline: 0.3em;
238
+ color: var(--lf-text);
239
+ font-family:
240
+ var(--font-jetbrains-mono, "JetBrains Mono Variable", "JetBrains Mono"), "Courier New",
241
+ monospace;
242
+ font-size: 0.84em;
243
+ font-variant-ligatures: none;
244
+ box-decoration-break: clone;
245
+ -webkit-box-decoration-break: clone;
246
+ }
247
+
248
+ .prose :where(img, svg, video):not(:where(.prose [data-slot] *, .not-prose *)) {
249
+ max-width: 100%;
250
+ height: auto;
251
+ }
252
+ }
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Radius. One knob. The look is industrial through the edge, not the corner: like a milled part,
3
+ * corners are filleted and the edge is chamfered (see depth.css).
4
+ *
5
+ * Concentric rule: a part nested inside another takes inner = outer − the padding between them,
6
+ * e.g. an item inside a sheet with 4px padding: rounded-[calc(var(--radius-xl)-4px)].
7
+ */
8
+
9
+ :root {
10
+ --radius-base: 0.5rem;
11
+ }
12
+
13
+ @theme inline {
14
+ --radius-xs: calc(var(--radius-base) - 3px); /* 5: checkbox, kbd */
15
+ --radius-sm: calc(var(--radius-base) - 2px); /* 6: small controls, badges */
16
+ --radius-md: var(--radius-base); /* 8: controls */
17
+ --radius-lg: calc(var(--radius-base) + 2px); /* 10: large controls */
18
+ --radius-xl: calc(var(--radius-base) * 1.5); /* 12: sheets, cards */
19
+ --radius-2xl: calc(var(--radius-base) * 2); /* 16: dialogs */
20
+ }
@@ -0,0 +1,208 @@
1
+ /*
2
+ * The thumb of a SegmentedControl. It is placed from the pressed segment's measured box
3
+ * (`--thumb-left`, `--thumb-width`, written by segmented-control.tsx) and moved by `translate`.
4
+ * Everything that moves here is a transform, so nothing is laid out while it travels; only a
5
+ * change of width between two segments is, on the thumb alone.
6
+ *
7
+ * Three parts, the first two as in a slider (slider.css):
8
+ *
9
+ * rider `segment-thumb`: the place. It travels to the chosen segment on `--segment-pace`
10
+ * and follows a pointer (a lean, a pull) on the chase curve.
11
+ * face `segment-thumb-face`: the shape, and what is seen. `--thumb-s` stretches it (1 at
12
+ * rest) and `--thumb-hold` says which edge holds still while the other gives (1 its
13
+ * right edge, -1 its left): the leading edge on a trip, so the tail lags; the far
14
+ * edge in a lean, so it reaches. It gets a little thinner as it gets longer. Because
15
+ * the holding edge is a `translate` and not a `transform-origin`, turning round is a
16
+ * transition and never a jump.
17
+ * lens `segment-lens`: the labels once more, in the colour of the choice, cut to the
18
+ * face. The lens takes the face's stretch back and `segment-lens-labels` takes back
19
+ * what the rider moved, so the labels stand still and keep their shape while the
20
+ * thumb passes over them: a letter half under the thumb is half dark.
21
+ *
22
+ * The face's shape and the lens's undoing of it are worked out from the same numbers in the
23
+ * same frame, so they cancel exactly. Those numbers (`--thumb-s`, `--thumb-hold`,
24
+ * `--thumb-press`, `--thumb-width`) are registered, and it is they that ease, on the track;
25
+ * the face and the lens have no transition of their own on their shape. Eased apart, a scale
26
+ * and its inverse do not cancel on the way: the copied labels drifted up to 4px from the
27
+ * labels under them and wiggled as the thumb passed. The rider and the lens's labels ease
28
+ * apart, on the same curve from the same frame, and cancel exactly: a translate is undone by
29
+ * its negative at every point of the way.
30
+ *
31
+ * The track carries the state: `data-placed` once the first placement stood (load does not
32
+ * animate), `data-following` while the rider follows a pointer, `data-moving` while the stretch
33
+ * is driven (let go, the face comes back on `rebound`, whose swing past rest is the squash),
34
+ * `data-travelling` while a trip's stretch grows, `data-grabbed` while the thumb is held,
35
+ * `data-dragging` while it is pulled, `data-settling` while a layout change is taken over.
36
+ */
37
+
38
+ @property --thumb-s {
39
+ syntax: "<number>";
40
+ inherits: true;
41
+ initial-value: 1;
42
+ }
43
+ @property --thumb-hold {
44
+ syntax: "<number>";
45
+ inherits: true;
46
+ initial-value: 1;
47
+ }
48
+ @property --thumb-press {
49
+ syntax: "<number>";
50
+ inherits: true;
51
+ initial-value: 1;
52
+ }
53
+ @property --thumb-width {
54
+ syntax: "<length>";
55
+ inherits: true;
56
+ initial-value: 0px;
57
+ }
58
+
59
+ @layer components {
60
+ [data-slot="segmented-control"] {
61
+ /* The slider's chase (slider.css): the `snap` spring as a bezier, which Safari runs off its
62
+ main thread. A test keeps the two equal. */
63
+ --segment-chase: cubic-bezier(0.3, 0.95, 0.25, 1);
64
+ /* How the thumb travels to a choice: a duration and a curve. Without weight it glides. */
65
+ --segment-pace: var(--transition-duration-spring-glide) var(--ease-spring-glide);
66
+ /* A mark closes when the thumb has come over it, not when it sets off. */
67
+ --segment-seat: calc(var(--transition-duration-spring-snap) * 0.4);
68
+ /* On a trip, the stretch starts a frame after the thumb: see `data-travelling` below. */
69
+ --segment-stretch-wait: calc(1s / 60);
70
+ /* How the face's shape eases (its stretch, the edge that holds, the press), and how the
71
+ thumb's width does. Each state below sets them; the transition on the track reads them. */
72
+ --segment-shape-pace: var(--transition-duration-spring-rebound) var(--ease-spring-rebound);
73
+ --segment-width-pace: var(--segment-pace);
74
+ /* How far the face stands inside the chosen segment's box. The square thumb's box is
75
+ already inset in its trough. */
76
+ --thumb-fit: 0px;
77
+ /* The square thumb's corners: the trough's, less the 3px around it. */
78
+ --thumb-radius: calc(var(--radius-md) - 3px);
79
+ /* How much thinner the face gets, as a share of what it gets longer. */
80
+ --thumb-thin: 0.15;
81
+ /* Held, the thumb gives a little, like every fitting that is pressed. */
82
+ --thumb-press: 1;
83
+ /* The face's length and height as factors of its box: the stretch times the press. */
84
+ --thumb-long: calc(var(--thumb-s) * var(--thumb-press));
85
+ --thumb-tall: calc((1 - (var(--thumb-s) - 1) * var(--thumb-thin)) * var(--thumb-press));
86
+ /* How far the face's middle is off its box's, in box widths: the holding edge stays. */
87
+ --thumb-off: calc(var(--thumb-hold) * (var(--thumb-s) - 1) / -2);
88
+ }
89
+ /* With weight, the leading edge sets off on `settle` and the tail comes after: stretched
90
+ thumb and all, the trip takes as long as a glide. */
91
+ [data-slot="segmented-control"][data-weight] {
92
+ --segment-pace: var(--transition-duration-spring-settle) var(--ease-spring-settle);
93
+ }
94
+ /* The round thumb lies flush in its trough: a pixel inside the segment's box, so its outline
95
+ and the trough's are one line (Justin, 2026-11-15). At 0 it stood on the trough's wall, a
96
+ pixel taller than the trough. */
97
+ [data-slot="segmented-control"][data-shape="round"] {
98
+ --thumb-radius: 9999px;
99
+ --thumb-fit: 1px;
100
+ }
101
+ [data-slot="segmented-control"][data-grabbed] {
102
+ --thumb-press: var(--motion-press-scale);
103
+ }
104
+
105
+ [data-slot="segment-thumb"] {
106
+ width: var(--thumb-width);
107
+ translate: calc(var(--thumb-left, 0px) + var(--thumb-lean, 0px)) 0;
108
+ }
109
+ /* Until it is placed, the chosen segment's own seat stands in for it (segmented-control.tsx):
110
+ the two change places in one frame, so a page that came from a server has a thumb at once. */
111
+ [data-slot="segmented-control"]:not([data-placed]) > [data-slot="segment-thumb"] {
112
+ visibility: hidden;
113
+ }
114
+
115
+ /* T(c) S(l): scaled about its middle, then moved so that the holding edge stays. Lengths in
116
+ px, not in percent of the box. */
117
+ [data-slot="segment-thumb-face"] {
118
+ scale: var(--thumb-long) var(--thumb-tall);
119
+ translate: calc(var(--thumb-off) * var(--thumb-width)) 0;
120
+ }
121
+
122
+ /* The inverse: T(c) S(l) is undone by T(-c/l) S(1/l). The press is left in, so a held label
123
+ goes down with its thumb. */
124
+ [data-slot="segment-lens"] {
125
+ scale: calc(1 / var(--thumb-s)) calc(1 / (1 - (var(--thumb-s) - 1) * var(--thumb-thin)));
126
+ translate: calc(-1 * var(--thumb-off) * var(--thumb-width) / var(--thumb-long)) 0;
127
+ }
128
+ /* And the rider's way taken back: the labels stand where the track's labels stand. */
129
+ [data-slot="segment-lens-labels"] {
130
+ translate: calc(-1 * (var(--thumb-left, 0px) + var(--thumb-lean, 0px))) 0;
131
+ }
132
+
133
+ /* What eases. On the track, the numbers the face and the lens are worked out from; on the
134
+ rider and the lens's labels, the way, in pairs on one curve. */
135
+ [data-slot="segmented-control"][data-placed] {
136
+ transition:
137
+ --thumb-s var(--segment-shape-pace),
138
+ --thumb-hold var(--segment-shape-pace),
139
+ --thumb-press var(--segment-shape-pace),
140
+ --thumb-width var(--segment-width-pace);
141
+ }
142
+ [data-placed] > [data-slot="segment-thumb"],
143
+ [data-placed] [data-slot="segment-lens-labels"] {
144
+ transition: translate var(--segment-pace);
145
+ }
146
+ [data-placed] [data-slot="segment-thumb-face"] {
147
+ transition:
148
+ box-shadow var(--transition-duration-spring-seat) var(--ease-spring-seat),
149
+ background-color var(--transition-duration-spring-seat) var(--ease-spring-seat);
150
+ }
151
+
152
+ /* Following a pointer (a mouse it reaches for, the rest of the way after a drop): the rider
153
+ chases it, and the labels give the same way back. A thumb in a hand is placed without any
154
+ curve: see below. */
155
+ [data-slot="segmented-control"][data-placed][data-following] {
156
+ --segment-width-pace: var(--transition-duration-spring-snap) var(--segment-chase);
157
+ }
158
+ [data-placed][data-following] > [data-slot="segment-thumb"],
159
+ [data-placed][data-following] [data-slot="segment-lens-labels"] {
160
+ transition: translate var(--transition-duration-spring-snap) var(--segment-chase);
161
+ }
162
+
163
+ /* While the stretch is driven it follows at once, without a swing. */
164
+ [data-slot="segmented-control"][data-placed][data-moving] {
165
+ --segment-shape-pace: var(--transition-duration-spring-snap) var(--segment-chase);
166
+ }
167
+ [data-placed][data-moving] [data-slot="segment-thumb-face"] {
168
+ transition:
169
+ box-shadow var(--transition-duration-spring-snap) var(--ease-spring-snap),
170
+ background-color var(--transition-duration-spring-snap) var(--ease-spring-snap);
171
+ }
172
+
173
+ /* Setting off to a choice, the stretch grows on the thumb's own pace, a frame after it. The
174
+ stretch is a share of the way, so the tail behind the leading edge never makes up for the
175
+ way gone: it only moves the way the thumb goes, never back through the wall it left, even
176
+ if the trip itself starts a frame late. On the faster chase, from the same frame, it could:
177
+ on an iPhone, the tail of a thumb leaving the last segment showed past the trough's end. */
178
+ [data-slot="segmented-control"][data-placed][data-moving][data-travelling] {
179
+ --segment-shape-pace: var(--segment-pace) var(--segment-stretch-wait);
180
+ }
181
+
182
+ /* In a hand: the thumb stands where the hand has it, written on every move (`follow` in
183
+ segmented-control.tsx), and so do the labels and the stretch. Nothing eases in between: a
184
+ transition retargeted on every move stalls on iOS (measured on an iPhone: the thumb stood
185
+ still while the finger moved, then lurched after it). When the hand stops, `data-moving`
186
+ goes and the face swings back on the rebound; let go, the thumb travels on the chase. */
187
+ [data-slot="segmented-control"][data-placed][data-dragging] {
188
+ --segment-width-pace: 0s;
189
+ }
190
+ [data-slot="segmented-control"][data-placed][data-dragging][data-moving] {
191
+ --segment-shape-pace: 0s;
192
+ }
193
+ [data-placed][data-dragging] > [data-slot="segment-thumb"],
194
+ [data-placed][data-dragging] [data-slot="segment-lens-labels"] {
195
+ transition: none;
196
+ }
197
+
198
+ /* A layout changed (the web font arrived, the container resized): the thumb takes its new
199
+ place at once. Only a choice travels. */
200
+ [data-slot="segmented-control"][data-placed][data-settling] {
201
+ --segment-shape-pace: 0s;
202
+ --segment-width-pace: 0s;
203
+ }
204
+ [data-placed][data-settling] [data-slot^="segment-thumb"],
205
+ [data-placed][data-settling] [data-slot^="segment-lens"] {
206
+ transition: none;
207
+ }
208
+ }