@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.
Files changed (246) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +512 -2
  3. package/dist/components/baht-form.d.ts +206 -0
  4. package/dist/components/baht-form.js +630 -0
  5. package/dist/components/baht-workflow.d.ts +187 -0
  6. package/dist/components/baht-workflow.js +455 -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 +45172 -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,557 @@
1
+ import { default as React } from 'react';
2
+ import { FeatureFlags, FieldDescriptor, FieldOption, FormDefinition, NestedData, Registry, WorkflowDefinition, ReferencePage, ReferenceQuery, SavedFilter } from '@20baht/engine';
3
+ import { AccordionItem, TreeNode, CalendarEvent, CalendarMark, CalendarView, AvatarSize, BadgeTone, ButtonSize, ButtonVariant, MenuItem, PopoverPlacement, TabItem, CellRenderer, ColumnMap, RowMenu, TableVariant, ChartDatePoint, ChartFormat, ChartGroup, ChartMarker, ChartSeries, CodeVariant, Crumb, FilterVariant, ListItem, MeterKind, MeterThresholds, FactItem, ChoiceOption, ModalPlacement, ModalSize, CardAccent, ProgressRingTone, FieldReferenceLookup, ReferenceOption, SwipeAction, TimelineItem, CommentEntry, EditColumn, EditRow, NotificationItem } from './components/primitives/index.js';
4
+ import { BahtFormOptions } from './components/baht-form.js';
5
+ import { ShellNavItem } from './components/primitives/baht-app-shell.js';
6
+ import { ChainStep } from './components/primitives/baht-approval-chain.js';
7
+ import { FilterField, FilterValue } from './components/primitives/baht-filter-builder.js';
8
+ import { WizardStep } from './components/primitives/baht-wizard.js';
9
+ interface BackLabelAttr {
10
+ 'back-label'?: string;
11
+ }
12
+ interface BackLinkAttrs extends BackLabelAttr {
13
+ 'back-href'?: string;
14
+ }
15
+ /**
16
+ * Base attributes shared by every custom element (style, event handlers, …).
17
+ * `class` is included alongside React's `className` — web-component users often
18
+ * reach for the plain HTML attribute, and both work on custom elements.
19
+ */
20
+ type WC<Props = object> = React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement> & {
21
+ class?: string;
22
+ } & Props, HTMLElement>;
23
+ /** `empty-message`: what an element shows with nothing to list. */
24
+ type EmptyMessage = Pick<ChartCommon, 'empty-message'>;
25
+ /** Shared props of every chart element (all extend BahtChartBase). */
26
+ interface ChartCommon {
27
+ 'empty-message'?: string;
28
+ loading?: boolean;
29
+ 'show-table'?: boolean;
30
+ format?: ChartFormat;
31
+ currency?: string;
32
+ }
33
+ /** Shared props of the form-field primitives (all extend BahtFieldBase). */
34
+ interface FieldProps {
35
+ field?: FieldDescriptor;
36
+ value?: unknown;
37
+ disabled?: boolean;
38
+ readonly?: boolean;
39
+ required?: boolean;
40
+ error?: string | null;
41
+ }
42
+ declare module 'react' {
43
+ namespace JSX {
44
+ interface IntrinsicElements {
45
+ 'baht-form': WC<{
46
+ form?: FormDefinition;
47
+ value?: Record<string, unknown>;
48
+ registry?: Registry;
49
+ options?: BahtFormOptions;
50
+ view?: string;
51
+ flags?: FeatureFlags;
52
+ }>;
53
+ 'baht-workflow': WC<{
54
+ workflow?: WorkflowDefinition;
55
+ value?: NestedData;
56
+ registry?: Registry;
57
+ flags?: FeatureFlags;
58
+ 'validate-gate'?: boolean;
59
+ 'show-steps'?: boolean;
60
+ 'next-label'?: string;
61
+ 'submit-label'?: string;
62
+ 'back-label'?: string;
63
+ 'show-back'?: boolean;
64
+ }>;
65
+ 'baht-input': WC<FieldProps>;
66
+ 'baht-textarea': WC<FieldProps>;
67
+ 'baht-markdown': WC<FieldProps & {
68
+ uploader?: NonNullable<Registry['uploaders']>[string];
69
+ allowImage?: (href: string) => boolean;
70
+ }>;
71
+ 'baht-markdown-view': WC<{
72
+ source?: string;
73
+ allowImage?: (href: string) => boolean;
74
+ }>;
75
+ 'baht-number': WC<FieldProps>;
76
+ 'baht-currency': WC<FieldProps>;
77
+ 'baht-select': WC<FieldProps>;
78
+ 'baht-multiselect': WC<FieldProps>;
79
+ 'baht-tags': WC<FieldProps>;
80
+ 'baht-checkbox': WC<FieldProps>;
81
+ 'baht-radio': WC<FieldProps>;
82
+ 'baht-toggle': WC<FieldProps>;
83
+ 'baht-datepicker': WC<FieldProps>;
84
+ 'baht-file': WC<FieldProps>;
85
+ 'baht-repeater': WC<FieldProps>;
86
+ 'baht-text': WC<{
87
+ field?: FieldDescriptor;
88
+ }>;
89
+ 'baht-button': WC<{
90
+ variant?: ButtonVariant;
91
+ size?: ButtonSize;
92
+ disabled?: boolean;
93
+ loading?: boolean;
94
+ 'loading-label'?: string;
95
+ type?: 'button' | 'submit';
96
+ label?: string;
97
+ icon?: string;
98
+ 'icon-only'?: boolean;
99
+ shortcut?: string;
100
+ 'tooltip-position'?: 'top' | 'bottom';
101
+ }>;
102
+ 'baht-menu': WC<{
103
+ items?: MenuItem[];
104
+ 'trigger-label'?: string;
105
+ icon?: string;
106
+ label?: string;
107
+ variant?: 'ghost' | 'secondary';
108
+ size?: 'sm' | 'md';
109
+ align?: 'start' | 'end';
110
+ disabled?: boolean;
111
+ heading?: string;
112
+ }>;
113
+ 'baht-tabs': WC<{
114
+ tabs?: TabItem[];
115
+ value?: string;
116
+ label?: string;
117
+ variant?: 'line' | 'pill';
118
+ activation?: 'automatic' | 'manual';
119
+ }>;
120
+ 'baht-popover': WC<{
121
+ open?: boolean;
122
+ label?: string;
123
+ placement?: PopoverPlacement;
124
+ }>;
125
+ 'baht-theme-toggle': WC<{
126
+ theme?: 'light' | 'dark';
127
+ default?: 'light' | 'dark' | 'system';
128
+ target?: string;
129
+ 'storage-key'?: string;
130
+ }>;
131
+ 'baht-split-button': WC<{
132
+ label?: string;
133
+ variant?: ButtonVariant;
134
+ size?: ButtonSize;
135
+ disabled?: boolean;
136
+ shortcut?: string;
137
+ items?: MenuItem[];
138
+ align?: 'start' | 'end';
139
+ 'menu-label'?: string;
140
+ }>;
141
+ 'baht-badge': WC<{
142
+ tone?: BadgeTone;
143
+ label?: string;
144
+ dot?: boolean;
145
+ busy?: boolean;
146
+ }>;
147
+ 'baht-avatar': WC<{
148
+ label?: string;
149
+ initials?: string;
150
+ size?: AvatarSize;
151
+ }>;
152
+ 'baht-card': WC<{
153
+ heading?: string;
154
+ subtitle?: string;
155
+ hero?: boolean;
156
+ accent?: CardAccent;
157
+ level?: number;
158
+ }>;
159
+ 'baht-alert': WC<{
160
+ tone?: 'info' | 'success' | 'warning' | 'danger';
161
+ heading?: string;
162
+ message?: string;
163
+ dismissible?: boolean;
164
+ }>;
165
+ 'baht-code': WC<{
166
+ variant?: CodeVariant;
167
+ code?: string;
168
+ }>;
169
+ 'baht-link': WC<{
170
+ href?: string;
171
+ label?: string;
172
+ external?: boolean;
173
+ }>;
174
+ 'baht-spinner': WC<{
175
+ size?: 'sm' | 'md' | 'lg';
176
+ label?: string;
177
+ }>;
178
+ 'baht-skeleton': WC<{
179
+ variant?: 'rect' | 'text' | 'circle';
180
+ width?: string;
181
+ height?: string;
182
+ }>;
183
+ 'baht-tooltip': WC<{
184
+ text?: string;
185
+ position?: 'top' | 'bottom' | 'left' | 'right';
186
+ }>;
187
+ 'baht-fieldset': WC<{
188
+ legend?: string;
189
+ disabled?: boolean;
190
+ }>;
191
+ 'baht-table': WC<{
192
+ items?: Record<string, unknown>[];
193
+ columns?: ColumnMap;
194
+ renderers?: Record<string, CellRenderer>;
195
+ visibleColumns?: string[];
196
+ 'column-picker'?: boolean;
197
+ variant?: TableVariant;
198
+ filterable?: boolean;
199
+ filter?: FilterValue;
200
+ savedFilters?: SavedFilter[] | null;
201
+ loading?: boolean;
202
+ error?: boolean;
203
+ 'error-message'?: string;
204
+ 'empty-message'?: string;
205
+ 'show-index'?: boolean;
206
+ 'index-offset'?: number;
207
+ 'skeleton-rows'?: number;
208
+ 'row-key'?: string;
209
+ clickable?: boolean;
210
+ 'row-actions'?: boolean;
211
+ rowMenu?: RowMenu | null;
212
+ page?: number;
213
+ 'total-pages'?: number;
214
+ 'always-paginate'?: boolean;
215
+ 'cursor-mode'?: boolean;
216
+ 'has-next'?: boolean;
217
+ 'has-prev'?: boolean;
218
+ }>;
219
+ 'baht-list': WC<{
220
+ items?: ListItem[];
221
+ loading?: boolean;
222
+ error?: boolean;
223
+ 'error-message'?: string;
224
+ 'empty-message'?: string;
225
+ 'skeleton-rows'?: number;
226
+ clickable?: boolean;
227
+ }>;
228
+ 'baht-accordion': WC<{
229
+ items?: AccordionItem[];
230
+ multiple?: boolean;
231
+ }>;
232
+ 'baht-tree': WC<EmptyMessage & {
233
+ items?: TreeNode[];
234
+ selected?: string | null;
235
+ collapsed?: boolean;
236
+ label?: string;
237
+ }>;
238
+ 'baht-calendar': WC<{
239
+ view?: CalendarView;
240
+ date?: string;
241
+ events?: CalendarEvent[];
242
+ marks?: CalendarMark[];
243
+ label?: string;
244
+ today?: string;
245
+ 'week-start'?: number;
246
+ locale?: string;
247
+ 'first-hour'?: number;
248
+ }>;
249
+ 'baht-timeline': WC<{
250
+ items?: TimelineItem[];
251
+ }>;
252
+ 'baht-comments': WC<EmptyMessage & {
253
+ entries?: CommentEntry[];
254
+ 'allow-internal'?: boolean;
255
+ placeholder?: string;
256
+ 'internal-label'?: string;
257
+ busy?: boolean;
258
+ }>;
259
+ 'baht-notification-bell': WC<EmptyMessage & {
260
+ items?: NotificationItem[];
261
+ count?: number;
262
+ label?: string;
263
+ 'all-href'?: string;
264
+ 'all-label'?: string;
265
+ }>;
266
+ 'baht-edit-table': WC<{
267
+ columns?: EditColumn[];
268
+ rows?: EditRow[];
269
+ 'row-key'?: string;
270
+ addable?: boolean;
271
+ removable?: boolean;
272
+ label?: string;
273
+ }>;
274
+ 'baht-rule-builder': WC<{
275
+ workflow?: WorkflowDefinition | null;
276
+ }>;
277
+ 'baht-breadcrumbs': WC<{
278
+ items?: Crumb[];
279
+ separator?: string;
280
+ }>;
281
+ 'baht-app-shell': WC<{
282
+ brand?: string;
283
+ 'brand-sub'?: string;
284
+ 'brand-href'?: string;
285
+ context?: string;
286
+ items?: ShellNavItem[];
287
+ value?: string;
288
+ filterable?: boolean;
289
+ label?: string;
290
+ }>;
291
+ 'baht-approval-chain': WC<{
292
+ heading?: string;
293
+ steps?: ChainStep[];
294
+ }>;
295
+ 'baht-catalog-card': WC<{
296
+ heading?: string;
297
+ description?: string;
298
+ image?: string;
299
+ href?: string;
300
+ }>;
301
+ 'baht-filter-builder': WC<{
302
+ fields?: FilterField[];
303
+ value?: FilterValue;
304
+ }>;
305
+ 'baht-order-box': WC<{
306
+ heading?: string;
307
+ label?: string;
308
+ disabled?: boolean;
309
+ }>;
310
+ 'baht-page-header': WC<BackLinkAttrs & {
311
+ heading?: string;
312
+ description?: string;
313
+ eyebrow?: string;
314
+ size?: 'md' | 'lg';
315
+ 'art-position'?: 'end' | 'start';
316
+ }>;
317
+ 'baht-section-header': WC<{
318
+ heading?: string;
319
+ description?: string;
320
+ level?: 2 | 3 | 4;
321
+ }>;
322
+ 'baht-facts': WC<{
323
+ items?: FactItem[];
324
+ }>;
325
+ 'baht-choice-group': WC<{
326
+ options?: ChoiceOption[];
327
+ value?: string;
328
+ label?: string;
329
+ disabled?: boolean;
330
+ }>;
331
+ 'baht-search': WC<{
332
+ value?: string;
333
+ placeholder?: string;
334
+ label?: string;
335
+ debounce?: number;
336
+ disabled?: boolean;
337
+ }>;
338
+ 'baht-record-bar': WC<BackLinkAttrs & {
339
+ lines?: string[];
340
+ sticky?: boolean | string;
341
+ }>;
342
+ 'baht-wizard': WC<BackLabelAttr & {
343
+ steps?: WizardStep[];
344
+ value?: string;
345
+ variant?: 'chevron' | 'tabs';
346
+ validateStep?: (key: string) => boolean | Promise<boolean>;
347
+ 'next-label'?: string;
348
+ 'finish-label'?: string;
349
+ busy?: boolean;
350
+ }>;
351
+ 'baht-reference-dialog': WC<{
352
+ open?: boolean;
353
+ heading?: string;
354
+ columns?: FilterField[];
355
+ lister?: ((query: ReferenceQuery) => ReferencePage | Promise<ReferencePage>) | null;
356
+ selected?: string;
357
+ walk?: ColumnMap | null;
358
+ savedColumns?: string[] | null;
359
+ savedFilters?: SavedFilter[] | null;
360
+ }>;
361
+ 'baht-saved-filters': WC<{
362
+ filters?: SavedFilter[];
363
+ current?: FilterValue;
364
+ fields?: FilterField[];
365
+ }>;
366
+ 'baht-column-picker': WC<{
367
+ open?: boolean;
368
+ columns?: ColumnMap;
369
+ selected?: string[];
370
+ }>;
371
+ 'baht-steps': WC<{
372
+ steps?: string[];
373
+ current?: number;
374
+ variant?: 'default' | 'sidebar' | 'chevron' | 'compact';
375
+ 'show-done'?: boolean;
376
+ }>;
377
+ 'baht-filter': WC<{
378
+ options?: FieldOption[];
379
+ selected?: string[];
380
+ multiple?: boolean;
381
+ disabled?: boolean;
382
+ variant?: FilterVariant;
383
+ label?: string;
384
+ }>;
385
+ 'baht-swipe-row': WC<{
386
+ actions?: SwipeAction[];
387
+ open?: boolean;
388
+ label?: string;
389
+ }>;
390
+ 'baht-pagination': WC<{
391
+ page?: number;
392
+ 'total-pages'?: number;
393
+ variant?: 'numbered' | 'compact' | 'cursor';
394
+ siblings?: number;
395
+ 'has-next'?: boolean;
396
+ 'has-prev'?: boolean;
397
+ }>;
398
+ 'baht-progress': WC<{
399
+ value?: number | null;
400
+ tone?: 'primary' | 'success' | 'warning' | 'danger';
401
+ 'show-label'?: boolean;
402
+ label?: string;
403
+ }>;
404
+ 'baht-progress-ring': WC<{
405
+ value?: number;
406
+ tone?: ProgressRingTone;
407
+ label?: string;
408
+ size?: number;
409
+ }>;
410
+ /** standalone props, or FieldProps when used as a `type: 'range'` field */
411
+ 'baht-range': WC<FieldProps & {
412
+ value?: unknown;
413
+ min?: number;
414
+ max?: number;
415
+ step?: number;
416
+ label?: string;
417
+ disabled?: boolean;
418
+ 'show-value'?: boolean;
419
+ }>;
420
+ /** standalone props, or FieldProps when used as a `type: 'rating'` field */
421
+ 'baht-rating': WC<FieldProps & {
422
+ value?: unknown;
423
+ max?: number;
424
+ label?: string;
425
+ }>;
426
+ 'baht-otp': WC<{
427
+ length?: number;
428
+ value?: string;
429
+ disabled?: boolean;
430
+ mode?: 'numeric' | 'text';
431
+ }>;
432
+ 'baht-stat-chart': WC<{
433
+ total?: number;
434
+ label?: string;
435
+ color?: string;
436
+ }>;
437
+ 'baht-stat': WC<{
438
+ label?: string;
439
+ value?: number;
440
+ format?: ChartFormat;
441
+ currency?: string;
442
+ delta?: number | null;
443
+ 'delta-kind'?: 'abs' | 'pct';
444
+ 'delta-label'?: string;
445
+ 'up-is-good'?: boolean;
446
+ trend?: number[];
447
+ size?: 'md' | 'hero';
448
+ icon?: string;
449
+ }>;
450
+ 'baht-sparkline': WC<{
451
+ values?: number[];
452
+ width?: number;
453
+ height?: number;
454
+ 'accent-last'?: boolean;
455
+ color?: string;
456
+ label?: string;
457
+ }>;
458
+ 'baht-donut-chart': WC<ChartCommon & {
459
+ groups?: ChartGroup[];
460
+ total?: number | null;
461
+ color?: string;
462
+ 'center-label'?: string;
463
+ 'other-label'?: string;
464
+ }>;
465
+ 'baht-bar-chart': WC<ChartCommon & {
466
+ groups?: ChartGroup[];
467
+ series?: ChartSeries[];
468
+ categories?: string[];
469
+ orientation?: 'horizontal' | 'vertical';
470
+ stacked?: boolean;
471
+ compare?: number[];
472
+ markers?: ChartMarker[];
473
+ 'label-values'?: 'ends' | 'none';
474
+ emphasis?: number | null;
475
+ color?: string;
476
+ label?: string;
477
+ }>;
478
+ 'baht-line-chart': WC<ChartCommon & {
479
+ series?: ChartSeries[];
480
+ categories?: string[];
481
+ area?: boolean;
482
+ markers?: ChartMarker[];
483
+ forecast?: number;
484
+ baseline?: number | null;
485
+ 'label-values'?: 'ends' | 'none';
486
+ label?: string;
487
+ }>;
488
+ 'baht-heatmap': WC<ChartCommon & {
489
+ values?: ChartDatePoint[];
490
+ from?: string;
491
+ to?: string;
492
+ 'less-label'?: string;
493
+ 'more-label'?: string;
494
+ 'zero-label'?: string;
495
+ 'show-values'?: boolean;
496
+ label?: string;
497
+ }>;
498
+ 'baht-meter': WC<{
499
+ value?: number;
500
+ max?: number;
501
+ label?: string;
502
+ format?: ChartFormat;
503
+ currency?: string;
504
+ thresholds?: MeterThresholds;
505
+ expected?: number | null;
506
+ kind?: MeterKind;
507
+ 'over-label'?: string;
508
+ 'near-label'?: string;
509
+ 'at-label'?: string;
510
+ }>;
511
+ 'baht-empty-state': WC<{
512
+ icon?: string;
513
+ message?: string;
514
+ hint?: string;
515
+ }>;
516
+ 'baht-error-state': WC<{
517
+ icon?: string;
518
+ heading?: string;
519
+ message?: string;
520
+ 'retry-label'?: string;
521
+ }>;
522
+ 'baht-keyvalue-editor': WC<{
523
+ value?: Record<string, unknown>;
524
+ 'key-placeholder'?: string;
525
+ 'value-placeholder'?: string;
526
+ 'add-label'?: string;
527
+ disabled?: boolean;
528
+ }>;
529
+ /** standalone props, or FieldProps + `lookup` when used as a `type: 'reference'` field */
530
+ 'baht-reference-picker': WC<FieldProps & {
531
+ value?: unknown;
532
+ lookup?: FieldReferenceLookup | null;
533
+ display?: string;
534
+ placeholder?: string;
535
+ disabled?: boolean;
536
+ invalid?: boolean;
537
+ href?: string;
538
+ 'lookup-label'?: string;
539
+ debounce?: number;
540
+ fetcher?: (term: string) => Promise<ReferenceOption[]>;
541
+ }>;
542
+ 'baht-modal': WC<{
543
+ open?: boolean;
544
+ heading?: string;
545
+ description?: string;
546
+ placement?: ModalPlacement;
547
+ size?: ModalSize;
548
+ 'show-close'?: boolean;
549
+ 'close-on-scrim'?: boolean;
550
+ }>;
551
+ 'baht-toast': WC<{
552
+ duration?: number;
553
+ }>;
554
+ }
555
+ }
556
+ }
557
+ export {};
package/dist/react.js ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,106 @@
1
+ /**
2
+ * @20baht/ui/register — opt-in element registration.
3
+ *
4
+ * import { registerElements } from '@20baht/ui/register';
5
+ * await registerElements(['baht-button', 'baht-avatar']);
6
+ *
7
+ * Each tag is a dynamic import, so a bundler emits one chunk per element and
8
+ * the browser fetches only what was asked for (plus what that element itself
9
+ * composes — `baht-workflow` brings `baht-form` and the field primitives).
10
+ * Importing `@20baht/ui` instead registers everything.
11
+ */
12
+ declare const LOADERS: {
13
+ 'baht-accordion': () => Promise<typeof import("./components/primitives/baht-accordion.js")>;
14
+ 'baht-tree': () => Promise<typeof import("./components/primitives/baht-tree.js")>;
15
+ 'baht-calendar': () => Promise<typeof import("./components/primitives/baht-calendar.js")>;
16
+ 'baht-alert': () => Promise<typeof import("./components/primitives/baht-alert.js")>;
17
+ 'baht-app-shell': () => Promise<typeof import("./components/primitives/baht-app-shell.js")>;
18
+ 'baht-approval-chain': () => Promise<typeof import("./components/primitives/baht-approval-chain.js")>;
19
+ 'baht-avatar': () => Promise<typeof import("./components/primitives/baht-avatar.js")>;
20
+ 'baht-badge': () => Promise<typeof import("./components/primitives/baht-badge.js")>;
21
+ 'baht-bar-chart': () => Promise<typeof import("./components/primitives/baht-bar-chart.js")>;
22
+ 'baht-breadcrumbs': () => Promise<typeof import("./components/primitives/baht-breadcrumbs.js")>;
23
+ 'baht-button': () => Promise<typeof import("./components/primitives/baht-button.js")>;
24
+ 'baht-card': () => Promise<typeof import("./components/primitives/baht-card.js")>;
25
+ 'baht-catalog-card': () => Promise<typeof import("./components/primitives/baht-catalog-card.js")>;
26
+ 'baht-checkbox': () => Promise<typeof import("./components/primitives/baht-checkbox.js")>;
27
+ 'baht-code': () => Promise<typeof import("./components/primitives/baht-code.js")>;
28
+ 'baht-comments': () => Promise<typeof import("./components/primitives/baht-comments.js")>;
29
+ 'baht-currency': () => Promise<typeof import("./components/primitives/baht-currency.js")>;
30
+ 'baht-datepicker': () => Promise<typeof import("./components/primitives/baht-datepicker.js")>;
31
+ 'baht-donut-chart': () => Promise<typeof import("./components/primitives/baht-donut-chart.js")>;
32
+ 'baht-edit-table': () => Promise<typeof import("./components/primitives/baht-edit-table.js")>;
33
+ 'baht-empty-state': () => Promise<typeof import("./components/primitives/baht-empty-state.js")>;
34
+ 'baht-error-state': () => Promise<typeof import("./components/primitives/baht-error-state.js")>;
35
+ 'baht-fieldset': () => Promise<typeof import("./components/primitives/baht-fieldset.js")>;
36
+ 'baht-file': () => Promise<typeof import("./components/primitives/baht-file.js")>;
37
+ 'baht-filter': () => Promise<typeof import("./components/primitives/baht-filter.js")>;
38
+ 'baht-filter-builder': () => Promise<typeof import("./components/primitives/baht-filter-builder.js")>;
39
+ 'baht-form': () => Promise<typeof import("./components/baht-form.js")>;
40
+ 'baht-heatmap': () => Promise<typeof import("./components/primitives/baht-heatmap.js")>;
41
+ 'baht-input': () => Promise<typeof import("./components/primitives/baht-input.js")>;
42
+ 'baht-keyvalue-editor': () => Promise<typeof import("./components/primitives/baht-keyvalue-editor.js")>;
43
+ 'baht-line-chart': () => Promise<typeof import("./components/primitives/baht-line-chart.js")>;
44
+ 'baht-link': () => Promise<typeof import("./components/primitives/baht-link.js")>;
45
+ 'baht-list': () => Promise<typeof import("./components/primitives/baht-list.js")>;
46
+ 'baht-loading-overlay': () => Promise<typeof import("./components/primitives/baht-loading-overlay.js")>;
47
+ 'baht-menu': () => Promise<typeof import("./components/primitives/baht-menu.js")>;
48
+ 'baht-meter': () => Promise<typeof import("./components/primitives/baht-meter.js")>;
49
+ 'baht-modal': () => Promise<typeof import("./components/primitives/baht-modal.js")>;
50
+ 'baht-multiselect': () => Promise<typeof import("./components/primitives/baht-multiselect.js")>;
51
+ 'baht-notification-bell': () => Promise<typeof import("./components/primitives/baht-notification-bell.js")>;
52
+ 'baht-number': () => Promise<typeof import("./components/primitives/baht-number.js")>;
53
+ 'baht-order-box': () => Promise<typeof import("./components/primitives/baht-order-box.js")>;
54
+ 'baht-otp': () => Promise<typeof import("./components/primitives/baht-otp.js")>;
55
+ 'baht-page-header': () => Promise<typeof import("./components/primitives/baht-page-header.js")>;
56
+ 'baht-section-header': () => Promise<typeof import("./components/primitives/baht-section-header.js")>;
57
+ 'baht-facts': () => Promise<typeof import("./components/primitives/baht-facts.js")>;
58
+ 'baht-choice-group': () => Promise<typeof import("./components/primitives/baht-choice-group.js")>;
59
+ 'baht-search': () => Promise<typeof import("./components/primitives/baht-search.js")>;
60
+ 'baht-pagination': () => Promise<typeof import("./components/primitives/baht-pagination.js")>;
61
+ 'baht-popover': () => Promise<typeof import("./components/primitives/baht-popover.js")>;
62
+ 'baht-progress': () => Promise<typeof import("./components/primitives/baht-progress.js")>;
63
+ 'baht-progress-ring': () => Promise<typeof import("./components/primitives/baht-progress-ring.js")>;
64
+ 'baht-radio': () => Promise<typeof import("./components/primitives/baht-radio.js")>;
65
+ 'baht-range': () => Promise<typeof import("./components/primitives/baht-range.js")>;
66
+ 'baht-markdown': () => Promise<typeof import("./components/primitives/baht-markdown.js")>;
67
+ 'baht-markdown-view': () => Promise<typeof import("./components/primitives/baht-markdown-view.js")>;
68
+ 'baht-rating': () => Promise<typeof import("./components/primitives/baht-rating.js")>;
69
+ 'baht-record-bar': () => Promise<typeof import("./components/primitives/baht-record-bar.js")>;
70
+ 'baht-column-picker': () => Promise<typeof import("./components/primitives/baht-column-picker.js")>;
71
+ 'baht-saved-filters': () => Promise<typeof import("./components/primitives/baht-saved-filters.js")>;
72
+ 'baht-reference-dialog': () => Promise<typeof import("./components/primitives/baht-reference-dialog.js")>;
73
+ 'baht-reference-picker': () => Promise<typeof import("./components/primitives/baht-reference-picker.js")>;
74
+ 'baht-repeater': () => Promise<typeof import("./components/primitives/baht-repeater.js")>;
75
+ 'baht-rule-builder': () => Promise<typeof import("./components/primitives/baht-rule-builder.js")>;
76
+ 'baht-section': () => Promise<typeof import("./components/primitives/baht-section.js")>;
77
+ 'baht-select': () => Promise<typeof import("./components/primitives/baht-select.js")>;
78
+ 'baht-skeleton': () => Promise<typeof import("./components/primitives/baht-skeleton.js")>;
79
+ 'baht-sparkline': () => Promise<typeof import("./components/primitives/baht-sparkline.js")>;
80
+ 'baht-spinner': () => Promise<typeof import("./components/primitives/baht-spinner.js")>;
81
+ 'baht-split-button': () => Promise<typeof import("./components/primitives/baht-split-button.js")>;
82
+ 'baht-stat': () => Promise<typeof import("./components/primitives/baht-stat.js")>;
83
+ 'baht-stat-chart': () => Promise<typeof import("./components/primitives/baht-stat-chart.js")>;
84
+ 'baht-steps': () => Promise<typeof import("./components/primitives/baht-steps.js")>;
85
+ 'baht-swipe-row': () => Promise<typeof import("./components/primitives/baht-swipe-row.js")>;
86
+ 'baht-table': () => Promise<typeof import("./components/primitives/baht-table.js")>;
87
+ 'baht-tabs': () => Promise<typeof import("./components/primitives/baht-tabs.js")>;
88
+ 'baht-tags': () => Promise<typeof import("./components/primitives/baht-tags.js")>;
89
+ 'baht-text': () => Promise<typeof import("./components/primitives/baht-text.js")>;
90
+ 'baht-textarea': () => Promise<typeof import("./components/primitives/baht-textarea.js")>;
91
+ 'baht-theme-toggle': () => Promise<typeof import("./components/primitives/baht-theme-toggle.js")>;
92
+ 'baht-timeline': () => Promise<typeof import("./components/primitives/baht-timeline.js")>;
93
+ 'baht-toast': () => Promise<typeof import("./components/primitives/baht-toast.js")>;
94
+ 'baht-toggle': () => Promise<typeof import("./components/primitives/baht-toggle.js")>;
95
+ 'baht-tooltip': () => Promise<typeof import("./components/primitives/baht-tooltip.js")>;
96
+ 'baht-typeahead': () => Promise<typeof import("./components/primitives/baht-typeahead.js")>;
97
+ 'baht-upload': () => Promise<typeof import("./components/primitives/baht-upload.js")>;
98
+ 'baht-wizard': () => Promise<typeof import("./components/primitives/baht-wizard.js")>;
99
+ 'baht-workflow': () => Promise<typeof import("./components/baht-workflow.js")>;
100
+ };
101
+ export type BahtTag = keyof typeof LOADERS;
102
+ /** Every tag this package can register. */
103
+ export declare const ELEMENT_TAGS: readonly BahtTag[];
104
+ /** Define the given `<baht-*>` elements; resolves once all are registered. */
105
+ export declare function registerElements(tags: readonly BahtTag[]): Promise<void>;
106
+ export {};