@20baht/ui 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +501 -2
  3. package/dist/components/baht-form.d.ts +191 -0
  4. package/dist/components/baht-form.js +614 -0
  5. package/dist/components/baht-workflow.d.ts +173 -0
  6. package/dist/components/baht-workflow.js +430 -0
  7. package/dist/components/base.d.ts +92 -0
  8. package/dist/components/base.js +138 -0
  9. package/dist/components/combobox-controller.d.ts +65 -0
  10. package/dist/components/combobox-controller.js +82 -0
  11. package/dist/components/define.d.ts +7 -0
  12. package/dist/components/define.js +16 -0
  13. package/dist/components/field-base.d.ts +84 -0
  14. package/dist/components/field-base.js +152 -0
  15. package/dist/components/floating.d.ts +84 -0
  16. package/dist/components/floating.js +182 -0
  17. package/dist/components/form-layout.d.ts +39 -0
  18. package/dist/components/form-layout.js +67 -0
  19. package/dist/components/form-options.d.ts +39 -0
  20. package/dist/components/form-options.js +65 -0
  21. package/dist/components/form-readonly.d.ts +20 -0
  22. package/dist/components/form-readonly.js +70 -0
  23. package/dist/components/layers.d.ts +4 -0
  24. package/dist/components/layers.js +15 -0
  25. package/dist/components/menu-controller.d.ts +65 -0
  26. package/dist/components/menu-controller.js +134 -0
  27. package/dist/components/motion.d.ts +9 -0
  28. package/dist/components/motion.js +16 -0
  29. package/dist/components/primitives/baht-accordion.d.ts +29 -0
  30. package/dist/components/primitives/baht-accordion.js +66 -0
  31. package/dist/components/primitives/baht-alert.d.ts +20 -0
  32. package/dist/components/primitives/baht-alert.js +62 -0
  33. package/dist/components/primitives/baht-app-shell.d.ts +81 -0
  34. package/dist/components/primitives/baht-app-shell.js +161 -0
  35. package/dist/components/primitives/baht-approval-chain.d.ts +59 -0
  36. package/dist/components/primitives/baht-approval-chain.js +80 -0
  37. package/dist/components/primitives/baht-avatar.d.ts +19 -0
  38. package/dist/components/primitives/baht-avatar.js +43 -0
  39. package/dist/components/primitives/baht-badge.d.ts +24 -0
  40. package/dist/components/primitives/baht-badge.js +41 -0
  41. package/dist/components/primitives/baht-bar-chart.d.ts +78 -0
  42. package/dist/components/primitives/baht-bar-chart.js +361 -0
  43. package/dist/components/primitives/baht-breadcrumbs.d.ts +23 -0
  44. package/dist/components/primitives/baht-breadcrumbs.js +45 -0
  45. package/dist/components/primitives/baht-button.d.ts +89 -0
  46. package/dist/components/primitives/baht-button.js +146 -0
  47. package/dist/components/primitives/baht-calendar.d.ts +96 -0
  48. package/dist/components/primitives/baht-calendar.js +398 -0
  49. package/dist/components/primitives/baht-card.d.ts +34 -0
  50. package/dist/components/primitives/baht-card.js +70 -0
  51. package/dist/components/primitives/baht-catalog-card.d.ts +52 -0
  52. package/dist/components/primitives/baht-catalog-card.js +90 -0
  53. package/dist/components/primitives/baht-checkbox.d.ts +7 -0
  54. package/dist/components/primitives/baht-checkbox.js +40 -0
  55. package/dist/components/primitives/baht-choice-group.d.ts +52 -0
  56. package/dist/components/primitives/baht-choice-group.js +71 -0
  57. package/dist/components/primitives/baht-code.d.ts +18 -0
  58. package/dist/components/primitives/baht-code.js +33 -0
  59. package/dist/components/primitives/baht-column-picker.d.ts +69 -0
  60. package/dist/components/primitives/baht-column-picker.js +234 -0
  61. package/dist/components/primitives/baht-comments.d.ts +38 -0
  62. package/dist/components/primitives/baht-comments.js +102 -0
  63. package/dist/components/primitives/baht-currency.d.ts +13 -0
  64. package/dist/components/primitives/baht-currency.js +69 -0
  65. package/dist/components/primitives/baht-datepicker.d.ts +77 -0
  66. package/dist/components/primitives/baht-datepicker.js +235 -0
  67. package/dist/components/primitives/baht-donut-chart.d.ts +24 -0
  68. package/dist/components/primitives/baht-donut-chart.js +88 -0
  69. package/dist/components/primitives/baht-edit-table.d.ts +45 -0
  70. package/dist/components/primitives/baht-edit-table.js +176 -0
  71. package/dist/components/primitives/baht-empty-state.d.ts +26 -0
  72. package/dist/components/primitives/baht-empty-state.js +51 -0
  73. package/dist/components/primitives/baht-error-state.d.ts +21 -0
  74. package/dist/components/primitives/baht-error-state.js +44 -0
  75. package/dist/components/primitives/baht-facts.d.ts +42 -0
  76. package/dist/components/primitives/baht-facts.js +49 -0
  77. package/dist/components/primitives/baht-fieldset.d.ts +19 -0
  78. package/dist/components/primitives/baht-fieldset.js +42 -0
  79. package/dist/components/primitives/baht-file.d.ts +27 -0
  80. package/dist/components/primitives/baht-file.js +158 -0
  81. package/dist/components/primitives/baht-filter-builder.d.ts +39 -0
  82. package/dist/components/primitives/baht-filter-builder.js +201 -0
  83. package/dist/components/primitives/baht-filter.d.ts +36 -0
  84. package/dist/components/primitives/baht-filter.js +64 -0
  85. package/dist/components/primitives/baht-heatmap.d.ts +49 -0
  86. package/dist/components/primitives/baht-heatmap.js +168 -0
  87. package/dist/components/primitives/baht-input.d.ts +10 -0
  88. package/dist/components/primitives/baht-input.js +44 -0
  89. package/dist/components/primitives/baht-keyvalue-editor.d.ts +28 -0
  90. package/dist/components/primitives/baht-keyvalue-editor.js +106 -0
  91. package/dist/components/primitives/baht-line-chart.d.ts +45 -0
  92. package/dist/components/primitives/baht-line-chart.js +183 -0
  93. package/dist/components/primitives/baht-link.d.ts +26 -0
  94. package/dist/components/primitives/baht-link.js +48 -0
  95. package/dist/components/primitives/baht-list.d.ts +29 -0
  96. package/dist/components/primitives/baht-list.js +79 -0
  97. package/dist/components/primitives/baht-loading-overlay.d.ts +15 -0
  98. package/dist/components/primitives/baht-loading-overlay.js +33 -0
  99. package/dist/components/primitives/baht-markdown-view.d.ts +17 -0
  100. package/dist/components/primitives/baht-markdown-view.js +39 -0
  101. package/dist/components/primitives/baht-markdown.d.ts +34 -0
  102. package/dist/components/primitives/baht-markdown.js +177 -0
  103. package/dist/components/primitives/baht-menu.d.ts +53 -0
  104. package/dist/components/primitives/baht-menu.js +100 -0
  105. package/dist/components/primitives/baht-meter.d.ts +67 -0
  106. package/dist/components/primitives/baht-meter.js +107 -0
  107. package/dist/components/primitives/baht-modal.d.ts +71 -0
  108. package/dist/components/primitives/baht-modal.js +164 -0
  109. package/dist/components/primitives/baht-multiselect.d.ts +8 -0
  110. package/dist/components/primitives/baht-multiselect.js +47 -0
  111. package/dist/components/primitives/baht-notification-bell.d.ts +54 -0
  112. package/dist/components/primitives/baht-notification-bell.js +143 -0
  113. package/dist/components/primitives/baht-number.d.ts +5 -0
  114. package/dist/components/primitives/baht-number.js +39 -0
  115. package/dist/components/primitives/baht-order-box.d.ts +24 -0
  116. package/dist/components/primitives/baht-order-box.js +50 -0
  117. package/dist/components/primitives/baht-otp.d.ts +49 -0
  118. package/dist/components/primitives/baht-otp.js +109 -0
  119. package/dist/components/primitives/baht-page-header.d.ts +43 -0
  120. package/dist/components/primitives/baht-page-header.js +78 -0
  121. package/dist/components/primitives/baht-pagination.d.ts +33 -0
  122. package/dist/components/primitives/baht-pagination.js +86 -0
  123. package/dist/components/primitives/baht-popover.d.ts +45 -0
  124. package/dist/components/primitives/baht-popover.js +112 -0
  125. package/dist/components/primitives/baht-progress-ring.d.ts +22 -0
  126. package/dist/components/primitives/baht-progress-ring.js +62 -0
  127. package/dist/components/primitives/baht-progress.d.ts +17 -0
  128. package/dist/components/primitives/baht-progress.js +48 -0
  129. package/dist/components/primitives/baht-radio.d.ts +7 -0
  130. package/dist/components/primitives/baht-radio.js +74 -0
  131. package/dist/components/primitives/baht-range.d.ts +38 -0
  132. package/dist/components/primitives/baht-range.js +88 -0
  133. package/dist/components/primitives/baht-rating.d.ts +40 -0
  134. package/dist/components/primitives/baht-rating.js +107 -0
  135. package/dist/components/primitives/baht-record-bar.d.ts +30 -0
  136. package/dist/components/primitives/baht-record-bar.js +60 -0
  137. package/dist/components/primitives/baht-reference-dialog.d.ts +87 -0
  138. package/dist/components/primitives/baht-reference-dialog.js +418 -0
  139. package/dist/components/primitives/baht-reference-picker.d.ts +110 -0
  140. package/dist/components/primitives/baht-reference-picker.js +321 -0
  141. package/dist/components/primitives/baht-repeater.d.ts +59 -0
  142. package/dist/components/primitives/baht-repeater.js +315 -0
  143. package/dist/components/primitives/baht-rule-builder.d.ts +24 -0
  144. package/dist/components/primitives/baht-rule-builder.js +177 -0
  145. package/dist/components/primitives/baht-saved-filters.d.ts +41 -0
  146. package/dist/components/primitives/baht-saved-filters.js +126 -0
  147. package/dist/components/primitives/baht-search.d.ts +34 -0
  148. package/dist/components/primitives/baht-search.js +71 -0
  149. package/dist/components/primitives/baht-section-header.d.ts +28 -0
  150. package/dist/components/primitives/baht-section-header.js +48 -0
  151. package/dist/components/primitives/baht-section.d.ts +23 -0
  152. package/dist/components/primitives/baht-section.js +49 -0
  153. package/dist/components/primitives/baht-select.d.ts +49 -0
  154. package/dist/components/primitives/baht-select.js +197 -0
  155. package/dist/components/primitives/baht-skeleton.d.ts +16 -0
  156. package/dist/components/primitives/baht-skeleton.js +37 -0
  157. package/dist/components/primitives/baht-sparkline.d.ts +23 -0
  158. package/dist/components/primitives/baht-sparkline.js +56 -0
  159. package/dist/components/primitives/baht-spinner.d.ts +13 -0
  160. package/dist/components/primitives/baht-spinner.js +30 -0
  161. package/dist/components/primitives/baht-split-button.d.ts +43 -0
  162. package/dist/components/primitives/baht-split-button.js +87 -0
  163. package/dist/components/primitives/baht-stat-chart.d.ts +14 -0
  164. package/dist/components/primitives/baht-stat-chart.js +38 -0
  165. package/dist/components/primitives/baht-stat.d.ts +56 -0
  166. package/dist/components/primitives/baht-stat.js +117 -0
  167. package/dist/components/primitives/baht-steps.d.ts +33 -0
  168. package/dist/components/primitives/baht-steps.js +60 -0
  169. package/dist/components/primitives/baht-swipe-row.d.ts +64 -0
  170. package/dist/components/primitives/baht-swipe-row.js +178 -0
  171. package/dist/components/primitives/baht-table.d.ts +315 -0
  172. package/dist/components/primitives/baht-table.js +640 -0
  173. package/dist/components/primitives/baht-tabs.d.ts +54 -0
  174. package/dist/components/primitives/baht-tabs.js +128 -0
  175. package/dist/components/primitives/baht-tags.d.ts +96 -0
  176. package/dist/components/primitives/baht-tags.js +323 -0
  177. package/dist/components/primitives/baht-text.d.ts +10 -0
  178. package/dist/components/primitives/baht-text.js +29 -0
  179. package/dist/components/primitives/baht-textarea.d.ts +5 -0
  180. package/dist/components/primitives/baht-textarea.js +40 -0
  181. package/dist/components/primitives/baht-theme-toggle.d.ts +44 -0
  182. package/dist/components/primitives/baht-theme-toggle.js +101 -0
  183. package/dist/components/primitives/baht-timeline.d.ts +21 -0
  184. package/dist/components/primitives/baht-timeline.js +42 -0
  185. package/dist/components/primitives/baht-toast.d.ts +29 -0
  186. package/dist/components/primitives/baht-toast.js +83 -0
  187. package/dist/components/primitives/baht-toggle.d.ts +6 -0
  188. package/dist/components/primitives/baht-toggle.js +42 -0
  189. package/dist/components/primitives/baht-tooltip.d.ts +34 -0
  190. package/dist/components/primitives/baht-tooltip.js +85 -0
  191. package/dist/components/primitives/baht-tree.d.ts +58 -0
  192. package/dist/components/primitives/baht-tree.js +159 -0
  193. package/dist/components/primitives/baht-typeahead.d.ts +92 -0
  194. package/dist/components/primitives/baht-typeahead.js +258 -0
  195. package/dist/components/primitives/baht-upload.d.ts +108 -0
  196. package/dist/components/primitives/baht-upload.js +325 -0
  197. package/dist/components/primitives/baht-wizard.d.ts +57 -0
  198. package/dist/components/primitives/baht-wizard.js +147 -0
  199. package/dist/components/primitives/charts.d.ts +134 -0
  200. package/dist/components/primitives/charts.js +184 -0
  201. package/dist/components/primitives/column-map.d.ts +56 -0
  202. package/dist/components/primitives/column-map.js +70 -0
  203. package/dist/components/primitives/control-icons.d.ts +2 -0
  204. package/dist/components/primitives/control-icons.js +40 -0
  205. package/dist/components/primitives/icons.d.ts +24 -0
  206. package/dist/components/primitives/icons.js +86 -0
  207. package/dist/components/primitives/illustrations.d.ts +21 -0
  208. package/dist/components/primitives/illustrations.js +78 -0
  209. package/dist/components/primitives/index.d.ts +89 -0
  210. package/dist/components/primitives/kbd.d.ts +6 -0
  211. package/dist/components/primitives/kbd.js +9 -0
  212. package/dist/components/primitives/listbox.d.ts +2 -0
  213. package/dist/components/primitives/listbox.js +7 -0
  214. package/dist/components/primitives/markdown-render.d.ts +9 -0
  215. package/dist/components/primitives/markdown-render.js +77 -0
  216. package/dist/components/primitives/rule-rows.d.ts +55 -0
  217. package/dist/components/primitives/rule-rows.js +75 -0
  218. package/dist/components/primitives/tag-map.d.ts +6 -0
  219. package/dist/components/primitives/tag-map.js +39 -0
  220. package/dist/components/reference-labels.d.ts +22 -0
  221. package/dist/components/reference-labels.js +29 -0
  222. package/dist/components/shortcuts.d.ts +7 -0
  223. package/dist/components/shortcuts.js +43 -0
  224. package/dist/css/components.css +7517 -0
  225. package/dist/css/datepicker.css +346 -0
  226. package/dist/css/tokens.css +679 -0
  227. package/dist/custom-elements.json +45110 -0
  228. package/dist/engine.d.ts +1 -0
  229. package/dist/engine.js +1 -0
  230. package/dist/hydrate.d.ts +9 -0
  231. package/dist/hydrate.js +46 -0
  232. package/dist/index.d.ts +7 -0
  233. package/dist/index.js +210 -0
  234. package/dist/overlay.d.ts +50 -0
  235. package/dist/overlay.js +140 -0
  236. package/dist/react.d.ts +557 -0
  237. package/dist/react.js +1 -0
  238. package/dist/register.d.ts +106 -0
  239. package/dist/register.js +99 -0
  240. package/dist/ssr.d.ts +16 -0
  241. package/dist/ssr.js +125 -0
  242. package/dist/tokens.css +8197 -0
  243. package/dist/vscode.css-custom-data.json +6 -0
  244. package/dist/vscode.html-custom-data.json +2261 -0
  245. package/dist/web-types.json +6523 -0
  246. package/package.json +157 -4
