@20baht/ui 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +512 -2
- package/dist/components/baht-form.d.ts +206 -0
- package/dist/components/baht-form.js +630 -0
- package/dist/components/baht-workflow.d.ts +187 -0
- package/dist/components/baht-workflow.js +455 -0
- package/dist/components/base.d.ts +92 -0
- package/dist/components/base.js +138 -0
- package/dist/components/combobox-controller.d.ts +65 -0
- package/dist/components/combobox-controller.js +82 -0
- package/dist/components/define.d.ts +7 -0
- package/dist/components/define.js +16 -0
- package/dist/components/field-base.d.ts +84 -0
- package/dist/components/field-base.js +152 -0
- package/dist/components/floating.d.ts +84 -0
- package/dist/components/floating.js +182 -0
- package/dist/components/form-layout.d.ts +39 -0
- package/dist/components/form-layout.js +67 -0
- package/dist/components/form-options.d.ts +39 -0
- package/dist/components/form-options.js +65 -0
- package/dist/components/form-readonly.d.ts +20 -0
- package/dist/components/form-readonly.js +70 -0
- package/dist/components/layers.d.ts +4 -0
- package/dist/components/layers.js +15 -0
- package/dist/components/menu-controller.d.ts +65 -0
- package/dist/components/menu-controller.js +134 -0
- package/dist/components/motion.d.ts +9 -0
- package/dist/components/motion.js +16 -0
- package/dist/components/primitives/baht-accordion.d.ts +29 -0
- package/dist/components/primitives/baht-accordion.js +66 -0
- package/dist/components/primitives/baht-alert.d.ts +20 -0
- package/dist/components/primitives/baht-alert.js +62 -0
- package/dist/components/primitives/baht-app-shell.d.ts +81 -0
- package/dist/components/primitives/baht-app-shell.js +161 -0
- package/dist/components/primitives/baht-approval-chain.d.ts +59 -0
- package/dist/components/primitives/baht-approval-chain.js +80 -0
- package/dist/components/primitives/baht-avatar.d.ts +19 -0
- package/dist/components/primitives/baht-avatar.js +43 -0
- package/dist/components/primitives/baht-badge.d.ts +24 -0
- package/dist/components/primitives/baht-badge.js +41 -0
- package/dist/components/primitives/baht-bar-chart.d.ts +78 -0
- package/dist/components/primitives/baht-bar-chart.js +361 -0
- package/dist/components/primitives/baht-breadcrumbs.d.ts +23 -0
- package/dist/components/primitives/baht-breadcrumbs.js +45 -0
- package/dist/components/primitives/baht-button.d.ts +89 -0
- package/dist/components/primitives/baht-button.js +146 -0
- package/dist/components/primitives/baht-calendar.d.ts +96 -0
- package/dist/components/primitives/baht-calendar.js +398 -0
- package/dist/components/primitives/baht-card.d.ts +34 -0
- package/dist/components/primitives/baht-card.js +70 -0
- package/dist/components/primitives/baht-catalog-card.d.ts +52 -0
- package/dist/components/primitives/baht-catalog-card.js +90 -0
- package/dist/components/primitives/baht-checkbox.d.ts +7 -0
- package/dist/components/primitives/baht-checkbox.js +40 -0
- package/dist/components/primitives/baht-choice-group.d.ts +52 -0
- package/dist/components/primitives/baht-choice-group.js +71 -0
- package/dist/components/primitives/baht-code.d.ts +18 -0
- package/dist/components/primitives/baht-code.js +33 -0
- package/dist/components/primitives/baht-column-picker.d.ts +69 -0
- package/dist/components/primitives/baht-column-picker.js +234 -0
- package/dist/components/primitives/baht-comments.d.ts +38 -0
- package/dist/components/primitives/baht-comments.js +102 -0
- package/dist/components/primitives/baht-currency.d.ts +13 -0
- package/dist/components/primitives/baht-currency.js +69 -0
- package/dist/components/primitives/baht-datepicker.d.ts +77 -0
- package/dist/components/primitives/baht-datepicker.js +235 -0
- package/dist/components/primitives/baht-donut-chart.d.ts +24 -0
- package/dist/components/primitives/baht-donut-chart.js +88 -0
- package/dist/components/primitives/baht-edit-table.d.ts +45 -0
- package/dist/components/primitives/baht-edit-table.js +176 -0
- package/dist/components/primitives/baht-empty-state.d.ts +26 -0
- package/dist/components/primitives/baht-empty-state.js +51 -0
- package/dist/components/primitives/baht-error-state.d.ts +21 -0
- package/dist/components/primitives/baht-error-state.js +44 -0
- package/dist/components/primitives/baht-facts.d.ts +42 -0
- package/dist/components/primitives/baht-facts.js +49 -0
- package/dist/components/primitives/baht-fieldset.d.ts +19 -0
- package/dist/components/primitives/baht-fieldset.js +42 -0
- package/dist/components/primitives/baht-file.d.ts +27 -0
- package/dist/components/primitives/baht-file.js +158 -0
- package/dist/components/primitives/baht-filter-builder.d.ts +39 -0
- package/dist/components/primitives/baht-filter-builder.js +201 -0
- package/dist/components/primitives/baht-filter.d.ts +36 -0
- package/dist/components/primitives/baht-filter.js +64 -0
- package/dist/components/primitives/baht-heatmap.d.ts +49 -0
- package/dist/components/primitives/baht-heatmap.js +168 -0
- package/dist/components/primitives/baht-input.d.ts +10 -0
- package/dist/components/primitives/baht-input.js +44 -0
- package/dist/components/primitives/baht-keyvalue-editor.d.ts +28 -0
- package/dist/components/primitives/baht-keyvalue-editor.js +106 -0
- package/dist/components/primitives/baht-line-chart.d.ts +45 -0
- package/dist/components/primitives/baht-line-chart.js +183 -0
- package/dist/components/primitives/baht-link.d.ts +26 -0
- package/dist/components/primitives/baht-link.js +48 -0
- package/dist/components/primitives/baht-list.d.ts +29 -0
- package/dist/components/primitives/baht-list.js +79 -0
- package/dist/components/primitives/baht-loading-overlay.d.ts +15 -0
- package/dist/components/primitives/baht-loading-overlay.js +33 -0
- package/dist/components/primitives/baht-markdown-view.d.ts +17 -0
- package/dist/components/primitives/baht-markdown-view.js +39 -0
- package/dist/components/primitives/baht-markdown.d.ts +34 -0
- package/dist/components/primitives/baht-markdown.js +177 -0
- package/dist/components/primitives/baht-menu.d.ts +53 -0
- package/dist/components/primitives/baht-menu.js +100 -0
- package/dist/components/primitives/baht-meter.d.ts +67 -0
- package/dist/components/primitives/baht-meter.js +107 -0
- package/dist/components/primitives/baht-modal.d.ts +71 -0
- package/dist/components/primitives/baht-modal.js +164 -0
- package/dist/components/primitives/baht-multiselect.d.ts +8 -0
- package/dist/components/primitives/baht-multiselect.js +47 -0
- package/dist/components/primitives/baht-notification-bell.d.ts +54 -0
- package/dist/components/primitives/baht-notification-bell.js +143 -0
- package/dist/components/primitives/baht-number.d.ts +5 -0
- package/dist/components/primitives/baht-number.js +39 -0
- package/dist/components/primitives/baht-order-box.d.ts +24 -0
- package/dist/components/primitives/baht-order-box.js +50 -0
- package/dist/components/primitives/baht-otp.d.ts +49 -0
- package/dist/components/primitives/baht-otp.js +109 -0
- package/dist/components/primitives/baht-page-header.d.ts +43 -0
- package/dist/components/primitives/baht-page-header.js +78 -0
- package/dist/components/primitives/baht-pagination.d.ts +33 -0
- package/dist/components/primitives/baht-pagination.js +86 -0
- package/dist/components/primitives/baht-popover.d.ts +45 -0
- package/dist/components/primitives/baht-popover.js +112 -0
- package/dist/components/primitives/baht-progress-ring.d.ts +22 -0
- package/dist/components/primitives/baht-progress-ring.js +62 -0
- package/dist/components/primitives/baht-progress.d.ts +17 -0
- package/dist/components/primitives/baht-progress.js +48 -0
- package/dist/components/primitives/baht-radio.d.ts +7 -0
- package/dist/components/primitives/baht-radio.js +74 -0
- package/dist/components/primitives/baht-range.d.ts +38 -0
- package/dist/components/primitives/baht-range.js +88 -0
- package/dist/components/primitives/baht-rating.d.ts +40 -0
- package/dist/components/primitives/baht-rating.js +107 -0
- package/dist/components/primitives/baht-record-bar.d.ts +30 -0
- package/dist/components/primitives/baht-record-bar.js +60 -0
- package/dist/components/primitives/baht-reference-dialog.d.ts +87 -0
- package/dist/components/primitives/baht-reference-dialog.js +418 -0
- package/dist/components/primitives/baht-reference-picker.d.ts +110 -0
- package/dist/components/primitives/baht-reference-picker.js +321 -0
- package/dist/components/primitives/baht-repeater.d.ts +59 -0
- package/dist/components/primitives/baht-repeater.js +315 -0
- package/dist/components/primitives/baht-rule-builder.d.ts +24 -0
- package/dist/components/primitives/baht-rule-builder.js +177 -0
- package/dist/components/primitives/baht-saved-filters.d.ts +41 -0
- package/dist/components/primitives/baht-saved-filters.js +126 -0
- package/dist/components/primitives/baht-search.d.ts +34 -0
- package/dist/components/primitives/baht-search.js +71 -0
- package/dist/components/primitives/baht-section-header.d.ts +28 -0
- package/dist/components/primitives/baht-section-header.js +48 -0
- package/dist/components/primitives/baht-section.d.ts +23 -0
- package/dist/components/primitives/baht-section.js +49 -0
- package/dist/components/primitives/baht-select.d.ts +49 -0
- package/dist/components/primitives/baht-select.js +197 -0
- package/dist/components/primitives/baht-skeleton.d.ts +16 -0
- package/dist/components/primitives/baht-skeleton.js +37 -0
- package/dist/components/primitives/baht-sparkline.d.ts +23 -0
- package/dist/components/primitives/baht-sparkline.js +56 -0
- package/dist/components/primitives/baht-spinner.d.ts +13 -0
- package/dist/components/primitives/baht-spinner.js +30 -0
- package/dist/components/primitives/baht-split-button.d.ts +43 -0
- package/dist/components/primitives/baht-split-button.js +87 -0
- package/dist/components/primitives/baht-stat-chart.d.ts +14 -0
- package/dist/components/primitives/baht-stat-chart.js +38 -0
- package/dist/components/primitives/baht-stat.d.ts +56 -0
- package/dist/components/primitives/baht-stat.js +117 -0
- package/dist/components/primitives/baht-steps.d.ts +33 -0
- package/dist/components/primitives/baht-steps.js +60 -0
- package/dist/components/primitives/baht-swipe-row.d.ts +64 -0
- package/dist/components/primitives/baht-swipe-row.js +178 -0
- package/dist/components/primitives/baht-table.d.ts +315 -0
- package/dist/components/primitives/baht-table.js +640 -0
- package/dist/components/primitives/baht-tabs.d.ts +54 -0
- package/dist/components/primitives/baht-tabs.js +128 -0
- package/dist/components/primitives/baht-tags.d.ts +96 -0
- package/dist/components/primitives/baht-tags.js +323 -0
- package/dist/components/primitives/baht-text.d.ts +10 -0
- package/dist/components/primitives/baht-text.js +29 -0
- package/dist/components/primitives/baht-textarea.d.ts +5 -0
- package/dist/components/primitives/baht-textarea.js +40 -0
- package/dist/components/primitives/baht-theme-toggle.d.ts +44 -0
- package/dist/components/primitives/baht-theme-toggle.js +101 -0
- package/dist/components/primitives/baht-timeline.d.ts +21 -0
- package/dist/components/primitives/baht-timeline.js +42 -0
- package/dist/components/primitives/baht-toast.d.ts +29 -0
- package/dist/components/primitives/baht-toast.js +83 -0
- package/dist/components/primitives/baht-toggle.d.ts +6 -0
- package/dist/components/primitives/baht-toggle.js +42 -0
- package/dist/components/primitives/baht-tooltip.d.ts +34 -0
- package/dist/components/primitives/baht-tooltip.js +85 -0
- package/dist/components/primitives/baht-tree.d.ts +58 -0
- package/dist/components/primitives/baht-tree.js +159 -0
- package/dist/components/primitives/baht-typeahead.d.ts +92 -0
- package/dist/components/primitives/baht-typeahead.js +258 -0
- package/dist/components/primitives/baht-upload.d.ts +108 -0
- package/dist/components/primitives/baht-upload.js +325 -0
- package/dist/components/primitives/baht-wizard.d.ts +57 -0
- package/dist/components/primitives/baht-wizard.js +147 -0
- package/dist/components/primitives/charts.d.ts +134 -0
- package/dist/components/primitives/charts.js +184 -0
- package/dist/components/primitives/column-map.d.ts +56 -0
- package/dist/components/primitives/column-map.js +70 -0
- package/dist/components/primitives/control-icons.d.ts +2 -0
- package/dist/components/primitives/control-icons.js +40 -0
- package/dist/components/primitives/icons.d.ts +24 -0
- package/dist/components/primitives/icons.js +86 -0
- package/dist/components/primitives/illustrations.d.ts +21 -0
- package/dist/components/primitives/illustrations.js +78 -0
- package/dist/components/primitives/index.d.ts +89 -0
- package/dist/components/primitives/kbd.d.ts +6 -0
- package/dist/components/primitives/kbd.js +9 -0
- package/dist/components/primitives/listbox.d.ts +2 -0
- package/dist/components/primitives/listbox.js +7 -0
- package/dist/components/primitives/markdown-render.d.ts +9 -0
- package/dist/components/primitives/markdown-render.js +77 -0
- package/dist/components/primitives/rule-rows.d.ts +55 -0
- package/dist/components/primitives/rule-rows.js +75 -0
- package/dist/components/primitives/tag-map.d.ts +6 -0
- package/dist/components/primitives/tag-map.js +39 -0
- package/dist/components/reference-labels.d.ts +22 -0
- package/dist/components/reference-labels.js +29 -0
- package/dist/components/shortcuts.d.ts +7 -0
- package/dist/components/shortcuts.js +43 -0
- package/dist/css/components.css +7517 -0
- package/dist/css/datepicker.css +346 -0
- package/dist/css/tokens.css +679 -0
- package/dist/custom-elements.json +45172 -0
- package/dist/engine.d.ts +1 -0
- package/dist/engine.js +1 -0
- package/dist/hydrate.d.ts +9 -0
- package/dist/hydrate.js +46 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +210 -0
- package/dist/overlay.d.ts +50 -0
- package/dist/overlay.js +140 -0
- package/dist/react.d.ts +557 -0
- package/dist/react.js +1 -0
- package/dist/register.d.ts +106 -0
- package/dist/register.js +99 -0
- package/dist/ssr.d.ts +16 -0
- package/dist/ssr.js +125 -0
- package/dist/tokens.css +8197 -0
- package/dist/vscode.css-custom-data.json +6 -0
- package/dist/vscode.html-custom-data.json +2261 -0
- package/dist/web-types.json +6523 -0
- package/package.json +157 -4
package/dist/engine.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@20baht/engine';
|
package/dist/engine.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@20baht/engine";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BahtHydrate } from './components/base.js';
|
|
2
|
+
/**
|
|
3
|
+
* Hydrate `host`'s light DOM against `value`. Light DOM has no shadow boundary, so two
|
|
4
|
+
* kinds of nodes would confuse Lit's hydration walk (it visits every comment under the
|
|
5
|
+
* container): a nested `baht-*` child's own part markers, and whatever follows the host's
|
|
6
|
+
* root part (author children, parent bindings). Both are parked while the host hydrates
|
|
7
|
+
* and restored right after — before any nested child's own first update runs.
|
|
8
|
+
*/
|
|
9
|
+
export declare const hydrateLightDom: BahtHydrate;
|
package/dist/hydrate.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import "@lit-labs/ssr-client/lit-element-hydrate-support.js";
|
|
2
|
+
import { hydrate as s } from "@lit-labs/ssr-client";
|
|
3
|
+
import { SSR_STASH as l, hasSsrMarkup as c } from "./components/base.js";
|
|
4
|
+
function f(a, t = []) {
|
|
5
|
+
for (const r of Array.from(a.children))
|
|
6
|
+
r.localName.startsWith("baht-") && c(r) ? t.push(r) : f(r, t);
|
|
7
|
+
return t;
|
|
8
|
+
}
|
|
9
|
+
function d(a) {
|
|
10
|
+
let t = a.firstChild, r = 0;
|
|
11
|
+
for (; t; ) {
|
|
12
|
+
if (t.nodeType === 8) {
|
|
13
|
+
const e = t.data;
|
|
14
|
+
if (e.startsWith("lit-part") ? r += 1 : e.startsWith("/lit-part") && (r -= 1), r === 0) break;
|
|
15
|
+
}
|
|
16
|
+
t = t.nextSibling;
|
|
17
|
+
}
|
|
18
|
+
if (!(t != null && t.nextSibling)) return null;
|
|
19
|
+
const i = document.createDocumentFragment();
|
|
20
|
+
let n = t.nextSibling;
|
|
21
|
+
for (; n; ) {
|
|
22
|
+
const e = n.nextSibling;
|
|
23
|
+
i.append(n), n = e;
|
|
24
|
+
}
|
|
25
|
+
return i;
|
|
26
|
+
}
|
|
27
|
+
const p = (a, t, r) => {
|
|
28
|
+
const i = d(t), n = f(t);
|
|
29
|
+
for (const e of n) {
|
|
30
|
+
const o = document.createDocumentFragment();
|
|
31
|
+
o.append(...Array.from(e.childNodes)), e[l] = o;
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
s(a, t, r);
|
|
35
|
+
} finally {
|
|
36
|
+
for (const e of n) {
|
|
37
|
+
const o = e[l];
|
|
38
|
+
Reflect.deleteProperty(e, l), o && e.append(o);
|
|
39
|
+
}
|
|
40
|
+
i && t.append(i);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
globalThis.bahtHydrate = p;
|
|
44
|
+
export {
|
|
45
|
+
p as hydrateLightDom
|
|
46
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from '@20baht/engine';
|
|
2
|
+
export * from './components/primitives/index.js';
|
|
3
|
+
export { renderIllustration, isIllustrationName, type IllustrationName, } from './components/primitives/illustrations.js';
|
|
4
|
+
export { BahtFieldBase } from './components/field-base.js';
|
|
5
|
+
export { BahtElement, adoptLightChildren, hasDom, hasSsrMarkup, SSR_STASH, type BahtHydrate, } from './components/base.js';
|
|
6
|
+
export { BahtForm } from './components/baht-form.js';
|
|
7
|
+
export { BahtWorkflow } from './components/baht-workflow.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
export * from "@20baht/engine";
|
|
2
|
+
import { BahtButton as e } from "./components/primitives/baht-button.js";
|
|
3
|
+
import { isIconName as p, renderIcon as m } from "./components/primitives/icons.js";
|
|
4
|
+
import { BahtBadge as f } from "./components/primitives/baht-badge.js";
|
|
5
|
+
import { BahtAvatar as x } from "./components/primitives/baht-avatar.js";
|
|
6
|
+
import { BahtCode as l } from "./components/primitives/baht-code.js";
|
|
7
|
+
import { BahtTable as d } from "./components/primitives/baht-table.js";
|
|
8
|
+
import { BahtList as s } from "./components/primitives/baht-list.js";
|
|
9
|
+
import { BahtPagination as T } from "./components/primitives/baht-pagination.js";
|
|
10
|
+
import { BahtModal as u } from "./components/primitives/baht-modal.js";
|
|
11
|
+
import { BahtToast as R } from "./components/primitives/baht-toast.js";
|
|
12
|
+
import { BahtTooltip as F } from "./components/primitives/baht-tooltip.js";
|
|
13
|
+
import { BahtThemeToggle as A } from "./components/primitives/baht-theme-toggle.js";
|
|
14
|
+
import { BahtSplitButton as b } from "./components/primitives/baht-split-button.js";
|
|
15
|
+
import { BahtMenu as M } from "./components/primitives/baht-menu.js";
|
|
16
|
+
import { BahtTabs as E } from "./components/primitives/baht-tabs.js";
|
|
17
|
+
import { BahtPopover as I } from "./components/primitives/baht-popover.js";
|
|
18
|
+
import { BahtAlert as D } from "./components/primitives/baht-alert.js";
|
|
19
|
+
import { BahtRating as N } from "./components/primitives/baht-rating.js";
|
|
20
|
+
import { BahtRange as G } from "./components/primitives/baht-range.js";
|
|
21
|
+
import { BahtOtp as W } from "./components/primitives/baht-otp.js";
|
|
22
|
+
import { BahtFilter as z } from "./components/primitives/baht-filter.js";
|
|
23
|
+
import { BahtSwipeRow as U } from "./components/primitives/baht-swipe-row.js";
|
|
24
|
+
import { BahtSkeleton as j } from "./components/primitives/baht-skeleton.js";
|
|
25
|
+
import { BahtProgress as Q } from "./components/primitives/baht-progress.js";
|
|
26
|
+
import { BahtProgressRing as Z } from "./components/primitives/baht-progress-ring.js";
|
|
27
|
+
import { BahtSpinner as rr } from "./components/primitives/baht-spinner.js";
|
|
28
|
+
import { BahtLoadingOverlay as or } from "./components/primitives/baht-loading-overlay.js";
|
|
29
|
+
import { BahtCard as ar } from "./components/primitives/baht-card.js";
|
|
30
|
+
import { BahtFieldset as mr } from "./components/primitives/baht-fieldset.js";
|
|
31
|
+
import { BahtTimeline as fr } from "./components/primitives/baht-timeline.js";
|
|
32
|
+
import { BahtAccordion as xr } from "./components/primitives/baht-accordion.js";
|
|
33
|
+
import { BahtTree as lr } from "./components/primitives/baht-tree.js";
|
|
34
|
+
import { BahtCalendar as dr, calendarRange as cr } from "./components/primitives/baht-calendar.js";
|
|
35
|
+
import { BahtLink as Sr } from "./components/primitives/baht-link.js";
|
|
36
|
+
import { BahtBreadcrumbs as gr } from "./components/primitives/baht-breadcrumbs.js";
|
|
37
|
+
import { BahtInput as Cr } from "./components/primitives/baht-input.js";
|
|
38
|
+
import { BahtTextarea as kr } from "./components/primitives/baht-textarea.js";
|
|
39
|
+
import { BahtMarkdown as wr } from "./components/primitives/baht-markdown.js";
|
|
40
|
+
import { BahtMarkdownView as Pr } from "./components/primitives/baht-markdown-view.js";
|
|
41
|
+
import { BahtNumber as vr } from "./components/primitives/baht-number.js";
|
|
42
|
+
import { BahtCurrency as Or } from "./components/primitives/baht-currency.js";
|
|
43
|
+
import { BahtSelect as yr } from "./components/primitives/baht-select.js";
|
|
44
|
+
import { BahtMultiselect as Lr } from "./components/primitives/baht-multiselect.js";
|
|
45
|
+
import { BahtTags as Hr } from "./components/primitives/baht-tags.js";
|
|
46
|
+
import { BahtCheckbox as _r } from "./components/primitives/baht-checkbox.js";
|
|
47
|
+
import { BahtRadio as Vr } from "./components/primitives/baht-radio.js";
|
|
48
|
+
import { BahtToggle as qr } from "./components/primitives/baht-toggle.js";
|
|
49
|
+
import { BahtDatepicker as Kr } from "./components/primitives/baht-datepicker.js";
|
|
50
|
+
import { BahtFile as Yr } from "./components/primitives/baht-file.js";
|
|
51
|
+
import { BahtUpload as Jr } from "./components/primitives/baht-upload.js";
|
|
52
|
+
import { BahtText as Xr } from "./components/primitives/baht-text.js";
|
|
53
|
+
import { BahtSection as $r } from "./components/primitives/baht-section.js";
|
|
54
|
+
import { BahtStatChart as tt } from "./components/primitives/baht-stat-chart.js";
|
|
55
|
+
import { BahtStat as et } from "./components/primitives/baht-stat.js";
|
|
56
|
+
import { BahtSparkline as pt } from "./components/primitives/baht-sparkline.js";
|
|
57
|
+
import { BahtDonutChart as ht } from "./components/primitives/baht-donut-chart.js";
|
|
58
|
+
import { BahtBarChart as Bt } from "./components/primitives/baht-bar-chart.js";
|
|
59
|
+
import { BahtLineChart as it } from "./components/primitives/baht-line-chart.js";
|
|
60
|
+
import { BahtHeatmap as nt } from "./components/primitives/baht-heatmap.js";
|
|
61
|
+
import { BahtMeter as ct } from "./components/primitives/baht-meter.js";
|
|
62
|
+
import { BahtChartBase as St, chartColor as Tt, chartSeqColor as gt, foldOther as ut, formatValue as Ct, linearScale as Rt, minTickStep as kt, niceRange as Ft, niceTicks as wt, renderTableTwin as At } from "./components/primitives/charts.js";
|
|
63
|
+
import { BahtEmptyState as bt } from "./components/primitives/baht-empty-state.js";
|
|
64
|
+
import { BahtErrorState as Mt } from "./components/primitives/baht-error-state.js";
|
|
65
|
+
import { BahtKeyvalueEditor as Et } from "./components/primitives/baht-keyvalue-editor.js";
|
|
66
|
+
import { BahtReferencePicker as It } from "./components/primitives/baht-reference-picker.js";
|
|
67
|
+
import { BahtTypeahead as Dt } from "./components/primitives/baht-typeahead.js";
|
|
68
|
+
import { BahtRepeater as Nt } from "./components/primitives/baht-repeater.js";
|
|
69
|
+
import { BahtSteps as Gt } from "./components/primitives/baht-steps.js";
|
|
70
|
+
import { TAG_FOR_TYPE as Wt } from "./components/primitives/tag-map.js";
|
|
71
|
+
import { BahtComments as zt } from "./components/primitives/baht-comments.js";
|
|
72
|
+
import { BahtEditTable as Ut } from "./components/primitives/baht-edit-table.js";
|
|
73
|
+
import { BahtNotificationBell as jt } from "./components/primitives/baht-notification-bell.js";
|
|
74
|
+
import { BahtRuleBuilder as Qt } from "./components/primitives/baht-rule-builder.js";
|
|
75
|
+
import { BahtAppShell as Zt } from "./components/primitives/baht-app-shell.js";
|
|
76
|
+
import { BahtApprovalChain as ro } from "./components/primitives/baht-approval-chain.js";
|
|
77
|
+
import { BahtCatalogCard as oo } from "./components/primitives/baht-catalog-card.js";
|
|
78
|
+
import { BahtFilterBuilder as ao, matchesFilter as po } from "./components/primitives/baht-filter-builder.js";
|
|
79
|
+
import { BahtOrderBox as ho } from "./components/primitives/baht-order-box.js";
|
|
80
|
+
import { BahtPageHeader as Bo } from "./components/primitives/baht-page-header.js";
|
|
81
|
+
import { BahtSectionHeader as io } from "./components/primitives/baht-section-header.js";
|
|
82
|
+
import { BahtFacts as no } from "./components/primitives/baht-facts.js";
|
|
83
|
+
import { BahtChoiceGroup as so } from "./components/primitives/baht-choice-group.js";
|
|
84
|
+
import { BahtSearch as To } from "./components/primitives/baht-search.js";
|
|
85
|
+
import { BahtRecordBar as uo } from "./components/primitives/baht-record-bar.js";
|
|
86
|
+
import { BahtWizard as Ro } from "./components/primitives/baht-wizard.js";
|
|
87
|
+
import { BahtReferenceDialog as Fo, pageOfRows as wo } from "./components/primitives/baht-reference-dialog.js";
|
|
88
|
+
import { BahtColumnPicker as Po } from "./components/primitives/baht-column-picker.js";
|
|
89
|
+
import { BahtSavedFilters as vo } from "./components/primitives/baht-saved-filters.js";
|
|
90
|
+
import { filterFieldsOf as Oo, valueAt as Eo } from "./components/primitives/column-map.js";
|
|
91
|
+
import { isIllustrationName as Io, renderIllustration as Lo } from "./components/primitives/illustrations.js";
|
|
92
|
+
import { BahtFieldBase as Ho } from "./components/field-base.js";
|
|
93
|
+
import { BahtElement as _o, SSR_STASH as Go, adoptLightChildren as Vo, hasDom as Wo, hasSsrMarkup as qo } from "./components/base.js";
|
|
94
|
+
import { BahtForm as Ko } from "./components/baht-form.js";
|
|
95
|
+
import { BahtWorkflow as Yo } from "./components/baht-workflow.js";
|
|
96
|
+
export {
|
|
97
|
+
xr as BahtAccordion,
|
|
98
|
+
D as BahtAlert,
|
|
99
|
+
Zt as BahtAppShell,
|
|
100
|
+
ro as BahtApprovalChain,
|
|
101
|
+
x as BahtAvatar,
|
|
102
|
+
f as BahtBadge,
|
|
103
|
+
Bt as BahtBarChart,
|
|
104
|
+
gr as BahtBreadcrumbs,
|
|
105
|
+
e as BahtButton,
|
|
106
|
+
dr as BahtCalendar,
|
|
107
|
+
ar as BahtCard,
|
|
108
|
+
oo as BahtCatalogCard,
|
|
109
|
+
St as BahtChartBase,
|
|
110
|
+
_r as BahtCheckbox,
|
|
111
|
+
so as BahtChoiceGroup,
|
|
112
|
+
l as BahtCode,
|
|
113
|
+
Po as BahtColumnPicker,
|
|
114
|
+
zt as BahtComments,
|
|
115
|
+
Or as BahtCurrency,
|
|
116
|
+
Kr as BahtDatepicker,
|
|
117
|
+
ht as BahtDonutChart,
|
|
118
|
+
Ut as BahtEditTable,
|
|
119
|
+
_o as BahtElement,
|
|
120
|
+
bt as BahtEmptyState,
|
|
121
|
+
Mt as BahtErrorState,
|
|
122
|
+
no as BahtFacts,
|
|
123
|
+
Ho as BahtFieldBase,
|
|
124
|
+
mr as BahtFieldset,
|
|
125
|
+
Yr as BahtFile,
|
|
126
|
+
z as BahtFilter,
|
|
127
|
+
ao as BahtFilterBuilder,
|
|
128
|
+
Ko as BahtForm,
|
|
129
|
+
nt as BahtHeatmap,
|
|
130
|
+
Cr as BahtInput,
|
|
131
|
+
Et as BahtKeyvalueEditor,
|
|
132
|
+
it as BahtLineChart,
|
|
133
|
+
Sr as BahtLink,
|
|
134
|
+
s as BahtList,
|
|
135
|
+
or as BahtLoadingOverlay,
|
|
136
|
+
wr as BahtMarkdown,
|
|
137
|
+
Pr as BahtMarkdownView,
|
|
138
|
+
M as BahtMenu,
|
|
139
|
+
ct as BahtMeter,
|
|
140
|
+
u as BahtModal,
|
|
141
|
+
Lr as BahtMultiselect,
|
|
142
|
+
jt as BahtNotificationBell,
|
|
143
|
+
vr as BahtNumber,
|
|
144
|
+
ho as BahtOrderBox,
|
|
145
|
+
W as BahtOtp,
|
|
146
|
+
Bo as BahtPageHeader,
|
|
147
|
+
T as BahtPagination,
|
|
148
|
+
I as BahtPopover,
|
|
149
|
+
Q as BahtProgress,
|
|
150
|
+
Z as BahtProgressRing,
|
|
151
|
+
Vr as BahtRadio,
|
|
152
|
+
G as BahtRange,
|
|
153
|
+
N as BahtRating,
|
|
154
|
+
uo as BahtRecordBar,
|
|
155
|
+
Fo as BahtReferenceDialog,
|
|
156
|
+
It as BahtReferencePicker,
|
|
157
|
+
Nt as BahtRepeater,
|
|
158
|
+
Qt as BahtRuleBuilder,
|
|
159
|
+
vo as BahtSavedFilters,
|
|
160
|
+
To as BahtSearch,
|
|
161
|
+
$r as BahtSection,
|
|
162
|
+
io as BahtSectionHeader,
|
|
163
|
+
yr as BahtSelect,
|
|
164
|
+
j as BahtSkeleton,
|
|
165
|
+
pt as BahtSparkline,
|
|
166
|
+
rr as BahtSpinner,
|
|
167
|
+
b as BahtSplitButton,
|
|
168
|
+
et as BahtStat,
|
|
169
|
+
tt as BahtStatChart,
|
|
170
|
+
Gt as BahtSteps,
|
|
171
|
+
U as BahtSwipeRow,
|
|
172
|
+
d as BahtTable,
|
|
173
|
+
E as BahtTabs,
|
|
174
|
+
Hr as BahtTags,
|
|
175
|
+
Xr as BahtText,
|
|
176
|
+
kr as BahtTextarea,
|
|
177
|
+
A as BahtThemeToggle,
|
|
178
|
+
fr as BahtTimeline,
|
|
179
|
+
R as BahtToast,
|
|
180
|
+
qr as BahtToggle,
|
|
181
|
+
F as BahtTooltip,
|
|
182
|
+
lr as BahtTree,
|
|
183
|
+
Dt as BahtTypeahead,
|
|
184
|
+
Jr as BahtUpload,
|
|
185
|
+
Ro as BahtWizard,
|
|
186
|
+
Yo as BahtWorkflow,
|
|
187
|
+
Go as SSR_STASH,
|
|
188
|
+
Wt as TAG_FOR_TYPE,
|
|
189
|
+
Vo as adoptLightChildren,
|
|
190
|
+
cr as calendarRange,
|
|
191
|
+
Tt as chartColor,
|
|
192
|
+
gt as chartSeqColor,
|
|
193
|
+
Oo as filterFieldsOf,
|
|
194
|
+
ut as foldOther,
|
|
195
|
+
Ct as formatValue,
|
|
196
|
+
Wo as hasDom,
|
|
197
|
+
qo as hasSsrMarkup,
|
|
198
|
+
p as isIconName,
|
|
199
|
+
Io as isIllustrationName,
|
|
200
|
+
Rt as linearScale,
|
|
201
|
+
po as matchesFilter,
|
|
202
|
+
kt as minTickStep,
|
|
203
|
+
Ft as niceRange,
|
|
204
|
+
wt as niceTicks,
|
|
205
|
+
wo as pageOfRows,
|
|
206
|
+
m as renderIcon,
|
|
207
|
+
Lo as renderIllustration,
|
|
208
|
+
At as renderTableTwin,
|
|
209
|
+
Eo as valueAt
|
|
210
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ToastOptions } from './components/primitives/baht-toast.js';
|
|
2
|
+
export type DialogTone = 'info' | 'success' | 'warning' | 'danger';
|
|
3
|
+
export interface DialogOptions {
|
|
4
|
+
/** Modal heading (also its accessible name). Each API has a dry default. */
|
|
5
|
+
title?: string;
|
|
6
|
+
tone?: DialogTone;
|
|
7
|
+
confirmText?: string;
|
|
8
|
+
cancelText?: string;
|
|
9
|
+
/** Secondary monospace block under the message (error detail, payload, …). */
|
|
10
|
+
detail?: string;
|
|
11
|
+
/** Allow Escape to cancel. Default true. A scrim click never cancels. */
|
|
12
|
+
dismissible?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface PromptOptions extends DialogOptions {
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
/** Initial input value. */
|
|
17
|
+
value?: string;
|
|
18
|
+
/**
|
|
19
|
+
* A textarea of this many rows instead of one line, for a reason or a note.
|
|
20
|
+
* Enter adds a line; Ctrl/⌘+Enter confirms.
|
|
21
|
+
*/
|
|
22
|
+
multiline?: number;
|
|
23
|
+
}
|
|
24
|
+
export type DialogReason = 'confirm' | 'cancel' | 'escape' | 'scrim' | 'detached';
|
|
25
|
+
export interface DialogResult {
|
|
26
|
+
confirmed: boolean;
|
|
27
|
+
reason: DialogReason;
|
|
28
|
+
/** Input value (prompt only). */
|
|
29
|
+
value?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const dialog: {
|
|
32
|
+
/** Yes/no question. Resolves true only on explicit confirm. */
|
|
33
|
+
confirm(message: string, options?: DialogOptions): Promise<boolean>;
|
|
34
|
+
/** One-button notice. Resolves when acknowledged. */
|
|
35
|
+
alert(message: string, options?: DialogOptions): Promise<void>;
|
|
36
|
+
/** Error notice — danger tone, optional monospace `detail`. */
|
|
37
|
+
error(message: string, options?: DialogOptions): Promise<void>;
|
|
38
|
+
/** Single text input. Resolves the value, or null on cancel/dismiss. */
|
|
39
|
+
prompt(message: string, options?: PromptOptions): Promise<string | null>;
|
|
40
|
+
};
|
|
41
|
+
type ToastShorthand = Omit<ToastOptions, 'message' | 'tone'>;
|
|
42
|
+
export declare const toast: {
|
|
43
|
+
show(message: string, options?: Omit<ToastOptions, "message">): number;
|
|
44
|
+
success: (message: string, options?: ToastShorthand) => number;
|
|
45
|
+
info: (message: string, options?: ToastShorthand) => number;
|
|
46
|
+
warning: (message: string, options?: ToastShorthand) => number;
|
|
47
|
+
danger: (message: string, options?: ToastShorthand) => number;
|
|
48
|
+
dismiss(id: number): void;
|
|
49
|
+
};
|
|
50
|
+
export {};
|
package/dist/overlay.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import "./components/primitives/baht-modal.js";
|
|
2
|
+
import "./components/primitives/baht-toast.js";
|
|
3
|
+
import "./components/primitives/baht-button.js";
|
|
4
|
+
import { afterExit as I } from "./components/motion.js";
|
|
5
|
+
let E = Promise.resolve();
|
|
6
|
+
function L(e) {
|
|
7
|
+
const t = E.then(e, e);
|
|
8
|
+
return E = t.catch(() => {
|
|
9
|
+
}), t;
|
|
10
|
+
}
|
|
11
|
+
function f(e) {
|
|
12
|
+
return L(() => S(e));
|
|
13
|
+
}
|
|
14
|
+
async function S(e) {
|
|
15
|
+
const t = document.activeElement, c = e.dismissible !== !1, g = e.tone === "danger" ? "danger" : "primary", n = document.createElement("baht-modal");
|
|
16
|
+
n.heading = e.title ?? "", n.showClose = !1, n.closeOnScrim = !1;
|
|
17
|
+
const d = document.createElement("div");
|
|
18
|
+
d.className = `baht-dialog${e.tone ? ` baht-dialog--${e.tone}` : ""}`;
|
|
19
|
+
const w = document.createElement("p");
|
|
20
|
+
if (w.className = "baht-dialog-message", w.textContent = e.message, d.appendChild(w), e.detail) {
|
|
21
|
+
const s = document.createElement("pre");
|
|
22
|
+
s.className = "baht-dialog-detail", s.textContent = e.detail, d.appendChild(s);
|
|
23
|
+
}
|
|
24
|
+
let a = null;
|
|
25
|
+
if (e.showInput) {
|
|
26
|
+
if (e.multiline) {
|
|
27
|
+
const s = document.createElement("textarea");
|
|
28
|
+
s.rows = e.multiline, a = s;
|
|
29
|
+
} else {
|
|
30
|
+
const s = document.createElement("input");
|
|
31
|
+
s.type = "text", a = s;
|
|
32
|
+
}
|
|
33
|
+
a.className = "baht-control baht-dialog-input", a.value = e.value ?? "", e.placeholder && (a.placeholder = e.placeholder), d.appendChild(a);
|
|
34
|
+
}
|
|
35
|
+
const h = document.createElement("div");
|
|
36
|
+
h.className = "baht-dialog-actions";
|
|
37
|
+
let o = null;
|
|
38
|
+
e.showCancel && (o = document.createElement("baht-button"), o.className = "baht-dialog-cancel", o.variant = "secondary", o.label = e.cancelText ?? "Cancel", h.appendChild(o));
|
|
39
|
+
const m = document.createElement("baht-button");
|
|
40
|
+
m.className = "baht-dialog-confirm", m.variant = g, m.label = e.confirmText ?? "OK", h.appendChild(m), d.appendChild(h), n.appendChild(d), document.body.appendChild(n), n.open = !0;
|
|
41
|
+
let p;
|
|
42
|
+
const C = new MutationObserver(() => {
|
|
43
|
+
n.isConnected || p == null || p();
|
|
44
|
+
});
|
|
45
|
+
C.observe(document.documentElement, { childList: !0, subtree: !0 });
|
|
46
|
+
const x = await new Promise((s) => {
|
|
47
|
+
let y = !1;
|
|
48
|
+
const u = (l) => {
|
|
49
|
+
y || (y = !0, s(l));
|
|
50
|
+
};
|
|
51
|
+
p = () => {
|
|
52
|
+
u({ confirmed: !1, reason: "detached" });
|
|
53
|
+
}, m.addEventListener("click", () => {
|
|
54
|
+
u({ confirmed: !0, reason: "confirm", ...a ? { value: a.value } : {} });
|
|
55
|
+
}), o == null || o.addEventListener("click", () => {
|
|
56
|
+
u({ confirmed: !1, reason: "cancel" });
|
|
57
|
+
}), n.addEventListener("baht-close", (l) => {
|
|
58
|
+
if (!c) return;
|
|
59
|
+
const i = l.detail.reason;
|
|
60
|
+
u({ confirmed: !1, reason: i === "scrim" ? "scrim" : "escape" });
|
|
61
|
+
}), a == null || a.addEventListener("keydown", (l) => {
|
|
62
|
+
const i = l, N = e.multiline ? i.ctrlKey || i.metaKey : !0;
|
|
63
|
+
i.key === "Enter" && !i.isComposing && N && u({ confirmed: !0, reason: "confirm", value: i.target.value });
|
|
64
|
+
}), n.updateComplete.then(() => {
|
|
65
|
+
var l;
|
|
66
|
+
return (l = a ?? m.querySelector("button")) == null ? void 0 : l.focus();
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
C.disconnect(), n.open = !1;
|
|
70
|
+
const v = n.querySelector(".baht-modal-scrim");
|
|
71
|
+
return v ? (v.classList.add("baht-modal-scrim--closing"), I(v, () => {
|
|
72
|
+
n.remove();
|
|
73
|
+
})) : n.remove(), t == null || t.focus(), x;
|
|
74
|
+
}
|
|
75
|
+
const $ = {
|
|
76
|
+
/** Yes/no question. Resolves true only on explicit confirm. */
|
|
77
|
+
async confirm(e, t = {}) {
|
|
78
|
+
return (await f({
|
|
79
|
+
title: "Are you sure?",
|
|
80
|
+
confirmText: "Confirm",
|
|
81
|
+
...t,
|
|
82
|
+
message: e,
|
|
83
|
+
showCancel: !0,
|
|
84
|
+
showInput: !1
|
|
85
|
+
})).confirmed;
|
|
86
|
+
},
|
|
87
|
+
/** One-button notice. Resolves when acknowledged. */
|
|
88
|
+
async alert(e, t = {}) {
|
|
89
|
+
await f({
|
|
90
|
+
title: "Notice",
|
|
91
|
+
...t,
|
|
92
|
+
message: e,
|
|
93
|
+
showCancel: !1,
|
|
94
|
+
showInput: !1
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
/** Error notice — danger tone, optional monospace `detail`. */
|
|
98
|
+
async error(e, t = {}) {
|
|
99
|
+
await f({
|
|
100
|
+
title: "Something went wrong",
|
|
101
|
+
tone: "danger",
|
|
102
|
+
...t,
|
|
103
|
+
message: e,
|
|
104
|
+
showCancel: !1,
|
|
105
|
+
showInput: !1
|
|
106
|
+
});
|
|
107
|
+
},
|
|
108
|
+
/** Single text input. Resolves the value, or null on cancel/dismiss. */
|
|
109
|
+
async prompt(e, t = {}) {
|
|
110
|
+
const c = await f({
|
|
111
|
+
title: "Input needed",
|
|
112
|
+
confirmText: "OK",
|
|
113
|
+
...t,
|
|
114
|
+
message: e,
|
|
115
|
+
showCancel: !0,
|
|
116
|
+
showInput: !0
|
|
117
|
+
});
|
|
118
|
+
return c.confirmed ? c.value ?? "" : null;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
let r = null;
|
|
122
|
+
function T() {
|
|
123
|
+
return r != null && r.isConnected || (r = document.querySelector("baht-toast") ?? document.body.appendChild(document.createElement("baht-toast"))), r;
|
|
124
|
+
}
|
|
125
|
+
const b = (e) => (t, c = {}) => q.show(t, { ...c, tone: e }), q = {
|
|
126
|
+
show(e, t = {}) {
|
|
127
|
+
return T().show({ message: e, ...t });
|
|
128
|
+
},
|
|
129
|
+
success: b("success"),
|
|
130
|
+
info: b("info"),
|
|
131
|
+
warning: b("warning"),
|
|
132
|
+
danger: b("danger"),
|
|
133
|
+
dismiss(e) {
|
|
134
|
+
r == null || r.dismiss(e);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
export {
|
|
138
|
+
$ as dialog,
|
|
139
|
+
q as toast
|
|
140
|
+
};
|