bank20baht-ui 0.0.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.
Files changed (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +190 -0
  3. package/dist/chunks/baht-toast-BlZBbneT.js +324 -0
  4. package/dist/components/baht-form.d.ts +41 -0
  5. package/dist/components/baht-workflow.d.ts +64 -0
  6. package/dist/components/base.d.ts +38 -0
  7. package/dist/components/primitives/baht-accordion.d.ts +26 -0
  8. package/dist/components/primitives/baht-alert.d.ts +17 -0
  9. package/dist/components/primitives/baht-badge.d.ts +19 -0
  10. package/dist/components/primitives/baht-breadcrumbs.d.ts +22 -0
  11. package/dist/components/primitives/baht-button.d.ts +31 -0
  12. package/dist/components/primitives/baht-card.d.ts +18 -0
  13. package/dist/components/primitives/baht-checkbox.d.ts +7 -0
  14. package/dist/components/primitives/baht-code.d.ts +18 -0
  15. package/dist/components/primitives/baht-datepicker.d.ts +6 -0
  16. package/dist/components/primitives/baht-fieldset.d.ts +17 -0
  17. package/dist/components/primitives/baht-file.d.ts +9 -0
  18. package/dist/components/primitives/baht-filter.d.ts +24 -0
  19. package/dist/components/primitives/baht-input.d.ts +6 -0
  20. package/dist/components/primitives/baht-link.d.ts +17 -0
  21. package/dist/components/primitives/baht-list.d.ts +28 -0
  22. package/dist/components/primitives/baht-modal.d.ts +32 -0
  23. package/dist/components/primitives/baht-multiselect.d.ts +8 -0
  24. package/dist/components/primitives/baht-number.d.ts +5 -0
  25. package/dist/components/primitives/baht-otp.d.ts +26 -0
  26. package/dist/components/primitives/baht-pagination.d.ts +21 -0
  27. package/dist/components/primitives/baht-progress.d.ts +16 -0
  28. package/dist/components/primitives/baht-radio.d.ts +5 -0
  29. package/dist/components/primitives/baht-range.d.ts +21 -0
  30. package/dist/components/primitives/baht-rating.d.ts +22 -0
  31. package/dist/components/primitives/baht-select.d.ts +5 -0
  32. package/dist/components/primitives/baht-skeleton.d.ts +16 -0
  33. package/dist/components/primitives/baht-spinner.d.ts +13 -0
  34. package/dist/components/primitives/baht-table.d.ts +44 -0
  35. package/dist/components/primitives/baht-text.d.ts +8 -0
  36. package/dist/components/primitives/baht-textarea.d.ts +5 -0
  37. package/dist/components/primitives/baht-timeline.d.ts +21 -0
  38. package/dist/components/primitives/baht-toast.d.ts +27 -0
  39. package/dist/components/primitives/baht-toggle.d.ts +6 -0
  40. package/dist/components/primitives/baht-tooltip.d.ts +29 -0
  41. package/dist/components/primitives/icons.d.ts +13 -0
  42. package/dist/components/primitives/index.d.ts +38 -0
  43. package/dist/core/approval.d.ts +9 -0
  44. package/dist/core/defaults.d.ts +6 -0
  45. package/dist/core/engine/conditions.d.ts +4 -0
  46. package/dist/core/engine/evaluate.d.ts +8 -0
  47. package/dist/core/engine/expressions.d.ts +3 -0
  48. package/dist/core/index.d.ts +7 -0
  49. package/dist/core/types.d.ts +166 -0
  50. package/dist/core/validators.d.ts +6 -0
  51. package/dist/custom-elements.json +7761 -0
  52. package/dist/engine.js +329 -0
  53. package/dist/index.d.ts +5 -0
  54. package/dist/index.js +1796 -0
  55. package/dist/overlay.d.ts +45 -0
  56. package/dist/overlay.js +121 -0
  57. package/dist/react.d.ts +191 -0
  58. package/dist/react.js +1 -0
  59. package/dist/tokens.css +936 -0
  60. package/dist/vscode.css-custom-data.json +6 -0
  61. package/dist/vscode.html-custom-data.json +479 -0
  62. package/dist/web-types.json +1226 -0
  63. package/package.json +94 -0
@@ -0,0 +1,26 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ export interface AccordionItem {
4
+ title: string;
5
+ content: string;
6
+ open?: boolean;
7
+ }
8
+ /**
9
+ * Accordion. `items` drive the panels; `multiple` allows several open at once.
10
+ * Emits `baht-toggle { index, open }`.
11
+ *
12
+ * el.items = [
13
+ * { title: 'What is a workflow?', content: 'Workflows run when something happens…' },
14
+ * { title: 'Pricing', content: '฿20 / month.', open: true },
15
+ * ];
16
+ */
17
+ export declare class BahtAccordion extends BahtElement {
18
+ items: AccordionItem[];
19
+ multiple: boolean;
20
+ private openSet;
21
+ private static instances;
22
+ private uid;
23
+ protected willUpdate(changed: Map<PropertyKey, unknown>): void;
24
+ toggle(index: number): void;
25
+ protected render(): TemplateResult;
26
+ }
@@ -0,0 +1,17 @@
1
+ import { nothing, TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Inline alert / callout.
5
+ *
6
+ * <baht-alert tone="danger" heading="Couldn't reach the webhook"
7
+ * message="Check the URL and try again." dismissible></baht-alert>
8
+ */
9
+ export declare class BahtAlert extends BahtElement {
10
+ tone: 'info' | 'success' | 'warning' | 'danger';
11
+ heading: string;
12
+ message: string;
13
+ dismissible: boolean;
14
+ hidden: boolean;
15
+ private dismiss;
16
+ protected render(): TemplateResult | typeof nothing;
17
+ }
@@ -0,0 +1,19 @@
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
+ */
12
+ export declare class BahtBadge extends BahtElement {
13
+ tone: BadgeTone;
14
+ label: string;
15
+ /** Force the dot on/off; defaults to on for status tones. */
16
+ dot: boolean | null;
17
+ private get showDot();
18
+ protected render(): TemplateResult;
19
+ }
@@ -0,0 +1,22 @@
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
+ */
17
+ export declare class BahtBreadcrumbs extends BahtElement {
18
+ items: Crumb[];
19
+ separator: string;
20
+ private navigate;
21
+ protected render(): TemplateResult;
22
+ }
@@ -0,0 +1,31 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ import { IconName } from './icons.js';
4
+ export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
5
+ export type ButtonSize = 'sm' | 'md' | 'lg';
6
+ /**
7
+ * Design-system button (20baht: no scale, no shadow change — color does the work).
8
+ * Standalone primitive: children become the label, listen for the native `click`.
9
+ * (Light DOM has no <slot>, so the initial children are moved into the button.)
10
+ *
11
+ * <baht-button variant="danger" size="sm">Delete</baht-button>
12
+ * <baht-button label="Save workflow"></baht-button>
13
+ * <baht-button icon="copy" variant="ghost" size="sm">Copy</baht-button>
14
+ * <baht-button icon="close" icon-only label="Close"></baht-button> <!-- label = a11y name -->
15
+ */
16
+ export declare class BahtButton extends BahtElement {
17
+ variant: ButtonVariant;
18
+ size: ButtonSize;
19
+ disabled: boolean;
20
+ /** Forwarded to the native button — 'button' (default) or 'submit'. */
21
+ type: 'button' | 'submit';
22
+ /** Alternative to children for setting the label programmatically. */
23
+ label: string;
24
+ /** Optional leading icon from the curated set (copy/check/download/…). */
25
+ icon: IconName | '';
26
+ /** Square icon-only button. Requires `label` for the accessible name. */
27
+ iconOnly: boolean;
28
+ private buttonEl;
29
+ protected firstUpdated(): void;
30
+ protected render(): TemplateResult;
31
+ }
@@ -0,0 +1,18 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Surface card (20baht: white on cream, 1px border, no shadow at rest — the
5
+ * border carries the separation). Children become the body.
6
+ *
7
+ * <baht-card heading="Runs" subtitle="Last 30 days">…content…</baht-card>
8
+ * <baht-card hero>…large feature card (20px radius)…</baht-card>
9
+ */
10
+ export declare class BahtCard extends BahtElement {
11
+ heading: string;
12
+ subtitle: string;
13
+ /** hero = 20px radius + roomier padding (large/feature cards). */
14
+ hero: boolean;
15
+ private bodyEl;
16
+ protected firstUpdated(): void;
17
+ protected render(): TemplateResult;
18
+ }
@@ -0,0 +1,7 @@
1
+ import { nothing, TemplateResult } from 'lit';
2
+ import { BahtFieldBase } from '../base.js';
3
+ export declare class BahtCheckbox extends BahtFieldBase {
4
+ /** Label sits beside the box, so suppress the block label. */
5
+ protected renderLabel(): typeof nothing;
6
+ protected renderControl(): TemplateResult;
7
+ }
@@ -0,0 +1,18 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ export type CodeVariant = 'inline' | 'block';
4
+ /**
5
+ * Monospace code (20baht): an inline chip or a block. Content is the light-DOM
6
+ * children (or the `code` property). Not a syntax highlighter — just the
7
+ * design-system's canonical way to show code/identifiers/tokens.
8
+ *
9
+ * <baht-code>baht-button</baht-code>
10
+ * <baht-code variant="block">npm i bank20baht-ui</baht-code>
11
+ */
12
+ export declare class BahtCode extends BahtElement {
13
+ variant: CodeVariant;
14
+ /** Alternative to children for setting the code text programmatically. */
15
+ code: string;
16
+ protected firstUpdated(): void;
17
+ protected render(): TemplateResult;
18
+ }
@@ -0,0 +1,6 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtFieldBase } from '../base.js';
3
+ /** Value = ISO date string (yyyy-mm-dd). */
4
+ export declare class BahtDatepicker extends BahtFieldBase {
5
+ protected renderControl(): TemplateResult;
6
+ }
@@ -0,0 +1,17 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Semantic group wrapper (native <fieldset>/<legend>). Children become the
5
+ * content — typically a set of baht-* fields.
6
+ *
7
+ * <baht-fieldset legend="Billing">
8
+ * <baht-input>…</baht-input>
9
+ * </baht-fieldset>
10
+ */
11
+ export declare class BahtFieldset extends BahtElement {
12
+ legend: string;
13
+ disabled: boolean;
14
+ private bodyEl;
15
+ protected firstUpdated(): void;
16
+ protected render(): TemplateResult;
17
+ }
@@ -0,0 +1,9 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtFieldBase } from '../base.js';
3
+ /**
4
+ * Capture only (spec 01 §2): value = File handle(s); the lib never uploads.
5
+ * maxSize (bytes) is enforced here as a soft filter — oversize files rejected.
6
+ */
7
+ export declare class BahtFile extends BahtFieldBase {
8
+ protected renderControl(): TemplateResult;
9
+ }
@@ -0,0 +1,24 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ import { FieldOption } from '../../core/types.js';
4
+ /**
5
+ * Filter chip group. Controlled: emits `baht-change { selected }` (array of
6
+ * option keys), host re-feeds `selected`. Typical use: above an <baht-table>,
7
+ * the handler refetches page 1 with the new filters.
8
+ *
9
+ * const f = document.querySelector('baht-filter');
10
+ * f.options = [{ key: 'running', label: 'Running' }, { key: 'failed', label: 'Failed' }];
11
+ * f.selected = ['running'];
12
+ * f.addEventListener('baht-change', (e) => refetch({ status: e.detail.selected }));
13
+ */
14
+ export declare class BahtFilter extends BahtElement {
15
+ options: FieldOption[];
16
+ selected: string[];
17
+ /** false = radio behavior (max one active; clicking it again clears). */
18
+ multiple: boolean;
19
+ disabled: boolean;
20
+ /** Accessible name for the chip group. */
21
+ label: string;
22
+ private toggle;
23
+ protected render(): TemplateResult;
24
+ }
@@ -0,0 +1,6 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtFieldBase } from '../base.js';
3
+ /** text + email share one control; email differs only in input type + validator. */
4
+ export declare class BahtInput extends BahtFieldBase {
5
+ protected renderControl(): TemplateResult;
6
+ }
@@ -0,0 +1,17 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Styled anchor (20baht underline treatment). `external` opens a new tab and
5
+ * shows the ↗ mark.
6
+ *
7
+ * <baht-link href="/docs" label="Read the docs"></baht-link>
8
+ * <baht-link href="https://…" label="Status page" external></baht-link>
9
+ */
10
+ export declare class BahtLink extends BahtElement {
11
+ href: string;
12
+ label: string;
13
+ external: boolean;
14
+ /** Screen-reader suffix for external links (override to localize). */
15
+ externalHint: string;
16
+ protected render(): TemplateResult;
17
+ }
@@ -0,0 +1,28 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ export interface ListItem {
4
+ id?: string | number;
5
+ title: string;
6
+ subtitle?: string;
7
+ meta?: string;
8
+ badge?: string;
9
+ badgeTone?: string;
10
+ [key: string]: unknown;
11
+ }
12
+ /**
13
+ * Display list — same server-side contract as <baht-table>: `items` is the
14
+ * current page, `loading` shows skeleton rows, the host fetches on
15
+ * `baht-page-change` (pair with <baht-pagination>).
16
+ */
17
+ export declare class BahtList extends BahtElement {
18
+ items: ListItem[];
19
+ loading: boolean;
20
+ error: boolean;
21
+ errorMessage: string;
22
+ emptyMessage: string;
23
+ skeletonRows: number;
24
+ clickable: boolean;
25
+ private emitItem;
26
+ private renderRows;
27
+ protected render(): TemplateResult;
28
+ }
@@ -0,0 +1,32 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Modal dialog (20baht: 0.4 ink scrim, no blur; float shadow; 20px radius).
5
+ * Controlled: the host flips `open`. Children become the body.
6
+ *
7
+ * <baht-modal heading="Delete this workflow?">
8
+ * <p>Steps and run history will be removed.</p>
9
+ * </baht-modal>
10
+ * modal.open = true;
11
+ * modal.addEventListener('baht-close', (e) => (modal.open = false));
12
+ */
13
+ export declare class BahtModal extends BahtElement {
14
+ open: boolean;
15
+ heading: string;
16
+ showClose: boolean;
17
+ closeOnScrim: boolean;
18
+ private bodyEl;
19
+ private static openStack;
20
+ private previousFocus;
21
+ private onKeydown;
22
+ private focusables;
23
+ /** Keep Tab cycling inside the dialog (no keyboard escape to the page behind). */
24
+ private trapFocus;
25
+ connectedCallback(): void;
26
+ disconnectedCallback(): void;
27
+ protected firstUpdated(): void;
28
+ protected updated(changed: Map<PropertyKey, unknown>): void;
29
+ /** Ask the host to close (the host owns `open`). */
30
+ requestClose(reason?: 'escape' | 'scrim' | 'button'): void;
31
+ protected render(): TemplateResult;
32
+ }
@@ -0,0 +1,8 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtFieldBase } from '../base.js';
3
+ /** Multi-pick rendered as a checkbox group; value = array of option keys. */
4
+ export declare class BahtMultiselect extends BahtFieldBase {
5
+ private get selected();
6
+ private toggle;
7
+ protected renderControl(): TemplateResult;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtFieldBase } from '../base.js';
3
+ export declare class BahtNumber extends BahtFieldBase {
4
+ protected renderControl(): TemplateResult;
5
+ }
@@ -0,0 +1,26 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * One-time-code input: N boxes, auto-advance, backspace steps back, paste
5
+ * distributes. Emits `baht-change { value }` per edit and `baht-complete { value }`
6
+ * when every box is filled.
7
+ *
8
+ * <baht-otp length="6"></baht-otp>
9
+ */
10
+ export declare class BahtOtp extends BahtElement {
11
+ length: number;
12
+ value: string;
13
+ disabled: boolean;
14
+ /** 'numeric' restricts to digits; 'text' allows anything. */
15
+ mode: 'numeric' | 'text';
16
+ /** Accessible name for the group of boxes. */
17
+ label: string;
18
+ private get chars();
19
+ private inputs;
20
+ private clean;
21
+ private commit;
22
+ private onInput;
23
+ private onKeydown;
24
+ private onPaste;
25
+ protected render(): TemplateResult;
26
+ }
@@ -0,0 +1,21 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Server-side pagination control: it never slices data — it only reports the
5
+ * page the user asked for via `baht-page-change`; the host fetches that page.
6
+ *
7
+ * <baht-pagination page="4" total-pages="20"></baht-pagination>
8
+ * <baht-pagination variant="compact" page="1" total-pages="3"></baht-pagination>
9
+ */
10
+ export declare class BahtPagination extends BahtElement {
11
+ page: number;
12
+ totalPages: number;
13
+ /** 'numbered' = 1 … 4 5 6 … 20 · 'compact' = « Page 4 of 20 » */
14
+ variant: 'numbered' | 'compact';
15
+ /** Numbered pages shown on each side of the current page. */
16
+ siblings: number;
17
+ private go;
18
+ /** Visible page numbers with `null` marking an ellipsis gap. */
19
+ private get pageItems();
20
+ protected render(): TemplateResult;
21
+ }
@@ -0,0 +1,16 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Progress bar. `value` 0–100; omit (null) for indeterminate.
5
+ *
6
+ * <baht-progress value="65" show-label></baht-progress>
7
+ * <baht-progress></baht-progress> <!-- indeterminate -->
8
+ */
9
+ export declare class BahtProgress extends BahtElement {
10
+ value: number | null;
11
+ tone: 'primary' | 'success' | 'warning' | 'danger';
12
+ showLabel: boolean;
13
+ /** Accessible name for the progressbar. */
14
+ label: string;
15
+ protected render(): TemplateResult;
16
+ }
@@ -0,0 +1,5 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtFieldBase } from '../base.js';
3
+ export declare class BahtRadio extends BahtFieldBase {
4
+ protected renderControl(): TemplateResult;
5
+ }
@@ -0,0 +1,21 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Range slider. Controlled: emits `baht-change { value }` (a number) on input.
5
+ *
6
+ * <baht-range min="0" max="100" step="5" value="40" label="Retry limit"></baht-range>
7
+ */
8
+ export declare class BahtRange extends BahtElement {
9
+ value: number;
10
+ min: number;
11
+ max: number;
12
+ step: number;
13
+ label: string;
14
+ disabled: boolean;
15
+ showValue: boolean;
16
+ private static instances;
17
+ private uid;
18
+ private get inputId();
19
+ private onInput;
20
+ protected render(): TemplateResult;
21
+ }
@@ -0,0 +1,22 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Star rating. Controlled: emits `baht-change { value }`, host re-feeds `value`.
5
+ *
6
+ * <baht-rating value="3" max="5"></baht-rating>
7
+ * <baht-rating value="4" readonly></baht-rating>
8
+ */
9
+ export declare class BahtRating extends BahtElement {
10
+ value: number;
11
+ max: number;
12
+ readonly: boolean;
13
+ /** Accessible name for the radiogroup. */
14
+ label: string;
15
+ private hover;
16
+ private emitValue;
17
+ private pick;
18
+ /** APG radio-group keys: arrows move the value, Home/End jump the ends. */
19
+ private onKeydown;
20
+ private setHover;
21
+ protected render(): TemplateResult;
22
+ }
@@ -0,0 +1,5 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtFieldBase } from '../base.js';
3
+ export declare class BahtSelect extends BahtFieldBase {
4
+ protected renderControl(): TemplateResult;
5
+ }
@@ -0,0 +1,16 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Loading placeholder (opacity pulse — the 20baht system bans gradients in
5
+ * core UI, so no shimmer).
6
+ *
7
+ * <baht-skeleton variant="text" width="60%"></baht-skeleton>
8
+ * <baht-skeleton variant="circle" width="40px" height="40px"></baht-skeleton>
9
+ * <baht-skeleton height="120px"></baht-skeleton>
10
+ */
11
+ export declare class BahtSkeleton extends BahtElement {
12
+ variant: 'rect' | 'text' | 'circle';
13
+ width: string;
14
+ height: string;
15
+ protected render(): TemplateResult;
16
+ }
@@ -0,0 +1,13 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Loading spinner — the single animated icon the 20baht system allows.
5
+ *
6
+ * <baht-spinner></baht-spinner>
7
+ * <baht-spinner size="lg"></baht-spinner>
8
+ */
9
+ export declare class BahtSpinner extends BahtElement {
10
+ size: 'sm' | 'md' | 'lg';
11
+ label: string;
12
+ protected render(): TemplateResult;
13
+ }
@@ -0,0 +1,44 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ export type CellRenderer = (value: unknown, row: Record<string, unknown>) => unknown;
4
+ /**
5
+ * Server-side data table. `items` is ONE page of rows — the component never
6
+ * slices or fetches; on `baht-page-change` the host fetches the next page and
7
+ * re-feeds `items`/`page`. While that fetch runs, set `loading` to show
8
+ * skeleton rows.
9
+ *
10
+ * const t = document.querySelector('baht-table');
11
+ * t.columns = { name: 'Name', created_at: 'Created' };
12
+ * t.items = pageRows; // current page only
13
+ * t.loading = false; t.page = 1; t.totalPages = 12;
14
+ * t.addEventListener('baht-page-change', (e) => fetchPage(e.detail.page));
15
+ * t.addEventListener('baht-row-click', (e) => open(e.detail.id));
16
+ */
17
+ export declare class BahtTable extends BahtElement {
18
+ /** Rows of the CURRENT page. */
19
+ items: Record<string, unknown>[];
20
+ /** column key -> display name; omitted = derive keys from the first row. */
21
+ columns: Record<string, string>;
22
+ loading: boolean;
23
+ error: boolean;
24
+ errorMessage: string;
25
+ emptyMessage: string;
26
+ /** Row-number column (No.). Offset lets numbering continue across pages. */
27
+ showIndex: boolean;
28
+ indexOffset: number;
29
+ skeletonRows: number;
30
+ /** Which row key identifies a row in baht-row-click detail.id (e.g. 'group_id'). */
31
+ rowKey: string;
32
+ /** Rows emit baht-row-click + get hover/keyboard affordances. */
33
+ clickable: boolean;
34
+ /** Custom cell renderers by column key (functions — a property, never JSON). */
35
+ renderers: Record<string, CellRenderer>;
36
+ page: number;
37
+ totalPages: number;
38
+ private get columnKeys();
39
+ private labelFor;
40
+ private emitRow;
41
+ private cell;
42
+ private renderBody;
43
+ protected render(): TemplateResult;
44
+ }
@@ -0,0 +1,8 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ import { FieldDescriptor } from '../../core/types.js';
4
+ /** Static text block (`type: "label"`): no value, no emits. */
5
+ export declare class BahtText extends BahtElement {
6
+ field: FieldDescriptor;
7
+ protected render(): TemplateResult;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtFieldBase } from '../base.js';
3
+ export declare class BahtTextarea extends BahtFieldBase {
4
+ protected renderControl(): TemplateResult;
5
+ }
@@ -0,0 +1,21 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ export interface TimelineItem {
4
+ title: string;
5
+ description?: string;
6
+ time?: string;
7
+ tone?: 'primary' | 'success' | 'warning' | 'danger' | 'muted';
8
+ }
9
+ /**
10
+ * Vertical timeline (run history, audit log).
11
+ *
12
+ * el.items = [
13
+ * { title: 'Run started', time: '09:12', tone: 'muted' },
14
+ * { title: 'Webhook sent', time: '09:12' },
15
+ * { title: 'Failed', description: "Couldn't reach the webhook.", time: '09:13', tone: 'danger' },
16
+ * ];
17
+ */
18
+ export declare class BahtTimeline extends BahtElement {
19
+ items: TimelineItem[];
20
+ protected render(): TemplateResult;
21
+ }
@@ -0,0 +1,27 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ export interface ToastOptions {
4
+ message: string;
5
+ tone?: 'neutral' | 'success' | 'warning' | 'danger' | 'info';
6
+ /** ms until auto-dismiss; 0 = sticky. */
7
+ duration?: number;
8
+ }
9
+ /**
10
+ * Toast host — put ONE <baht-toast> on the page and call show():
11
+ *
12
+ * const toast = document.querySelector('baht-toast');
13
+ * toast.show({ message: 'Saved.', tone: 'success' });
14
+ *
15
+ * Copy: short and dry ("Saved.", not "Successfully saved your changes!").
16
+ */
17
+ export declare class BahtToast extends BahtElement {
18
+ /** Default auto-dismiss (ms) when show() gets no duration. */
19
+ duration: number;
20
+ private entries;
21
+ private static counter;
22
+ private timers;
23
+ show(options: ToastOptions): number;
24
+ dismiss(id: number): void;
25
+ disconnectedCallback(): void;
26
+ protected render(): TemplateResult;
27
+ }
@@ -0,0 +1,6 @@
1
+ import { nothing, TemplateResult } from 'lit';
2
+ import { BahtFieldBase } from '../base.js';
3
+ export declare class BahtToggle extends BahtFieldBase {
4
+ protected renderLabel(): typeof nothing;
5
+ protected renderControl(): TemplateResult;
6
+ }
@@ -0,0 +1,29 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ /**
4
+ * Hover/focus tooltip. Wraps its children; pure CSS show/hide (120ms fade).
5
+ * Escape hides it without moving focus (WCAG 1.4.13); it re-arms on leave/blur.
6
+ *
7
+ * <baht-tooltip text="Posted as JSON when the trigger fires">
8
+ * <baht-button variant="ghost" label="?"></baht-button>
9
+ * </baht-tooltip>
10
+ */
11
+ export declare class BahtTooltip extends BahtElement {
12
+ text: string;
13
+ position: 'top' | 'bottom' | 'left' | 'right';
14
+ private anchorEl;
15
+ private dismissed;
16
+ private static instances;
17
+ private uid;
18
+ private get tooltipId();
19
+ /**
20
+ * Point aria-describedby at the tooltip from the focusable child (light DOM,
21
+ * so the id reference works). No focusable child -> the anchor itself becomes
22
+ * one, so keyboard users can still surface the tooltip.
23
+ */
24
+ private wireDescribedBy;
25
+ protected firstUpdated(): void;
26
+ private onKeydown;
27
+ private rearm;
28
+ protected render(): TemplateResult;
29
+ }