@@ -0,0 +1,80 @@
1
+ import { nothing as e, html as s } from "lit";
2
+ import { property as c } from "lit/decorators.js";
3
+ import { BahtElement as b } from "../base.js";
4
+ import { customElement as m } from "../define.js";
5
+ import "./baht-alert.js";
6
+ import "./baht-badge.js";
7
+ var d = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, o = (a, t, h, r) => {
8
+ for (var n = r > 1 ? void 0 : r ? $(t, h) : t, i = a.length - 1, p; i >= 0; i--)
9
+ (p = a[i]) && (n = (r ? p(t, h, n) : p(n)) || n);
10
+ return r && n && d(t, h, n), n;
11
+ };
12
+ let l = class extends b {
13
+ constructor() {
14
+ super(...arguments), this.heading = "", this.steps = [];
15
+ }
16
+ renderApprover(a) {
17
+ return s`<li class="baht-chain-approver">
18
+ <span class="baht-chain-who">
19
+ ${a.name}
20
+ ${a.title ? s`<span class="baht-chain-title">${a.title}</span>` : e}
21
+ </span>
22
+ <baht-badge .tone=${a.tone ?? "neutral"} .label=${a.stateLabel}></baht-badge>
23
+ ${a.tag ? s`<span class="baht-chain-tag">${a.tag}</span>` : e}
24
+ ${(a.notes ?? []).map((t) => s`<span class="baht-chain-note">${t}</span>`)}
25
+ ${a.problem ? s`<span class="baht-chain-note baht-chain-note--problem">${a.problem}</span>` : e}
26
+ ${a.comment ? s`<span class="baht-chain-comment">“${a.comment}”</span>` : e}
27
+ </li>`;
28
+ }
29
+ renderStep(a, t) {
30
+ var h;
31
+ return s`<li class="baht-chain-step baht-chain-step--${a.status}">
32
+ <details ?open=${a.status === "current" || a.stalled !== void 0}>
33
+ <summary class="baht-chain-head">
34
+ <span class="baht-chain-index" aria-hidden="true">${a.status === "done" ? "✓" : t + 1}</span>
35
+ <span class="baht-chain-summary">
36
+ <span class="baht-chain-line">
37
+ <span class="baht-chain-label">${a.label}</span>
38
+ <baht-badge .tone=${a.tone ?? "neutral"} .label=${a.statusLabel}></baht-badge>
39
+ </span>
40
+ ${a.who ? s`<span class="baht-chain-who-line">${a.who}</span>` : e}
41
+ </span>
42
+ <span class="baht-chain-chevron" aria-hidden="true">▾</span>
43
+ </summary>
44
+ <div class="baht-chain-body">
45
+ ${a.rule || a.progress ? s`<div class="baht-chain-meta">
46
+ <span>${a.rule ?? ""}</span><span>${a.progress ?? ""}</span>
47
+ </div>` : e}
48
+ ${a.stalled ? s`<baht-alert
49
+ tone="danger"
50
+ .heading=${a.stalled.heading}
51
+ .message=${a.stalled.message}
52
+ ></baht-alert>` : e}
53
+ ${(h = a.approvers) != null && h.length ? s`<ul class="baht-chain-approvers">
54
+ ${a.approvers.map((r) => this.renderApprover(r))}
55
+ </ul>` : e}
56
+ </div>
57
+ </details>
58
+ </li>`;
59
+ }
60
+ render() {
61
+ return s`<section class="baht-chain">
62
+ ${this.heading ? s`<h2 class="baht-chain-heading">${this.heading}</h2>` : e}
63
+ <ol class="baht-chain-steps">
64
+ ${this.steps.map((a, t) => this.renderStep(a, t))}
65
+ </ol>
66
+ </section>`;
67
+ }
68
+ };
69
+ o([
70
+ c()
71
+ ], l.prototype, "heading", 2);
72
+ o([
73
+ c({ attribute: !1 })
74
+ ], l.prototype, "steps", 2);
75
+ l = o([
76
+ m("baht-approval-chain")
77
+ ], l);
78
+ export {
79
+ l as BahtApprovalChain
80
+ };
@@ -0,0 +1,19 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ export type AvatarSize = 'sm' | 'md' | 'lg';
4
+ /**
5
+ * Small circular identity chip — initials derived from `label`, or an
6
+ * explicit `initials` override.
7
+ *
8
+ * <baht-avatar label="Pear Nattapong"></baht-avatar>
9
+ * <baht-avatar initials="P" size="sm"></baht-avatar>
10
+ */
11
+ export declare class BahtAvatar extends BahtElement {
12
+ /** Full name; initials are derived from it when `initials` isn't set. */
13
+ label: string;
14
+ /** Explicit override — first 1-2 characters are shown as-is. */
15
+ initials: string;
16
+ size: AvatarSize;
17
+ private get shown();
18
+ protected render(): TemplateResult;
19
+ }
@@ -0,0 +1,43 @@
1
+ import { html as h } from "lit";
2
+ import { property as n } from "lit/decorators.js";
3
+ import { BahtElement as m } from "../base.js";
4
+ import { customElement as f } from "../define.js";
5
+ var v = Object.defineProperty, b = Object.getOwnPropertyDescriptor, l = (e, t, s, i) => {
6
+ for (var r = i > 1 ? void 0 : i ? b(t, s) : t, o = e.length - 1, p; o >= 0; o--)
7
+ (p = e[o]) && (r = (i ? p(t, s, r) : p(r)) || r);
8
+ return i && r && v(t, s, r), r;
9
+ };
10
+ let a = class extends m {
11
+ constructor() {
12
+ super(...arguments), this.label = "", this.initials = "", this.size = "md";
13
+ }
14
+ get shown() {
15
+ var t, s;
16
+ if (this.initials) return this.initials.slice(0, 2).toUpperCase();
17
+ const e = this.label.trim().split(/\s+/).filter(Boolean);
18
+ return e.length === 0 ? "" : ((((t = e[0]) == null ? void 0 : t[0]) ?? "") + (((s = e[1]) == null ? void 0 : s[0]) ?? "")).toUpperCase();
19
+ }
20
+ render() {
21
+ return h`<span
22
+ class="baht-avatar baht-avatar--${this.size}"
23
+ role="img"
24
+ aria-label=${this.label || this.initials || "Avatar"}
25
+ >${this.shown}</span
26
+ >`;
27
+ }
28
+ };
29
+ l([
30
+ n()
31
+ ], a.prototype, "label", 2);
32
+ l([
33
+ n()
34
+ ], a.prototype, "initials", 2);
35
+ l([
36
+ n()
37
+ ], a.prototype, "size", 2);
38
+ a = l([
39
+ f("baht-avatar")
40
+ ], a);
41
+ export {
42
+ a as BahtAvatar
43
+ };
@@ -0,0 +1,24 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ export type BadgeTone = 'neutral' | 'success' | 'danger' | 'warning' | 'info' | 'outline' | 'solid' | 'gold' | 'inverse' | 'mono';
4
+ /**
5
+ * Status pill / tag / counter (20baht badges).
6
+ * Status tones (neutral/success/danger/warning/info) show a colored dot;
7
+ * tag tones (outline/solid/gold/inverse/mono) don't.
8
+ *
9
+ * <baht-badge tone="success" label="Running"></baht-badge>
10
+ * <baht-badge tone="mono" label="฿20 / mo"></baht-badge>
11
+ * <baht-badge tone="info" label="Building" busy></baht-badge>
12
+ *
13
+ * `busy` puts a small spinner where the dot goes (on any tone) for states still in progress.
14
+ */
15
+ export declare class BahtBadge extends BahtElement {
16
+ tone: BadgeTone;
17
+ label: string;
18
+ /** Force the dot on/off; defaults to on for status tones. */
19
+ dot: boolean | null;
20
+ /** Work in progress ("Building", "Downloading"): a small spinner in place of the dot. */
21
+ busy: boolean;
22
+ private get showDot();
23
+ protected render(): TemplateResult;
24
+ }
@@ -0,0 +1,41 @@
1
+ import { html as i, nothing as u } from "lit";
2
+ import { property as n } from "lit/decorators.js";
3
+ import { BahtElement as b } from "../base.js";
4
+ import { customElement as d } from "../define.js";
5
+ var c = Object.defineProperty, f = Object.getOwnPropertyDescriptor, r = (a, e, l, o) => {
6
+ for (var t = o > 1 ? void 0 : o ? f(e, l) : e, p = a.length - 1, h; p >= 0; p--)
7
+ (h = a[p]) && (t = (o ? h(e, l, t) : h(t)) || t);
8
+ return o && t && c(e, l, t), t;
9
+ };
10
+ let s = class extends b {
11
+ constructor() {
12
+ super(...arguments), this.tone = "neutral", this.label = "", this.dot = null, this.busy = !1;
13
+ }
14
+ get showDot() {
15
+ return this.dot !== null ? this.dot : ["neutral", "success", "danger", "warning", "info"].includes(this.tone);
16
+ }
17
+ render() {
18
+ const a = this.tone === "neutral" ? "" : ` baht-badge--${this.tone}`, e = this.busy ? i`<span class="baht-badge-spinner" aria-hidden="true"></span>` : this.showDot ? i`<span class="baht-badge-dot" aria-hidden="true"></span>` : u;
19
+ return i`<span class="baht-badge${a}${this.busy ? " baht-badge--busy" : ""}">
20
+ ${e}${this.label}
21
+ </span>`;
22
+ }
23
+ };
24
+ r([
25
+ n()
26
+ ], s.prototype, "tone", 2);
27
+ r([
28
+ n()
29
+ ], s.prototype, "label", 2);
30
+ r([
31
+ n({ attribute: !1 })
32
+ ], s.prototype, "dot", 2);
33
+ r([
34
+ n({ type: Boolean, reflect: !0 })
35
+ ], s.prototype, "busy", 2);
36
+ s = r([
37
+ d("baht-badge")
38
+ ], s);
39
+ export {
40
+ s as BahtBadge
41
+ };
@@ -0,0 +1,78 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtChartBase, ChartGroup, ChartMarker, ChartSeries } from './charts.js';
3
+ export declare class BahtBarChart extends BahtChartBase {
4
+ /** Original API: `{ label, count }[]`, one bar each. */
5
+ groups: ChartGroup[];
6
+ /** Series API: one entry per series, one value per category. */
7
+ series: ChartSeries[];
8
+ /** Category names, one per value index. */
9
+ categories: string[];
10
+ /** Bars across (default) or columns up. */
11
+ orientation: 'horizontal' | 'vertical';
12
+ /** Stack the series inside one band instead of grouping them side by side. */
13
+ stacked: boolean;
14
+ /** Previous-period values, drawn as a muted bar under each current bar. */
15
+ compare: number[];
16
+ /** Names the muted `compare` bar in the key and the table twin. */
17
+ compareLabel: string;
18
+ /** Budget / target lines drawn over the bars. */
19
+ markers: ChartMarker[];
20
+ /** `ends` prints the value at the bar tip; `none` leaves it to the tooltip. */
21
+ labelValues: 'ends' | 'none';
22
+ /** Index of the series (2+ series) or category (one series) to highlight. */
23
+ emphasis: number | null;
24
+ /** Single color for every bar; per-series palette otherwise. */
25
+ color: string;
26
+ /** Accessible summary used by the vertical (graphics-only) rendering. */
27
+ label: string;
28
+ /**
29
+ * Measured px per category for the vertical rendering; `0` until the host has
30
+ * been measured, where the CSS flex fallback (`flex: 1 1 0; min-width: 0`)
31
+ * already keeps the columns inside the host. Measuring lets the element also
32
+ * thin the x labels and shrink the bars below the 24px cap, so 31 days fit a
33
+ * 400px card instead of spilling out of it.
34
+ */
35
+ private band;
36
+ private resizeObserver;
37
+ connectedCallback(): void;
38
+ disconnectedCallback(): void;
39
+ protected firstUpdated(): void;
40
+ /** Host width → px per category. Never runs on the server (`hasDom` guard). */
41
+ private measure;
42
+ private get columnCount();
43
+ /** The series actually drawn — `groups` is normalised into one series. */
44
+ private get model();
45
+ private colorFor;
46
+ protected render(): TemplateResult;
47
+ /** Largest value a bar can reach: the raw max for `groups`, a clean tick otherwise. */
48
+ private domainMax;
49
+ private tableTwin;
50
+ /** Markers with no `category` span the chart; the rest ride their own row. */
51
+ private markersFor;
52
+ /** Markers that apply to every row / column. */
53
+ private get chartMarkers();
54
+ /** Markers pinned to one category — they ride that row / column, not the chart. */
55
+ private categoryMarkers;
56
+ /** What a marker reads as: its own label, else its formatted value. */
57
+ private markerText;
58
+ /**
59
+ * Marker lines, positioned along the value axis. The label is drawn separately
60
+ * (`markerLabels`) as real text — a `title` attribute alone never reaches AT.
61
+ */
62
+ private markerOverlay;
63
+ /**
64
+ * Marker labels, sorted along the axis and thinned so neighbours never collide:
65
+ * a dropped label keeps its line, and its value still reads in the table twin.
66
+ * Thinning is scoped to the list it is given — chart-wide markers compete with
67
+ * each other, a row's own markers only with that row's.
68
+ */
69
+ private place;
70
+ /** Chart-wide marker labels — the strip above the rows / the end of the line. */
71
+ private placedMarkers;
72
+ /** A row's own marker labels, drawn beside their line inside that row. */
73
+ private rowMarkerLabels;
74
+ /** Legend rows: one per series, plus the muted `compare` key when it is set. */
75
+ private legendEntries;
76
+ private renderHorizontal;
77
+ private renderVertical;
78
+ }
@@ -0,0 +1,361 @@
1
+ import { html as o, nothing as k } from "lit";
2
+ import { property as v, state as B } from "lit/decorators.js";
3
+ import { hasDom as O, arr as n } from "../base.js";
4
+ import { BahtChartBase as E, chartColor as F, niceRange as L, minTickStep as z, renderTableTwin as j } from "./charts.js";
5
+ import { customElement as P } from "../define.js";
6
+ var R = Object.defineProperty, S = Object.getOwnPropertyDescriptor, $ = (t, a, e, r) => {
7
+ for (var i = r > 1 ? void 0 : r ? S(a, e) : a, s = t.length - 1, h; s >= 0; s--)
8
+ (h = t[s]) && (i = (r ? h(a, e, i) : h(i)) || i);
9
+ return r && i && R(a, e, i), i;
10
+ };
11
+ const A = 24, V = 2, D = 56, H = 26;
12
+ function _(t, a) {
13
+ const e = t[a];
14
+ return e !== void 0 && e !== "" ? e : "(empty)";
15
+ }
16
+ let p = class extends E {
17
+ constructor() {
18
+ super(...arguments), this.groups = [], this.series = [], this.categories = [], this.orientation = "horizontal", this.stacked = !1, this.compare = [], this.compareLabel = "Previous period", this.markers = [], this.labelValues = "ends", this.emphasis = null, this.color = "", this.label = "", this.band = 0;
19
+ }
20
+ connectedCallback() {
21
+ super.connectedCallback(), !(!O() || typeof ResizeObserver > "u") && (this.resizeObserver = new ResizeObserver(() => {
22
+ this.measure();
23
+ }), this.resizeObserver.observe(this));
24
+ }
25
+ disconnectedCallback() {
26
+ var t;
27
+ (t = this.resizeObserver) == null || t.disconnect(), this.resizeObserver = void 0, super.disconnectedCallback();
28
+ }
29
+ firstUpdated() {
30
+ O() && queueMicrotask(() => {
31
+ this.measure();
32
+ });
33
+ }
34
+ /** Host width → px per category. Never runs on the server (`hasDom` guard). */
35
+ measure() {
36
+ if (!O() || !this.isConnected || this.orientation !== "vertical") return;
37
+ const t = this.columnCount;
38
+ if (t === 0) return;
39
+ const a = this.getBoundingClientRect().width;
40
+ if (!a) return;
41
+ const r = (Math.max(0, a - D) - V * (t - 1)) / t, i = r > 0 ? Math.floor(r * 100) / 100 : 0;
42
+ Math.abs(i - this.band) > 0.01 && (this.band = i);
43
+ }
44
+ get columnCount() {
45
+ const t = this.model.series;
46
+ return t.length === 0 ? 0 : Math.max(...t.map((a) => a.values.length));
47
+ }
48
+ /** The series actually drawn — `groups` is normalised into one series. */
49
+ get model() {
50
+ if (n(this.series).length > 0)
51
+ return { series: n(this.series), categories: n(this.categories), legacy: !1 };
52
+ const t = n(this.groups);
53
+ return {
54
+ series: t.length ? [{ name: this.label || "Value", values: t.map((a) => a.count) }] : [],
55
+ categories: t.map((a) => a.label),
56
+ legacy: !0
57
+ };
58
+ }
59
+ colorFor(t, a, e) {
60
+ const r = this.model.series[t];
61
+ return this.emphasis != null && !(e ? t === this.emphasis : a === this.emphasis) ? "var(--baht-chart-muted)" : F(e ? t : 0, this.color || (r == null ? void 0 : r.color));
62
+ }
63
+ render() {
64
+ const t = this.hold(this.model);
65
+ return t.series.length === 0 ? o`<div class=${this.rootClass("baht-bar-chart")}>${this.renderEmpty()}</div>` : this.orientation === "vertical" ? this.renderVertical(t) : this.renderHorizontal(t);
66
+ }
67
+ /** Largest value a bar can reach: the raw max for `groups`, a clean tick otherwise. */
68
+ domainMax(t, a, e) {
69
+ const r = Math.max(...t.map((d) => d.values.length)), i = Array.from(
70
+ { length: r },
71
+ (d, f) => a ? t.reduce((g, w) => g + (w.values[f] ?? 0), 0) : Math.max(...t.map((g) => g.values[f] ?? 0))
72
+ ), s = Math.max(1, ...i, ...this.compare, ...this.markers.map((d) => d.value));
73
+ if (e) return s;
74
+ const h = L(0, s, 4, z(this.format));
75
+ return h[h.length - 1] ?? s;
76
+ }
77
+ tableTwin(t, a, e) {
78
+ if (!this.showTable) return k;
79
+ const r = ["Category", ...t.map((s) => s.name || "Value")];
80
+ n(this.compare).length > 0 && r.push(this.compareLabel);
81
+ const i = Array.from({ length: e }, (s, h) => {
82
+ const d = [
83
+ _(a, h),
84
+ ...t.map((f) => this.fmt(f.values[h] ?? 0))
85
+ ];
86
+ return n(this.compare).length > 0 && d.push(this.fmt(n(this.compare)[h] ?? 0)), d;
87
+ });
88
+ for (const s of n(this.markers))
89
+ i.push([
90
+ `${s.label ?? "Target"}${s.category ? ` (${s.category})` : ""}`,
91
+ this.fmt(s.value),
92
+ ...Array.from({ length: r.length - 2 }, () => "—")
93
+ ]);
94
+ return j(this.label || "Bar chart data", r, i);
95
+ }
96
+ /** Markers with no `category` span the chart; the rest ride their own row. */
97
+ markersFor(t) {
98
+ return n(this.markers).filter((a) => !a.category || a.category === t);
99
+ }
100
+ /** Markers that apply to every row / column. */
101
+ get chartMarkers() {
102
+ return n(this.markers).filter((t) => !t.category);
103
+ }
104
+ /** Markers pinned to one category — they ride that row / column, not the chart. */
105
+ categoryMarkers(t) {
106
+ return n(this.markers).filter((a) => a.category === t);
107
+ }
108
+ /** What a marker reads as: its own label, else its formatted value. */
109
+ markerText(t) {
110
+ return t.label ? `${t.label} ${this.fmt(t.value)}` : this.fmt(t.value);
111
+ }
112
+ /**
113
+ * Marker lines, positioned along the value axis. The label is drawn separately
114
+ * (`markerLabels`) as real text — a `title` attribute alone never reaches AT.
115
+ */
116
+ markerOverlay(t, a) {
117
+ return this.markersFor(a).map(
118
+ (e) => o`<span
119
+ class="baht-bar-chart-marker"
120
+ style=${`left:${Math.min(100, e.value / t * 100).toFixed(2)}%`}
121
+ aria-hidden="true"
122
+ ></span>`
123
+ );
124
+ }
125
+ /**
126
+ * Marker labels, sorted along the axis and thinned so neighbours never collide:
127
+ * a dropped label keeps its line, and its value still reads in the table twin.
128
+ * Thinning is scoped to the list it is given — chart-wide markers compete with
129
+ * each other, a row's own markers only with that row's.
130
+ */
131
+ place(t, a) {
132
+ const e = [], r = [...t].sort((i, s) => i.value - s.value);
133
+ for (const i of r) {
134
+ const s = Math.min(100, Math.max(0, i.value / a * 100)), h = e[e.length - 1];
135
+ h && s - h.pct < 12 || e.push({ m: i, pct: s });
136
+ }
137
+ return e;
138
+ }
139
+ /** Chart-wide marker labels — the strip above the rows / the end of the line. */
140
+ placedMarkers(t) {
141
+ return this.place(this.chartMarkers, t);
142
+ }
143
+ /** A row's own marker labels, drawn beside their line inside that row. */
144
+ rowMarkerLabels(t, a) {
145
+ return this.place(this.categoryMarkers(t), a).map(
146
+ ({ m: e, pct: r }) => o`<span
147
+ class="baht-bar-chart-marker-label baht-bar-chart-marker-label--row"
148
+ style=${`left:${r.toFixed(2)}%;transform:translateX(${r > 70 ? "calc(-100% - 4px)" : "4px"})`}
149
+ >${this.markerText(e)}</span
150
+ >`
151
+ );
152
+ }
153
+ /** Legend rows: one per series, plus the muted `compare` key when it is set. */
154
+ legendEntries(t) {
155
+ const a = t.map((e, r) => ({
156
+ label: e.name || "Value",
157
+ color: F(r, e.color)
158
+ }));
159
+ return n(this.compare).length > 0 && a.push({ label: this.compareLabel, color: "var(--baht-chart-muted)" }), a;
160
+ }
161
+ renderHorizontal(t) {
162
+ const { series: a, categories: e, legacy: r } = t, i = a.length > 1, s = Math.max(...a.map((x) => x.values.length)), h = this.domainMax(a, this.stacked, r), d = n(this.compare).length > 0, f = (this.stacked ? 1 : a.length) + (d ? 1 : 0), g = Math.min(A, Math.max(6, Math.floor(48 / f))), w = Array.from({ length: s }, (x, c) => {
163
+ const y = _(e, c), b = a.reduce((l, m) => l + (m.values[c] ?? 0), 0), u = `${y}: ${a.map((l) => `${l.name ? `${l.name} ` : ""}${this.fmt(l.values[c] ?? 0)}`).join(", ")}${d ? `, previous ${this.fmt(n(this.compare)[c] ?? 0)}` : ""}`, M = a.map((l, m) => ({
164
+ value: l.values[c] ?? 0,
165
+ color: this.colorFor(m, c, i),
166
+ name: l.name
167
+ }));
168
+ return o`<div class="baht-bar-chart-row">
169
+ <span class="baht-bar-chart-label" title=${y}>${y}</span>
170
+ <div
171
+ class="baht-bar-chart-track${this.stacked ? " baht-bar-chart-track--stacked" : ""}${this.categoryMarkers(y).length > 0 ? " baht-bar-chart-track--marked" : ""}"
172
+ tabindex="0"
173
+ role="button"
174
+ aria-label=${u}
175
+ @pointermove=${(l) => {
176
+ this.showTip(l, u);
177
+ }}
178
+ @pointerleave=${() => {
179
+ this.hideTip();
180
+ }}
181
+ @focus=${(l) => {
182
+ this.showTip(l, u);
183
+ }}
184
+ @blur=${() => {
185
+ this.hideTip();
186
+ }}
187
+ >
188
+ ${this.markerOverlay(h, y)}
189
+ ${this.rowMarkerLabels(y, h)}
190
+ <div class="baht-bar-chart-bars">
191
+ ${this.stacked ? o`<div class="baht-bar-chart-stack" style=${`height:${g}px`}>
192
+ ${M.map(
193
+ (l) => o`<div
194
+ class="baht-bar-chart-bar baht-bar-chart-bar--segment"
195
+ style=${`width:${Math.max(0, l.value / h * 100)}%;background:${l.color}`}
196
+ ></div>`
197
+ )}
198
+ </div>` : M.map(
199
+ (l) => o`<div
200
+ class="baht-bar-chart-bar"
201
+ style=${`width:${Math.max(2, l.value / h * 100)}%;height:${g}px;background:${l.color}`}
202
+ ></div>`
203
+ )}
204
+ ${d ? o`<div
205
+ class="baht-bar-chart-bar baht-bar-chart-bar--compare"
206
+ style=${`width:${Math.max(2, (n(this.compare)[c] ?? 0) / h * 100)}%;height:${Math.min(8, g)}px`}
207
+ ></div>` : k}
208
+ </div>
209
+ </div>
210
+ ${this.labelValues === "ends" ? o`<span class="baht-bar-chart-count"
211
+ >${r ? a[0].values[c] ?? 0 : this.fmt(this.stacked ? b : a[0].values[c] ?? 0)}</span
212
+ >` : k}
213
+ </div>`;
214
+ }), T = this.placedMarkers(h);
215
+ return o`<div class=${this.rootClass("baht-bar-chart")}>
216
+ ${T.length > 0 ? o`<div class="baht-bar-chart-row baht-bar-chart-row--markers">
217
+ <span class="baht-bar-chart-label"></span>
218
+ <div class="baht-bar-chart-markbar">
219
+ ${T.map(
220
+ ({ m: x, pct: c }) => o`<span
221
+ class="baht-bar-chart-marker-label"
222
+ style=${`left:${c.toFixed(2)}%;transform:translateX(${c > 88 ? "-100%" : c < 12 ? "0" : "-50%"})`}
223
+ >${this.markerText(x)}</span
224
+ >`
225
+ )}
226
+ </div>
227
+ ${this.labelValues === "ends" ? o`<span class="baht-bar-chart-count"></span>` : k}
228
+ </div>` : k}
229
+ ${w}
230
+ ${this.renderTooltip()}
231
+ ${this.renderLegend(this.legendEntries(a))}
232
+ ${this.tableTwin(a, e, s)}
233
+ </div>`;
234
+ }
235
+ renderVertical(t) {
236
+ const { series: a, categories: e, legacy: r } = t, i = a.length > 1, s = Math.max(...a.map((b) => b.values.length)), h = this.domainMax(a, this.stacked, r), d = L(0, h, 4, z(this.format)), f = n(this.compare).length > 0, g = (this.stacked ? 1 : a.length) + (f ? 1 : 0), w = this.band > 0 ? (this.band - V) / g : 48 / g, T = Math.min(A, Math.max(2, Math.floor(w))), x = this.band > 0 ? Math.max(1, Math.ceil(H / Math.max(1, this.band))) : Math.max(1, Math.ceil(s / 12)), c = n(this.markers).map(
237
+ (b) => `${this.markerText(b)}${b.category ? ` on ${b.category}` : ""}`
238
+ ), y = this.label || `Column chart, ${s} categories. ${e.map((b, u) => `${b} ${this.fmt(a[0].values[u] ?? 0)}`).join(", ")}${c.length ? `. Reference lines: ${c.join(", ")}` : ""}`;
239
+ return o`<div class=${this.rootClass("baht-bar-chart baht-bar-chart--vertical")}>
240
+ <div class="baht-bar-chart-plot" role="img" aria-label=${y}>
241
+ <div class="baht-bar-chart-yaxis" aria-hidden="true">
242
+ ${[...d].reverse().map((b) => o`<span class="baht-chart-tick-text">${this.fmt(b)}</span>`)}
243
+ </div>
244
+ <div class="baht-bar-chart-grid">
245
+ ${this.chartMarkers.map(
246
+ (b) => o`<span
247
+ class="baht-bar-chart-marker baht-bar-chart-marker--horizontal"
248
+ style=${`bottom:${Math.min(100, b.value / h * 100).toFixed(2)}%`}
249
+ aria-hidden="true"
250
+ ></span>`
251
+ )}
252
+ ${this.placedMarkers(h).map(
253
+ ({ m: b, pct: u }) => o`<span
254
+ class="baht-bar-chart-marker-label baht-bar-chart-marker-label--end"
255
+ style=${`bottom:${u.toFixed(2)}%`}
256
+ >${this.markerText(b)}</span
257
+ >`
258
+ )}
259
+ ${[...d].reverse().map(() => o`<span class="baht-chart-grid-rule" aria-hidden="true"></span>`)}
260
+ <div class="baht-bar-chart-columns">
261
+ ${Array.from({ length: s }, (b, u) => {
262
+ const M = _(e, u), l = `${M}: ${a.map((m) => `${m.name ? `${m.name} ` : ""}${this.fmt(m.values[u] ?? 0)}`).join(", ")}`;
263
+ return o`<div
264
+ class="baht-bar-chart-column"
265
+ style=${this.band > 0 ? `flex:0 0 auto;width:${this.band}px` : k}
266
+ tabindex="0"
267
+ role="button"
268
+ aria-label=${l}
269
+ @pointermove=${(m) => {
270
+ this.showTip(m, l);
271
+ }}
272
+ @pointerleave=${() => {
273
+ this.hideTip();
274
+ }}
275
+ @focus=${(m) => {
276
+ this.showTip(m, l);
277
+ }}
278
+ @blur=${() => {
279
+ this.hideTip();
280
+ }}
281
+ >
282
+ ${this.place(this.categoryMarkers(M), h).map(
283
+ ({ m, pct: C }) => o`<span
284
+ class="baht-bar-chart-marker baht-bar-chart-marker--horizontal"
285
+ style=${`bottom:${C.toFixed(2)}%`}
286
+ aria-hidden="true"
287
+ ></span>${this.band === 0 || this.band >= 40 ? o`<span
288
+ class="baht-bar-chart-marker-label baht-bar-chart-marker-label--column"
289
+ style=${`bottom:${C.toFixed(2)}%`}
290
+ >${this.markerText(m)}</span
291
+ >` : k}`
292
+ )}
293
+ <div class="baht-bar-chart-column-bars">
294
+ ${a.map(
295
+ (m, C) => o`<div
296
+ class="baht-bar-chart-col"
297
+ style=${`height:${Math.max(1, (m.values[u] ?? 0) / h * 100)}%;width:${T}px;background:${this.colorFor(C, u, i)}`}
298
+ ></div>`
299
+ )}
300
+ ${f ? o`<div
301
+ class="baht-bar-chart-col baht-bar-chart-col--compare"
302
+ style=${`height:${Math.max(1, (n(this.compare)[u] ?? 0) / h * 100)}%;width:${Math.min(8, T)}px`}
303
+ ></div>` : k}
304
+ </div>
305
+ ${u % x === 0 ? o`<span class="baht-bar-chart-xlabel">${M}</span>` : k}
306
+ </div>`;
307
+ })}
308
+ </div>
309
+ </div>
310
+ </div>
311
+ ${this.renderTooltip()}
312
+ ${this.renderLegend(this.legendEntries(a))}
313
+ ${this.tableTwin(a, e, s)}
314
+ </div>`;
315
+ }
316
+ };
317
+ $([
318
+ v({ attribute: !1 })
319
+ ], p.prototype, "groups", 2);
320
+ $([
321
+ v({ attribute: !1 })
322
+ ], p.prototype, "series", 2);
323
+ $([
324
+ v({ attribute: !1 })
325
+ ], p.prototype, "categories", 2);
326
+ $([
327
+ v()
328
+ ], p.prototype, "orientation", 2);
329
+ $([
330
+ v({ type: Boolean })
331
+ ], p.prototype, "stacked", 2);
332
+ $([
333
+ v({ attribute: !1 })
334
+ ], p.prototype, "compare", 2);
335
+ $([
336
+ v({ attribute: "compare-label" })
337
+ ], p.prototype, "compareLabel", 2);
338
+ $([
339
+ v({ attribute: !1 })
340
+ ], p.prototype, "markers", 2);
341
+ $([
342
+ v({ attribute: "label-values" })
343
+ ], p.prototype, "labelValues", 2);
344
+ $([
345
+ v({ type: Number })
346
+ ], p.prototype, "emphasis", 2);
347
+ $([
348
+ v()
349
+ ], p.prototype, "color", 2);
350
+ $([
351
+ v()
352
+ ], p.prototype, "label", 2);
353
+ $([
354
+ B()
355
+ ], p.prototype, "band", 2);
356
+ p = $([
357
+ P("baht-bar-chart")
358
+ ], p);
359
+ export {
360
+ p as BahtBarChart
361
+ };
@@ -0,0 +1,23 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ export interface Crumb {
4
+ label: string;
5
+ href?: string;
6
+ }
7
+ /**
8
+ * Breadcrumb trail. Last item renders as the current page (no link). Items
9
+ * without `href` emit `baht-navigate { item, index }` for router-driven apps.
10
+ *
11
+ * el.items = [
12
+ * { label: 'Workflows', href: '/workflows' },
13
+ * { label: 'Signup', href: '/workflows/signup' },
14
+ * { label: 'Run #812' },
15
+ * ];
16
+ * @fires {CustomEvent<{ item: Crumb; index: number }>} baht-navigate - A crumb was pressed.
17
+ */
18
+ export declare class BahtBreadcrumbs extends BahtElement {
19
+ items: Crumb[];
20
+ separator: string;
21
+ private navigate;
22
+ protected render(): TemplateResult;
23
+ }