@syware/jlib 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/README.md +19 -3
  2. package/dist/all.js +6 -3
  3. package/dist/atoms/jl-app-icon.css.js +3 -0
  4. package/dist/atoms/jl-app-icon.js +1 -1
  5. package/dist/atoms/jl-avatar.css.js +3 -0
  6. package/dist/atoms/jl-avatar.js +1 -1
  7. package/dist/atoms/jl-badge.css.js +3 -0
  8. package/dist/atoms/jl-badge.js +1 -1
  9. package/dist/atoms/jl-button.css.js +3 -0
  10. package/dist/atoms/jl-button.js +1 -1
  11. package/dist/atoms/jl-checkbox.css.js +3 -0
  12. package/dist/atoms/jl-checkbox.js +1 -1
  13. package/dist/atoms/jl-chip.css.js +3 -0
  14. package/dist/atoms/jl-chip.d.ts +1 -0
  15. package/dist/atoms/jl-chip.js +5 -3
  16. package/dist/atoms/jl-divider.css.js +3 -0
  17. package/dist/atoms/jl-divider.js +1 -1
  18. package/dist/atoms/jl-icon.css.js +3 -0
  19. package/dist/atoms/jl-icon.js +1 -1
  20. package/dist/atoms/jl-input.css.js +3 -0
  21. package/dist/atoms/jl-input.d.ts +2 -0
  22. package/dist/atoms/jl-input.js +10 -4
  23. package/dist/atoms/jl-kbd.css.js +3 -0
  24. package/dist/atoms/jl-kbd.js +1 -1
  25. package/dist/atoms/jl-link.css.js +3 -0
  26. package/dist/atoms/jl-link.js +1 -1
  27. package/dist/atoms/jl-loading-bar.css.js +3 -0
  28. package/dist/atoms/jl-loading-bar.d.ts +38 -0
  29. package/dist/atoms/jl-loading-bar.js +121 -0
  30. package/dist/atoms/jl-progress-ring.css.js +3 -0
  31. package/dist/atoms/jl-progress-ring.js +1 -1
  32. package/dist/atoms/jl-progress.css.js +3 -0
  33. package/dist/atoms/jl-progress.js +1 -1
  34. package/dist/atoms/jl-rating.css.js +3 -0
  35. package/dist/atoms/jl-rating.d.ts +2 -0
  36. package/dist/atoms/jl-rating.js +14 -6
  37. package/dist/atoms/jl-select.css.js +3 -0
  38. package/dist/atoms/jl-select.js +1 -1
  39. package/dist/atoms/jl-skeleton.css.js +3 -0
  40. package/dist/atoms/jl-skeleton.js +1 -1
  41. package/dist/atoms/jl-slider.css.js +3 -0
  42. package/dist/atoms/jl-slider.js +1 -1
  43. package/dist/atoms/jl-spinner.css.js +3 -0
  44. package/dist/atoms/jl-spinner.d.ts +2 -0
  45. package/dist/atoms/jl-spinner.js +7 -3
  46. package/dist/atoms/jl-switch.css.js +3 -0
  47. package/dist/atoms/jl-switch.js +1 -1
  48. package/dist/atoms/jl-textarea.css.js +3 -0
  49. package/dist/atoms/jl-textarea.js +1 -1
  50. package/dist/base/jl-element.d.ts +8 -0
  51. package/dist/base/jl-element.js +5 -0
  52. package/dist/index.d.ts +5 -1
  53. package/dist/index.js +5 -2
  54. package/dist/lib/flow.js +23 -6
  55. package/dist/lib/texts-de.d.ts +111 -0
  56. package/dist/lib/texts-de.js +114 -0
  57. package/dist/lib/texts-fr.d.ts +111 -0
  58. package/dist/lib/texts-fr.js +114 -0
  59. package/dist/lib/texts.d.ts +180 -91
  60. package/dist/lib/texts.js +177 -9
  61. package/dist/molecules/jl-accordion-item.css.js +3 -0
  62. package/dist/molecules/jl-accordion-item.js +1 -1
  63. package/dist/molecules/jl-accordion.css.js +3 -0
  64. package/dist/molecules/jl-accordion.js +1 -1
  65. package/dist/molecules/jl-account-button.css.js +3 -0
  66. package/dist/molecules/jl-account-button.js +1 -1
  67. package/dist/molecules/jl-alert.css.js +3 -0
  68. package/dist/molecules/jl-alert.d.ts +1 -0
  69. package/dist/molecules/jl-alert.js +5 -3
  70. package/dist/molecules/jl-avatar-group.css.js +3 -0
  71. package/dist/molecules/jl-avatar-group.js +1 -1
  72. package/dist/molecules/jl-breadcrumb.css.js +3 -0
  73. package/dist/molecules/jl-breadcrumb.d.ts +2 -0
  74. package/dist/molecules/jl-breadcrumb.js +13 -7
  75. package/dist/molecules/jl-calendar.css.js +3 -0
  76. package/dist/molecules/jl-calendar.d.ts +1 -0
  77. package/dist/molecules/jl-calendar.js +8 -5
  78. package/dist/molecules/jl-card.css.js +3 -0
  79. package/dist/molecules/jl-card.js +1 -1
  80. package/dist/molecules/jl-chip-group.css.js +3 -0
  81. package/dist/molecules/jl-chip-group.d.ts +1 -0
  82. package/dist/molecules/jl-chip-group.js +5 -2
  83. package/dist/molecules/jl-code-block.css.js +3 -0
  84. package/dist/molecules/jl-code-block.js +2 -2
  85. package/dist/molecules/jl-combobox.css.js +3 -0
  86. package/dist/molecules/jl-combobox.d.ts +3 -1
  87. package/dist/molecules/jl-combobox.js +13 -8
  88. package/dist/molecules/jl-copy-button.css.js +3 -0
  89. package/dist/molecules/jl-copy-button.d.ts +1 -0
  90. package/dist/molecules/jl-copy-button.js +8 -6
  91. package/dist/molecules/jl-date-picker.css.js +3 -0
  92. package/dist/molecules/jl-date-picker.d.ts +1 -0
  93. package/dist/molecules/jl-date-picker.js +11 -8
  94. package/dist/molecules/jl-empty.css.js +3 -0
  95. package/dist/molecules/jl-empty.js +1 -1
  96. package/dist/molecules/jl-facts.css.js +3 -0
  97. package/dist/molecules/jl-facts.js +1 -1
  98. package/dist/molecules/jl-field.css.js +3 -0
  99. package/dist/molecules/jl-field.js +1 -1
  100. package/dist/molecules/jl-file-drop.css.js +3 -0
  101. package/dist/molecules/jl-file-drop.d.ts +1 -0
  102. package/dist/molecules/jl-file-drop.js +16 -7
  103. package/dist/molecules/jl-input-list.css.js +3 -0
  104. package/dist/molecules/jl-input-list.d.ts +3 -2
  105. package/dist/molecules/jl-input-list.js +11 -8
  106. package/dist/molecules/jl-list-item.css.js +3 -0
  107. package/dist/molecules/jl-list-item.js +1 -1
  108. package/dist/molecules/jl-load-more.css.js +3 -0
  109. package/dist/molecules/jl-load-more.d.ts +4 -2
  110. package/dist/molecules/jl-load-more.js +16 -9
  111. package/dist/molecules/jl-load-state.css.js +3 -0
  112. package/dist/molecules/jl-load-state.d.ts +13 -0
  113. package/dist/molecules/jl-load-state.js +63 -12
  114. package/dist/molecules/jl-menu.css.js +3 -0
  115. package/dist/molecules/jl-menu.js +1 -1
  116. package/dist/molecules/jl-number-input.css.js +3 -0
  117. package/dist/molecules/jl-number-input.d.ts +1 -0
  118. package/dist/molecules/jl-number-input.js +7 -4
  119. package/dist/molecules/jl-pagination.css.js +3 -0
  120. package/dist/molecules/jl-pagination.d.ts +2 -0
  121. package/dist/molecules/jl-pagination.js +18 -10
  122. package/dist/molecules/jl-popover.css.js +3 -0
  123. package/dist/molecules/jl-popover.js +1 -1
  124. package/dist/molecules/jl-radio-group.css.js +3 -0
  125. package/dist/molecules/jl-radio-group.d.ts +1 -0
  126. package/dist/molecules/jl-radio-group.js +5 -2
  127. package/dist/molecules/jl-search-button.css.js +3 -0
  128. package/dist/molecules/jl-search-button.d.ts +2 -1
  129. package/dist/molecules/jl-search-button.js +7 -5
  130. package/dist/molecules/jl-search.css.js +3 -0
  131. package/dist/molecules/jl-search.d.ts +2 -0
  132. package/dist/molecules/jl-search.js +10 -4
  133. package/dist/molecules/jl-segmented.css.js +3 -0
  134. package/dist/molecules/jl-segmented.js +1 -1
  135. package/dist/molecules/jl-stat.css.js +3 -0
  136. package/dist/molecules/jl-stat.js +1 -1
  137. package/dist/molecules/jl-steps.css.js +3 -0
  138. package/dist/molecules/jl-steps.d.ts +2 -0
  139. package/dist/molecules/jl-steps.js +10 -5
  140. package/dist/molecules/jl-tab-panel.css.js +3 -0
  141. package/dist/molecules/jl-tab-panel.js +1 -1
  142. package/dist/molecules/jl-tabs.css.js +3 -0
  143. package/dist/molecules/jl-tabs.js +1 -1
  144. package/dist/molecules/jl-tag-input.css.js +3 -0
  145. package/dist/molecules/jl-tag-input.d.ts +1 -0
  146. package/dist/molecules/jl-tag-input.js +9 -5
  147. package/dist/molecules/jl-timeline.css.js +3 -0
  148. package/dist/molecules/jl-timeline.js +1 -1
  149. package/dist/molecules/jl-toast.css.js +3 -0
  150. package/dist/molecules/jl-toast.d.ts +1 -0
  151. package/dist/molecules/jl-toast.js +5 -3
  152. package/dist/molecules/jl-tooltip.css.js +3 -0
  153. package/dist/molecules/jl-tooltip.js +1 -1
  154. package/dist/organisms/jl-command-palette.css.js +3 -0
  155. package/dist/organisms/jl-command-palette.d.ts +3 -1
  156. package/dist/organisms/jl-command-palette.js +23 -15
  157. package/dist/organisms/jl-confirm.css.js +3 -0
  158. package/dist/organisms/jl-confirm.d.ts +3 -0
  159. package/dist/organisms/jl-confirm.js +13 -12
  160. package/dist/organisms/jl-dialog.css.js +3 -0
  161. package/dist/organisms/jl-dialog.d.ts +1 -0
  162. package/dist/organisms/jl-dialog.js +5 -3
  163. package/dist/organisms/jl-drawer.css.js +3 -0
  164. package/dist/organisms/jl-drawer.d.ts +1 -0
  165. package/dist/organisms/jl-drawer.js +5 -3
  166. package/dist/organisms/jl-flow.css.js +3 -0
  167. package/dist/organisms/jl-flow.d.ts +2 -0
  168. package/dist/organisms/jl-flow.js +26 -17
  169. package/dist/organisms/jl-navbar.css.js +3 -0
  170. package/dist/organisms/jl-navbar.d.ts +3 -0
  171. package/dist/organisms/jl-navbar.js +17 -8
  172. package/dist/organisms/jl-page-header.css.js +3 -0
  173. package/dist/organisms/jl-page-header.js +1 -1
  174. package/dist/organisms/jl-page-outlet.css.js +3 -0
  175. package/dist/organisms/jl-page-outlet.d.ts +34 -0
  176. package/dist/organisms/jl-page-outlet.js +107 -0
  177. package/dist/organisms/jl-side-nav.css.js +3 -0
  178. package/dist/organisms/jl-side-nav.d.ts +4 -2
  179. package/dist/organisms/jl-side-nav.js +18 -12
  180. package/dist/organisms/jl-tab-bar.css.js +3 -0
  181. package/dist/organisms/jl-tab-bar.d.ts +1 -0
  182. package/dist/organisms/jl-tab-bar.js +6 -3
  183. package/dist/organisms/jl-table.css.js +3 -0
  184. package/dist/organisms/jl-table.d.ts +2 -1
  185. package/dist/organisms/jl-table.js +10 -7
  186. package/dist/organisms/jl-toaster.css.js +3 -0
  187. package/dist/organisms/jl-toaster.d.ts +2 -1
  188. package/dist/organisms/jl-toaster.js +13 -10
  189. package/dist/organisms/jl-tree.css.js +3 -0
  190. package/dist/organisms/jl-tree.d.ts +6 -4
  191. package/dist/organisms/jl-tree.js +22 -16
  192. package/dist/styles/base.css.js +3 -0
  193. package/dist/styles/control.css.js +3 -0
  194. package/dist/styles/floating.css.js +3 -0
  195. package/dist/styles/shared.js +4 -4
  196. package/dist/styles/tokens.css.js +3 -0
  197. package/dist/templates/jl-app-shell.css.js +3 -0
  198. package/dist/templates/jl-app-shell.d.ts +1 -0
  199. package/dist/templates/jl-app-shell.js +5 -3
  200. package/dist/templates/jl-auth-layout.css.js +3 -0
  201. package/dist/templates/jl-auth-layout.d.ts +4 -3
  202. package/dist/templates/jl-auth-layout.js +14 -12
  203. package/dist/templates/jl-page.css.js +3 -0
  204. package/dist/templates/jl-page.d.ts +1 -0
  205. package/dist/templates/jl-page.js +5 -2
  206. package/dist/templates/jl-split-view.css.js +3 -0
  207. package/dist/templates/jl-split-view.d.ts +1 -0
  208. package/dist/templates/jl-split-view.js +6 -5
  209. package/dist/templates/jl-stack.css.js +3 -0
  210. package/dist/templates/jl-stack.d.ts +17 -0
  211. package/dist/templates/jl-stack.js +36 -0
  212. package/dist/types/jl-stack.types.d.ts +2 -0
  213. package/dist/types/texts.types.d.ts +29 -4
  214. package/package.json +5 -4
  215. package/dist/atoms/jl-app-icon.css_raw.js +0 -3
  216. package/dist/atoms/jl-avatar.css_raw.js +0 -3
  217. package/dist/atoms/jl-badge.css_raw.js +0 -3
  218. package/dist/atoms/jl-button.css_raw.js +0 -3
  219. package/dist/atoms/jl-checkbox.css_raw.js +0 -3
  220. package/dist/atoms/jl-chip.css_raw.js +0 -3
  221. package/dist/atoms/jl-divider.css_raw.js +0 -3
  222. package/dist/atoms/jl-icon.css_raw.js +0 -3
  223. package/dist/atoms/jl-input.css_raw.js +0 -3
  224. package/dist/atoms/jl-kbd.css_raw.js +0 -3
  225. package/dist/atoms/jl-link.css_raw.js +0 -3
  226. package/dist/atoms/jl-progress-ring.css_raw.js +0 -3
  227. package/dist/atoms/jl-progress.css_raw.js +0 -3
  228. package/dist/atoms/jl-rating.css_raw.js +0 -3
  229. package/dist/atoms/jl-select.css_raw.js +0 -3
  230. package/dist/atoms/jl-skeleton.css_raw.js +0 -3
  231. package/dist/atoms/jl-slider.css_raw.js +0 -3
  232. package/dist/atoms/jl-spinner.css_raw.js +0 -3
  233. package/dist/atoms/jl-switch.css_raw.js +0 -3
  234. package/dist/atoms/jl-textarea.css_raw.js +0 -3
  235. package/dist/molecules/jl-accordion-item.css_raw.js +0 -3
  236. package/dist/molecules/jl-accordion.css_raw.js +0 -3
  237. package/dist/molecules/jl-account-button.css_raw.js +0 -3
  238. package/dist/molecules/jl-alert.css_raw.js +0 -3
  239. package/dist/molecules/jl-avatar-group.css_raw.js +0 -3
  240. package/dist/molecules/jl-breadcrumb.css_raw.js +0 -3
  241. package/dist/molecules/jl-calendar.css_raw.js +0 -3
  242. package/dist/molecules/jl-card.css_raw.js +0 -3
  243. package/dist/molecules/jl-chip-group.css_raw.js +0 -3
  244. package/dist/molecules/jl-code-block.css_raw.js +0 -3
  245. package/dist/molecules/jl-combobox.css_raw.js +0 -3
  246. package/dist/molecules/jl-copy-button.css_raw.js +0 -3
  247. package/dist/molecules/jl-date-picker.css_raw.js +0 -3
  248. package/dist/molecules/jl-empty.css_raw.js +0 -3
  249. package/dist/molecules/jl-facts.css_raw.js +0 -3
  250. package/dist/molecules/jl-field.css_raw.js +0 -3
  251. package/dist/molecules/jl-file-drop.css_raw.js +0 -3
  252. package/dist/molecules/jl-input-list.css_raw.js +0 -3
  253. package/dist/molecules/jl-list-item.css_raw.js +0 -3
  254. package/dist/molecules/jl-load-more.css_raw.js +0 -3
  255. package/dist/molecules/jl-load-state.css_raw.js +0 -3
  256. package/dist/molecules/jl-menu.css_raw.js +0 -3
  257. package/dist/molecules/jl-number-input.css_raw.js +0 -3
  258. package/dist/molecules/jl-pagination.css_raw.js +0 -3
  259. package/dist/molecules/jl-popover.css_raw.js +0 -3
  260. package/dist/molecules/jl-radio-group.css_raw.js +0 -3
  261. package/dist/molecules/jl-search-button.css_raw.js +0 -3
  262. package/dist/molecules/jl-search.css_raw.js +0 -3
  263. package/dist/molecules/jl-segmented.css_raw.js +0 -3
  264. package/dist/molecules/jl-stat.css_raw.js +0 -3
  265. package/dist/molecules/jl-steps.css_raw.js +0 -3
  266. package/dist/molecules/jl-tab-panel.css_raw.js +0 -3
  267. package/dist/molecules/jl-tabs.css_raw.js +0 -3
  268. package/dist/molecules/jl-tag-input.css_raw.js +0 -3
  269. package/dist/molecules/jl-timeline.css_raw.js +0 -3
  270. package/dist/molecules/jl-toast.css_raw.js +0 -3
  271. package/dist/molecules/jl-tooltip.css_raw.js +0 -3
  272. package/dist/organisms/jl-command-palette.css_raw.js +0 -3
  273. package/dist/organisms/jl-confirm.css_raw.js +0 -3
  274. package/dist/organisms/jl-dialog.css_raw.js +0 -3
  275. package/dist/organisms/jl-drawer.css_raw.js +0 -3
  276. package/dist/organisms/jl-flow.css_raw.js +0 -3
  277. package/dist/organisms/jl-navbar.css_raw.js +0 -3
  278. package/dist/organisms/jl-page-header.css_raw.js +0 -3
  279. package/dist/organisms/jl-side-nav.css_raw.js +0 -3
  280. package/dist/organisms/jl-tab-bar.css_raw.js +0 -3
  281. package/dist/organisms/jl-table.css_raw.js +0 -3
  282. package/dist/organisms/jl-toaster.css_raw.js +0 -3
  283. package/dist/organisms/jl-tree.css_raw.js +0 -3
  284. package/dist/styles/base.css_raw.js +0 -3
  285. package/dist/styles/control.css_raw.js +0 -3
  286. package/dist/styles/floating.css_raw.js +0 -3
  287. package/dist/styles/tokens.css_raw.js +0 -3
  288. package/dist/templates/jl-app-shell.css_raw.js +0 -3
  289. package/dist/templates/jl-auth-layout.css_raw.js +0 -3
  290. package/dist/templates/jl-page.css_raw.js +0 -3
  291. package/dist/templates/jl-split-view.css_raw.js +0 -3
