spell-ui 0.8.15 → 0.8.17

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 (285) hide show
  1. package/README-components.md +4 -2
  2. package/README-runtime.md +26 -1
  3. package/README.md +2 -1
  4. package/dist/SliderScale-DunjyaDW.js +67 -0
  5. package/dist/SliderScale-DunjyaDW.js.map +1 -0
  6. package/dist/{ThemeDraft-CyX3YA_L.js → ThemeDraft-spaNC2dD.js} +2 -2
  7. package/dist/{ThemeDraft-CyX3YA_L.js.map → ThemeDraft-spaNC2dD.js.map} +1 -1
  8. package/dist/{UIInput-B3K0w4ow.js → UIInput-8s1aiaw1.js} +2 -2
  9. package/dist/UIInput-8s1aiaw1.js.map +1 -0
  10. package/dist/{UIRuntime-DCv4sy30.js → UIRuntime-BaokNnwk.js} +900 -158
  11. package/dist/UIRuntime-BaokNnwk.js.map +1 -0
  12. package/dist/_spell-element/UIComponent.d.ts +7 -0
  13. package/dist/_spell-element/elements.types.d.ts +6 -0
  14. package/dist/_spell-element/vocabulary.types.d.ts +27 -0
  15. package/dist/_util/dom.d.ts +7 -0
  16. package/dist/components/components.es.d.ts +1 -0
  17. package/dist/components/ui-dial/DialArc.d.ts +43 -0
  18. package/dist/components/ui-dial/UIDial.d.ts +263 -0
  19. package/dist/components/ui-dial/UIDial.en.d.ts +149 -0
  20. package/dist/components/ui-dial/UIDial.es.d.ts +25 -0
  21. package/dist/components/ui-dial/UIDial.fallback.d.ts +167 -0
  22. package/dist/components/ui-dial/UIDial.types.d.ts +11 -0
  23. package/dist/components/ui-dial/index.d.ts +3 -0
  24. package/dist/components/ui-graph/UIGraph.d.ts +17 -0
  25. package/dist/components/ui-graph/UIGraph.en.d.ts +17 -0
  26. package/dist/components/ui-graph/UIGraph.es.d.ts +6 -0
  27. package/dist/components/ui-input/UIInput.d.ts +46 -3
  28. package/dist/components/ui-input/UIInput.en.d.ts +6 -1
  29. package/dist/components/ui-input/UIInput.es.d.ts +1 -0
  30. package/dist/components/ui-input/UIInput.fallback.d.ts +6 -1
  31. package/dist/components/ui-json/UIJson.d.ts +5 -4
  32. package/dist/components/ui-modal/ChoiceRows.d.ts +61 -0
  33. package/dist/components/ui-modal/ModalDialogs.d.ts +15 -1
  34. package/dist/components/ui-modal/UIModal.d.ts +6 -2
  35. package/dist/components/ui-modal/UIModal.en.d.ts +6 -2
  36. package/dist/components/ui-modal/UIModal.es.d.ts +1 -0
  37. package/dist/components/ui-page-layout/UIPageLayout.d.ts +141 -8
  38. package/dist/components/ui-page-layout/UIPageLayout.en.d.ts +51 -2
  39. package/dist/components/ui-page-layout/UIPageLayout.es.d.ts +3 -0
  40. package/dist/components/ui-property-editor/UIProperty.d.ts +2 -2
  41. package/dist/components/ui-site-links/UISiteLinks.d.ts +124 -0
  42. package/dist/components/ui-site-links/UISiteLinks.en.d.ts +60 -0
  43. package/dist/components/ui-site-links/UISiteLinks.es.d.ts +26 -0
  44. package/dist/components/ui-site-links/index.d.ts +1 -0
  45. package/dist/components/ui-site-nav-button/UISiteNavButton.d.ts +12 -5
  46. package/dist/components/ui-site-nav-button/UISiteNavButton.en.d.ts +32 -12
  47. package/dist/components/ui-site-nav-button/UISiteNavButton.es.d.ts +3 -0
  48. package/dist/components/ui-site-tabs/UISiteTabs.d.ts +13 -0
  49. package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +9 -0
  50. package/dist/components/ui-slider/SliderScale.d.ts +26 -2
  51. package/dist/components/ui-slider/UISlider.d.ts +0 -2
  52. package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
  53. package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
  54. package/dist/components/ui-toc/TocIndex.d.ts +16 -1
  55. package/dist/components/ui-toc/UIToc.d.ts +27 -3
  56. package/dist/components/ui-toc/UIToc.en.d.ts +1 -1
  57. package/dist/components/ui-toc/UIToc.types.d.ts +5 -0
  58. package/dist/components/ui-tree/UITree.d.ts +38 -2
  59. package/dist/components/ui-tree/UITree.en.d.ts +9 -0
  60. package/dist/components/ui-tree/UITree.es.d.ts +4 -0
  61. package/dist/components/ui-uploader/UIUploader.d.ts +721 -0
  62. package/dist/components/ui-uploader/UIUploader.en.d.ts +394 -0
  63. package/dist/components/ui-uploader/UIUploader.es.d.ts +112 -0
  64. package/dist/components/ui-uploader/index.d.ts +1 -0
  65. package/dist/{components.es-DilRG1VO.js → components.es-jY2nBwuP.js} +249 -65
  66. package/dist/components.es-jY2nBwuP.js.map +1 -0
  67. package/dist/core.js +605 -571
  68. package/dist/core.js.map +1 -1
  69. package/dist/docs-components/docs-components.types.d.ts +2 -0
  70. package/dist/index.d.ts +3 -0
  71. package/dist/index.js +101 -97
  72. package/dist/jsx.d.ts +1138 -21
  73. package/dist/runtime/DataTooltips.d.ts +10 -0
  74. package/dist/runtime/Modals.d.ts +7 -2
  75. package/dist/runtime/Styles.d.ts +7 -1
  76. package/dist/runtime/UIRuntime.d.ts +6 -0
  77. package/dist/runtime/runtime.types.d.ts +26 -1
  78. package/dist/sound-library/back.ogg +0 -0
  79. package/dist/sound-library/beep.ogg +0 -0
  80. package/dist/sound-library/bell.ogg +0 -0
  81. package/dist/sound-library/big-punch.ogg +0 -0
  82. package/dist/sound-library/bong.ogg +0 -0
  83. package/dist/sound-library/book-close.ogg +0 -0
  84. package/dist/sound-library/book-down.ogg +0 -0
  85. package/dist/sound-library/book-open.ogg +0 -0
  86. package/dist/sound-library/card-fan-2.ogg +0 -0
  87. package/dist/sound-library/card-fan.ogg +0 -0
  88. package/dist/sound-library/card-place-2.ogg +0 -0
  89. package/dist/sound-library/card-place-3.ogg +0 -0
  90. package/dist/sound-library/card-place.ogg +0 -0
  91. package/dist/sound-library/card-shove-2.ogg +0 -0
  92. package/dist/sound-library/card-shove.ogg +0 -0
  93. package/dist/sound-library/card-slide-2.ogg +0 -0
  94. package/dist/sound-library/card-slide-3.ogg +0 -0
  95. package/dist/sound-library/card-slide-4.ogg +0 -0
  96. package/dist/sound-library/card-slide.ogg +0 -0
  97. package/dist/sound-library/chip-down-2.ogg +0 -0
  98. package/dist/sound-library/chip-down.ogg +0 -0
  99. package/dist/sound-library/chips-collide.ogg +0 -0
  100. package/dist/sound-library/chips-handle.ogg +0 -0
  101. package/dist/sound-library/chips-stack-2.ogg +0 -0
  102. package/dist/sound-library/chips-stack.ogg +0 -0
  103. package/dist/sound-library/chop.ogg +0 -0
  104. package/dist/sound-library/click-2.ogg +0 -0
  105. package/dist/sound-library/click-3.ogg +0 -0
  106. package/dist/sound-library/click.ogg +0 -0
  107. package/dist/sound-library/close.ogg +0 -0
  108. package/dist/sound-library/cloth.ogg +0 -0
  109. package/dist/sound-library/coins-2.ogg +0 -0
  110. package/dist/sound-library/coins.ogg +0 -0
  111. package/dist/sound-library/confirm-2.ogg +0 -0
  112. package/dist/sound-library/confirm.ogg +0 -0
  113. package/dist/sound-library/creak.ogg +0 -0
  114. package/dist/sound-library/deck-open.ogg +0 -0
  115. package/dist/sound-library/deck-take-out.ogg +0 -0
  116. package/dist/sound-library/dice-grab.ogg +0 -0
  117. package/dist/sound-library/dice-shake-2.ogg +0 -0
  118. package/dist/sound-library/dice-shake.ogg +0 -0
  119. package/dist/sound-library/dice-throw-2.ogg +0 -0
  120. package/dist/sound-library/dice-throw.ogg +0 -0
  121. package/dist/sound-library/die-throw-2.ogg +0 -0
  122. package/dist/sound-library/die-throw.ogg +0 -0
  123. package/dist/sound-library/door-close.ogg +0 -0
  124. package/dist/sound-library/door-open.ogg +0 -0
  125. package/dist/sound-library/drop.ogg +0 -0
  126. package/dist/sound-library/error-2.ogg +0 -0
  127. package/dist/sound-library/error.ogg +0 -0
  128. package/dist/sound-library/fail.ogg +0 -0
  129. package/dist/sound-library/fall.ogg +0 -0
  130. package/dist/sound-library/glass-break.ogg +0 -0
  131. package/dist/sound-library/glass-clink.ogg +0 -0
  132. package/dist/sound-library/glass-tap.ogg +0 -0
  133. package/dist/sound-library/glass.ogg +0 -0
  134. package/dist/sound-library/glitch.ogg +0 -0
  135. package/dist/sound-library/grow.ogg +0 -0
  136. package/dist/sound-library/high-up.ogg +0 -0
  137. package/dist/sound-library/hover-2.ogg +0 -0
  138. package/dist/sound-library/hover.ogg +0 -0
  139. package/dist/sound-library/jingle-2.ogg +0 -0
  140. package/dist/sound-library/jingle-3.ogg +0 -0
  141. package/dist/sound-library/jingle-4.ogg +0 -0
  142. package/dist/sound-library/jingle.ogg +0 -0
  143. package/dist/sound-library/jump.ogg +0 -0
  144. package/dist/sound-library/knife-draw.ogg +0 -0
  145. package/dist/sound-library/knife-slice.ogg +0 -0
  146. package/dist/sound-library/laser-2.ogg +0 -0
  147. package/dist/sound-library/laser.ogg +0 -0
  148. package/dist/sound-library/latch.ogg +0 -0
  149. package/dist/sound-library/level-up.ogg +0 -0
  150. package/dist/sound-library/lose-2.ogg +0 -0
  151. package/dist/sound-library/lose-3.ogg +0 -0
  152. package/dist/sound-library/lose-4.ogg +0 -0
  153. package/dist/sound-library/lose.ogg +0 -0
  154. package/dist/sound-library/low-down.ogg +0 -0
  155. package/dist/sound-library/metal-clang.ogg +0 -0
  156. package/dist/sound-library/metal-click.ogg +0 -0
  157. package/dist/sound-library/metal-crash.ogg +0 -0
  158. package/dist/sound-library/metal-tap.ogg +0 -0
  159. package/dist/sound-library/mouse-click.ogg +0 -0
  160. package/dist/sound-library/mouse-release.ogg +0 -0
  161. package/dist/sound-library/open.ogg +0 -0
  162. package/dist/sound-library/orchestra-hit-2.ogg +0 -0
  163. package/dist/sound-library/orchestra-hit.ogg +0 -0
  164. package/dist/sound-library/page-turn-2.ogg +0 -0
  165. package/dist/sound-library/page-turn.ogg +0 -0
  166. package/dist/sound-library/pickaxe.ogg +0 -0
  167. package/dist/sound-library/piece-down-2.ogg +0 -0
  168. package/dist/sound-library/piece-down-3.ogg +0 -0
  169. package/dist/sound-library/piece-down.ogg +0 -0
  170. package/dist/sound-library/piece-take-2.ogg +0 -0
  171. package/dist/sound-library/piece-take.ogg +0 -0
  172. package/dist/sound-library/piece-tap-2.ogg +0 -0
  173. package/dist/sound-library/piece-tap.ogg +0 -0
  174. package/dist/sound-library/plank.ogg +0 -0
  175. package/dist/sound-library/plate.ogg +0 -0
  176. package/dist/sound-library/pluck.ogg +0 -0
  177. package/dist/sound-library/pot.ogg +0 -0
  178. package/dist/sound-library/power-up-2.ogg +0 -0
  179. package/dist/sound-library/power-up-3.ogg +0 -0
  180. package/dist/sound-library/power-up.ogg +0 -0
  181. package/dist/sound-library/punch.ogg +0 -0
  182. package/dist/sound-library/question.ogg +0 -0
  183. package/dist/sound-library/rise.ogg +0 -0
  184. package/dist/sound-library/scratch.ogg +0 -0
  185. package/dist/sound-library/scroll.ogg +0 -0
  186. package/dist/sound-library/select-2.ogg +0 -0
  187. package/dist/sound-library/select.ogg +0 -0
  188. package/dist/sound-library/shrink.ogg +0 -0
  189. package/dist/sound-library/shuffle.ogg +0 -0
  190. package/dist/sound-library/soft-thud-2.ogg +0 -0
  191. package/dist/sound-library/soft-thud.ogg +0 -0
  192. package/dist/sound-library/space-junk.ogg +0 -0
  193. package/dist/sound-library/step-2.ogg +0 -0
  194. package/dist/sound-library/step-on-carpet.ogg +0 -0
  195. package/dist/sound-library/step-on-grass.ogg +0 -0
  196. package/dist/sound-library/step-on-snow.ogg +0 -0
  197. package/dist/sound-library/step-on-stone.ogg +0 -0
  198. package/dist/sound-library/step-on-wood.ogg +0 -0
  199. package/dist/sound-library/step.ogg +0 -0
  200. package/dist/sound-library/switch-2.ogg +0 -0
  201. package/dist/sound-library/switch.ogg +0 -0
  202. package/dist/sound-library/tap-2.ogg +0 -0
  203. package/dist/sound-library/tap.ogg +0 -0
  204. package/dist/sound-library/three-tones.ogg +0 -0
  205. package/dist/sound-library/tick-2.ogg +0 -0
  206. package/dist/sound-library/tick.ogg +0 -0
  207. package/dist/sound-library/tin.ogg +0 -0
  208. package/dist/sound-library/toggle-2.ogg +0 -0
  209. package/dist/sound-library/toggle.ogg +0 -0
  210. package/dist/sound-library/two-tones.ogg +0 -0
  211. package/dist/sound-library/win-2.ogg +0 -0
  212. package/dist/sound-library/win-3.ogg +0 -0
  213. package/dist/sound-library/win-4.ogg +0 -0
  214. package/dist/sound-library/win.ogg +0 -0
  215. package/dist/sound-library/wood-thud.ogg +0 -0
  216. package/dist/sound-library/zap.ogg +0 -0
  217. package/dist/sounds/BuiltInSounds.d.ts +41 -0
  218. package/dist/sounds/index.d.ts +9 -0
  219. package/dist/sounds/sounds.types.d.ts +22 -0
  220. package/dist/ui-calendar.js +1 -1
  221. package/dist/ui-dial.editor-CjjdKi5L.js +5 -0
  222. package/dist/ui-dial.editor-CjjdKi5L.js.map +1 -0
  223. package/dist/ui-dial.js +467 -0
  224. package/dist/ui-dial.js.map +1 -0
  225. package/dist/ui-graph.js +22 -0
  226. package/dist/ui-graph.js.map +1 -1
  227. package/dist/{ui-input.editor-budoNoB0.js → ui-input.editor-D11iRgXR.js} +2 -2
  228. package/dist/ui-input.editor-D11iRgXR.js.map +1 -0
  229. package/dist/ui-input.js +84 -54
  230. package/dist/ui-input.js.map +1 -1
  231. package/dist/ui-json.js +8 -8
  232. package/dist/ui-json.js.map +1 -1
  233. package/dist/ui-modal.js +183 -97
  234. package/dist/ui-modal.js.map +1 -1
  235. package/dist/ui-page-layout.editor-IgDEveUY.js +5 -0
  236. package/dist/ui-page-layout.editor-IgDEveUY.js.map +1 -0
  237. package/dist/ui-page-layout.js +217 -72
  238. package/dist/ui-page-layout.js.map +1 -1
  239. package/dist/ui-popup.js +34 -34
  240. package/dist/ui-popup.js.map +1 -1
  241. package/dist/ui-property-editor.js +7 -4
  242. package/dist/ui-property-editor.js.map +1 -1
  243. package/dist/ui-root.js +71 -5
  244. package/dist/ui-root.js.map +1 -1
  245. package/dist/ui-search.js +1 -1
  246. package/dist/ui-section.js +97 -96
  247. package/dist/ui-section.js.map +1 -1
  248. package/dist/ui-site-links.editor-BME3sw5H.js +5 -0
  249. package/dist/ui-site-links.editor-BME3sw5H.js.map +1 -0
  250. package/dist/ui-site-links.js +150 -0
  251. package/dist/ui-site-links.js.map +1 -0
  252. package/dist/ui-site-nav-button.editor-ChY4xe1U.js +5 -0
  253. package/dist/ui-site-nav-button.editor-ChY4xe1U.js.map +1 -0
  254. package/dist/ui-site-nav-button.js +57 -18
  255. package/dist/ui-site-nav-button.js.map +1 -1
  256. package/dist/{ui-site-tabs.editor-DDvQfH6S.js → ui-site-tabs.editor-CdMIw4jw.js} +2 -2
  257. package/dist/ui-site-tabs.editor-CdMIw4jw.js.map +1 -0
  258. package/dist/ui-site-tabs.js +30 -14
  259. package/dist/ui-site-tabs.js.map +1 -1
  260. package/dist/ui-slider.js +75 -124
  261. package/dist/ui-slider.js.map +1 -1
  262. package/dist/ui-statistic.js +1 -0
  263. package/dist/ui-statistic.js.map +1 -1
  264. package/dist/ui-theme-editor.js +2 -2
  265. package/dist/{ui-theme-menu-BZYUMrHe.js → ui-theme-menu-BEBu6dyq.js} +3 -3
  266. package/dist/{ui-theme-menu-BZYUMrHe.js.map → ui-theme-menu-BEBu6dyq.js.map} +1 -1
  267. package/dist/ui-toc.js +159 -122
  268. package/dist/ui-toc.js.map +1 -1
  269. package/dist/ui-tree.js +142 -87
  270. package/dist/ui-tree.js.map +1 -1
  271. package/dist/ui-uploader.editor-DrE80KjL.js +5 -0
  272. package/dist/ui-uploader.editor-DrE80KjL.js.map +1 -0
  273. package/dist/ui-uploader.js +1442 -0
  274. package/dist/ui-uploader.js.map +1 -0
  275. package/dist/vocabulary/hooks.generated.d.ts +7 -0
  276. package/package.json +1 -1
  277. package/dist/UIInput-B3K0w4ow.js.map +0 -1
  278. package/dist/UIRuntime-DCv4sy30.js.map +0 -1
  279. package/dist/components.es-DilRG1VO.js.map +0 -1
  280. package/dist/ui-input.editor-budoNoB0.js.map +0 -1
  281. package/dist/ui-page-layout.editor-xtQW0FZk.js +0 -5
  282. package/dist/ui-page-layout.editor-xtQW0FZk.js.map +0 -1
  283. package/dist/ui-site-nav-button.editor-6J-zJLtZ.js +0 -5
  284. package/dist/ui-site-nav-button.editor-6J-zJLtZ.js.map +0 -1
  285. package/dist/ui-site-tabs.editor-DDvQfH6S.js.map +0 -1
