@nmnmcc/standard 0.0.0-stage → 0.4.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 (260) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +516 -2
  3. package/dist/Extend.d.ts +15 -0
  4. package/dist/Extend.d.ts.map +1 -0
  5. package/dist/Extend.js +1 -0
  6. package/dist/Node.d.ts +71 -0
  7. package/dist/Node.d.ts.map +1 -0
  8. package/dist/Palette-BIJ96BEh.js +84 -0
  9. package/dist/Palette.d.ts +8 -0
  10. package/dist/Palette.d.ts.map +1 -0
  11. package/dist/Palette.js +1 -0
  12. package/dist/Standard-BPpzr5SM.js +488 -0
  13. package/dist/Standard.d.ts +249 -0
  14. package/dist/Standard.d.ts.map +1 -0
  15. package/dist/Standard.js +1 -0
  16. package/dist/Ui-B9xQqqNT.js +468 -0
  17. package/dist/Ui.d.ts +500 -0
  18. package/dist/Ui.d.ts.map +1 -0
  19. package/dist/Ui.js +1 -0
  20. package/dist/index.d.ts +25 -0
  21. package/dist/index.d.ts.map +1 -0
  22. package/dist/index.js +4 -0
  23. package/dist/rolldown-runtime-BMBA7GOT.js +10 -0
  24. package/dist/standard/button/button.d.ts +21 -0
  25. package/dist/standard/button/button.d.ts.map +1 -0
  26. package/dist/standard/colour/colour.d.ts +93 -0
  27. package/dist/standard/colour/colour.d.ts.map +1 -0
  28. package/dist/standard/field/field.d.ts +91 -0
  29. package/dist/standard/field/field.d.ts.map +1 -0
  30. package/dist/standard/form/form.d.ts +16 -0
  31. package/dist/standard/form/form.d.ts.map +1 -0
  32. package/dist/standard/icon/icon.d.ts +31 -0
  33. package/dist/standard/icon/icon.d.ts.map +1 -0
  34. package/dist/standard/image/image.d.ts +21 -0
  35. package/dist/standard/image/image.d.ts.map +1 -0
  36. package/dist/standard/layout/layout.d.ts +73 -0
  37. package/dist/standard/layout/layout.d.ts.map +1 -0
  38. package/dist/standard/list/list.d.ts +26 -0
  39. package/dist/standard/list/list.d.ts.map +1 -0
  40. package/dist/standard/page/page.d.ts +20 -0
  41. package/dist/standard/page/page.d.ts.map +1 -0
  42. package/dist/standard/table/table.d.ts +18 -0
  43. package/dist/standard/table/table.d.ts.map +1 -0
  44. package/dist/standard/text/text.d.ts +39 -0
  45. package/dist/standard/text/text.d.ts.map +1 -0
  46. package/dist/standard/tokens/classes.d.ts +16 -0
  47. package/dist/standard/tokens/classes.d.ts.map +1 -0
  48. package/dist/standard/tokens/tokens.d.ts +162 -0
  49. package/dist/standard/tokens/tokens.d.ts.map +1 -0
  50. package/dist/standard.css +2 -0
  51. package/dist/ui/arrow/arrow.d.ts +18 -0
  52. package/dist/ui/arrow/arrow.d.ts.map +1 -0
  53. package/dist/ui/avatar/avatar.d.ts +15 -0
  54. package/dist/ui/avatar/avatar.d.ts.map +1 -0
  55. package/dist/ui/board/board.d.ts +34 -0
  56. package/dist/ui/board/board.d.ts.map +1 -0
  57. package/dist/ui/bullet/bullet.d.ts +15 -0
  58. package/dist/ui/bullet/bullet.d.ts.map +1 -0
  59. package/dist/ui/card/card.d.ts +24 -0
  60. package/dist/ui/card/card.d.ts.map +1 -0
  61. package/dist/ui/carousel/carousel.d.ts +17 -0
  62. package/dist/ui/carousel/carousel.d.ts.map +1 -0
  63. package/dist/ui/check/check.d.ts +20 -0
  64. package/dist/ui/check/check.d.ts.map +1 -0
  65. package/dist/ui/choice/choice.d.ts +19 -0
  66. package/dist/ui/choice/choice.d.ts.map +1 -0
  67. package/dist/ui/control/control.d.ts +57 -0
  68. package/dist/ui/control/control.d.ts.map +1 -0
  69. package/dist/ui/dialog/dialog.d.ts +30 -0
  70. package/dist/ui/dialog/dialog.d.ts.map +1 -0
  71. package/dist/ui/disclosure/disclosure.d.ts +20 -0
  72. package/dist/ui/disclosure/disclosure.d.ts.map +1 -0
  73. package/dist/ui/flap/flap.d.ts +18 -0
  74. package/dist/ui/flap/flap.d.ts.map +1 -0
  75. package/dist/ui/item/item.d.ts +21 -0
  76. package/dist/ui/item/item.d.ts.map +1 -0
  77. package/dist/ui/key/key.d.ts +12 -0
  78. package/dist/ui/key/key.d.ts.map +1 -0
  79. package/dist/ui/menu/menu.d.ts +26 -0
  80. package/dist/ui/menu/menu.d.ts.map +1 -0
  81. package/dist/ui/modal/modal.d.ts +22 -0
  82. package/dist/ui/modal/modal.d.ts.map +1 -0
  83. package/dist/ui/navigator/navigator.d.ts +137 -0
  84. package/dist/ui/navigator/navigator.d.ts.map +1 -0
  85. package/dist/ui/notice/notice.d.ts +34 -0
  86. package/dist/ui/notice/notice.d.ts.map +1 -0
  87. package/dist/ui/options/options.d.ts +19 -0
  88. package/dist/ui/options/options.d.ts.map +1 -0
  89. package/dist/ui/pager/pager.d.ts +29 -0
  90. package/dist/ui/pager/pager.d.ts.map +1 -0
  91. package/dist/ui/pagination/pagination.d.ts +14 -0
  92. package/dist/ui/pagination/pagination.d.ts.map +1 -0
  93. package/dist/ui/popover/popover.d.ts +20 -0
  94. package/dist/ui/popover/popover.d.ts.map +1 -0
  95. package/dist/ui/progress/progress.d.ts +17 -0
  96. package/dist/ui/progress/progress.d.ts.map +1 -0
  97. package/dist/ui/route/route.d.ts +27 -0
  98. package/dist/ui/route/route.d.ts.map +1 -0
  99. package/dist/ui/sheet/sheet.d.ts +35 -0
  100. package/dist/ui/sheet/sheet.d.ts.map +1 -0
  101. package/dist/ui/skeleton/skeleton.d.ts +15 -0
  102. package/dist/ui/skeleton/skeleton.d.ts.map +1 -0
  103. package/dist/ui/slider/slider.d.ts +23 -0
  104. package/dist/ui/slider/slider.d.ts.map +1 -0
  105. package/dist/ui/stepper/stepper.d.ts +32 -0
  106. package/dist/ui/stepper/stepper.d.ts.map +1 -0
  107. package/dist/ui/tabs/tabs.d.ts +22 -0
  108. package/dist/ui/tabs/tabs.d.ts.map +1 -0
  109. package/dist/ui/tag/tag.d.ts +17 -0
  110. package/dist/ui/tag/tag.d.ts.map +1 -0
  111. package/dist/ui/tile/tile.d.ts +38 -0
  112. package/dist/ui/tile/tile.d.ts.map +1 -0
  113. package/dist/ui/toasts/toasts.d.ts +17 -0
  114. package/dist/ui/toasts/toasts.d.ts.map +1 -0
  115. package/dist/ui/toggle/toggle.d.ts +17 -0
  116. package/dist/ui/toggle/toggle.d.ts.map +1 -0
  117. package/dist/ui/trail/trail.d.ts +22 -0
  118. package/dist/ui/trail/trail.d.ts.map +1 -0
  119. package/package.json +70 -3
  120. package/src/Extend.ts +14 -0
  121. package/src/Node.ts +44 -0
  122. package/src/Palette.ts +7 -0
  123. package/src/Standard.ts +109 -0
  124. package/src/Ui.ts +156 -0
  125. package/src/index.ts +27 -0
  126. package/src/standard/button/button.module.css +43 -0
  127. package/src/standard/button/button.module.d.css.ts +6 -0
  128. package/src/standard/button/button.ts +38 -0
  129. package/src/standard/colour/colour.ts +197 -0
  130. package/src/standard/field/field.module.css +222 -0
  131. package/src/standard/field/field.module.d.css.ts +13 -0
  132. package/src/standard/field/field.ts +266 -0
  133. package/src/standard/form/form.ts +25 -0
  134. package/src/standard/icon/icon.module.css +349 -0
  135. package/src/standard/icon/icon.module.d.css.ts +112 -0
  136. package/src/standard/icon/icon.ts +148 -0
  137. package/src/standard/image/image.module.css +42 -0
  138. package/src/standard/image/image.module.d.css.ts +12 -0
  139. package/src/standard/image/image.ts +39 -0
  140. package/src/standard/layout/layout.module.css +224 -0
  141. package/src/standard/layout/layout.module.d.css.ts +41 -0
  142. package/src/standard/layout/layout.ts +133 -0
  143. package/src/standard/list/list.module.css +71 -0
  144. package/src/standard/list/list.module.d.css.ts +10 -0
  145. package/src/standard/list/list.ts +53 -0
  146. package/src/standard/page/page.module.css +244 -0
  147. package/src/standard/page/page.module.d.css.ts +9 -0
  148. package/src/standard/page/page.ts +32 -0
  149. package/src/standard/table/table.module.css +40 -0
  150. package/src/standard/table/table.module.d.css.ts +6 -0
  151. package/src/standard/table/table.ts +36 -0
  152. package/src/standard/text/text.module.css +149 -0
  153. package/src/standard/text/text.module.d.css.ts +19 -0
  154. package/src/standard/text/text.ts +77 -0
  155. package/src/standard/tokens/classes.ts +31 -0
  156. package/src/standard/tokens/tokens.module.css +294 -0
  157. package/src/standard/tokens/tokens.module.d.css.ts +40 -0
  158. package/src/standard/tokens/tokens.ts +339 -0
  159. package/src/ui/arrow/arrow.module.css +38 -0
  160. package/src/ui/arrow/arrow.module.d.css.ts +13 -0
  161. package/src/ui/arrow/arrow.ts +35 -0
  162. package/src/ui/avatar/avatar.module.css +25 -0
  163. package/src/ui/avatar/avatar.module.d.css.ts +5 -0
  164. package/src/ui/avatar/avatar.ts +28 -0
  165. package/src/ui/board/board.module.css +94 -0
  166. package/src/ui/board/board.module.d.css.ts +10 -0
  167. package/src/ui/board/board.ts +84 -0
  168. package/src/ui/bullet/bullet.module.css +28 -0
  169. package/src/ui/bullet/bullet.module.d.css.ts +5 -0
  170. package/src/ui/bullet/bullet.ts +16 -0
  171. package/src/ui/card/card.module.css +80 -0
  172. package/src/ui/card/card.module.d.css.ts +6 -0
  173. package/src/ui/card/card.ts +42 -0
  174. package/src/ui/carousel/carousel.module.css +24 -0
  175. package/src/ui/carousel/carousel.module.d.css.ts +5 -0
  176. package/src/ui/carousel/carousel.ts +30 -0
  177. package/src/ui/check/check.module.css +53 -0
  178. package/src/ui/check/check.module.d.css.ts +8 -0
  179. package/src/ui/check/check.ts +46 -0
  180. package/src/ui/choice/choice.module.css +32 -0
  181. package/src/ui/choice/choice.module.d.css.ts +6 -0
  182. package/src/ui/choice/choice.ts +31 -0
  183. package/src/ui/control/control.module.css +127 -0
  184. package/src/ui/control/control.module.d.css.ts +12 -0
  185. package/src/ui/control/control.ts +97 -0
  186. package/src/ui/dialog/dialog.module.css +42 -0
  187. package/src/ui/dialog/dialog.module.d.css.ts +6 -0
  188. package/src/ui/dialog/dialog.ts +44 -0
  189. package/src/ui/disclosure/disclosure.module.css +57 -0
  190. package/src/ui/disclosure/disclosure.module.d.css.ts +7 -0
  191. package/src/ui/disclosure/disclosure.ts +32 -0
  192. package/src/ui/flap/flap.module.css +161 -0
  193. package/src/ui/flap/flap.module.d.css.ts +48 -0
  194. package/src/ui/flap/flap.ts +78 -0
  195. package/src/ui/item/item.module.css +39 -0
  196. package/src/ui/item/item.module.d.css.ts +7 -0
  197. package/src/ui/item/item.ts +33 -0
  198. package/src/ui/key/key.module.css +15 -0
  199. package/src/ui/key/key.module.d.css.ts +5 -0
  200. package/src/ui/key/key.ts +13 -0
  201. package/src/ui/menu/menu.module.css +11 -0
  202. package/src/ui/menu/menu.module.d.css.ts +5 -0
  203. package/src/ui/menu/menu.ts +48 -0
  204. package/src/ui/modal/modal.module.css +66 -0
  205. package/src/ui/modal/modal.module.d.css.ts +8 -0
  206. package/src/ui/modal/modal.ts +55 -0
  207. package/src/ui/navigator/navigator.module.css +658 -0
  208. package/src/ui/navigator/navigator.module.d.css.ts +39 -0
  209. package/src/ui/navigator/navigator.ts +337 -0
  210. package/src/ui/notice/notice.module.css +80 -0
  211. package/src/ui/notice/notice.module.d.css.ts +10 -0
  212. package/src/ui/notice/notice.ts +57 -0
  213. package/src/ui/options/options.module.css +30 -0
  214. package/src/ui/options/options.module.d.css.ts +6 -0
  215. package/src/ui/options/options.ts +31 -0
  216. package/src/ui/pager/pager.module.css +38 -0
  217. package/src/ui/pager/pager.module.d.css.ts +8 -0
  218. package/src/ui/pager/pager.ts +48 -0
  219. package/src/ui/pagination/pagination.module.css +38 -0
  220. package/src/ui/pagination/pagination.module.d.css.ts +7 -0
  221. package/src/ui/pagination/pagination.ts +52 -0
  222. package/src/ui/popover/popover.module.css +94 -0
  223. package/src/ui/popover/popover.module.d.css.ts +8 -0
  224. package/src/ui/popover/popover.ts +139 -0
  225. package/src/ui/progress/progress.module.css +69 -0
  226. package/src/ui/progress/progress.module.d.css.ts +6 -0
  227. package/src/ui/progress/progress.ts +26 -0
  228. package/src/ui/route/route.module.css +116 -0
  229. package/src/ui/route/route.module.d.css.ts +11 -0
  230. package/src/ui/route/route.ts +58 -0
  231. package/src/ui/sheet/sheet.module.css +194 -0
  232. package/src/ui/sheet/sheet.module.d.css.ts +7 -0
  233. package/src/ui/sheet/sheet.ts +47 -0
  234. package/src/ui/skeleton/skeleton.module.css +44 -0
  235. package/src/ui/skeleton/skeleton.module.d.css.ts +6 -0
  236. package/src/ui/skeleton/skeleton.ts +20 -0
  237. package/src/ui/slider/slider.module.css +56 -0
  238. package/src/ui/slider/slider.module.d.css.ts +6 -0
  239. package/src/ui/slider/slider.ts +48 -0
  240. package/src/ui/stepper/stepper.module.css +32 -0
  241. package/src/ui/stepper/stepper.module.d.css.ts +7 -0
  242. package/src/ui/stepper/stepper.ts +62 -0
  243. package/src/ui/tabs/tabs.module.css +38 -0
  244. package/src/ui/tabs/tabs.module.d.css.ts +6 -0
  245. package/src/ui/tabs/tabs.ts +24 -0
  246. package/src/ui/tag/tag.module.css +23 -0
  247. package/src/ui/tag/tag.module.d.css.ts +5 -0
  248. package/src/ui/tag/tag.ts +17 -0
  249. package/src/ui/tile/tile.module.css +137 -0
  250. package/src/ui/tile/tile.module.d.css.ts +13 -0
  251. package/src/ui/tile/tile.ts +69 -0
  252. package/src/ui/toasts/toasts.module.css +38 -0
  253. package/src/ui/toasts/toasts.module.d.css.ts +6 -0
  254. package/src/ui/toasts/toasts.ts +26 -0
  255. package/src/ui/toggle/toggle.module.css +46 -0
  256. package/src/ui/toggle/toggle.module.d.css.ts +6 -0
  257. package/src/ui/toggle/toggle.ts +29 -0
  258. package/src/ui/trail/trail.module.css +42 -0
  259. package/src/ui/trail/trail.module.d.css.ts +5 -0
  260. package/src/ui/trail/trail.ts +28 -0
