@syware/jlib 0.0.0-stage → 0.1.3

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 (331) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +133 -2
  3. package/dist/all.d.ts +1 -0
  4. package/dist/all.js +75 -0
  5. package/dist/atoms/jl-avatar.css_raw.js +3 -0
  6. package/dist/atoms/jl-avatar.d.ts +52 -0
  7. package/dist/atoms/jl-avatar.js +167 -0
  8. package/dist/atoms/jl-badge.css_raw.js +3 -0
  9. package/dist/atoms/jl-badge.d.ts +32 -0
  10. package/dist/atoms/jl-badge.js +60 -0
  11. package/dist/atoms/jl-button.css_raw.js +3 -0
  12. package/dist/atoms/jl-button.d.ts +70 -0
  13. package/dist/atoms/jl-button.js +146 -0
  14. package/dist/atoms/jl-checkbox.css_raw.js +3 -0
  15. package/dist/atoms/jl-checkbox.d.ts +61 -0
  16. package/dist/atoms/jl-checkbox.js +149 -0
  17. package/dist/atoms/jl-chip.css_raw.js +3 -0
  18. package/dist/atoms/jl-chip.d.ts +59 -0
  19. package/dist/atoms/jl-chip.js +164 -0
  20. package/dist/atoms/jl-divider.css_raw.js +3 -0
  21. package/dist/atoms/jl-divider.d.ts +26 -0
  22. package/dist/atoms/jl-divider.js +59 -0
  23. package/dist/atoms/jl-icon.css_raw.js +3 -0
  24. package/dist/atoms/jl-icon.d.ts +25 -0
  25. package/dist/atoms/jl-icon.js +41 -0
  26. package/dist/atoms/jl-input.css_raw.js +3 -0
  27. package/dist/atoms/jl-input.d.ts +112 -0
  28. package/dist/atoms/jl-input.js +202 -0
  29. package/dist/atoms/jl-kbd.css_raw.js +3 -0
  30. package/dist/atoms/jl-kbd.d.ts +17 -0
  31. package/dist/atoms/jl-kbd.js +62 -0
  32. package/dist/atoms/jl-link.css_raw.js +3 -0
  33. package/dist/atoms/jl-link.d.ts +37 -0
  34. package/dist/atoms/jl-link.js +86 -0
  35. package/dist/atoms/jl-progress-ring.css_raw.js +3 -0
  36. package/dist/atoms/jl-progress-ring.d.ts +49 -0
  37. package/dist/atoms/jl-progress-ring.js +132 -0
  38. package/dist/atoms/jl-progress.css_raw.js +3 -0
  39. package/dist/atoms/jl-progress.d.ts +43 -0
  40. package/dist/atoms/jl-progress.js +109 -0
  41. package/dist/atoms/jl-rating.css_raw.js +3 -0
  42. package/dist/atoms/jl-rating.d.ts +73 -0
  43. package/dist/atoms/jl-rating.js +184 -0
  44. package/dist/atoms/jl-select.css_raw.js +3 -0
  45. package/dist/atoms/jl-select.d.ts +70 -0
  46. package/dist/atoms/jl-select.js +146 -0
  47. package/dist/atoms/jl-skeleton.css_raw.js +3 -0
  48. package/dist/atoms/jl-skeleton.d.ts +34 -0
  49. package/dist/atoms/jl-skeleton.js +63 -0
  50. package/dist/atoms/jl-slider.css_raw.js +3 -0
  51. package/dist/atoms/jl-slider.d.ts +65 -0
  52. package/dist/atoms/jl-slider.js +143 -0
  53. package/dist/atoms/jl-spinner.css_raw.js +3 -0
  54. package/dist/atoms/jl-spinner.d.ts +16 -0
  55. package/dist/atoms/jl-spinner.js +26 -0
  56. package/dist/atoms/jl-switch.css_raw.js +3 -0
  57. package/dist/atoms/jl-switch.d.ts +57 -0
  58. package/dist/atoms/jl-switch.js +125 -0
  59. package/dist/atoms/jl-textarea.css_raw.js +3 -0
  60. package/dist/atoms/jl-textarea.d.ts +81 -0
  61. package/dist/atoms/jl-textarea.js +148 -0
  62. package/dist/base/jl-element.d.ts +16 -0
  63. package/dist/base/jl-element.js +35 -0
  64. package/dist/base/jl-form-control.d.ts +29 -0
  65. package/dist/base/jl-form-control.js +44 -0
  66. package/dist/index.d.ts +119 -0
  67. package/dist/index.js +72 -0
  68. package/dist/lib/arrow.d.ts +6 -0
  69. package/dist/lib/arrow.js +15 -0
  70. package/dist/lib/attributes.d.ts +9 -0
  71. package/dist/lib/attributes.js +22 -0
  72. package/dist/lib/avatar.d.ts +11 -0
  73. package/dist/lib/avatar.js +37 -0
  74. package/dist/lib/calendar.d.ts +48 -0
  75. package/dist/lib/calendar.js +166 -0
  76. package/dist/lib/css-length.d.ts +2 -0
  77. package/dist/lib/css-length.js +8 -0
  78. package/dist/lib/define.d.ts +9 -0
  79. package/dist/lib/define.js +9 -0
  80. package/dist/lib/dom.d.ts +4 -0
  81. package/dist/lib/dom.js +16 -0
  82. package/dist/lib/files.d.ts +18 -0
  83. package/dist/lib/files.js +89 -0
  84. package/dist/lib/floating.d.ts +13 -0
  85. package/dist/lib/floating.js +127 -0
  86. package/dist/lib/fuzzy.d.ts +26 -0
  87. package/dist/lib/fuzzy.js +149 -0
  88. package/dist/lib/highlight.d.ts +5 -0
  89. package/dist/lib/highlight.js +267 -0
  90. package/dist/lib/hotkey.d.ts +9 -0
  91. package/dist/lib/hotkey.js +101 -0
  92. package/dist/lib/icon-set.d.ts +95 -0
  93. package/dist/lib/icon-set.js +97 -0
  94. package/dist/lib/icons.d.ts +12 -0
  95. package/dist/lib/icons.js +39 -0
  96. package/dist/lib/indicator.d.ts +6 -0
  97. package/dist/lib/indicator.js +18 -0
  98. package/dist/lib/keep-in-view.d.ts +5 -0
  99. package/dist/lib/keep-in-view.js +15 -0
  100. package/dist/lib/key-shortcut.d.ts +20 -0
  101. package/dist/lib/key-shortcut.js +100 -0
  102. package/dist/lib/keycaps.d.ts +8 -0
  103. package/dist/lib/keycaps.js +162 -0
  104. package/dist/lib/locale.d.ts +4 -0
  105. package/dist/lib/locale.js +13 -0
  106. package/dist/lib/nav-tree.d.ts +9 -0
  107. package/dist/lib/nav-tree.js +30 -0
  108. package/dist/lib/numeric.d.ts +20 -0
  109. package/dist/lib/numeric.js +50 -0
  110. package/dist/lib/option-filter.d.ts +29 -0
  111. package/dist/lib/option-filter.js +108 -0
  112. package/dist/lib/option-groups.d.ts +6 -0
  113. package/dist/lib/option-groups.js +26 -0
  114. package/dist/lib/options.d.ts +5 -0
  115. package/dist/lib/options.js +24 -0
  116. package/dist/lib/pagination.d.ts +9 -0
  117. package/dist/lib/pagination.js +52 -0
  118. package/dist/lib/palette.d.ts +8 -0
  119. package/dist/lib/palette.js +46 -0
  120. package/dist/lib/progress.d.ts +20 -0
  121. package/dist/lib/progress.js +33 -0
  122. package/dist/lib/rating.d.ts +7 -0
  123. package/dist/lib/rating.js +26 -0
  124. package/dist/lib/roving-index.d.ts +10 -0
  125. package/dist/lib/roving-index.js +32 -0
  126. package/dist/lib/roving.d.ts +11 -0
  127. package/dist/lib/roving.js +21 -0
  128. package/dist/lib/slots.d.ts +2 -0
  129. package/dist/lib/slots.js +6 -0
  130. package/dist/lib/sparkline.d.ts +11 -0
  131. package/dist/lib/sparkline.js +42 -0
  132. package/dist/lib/split.d.ts +12 -0
  133. package/dist/lib/split.js +37 -0
  134. package/dist/lib/surface.d.ts +7 -0
  135. package/dist/lib/surface.js +28 -0
  136. package/dist/lib/table.d.ts +30 -0
  137. package/dist/lib/table.js +110 -0
  138. package/dist/lib/tags.d.ts +14 -0
  139. package/dist/lib/tags.js +29 -0
  140. package/dist/lib/text.d.ts +5 -0
  141. package/dist/lib/text.js +13 -0
  142. package/dist/lib/tokens.d.ts +5 -0
  143. package/dist/lib/tokens.js +15 -0
  144. package/dist/lib/tree.d.ts +16 -0
  145. package/dist/lib/tree.js +89 -0
  146. package/dist/lib/trend.d.ts +3 -0
  147. package/dist/lib/trend.js +15 -0
  148. package/dist/lib/trigger.d.ts +11 -0
  149. package/dist/lib/trigger.js +34 -0
  150. package/dist/molecules/jl-accordion-item.css_raw.js +3 -0
  151. package/dist/molecules/jl-accordion-item.d.ts +34 -0
  152. package/dist/molecules/jl-accordion-item.js +82 -0
  153. package/dist/molecules/jl-accordion.css_raw.js +3 -0
  154. package/dist/molecules/jl-accordion.d.ts +27 -0
  155. package/dist/molecules/jl-accordion.js +61 -0
  156. package/dist/molecules/jl-alert.css_raw.js +3 -0
  157. package/dist/molecules/jl-alert.d.ts +38 -0
  158. package/dist/molecules/jl-alert.js +131 -0
  159. package/dist/molecules/jl-avatar-group.css_raw.js +3 -0
  160. package/dist/molecules/jl-avatar-group.d.ts +28 -0
  161. package/dist/molecules/jl-avatar-group.js +69 -0
  162. package/dist/molecules/jl-breadcrumb.css_raw.js +3 -0
  163. package/dist/molecules/jl-breadcrumb.d.ts +35 -0
  164. package/dist/molecules/jl-breadcrumb.js +126 -0
  165. package/dist/molecules/jl-calendar.css_raw.js +3 -0
  166. package/dist/molecules/jl-calendar.d.ts +101 -0
  167. package/dist/molecules/jl-calendar.js +314 -0
  168. package/dist/molecules/jl-card.css_raw.js +3 -0
  169. package/dist/molecules/jl-card.d.ts +46 -0
  170. package/dist/molecules/jl-card.js +172 -0
  171. package/dist/molecules/jl-code-block.css_raw.js +3 -0
  172. package/dist/molecules/jl-code-block.d.ts +44 -0
  173. package/dist/molecules/jl-code-block.js +106 -0
  174. package/dist/molecules/jl-combobox.css_raw.js +3 -0
  175. package/dist/molecules/jl-combobox.d.ts +120 -0
  176. package/dist/molecules/jl-combobox.js +450 -0
  177. package/dist/molecules/jl-copy-button.css_raw.js +3 -0
  178. package/dist/molecules/jl-copy-button.d.ts +31 -0
  179. package/dist/molecules/jl-copy-button.js +69 -0
  180. package/dist/molecules/jl-date-picker.css_raw.js +3 -0
  181. package/dist/molecules/jl-date-picker.d.ts +109 -0
  182. package/dist/molecules/jl-date-picker.js +322 -0
  183. package/dist/molecules/jl-empty.css_raw.js +3 -0
  184. package/dist/molecules/jl-empty.d.ts +32 -0
  185. package/dist/molecules/jl-empty.js +94 -0
  186. package/dist/molecules/jl-field.css_raw.js +3 -0
  187. package/dist/molecules/jl-field.d.ts +49 -0
  188. package/dist/molecules/jl-field.js +147 -0
  189. package/dist/molecules/jl-file-drop.css_raw.js +3 -0
  190. package/dist/molecules/jl-file-drop.d.ts +93 -0
  191. package/dist/molecules/jl-file-drop.js +366 -0
  192. package/dist/molecules/jl-list-item.css_raw.js +3 -0
  193. package/dist/molecules/jl-list-item.d.ts +56 -0
  194. package/dist/molecules/jl-list-item.js +176 -0
  195. package/dist/molecules/jl-menu.css_raw.js +3 -0
  196. package/dist/molecules/jl-menu.d.ts +62 -0
  197. package/dist/molecules/jl-menu.js +288 -0
  198. package/dist/molecules/jl-number-input.css_raw.js +3 -0
  199. package/dist/molecules/jl-number-input.d.ts +81 -0
  200. package/dist/molecules/jl-number-input.js +220 -0
  201. package/dist/molecules/jl-pagination.css_raw.js +3 -0
  202. package/dist/molecules/jl-pagination.d.ts +59 -0
  203. package/dist/molecules/jl-pagination.js +172 -0
  204. package/dist/molecules/jl-popover.css_raw.js +3 -0
  205. package/dist/molecules/jl-popover.d.ts +49 -0
  206. package/dist/molecules/jl-popover.js +152 -0
  207. package/dist/molecules/jl-radio-group.css_raw.js +3 -0
  208. package/dist/molecules/jl-radio-group.d.ts +71 -0
  209. package/dist/molecules/jl-radio-group.js +202 -0
  210. package/dist/molecules/jl-search.css_raw.js +3 -0
  211. package/dist/molecules/jl-search.d.ts +71 -0
  212. package/dist/molecules/jl-search.js +210 -0
  213. package/dist/molecules/jl-segmented.css_raw.js +3 -0
  214. package/dist/molecules/jl-segmented.d.ts +65 -0
  215. package/dist/molecules/jl-segmented.js +187 -0
  216. package/dist/molecules/jl-stat.css_raw.js +3 -0
  217. package/dist/molecules/jl-stat.d.ts +55 -0
  218. package/dist/molecules/jl-stat.js +169 -0
  219. package/dist/molecules/jl-steps.css_raw.js +3 -0
  220. package/dist/molecules/jl-steps.d.ts +44 -0
  221. package/dist/molecules/jl-steps.js +118 -0
  222. package/dist/molecules/jl-tab-panel.css_raw.js +3 -0
  223. package/dist/molecules/jl-tab-panel.d.ts +35 -0
  224. package/dist/molecules/jl-tab-panel.js +35 -0
  225. package/dist/molecules/jl-tabs.css_raw.js +3 -0
  226. package/dist/molecules/jl-tabs.d.ts +51 -0
  227. package/dist/molecules/jl-tabs.js +198 -0
  228. package/dist/molecules/jl-tag-input.css_raw.js +3 -0
  229. package/dist/molecules/jl-tag-input.d.ts +103 -0
  230. package/dist/molecules/jl-tag-input.js +429 -0
  231. package/dist/molecules/jl-timeline.css_raw.js +3 -0
  232. package/dist/molecules/jl-timeline.d.ts +28 -0
  233. package/dist/molecules/jl-timeline.js +81 -0
  234. package/dist/molecules/jl-toast.css_raw.js +3 -0
  235. package/dist/molecules/jl-toast.d.ts +75 -0
  236. package/dist/molecules/jl-toast.js +274 -0
  237. package/dist/molecules/jl-tooltip.css_raw.js +3 -0
  238. package/dist/molecules/jl-tooltip.d.ts +44 -0
  239. package/dist/molecules/jl-tooltip.js +160 -0
  240. package/dist/organisms/jl-command-palette.css_raw.js +3 -0
  241. package/dist/organisms/jl-command-palette.d.ts +60 -0
  242. package/dist/organisms/jl-command-palette.js +285 -0
  243. package/dist/organisms/jl-confirm.css_raw.js +3 -0
  244. package/dist/organisms/jl-confirm.d.ts +56 -0
  245. package/dist/organisms/jl-confirm.js +132 -0
  246. package/dist/organisms/jl-dialog.css_raw.js +3 -0
  247. package/dist/organisms/jl-dialog.d.ts +43 -0
  248. package/dist/organisms/jl-dialog.js +120 -0
  249. package/dist/organisms/jl-drawer.css_raw.js +3 -0
  250. package/dist/organisms/jl-drawer.d.ts +50 -0
  251. package/dist/organisms/jl-drawer.js +141 -0
  252. package/dist/organisms/jl-navbar.css_raw.js +3 -0
  253. package/dist/organisms/jl-navbar.d.ts +32 -0
  254. package/dist/organisms/jl-navbar.js +121 -0
  255. package/dist/organisms/jl-page-header.css_raw.js +3 -0
  256. package/dist/organisms/jl-page-header.d.ts +26 -0
  257. package/dist/organisms/jl-page-header.js +85 -0
  258. package/dist/organisms/jl-side-nav.css_raw.js +3 -0
  259. package/dist/organisms/jl-side-nav.d.ts +60 -0
  260. package/dist/organisms/jl-side-nav.js +269 -0
  261. package/dist/organisms/jl-table.css_raw.js +3 -0
  262. package/dist/organisms/jl-table.d.ts +109 -0
  263. package/dist/organisms/jl-table.js +318 -0
  264. package/dist/organisms/jl-toaster.css_raw.js +3 -0
  265. package/dist/organisms/jl-toaster.d.ts +48 -0
  266. package/dist/organisms/jl-toaster.js +142 -0
  267. package/dist/organisms/jl-tree.css_raw.js +3 -0
  268. package/dist/organisms/jl-tree.d.ts +59 -0
  269. package/dist/organisms/jl-tree.js +198 -0
  270. package/dist/styles/base.css_raw.js +3 -0
  271. package/dist/styles/control.css_raw.js +3 -0
  272. package/dist/styles/floating.css_raw.js +3 -0
  273. package/dist/styles/shared.d.ts +8 -0
  274. package/dist/styles/shared.js +14 -0
  275. package/dist/styles/tokens.css_raw.js +3 -0
  276. package/dist/templates/jl-app-shell.css_raw.js +3 -0
  277. package/dist/templates/jl-app-shell.d.ts +37 -0
  278. package/dist/templates/jl-app-shell.js +150 -0
  279. package/dist/templates/jl-split-view.css_raw.js +3 -0
  280. package/dist/templates/jl-split-view.d.ts +49 -0
  281. package/dist/templates/jl-split-view.js +149 -0
  282. package/dist/tokens.css +188 -0
  283. package/dist/types/calendar.types.d.ts +11 -0
  284. package/dist/types/files.types.d.ts +23 -0
  285. package/dist/types/floating.types.d.ts +13 -0
  286. package/dist/types/fuzzy.types.d.ts +10 -0
  287. package/dist/types/highlight.types.d.ts +6 -0
  288. package/dist/types/hotkey.types.d.ts +19 -0
  289. package/dist/types/jl-accordion.types.d.ts +2 -0
  290. package/dist/types/jl-avatar.types.d.ts +10 -0
  291. package/dist/types/jl-breadcrumb.types.d.ts +6 -0
  292. package/dist/types/jl-button.types.d.ts +3 -0
  293. package/dist/types/jl-card.types.d.ts +2 -0
  294. package/dist/types/jl-chip.types.d.ts +1 -0
  295. package/dist/types/jl-combobox.types.d.ts +8 -0
  296. package/dist/types/jl-command-palette.types.d.ts +22 -0
  297. package/dist/types/jl-confirm.types.d.ts +10 -0
  298. package/dist/types/jl-dialog.types.d.ts +1 -0
  299. package/dist/types/jl-divider.types.d.ts +2 -0
  300. package/dist/types/jl-drawer.types.d.ts +4 -0
  301. package/dist/types/jl-empty.types.d.ts +2 -0
  302. package/dist/types/jl-field.types.d.ts +2 -0
  303. package/dist/types/jl-input.types.d.ts +1 -0
  304. package/dist/types/jl-link.types.d.ts +2 -0
  305. package/dist/types/jl-menu.types.d.ts +22 -0
  306. package/dist/types/jl-navbar.types.d.ts +6 -0
  307. package/dist/types/jl-progress.types.d.ts +3 -0
  308. package/dist/types/jl-radio-group.types.d.ts +10 -0
  309. package/dist/types/jl-segmented.types.d.ts +7 -0
  310. package/dist/types/jl-select.types.d.ts +12 -0
  311. package/dist/types/jl-side-nav.types.d.ts +17 -0
  312. package/dist/types/jl-skeleton.types.d.ts +2 -0
  313. package/dist/types/jl-slider.types.d.ts +5 -0
  314. package/dist/types/jl-split-view.types.d.ts +2 -0
  315. package/dist/types/jl-stat.types.d.ts +2 -0
  316. package/dist/types/jl-steps.types.d.ts +8 -0
  317. package/dist/types/jl-switch.types.d.ts +1 -0
  318. package/dist/types/jl-table.types.d.ts +30 -0
  319. package/dist/types/jl-tabs.types.d.ts +2 -0
  320. package/dist/types/jl-timeline.types.d.ts +10 -0
  321. package/dist/types/jl-toast.types.d.ts +2 -0
  322. package/dist/types/jl-toaster.types.d.ts +23 -0
  323. package/dist/types/jl-tree.types.d.ts +26 -0
  324. package/dist/types/key-shortcut.types.d.ts +9 -0
  325. package/dist/types/keycaps.types.d.ts +7 -0
  326. package/dist/types/option-filter.types.d.ts +10 -0
  327. package/dist/types/options.types.d.ts +4 -0
  328. package/dist/types/pagination.types.d.ts +8 -0
  329. package/dist/types/roving-index.types.d.ts +2 -0
  330. package/dist/types/sparkline.types.d.ts +11 -0
  331. package/package.json +102 -4