@@ -20,10 +20,12 @@ export declare class JlConfirm extends JlElement {
20
20
  get(): string;
21
21
  set(setter: string | ((prevState: string) => string)): void;
22
22
  }>>;
23
+ /** The confirm button's text; jlib's own when empty. */
23
24
  readonly confirmLabel: Readonly<Readonly<{
24
25
  get(): string;
25
26
  set(setter: string | ((prevState: string) => string)): void;
26
27
  }>>;
28
+ /** The cancel button's text; jlib's own when empty. */
27
29
  readonly cancelLabel: Readonly<Readonly<{
28
30
  get(): string;
29
31
  set(setter: string | ((prevState: string) => string)): void;
@@ -38,6 +40,7 @@ export declare class JlConfirm extends JlElement {
38
40
  ask(): Promise<boolean>;
39
41
  templateHtml(): Node;
40
42
  templateCss(): string;
43
+ protected drawTexts(): void;
41
44
  onConnect(): void;
42
45
  /** Every way the dialog closes ends in its close event: that is where the answer is given. */
43
46
  private openFor;
@@ -1,10 +1,10 @@
1
+ import { jlText } from "../lib/texts.js";
1
2
  import { BASE_STYLES } from "../styles/shared.js";
2
3
  import { JlElement } from "../base/jl-element.js";
3
4
  import { oneOf } from "../lib/attributes.js";
4
5
  import { define } from "../lib/define.js";
5
- import { jlText } from "../lib/texts.js";
6
6
  import { JlButton } from "../atoms/jl-button.js";
7
- import jl_confirm_default from "./jl-confirm.css_raw.js";
7
+ import jl_confirm_default from "./jl-confirm.css.js";
8
8
  import { JlDialog } from "./jl-dialog.js";
9
9
  import { css } from "@jadis/core";
10
10
  import { jsx, jsxs } from "@jadis/core/jsx-runtime";
@@ -15,8 +15,6 @@ var CONFIRM_VARIANTS = {
15
15
  accent: "primary",
16
16
  danger: "danger"
17
17
  };
18
- var DEFAULT_CONFIRM = "Confirm";
19
- var DEFAULT_CANCEL = "Cancel";
20
18
  var CLOSE = "close";
21
19
  /**
22
20
  * A yes-or-no question in a small modal dialog. `ask()` opens it and resolves `true` on confirm, `false` on cancel,
@@ -31,8 +29,10 @@ var JlConfirm = class extends JlElement {
31
29
  this._refs.text.textContent = value;
32
30
  this._refs.text.hidden = value === "";
33
31
  }, { attribute: "text" });
34
- confirmLabel = this.useChange(DEFAULT_CONFIRM, (value) => this._refs.confirm.label.set(value), { attribute: "confirm-label" });
35
- cancelLabel = this.useChange(DEFAULT_CANCEL, (value) => this._refs.cancel.label.set(value), { attribute: "cancel-label" });
32
+ /** The confirm button's text; jlib's own when empty. */
33
+ confirmLabel = this.useChange("", () => this.drawTexts(), { attribute: "confirm-label" });
34
+ /** The cancel button's text; jlib's own when empty. */
35
+ cancelLabel = this.useChange("", () => this.drawTexts(), { attribute: "cancel-label" });
36
36
  tone = this.useChange("accent", (value) => {
37
37
  this.reflect("tone", value);
38
38
  this._refs.confirm.variant.set(CONFIRM_VARIANTS[value]);
@@ -67,14 +67,12 @@ var JlConfirm = class extends JlElement {
67
67
  /* @__PURE__ */ jsx("slot", {}),
68
68
  /* @__PURE__ */ jsx(JlButton, {
69
69
  slot: "actions",
70
- class: "cancel",
71
- label: DEFAULT_CANCEL
70
+ class: "cancel"
72
71
  }),
73
72
  /* @__PURE__ */ jsx(JlButton, {
74
73
  slot: "actions",
75
74
  class: "confirm",
76
- variant: "primary",
77
- label: DEFAULT_CONFIRM
75
+ variant: "primary"
78
76
  })
79
77
  ]
80
78
  });
@@ -82,6 +80,10 @@ var JlConfirm = class extends JlElement {
82
80
  templateCss() {
83
81
  return css`${BASE_STYLES}${jl_confirm_default}`;
84
82
  }
83
+ drawTexts() {
84
+ this._refs.confirm.label.set(this.confirmLabel.get() || jlText("confirm"));
85
+ this._refs.cancel.label.set(this.cancelLabel.get() || jlText("cancel"));
86
+ }
85
87
  onConnect() {
86
88
  this._refs.cancel.events.register("press", () => this._refs.dialog.close());
87
89
  this._refs.confirm.events.register("press", () => {
@@ -130,7 +132,6 @@ function confirmDialog(options) {
130
132
  document.body.append(element);
131
133
  return element.ask().finally(() => element.remove());
132
134
  }
133
- var LEAVE_HEADING = "Leave without saving?";
134
135
  /**
135
136
  * Guards a form or an editor against leaving with changes not saved. Closing or reloading the tab asks the
136
137
  * browser's own question; the function it returns asks in the page, for the app's router to call before it moves
@@ -147,7 +148,7 @@ function guardLeave(options) {
147
148
  asking.pending ??= confirmDialog({
148
149
  cancelLabel: options.stayLabel ?? jlText("stay"),
149
150
  confirmLabel: options.leaveLabel ?? jlText("leave"),
150
- heading: options.heading ?? LEAVE_HEADING,
151
+ heading: options.heading ?? jlText("leaveHeading"),
151
152
  text: options.text ?? jlText("leaveText"),
152
153
  tone: "danger"
153
154
  }).finally(() => {
@@ -0,0 +1,3 @@
1
+ // src/organisms/jl-dialog.css?inline
2
+ var jl_dialog_default = ":host{--width:520px;display:contents}:host([size=sm]){--width:400px}:host([size=lg]){--width:820px}:host([size=full]){--width:100vw}dialog{width:min(var(--width), calc(100vw - 32px));border:1px solid var(--jl-line);border-radius:var(--jl-radius-lg);background:var(--jl-surface);max-height:min(760px,100dvh - 48px);color:var(--jl-text);font-size:var(--jl-font-md);box-shadow:var(--jl-shadow-lg);flex-direction:column;padding:0;display:flex}dialog:not([open]){display:none}:host([size=full]) dialog{height:calc(100dvh - 32px);max-height:calc(100dvh - 32px)}dialog[open]{animation:rise var(--jl-slow) var(--jl-ease)}dialog::backdrop{background:var(--jl-scrim);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}header{align-items:flex-start;gap:12px;padding:20px 16px 4px 24px;display:flex}.titles{flex:1;gap:4px;padding-top:4px;display:grid}h2{letter-spacing:-.01em;font-size:17px;font-weight:650;line-height:1.3}.description{color:var(--jl-muted);font-size:var(--jl-font-sm);line-height:1.5}.body{flex:1;padding:16px 24px;line-height:1.55;overflow:auto}footer{flex-wrap:wrap;justify-content:flex-end;gap:8px;padding:0 24px 20px;display:flex}@keyframes rise{0%{opacity:0;transform:translateY(8px)scale(.98)}}";
3
+ export { jl_dialog_default as default };
@@ -37,6 +37,7 @@ export declare class JlDialog extends JlElement {
37
37
  close(): void;
38
38
  templateHtml(): Node;
39
39
  templateCss(): string;
40
+ protected drawTexts(): void;
40
41
  onConnect(): void;
41
42
  private renderFooter;
42
43
  private renderOpen;
@@ -1,10 +1,10 @@
1
+ import { jlText } from "../lib/texts.js";
1
2
  import { BASE_STYLES } from "../styles/shared.js";
2
3
  import { JlElement } from "../base/jl-element.js";
3
4
  import { oneOf } from "../lib/attributes.js";
4
5
  import { registerIcons } from "../lib/icons.js";
5
- import { jlText } from "../lib/texts.js";
6
6
  import { JlButton } from "../atoms/jl-button.js";
7
- import jl_dialog_default from "./jl-dialog.css_raw.js";
7
+ import jl_dialog_default from "./jl-dialog.css.js";
8
8
  import { css } from "@jadis/core";
9
9
  import { X } from "lucide";
10
10
  import { jsx, jsxs } from "@jadis/core/jsx-runtime";
@@ -68,7 +68,6 @@ var JlDialog = class extends JlElement {
68
68
  class: "close",
69
69
  variant: "ghost",
70
70
  icon: "x",
71
- hint: jlText("close"),
72
71
  size: "sm"
73
72
  })] }),
74
73
  /* @__PURE__ */ jsx("div", {
@@ -85,6 +84,9 @@ var JlDialog = class extends JlElement {
85
84
  templateCss() {
86
85
  return css`${BASE_STYLES}${jl_dialog_default}`;
87
86
  }
87
+ drawTexts() {
88
+ this._refs.close.hint.set(jlText("close"));
89
+ }
88
90
  onConnect() {
89
91
  const dialog = this._refs.dialog;
90
92
  this._refs.close.events.register("press", () => this.close());
@@ -0,0 +1,3 @@
1
+ // src/organisms/jl-drawer.css?inline
2
+ var jl_drawer_default = ":host{--size:420px;--from:translateX(100%);display:contents}:host([size=sm]){--size:320px}:host([size=lg]){--size:640px}:host([placement=left]){--from:translateX(-100%)}:host([placement=bottom]){--size:60dvh;--from:translateY(100%)}:host([placement=bottom][size=sm]){--size:40dvh}:host([placement=bottom][size=lg]){--size:88dvh}dialog{width:min(var(--size), calc(100vw - 24px));border:none;border-left:1px solid var(--jl-line);background:var(--jl-surface);max-width:none;height:100dvh;max-height:none;color:var(--jl-text);font-size:var(--jl-font-md);box-shadow:var(--jl-shadow-lg);transform:var(--from);transition:transform var(--jl-slow) var(--jl-ease), display var(--jl-slow) allow-discrete, overlay var(--jl-slow) allow-discrete;flex-direction:column;margin:0;padding:0;display:none;position:fixed;inset:0 0 0 auto}dialog[open]{display:flex;transform:none}@starting-style{dialog[open]{transform:var(--from)}}:host([placement=left]) dialog{border-right:1px solid var(--jl-line);border-left:none;inset:0 auto 0 0}:host([placement=bottom]) dialog{width:100%;height:auto;max-height:var(--size);border:1px solid var(--jl-line);border-radius:var(--jl-radius-xl) var(--jl-radius-xl) 0 0;border-bottom:none;inset:auto 0 0}dialog::backdrop{transition:background var(--jl-slow) var(--jl-ease), display var(--jl-slow) allow-discrete, overlay var(--jl-slow) allow-discrete;background:0 0}dialog[open]::backdrop{background:var(--jl-scrim)}@starting-style{dialog[open]::backdrop{background:0 0}}.handle{display:none}:host([placement=bottom]) .handle{border-radius:var(--jl-radius-pill);background:var(--jl-line-strong);flex:none;width:40px;height:4px;margin:10px auto 0;display:block}header{border-bottom:1px solid var(--jl-line);flex:none;align-items:flex-start;gap:12px;padding:18px 16px 14px 24px;display:flex}:host([placement=bottom]) header{padding-top:10px}.titles{flex:1;gap:4px;min-width:0;padding-top:4px;display:grid}h2{letter-spacing:-.01em;font-size:17px;font-weight:650;line-height:1.3}.description{color:var(--jl-muted);font-size:var(--jl-font-sm);line-height:1.5}.actions{flex:none;align-items:center;gap:4px;display:flex}.body{overscroll-behavior:contain;flex:1;min-height:0;padding:20px 24px;line-height:1.55;overflow:auto}footer{border-top:1px solid var(--jl-line);background:var(--jl-surface);flex-wrap:wrap;flex:none;justify-content:flex-end;gap:8px;padding:14px 24px;display:flex}:host([placement=bottom]) footer{padding-bottom:max(14px, env(safe-area-inset-bottom))}";
3
+ export { jl_drawer_default as default };
@@ -44,6 +44,7 @@ export declare class JlDrawer extends JlElement {
44
44
  close(): void;
45
45
  templateHtml(): Node;
46
46
  templateCss(): string;
47
+ protected drawTexts(): void;
47
48
  onConnect(): void;
48
49
  private renderFooter;
49
50
  private renderOpen;
@@ -1,10 +1,10 @@
1
+ import { jlText } from "../lib/texts.js";
1
2
  import { BASE_STYLES } from "../styles/shared.js";
2
3
  import { JlElement } from "../base/jl-element.js";
3
4
  import { oneOf } from "../lib/attributes.js";
4
5
  import { registerIcons } from "../lib/icons.js";
5
- import { jlText } from "../lib/texts.js";
6
6
  import { JlButton } from "../atoms/jl-button.js";
7
- import jl_drawer_default from "./jl-drawer.css_raw.js";
7
+ import jl_drawer_default from "./jl-drawer.css.js";
8
8
  import { css } from "@jadis/core";
9
9
  import { X } from "lucide";
10
10
  import { jsx, jsxs } from "@jadis/core/jsx-runtime";
@@ -86,7 +86,6 @@ var JlDrawer = class extends JlElement {
86
86
  class: "close",
87
87
  variant: "ghost",
88
88
  icon: "x",
89
- hint: jlText("close"),
90
89
  size: "sm"
91
90
  })]
92
91
  })] }),
@@ -104,6 +103,9 @@ var JlDrawer = class extends JlElement {
104
103
  templateCss() {
105
104
  return css`${BASE_STYLES}${jl_drawer_default}`;
106
105
  }
106
+ drawTexts() {
107
+ this._refs.close.hint.set(jlText("close"));
108
+ }
107
109
  onConnect() {
108
110
  const dialog = this._refs.dialog;
109
111
  this._refs.close.events.register("press", () => this.close());
@@ -0,0 +1,3 @@
1
+ // src/organisms/jl-flow.css?inline
2
+ var jl_flow_default = ":host{height:420px;min-height:0;display:block}.viewport{border:1px solid var(--jl-line);border-radius:var(--jl-radius-lg);background-color:var(--jl-surface-2);background-image:radial-gradient(circle, var(--jl-line-strong) 1px, transparent 1.2px);touch-action:none;-webkit-user-select:none;user-select:none;outline:none;height:100%;position:relative;overflow:clip}.viewport:focus-visible{box-shadow:var(--jl-focus-ring)}.world,.nodes,.edges{position:absolute;top:0;left:0}.world{transform-origin:0 0}.edges{pointer-events:none;overflow:visible}.edge{fill:none;stroke:color-mix(in srgb, var(--tone,var(--jl-muted)) 60%, var(--jl-line-strong));stroke-width:2px;stroke-linecap:round}.edge[data-tone=danger]{stroke-dasharray:6 5}.edge-hit{fill:none;stroke:#0000;stroke-width:14px;pointer-events:stroke;cursor:pointer}.edge-group:hover .edge{stroke:var(--tone,var(--jl-muted))}.edge-group.taken .edge{stroke:var(--tone,var(--jl-muted));stroke-width:3px}.edge-group.selected .edge{stroke:var(--jl-accent);stroke-width:3px}.draft{stroke:var(--jl-accent);stroke-dasharray:5 5}.node{--tone:var(--jl-accent);width:240px;height:64px;padding:0 var(--jl-space-3) var(--jl-space-1);border:1px solid var(--jl-line);border-radius:var(--jl-radius-lg);background:var(--jl-surface);box-shadow:var(--jl-shadow-sm);cursor:grab;transition:border-color var(--jl-fast) var(--jl-ease), box-shadow var(--jl-fast) var(--jl-ease);flex-direction:column;justify-content:center;display:flex;position:absolute;top:0;left:0}.node:hover{border-color:var(--jl-line-strong)}.node:focus-visible{box-shadow:var(--jl-focus-ring);outline:none}.node[data-status=running]{--state:var(--jl-info);box-shadow:0 0 0 3px color-mix(in srgb, var(--jl-info) 30%, transparent)}.node[data-status=done]{--state:var(--jl-ok);border-color:color-mix(in srgb, var(--jl-ok) 55%, var(--jl-line))}.node[data-status=waiting]{--state:var(--jl-brand);border-color:var(--jl-brand);box-shadow:0 0 0 3px color-mix(in srgb, var(--jl-brand) 30%, transparent)}.node[data-status=failed]{--state:var(--jl-danger);border-color:var(--jl-danger)}.node.selected{border-color:var(--jl-accent);box-shadow:0 0 0 3px var(--jl-accent-soft)}.head{align-items:center;gap:var(--jl-space-3);min-width:0;display:flex}.node:has(.detail){justify-content:flex-start;padding-top:10px}.detail{border-top:1px dashed var(--jl-line);color:var(--jl-muted);line-height:16px;font-size:var(--jl-font-xs);text-overflow:ellipsis;white-space:nowrap;margin-top:6px;padding-top:5px;overflow:hidden}.problem{color:var(--jl-danger);flex:none;display:inline-flex}.status{background:var(--state);width:20px;height:20px;color:var(--jl-on-accent);border-radius:50%;flex:none;justify-content:center;align-items:center;display:inline-flex}.node[data-status=running] .status jl-icon{animation:1s linear infinite spin}@keyframes spin{to{rotate:360deg}}.input{border:2px solid var(--jl-surface);background:var(--jl-line-strong);border-radius:50%;width:10px;height:10px;position:absolute;top:-5px;left:50%;transform:translate(-50%)}.icon{border-radius:var(--jl-radius);background:color-mix(in srgb, var(--tone) 14%, var(--jl-surface));width:32px;height:32px;color:var(--tone);flex:none;justify-content:center;align-items:center;display:inline-flex}.text{flex:1;min-width:0;display:grid}.label,.description{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.label{color:var(--jl-text);font-size:var(--jl-font-sm);font-weight:600}.description{color:var(--jl-muted);font-size:var(--jl-font-xs)}.ports{height:22px;position:absolute;bottom:-11px;left:0;right:0}.port{--tone:var(--jl-muted);align-items:center;gap:var(--jl-space-1);border:1px solid color-mix(in srgb, var(--tone) 35%, var(--jl-line));border-radius:var(--jl-radius-pill);background:var(--jl-surface);height:22px;color:color-mix(in srgb, var(--tone) 80%, var(--jl-text));font-size:var(--jl-font-xs);white-space:nowrap;cursor:crosshair;padding:0 7px;font-weight:600;display:inline-flex;position:absolute;top:0;transform:translate(-50%)}.port:has(.add){padding-right:3px}.port[data-taken]{border-color:var(--tone);background:color-mix(in srgb, var(--tone) 14%, var(--jl-surface))}.dot{background:var(--tone);border-radius:50%;flex:none;width:7px;height:7px}.port-label{text-overflow:ellipsis;min-width:0;overflow:hidden}.add,.remove-edge{cursor:pointer;border-radius:50%;justify-content:center;align-items:center;padding:0;display:inline-flex}.add{background:color-mix(in srgb, var(--tone) 16%, var(--jl-surface));width:16px;height:16px;color:var(--tone);border:none}.add:hover{background:var(--tone);color:var(--jl-surface)}.remove-edge{border:1px solid var(--jl-line);background:var(--jl-surface);width:24px;height:24px;color:var(--jl-danger);position:absolute;top:0;left:0}.remove-edge:hover{border-color:var(--jl-danger);background:var(--jl-danger);color:var(--jl-on-danger)}.empty{padding:var(--jl-space-6);color:var(--jl-muted);text-align:center;pointer-events:none;place-items:center;display:grid;position:absolute;inset:0}.empty[hidden]{display:none}.empty ::slotted(*){pointer-events:auto}.controls{bottom:var(--jl-space-3);left:var(--jl-space-3);border:1px solid var(--jl-line);border-radius:var(--jl-radius);background:var(--jl-surface);align-items:center;gap:2px;padding:2px;display:flex;position:absolute}.control{width:var(--jl-control-sm);height:var(--jl-control-sm);border-radius:var(--jl-radius-sm);color:var(--jl-accent);cursor:pointer;transition:background var(--jl-fast) var(--jl-ease);background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.control:hover{background:var(--jl-accent-soft)}.zoom-label{min-width:40px;color:var(--jl-muted);font-size:var(--jl-font-xs);font-variant-numeric:tabular-nums;text-align:center}[data-tone=neutral]{--tone:var(--jl-muted)}[data-tone=accent]{--tone:var(--jl-accent)}[data-tone=ok]{--tone:var(--jl-ok)}[data-tone=warn]{--tone:var(--jl-warn)}[data-tone=danger]{--tone:var(--jl-danger)}[data-tone=info]{--tone:var(--jl-info)}:host([readonly]) .node,:host([readonly]) .port{cursor:pointer}:host([readonly]) .tidy{display:none}";
3
+ export { jl_flow_default as default };
@@ -57,6 +57,8 @@ export declare class JlFlow extends JlElement {
57
57
  layout(): void;
58
58
  templateHtml(): Node;
59
59
  templateCss(): string;
60
+ protected drawTexts(): void;
61
+ private renderLabel;
60
62
  onConnect(): void;
61
63
  private show;
62
64
  /** An edit: drawn, kept, and sent to the page. */
@@ -1,12 +1,12 @@
1
+ import { jlText } from "../lib/texts.js";
1
2
  import { BASE_STYLES } from "../styles/shared.js";
2
3
  import { JlElement } from "../base/jl-element.js";
3
4
  import { jsonOf } from "../lib/attributes.js";
4
5
  import { registerIcons } from "../lib/icons.js";
5
- import { jlText } from "../lib/texts.js";
6
6
  import { JlIcon } from "../atoms/jl-icon.js";
7
7
  import { setOrRemove, svgElement } from "../lib/dom.js";
8
8
  import { FLOW_NODE, FLOW_ZOOM, centeredAt, connect, edgeEnds, edgeMidpoint, edgePath, fitView, isEdgeTaken, isPortFree, layoutFlow, moveNode, nodeAt, nodeHeight, outputAnchor, portX, portsOf, positionAfter, removeEdge, removeNode, revealIn, snap, toWorld, zoomAt } from "../lib/flow.js";
9
- import jl_flow_default from "./jl-flow.css_raw.js";
9
+ import jl_flow_default from "./jl-flow.css.js";
10
10
  import { css } from "@jadis/core";
11
11
  import { Check, CircleAlert, Hourglass, LoaderCircle, Maximize, Minus, Plus, WandSparkles, X } from "lucide";
12
12
  import { Fragment, jsx, jsxs } from "@jadis/core/jsx-runtime";
@@ -116,7 +116,7 @@ var JlFlow = class extends JlElement {
116
116
  */
117
117
  dropType = this.useChange("", () => void 0, { attribute: "drop-type" });
118
118
  /** The canvas's name for screen readers. */
119
- label = this.useChange("", (value) => this._refs.viewport.setAttribute("aria-label", value || jlText("flow")), { attribute: "label" });
119
+ label = this.useChange("", () => this.renderLabel(), { attribute: "label" });
120
120
  _state = {
121
121
  edge: "",
122
122
  fitted: false,
@@ -139,6 +139,7 @@ var JlFlow = class extends JlElement {
139
139
  };
140
140
  _refs = this.useRefs((ref) => ({
141
141
  empty: ref(".empty"),
142
+ emptySlot: ref("slot[name=\"empty\"]"),
142
143
  fit: ref(".fit"),
143
144
  nodes: ref(".nodes"),
144
145
  removeEdge: ref(".remove-edge"),
@@ -203,7 +204,6 @@ var JlFlow = class extends JlElement {
203
204
  class: "remove-edge",
204
205
  "data-control": "",
205
206
  hidden: true,
206
- "aria-label": jlText("removeEdge"),
207
207
  children: /* @__PURE__ */ jsx(JlIcon, {
208
208
  name: "x",
209
209
  size: ADD_ICON_SIZE
@@ -215,10 +215,7 @@ var JlFlow = class extends JlElement {
215
215
  class: "empty",
216
216
  "data-control": "",
217
217
  hidden: true,
218
- children: /* @__PURE__ */ jsx("slot", {
219
- name: "empty",
220
- children: "Nothing here yet."
221
- })
218
+ children: /* @__PURE__ */ jsx("slot", { name: "empty" })
222
219
  }),
223
220
  /* @__PURE__ */ jsxs("div", {
224
221
  class: "controls",
@@ -227,8 +224,6 @@ var JlFlow = class extends JlElement {
227
224
  /* @__PURE__ */ jsx("button", {
228
225
  type: "button",
229
226
  class: "control zoom-out",
230
- title: jlText("zoomOut"),
231
- "aria-label": jlText("zoomOut"),
232
227
  children: /* @__PURE__ */ jsx(JlIcon, {
233
228
  name: "minus",
234
229
  size: CONTROL_ICON_SIZE
@@ -238,8 +233,6 @@ var JlFlow = class extends JlElement {
238
233
  /* @__PURE__ */ jsx("button", {
239
234
  type: "button",
240
235
  class: "control zoom-in",
241
- title: jlText("zoomIn"),
242
- "aria-label": jlText("zoomIn"),
243
236
  children: /* @__PURE__ */ jsx(JlIcon, {
244
237
  name: "plus",
245
238
  size: CONTROL_ICON_SIZE
@@ -248,8 +241,6 @@ var JlFlow = class extends JlElement {
248
241
  /* @__PURE__ */ jsx("button", {
249
242
  type: "button",
250
243
  class: "control fit",
251
- title: jlText("fitView"),
252
- "aria-label": jlText("fitView"),
253
244
  children: /* @__PURE__ */ jsx(JlIcon, {
254
245
  name: "maximize",
255
246
  size: CONTROL_ICON_SIZE
@@ -258,8 +249,6 @@ var JlFlow = class extends JlElement {
258
249
  /* @__PURE__ */ jsx("button", {
259
250
  type: "button",
260
251
  class: "control tidy",
261
- title: jlText("tidyLayout"),
262
- "aria-label": jlText("tidyLayout"),
263
252
  children: /* @__PURE__ */ jsx(JlIcon, {
264
253
  name: "wand-sparkles",
265
254
  size: CONTROL_ICON_SIZE
@@ -273,6 +262,26 @@ var JlFlow = class extends JlElement {
273
262
  templateCss() {
274
263
  return css`${BASE_STYLES}${jl_flow_default}`;
275
264
  }
265
+ drawTexts() {
266
+ this.renderLabel();
267
+ this._refs.emptySlot.textContent = jlText("flowEmpty");
268
+ this._refs.removeEdge.setAttribute("aria-label", jlText("removeEdge"));
269
+ const controls = [
270
+ [this._refs.zoomOut, jlText("zoomOut")],
271
+ [this._refs.zoomIn, jlText("zoomIn")],
272
+ [this._refs.fit, jlText("fitView")],
273
+ [this._refs.tidy, jlText("tidyLayout")]
274
+ ];
275
+ for (const [button, text] of controls) {
276
+ button.title = text;
277
+ button.setAttribute("aria-label", text);
278
+ }
279
+ for (const node of this._nodes.values()) node.setAttribute("aria-roledescription", jlText("node"));
280
+ for (const port of this._refs.nodes.querySelectorAll(".port")) port.title = jlText("dragToConnect");
281
+ }
282
+ renderLabel() {
283
+ this._refs.viewport.setAttribute("aria-label", this.label.get() || jlText("flow"));
284
+ }
276
285
  onConnect() {
277
286
  const viewport = this._refs.viewport;
278
287
  this.on(viewport, "pointerdown", (event) => this.pointerDown(event));
@@ -584,7 +593,7 @@ var JlFlow = class extends JlElement {
584
593
  "data-node": id,
585
594
  tabIndex: 0,
586
595
  role: "group",
587
- "aria-roledescription": "node",
596
+ "aria-roledescription": jlText("node"),
588
597
  attrs: { part: "node" }
589
598
  });
590
599
  this._nodes.set(id, element);
@@ -0,0 +1,3 @@
1
+ // src/organisms/jl-navbar.css?inline
2
+ var jl_navbar_default = ":host{--max-width:none;display:block;container-type:inline-size}:host([sticky]){z-index:10;position:sticky;top:0}header{border-bottom:1px solid var(--jl-line);background:var(--jl-surface)}.bar{max-width:var(--max-width);align-items:center;gap:24px;height:60px;margin:0 auto;padding:0 20px;display:flex}.brand{color:var(--jl-text);font-size:var(--jl-font-lg);letter-spacing:-.01em;flex:none;align-items:center;font-weight:700;display:flex}::slotted([slot=brand]){color:inherit;align-items:center;gap:8px;text-decoration:none;display:inline-flex}ul{margin:0;padding:0;list-style:none;display:flex}.links{flex:1;min-width:0}.links ul{align-items:center;gap:2px}.link{border-radius:var(--jl-radius-sm);height:34px;color:var(--jl-text-2);font-size:var(--jl-font-md);white-space:nowrap;transition:background var(--jl-fast) var(--jl-ease), color var(--jl-fast) var(--jl-ease);align-items:center;padding:0 12px;font-weight:600;text-decoration:none;display:inline-flex}.link:hover{background:var(--jl-surface-2);color:var(--jl-text)}.link[aria-current=page]{color:var(--jl-accent)}.actions{flex:none;align-items:center;gap:8px;display:flex}.toggle{width:var(--jl-control-md);height:var(--jl-control-md);border-radius:var(--jl-radius-sm);color:var(--jl-text);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;margin-right:-6px;padding:0;display:none}.toggle:hover{background:var(--jl-surface-2)}.drawer{display:none}@container (width<720px){.bar{gap:12px;padding:0 16px}.links{display:none}.actions{margin-left:auto}.toggle{display:inline-flex}.drawer:not([hidden]){border-top:1px solid var(--jl-line);animation:drop var(--jl-fast) var(--jl-ease);padding:8px 12px 12px;display:block}.drawer ul{flex-direction:column;gap:2px}.drawer .link{height:40px;display:flex}.drawer .link[aria-current=page]{background:var(--jl-accent-soft)}}@keyframes drop{0%{opacity:0;transform:translateY(-4px)}}";
3
+ export { jl_navbar_default as default };
@@ -27,6 +27,9 @@ export declare class JlNavbar extends JlElement {
27
27
  onConnect(): void;
28
28
  private renderLinks;
29
29
  private link;
30
+ protected drawTexts(): void;
31
+ private renderLabel;
32
+ private renderToggleLabel;
30
33
  /** Opens or closes the list of links under the bar, on a narrow bar. */
31
34
  private setDrawer;
32
35
  }
@@ -1,10 +1,10 @@
1
+ import { jlText } from "../lib/texts.js";
1
2
  import { BASE_STYLES } from "../styles/shared.js";
2
3
  import { JlElement } from "../base/jl-element.js";
3
4
  import { jsonOf } from "../lib/attributes.js";
4
5
  import { registerIcons } from "../lib/icons.js";
5
- import { jlText } from "../lib/texts.js";
6
6
  import { JlIcon } from "../atoms/jl-icon.js";
7
- import jl_navbar_default from "./jl-navbar.css_raw.js";
7
+ import jl_navbar_default from "./jl-navbar.css.js";
8
8
  import { css } from "@jadis/core";
9
9
  import { Menu, X } from "lucide";
10
10
  import { jsx, jsxs } from "@jadis/core/jsx-runtime";
@@ -30,10 +30,7 @@ var JlNavbar = class extends JlElement {
30
30
  /** Stays at the top of the window while the page scrolls. */
31
31
  sticky = this.useChange(false, (value) => this.reflect("sticky", value), { attribute: "sticky" });
32
32
  /** The navigation's name for screen readers. */
33
- label = this.useChange(jlText("mainNavigation"), (value) => {
34
- this._refs.links.setAttribute("aria-label", value || jlText("mainNavigation"));
35
- this._refs.drawer.setAttribute("aria-label", value || jlText("mainNavigation"));
36
- }, { attribute: "label" });
33
+ label = this.useChange("", () => this.renderLabel(), { attribute: "label" });
37
34
  _refs = this.useRefs((ref) => ({
38
35
  drawer: ref(".drawer"),
39
36
  drawerList: ref(".drawer ul"),
@@ -65,7 +62,6 @@ var JlNavbar = class extends JlElement {
65
62
  class: "toggle",
66
63
  "aria-expanded": "false",
67
64
  "aria-controls": "drawer",
68
- "aria-label": jlText("menu"),
69
65
  children: /* @__PURE__ */ jsx(JlIcon, {
70
66
  name: MENU_ICON,
71
67
  size: ICON_SIZE
@@ -108,11 +104,24 @@ var JlNavbar = class extends JlElement {
108
104
  children: link.label
109
105
  }) });
110
106
  }
107
+ drawTexts() {
108
+ this.renderLabel();
109
+ this.renderToggleLabel();
110
+ }
111
+ renderLabel() {
112
+ const label = this.label.get() || jlText("mainNavigation");
113
+ this._refs.links.setAttribute("aria-label", label);
114
+ this._refs.drawer.setAttribute("aria-label", label);
115
+ }
116
+ renderToggleLabel() {
117
+ const open = !this._refs.drawer.hidden;
118
+ this._refs.toggle.setAttribute("aria-label", open ? jlText("closeMenu") : jlText("menu"));
119
+ }
111
120
  /** Opens or closes the list of links under the bar, on a narrow bar. */
112
121
  setDrawer(open) {
113
122
  this._refs.drawer.hidden = !open;
114
123
  this._refs.toggle.setAttribute("aria-expanded", String(open));
115
- this._refs.toggle.setAttribute("aria-label", open ? jlText("closeMenu") : jlText("menu"));
124
+ this.renderToggleLabel();
116
125
  this._refs.toggleIcon.name.set(open ? CLOSE_ICON : MENU_ICON);
117
126
  this.reflect("expanded", open);
118
127
  }
@@ -0,0 +1,3 @@
1
+ // src/organisms/jl-page-header.css?inline
2
+ var jl_page_header_default = ":host{display:block}.page-header{gap:12px;display:grid}:host([divided]) .page-header{border-bottom:1px solid var(--jl-line);padding-bottom:20px}.breadcrumb{color:var(--jl-muted);font-size:var(--jl-font-sm);line-height:1.4}.main{flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:12px 24px;display:flex}.titles{flex:320px;gap:6px;min-width:0;display:grid}h1{color:var(--jl-text);letter-spacing:-.02em;overflow-wrap:anywhere;font-size:26px;font-weight:700;line-height:1.25}.description{max-width:72ch;color:var(--jl-muted);font-size:var(--jl-font-md);line-height:1.55}.actions{flex-wrap:wrap;align-items:center;gap:8px;padding-top:2px;display:flex}.meta{flex-wrap:wrap;align-items:center;gap:8px;display:flex}";
3
+ export { jl_page_header_default as default };
@@ -1,7 +1,7 @@
1
1
  import { BASE_STYLES } from "../styles/shared.js";
2
2
  import { JlElement } from "../base/jl-element.js";
3
3
  import { hasSlotted } from "../lib/slots.js";
4
- import jl_page_header_default from "./jl-page-header.css_raw.js";
4
+ import jl_page_header_default from "./jl-page-header.css.js";
5
5
  import { css } from "@jadis/core";
6
6
  import { jsx, jsxs } from "@jadis/core/jsx-runtime";
7
7
  // src/organisms/jl-page-header.tsx
@@ -0,0 +1,3 @@
1
+ // src/organisms/jl-page-outlet.css?inline
2
+ var jl_page_outlet_default = ":host{grid-template:1fr/minmax(0,1fr);min-height:100%;display:grid;position:relative}::slotted(*){grid-area:1/1}.line{z-index:1;grid-area:1/1;align-self:start;position:sticky;top:0}.next{visibility:hidden;height:0;position:absolute;inset:0 0 auto;overflow:hidden}";
3
+ export { jl_page_outlet_default as default };
@@ -0,0 +1,34 @@
1
+ import { JlElement } from '../base/jl-element';
2
+ /**
3
+ * Where an app's pages show, one at a time. A new page loads out of sight while the current one stays, usable,
4
+ * under a line that says the next one is on its way; it takes the current one's place once its load states have
5
+ * their data, or after `max-wait`, so a page never shows half drawn. The first page shows at once. It is the router's
6
+ * way to show its pages: `router.mountOn(outlet, { show: (page) => outlet.show(page) })`.
7
+ */
8
+ export declare class JlPageOutlet extends JlElement {
9
+ static readonly selector = "jl-page-outlet";
10
+ readonly events: Readonly<import("@jadis/core").UseEventsHandler<{
11
+ show: HTMLElement;
12
+ }>>;
13
+ /** The longest the current page stays while the next one loads, in milliseconds. */
14
+ readonly maxWait: Readonly<Readonly<{
15
+ get(): number;
16
+ set(setter: number | ((prevState: number) => number)): void;
17
+ }>>;
18
+ private readonly _swap;
19
+ private readonly _refs;
20
+ /**
21
+ * Shows a page: at once when none shows yet, else once it has its data, the current one staying until then. A page
22
+ * still loading when another comes is dropped.
23
+ */
24
+ show(page: HTMLElement): void;
25
+ templateHtml(): Node;
26
+ templateCss(): string;
27
+ private showOnceLoaded;
28
+ /** Puts the page in the current one's place. */
29
+ private reveal;
30
+ private pages;
31
+ private drawWaiting;
32
+ /** Brings the top of the new page into view, as a page loaded by the browser starts at its top. */
33
+ private scrollToTop;
34
+ }
@@ -0,0 +1,107 @@
1
+ import { BASE_STYLES } from "../styles/shared.js";
2
+ import { JlElement } from "../base/jl-element.js";
3
+ import { clampedNumber } from "../lib/attributes.js";
4
+ import { define } from "../lib/define.js";
5
+ import { setOrRemove } from "../lib/dom.js";
6
+ import { JlLoadingBar } from "../atoms/jl-loading-bar.js";
7
+ import { JlLoadState } from "../molecules/jl-load-state.js";
8
+ import jl_page_outlet_default from "./jl-page-outlet.css.js";
9
+ import { css } from "@jadis/core";
10
+ import { Fragment, jsx, jsxs } from "@jadis/core/jsx-runtime";
11
+ // src/organisms/jl-page-outlet.tsx
12
+ var DEFAULT_MAX_WAIT_MS = 3e3;
13
+ var MAX_WAIT_LIMIT_MS = 3e4;
14
+ var NEXT_SLOT = "next";
15
+ define(JlLoadingBar);
16
+ /** Resolves after some milliseconds, or once the signal aborts. */
17
+ function waitFor(milliseconds, signal) {
18
+ return new Promise((resolve) => {
19
+ const timer = setTimeout(resolve, milliseconds);
20
+ signal.addEventListener("abort", () => {
21
+ clearTimeout(timer);
22
+ resolve();
23
+ }, { once: true });
24
+ });
25
+ }
26
+ /**
27
+ * Where an app's pages show, one at a time. A new page loads out of sight while the current one stays, usable,
28
+ * under a line that says the next one is on its way; it takes the current one's place once its load states have
29
+ * their data, or after `max-wait`, so a page never shows half drawn. The first page shows at once. It is the router's
30
+ * way to show its pages: `router.mountOn(outlet, { show: (page) => outlet.show(page) })`.
31
+ */
32
+ var JlPageOutlet = class extends JlElement {
33
+ static selector = "jl-page-outlet";
34
+ events = this.useEvents();
35
+ /** The longest the current page stays while the next one loads, in milliseconds. */
36
+ maxWait = this.useChange(DEFAULT_MAX_WAIT_MS, () => void 0, {
37
+ attribute: "max-wait",
38
+ parse: clampedNumber(DEFAULT_MAX_WAIT_MS, 0, MAX_WAIT_LIMIT_MS)
39
+ });
40
+ _swap = {};
41
+ _refs = this.useRefs((ref) => ({ line: ref(JlLoadingBar) }));
42
+ /**
43
+ * Shows a page: at once when none shows yet, else once it has its data, the current one staying until then. A page
44
+ * still loading when another comes is dropped.
45
+ */
46
+ show(page) {
47
+ this._swap.pending?.abort();
48
+ for (const dropped of this.pages().filter((child) => child.slot === NEXT_SLOT)) dropped.remove();
49
+ if (this.pages().length === 0) {
50
+ this.append(page);
51
+ this.reveal(page);
52
+ return;
53
+ }
54
+ this.showOnceLoaded(page);
55
+ }
56
+ templateHtml() {
57
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
58
+ /* @__PURE__ */ jsx("jl-loading-bar", {
59
+ class: "line",
60
+ attrs: { part: "line" }
61
+ }),
62
+ /* @__PURE__ */ jsx("slot", {}),
63
+ /* @__PURE__ */ jsx("div", {
64
+ class: "next",
65
+ inert: true,
66
+ "aria-hidden": "true",
67
+ children: /* @__PURE__ */ jsx("slot", { name: NEXT_SLOT })
68
+ })
69
+ ] });
70
+ }
71
+ templateCss() {
72
+ return css`${BASE_STYLES}${jl_page_outlet_default}`;
73
+ }
74
+ async showOnceLoaded(page) {
75
+ const pending = new AbortController();
76
+ this._swap.pending = pending;
77
+ page.slot = NEXT_SLOT;
78
+ this.append(page);
79
+ this.drawWaiting(true);
80
+ await Promise.race([JlLoadState.whenSettled(page, pending.signal), waitFor(this.maxWait.get(), pending.signal)]);
81
+ if (pending.signal.aborted) return;
82
+ pending.abort();
83
+ this.reveal(page);
84
+ }
85
+ /** Puts the page in the current one's place. */
86
+ reveal(page) {
87
+ for (const left of this.pages().filter((child) => child !== page)) left.remove();
88
+ page.removeAttribute("slot");
89
+ this.drawWaiting(false);
90
+ this.scrollToTop();
91
+ this.events.emit("show", page);
92
+ }
93
+ pages() {
94
+ return [...this.children].filter((child) => child instanceof HTMLElement);
95
+ }
96
+ drawWaiting(waiting) {
97
+ setOrRemove(this, "aria-busy", waiting ? "true" : "");
98
+ this.whenRendered(() => this._refs.line.active.set(waiting));
99
+ }
100
+ /** Brings the top of the new page into view, as a page loaded by the browser starts at its top. */
101
+ scrollToTop() {
102
+ if (this.getBoundingClientRect().top >= 0) return;
103
+ this.scrollIntoView({ block: "start" });
104
+ }
105
+ };
106
+ JlPageOutlet.register();
107
+ export { JlPageOutlet };
@@ -0,0 +1,3 @@
1
+ // src/organisms/jl-side-nav.css?inline
2
+ var jl_side_nav_default = ":host{width:var(--width,248px);height:100%;min-height:0;transition:width var(--jl-slow) var(--jl-ease);display:block}:host([rail]){width:var(--rail-width,60px)}nav{height:100%;color:var(--jl-text-2);font-size:var(--jl-font-md);flex-direction:column;gap:8px;padding:12px 8px;display:flex;overflow:hidden auto}.bottom{flex-direction:column;gap:8px;margin-top:auto;display:flex}.fold{align-self:flex-start}:host([rail]) .fold{align-self:center}.sections{gap:14px;display:grid}.section{gap:2px;display:grid}.section-label{color:var(--jl-muted);letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;padding:4px 10px 6px;font-size:11px;font-weight:650}.items,.children{gap:2px;margin:0;padding:0;list-style:none;display:grid}.children{margin-top:2px}.entry{position:relative}.item{border-radius:var(--jl-radius-sm);width:100%;min-height:34px;color:inherit;font:inherit;text-align:start;white-space:nowrap;cursor:pointer;transition:background var(--jl-fast) var(--jl-ease), color var(--jl-fast) var(--jl-ease);background:0 0;border:none;align-items:center;gap:10px;padding:0 10px;font-weight:550;text-decoration:none;display:flex}.item[data-depth=\"1\"]{padding-left:36px}.item[data-depth=\"2\"]{padding-left:50px}.item[data-depth=\"3\"]{padding-left:64px}.item:hover{background:var(--jl-surface-3);color:var(--jl-text)}.item[aria-current=page]{background:var(--jl-accent-soft);color:var(--jl-accent)}.item.holds-active{color:var(--jl-text)}.item-icon{color:var(--jl-faint)}.item:hover .item-icon,.item.holds-active .item-icon{color:var(--jl-text-2)}.item[aria-current=page] .item-icon{color:var(--jl-accent)}.item-initial{border-radius:var(--jl-radius-xs);background:var(--jl-surface-3);width:20px;height:20px;color:var(--jl-text-2);flex:none;justify-content:center;align-items:center;font-size:11px;font-weight:700;display:none}.item:not([data-depth=\"0\"]) .item-initial{display:none}.item-label{text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.item-badge{border-radius:var(--jl-radius-pill);background:var(--jl-surface-3);min-width:20px;color:var(--jl-text-2);text-align:center;flex:none;padding:2px 6px;font-size:11px;font-weight:650;line-height:14px}.item[aria-current=page] .item-badge{background:var(--jl-accent);color:var(--jl-on-accent)}.expander jl-icon{transition:transform var(--jl-fast) var(--jl-ease)}.chevron{color:var(--jl-faint);transition:transform var(--jl-fast) var(--jl-ease)}.entry.open>.item .chevron,.entry.open>.expander jl-icon{transform:rotate(90deg)}.expander{border-radius:var(--jl-radius-xs);width:24px;height:24px;color:var(--jl-faint);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:inline-flex;position:absolute;top:5px;right:6px}.expander:hover{background:var(--jl-surface-3);color:var(--jl-text)}.entry:has(>.expander)>.item{padding-right:36px}:host([rail]) .section-label{background:var(--jl-line);color:#0000;height:1px;margin:4px 10px;padding:0;overflow:hidden}:host([rail]) .section:first-child .section-label{display:none}:host([rail]) .item{justify-content:center;padding:0}:host([rail]) .item-label{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}:host([rail]) .item-initial{display:inline-flex}:host([rail]) .item-badge{background:var(--jl-accent);color:#0000;width:8px;min-width:0;height:8px;padding:0;position:absolute;top:5px;right:9px;overflow:hidden}:host([rail]) .children{display:none}";
3
+ export { jl_side_nav_default as default };
@@ -33,12 +33,12 @@ export declare class JlSideNav<Id extends string = string> extends JlElement {
33
33
  get(): boolean;
34
34
  set(setter: boolean | ((prevState: boolean) => boolean)): void;
35
35
  }>>;
36
- /** The fold button's text while the side nav is open. */
36
+ /** The fold button's text while the side nav is open; jlib's own when empty. */
37
37
  readonly collapseLabel: Readonly<Readonly<{
38
38
  get(): string;
39
39
  set(setter: string | ((prevState: string) => string)): void;
40
40
  }>>;
41
- /** Its hint while the side nav is a rail. */
41
+ /** Its hint while the side nav is a rail; jlib's own when empty. */
42
42
  readonly expandLabel: Readonly<Readonly<{
43
43
  get(): string;
44
44
  set(setter: string | ((prevState: string) => string)): void;
@@ -71,6 +71,8 @@ export declare class JlSideNav<Id extends string = string> extends JlElement {
71
71
  private fold;
72
72
  /** The rail, or the whole side nav: drawn again, said on the host (`rail`) for the styles and the page. */
73
73
  private renderRail;
74
+ protected drawTexts(): void;
75
+ private renderLabel;
74
76
  private renderFold;
75
77
  private choose;
76
78
  /** Up and Down move between the rows people can see, Right opens a parent, Left closes it or goes up to it. */