@@ -0,0 +1,150 @@
1
+ import "./rolldown-runtime-c6e9CmGy.js";
2
+ import { Gt as e, Jt as t, Kt as n, UIComponent as r, Ut as i, Wt as a, Yt as o, cssState as s, derived as c, proto as l, protoMerged as u, qt as d, state as f, whileConnected as p } from "./core.js";
3
+ import { t as m } from "./SitePages-B3zd5Zgu.js";
4
+ import "./ui-button.js";
5
+ import { Show as h } from "solid-js";
6
+ import { className as g, createComponent as _, effect as v, getOwner as y, insert as b, isServer as x, readShallow as S, setAttribute as C, template as w } from "@solidjs/web";
7
+ // src/components/ui-site-links/UISiteLinks.en.ts
8
+ var T = {
9
+ tag: "ui-site-links",
10
+ icon: "up right from square",
11
+ topics: ["navigation", "menus"],
12
+ aka: [
13
+ "page links",
14
+ "page actions",
15
+ "report a bug",
16
+ "original page",
17
+ "edit this page",
18
+ "external links"
19
+ ],
20
+ noun: "site links",
21
+ partOfSpeech: "structure",
22
+ description: "Site links are the page shown's own links, for an app menu's end: the real page it stands for (its `live` link, Fomantic UI's original for Spell UI's pages), and a way to report a problem with it.",
23
+ attributes: [
24
+ {
25
+ name: "pages",
26
+ group: "content",
27
+ kind: "json",
28
+ reflect: !1,
29
+ description: "The site's pages, nested as the side navigation nests them: the same `pages` `<ui-site-nav>` takes, each `{ title, href, id?, live?, pages? }`, e.g. `[{ \"title\": \"Button\", \"href\": \"/button\", \"live\": \"https://fomantic-ui.com/elements/button.html\" }]`. `live` is the real page a page stands for: the page shown's own, else the nearest one above it."
30
+ },
31
+ {
32
+ name: "current",
33
+ group: "content",
34
+ kind: "string",
35
+ description: "Which page is shown: its `href` or its `id`. None: the page whose `href` is the browser's address."
36
+ },
37
+ {
38
+ name: "report",
39
+ group: "link",
40
+ kind: "string",
41
+ description: "Where to report a problem with the page shown: an address, `{title}` in it standing for the title of the page at the top of its family, e.g. `https://github.com/spell-app/spell-ui/issues/new?title={title}`. None: no report link."
42
+ }
43
+ ],
44
+ events: [],
45
+ slots: [],
46
+ parts: [
47
+ {
48
+ name: "links",
49
+ description: "The row of links."
50
+ },
51
+ {
52
+ name: "original",
53
+ description: "The link to the real page the page shown stands for (its `live`)."
54
+ },
55
+ {
56
+ name: "report",
57
+ description: "The link to report a problem with the page shown."
58
+ }
59
+ ],
60
+ states: [{
61
+ name: "empty",
62
+ description: "No link to draw for the page shown: it takes no room."
63
+ }],
64
+ texts: [{
65
+ key: "original",
66
+ text: "The original page",
67
+ description: "The original's name, its tooltip and its name for a screen reader."
68
+ }, {
69
+ key: "report",
70
+ text: "Report a bug",
71
+ description: "The report link's name, its tooltip and its name for a screen reader."
72
+ }]
73
+ }, E = "@layer ui.components{:host{align-items:center;min-width:0;display:flex}:host(:state(empty)){display:none}.links{align-items:center;gap:4px;display:flex}}", D = /* @__PURE__ */ w("<div><!><!>"), O = /* @__PURE__ */ w("<ui-button>", 1), k, A, j, M, N, P, F, I, L, R, z = class _UISiteLinks extends (I = r, F = [l], P = [u], N = [c], M = [f], j = [p], A = [c], k = [s("empty")], I) {
74
+ constructor() {
75
+ super(...arguments), o(L, 5, this), d(this, R, o(L, 8, this)), o(L, 11, this);
76
+ }
77
+ get sitePages() {
78
+ return m.wellFormed(this.isFollowing ? this.followed?.pages : this.pages);
79
+ }
80
+ get currentKey() {
81
+ return this.current ?? (this.isFollowing ? this.followed?.current : void 0) ?? (x ? "" : location.pathname);
82
+ }
83
+ get isFollowing() {
84
+ return this.pages === void 0;
85
+ }
86
+ followSiteNav() {
87
+ let e = m.followNavAround(this.domElement, (e) => this.followed = e);
88
+ return () => {
89
+ e?.(), this.followed = void 0;
90
+ };
91
+ }
92
+ get pathToShown() {
93
+ let e = this.currentKey, t = /* @__PURE__ */ n((n) => {
94
+ for (let r of n) {
95
+ if (r.copyOf) continue;
96
+ if (m.isShown(r, e)) return [r];
97
+ let n = t(r.pages ?? []);
98
+ if (n) return [r, ...n];
99
+ }
100
+ }, "walk");
101
+ return t(this.sitePages) ?? [];
102
+ }
103
+ get originalLink() {
104
+ return this.pathToShown.findLast((e) => e.live)?.live;
105
+ }
106
+ get reportLink() {
107
+ let e = this.pathToShown.find((e) => e.band !== V);
108
+ if (this.report && e) return this.report.replaceAll(H, encodeURIComponent(e.title));
109
+ }
110
+ get isEmpty() {
111
+ return !this.originalLink && !this.reportLink;
112
+ }
113
+ render() {
114
+ let e = this;
115
+ var t = D(), n = t.firstChild, r = n.nextSibling;
116
+ return b(t, _(h, {
117
+ get when() {
118
+ return e.originalLink;
119
+ },
120
+ children: (t) => e.button("original", W, t())
121
+ }), n), b(t, _(h, {
122
+ get when() {
123
+ return e.reportLink;
124
+ },
125
+ children: (t) => e.button("report", G, t())
126
+ }), r), v(() => ({
127
+ e: S(U),
128
+ t: e.partForName("links")
129
+ }), ({ e, t: n }, r) => {
130
+ g(t, e, r?.e), n !== r?.t && C(t, "part", n);
131
+ }), t;
132
+ }
133
+ button(e, t, n) {
134
+ let r = this.translationForKey(e), i = this;
135
+ var a = O();
136
+ return C(a, "icon", t), C(a, "appearance", K), C(a, "size", q), C(a, "link", n), C(a, "target", J), C(a, "aria-label", r), C(a, "title", r), a._$owner = y(), v(() => i.partForName(e), (e) => {
137
+ C(a, "part", e);
138
+ }), a;
139
+ }
140
+ };
141
+ L = e(I), R = /* @__PURE__ */ new WeakMap(), i(L, 2, "sitePages", N, z), i(L, 4, "followed", M, z, R), i(L, 1, "followSiteNav", j, z), i(L, 2, "pathToShown", A, z), i(L, 2, "isEmpty", k, z), i(L, 13, "vocabulary", F, z), i(L, 13, "elementSetup", P, z), a(L, z), n(z, "UISiteLinks"), t(z, "vocabulary", o(L, 12, z, T)), o(L, 15, z), t(z, "elementSetup", o(L, 16, z, {
142
+ styleSheets: { "site-links": E },
143
+ delegatesFocus: !1
144
+ })), o(L, 19, z);
145
+ var B = z, V = "group", H = "{title}", U = "links", W = "up right from square", G = "bug", K = "tertiary", q = "small", J = "_blank";
146
+ // src/components/ui-site-links/index.ts
147
+ B.define();
148
+ export { B as UISiteLinks };
149
+
150
+ //# sourceMappingURL=ui-site-links.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-site-links.js","names":["<Show when={this.originalLink}>{(link) => this.button(\"original\", ORIGINAL_ICON, link())}</Show>","this","<div class={LINKS} part={this.partForName(\"links\")}>\n <Show when={this.originalLink}>{(link) => this.button(\"original\", ORIGINAL_ICON, link())}</Show>\n <Show when={this.reportLink}>{(link) => this.button(\"report\", REPORT_ICON, link())}</Show>\n </div>","<Show when={this.reportLink}>{(link) => this.button(\"report\", REPORT_ICON, link())}</Show>","part={this.partForName(\"links\")}","<ui-button\n part={this.partForName(name)}\n icon={icon}\n appearance={TERTIARY}\n size={SMALL}\n link={link}\n target={NEW_TAB}\n aria-label={words}\n title={words}\n />","E.UIComponent","E.proto","E.protoMerged","E.derived","E.state","E.whileConnected","E.cssState","_$readShallow","_$setAttribute","_$getOwner","__name","siteLinksCSS","__decoratorStart","__publicField","__name$1","__decorateElement","__decoratorMetadata","__runInitializers","__privateAdd","SitePages","getOwner$1","siteLinksVocabulary","UISiteLinks_default","_tmpl$","_tmpl$2","_isEmpty_dec","_pathToShown_dec","_followSiteNav_dec","_followed_dec","_sitePages_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_followed","_UISiteLinks","UIComponent","proto","protoMerged","derived","state","whileConnected","cssState","isServer","stop","followed","key","walk","page","pages","below","top","GROUP","TITLE_MARK","_self$","_el$","_el$2","_el$3","insert","createComponent","Show","ORIGINAL_ICON","link","REPORT_ICON","effect","readShallow","LINKS","className","_p$","t","setAttribute","words","name","_self$2","_el$4","icon","TERTIARY","SMALL","NEW_TAB","_v$","UISiteLinks"],"sources":["../src/components/ui-site-links/UISiteLinks.en.ts","../src/components/ui-site-links/UISiteLinks.tsx","../src/components/ui-site-links/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-site-links>`: every name the tag uses.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n */\n\nimport type { E } from \"spell/ui/core\"\n\n/****************\n * ### `siteLinksVocabulary`\n * The names of `<ui-site-links>`: the page shown's own links, for an app menu's end, drawn from the side\n * navigation's own pages.\n ****************/\nexport const siteLinksVocabulary = {\n tag: \"ui-site-links\",\n icon: \"up right from square\",\n topics: [\"navigation\", \"menus\"],\n aka: [\"page links\", \"page actions\", \"report a bug\", \"original page\", \"edit this page\", \"external links\"],\n noun: \"site links\",\n partOfSpeech: \"structure\",\n description:\n \"Site links are the page shown's own links, for an app menu's end: the real page it stands for (its `live` \" +\n \"link, Fomantic UI's original for Spell UI's pages), and a way to report a problem with it.\",\n attributes: [\n {\n name: \"pages\",\n group: \"content\",\n kind: \"json\",\n reflect: false,\n description:\n \"The site's pages, nested as the side navigation nests them: the same `pages` `<ui-site-nav>` takes, each \" +\n '`{ title, href, id?, live?, pages? }`, e.g. `[{ \"title\": \"Button\", \"href\": \"/button\", \"live\": ' +\n '\"https://fomantic-ui.com/elements/button.html\" }]`. `live` is the real page a page stands for: the page ' +\n \"shown's own, else the nearest one above it.\"\n },\n {\n name: \"current\",\n group: \"content\",\n kind: \"string\",\n description:\n \"Which page is shown: its `href` or its `id`. None: the page whose `href` is the browser's address.\"\n },\n {\n name: \"report\",\n group: \"link\",\n kind: \"string\",\n description:\n \"Where to report a problem with the page shown: an address, `{title}` in it standing for the title of the \" +\n \"page at the top of its family, e.g. `https://github.com/spell-app/spell-ui/issues/new?title={title}`. \" +\n \"None: no report link.\"\n }\n ],\n events: [],\n slots: [],\n parts: [\n { name: \"links\", description: \"The row of links.\" },\n { name: \"original\", description: \"The link to the real page the page shown stands for (its `live`).\" },\n { name: \"report\", description: \"The link to report a problem with the page shown.\" }\n ],\n states: [{ name: \"empty\", description: \"No link to draw for the page shown: it takes no room.\" }],\n texts: [\n {\n key: \"original\",\n text: \"The original page\",\n description: \"The original's name, its tooltip and its name for a screen reader.\"\n },\n {\n key: \"report\",\n text: \"Report a bug\",\n description: \"The report link's name, its tooltip and its name for a screen reader.\"\n }\n ]\n} as const satisfies E.ComponentVocabulary\n","import { Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E } from \"spell/ui/core\"\nimport { SitePages, type FollowedSiteNav, type SitePage } from \"spell/ui/components/ui-site-nav/SitePages\"\nimport { siteLinksVocabulary } from \"./UISiteLinks.en\"\n\nimport siteLinksCSS from \"./UISiteLinks.css?inline\"\n\n/****************\n * ### `<ui-site-links>`\n * The component behind `<ui-site-links>`: the page shown's own links, for an app menu's end (epic `mockup` T55).\n * It takes the same `pages` and `current` as `<ui-site-nav>`, and draws a row of small icon buttons:\n *\n * <div class=\"links\" part=\"links\">\n * <ui-button part=\"original\" icon=\"up right from square\" link=\"https://fomantic-ui.com/...\" target=\"_blank\">\n * <ui-button part=\"report\" icon=\"bug\" link=\"https://github.com/.../issues/new?title=Button\" target=\"_blank\">\n * </div>\n *\n * - The original: the real page the page shown stands for, its `live` link, else the nearest page above it with one\n * (Owen, 2026-11-17: Spell UI's pages link Fomantic's, as its docs site's do).\n * - The report: `report`, with `{title}` standing for the title of the page at the top of the family shown\n * (`Button` on Button's API page), as a link's text: none without `report`.\n * - Both open in a new tab. Nothing to show: nothing draws, `:state(empty)`.\n * - Plain data in, no fetching: `pages` and `current`, set on it by hand.\n * - Without `pages`, it follows the site navigation it's inside, as `<ui-site-breadcrumbs>` does\n * (`SitePages.followNavAround()`): a Spell site's layout writes a bare `<site-links report=\"...\"/>`.\n ****************/\nexport class UISiteLinks extends E.UIComponent<typeof siteLinksVocabulary> {\n @E.proto static vocabulary = siteLinksVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { \"site-links\": siteLinksCSS },\n delegatesFocus: false\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## The pages\n ////////////////\n\n /** `pages`, else the site navigation's, the well-formed ones: each with a `title`, its pages checked the same way. */\n @E.derived\n get sitePages(): readonly SiteLinksPage[] {\n return SitePages.wellFormed(this.isFollowing ? this.followed?.pages : this.pages)\n }\n\n /** Which page is shown: `current`, else the site navigation's while following it, else the browser's address. */\n get currentKey(): string {\n const current = this.current ?? (this.isFollowing ? this.followed?.current : undefined)\n return current ?? (isServer ? \"\" : location.pathname)\n }\n\n /** The site navigation's `pages` and `current`, while it's inside one; `undefined` outside any. */\n @E.state accessor followed: FollowedSiteNav | undefined = undefined\n\n /** It has no `pages` of its own, so it shows the site navigation's. */\n get isFollowing(): boolean {\n return this.pages === undefined\n }\n\n /**\n * While connected: follow the site navigation around it (`SitePages.followNavAround()`).\n * - Nothing around it: nothing to follow, and it draws only what it's given.\n */\n @E.whileConnected\n protected followSiteNav() {\n const stop = SitePages.followNavAround(this.domElement, (followed) => (this.followed = followed))\n return () => {\n stop?.()\n this.followed = undefined\n }\n }\n\n /** The pages from the top down to the page shown, it last; empty when it isn't among them. */\n @E.derived\n get pathToShown(): readonly SiteLinksPage[] {\n const key = this.currentKey\n const walk = (pages: readonly SiteLinksPage[]): SiteLinksPage[] | undefined => {\n for (const page of pages) {\n if (page.copyOf) continue\n if (SitePages.isShown(page, key)) return [page]\n const below = walk(page.pages ?? [])\n if (below) return [page, ...below]\n }\n return undefined\n }\n return walk(this.sitePages) ?? []\n }\n\n ////////////////\n // ## The links\n ////////////////\n\n /** The real page the page shown stands for: its own `live`, else the nearest page's above it. */\n get originalLink(): string | undefined {\n return this.pathToShown.findLast((page) => page.live)?.live\n }\n\n /**\n * Where to report a problem with the page shown: `report`, its `{title}` the family's top page's title;\n * none without `report`, or with no page shown.\n * - The family's top: the first page in the path that's a page, not a group's name.\n */\n get reportLink(): string | undefined {\n const top = this.pathToShown.find((page) => page.band !== GROUP)\n if (!this.report || !top) return undefined\n return this.report.replaceAll(TITLE_MARK, encodeURIComponent(top.title))\n }\n\n /** No link to draw: `:state(empty)`, which takes no room. */\n @E.cssState(\"empty\")\n get isEmpty(): boolean {\n return !this.originalLink && !this.reportLink\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n render(): JSX.Element {\n return (\n <div class={LINKS} part={this.partForName(\"links\")}>\n <Show when={this.originalLink}>{(link) => this.button(\"original\", ORIGINAL_ICON, link())}</Show>\n <Show when={this.reportLink}>{(link) => this.button(\"report\", REPORT_ICON, link())}</Show>\n </div>\n )\n }\n\n /** One link: a small tertiary icon button opening `link` in a new tab, named by its words. */\n private button(name: \"original\" | \"report\", icon: string, link: string): JSX.Element {\n const words = this.translationForKey(name)\n return (\n <ui-button\n part={this.partForName(name)}\n icon={icon}\n appearance={TERTIARY}\n size={SMALL}\n link={link}\n target={NEW_TAB}\n aria-label={words}\n title={words}\n />\n )\n }\n}\n\n/** The vocabulary getters, typed (`UIComponent`'s doc). */\nexport interface UISiteLinks extends E.AttributeValues<typeof siteLinksVocabulary> {}\n\n/** One page of a site, as `<ui-site-links pages>` takes it: the same list `<ui-site-nav>` takes. */\nexport type SiteLinksPage = Omit<SitePage, \"pages\"> & {\n /** the real page it stands for: `https://fomantic-ui.com/elements/button.html` */\n live?: string\n /** `group`: a group's name over its pages */\n band?: string\n /** the `id` of the page this is a second copy of (a favourite): never the way down */\n copyOf?: string\n /** the pages under it */\n pages?: readonly SiteLinksPage[]\n}\n\n/** The `band` of a group's name over its pages: a Spell site's groups. */\nconst GROUP = \"group\"\n\n/** What `report` writes for the family's title. */\nconst TITLE_MARK = \"{title}\"\n\n/** Its box's class word. */\nconst LINKS = \"links\"\n\n/** Its links' icons: the docs site's own. */\nconst ORIGINAL_ICON = \"up right from square\"\nconst REPORT_ICON = \"bug\"\n\n/** Its links' look: an app menu's end buttons'. */\nconst TERTIARY = \"tertiary\"\nconst SMALL = \"small\"\n\n/** A link's `target`: a new tab. */\nconst NEW_TAB = \"_blank\"\n","/**\n * The site links family: defines `<ui-site-links>`, and exports its component.\n * - SIDE EFFECT: importing it defines the tag, and the buttons it draws its links with.\n * - Also the library's `spell/ui/ui-site-links` entry.\n */\n\nimport { UISiteLinks } from \"./UISiteLinks\"\n\nimport \"spell/ui/components/ui-button\"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,GAwBOD,CAAA,GAYlBnB,EAAAkB,GAAA,GAAU,iBADVN,GAnCWQ,CAAA,GA8CXpB,EAAAkB,GAAA,GAAI,eADJP,GA7CWS,CAAA,GAkFXpB,EAAAkB,GAAA,GAAI,WADJR,GAjFWU,CAAA,GACFpB,EAAAkB,GAAA,IAAO,cAAhBF,GADWI,CAAA,GAEIpB,EAAAkB,GAAA,IAAO,gBAAtBH,GAFWK,CAAA,GAANnB,EAAAiB,GAAME,CAAA,GAA8DzB,EAAAyB,GAAA,aAAA,GAChEtB,EADEsB,GACK,cAAalB,EAApBgB,GAAA,IADEE,GACkBd,CAAA,CAAA,GAApBJ,EAAAgB,GAAA,IADEE,CAAA,GAEItB,EAFJsB,GAEW,gBAAelB,EAAtBgB,GAAA,IAFJE,GAE0B;CACnC,aAAa,EAAE,cAAcxB,EAAa;CAC1C,gBAAgB;AAClB,CAAA,CAAA,GAHeM,EAAAgB,GAAA,IAFJE,CAAA;AAAN,IAAM6C,IAAN7C,GAqIDiB,IAAQ,SAGRC,IAAa,WAGba,IAAQ,SAGRL,IAAgB,wBAChBE,IAAc,OAGda,IAAW,YACXC,IAAQ,SAGRC,IAAU;;ACxKhBE,EAAY,OAAO"}
@@ -0,0 +1,5 @@
1
+ // src/components/ui-site-nav-button/ui-site-nav-button.editor.html?raw
2
+ var e = "<!-- <ui-site-nav-button>'s property editor layout: move, pair (<ui-fields>) or leave out (data-omit) its properties. How: Spell UI's AGENTS.md, \"Property editor layouts\". -->\n<ui-property-editor schema=\"ui-site-nav-button\" data-omit=\"\">\n <ui-property-group label=\"Name\" data-group=\"name\">\n <ui-property name=\"label\"></ui-property>\n </ui-property-group>\n <ui-property-group label=\"Behaviour\" data-group=\"behaviour\">\n <ui-property name=\"toggles\"></ui-property>\n </ui-property-group>\n <ui-property-group label=\"Content\" data-group=\"content\">\n <ui-property name=\"description\"></ui-property>\n <ui-property name=\"icon\"></ui-property>\n <ui-property name=\"image\"></ui-property>\n <ui-property name=\"flag\"></ui-property>\n <ui-property name=\"kind\"></ui-property>\n </ui-property-group>\n <ui-property-group label=\"Appearance\" data-group=\"appearance\">\n <ui-property name=\"color\"></ui-property>\n <ui-property name=\"appearance\"></ui-property>\n </ui-property-group>\n <ui-property-group label=\"Layout\" data-group=\"layout\">\n <ui-property name=\"position\"></ui-property>\n <ui-property name=\"padding\"></ui-property>\n </ui-property-group>\n <ui-property-group label=\"States\" data-group=\"states\">\n <ui-property name=\"disabled\"></ui-property>\n <ui-property name=\"selected\"></ui-property>\n </ui-property-group>\n <ui-property-group label=\"Form\" data-group=\"form\">\n <ui-property name=\"value\"></ui-property>\n </ui-property-group>\n <ui-property-group label=\"Link\" data-group=\"link\">\n <ui-property name=\"link\"></ui-property>\n <ui-property name=\"target\"></ui-property>\n </ui-property-group>\n</ui-property-editor>\n";
3
+ export { e as default };
4
+
5
+ //# sourceMappingURL=ui-site-nav-button.editor-ChY4xe1U.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-site-nav-button.editor-ChY4xe1U.js","names":["ui_site_nav_button_editor_default"],"sources":[],"mappings":""}
@@ -23,37 +23,74 @@ var S = {
23
23
  "sidebar toggle"
24
24
  ],