@@ -0,0 +1,50 @@
1
+ import { JlElement } from '../base/jl-element';
2
+ import type { DrawerPlacement, DrawerSize } from '../types/jl-drawer.types';
3
+ export declare const DRAWER_PLACEMENTS: readonly DrawerPlacement[];
4
+ export declare const DRAWER_SIZES: readonly DrawerSize[];
5
+ /**
6
+ * A panel that slides over the page from an edge, on the browser's own modal `<dialog>`: focus stays inside, Escape
7
+ * and the backdrop close it. From the bottom it has rounded top corners and a handle, as sheets have on phones.
8
+ * The content goes in the default slot, header buttons in `slot="actions"`, the buttons at the bottom in
9
+ * `slot="footer"`.
10
+ */
11
+ export declare class JlDrawer extends JlElement {
12
+ static readonly selector = "jl-drawer";
13
+ readonly events: Readonly<import("@jadis/core").UseEventsHandler<{
14
+ open: undefined;
15
+ close: undefined;
16
+ }>>;
17
+ readonly heading: Readonly<Readonly<{
18
+ get(): string;
19
+ set(setter: string | ((prevState: string) => string)): void;
20
+ }>>;
21
+ readonly description: Readonly<Readonly<{
22
+ get(): string;
23
+ set(setter: string | ((prevState: string) => string)): void;
24
+ }>>;
25
+ readonly placement: Readonly<Readonly<{
26
+ get(): DrawerPlacement;
27
+ set(setter: ((prevState: DrawerPlacement) => DrawerPlacement) | DrawerPlacement): void;
28
+ }>>;
29
+ readonly size: Readonly<Readonly<{
30
+ get(): DrawerSize;
31
+ set(setter: ((prevState: DrawerSize) => DrawerSize) | DrawerSize): void;
32
+ }>>;
33
+ readonly open: Readonly<Readonly<{
34
+ get(): boolean;
35
+ set(setter: boolean | ((prevState: boolean) => boolean)): void;
36
+ }>>;
37
+ /** Keeps the drawer open on Escape and on a click outside: only its own buttons close it. */
38
+ readonly persistent: Readonly<Readonly<{
39
+ get(): boolean;
40
+ set(setter: boolean | ((prevState: boolean) => boolean)): void;
41
+ }>>;
42
+ private readonly _refs;
43
+ show(): void;
44
+ close(): void;
45
+ templateHtml(): Node;
46
+ templateCss(): string;
47
+ onConnect(): void;
48
+ private renderFooter;
49
+ private renderOpen;
50
+ }
@@ -0,0 +1,141 @@
1
+ import { BASE_STYLES } from "../styles/shared.js";
2
+ import { JlElement } from "../base/jl-element.js";
3
+ import { oneOf } from "../lib/attributes.js";
4
+ import { registerIcons } from "../lib/icons.js";
5
+ import { JlButton } from "../atoms/jl-button.js";
6
+ import jl_drawer_default from "./jl-drawer.css_raw.js";
7
+ import { css } from "@jadis/core";
8
+ import { X } from "lucide";
9
+ import { jsx, jsxs } from "@jadis/core/jsx-runtime";
10
+ // src/organisms/jl-drawer.tsx
11
+ registerIcons({ x: X });
12
+ var DRAWER_PLACEMENTS = [
13
+ "right",
14
+ "left",
15
+ "bottom"
16
+ ];
17
+ var DRAWER_SIZES = [
18
+ "md",
19
+ "sm",
20
+ "lg"
21
+ ];
22
+ /**
23
+ * A panel that slides over the page from an edge, on the browser's own modal `<dialog>`: focus stays inside, Escape
24
+ * and the backdrop close it. From the bottom it has rounded top corners and a handle, as sheets have on phones.
25
+ * The content goes in the default slot, header buttons in `slot="actions"`, the buttons at the bottom in
26
+ * `slot="footer"`.
27
+ */
28
+ var JlDrawer = class extends JlElement {
29
+ static selector = "jl-drawer";
30
+ events = this.useEvents();
31
+ heading = this.useChange("", (value) => {
32
+ this._refs.heading.textContent = value;
33
+ }, { attribute: "heading" });
34
+ description = this.useChange("", (value) => {
35
+ this._refs.description.textContent = value;
36
+ this._refs.description.hidden = value === "";
37
+ }, { attribute: "description" });
38
+ placement = this.useChange("right", (value) => this.reflect("placement", value), {
39
+ attribute: "placement",
40
+ parse: oneOf(DRAWER_PLACEMENTS, "right")
41
+ });
42
+ size = this.useChange("md", (value) => this.reflect("size", value), {
43
+ attribute: "size",
44
+ parse: oneOf(DRAWER_SIZES, "md")
45
+ });
46
+ open = this.useChange(false, (value) => this.renderOpen(value), { attribute: "open" });
47
+ /** Keeps the drawer open on Escape and on a click outside: only its own buttons close it. */
48
+ persistent = this.useChange(false, (value) => {
49
+ this._refs.close.hidden = value;
50
+ }, { attribute: "persistent" });
51
+ _refs = this.useRefs((ref) => ({
52
+ close: ref(".close"),
53
+ description: ref(".description"),
54
+ dialog: ref("dialog"),
55
+ footer: ref("footer"),
56
+ footerSlot: ref("slot[name=\"footer\"]"),
57
+ heading: ref("h2")
58
+ }));
59
+ show() {
60
+ this.open.set(true);
61
+ }
62
+ close() {
63
+ this.open.set(false);
64
+ }
65
+ templateHtml() {
66
+ return /* @__PURE__ */ jsxs("dialog", {
67
+ attrs: { part: "base" },
68
+ "aria-labelledby": "heading",
69
+ "aria-describedby": "description",
70
+ children: [
71
+ /* @__PURE__ */ jsx("span", {
72
+ class: "handle",
73
+ "aria-hidden": "true"
74
+ }),
75
+ /* @__PURE__ */ jsxs("header", { children: [/* @__PURE__ */ jsxs("div", {
76
+ class: "titles",
77
+ children: [/* @__PURE__ */ jsx("h2", { id: "heading" }), /* @__PURE__ */ jsx("p", {
78
+ class: "description",
79
+ id: "description",
80
+ hidden: true
81
+ })]
82
+ }), /* @__PURE__ */ jsxs("div", {
83
+ class: "actions",
84
+ children: [/* @__PURE__ */ jsx("slot", { name: "actions" }), /* @__PURE__ */ jsx(JlButton, {
85
+ class: "close",
86
+ variant: "ghost",
87
+ icon: "x",
88
+ hint: "Close",
89
+ size: "sm"
90
+ })]
91
+ })] }),
92
+ /* @__PURE__ */ jsx("div", {
93
+ class: "body",
94
+ children: /* @__PURE__ */ jsx("slot", {})
95
+ }),
96
+ /* @__PURE__ */ jsx("footer", {
97
+ hidden: true,
98
+ children: /* @__PURE__ */ jsx("slot", { name: "footer" })
99
+ })
100
+ ]
101
+ });
102
+ }
103
+ templateCss() {
104
+ return css`${BASE_STYLES}${jl_drawer_default}`;
105
+ }
106
+ onConnect() {
107
+ const dialog = this._refs.dialog;
108
+ this._refs.close.events.register("press", () => this.close());
109
+ this.on(dialog, "close", () => {
110
+ this.reflect("open", false);
111
+ this.open.set(false);
112
+ this.events.emit("close");
113
+ });
114
+ this.on(dialog, "cancel", (event) => {
115
+ if (this.persistent.get()) event.preventDefault();
116
+ });
117
+ this.on(dialog, "click", (event) => {
118
+ if (event.target === dialog && !this.persistent.get()) this.close();
119
+ });
120
+ this.renderFooter();
121
+ this.on(this._refs.footerSlot, "slotchange", () => this.renderFooter());
122
+ this.renderOpen(this.open.get());
123
+ }
124
+ renderFooter() {
125
+ this._refs.footer.hidden = this._refs.footerSlot.assignedElements().length === 0;
126
+ }
127
+ renderOpen(open) {
128
+ const dialog = this._refs.dialog;
129
+ if (open === dialog.open || !this.isConnected) return;
130
+ if (open) {
131
+ dialog.showModal();
132
+ this.reflect("open", true);
133
+ this.events.emit("open");
134
+ return;
135
+ }
136
+ this.reflect("open", false);
137
+ dialog.close();
138
+ }
139
+ };
140
+ JlDrawer.register();
141
+ export { DRAWER_PLACEMENTS, DRAWER_SIZES, JlDrawer };
@@ -0,0 +1,3 @@
1
+ // src/organisms/jl-navbar.css?raw
2
+ var jl_navbar_default = ":host {\n display: block;\n container-type: inline-size;\n --max-width: none;\n}\n\n:host([sticky]) {\n position: sticky;\n top: 0;\n z-index: 10;\n}\n\nheader {\n border-bottom: 1px solid var(--jl-line);\n background: var(--jl-surface);\n}\n\n.bar {\n display: flex;\n align-items: center;\n gap: 24px;\n max-width: var(--max-width);\n height: 60px;\n margin: 0 auto;\n padding: 0 20px;\n}\n\n.brand {\n display: flex;\n flex: none;\n align-items: center;\n color: var(--jl-text);\n font-size: var(--jl-font-lg);\n font-weight: 700;\n letter-spacing: -0.01em;\n}\n\n/* A logo and a name side by side, whatever element holds them. */\n::slotted([slot=\"brand\"]) {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n color: inherit;\n text-decoration: none;\n}\n\nul {\n display: flex;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.links {\n flex: 1;\n min-width: 0;\n}\n\n.links ul {\n align-items: center;\n gap: 2px;\n}\n\n.link {\n display: inline-flex;\n align-items: center;\n height: 34px;\n padding: 0 12px;\n border-radius: var(--jl-radius-sm);\n color: var(--jl-text-2);\n font-size: var(--jl-font-md);\n font-weight: 600;\n text-decoration: none;\n white-space: nowrap;\n transition:\n background var(--jl-fast) var(--jl-ease),\n color var(--jl-fast) var(--jl-ease);\n}\n\n.link:hover {\n background: var(--jl-surface-2);\n color: var(--jl-text);\n}\n\n.link[aria-current=\"page\"] {\n color: var(--jl-accent);\n}\n\n.actions {\n display: flex;\n flex: none;\n align-items: center;\n gap: 8px;\n}\n\n.toggle {\n display: none;\n flex: none;\n align-items: center;\n justify-content: center;\n width: var(--jl-control-md);\n height: var(--jl-control-md);\n margin-right: -6px;\n padding: 0;\n border: none;\n border-radius: var(--jl-radius-sm);\n background: none;\n color: var(--jl-text);\n cursor: pointer;\n}\n\n.toggle:hover {\n background: var(--jl-surface-2);\n}\n\n.drawer {\n display: none;\n}\n\n/* A narrow bar folds its links into the menu button; the button opens them as a list under the bar. */\n@container (width < 720px) {\n .bar {\n gap: 12px;\n padding: 0 16px;\n }\n\n .links {\n display: none;\n }\n\n .actions {\n margin-left: auto;\n }\n\n .toggle {\n display: inline-flex;\n }\n\n .drawer:not([hidden]) {\n display: block;\n padding: 8px 12px 12px;\n border-top: 1px solid var(--jl-line);\n animation: drop var(--jl-fast) var(--jl-ease);\n }\n\n .drawer ul {\n flex-direction: column;\n gap: 2px;\n }\n\n .drawer .link {\n display: flex;\n height: 40px;\n }\n\n .drawer .link[aria-current=\"page\"] {\n background: var(--jl-accent-soft);\n }\n}\n\n@keyframes drop {\n from {\n opacity: 0;\n transform: translateY(-4px);\n }\n}\n";
3
+ export { jl_navbar_default as default };
@@ -0,0 +1,32 @@
1
+ import { JlElement } from '../base/jl-element';
2
+ import type { NavbarLink } from '../types/jl-navbar.types';
3
+ /**
4
+ * The bar at the top of an app or a site: the brand (`slot="brand"`), the main links, and actions
5
+ * (`slot="actions"`). When the bar itself is narrower than 720 pixels, the links fold into a menu button that opens
6
+ * them as a list under the bar.
7
+ */
8
+ export declare class JlNavbar extends JlElement {
9
+ static readonly selector = "jl-navbar";
10
+ readonly links: Readonly<Readonly<{
11
+ get(): NavbarLink[];
12
+ set(setter: NavbarLink[] | ((prevState: NavbarLink[]) => NavbarLink[])): void;
13
+ }>>;
14
+ /** Stays at the top of the window while the page scrolls. */
15
+ readonly sticky: Readonly<Readonly<{
16
+ get(): boolean;
17
+ set(setter: boolean | ((prevState: boolean) => boolean)): void;
18
+ }>>;
19
+ /** The navigation's name for screen readers. */
20
+ readonly label: Readonly<Readonly<{
21
+ get(): string;
22
+ set(setter: string | ((prevState: string) => string)): void;
23
+ }>>;
24
+ private readonly _refs;
25
+ templateHtml(): Node;
26
+ templateCss(): string;
27
+ onConnect(): void;
28
+ private renderLinks;
29
+ private link;
30
+ /** Opens or closes the list of links under the bar, on a narrow bar. */
31
+ private setDrawer;
32
+ }
@@ -0,0 +1,121 @@
1
+ import { BASE_STYLES } from "../styles/shared.js";
2
+ import { JlElement } from "../base/jl-element.js";
3
+ import { jsonOf } from "../lib/attributes.js";
4
+ import { registerIcons } from "../lib/icons.js";
5
+ import { JlIcon } from "../atoms/jl-icon.js";
6
+ import jl_navbar_default from "./jl-navbar.css_raw.js";
7
+ import { css } from "@jadis/core";
8
+ import { Menu, X } from "lucide";
9
+ import { jsx, jsxs } from "@jadis/core/jsx-runtime";
10
+ // src/organisms/jl-navbar.tsx
11
+ registerIcons({
12
+ menu: Menu,
13
+ x: X
14
+ });
15
+ var ICON_SIZE = 18;
16
+ var DEFAULT_LABEL = "Main";
17
+ var MENU_ICON = "menu";
18
+ var CLOSE_ICON = "x";
19
+ /**
20
+ * The bar at the top of an app or a site: the brand (`slot="brand"`), the main links, and actions
21
+ * (`slot="actions"`). When the bar itself is narrower than 720 pixels, the links fold into a menu button that opens
22
+ * them as a list under the bar.
23
+ */
24
+ var JlNavbar = class extends JlElement {
25
+ static selector = "jl-navbar";
26
+ links = this.useChange([], () => this.renderLinks(), {
27
+ attribute: "links",
28
+ parse: jsonOf([])
29
+ });
30
+ /** Stays at the top of the window while the page scrolls. */
31
+ sticky = this.useChange(false, (value) => this.reflect("sticky", value), { attribute: "sticky" });
32
+ /** The navigation's name for screen readers. */
33
+ label = this.useChange(DEFAULT_LABEL, (value) => {
34
+ this._refs.links.setAttribute("aria-label", value || DEFAULT_LABEL);
35
+ this._refs.drawer.setAttribute("aria-label", value || DEFAULT_LABEL);
36
+ }, { attribute: "label" });
37
+ _refs = this.useRefs((ref) => ({
38
+ drawer: ref(".drawer"),
39
+ drawerList: ref(".drawer ul"),
40
+ links: ref(".links"),
41
+ linksList: ref(".links ul"),
42
+ toggle: ref(".toggle"),
43
+ toggleIcon: ref(".toggle jl-icon")
44
+ }));
45
+ templateHtml() {
46
+ return /* @__PURE__ */ jsxs("header", {
47
+ attrs: { part: "base" },
48
+ children: [/* @__PURE__ */ jsxs("div", {
49
+ class: "bar",
50
+ children: [
51
+ /* @__PURE__ */ jsx("div", {
52
+ class: "brand",
53
+ children: /* @__PURE__ */ jsx("slot", { name: "brand" })
54
+ }),
55
+ /* @__PURE__ */ jsx("nav", {
56
+ class: "links",
57
+ children: /* @__PURE__ */ jsx("ul", {})
58
+ }),
59
+ /* @__PURE__ */ jsx("div", {
60
+ class: "actions",
61
+ children: /* @__PURE__ */ jsx("slot", { name: "actions" })
62
+ }),
63
+ /* @__PURE__ */ jsx("button", {
64
+ type: "button",
65
+ class: "toggle",
66
+ "aria-expanded": "false",
67
+ "aria-controls": "drawer",
68
+ "aria-label": "Menu",
69
+ children: /* @__PURE__ */ jsx(JlIcon, {
70
+ name: MENU_ICON,
71
+ size: ICON_SIZE
72
+ })
73
+ })
74
+ ]
75
+ }), /* @__PURE__ */ jsx("nav", {
76
+ class: "drawer",
77
+ id: "drawer",
78
+ hidden: true,
79
+ children: /* @__PURE__ */ jsx("ul", {})
80
+ })]
81
+ });
82
+ }
83
+ templateCss() {
84
+ return css`${BASE_STYLES}${jl_navbar_default}`;
85
+ }
86
+ onConnect() {
87
+ this.on(this._refs.toggle, "click", () => this.setDrawer(!this.hasAttribute("expanded")));
88
+ this.on(this._refs.drawer, "click", (event) => {
89
+ if (event.target.closest("a") !== null) this.setDrawer(false);
90
+ });
91
+ this.on(this._refs.drawer, "keydown", (event) => {
92
+ if (event.key === "Escape") {
93
+ this.setDrawer(false);
94
+ this._refs.toggle.focus();
95
+ }
96
+ });
97
+ }
98
+ renderLinks() {
99
+ const links = this.links.get();
100
+ this._refs.linksList.replaceChildren(...links.map((link) => this.link(link)));
101
+ this._refs.drawerList.replaceChildren(...links.map((link) => this.link(link)));
102
+ }
103
+ link(link) {
104
+ return /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("a", {
105
+ class: "link",
106
+ href: link.href,
107
+ "aria-current": link.active === true ? "page" : void 0,
108
+ children: link.label
109
+ }) });
110
+ }
111
+ /** Opens or closes the list of links under the bar, on a narrow bar. */
112
+ setDrawer(open) {
113
+ this._refs.drawer.hidden = !open;
114
+ this._refs.toggle.setAttribute("aria-expanded", String(open));
115
+ this._refs.toggle.setAttribute("aria-label", open ? "Close the menu" : "Menu");
116
+ this._refs.toggleIcon.name.set(open ? CLOSE_ICON : MENU_ICON);
117
+ this.reflect("expanded", open);
118
+ }
119
+ };
120
+ JlNavbar.register();
121
+ export { JlNavbar };
@@ -0,0 +1,3 @@
1
+ // src/organisms/jl-page-header.css?raw
2
+ var jl_page_header_default = ":host {\n display: block;\n}\n\n.page-header {\n display: grid;\n gap: 12px;\n}\n\n:host([divided]) .page-header {\n padding-bottom: 20px;\n border-bottom: 1px solid var(--jl-line);\n}\n\n.breadcrumb {\n color: var(--jl-muted);\n font-size: var(--jl-font-sm);\n line-height: 1.4;\n}\n\n/* The actions sit beside the heading while there is room, and wrap under it when there is not. */\n.main {\n display: flex;\n flex-wrap: wrap;\n align-items: flex-start;\n justify-content: space-between;\n gap: 12px 24px;\n}\n\n.titles {\n display: grid;\n flex: 1 1 320px;\n gap: 6px;\n min-width: 0;\n}\n\nh1 {\n color: var(--jl-text);\n font-size: 26px;\n font-weight: 700;\n letter-spacing: -0.02em;\n line-height: 1.25;\n overflow-wrap: anywhere;\n}\n\n.description {\n max-width: 72ch;\n color: var(--jl-muted);\n font-size: var(--jl-font-md);\n line-height: 1.55;\n}\n\n.actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n padding-top: 2px;\n}\n\n.meta {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n}\n";
3
+ export { jl_page_header_default as default };
@@ -0,0 +1,26 @@
1
+ import { JlElement } from '../base/jl-element';
2
+ /**
3
+ * The top of a page: its heading and what it is for, a breadcrumb above, the page's actions beside the heading
4
+ * (under it on a phone) and a row of badges under the description. `divided` draws a line under it all.
5
+ */
6
+ export declare class JlPageHeader extends JlElement {
7
+ static readonly selector = "jl-page-header";
8
+ readonly heading: Readonly<Readonly<{
9
+ get(): string;
10
+ set(setter: string | ((prevState: string) => string)): void;
11
+ }>>;
12
+ readonly description: Readonly<Readonly<{
13
+ get(): string;
14
+ set(setter: string | ((prevState: string) => string)): void;
15
+ }>>;
16
+ /** Draws a line under the header, between it and the page's content. */
17
+ readonly divided: Readonly<Readonly<{
18
+ get(): boolean;
19
+ set(setter: boolean | ((prevState: boolean) => boolean)): void;
20
+ }>>;
21
+ private readonly _refs;
22
+ templateHtml(): Node;
23
+ templateCss(): string;
24
+ onConnect(): void;
25
+ private renderSlots;
26
+ }
@@ -0,0 +1,85 @@
1
+ import { BASE_STYLES } from "../styles/shared.js";
2
+ import { JlElement } from "../base/jl-element.js";
3
+ import { hasSlotted } from "../lib/slots.js";
4
+ import jl_page_header_default from "./jl-page-header.css_raw.js";
5
+ import { css } from "@jadis/core";
6
+ import { jsx, jsxs } from "@jadis/core/jsx-runtime";
7
+ // src/organisms/jl-page-header.tsx
8
+ /**
9
+ * The top of a page: its heading and what it is for, a breadcrumb above, the page's actions beside the heading
10
+ * (under it on a phone) and a row of badges under the description. `divided` draws a line under it all.
11
+ */
12
+ var JlPageHeader = class extends JlElement {
13
+ static selector = "jl-page-header";
14
+ heading = this.useChange("", (value) => {
15
+ this._refs.heading.textContent = value;
16
+ }, { attribute: "heading" });
17
+ description = this.useChange("", (value) => {
18
+ this._refs.description.textContent = value;
19
+ this._refs.description.hidden = value === "";
20
+ }, { attribute: "description" });
21
+ /** Draws a line under the header, between it and the page's content. */
22
+ divided = this.useChange(false, (value) => this.reflect("divided", value), { attribute: "divided" });
23
+ _refs = this.useRefs((ref) => ({
24
+ actions: ref(".actions"),
25
+ actionsSlot: ref("slot[name=\"actions\"]"),
26
+ breadcrumb: ref(".breadcrumb"),
27
+ breadcrumbSlot: ref("slot[name=\"breadcrumb\"]"),
28
+ description: ref(".description"),
29
+ heading: ref("h1"),
30
+ meta: ref(".meta"),
31
+ metaSlot: ref("slot[name=\"meta\"]")
32
+ }));
33
+ templateHtml() {
34
+ return /* @__PURE__ */ jsxs("header", {
35
+ class: "page-header",
36
+ attrs: { part: "base" },
37
+ children: [
38
+ /* @__PURE__ */ jsx("div", {
39
+ class: "breadcrumb",
40
+ hidden: true,
41
+ children: /* @__PURE__ */ jsx("slot", { name: "breadcrumb" })
42
+ }),
43
+ /* @__PURE__ */ jsxs("div", {
44
+ class: "main",
45
+ children: [/* @__PURE__ */ jsxs("div", {
46
+ class: "titles",
47
+ children: [/* @__PURE__ */ jsx("h1", {}), /* @__PURE__ */ jsx("p", {
48
+ class: "description",
49
+ hidden: true
50
+ })]
51
+ }), /* @__PURE__ */ jsx("div", {
52
+ class: "actions",
53
+ hidden: true,
54
+ children: /* @__PURE__ */ jsx("slot", { name: "actions" })
55
+ })]
56
+ }),
57
+ /* @__PURE__ */ jsx("div", {
58
+ class: "meta",
59
+ hidden: true,
60
+ children: /* @__PURE__ */ jsx("slot", { name: "meta" })
61
+ })
62
+ ]
63
+ });
64
+ }
65
+ templateCss() {
66
+ return css`${BASE_STYLES}${jl_page_header_default}`;
67
+ }
68
+ onConnect() {
69
+ const refs = this._refs;
70
+ this.renderSlots();
71
+ for (const slot of [
72
+ refs.breadcrumbSlot,
73
+ refs.actionsSlot,
74
+ refs.metaSlot
75
+ ]) this.on(slot, "slotchange", () => this.renderSlots());
76
+ }
77
+ renderSlots() {
78
+ const refs = this._refs;
79
+ refs.breadcrumb.hidden = !hasSlotted(refs.breadcrumbSlot);
80
+ refs.actions.hidden = !hasSlotted(refs.actionsSlot);
81
+ refs.meta.hidden = !hasSlotted(refs.metaSlot);
82
+ }
83
+ };
84
+ JlPageHeader.register();
85
+ export { JlPageHeader };
@@ -0,0 +1,3 @@
1
+ // src/organisms/jl-side-nav.css?raw
2
+ var jl_side_nav_default = ":host {\n display: block;\n width: var(--width, 248px);\n height: 100%;\n min-height: 0;\n transition: width var(--jl-slow) var(--jl-ease);\n}\n\n:host([collapsed]) {\n width: var(--rail-width, 60px);\n}\n\nnav {\n display: flex;\n flex-direction: column;\n gap: 8px;\n height: 100%;\n padding: 12px 8px;\n overflow-x: hidden;\n overflow-y: auto;\n color: var(--jl-text-2);\n font-size: var(--jl-font-md);\n}\n\n::slotted([slot=\"footer\"]) {\n margin-top: auto;\n}\n\n.sections {\n display: grid;\n gap: 14px;\n}\n\n.section {\n display: grid;\n gap: 2px;\n}\n\n.section-label {\n padding: 4px 10px 6px;\n color: var(--jl-muted);\n font-size: 11px;\n font-weight: 650;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.items,\n.children {\n display: grid;\n gap: 2px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.children {\n margin-top: 2px;\n}\n\n.entry {\n position: relative;\n}\n\n.item {\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n min-height: 34px;\n padding: 0 10px;\n border: none;\n border-radius: var(--jl-radius-sm);\n background: none;\n color: inherit;\n font: inherit;\n font-weight: 550;\n text-align: start;\n text-decoration: none;\n white-space: nowrap;\n cursor: pointer;\n transition:\n background var(--jl-fast) var(--jl-ease),\n color var(--jl-fast) var(--jl-ease);\n}\n\n.item[data-depth=\"1\"] {\n padding-left: 36px;\n}\n\n.item[data-depth=\"2\"] {\n padding-left: 50px;\n}\n\n.item[data-depth=\"3\"] {\n padding-left: 64px;\n}\n\n.item:hover {\n background: var(--jl-surface-3);\n color: var(--jl-text);\n}\n\n.item[aria-current=\"page\"] {\n background: var(--jl-accent-soft);\n color: var(--jl-accent);\n}\n\n.item.holds-active {\n color: var(--jl-text);\n}\n\n.item-icon {\n color: var(--jl-faint);\n}\n\n.item:hover .item-icon,\n.item.holds-active .item-icon {\n color: var(--jl-text-2);\n}\n\n.item[aria-current=\"page\"] .item-icon {\n color: var(--jl-accent);\n}\n\n.item-initial {\n display: none;\n flex: none;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n border-radius: var(--jl-radius-xs);\n background: var(--jl-surface-3);\n color: var(--jl-text-2);\n font-size: 11px;\n font-weight: 700;\n}\n\n/* Nested items without an icon line their labels up under their parent's label. */\n.item:not([data-depth=\"0\"]) .item-initial {\n display: none;\n}\n.item-label {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.item-badge {\n flex: none;\n min-width: 20px;\n padding: 2px 6px;\n border-radius: var(--jl-radius-pill);\n background: var(--jl-surface-3);\n color: var(--jl-text-2);\n font-size: 11px;\n font-weight: 650;\n line-height: 14px;\n text-align: center;\n}\n\n.item[aria-current=\"page\"] .item-badge {\n background: var(--jl-accent);\n color: var(--jl-on-accent);\n}\n\n.expander jl-icon {\n transition: transform var(--jl-fast) var(--jl-ease);\n}\n\n.chevron {\n color: var(--jl-faint);\n transition: transform var(--jl-fast) var(--jl-ease);\n}\n\n.entry.open > .item .chevron,\n.entry.open > .expander jl-icon {\n transform: rotate(90deg);\n}\n\n/* The chevron of a parent that is also a link: its own button, over the end of the row. */\n.expander {\n position: absolute;\n top: 5px;\n right: 6px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 0;\n border: none;\n border-radius: var(--jl-radius-xs);\n background: none;\n color: var(--jl-faint);\n cursor: pointer;\n}\n\n.expander:hover {\n background: var(--jl-surface-3);\n color: var(--jl-text);\n}\n\n.entry:has(> .expander) > .item {\n padding-right: 36px;\n}\n\n/* The rail: icons only, centred; labels stay for screen readers, and show as tooltips. */\n:host([collapsed]) .section-label {\n height: 1px;\n margin: 4px 10px;\n padding: 0;\n overflow: hidden;\n background: var(--jl-line);\n color: transparent;\n}\n\n:host([collapsed]) .section:first-child .section-label {\n display: none;\n}\n\n:host([collapsed]) .item {\n justify-content: center;\n padding: 0;\n}\n\n:host([collapsed]) .item-label {\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n clip-path: inset(50%);\n}\n\n:host([collapsed]) .item-initial {\n display: inline-flex;\n}\n\n:host([collapsed]) .item-badge {\n position: absolute;\n top: 5px;\n right: 9px;\n min-width: 0;\n width: 8px;\n height: 8px;\n padding: 0;\n overflow: hidden;\n background: var(--jl-accent);\n color: transparent;\n}\n\n:host([collapsed]) .children {\n display: none;\n}\n";
3
+ export { jl_side_nav_default as default };
@@ -0,0 +1,60 @@
1
+ import { JlElement } from '../base/jl-element';
2
+ import type { SideNavSection } from '../types/jl-side-nav.types';
3
+ /**
4
+ * The navigation of an app, down its side: sections of items with icons, badges and nested items that open with
5
+ * a chevron. `value` is the active item (its parents open to show it); `collapsed` makes it a rail of icons, with
6
+ * the labels as tooltips. Items with an `href` are links; the others fire `select`.
7
+ */
8
+ export declare class JlSideNav extends JlElement {
9
+ static readonly selector = "jl-side-nav";
10
+ readonly events: Readonly<import("@jadis/core").UseEventsHandler<{
11
+ select: string;
12
+ }>>;
13
+ readonly sections: Readonly<Readonly<{
14
+ get(): SideNavSection[];
15
+ set(setter: SideNavSection[] | ((prevState: SideNavSection[]) => SideNavSection[])): void;
16
+ }>>;
17
+ /** The id of the active item. */
18
+ readonly value: Readonly<Readonly<{
19
+ get(): string;
20
+ set(setter: string | ((prevState: string) => string)): void;
21
+ }>>;
22
+ /** Shows only the icons, in a narrow rail; the labels become tooltips. */
23
+ readonly collapsed: Readonly<Readonly<{
24
+ get(): boolean;
25
+ set(setter: boolean | ((prevState: boolean) => boolean)): void;
26
+ }>>;
27
+ /** The name of the navigation for screen readers. */
28
+ readonly label: Readonly<Readonly<{
29
+ get(): string;
30
+ set(setter: string | ((prevState: string) => string)): void;
31
+ }>>;
32
+ private readonly _prefix;
33
+ /** The parents people opened, or that hold the active item. */
34
+ private readonly _state;
35
+ private readonly _refs;
36
+ templateHtml(): Node;
37
+ templateCss(): string;
38
+ onConnect(): void;
39
+ /** Opens or closes a parent item. */
40
+ toggleItem(id: string, force?: boolean): void;
41
+ private onClick;
42
+ private choose;
43
+ /** Up and Down move between the rows people can see, Right opens a parent, Left closes it or goes up to it. */
44
+ private onKey;
45
+ private openOrGoDown;
46
+ private closeOrGoUp;
47
+ private render;
48
+ private sectionNode;
49
+ private itemNode;
50
+ /**
51
+ * The row of an item: a link when it has an `href`, otherwise a button. In the rail, a parent leads to its first
52
+ * leaf, since its children cannot show there.
53
+ */
54
+ private rowNode;
55
+ private rowContent;
56
+ /** Shows the children of open parents, and says so on their chevrons. */
57
+ private renderOpen;
58
+ /** Marks the active row, and the parents above it; opens them so it shows. */
59
+ private renderActive;
60
+ }