@@ -0,0 +1,658 @@
1
+ /* navigator: everywhere you can go, at the side of the page, along its top, or along its bottom. */
2
+
3
+ @layer standard.ui {
4
+ /*
5
+ * The navigator, in two layers. First a bar: each group, by a pictogram
6
+ * and its name. Then a pane: the places of the group that is shown. The
7
+ * group shown and its pane are a block of its colour, a group that is
8
+ * not shown is written in its colour, and the current place is the two
9
+ * colours swapped.
10
+ *
11
+ * It takes one of three places. At the side, the bar is a rail down the
12
+ * edge where the page starts and the pane is beside it. Along the top,
13
+ * the bar is a row and the pane hangs under the group that is shown.
14
+ * Along the bottom, which is where a thumb is, the bar is a row of tabs
15
+ * and the pane rises from behind it. A narrow window always has it along
16
+ * the bottom.
17
+ *
18
+ * The button that goes back, and the app's mark, are at the start of the
19
+ * bar. The tabs along the bottom have no room for them: there they are
20
+ * in a bar of their own, along the top of the page.
21
+ *
22
+ * Closed, which is how it is until it is opened, there is only the bar.
23
+ * Docked, the open pane takes its room from the page, by moving its
24
+ * edge. As a sheet it takes none: the window moves over to it, and the
25
+ * page slides out by as much as the pane slides in. Along the bottom it
26
+ * is always a sheet. Along the top it is neither: it hangs over the
27
+ * page, as a menu does.
28
+ */
29
+ .shell {
30
+ /* How high the top of each layer is, and how wide the rail is while it is closed. */
31
+ --s-ui-row: 3.75rem;
32
+ /* How wide the rail is, open. */
33
+ --s-ui-rail: 11rem;
34
+ --s-ui-pane: 14.25rem;
35
+ /* What centres a pictogram in the closed rail, and keeps a name out of it. */
36
+ --s-ui-inset: calc((var(--s-ui-row) - 1.5rem) / 2);
37
+ /* How high a row of the pane is. It is a list read downwards, so a row is lower than a button; a finger still gets the whole target. */
38
+ --s-ui-place: calc(var(--s-target) - var(--s-unit));
39
+ /* How high the tabs along the bottom are, and the pane that rises from behind them. */
40
+ --s-ui-tabs: 3.5rem;
41
+ --s-ui-drawer: min(24rem, round(60dvb, 1px));
42
+ /* How high the bar along the top is. There is none unless there is something to put in it. */
43
+ --s-ui-top: 0px;
44
+
45
+ &:has(> .nav-top) {
46
+ --s-ui-top: var(--s-ui-row);
47
+ }
48
+
49
+ @media (pointer: coarse) {
50
+ --s-ui-place: var(--s-target);
51
+ }
52
+
53
+ flex: 1;
54
+ display: grid;
55
+ grid-template-columns: minmax(0, 1fr);
56
+ grid-template-rows: auto minmax(0, 1fr) auto;
57
+ /* The page can be moved past the edge of the window without the window scrolling after it. */
58
+ overflow-x: clip;
59
+ }
60
+
61
+ /* What is beside the navigator is measured against its own width, not the window's. */
62
+ .shell-body {
63
+ grid-row: 2;
64
+ container: s-page / inline-size;
65
+ display: flex;
66
+ flex-direction: column;
67
+ min-block-size: calc(100dvb - var(--s-ui-tabs) - var(--s-ui-top));
68
+ transition: translate var(--s-travel) var(--s-glide);
69
+ }
70
+
71
+ :where(.nav-list, .nav-cell, .nav-mark) {
72
+ --s-line: var(--s-mark);
73
+ --s-on-line: var(--s-on-mark);
74
+ }
75
+
76
+ /* Along the bottom, unless a wide window puts it somewhere else. */
77
+ .navigator,
78
+ .nav-top {
79
+ position: sticky;
80
+ z-index: 2;
81
+ /* The bar is a surface: a step from its ground towards its text. */
82
+ --s-ui-bar: color-mix(in oklch, var(--s-fg) 8%, var(--s-bg));
83
+
84
+ color: var(--s-fg);
85
+ }
86
+
87
+ /*
88
+ * The bar along the top of a page that has its tabs along the bottom:
89
+ * the button that goes back, and the app's mark and name. A wide window
90
+ * that has the navigator at its side or along its top has no need of it.
91
+ */
92
+ .nav-top {
93
+ grid-row: 1;
94
+ inset-block-start: 0;
95
+ display: flex;
96
+ min-block-size: var(--s-ui-row);
97
+ padding-block-start: env(safe-area-inset-top);
98
+ background: var(--s-ui-bar);
99
+ /* In a change of page it is not part of what moves. */
100
+ view-transition-name: s-ui-navigator-top;
101
+ }
102
+
103
+ /* The app's mark and name there. It is not a button: the tabs open the navigator. */
104
+ .nav-sign {
105
+ display: flex;
106
+ align-items: center;
107
+ column-gap: var(--s-unit);
108
+ padding-inline: var(--s-ui-inset);
109
+ white-space: nowrap;
110
+ overflow: clip;
111
+ font-size: 1.25rem;
112
+
113
+ /* After the button, its pictogram's own margin is all the room it needs. */
114
+ .nav-back + & {
115
+ padding-inline-start: 0;
116
+ }
117
+ }
118
+
119
+ .navigator {
120
+ grid-row: 3;
121
+ inset-block-end: 0;
122
+ /* In a change of page it is not part of what moves. */
123
+ view-transition-name: s-ui-navigator;
124
+ }
125
+
126
+ /* The bar of a wide window. */
127
+ .nav-bar {
128
+ display: none;
129
+ }
130
+
131
+ /* The bar along the bottom: a tab for each group. It is over the pane, so the pane rises from behind it. */
132
+ .nav-tabs {
133
+ position: relative;
134
+ z-index: 1;
135
+ display: flex;
136
+ padding-block-end: env(safe-area-inset-bottom);
137
+ background: var(--s-ui-bar);
138
+ }
139
+
140
+ /* A group, by a pictogram and its name. */
141
+ .nav-cell {
142
+ flex: none;
143
+ display: flex;
144
+ align-items: center;
145
+ column-gap: var(--s-ui-inset);
146
+ padding-inline: var(--s-ui-inset);
147
+ background: color-mix(in oklch, var(--s-fg) var(--s-ui-press), transparent);
148
+ /*
149
+ * A group that is not shown is written in its colour: the colour as
150
+ * text, which can be read on the bar. It is worked out here and not
151
+ * taken from `--s-read`, because a group may have a colour of its own.
152
+ */
153
+ color: color-mix(
154
+ in srgb,
155
+ var(--s-fg) calc(var(--s-flat) * 100%),
156
+ color-mix(in srgb, var(--s-accent-on-black) calc(var(--s-dark) * 100%), var(--s-accent-on-white))
157
+ );
158
+ /* The size of the pictogram. The name has its own. */
159
+ font-size: 1.25rem;
160
+ white-space: nowrap;
161
+ overflow: clip;
162
+
163
+ /* The group that is shown is a block of its colour. */
164
+ &[aria-pressed="true"] {
165
+ background: color-mix(in oklch, var(--s-on-line) var(--s-ui-press), var(--s-line));
166
+ color: var(--s-on-line);
167
+ forced-color-adjust: none;
168
+ }
169
+ }
170
+
171
+ .nav-name {
172
+ font-size: 1rem;
173
+ line-height: 1.25rem;
174
+ font-weight: 700;
175
+ }
176
+
177
+ /* A tab: the pictogram over the name, flush with the edge where the page starts, and each tab as wide as the others. */
178
+ .nav-tabs > .nav-cell {
179
+ flex: 1 1 0;
180
+ flex-direction: column;
181
+ align-items: start;
182
+ justify-content: center;
183
+ row-gap: calc(var(--s-unit) / 4);
184
+ min-block-size: var(--s-ui-tabs);
185
+ padding-inline: calc(1.5 * var(--s-unit));
186
+
187
+ & > .nav-name {
188
+ font-size: 0.75rem;
189
+ line-height: 1rem;
190
+ }
191
+ }
192
+
193
+ /* The button that opens and closes the navigator: three bars, or the app's mark and, where there is room, its name. */
194
+ .nav-back {
195
+ inline-size: var(--s-ui-row);
196
+ /* In a change of page it is not part of the navigator: its arrow goes with the page, seen through the button. */
197
+ view-transition-name: s-ui-navigator-back;
198
+ }
199
+
200
+ /* The button that goes back is set as it is: an arrow, in a square. */
201
+ .nav-fold,
202
+ .nav-back {
203
+ flex: none;
204
+ display: flex;
205
+ align-items: center;
206
+ column-gap: var(--s-ui-inset);
207
+ padding-inline: var(--s-ui-inset);
208
+ white-space: nowrap;
209
+ overflow: clip;
210
+ background: color-mix(in oklch, var(--s-fg) var(--s-ui-press), transparent);
211
+ color: inherit;
212
+ font-size: 1.25rem;
213
+ }
214
+
215
+ /*
216
+ * The arrow of the button that goes back points the way the window will
217
+ * move: back along the line of reading, as it is drawn, or turned from
218
+ * that. When the window moves, the arrow leaves with the page that is
219
+ * left, and the one that comes in with the next page is turned already.
220
+ * When the page changes and the window does not move, the arrow turns
221
+ * where it is: the short way round where it can, by a `rotate` of its
222
+ * own that says the same direction as one of these.
223
+ */
224
+ .nav-way {
225
+ transition: rotate var(--s-travel) var(--s-glide);
226
+
227
+ &.turn-45 {
228
+ rotate: 45deg;
229
+ }
230
+ &.turn-90 {
231
+ rotate: 90deg;
232
+ }
233
+ &.turn-135 {
234
+ rotate: 135deg;
235
+ }
236
+ &.turn-180 {
237
+ rotate: 180deg;
238
+ }
239
+ &.turn--45 {
240
+ rotate: -45deg;
241
+ }
242
+ &.turn--90 {
243
+ rotate: -90deg;
244
+ }
245
+ &.turn--135 {
246
+ rotate: -135deg;
247
+ }
248
+ }
249
+
250
+ :root:active-view-transition-type(forward, back, down, up) .nav-way {
251
+ transition: none;
252
+ }
253
+
254
+ /*
255
+ * The rule between the app's mark and the groups: a hairline across the
256
+ * bar, whichever way the bar runs. It is the first thing in the bar after
257
+ * the mark, so along the bottom, where there is no mark, there is no rule.
258
+ */
259
+ .nav-rule {
260
+ flex: 0 0 var(--s-hair);
261
+ align-self: stretch;
262
+ background: color-mix(in oklch, var(--s-fg) 28%, transparent);
263
+ }
264
+
265
+ /* The mark of the app: a square the size of a pictogram. A picture fills it; a pictogram sits in it; with neither it is a block of the accent. */
266
+ .nav-mark {
267
+ flex: none;
268
+ display: grid;
269
+ place-items: center;
270
+ inline-size: 1.5rem;
271
+ block-size: 1.5rem;
272
+ overflow: clip;
273
+
274
+ &:empty {
275
+ background: var(--s-line);
276
+ forced-color-adjust: none;
277
+ }
278
+
279
+ & > img {
280
+ inline-size: 100%;
281
+ block-size: 100%;
282
+ object-fit: cover;
283
+ }
284
+ }
285
+
286
+ /* The second layer. Its lists are stacked, and only the one shown is in it. Along the bottom it rises from behind the tabs. */
287
+ .nav-pane {
288
+ position: absolute;
289
+ inset-inline: 0;
290
+ inset-block-end: 100%;
291
+ display: grid;
292
+ block-size: var(--s-ui-drawer);
293
+ background: var(--s-bg);
294
+ overflow: clip;
295
+ /*
296
+ * Closed, it is where it will be and none of it is seen: its top edge
297
+ * is down at the tabs. It is not moved below them to hide it, because
298
+ * there it would be past the bottom of the page and the page would
299
+ * scroll on into nothing.
300
+ */
301
+ clip-path: inset(100% 0 0 0);
302
+ visibility: hidden;
303
+ transition:
304
+ clip-path var(--s-travel) var(--s-glide),
305
+ translate var(--s-travel) var(--s-glide),
306
+ visibility var(--s-travel);
307
+ }
308
+
309
+ /* Open, its edge has gone up as far as the page has. */
310
+ .shell.state-open .nav-pane {
311
+ clip-path: inset(0);
312
+ visibility: visible;
313
+ }
314
+
315
+ /* The window has moved down to the pane: the page is as far up as the pane is high. */
316
+ .shell.state-open > .shell-body {
317
+ translate: 0 calc(-1 * var(--s-ui-drawer));
318
+ }
319
+
320
+ /*
321
+ * A list is set on its group's colour: the pane is a block of it, as the
322
+ * group is in the bar. The text on it is in the colour that goes on that
323
+ * colour, and the current place is the two swapped.
324
+ */
325
+ .nav-list {
326
+ --s-bg: var(--s-line);
327
+ --s-fg: var(--s-on-line);
328
+ /* What matters less on the colour. On a navigator that is itself a block of colour, the pane is that block's other colour, and nothing is taken off. */
329
+ --s-muted: color-mix(in srgb, var(--s-on-line) calc(var(--s-flat) * 100%), var(--s-accent-soft));
330
+
331
+ background: var(--s-bg);
332
+ color: var(--s-fg);
333
+ forced-color-adjust: none;
334
+
335
+ /* A group that was given a colour is set on that. */
336
+ &:global(.s-ui-lined) {
337
+ --s-muted: var(--s-accent-soft);
338
+ }
339
+ }
340
+
341
+ .nav-list {
342
+ grid-area: 1 / 1;
343
+ position: relative;
344
+ inline-size: 100%;
345
+ block-size: 100%;
346
+ /* The group is named in the bar, and not again here: its first place is flush with the bar. */
347
+ padding-block: 0 calc(3 * var(--s-unit));
348
+ overflow: hidden auto;
349
+ overscroll-behavior: contain;
350
+ scrollbar-width: none;
351
+ /* A change of group moves the lists the way the groups are placed: an earlier group is above, a later one below. */
352
+ transition:
353
+ translate var(--s-move) var(--s-ease),
354
+ visibility var(--s-move);
355
+
356
+ &.is-before {
357
+ translate: 0 -100%;
358
+ visibility: hidden;
359
+ }
360
+ &.is-after {
361
+ translate: 0 100%;
362
+ visibility: hidden;
363
+ }
364
+ }
365
+
366
+ .nav-places {
367
+ list-style: none;
368
+ }
369
+
370
+ .nav-rows {
371
+ position: relative;
372
+ }
373
+
374
+ /* A row of the pane: a place, and its name again in the block that marks the current place. Every row is as high as every other. */
375
+ .nav-place,
376
+ .nav-lit {
377
+ display: grid;
378
+ align-content: center;
379
+ min-block-size: 0;
380
+ block-size: var(--s-ui-place);
381
+ padding-inline: calc(2 * var(--s-unit));
382
+ line-height: 1.25rem;
383
+ white-space: nowrap;
384
+ overflow: clip;
385
+ }
386
+
387
+ .nav-place {
388
+ background: color-mix(in oklch, var(--s-fg) var(--s-ui-press), transparent);
389
+ color: var(--s-muted);
390
+ text-decoration: none;
391
+
392
+ /* Where the block can't be drawn, the current place itself is filled. */
393
+ &[aria-current="page"] {
394
+ background: var(--s-on-line);
395
+ color: var(--s-line);
396
+ }
397
+ }
398
+
399
+ /*
400
+ * The block that marks the current place. It is the whole list over
401
+ * again, in the block's colours, seen through a window one row high. In a
402
+ * change of place the window goes from the row you left to the row you
403
+ * reached, with the duration and easing the page uses, and no name
404
+ * moves: under the window a name is in the colour of the pane on the
405
+ * colour of its text, beside it the other way round, and where the edge
406
+ * of the window crosses a name, the name is cut there. So the two are
407
+ * set the same, in one weight: only the colours differ.
408
+ */
409
+ .nav-here {
410
+ display: none;
411
+ }
412
+
413
+ @supports (x: attr(x type(*))) {
414
+ .nav-here {
415
+ /* The row it is on, counted from the first. */
416
+ --s-ui-at: attr(data-at type(<number>), 0);
417
+
418
+ display: block;
419
+ position: absolute;
420
+ inset: 0;
421
+ background: var(--s-on-line);
422
+ color: var(--s-line);
423
+ clip-path: inset(
424
+ calc(var(--s-ui-at) * var(--s-ui-place)) 0 calc(100% - (var(--s-ui-at) + 1) * var(--s-ui-place)) 0
425
+ );
426
+ transition: clip-path var(--s-travel) var(--s-glide);
427
+ /* A press goes through it to the place under it. */
428
+ pointer-events: none;
429
+ forced-color-adjust: none;
430
+ }
431
+
432
+ /* Under the block, the place itself is a row like any other. */
433
+ .nav-rows:has(> .nav-here) .nav-place[aria-current="page"] {
434
+ background: color-mix(in oklch, var(--s-fg) var(--s-ui-press), transparent);
435
+ color: var(--s-muted);
436
+ }
437
+
438
+ /* The focus ring of the place under the block is drawn on the block, in the colour that is readable on it. */
439
+ .nav-rows:has([aria-current="page"]:focus-visible) > .nav-here::after {
440
+ content: "";
441
+ position: absolute;
442
+ inset-inline: 0;
443
+ inset-block-start: calc(var(--s-ui-at) * var(--s-ui-place));
444
+ block-size: var(--s-ui-place);
445
+ border: calc(var(--s-unit) / 4) solid currentColor;
446
+ }
447
+ }
448
+
449
+ @container s-page (inline-size >= 48rem) {
450
+ /* ---- At the side: a rail down the edge where the page starts, and the pane beside it. ---- */
451
+
452
+ .shell.place-side {
453
+ grid-template-columns: auto minmax(0, 1fr);
454
+ grid-template-rows: none;
455
+
456
+ & > .shell-body {
457
+ grid-row: auto;
458
+ min-block-size: 100dvb;
459
+ translate: none;
460
+ }
461
+
462
+ & > .nav-top {
463
+ display: none;
464
+ }
465
+
466
+ & > .navigator {
467
+ grid-row: auto;
468
+ inset-block: 0 auto;
469
+ align-self: start;
470
+ display: flex;
471
+ block-size: 100dvb;
472
+ }
473
+
474
+ & .nav-tabs {
475
+ display: none;
476
+ }
477
+
478
+ /* The rail. It is over the pane, so a sliding pane comes out from under it. Closed, it is as wide as its pictograms. */
479
+ & .nav-bar {
480
+ position: relative;
481
+ z-index: 1;
482
+ flex: none;
483
+ display: flex;
484
+ flex-direction: column;
485
+ inline-size: var(--s-ui-row);
486
+ background: var(--s-ui-bar);
487
+ overflow: hidden auto;
488
+ scrollbar-width: none;
489
+ /* It opens and closes by moving its edge, and uncovers the names. */
490
+ transition: inline-size var(--s-move) var(--s-ease);
491
+ }
492
+
493
+ /* Each is as high as the closed rail is wide: closed, a group is a square, and the one shown a square block of its colour. */
494
+ & :is(.nav-back, .nav-fold, .nav-cell) {
495
+ inline-size: 100%;
496
+ block-size: var(--s-ui-row);
497
+ }
498
+
499
+ /* Open: the rail has room for the names. */
500
+ &.state-open .nav-bar {
501
+ inline-size: var(--s-ui-rail);
502
+ }
503
+
504
+ /* The pane is beside the rail. It opens and folds by moving its edge; what is in it keeps its width, and is uncovered. */
505
+ & .nav-pane {
506
+ position: static;
507
+ inline-size: var(--s-ui-pane);
508
+ block-size: auto;
509
+ clip-path: none;
510
+ translate: none;
511
+ visibility: visible;
512
+ transition:
513
+ inline-size var(--s-move) var(--s-ease),
514
+ translate var(--s-travel) var(--s-glide),
515
+ visibility var(--s-travel);
516
+ }
517
+
518
+ & .nav-list {
519
+ inline-size: var(--s-ui-pane);
520
+ }
521
+
522
+ /* Docked and closed: the pane has no width, and the page has the room. */
523
+ &:not(.mode-sheet, .state-open) .nav-pane {
524
+ inline-size: 0;
525
+ visibility: hidden;
526
+ }
527
+
528
+ /* As a sheet it keeps the room of the closed rail, however wide it grows: the rest lies over where the page was. */
529
+ &.mode-sheet > .navigator {
530
+ inline-size: var(--s-ui-row);
531
+ }
532
+ /* The rail grows in step with the page leaving. */
533
+ &.mode-sheet .nav-bar {
534
+ transition: inline-size var(--s-travel) var(--s-glide);
535
+ }
536
+
537
+ /* The pane is beside the rail and takes no room. Closed, it is under the rail and off the window. */
538
+ &.mode-sheet .nav-pane {
539
+ position: absolute;
540
+ inset-block: 0;
541
+ inset-inline: var(--s-ui-row) auto;
542
+ translate: -100% 0;
543
+ visibility: hidden;
544
+ }
545
+
546
+ &.mode-sheet.state-open .nav-pane {
547
+ translate: calc(var(--s-ui-rail) - var(--s-ui-row)) 0;
548
+ visibility: visible;
549
+ }
550
+
551
+ /* The window has moved over to them: the page is moved across by as much as the rail has grown and the pane is wide. */
552
+ &.mode-sheet.state-open > .shell-body {
553
+ translate: calc(var(--s-ui-rail) - var(--s-ui-row) + var(--s-ui-pane)) 0;
554
+ }
555
+ }
556
+
557
+ /* ---- Along the top: a row of groups, and the places of one of them hanging under it. ---- */
558
+
559
+ .shell.place-top {
560
+ grid-template-rows: auto minmax(0, 1fr);
561
+
562
+ & > .shell-body {
563
+ grid-row: 2;
564
+ min-block-size: calc(100dvb - var(--s-ui-row));
565
+ translate: none;
566
+ }
567
+
568
+ & > .nav-top {
569
+ display: none;
570
+ }
571
+
572
+ & > .navigator {
573
+ grid-row: 1;
574
+ inset-block: 0 auto;
575
+ }
576
+
577
+ & .nav-tabs {
578
+ display: none;
579
+ }
580
+
581
+ /* The row of groups. It is over the pane, so a sliding pane comes out from under it. */
582
+ & .nav-bar {
583
+ position: relative;
584
+ z-index: 1;
585
+ display: flex;
586
+ block-size: var(--s-ui-row);
587
+ background: var(--s-ui-bar);
588
+ overflow: auto hidden;
589
+ scrollbar-width: none;
590
+ }
591
+
592
+ & .nav-fold {
593
+ inline-size: var(--s-ui-row);
594
+ }
595
+ /* With a mark and a name it is as wide as they are, and the name a word's width from the mark, as the groups have theirs. */
596
+ & .nav-fold.nav-brand {
597
+ inline-size: auto;
598
+ column-gap: var(--s-unit);
599
+ padding-inline: calc(2 * var(--s-unit));
600
+ }
601
+ /* A name is a word's width from its pictogram, as in a line of text. */
602
+ & .nav-cell {
603
+ column-gap: var(--s-unit);
604
+ padding-inline: calc(2 * var(--s-unit));
605
+ }
606
+
607
+ /* The pressed group is what the pane hangs from. */
608
+ & > .navigator {
609
+ anchor-scope: --s-ui-group;
610
+ }
611
+ & .nav-bar > .nav-cell[aria-pressed="true"] {
612
+ anchor-name: --s-ui-group;
613
+ }
614
+
615
+ /*
616
+ * The places of the group shown hang under it, in a list read
617
+ * downwards. It is drawn down out of the bar, and back up into it: an
618
+ * edge moves, and nothing fades. It takes no room and moves nothing,
619
+ * like a menu, so it closes when a place is chosen.
620
+ */
621
+ & .nav-pane {
622
+ inset-block: 100% auto;
623
+ inset-inline: anchor(--s-ui-group left, 0px) auto;
624
+ position-try-fallbacks: flip-inline;
625
+ inline-size: var(--s-ui-pane);
626
+ block-size: auto;
627
+ max-block-size: min(var(--s-ui-drawer), 100dvb - var(--s-ui-row));
628
+ translate: none;
629
+ clip-path: inset(0 0 100% 0);
630
+ transition:
631
+ clip-path var(--s-move) var(--s-ease),
632
+ visibility var(--s-move);
633
+ }
634
+
635
+ &.state-open .nav-pane {
636
+ clip-path: inset(0);
637
+ }
638
+
639
+ /* Only the list of the group shown is in it: it is as long as that list, up to what the window has room for. */
640
+ & .nav-list {
641
+ block-size: auto;
642
+ max-block-size: inherit;
643
+ padding-block: 0 var(--s-unit);
644
+ }
645
+
646
+ & .nav-list:is(.is-before, .is-after) {
647
+ display: none;
648
+ }
649
+ }
650
+ }
651
+ }
652
+
653
+ @media print {
654
+ .navigator,
655
+ .nav-top {
656
+ display: none;
657
+ }
658
+ }
@@ -0,0 +1,39 @@
1
+ declare const styles: {
2
+ readonly "is-after": string;
3
+ readonly "is-before": string;
4
+ readonly "mode-sheet": string;
5
+ readonly "nav-back": string;
6
+ readonly "nav-bar": string;
7
+ readonly "nav-brand": string;
8
+ readonly "nav-cell": string;
9
+ readonly "nav-fold": string;
10
+ readonly "nav-here": string;
11
+ readonly "nav-list": string;
12
+ readonly "nav-lit": string;
13
+ readonly "nav-mark": string;
14
+ readonly "nav-name": string;
15
+ readonly "nav-pane": string;
16
+ readonly "nav-place": string;
17
+ readonly "nav-places": string;
18
+ readonly "nav-rows": string;
19
+ readonly "nav-rule": string;
20
+ readonly "nav-sign": string;
21
+ readonly "nav-tabs": string;
22
+ readonly "nav-top": string;
23
+ readonly "nav-way": string;
24
+ readonly "navigator": string;
25
+ readonly "place-side": string;
26
+ readonly "place-top": string;
27
+ readonly "shell": string;
28
+ readonly "shell-body": string;
29
+ readonly "state-open": string;
30
+ readonly "turn--135": string;
31
+ readonly "turn--45": string;
32
+ readonly "turn--90": string;
33
+ readonly "turn-135": string;
34
+ readonly "turn-180": string;
35
+ readonly "turn-45": string;
36
+ readonly "turn-90": string;
37
+ };
38
+ export = styles;
39
+