25
25
  skeleton: "inline 2.5 x 2.5",
26
- description: "A site nav button shows or hides the side navigation of the page layout around it: its icons only and back on a wide page, slid in and out on a narrow one. It's an item, for an app menu.",
27
- texts: [{
28
- key: "label",
29
- text: "Show or hide the side bar",
30
- description: "What it's called, its tooltip and its name for a screen reader, without `aria-label`."
31
- }, {
32
- key: "menuLabel",
33
- text: "Show or hide the menu",
34
- description: "What it's called at a narrow width, where the drawer is hidden until it slides in: its icon the menu's (`bars`)."
35
- }]
26
+ description: "A site nav button shows or hides the side navigation of the page layout around it: its icons only and back on a wide page, slid in and out on a narrow one; or one of its side bars (`toggles`). It's an item, for an app menu.",
27
+ attributes: [...m.attributes, {
28
+ name: "toggles",
29
+ group: "behaviour",
30
+ kind: "valueOnly",
31
+ values: [
32
+ "drawer",
33
+ "left",
34
+ "right"
35
+ ],
36
+ default: "drawer",
37
+ classes: {
38
+ drawer: "",
39
+ left: "",
40
+ right: ""
41
+ },
42
+ description: "What it shows and hides: the layout's `drawer` (its side navigation), or its `left` or `right` side bar. With one for a side bar, a narrow layout hides that side bar behind it."
43
+ }],
44
+ texts: [
45
+ {
46
+ key: "label",
47
+ text: "Show or hide the side bar",
48
+ description: "What it's called, its tooltip and its name for a screen reader, without `aria-label`."
49
+ },
50
+ {
51
+ key: "leftLabel",
52
+ text: "Show or hide the left side bar",
53
+ description: "What it's called with `toggles=\"left\"`, without `aria-label`."
54
+ },
55
+ {
56
+ key: "rightLabel",
57
+ text: "Show or hide the right side bar",
58
+ description: "What it's called with `toggles=\"right\"`, without `aria-label`."
59
+ },
60
+ {
61
+ key: "menuLabel",
62
+ text: "Show or hide the menu",
63
+ description: "What it's called at a narrow width, where the drawer is hidden until it slides in: its icon the menu's (`bars`)."
64
+ }
65
+ ]
36
66
  }, C = "@layer ui.components{:host(:state(in-menu))>.item{margin-inline:.64286em -1.14286em;padding-inline:.5em}}", w = /* @__PURE__ */ x("<ui-button>", 1), T, E, D, O, k, A, j, M, N = class _UISiteNavButton extends (A = p, k = [c], O = [l], D = [d], E = [f], T = [s("click")], A) {
37
67
  constructor() {
38
68
  super(...arguments), a(j, 5, this), u(this, M, a(j, 8, this)), a(j, 11, this);
39
69
  }
40
70
  findLayout() {
41
- return this.layout = o(this.domElement, L) ?? void 0, () => this.layout = void 0;
71
+ return this.layout = o(this.domElement, V) ?? void 0, () => this.layout = void 0;
42
72
  }
43
73
  get layoutComponent() {
44
74
  return this.layout?.component;
45
75
  }
76
+ get side() {
77
+ let e = this.attributes.toggles;
78
+ return e === z || e === B ? e : void 0;
79
+ }
46
80
  onClick() {
47
- this.isDisabled || this.layoutComponent?.toggleDrawer();
81
+ if (this.isDisabled) return;
82
+ let e = this.side;
83
+ e ? this.layoutComponent?.toggleSidebar(e) : this.layoutComponent?.toggleDrawer();
48
84
  }
49
85
  get icon() {
50
- return this.attributes.icon ?? (this.isForHiddenDrawer ? z : R);
86
+ return this.attributes.icon ?? (this.isForHiddenDrawer ? U : H);
51
87
  }
52
88
  get isForHiddenDrawer() {
53
- return this.layoutComponent?.isNarrow ?? !1;
89
+ return !this.side && (this.layoutComponent?.isNarrow ?? !1);
54
90
  }
55
91
  get words() {
56
- return this.translationForKey(this.isForHiddenDrawer ? I : F);
92
+ let e = this.side;
93
+ return e ? this.translationForKey(e === z ? L : R) : this.translationForKey(this.isForHiddenDrawer ? I : F);
57
94
  }
58
95
  get rootTag() {
59
96
  return this.kind === "item" ? "button" : "div";
@@ -67,7 +104,9 @@ var S = {
67
104
  }
68
105
  get boxExpanded() {
69
106
  let e = this.layoutComponent;
70
- return e ? String(e.isDrawerShown) : void 0;
107
+ if (!e) return;
108
+ let t = this.side;
109
+ return String(t ? e.isSideShown(t) : e.isDrawerShown);
71
110
  }
72
111
  render() {
73
112
  let e = super.render();
@@ -86,7 +125,7 @@ var S = {
86
125
  button() {
87
126
  let e = this;
88
127
  var t = w();
89
- return b(t, "appearance", B), b(t, "size", V), t._$owner = v(), _(() => ({
128
+ return b(t, "appearance", W), b(t, "size", G), t._$owner = v(), _(() => ({
90
129
  e: e.partForName("item"),
91
130
  t: e.icon,
92
131
  a: e.boxLabel,
@@ -105,7 +144,7 @@ j = e(A), M = /* @__PURE__ */ new WeakMap(), r(j, 4, "layout", D, N, M), r(j, 1,
105
144
  isAPart: !0,
106
145
  disabled: "its own"
107
146
  })), a(j, 19, N);
108
- var P = N, F = "label", I = "menuLabel", L = "ui-page-layout", R = "columns", z = "bars", B = "basic", V = "small";
147
+ var P = N, F = "label", I = "menuLabel", L = "leftLabel", R = "rightLabel", z = "left", B = "right", V = "ui-page-layout", H = "columns", U = "bars", W = "basic", G = "small";
109
148
  // src/components/ui-site-nav-button/index.ts
110
149
  P.define();
111
150
  export { P as UISiteNavButton };
@@ -1 +1 @@
1
- {"version":3,"file":"ui-site-nav-button.js","names":["<Show when={this.itemContext} fallback={this.button()}>\n {asItem}\n </Show>","this","icon={this.icon}","aria-label={this.boxLabel}","title={this.boxTooltip}","aria-expanded={this.boxExpanded}","<ui-button\n part={this.partForName(\"item\")}\n icon={this.icon}\n appearance={BASIC}\n size={SMALL}\n aria-label={this.boxLabel}\n title={this.boxTooltip}\n aria-expanded={this.boxExpanded}\n />","E.proto","E.protoMerged","E.state","E.whileConnected","E.on","E.closestAcrossShadow","_$getOwner","_$setAttribute","__name","siteNavButtonCSS","__decoratorStart","__publicField","__name$1","__decorateElement","__decoratorMetadata","__runInitializers","__privateAdd","getOwner$1","siteNavButtonVocabulary","itemVocabulary","UISiteNavButton_default","_tmpl$","_onClick_dec","_findLayout_dec","_layout_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_layout","_UISiteNavButton","UIItem","proto","protoMerged","state","whileConnected","on","closestAcrossShadow","PAGE_LAYOUT","BARS","COLUMNS","MENU_LABEL","LABEL","own","layout","asItem","isServer","_self$","createComponent","Show","_self$2","_el$","setAttribute","BASIC","SMALL","effect","_p$","t","a","o","i","UISiteNavButton"],"sources":["../src/components/ui-site-nav-button/UISiteNavButton.en.ts","../src/components/ui-site-nav-button/UISiteNavButton.tsx","../src/components/ui-site-nav-button/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-site-nav-button>`: `<ui-item>`'s, under the button's own tag, with its words.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Built ON the item's, as `<ui-action>`'s is: the same attributes, slots and states, so a menu draws it as one of\n * its items (the same noun, `item`).\n * - Its own: only its words, what it's called.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport { itemVocabulary } from \"spell/ui/components/ui-item/UIItem.en\"\n\n/****************\n * ### `siteNavButtonVocabulary`\n * The names of `<ui-site-nav-button>`: the drawer's button, in an app's top bar, which shows or hides the side\n * navigation of the `<ui-page-layout>` around it.\n ****************/\nexport const siteNavButtonVocabulary = {\n ...itemVocabulary,\n tag: \"ui-site-nav-button\",\n icon: \"columns\",\n topics: [\"navigation\", \"menus\", \"buttons\"],\n aka: [\"side bar button\", \"drawer button\", \"hamburger\", \"menu button\", \"navigation toggle\", \"sidebar toggle\"],\n skeleton: \"inline 2.5 x 2.5\",\n description:\n \"A site nav button shows or hides the side navigation of the page layout around it: its icons only and back \" +\n \"on a wide page, slid in and out on a narrow one. It's an item, for an app menu.\",\n texts: [\n {\n key: \"label\",\n text: \"Show or hide the side bar\",\n description: \"What it's called, its tooltip and its name for a screen reader, without `aria-label`.\"\n },\n {\n key: \"menuLabel\",\n text: \"Show or hide the menu\",\n description:\n \"What it's called at a narrow width, where the drawer is hidden until it slides in: its icon the menu's (`bars`).\"\n }\n ]\n} as const satisfies E.ComponentVocabulary\n","import { Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UIT } from \"spell/ui/core\"\n// the family barrel, not the leaf:\n// the lib build then imports `ui-item.js` instead of splitting a shared chunk\n// (SIDE EFFECT: defines `<ui-item>`, which the button extends)\nimport { UIItem } from \"spell/ui/components/ui-item\"\nimport type { itemVocabulary } from \"spell/ui/components/ui-item/UIItem.en\"\nimport type { DOMPageLayoutElement, UIPageLayout } from \"spell/ui/components/ui-page-layout/UIPageLayout\"\nimport { siteNavButtonVocabulary } from \"./UISiteNavButton.en\"\n\nimport siteNavButtonCSS from \"./UISiteNavButton.css?inline\"\n\n/****************\n * ### `<ui-site-nav-button>`\n * The component behind `<ui-site-nav-button>`: the drawer's button (epic `mockup` T39).\n *\n * <button class=\"icon item\" part=\"item\" aria-label=\"Show or hide the side bar\" aria-expanded=\"true\">\n * <span class=\"icon\" part=\"icon\"> <svg> </span> (`columns`)\n * </button>\n *\n * - It IS a `<ui-item>` (it extends `UIItem`): an app menu draws it as one of its items, as today's top bar's side\n * bar button.\n * - Its icon is `columns`, and its name and tooltip its words (`label`), unless the page writes its own.\n * - Narrow, the drawer hidden until it slides in: `bars`, a menu's, and its words for that (`menuLabel`).\n * - Outside a menu, where an item draws nothing of its own, it's a small basic `<ui-button>` with the same icon.\n * - A click: the nearest `<ui-page-layout>` around it, across shadow roots, `toggleDrawer()`s.\n * - So narrow, the drawer slides in and out; wide, it shows only its icons, or all of it again.\n * - `aria-expanded` says whether the layout's drawer shows all of it.\n * - With one inside it, the layout draws no menu button of its own.\n * - It finds its layout by its English tag (`ui-page-layout`).\n ****************/\nexport class UISiteNavButton extends UIItem {\n // the item's names under the button's tag, and its words: TypeScript only knows the item's literals\n @E.proto static vocabulary = siteNavButtonVocabulary as unknown as typeof itemVocabulary\n @E.protoMerged static elementSetup = {\n // the item's own, restated: its setup is typed as its literal\n styleSheets: { item: UIItem.elementSetup.styleSheets.item, \"site-nav-button\": siteNavButtonCSS },\n isAPart: true,\n disabled: \"its own\"\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## The layout around it\n ////////////////\n\n /** The `<ui-page-layout>` around it, while connected; `undefined` outside one. */\n @E.state accessor layout: DOMPageLayoutElement | undefined = undefined\n\n /** While connected: find the layout around it. */\n @E.whileConnected\n protected findLayout() {\n this.layout = E.closestAcrossShadow<DOMPageLayoutElement>(this.domElement, PAGE_LAYOUT) ?? undefined\n return () => (this.layout = undefined)\n }\n\n /** The layout's component, once its family has loaded and it has drawn. */\n private get layoutComponent(): UIPageLayout | undefined {\n return this.layout?.component\n }\n\n /** SIDE EFFECT: a click shows or hides the layout's drawer. */\n @E.on(\"click\")\n protected onClick() {\n if (!this.isDisabled) this.layoutComponent?.toggleDrawer()\n }\n\n ////////////////\n // ## Its look and its name\n ////////////////\n\n /**\n * Its icon: its own `icon` attribute, else `columns` beside a drawer it shows, `bars` while the drawer is hidden at a\n * narrow width (epic `mockup` I26). (A member with an attribute's name wins over it.)\n */\n get icon(): string | undefined {\n return this.attributes.icon ?? (this.isForHiddenDrawer ? BARS : COLUMNS)\n }\n\n /** Is the layout narrow, its drawer slid out of sight until this button slides it in? */\n private get isForHiddenDrawer(): boolean {\n return this.layoutComponent?.isNarrow ?? false\n }\n\n /** Its words: for the menu while the drawer is hidden at a narrow width, else for the side bar. */\n private get words(): string | undefined {\n return this.translationForKey(this.isForHiddenDrawer ? MENU_LABEL : LABEL)\n }\n\n /** Always a button: something to press, in any owner. */\n get rootTag(): \"a\" | \"button\" | \"div\" {\n return this.kind === UIT.ITEM ? \"button\" : \"div\"\n }\n\n /** What it's called: the page's `aria-label`, else its words. */\n protected get boxLabel(): string | undefined {\n return super.boxLabel ?? this.words\n }\n\n /** Its tooltip: the page's `title`, else its words. */\n protected get boxTooltip(): string | undefined {\n const own = this.attributes.title\n return own === null ? this.words : own || undefined\n }\n\n /** Does the layout's drawer show all of it: its `aria-expanded`. */\n protected get boxExpanded(): \"true\" | \"false\" | undefined {\n const layout = this.layoutComponent\n return layout ? (String(layout.isDrawerShown) as \"true\" | \"false\") : undefined\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** In a menu, its item box; anywhere else, a small basic button. */\n render(): JSX.Element {\n const asItem = super.render()\n if (isServer) return asItem\n return (\n <Show when={this.itemContext} fallback={this.button()}>\n {asItem}\n </Show>\n )\n }\n\n /** The button it is outside a menu: the same icon, name and `aria-expanded`. */\n private button(): JSX.Element {\n return (\n <ui-button\n part={this.partForName(\"item\")}\n icon={this.icon}\n appearance={BASIC}\n size={SMALL}\n aria-label={this.boxLabel}\n title={this.boxTooltip}\n aria-expanded={this.boxExpanded}\n />\n )\n }\n}\n\n/** Its words' key in its vocabulary's `texts`: TypeScript knows only the item's, which has none. */\nconst LABEL = \"label\" as never\nconst MENU_LABEL = \"menuLabel\" as never\n\n/** The layout's tag. */\nconst PAGE_LAYOUT = \"ui-page-layout\"\n\n/** Its icons: today's top bar's side bar button's; the menu's, while the drawer is hidden. */\nconst COLUMNS = \"columns\"\nconst BARS = \"bars\"\n\n/** Its look outside a menu: a small basic button, as the layout's own menu button. */\nconst BASIC = \"basic\"\nconst SMALL = \"small\"\n","/**\n * The site nav button family: defines `<ui-site-nav-button>` and exports its component.\n * - SIDE EFFECT: importing it defines the tag.\n * `UISiteNavButton` imports the item family first, which defines `<ui-item>`: the button extends the item.\n * And the button family: outside a menu, it draws a `<ui-button>`.\n * - Also the library's `spell/ui/ui-site-nav-button` entry.\n */\n\nimport { UISiteNavButton } from \"./UISiteNavButton\"\n\nimport \"spell/ui/components/ui-button\"\n\nUISiteNavButton.define()\n\nexport { UISiteNavButton } from \"./UISiteNavButton\"\n"],"mappings":";;;;;;;AAgBA,IAAayB,IAA0B;CACrC,GAAGC;CACH,KAAK;CACL,MAAM;CACN,QAAQ;EAAC;EAAc;EAAS;CAAS;CACzC,KAAK;EAAC;EAAmB;EAAiB;EAAa;EAAe;EAAqB;CAAgB;CAC3G,UAAU;CACV,aACE;CAEF,OAAO,CACL;EACE,KAAK;EACL,MAAM;EACN,aAAa;CACf,GACA;EACE,KAAK;EACL,MAAM;EACN,aACE;CACJ,CACF;AACF,G,0JCvCAG,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAiCaC,IAAN,MAAM,0BAAwB,IAAAC,GAEnC,IAAA,CAAC/B,CAAE,GACH,IAAA,CAACC,CAAE,GAYH,IAAA,CAACC,CAAE,GAGH,IAAA,CAACC,CAAE,GAYH,IAAA,CAACC,EAAK,OAAO,CAAA,GA9BsBuB,EAAA,CAAO;CAArC,cAAA;EAeI,AAfJ,MAAA,GAAA,SAAA,GAAAZ,EAAAa,GAAA,GAAA,IAAA,GAeIZ,EAAA,MAASa,GAA2Cd,EAApDa,GAAA,GAAA,IAAA,CAAA,GAAAb,EAAAa,GAAA,IAAA,IAAA;CAAA;CAIC,aAAa;EAErB,OADA,KAAK,SAASvB,EAA4C,KAAK,YAAYiC,CAAW,KAAK,KAAA,SAC7E,KAAK,SAAS,KAAA;CAC9B;CAGA,IAAY,kBAA4C;EACtD,OAAO,KAAK,QAAQ;CACtB;CAIU,UAAU;EAClB,AAAK,KAAK,cAAY,KAAK,iBAAiB,aAAa;CAC3D;CAUA,IAAI,OAA2B;EAC7B,OAAO,KAAK,WA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AF,GAAA,KAAAjD,EAAA4C,GAAA,cAAAO,CAAiB,GACjBC,MAAAH,GAAA,KAAAjD,EAAA4C,GAAA,SAAAQ,CAAY,GACZC,MAAAJ,GAAA,KAAAjD,EAAA4C,GAAA,iBAAAS,CAAoB;EANS,CAAA,GAD/B7D;CAUJ;AACF;AA5GO,IAAAW,EAAAiB,CAAA,GAea,oBAAA,IAAA,QAAA,GAATd,EAAAe,GAAA,GAAS,UAAlBJ,GAfWM,GAeOD,CAAA,GAIlBhB,EAAAe,GAAA,GAAU,cADVL,GAlBWO,CAAA,GA+BXjB,EAAAe,GAAA,GAAU,WADVN,GA9BWQ,CAAA,GAEFjB,EAAAe,GAAA,IAAO,cAAhBF,GAFWI,CAAA,GAGIjB,EAAAe,GAAA,IAAO,gBAAtBH,GAHWK,CAAA,GAANhB,EAAAc,GAAME,CAAA,GAA+BtB,EAAAsB,GAAA,iBAAA,GAEjCnB,EAFEmB,GAEK,cAAaf,EAApBa,GAAA,IAFEE,GAEkBZ,CAAA,CAAA,GAApBH,EAAAa,GAAA,IAFEE,CAAA,GAGInB,EAHJmB,GAGW,gBAAef,EAAtBa,GAAA,IAHJE,GAG0B;CAEnC,aAAa;EAAE,MAAMC,EAAO,aAAa,YAAY;EAAM,mBAAmBtB;CAAiB;CAC/F,SAAS;CACT,UAAU;AACZ,CAAA,CAAA,GALeM,EAAAa,GAAA,IAHJE,CAAA;AAAN,IAAM+B,IAAN/B,GA+GDY,IAAQ,SACRD,IAAa,aAGbH,IAAc,kBAGdE,IAAU,WACVD,IAAO,QAGPc,IAAQ,SACRC,IAAQ;;AChJdO,EAAgB,OAAO"}
1
+ {"version":3,"file":"ui-site-nav-button.js","names":["<Show when={this.itemContext} fallback={this.button()}>\n {asItem}\n </Show>","this","icon={this.icon}","aria-label={this.boxLabel}","title={this.boxTooltip}","aria-expanded={this.boxExpanded}","<ui-button\n part={this.partForName(\"item\")}\n icon={this.icon}\n appearance={BASIC}\n size={SMALL}\n aria-label={this.boxLabel}\n title={this.boxTooltip}\n aria-expanded={this.boxExpanded}\n />","E.proto","E.protoMerged","E.state","E.whileConnected","E.on","E.closestAcrossShadow","_$getOwner","_$setAttribute","__name","siteNavButtonCSS","__decoratorStart","__publicField","__name$1","__decorateElement","__decoratorMetadata","__runInitializers","__privateAdd","getOwner$1","siteNavButtonVocabulary","itemVocabulary","UISiteNavButton_default","_tmpl$","_onClick_dec","_findLayout_dec","_layout_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_layout","_UISiteNavButton","UIItem","proto","protoMerged","state","whileConnected","on","closestAcrossShadow","PAGE_LAYOUT","toggles","LEFT","RIGHT","side","BARS","COLUMNS","LEFT_LABEL","RIGHT_LABEL","MENU_LABEL","LABEL","own","layout","asItem","isServer","_self$","createComponent","Show","_self$2","_el$","setAttribute","BASIC","SMALL","effect","_p$","t","a","o","i","UISiteNavButton"],"sources":["../src/components/ui-site-nav-button/UISiteNavButton.en.ts","../src/components/ui-site-nav-button/UISiteNavButton.tsx","../src/components/ui-site-nav-button/index.ts"],"sourcesContent":["/**\n * The English vocabulary of `<ui-site-nav-button>`: `<ui-item>`'s, under the button's own tag, with its words.\n * The shape is `E.ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Built ON the item's, as `<ui-action>`'s is: the same attributes, slots and states, so a menu draws it as one of\n * its items (the same noun, `item`).\n * - Its own: only its words, what it's called.\n */\n\nimport type { E } from \"spell/ui/core\"\nimport { itemVocabulary } from \"spell/ui/components/ui-item/UIItem.en\"\n\n/****************\n * ### `siteNavButtonVocabulary`\n * The names of `<ui-site-nav-button>`: the drawer's button, in an app's top bar, which shows or hides the side\n * navigation of the `<ui-page-layout>` around it.\n ****************/\nexport const siteNavButtonVocabulary = {\n ...itemVocabulary,\n tag: \"ui-site-nav-button\",\n icon: \"columns\",\n topics: [\"navigation\", \"menus\", \"buttons\"],\n aka: [\"side bar button\", \"drawer button\", \"hamburger\", \"menu button\", \"navigation toggle\", \"sidebar toggle\"],\n skeleton: \"inline 2.5 x 2.5\",\n description:\n \"A site nav button shows or hides the side navigation of the page layout around it: its icons only and back \" +\n \"on a wide page, slid in and out on a narrow one; or one of its side bars (`toggles`). It's an item, for an \" +\n \"app menu.\",\n attributes: [\n ...itemVocabulary.attributes,\n {\n name: \"toggles\",\n group: \"behaviour\",\n kind: \"valueOnly\",\n values: [\"drawer\", \"left\", \"right\"],\n default: \"drawer\",\n // no class words: `right` is Fomantic's own word for an item pushed to a menu's end\n classes: { drawer: \"\", left: \"\", right: \"\" },\n description:\n \"What it shows and hides: the layout's `drawer` (its side navigation), or its `left` or `right` side bar. \" +\n \"With one for a side bar, a narrow layout hides that side bar behind it.\"\n }\n ],\n texts: [\n {\n key: \"label\",\n text: \"Show or hide the side bar\",\n description: \"What it's called, its tooltip and its name for a screen reader, without `aria-label`.\"\n },\n {\n key: \"leftLabel\",\n text: \"Show or hide the left side bar\",\n description: 'What it\\'s called with `toggles=\"left\"`, without `aria-label`.'\n },\n {\n key: \"rightLabel\",\n text: \"Show or hide the right side bar\",\n description: 'What it\\'s called with `toggles=\"right\"`, without `aria-label`.'\n },\n {\n key: \"menuLabel\",\n text: \"Show or hide the menu\",\n description:\n \"What it's called at a narrow width, where the drawer is hidden until it slides in: its icon the menu's (`bars`).\"\n }\n ]\n} as const satisfies E.ComponentVocabulary\n","import { Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UIT } from \"spell/ui/core\"\n// the family barrel, not the leaf:\n// the lib build then imports `ui-item.js` instead of splitting a shared chunk\n// (SIDE EFFECT: defines `<ui-item>`, which the button extends)\nimport { UIItem } from \"spell/ui/components/ui-item\"\nimport type { itemVocabulary } from \"spell/ui/components/ui-item/UIItem.en\"\nimport type { DOMPageLayoutElement, Side, UIPageLayout } from \"spell/ui/components/ui-page-layout/UIPageLayout\"\nimport { siteNavButtonVocabulary } from \"./UISiteNavButton.en\"\n\nimport siteNavButtonCSS from \"./UISiteNavButton.css?inline\"\n\n/****************\n * ### `<ui-site-nav-button>`\n * The component behind `<ui-site-nav-button>`: the drawer's button (epic `mockup` T39).\n *\n * <button class=\"icon item\" part=\"item\" aria-label=\"Show or hide the side bar\" aria-expanded=\"true\">\n * <span class=\"icon\" part=\"icon\"> <svg> </span> (`columns`)\n * </button>\n *\n * - It IS a `<ui-item>` (it extends `UIItem`): an app menu draws it as one of its items, as today's top bar's side\n * bar button.\n * - Its icon is `columns`, and its name and tooltip its words (`label`), unless the page writes its own.\n * - Narrow, the drawer hidden until it slides in: `bars`, a menu's, and its words for that (`menuLabel`).\n * - Outside a menu, where an item draws nothing of its own, it's a small basic `<ui-button>` with the same icon.\n * - A click: the nearest `<ui-page-layout>` around it, across shadow roots, `toggleDrawer()`s.\n * - So narrow, the drawer slides in and out; wide, it shows only its icons, or all of it again.\n * - `toggles=\"right\"` (or `left`): a click `toggleSidebar()`s that side bar instead (epic `mockup` T55),\n * and its words say so (`rightLabel`); narrow, the layout hides that side bar behind it.\n * - `aria-expanded` says whether the layout's drawer (or its side bar) is shown.\n * - With one for the drawer inside it, the layout draws no menu button of its own.\n * - It finds its layout by its English tag (`ui-page-layout`).\n ****************/\nexport class UISiteNavButton extends UIItem {\n // the item's names under the button's tag, and its words: TypeScript only knows the item's literals\n @E.proto static vocabulary = siteNavButtonVocabulary as unknown as typeof itemVocabulary\n @E.protoMerged static elementSetup = {\n // the item's own, restated: its setup is typed as its literal\n styleSheets: { item: UIItem.elementSetup.styleSheets.item, \"site-nav-button\": siteNavButtonCSS },\n isAPart: true,\n disabled: \"its own\"\n } satisfies Partial<E.ElementSetup>\n\n ////////////////\n // ## The layout around it\n ////////////////\n\n /** The `<ui-page-layout>` around it, while connected; `undefined` outside one. */\n @E.state accessor layout: DOMPageLayoutElement | undefined = undefined\n\n /** While connected: find the layout around it. */\n @E.whileConnected\n protected findLayout() {\n this.layout = E.closestAcrossShadow<DOMPageLayoutElement>(this.domElement, PAGE_LAYOUT) ?? undefined\n return () => (this.layout = undefined)\n }\n\n /** The layout's component, once its family has loaded and it has drawn. */\n private get layoutComponent(): UIPageLayout | undefined {\n return this.layout?.component\n }\n\n /** The side bar it shows and hides (`toggles`), or `undefined` for the drawer. */\n private get side(): Side | undefined {\n // the item's attributes are what TypeScript knows of its vocabulary: `toggles` is the button's own\n const toggles = this.attributes.toggles\n return toggles === LEFT || toggles === RIGHT ? toggles : undefined\n }\n\n /** SIDE EFFECT: a click shows or hides the layout's drawer, or its side bar (`toggles`). */\n @E.on(\"click\")\n protected onClick() {\n if (this.isDisabled) return\n const side = this.side\n if (side) this.layoutComponent?.toggleSidebar(side)\n else this.layoutComponent?.toggleDrawer()\n }\n\n ////////////////\n // ## Its look and its name\n ////////////////\n\n /**\n * Its icon: its own `icon` attribute, else `columns` beside a drawer it shows, `bars` while the drawer is hidden at a\n * narrow width (epic `mockup` I26). (A member with an attribute's name wins over it.)\n */\n get icon(): string | undefined {\n return this.attributes.icon ?? (this.isForHiddenDrawer ? BARS : COLUMNS)\n }\n\n /** Is the layout narrow, its drawer slid out of sight until this button slides it in? */\n private get isForHiddenDrawer(): boolean {\n return !this.side && (this.layoutComponent?.isNarrow ?? false)\n }\n\n /**\n * Its words: for its side bar (`toggles`); for the menu while the drawer is hidden at a narrow width;\n * else for the drawer, the side bar a site calls it.\n */\n private get words(): string | undefined {\n const side = this.side\n if (side) return this.translationForKey(side === LEFT ? LEFT_LABEL : RIGHT_LABEL)\n return this.translationForKey(this.isForHiddenDrawer ? MENU_LABEL : LABEL)\n }\n\n /** Always a button: something to press, in any owner. */\n get rootTag(): \"a\" | \"button\" | \"div\" {\n return this.kind === UIT.ITEM ? \"button\" : \"div\"\n }\n\n /** What it's called: the page's `aria-label`, else its words. */\n protected get boxLabel(): string | undefined {\n return super.boxLabel ?? this.words\n }\n\n /** Its tooltip: the page's `title`, else its words. */\n protected get boxTooltip(): string | undefined {\n const own = this.attributes.title\n return own === null ? this.words : own || undefined\n }\n\n /** Does the layout's drawer show all of it, or is its side bar shown (`toggles`): its `aria-expanded`. */\n protected get boxExpanded(): \"true\" | \"false\" | undefined {\n const layout = this.layoutComponent\n if (!layout) return undefined\n const side = this.side\n return String(side ? layout.isSideShown(side) : layout.isDrawerShown) as \"true\" | \"false\"\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** In a menu, its item box; anywhere else, a small basic button. */\n render(): JSX.Element {\n const asItem = super.render()\n if (isServer) return asItem\n return (\n <Show when={this.itemContext} fallback={this.button()}>\n {asItem}\n </Show>\n )\n }\n\n /** The button it is outside a menu: the same icon, name and `aria-expanded`. */\n private button(): JSX.Element {\n return (\n <ui-button\n part={this.partForName(\"item\")}\n icon={this.icon}\n appearance={BASIC}\n size={SMALL}\n aria-label={this.boxLabel}\n title={this.boxTooltip}\n aria-expanded={this.boxExpanded}\n />\n )\n }\n}\n\n/** Its words' key in its vocabulary's `texts`: TypeScript knows only the item's, which has none. */\nconst LABEL = \"label\" as never\nconst MENU_LABEL = \"menuLabel\" as never\nconst LEFT_LABEL = \"leftLabel\" as never\nconst RIGHT_LABEL = \"rightLabel\" as never\n\n/** `toggles`'s side bars. */\nconst LEFT = \"left\"\nconst RIGHT = \"right\"\n\n/** The layout's tag. */\nconst PAGE_LAYOUT = \"ui-page-layout\"\n\n/** Its icons: today's top bar's side bar button's; the menu's, while the drawer is hidden. */\nconst COLUMNS = \"columns\"\nconst BARS = \"bars\"\n\n/** Its look outside a menu: a small basic button, as the layout's own menu button. */\nconst BASIC = \"basic\"\nconst SMALL = \"small\"\n","/**\n * The site nav button family: defines `<ui-site-nav-button>` and exports its component.\n * - SIDE EFFECT: importing it defines the tag.\n * `UISiteNavButton` imports the item family first, which defines `<ui-item>`: the button extends the item.\n * And the button family: outside a menu, it draws a `<ui-button>`.\n * - Also the library's `spell/ui/ui-site-nav-button` entry.\n */\n\nimport { UISiteNavButton } from \"./UISiteNavButton\"\n\nimport \"spell/ui/components/ui-button\"\n\nUISiteNavButton.define()\n\nexport { UISiteNavButton } from \"./UISiteNavButton\"\n"],"mappings":";;;;;;;A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A,IAHJE,CAAA;AAAN,IAAMqC,IAANrC,GAgIDkB,IAAQ,SACRD,IAAa,aACbF,IAAa,aACbC,IAAc,cAGdN,IAAO,QACPC,IAAQ,SAGRH,IAAc,kBAGdM,IAAU,WACVD,IAAO,QAGPgB,IAAQ,SACRC,IAAQ;;ACzKdO,EAAgB,OAAO"}
@@ -1,5 +1,5 @@
1
1
  // src/components/ui-site-tabs/ui-site-tabs.editor.html?raw
2
- var e = "<!-- <ui-site-tabs>'s property editor layout: move, pair (<ui-fields>) or leave out (data-omit) its properties. How: Spell UI's AGENTS.md, \"Property editor layouts\". -->\n<ui-property-editor schema=\"ui-site-tabs\" data-omit=\"\">\n <ui-property-group label=\"Content\" data-group=\"content\">\n <ui-property name=\"pages\"></ui-property>\n <ui-property name=\"current\"></ui-property>\n <ui-property name=\"label\"></ui-property>\n </ui-property-group>\n</ui-property-editor>\n";
2
+ var e = "<!-- <ui-site-tabs>'s property editor layout: move, pair (<ui-fields>) or leave out (data-omit) its properties. How: Spell UI's AGENTS.md, \"Property editor layouts\". -->\n<ui-property-editor schema=\"ui-site-tabs\" data-omit=\"\">\n <ui-property-group label=\"Content\" data-group=\"content\">\n <ui-property name=\"pages\"></ui-property>\n <ui-property name=\"current\"></ui-property>\n <ui-property name=\"label\"></ui-property>\n </ui-property-group>\n <ui-property-group label=\"Appearance\" data-group=\"appearance\">\n <ui-property name=\"appearance\"></ui-property>\n </ui-property-group>\n</ui-property-editor>\n";
3
3
  export { e as default };
4
4
 
5
- //# sourceMappingURL=ui-site-tabs.editor-DDvQfH6S.js.map
5
+ //# sourceMappingURL=ui-site-tabs.editor-CdMIw4jw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-site-tabs.editor-CdMIw4jw.js","names":["ui_site_tabs_editor_default"],"sources":[],"mappings":""}
@@ -34,6 +34,13 @@ var D = {
34
34
  kind: "string",
35
35
  description: "Which page is shown: its `href` or its `id`. None: the page whose `href` is the browser's address."
36
36
  },
37
+ {
38
+ name: "appearance",
39
+ group: "appearance",
40
+ kind: "valueOnly",
41
+ values: ["header"],
42
+ description: "`header`: a switch for an app menu's middle, the look of the editor's Run | Edit: the row as wide as its tabs, on the bar's own fill, the page shown on the thumb. None: a segmented row of its own, each tab an equal share of it."
43
+ },
37
44
  {
38
45
  name: "label",
39
46
  group: "content",
@@ -55,11 +62,14 @@ var D = {
55
62
  states: [{
56
63
  name: "empty",
57
64
  description: "The shown page has no family, so no tabs are drawn: it takes no room."
65
+ }, {
66
+ name: "header",
67
+ description: "`appearance=\"header\"`: a switch for an app menu's middle."
58
68
  }],
59
69
  texts: []
60
- }, O = "@layer ui.components{:host{min-width:0;display:block}:host(:state(empty)){display:none}ui-item{min-width:max-content}ui-item::part(item){white-space:nowrap;min-width:max-content}}", k = /* @__PURE__ */ E("<ui-toolbar equal>", 1), A = /* @__PURE__ */ E("<ui-item>", 1), j, M, N, P, F, I, L, R, z, B, V, H, U = class _UISiteTabs extends (B = r, z = [d], R = [f], L = [l], I = [m], F = [h], P = [l], N = [l], M = [c("empty")], j = [u("selectedKey", "isReady")], B) {
70
+ }, O = "@layer ui.components{:host{min-width:0;display:block}:host(:state(empty)){display:none}:host(:state(header):not(:state(empty))){align-items:center;display:flex}ui-item{min-width:max-content}ui-item::part(item){white-space:nowrap;min-width:max-content}}", k = /* @__PURE__ */ E("<ui-toolbar>", 1), A = /* @__PURE__ */ E("<ui-item>", 1), j, M, N, P, F, I, L, R, z, B, V, H, U, W = class _UISiteTabs extends (V = r, B = [d], z = [f], R = [l], L = [m], I = [h], F = [l], P = [l], N = [c("empty")], M = [u("selectedKey", "isReady")], j = [c("header")], V) {
61
71
  constructor() {
62
- super(...arguments), o(V, 5, this), p(this, H, o(V, 8, this)), o(V, 11, this), t(this, "menu");
72
+ super(...arguments), o(H, 5, this), p(this, U, o(H, 8, this)), o(H, 11, this), t(this, "menu");
63
73
  }
64
74
  get sitePages() {
65
75
  return g.wellFormed(this.isFollowing ? this.followed?.pages : this.pages);
@@ -91,7 +101,7 @@ var D = {
91
101
  }
92
102
  get tabs() {
93
103
  let e = this.family.filter((e) => e.href && !g.hasParameter(e));
94
- return e.length >= G ? e : [];
104
+ return e.length >= K ? e : [];
95
105
  }
96
106
  get isEmpty() {
97
107
  return !this.tabs.length;
@@ -106,7 +116,7 @@ var D = {
106
116
  }) || n?.preventDefault());
107
117
  }
108
118
  tabForItem(e) {
109
- let t = e.getAttribute(K);
119
+ let t = e.getAttribute(q);
110
120
  return this.tabs.find((e) => g.keyOf(e) === t);
111
121
  }
112
122
  get selectedKey() {
@@ -120,7 +130,7 @@ var D = {
120
130
  if (!this.menu) return;
121
131
  let e = [this.menu, ...this.menu.children];
122
132
  await Promise.all(e.map((e) => e.ready)), s(() => {
123
- let e = this.menu?.shadowRoot?.querySelector(X), t = this.menu?.querySelector(`[${q}]`)?.shadowRoot?.querySelector("a");
133
+ let e = this.menu?.shadowRoot?.querySelector($), t = this.menu?.querySelector(`[${J}]`)?.shadowRoot?.querySelector("a");
124
134
  if (!e || !t) return;
125
135
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
126
136
  r.left < n.left ? e.scrollBy({
@@ -132,6 +142,9 @@ var D = {
132
142
  });
133
143
  });
134
144
  }
145
+ get isHeader() {
146
+ return this.appearance === Z;
147
+ }
135
148
  render() {
136
149
  let e = this;
137
150
  return y(v, {
@@ -140,7 +153,7 @@ var D = {
140
153
  },
141
154
  get children() {
142
155
  var t = k();
143
- return T(t, "appearance", J), T(t, "align", Y), T(t, "on-ui-choosing", (t) => e.onChoosing(t)), w(() => (t) => e.menu = t, t), t._$owner = x(), S(t, y(_, {
156
+ return T(t, "on-ui-choosing", (t) => e.onChoosing(t)), w(() => (t) => e.menu = t, t), t._$owner = x(), S(t, y(_, {
144
157
  get each() {
145
158
  return e.tabs;
146
159
  },
@@ -150,9 +163,12 @@ var D = {
150
163
  children: (t) => e.tab(t)
151
164
  })), b(() => ({
152
165
  e: `menu: ${e.partForName("tabs")}`,
153
- t: e.label ?? e.family[0]?.title
154
- }), ({ e, t: n }, r) => {
155
- e !== r?.e && T(t, "exportparts", e), n !== r?.t && T(t, "aria-label", n);
166
+ t: e.isHeader ? Q : Y,
167
+ a: e.isHeader ? void 0 : X,
168
+ o: e.isHeader ? void 0 : "",
169
+ i: e.label ?? e.family[0]?.title
170
+ }), ({ e, t: n, a: r, o: i, i: a }, o) => {
171
+ e !== o?.e && T(t, "exportparts", e), n !== o?.t && T(t, "appearance", n), r !== o?.a && T(t, "align", r), i !== o?.o && T(t, "equal", i), a !== o?.i && T(t, "aria-label", a);
156
172
  }), t;
157
173
  }
158
174
  });
@@ -170,13 +186,13 @@ var D = {
170
186
  }), n;
171
187
  }
172
188
  };
173
- V = e(B), H = /* @__PURE__ */ new WeakMap(), i(V, 2, "sitePages", L, U), i(V, 4, "followed", I, U, H), i(V, 1, "followSiteNav", F, U), i(V, 2, "family", P, U), i(V, 2, "tabs", N, U), i(V, 2, "isEmpty", M, U), i(V, 1, "onSelectedChanged", j, U), i(V, 13, "vocabulary", z, U), i(V, 13, "elementSetup", R, U), a(V, U), n(U, "UISiteTabs"), t(U, "vocabulary", o(V, 12, U, D)), o(V, 15, U), t(U, "elementSetup", o(V, 16, U, {
189
+ H = e(V), U = /* @__PURE__ */ new WeakMap(), i(H, 2, "sitePages", R, W), i(H, 4, "followed", L, W, U), i(H, 1, "followSiteNav", I, W), i(H, 2, "family", F, W), i(H, 2, "tabs", P, W), i(H, 2, "isEmpty", N, W), i(H, 1, "onSelectedChanged", M, W), i(H, 2, "isHeader", j, W), i(H, 13, "vocabulary", B, W), i(H, 13, "elementSetup", z, W), a(H, W), n(W, "UISiteTabs"), t(W, "vocabulary", o(H, 12, W, D)), o(H, 15, W), t(W, "elementSetup", o(H, 16, W, {
174
190
  styleSheets: { "site-tabs": O },
175
191
  delegatesFocus: !1
176
- })), o(V, 19, U);
177
- var W = U, G = 2, K = "data-page", q = "data-current", J = "segmented", Y = "fluid", X = "[part~=\"menu\"]";
192
+ })), o(H, 19, W);
193
+ var G = W, K = 2, q = "data-page", J = "data-current", Y = "segmented", X = "fluid", Z = "header", Q = "segmented link header", $ = "[part~=\"menu\"]";
178
194
  // src/components/ui-site-tabs/index.ts
179
- W.define();
180
- export { W as UISiteTabs };
195
+ G.define();
196
+ export { G as UISiteTabs };
181
197
 
182
198
  //# sourceMappingURL=ui-site-tabs.js.map