@deepfuture/dui-components 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 (380) hide show
  1. package/accordion/accordion-context.d.ts +15 -0
  2. package/accordion/accordion-context.js +3 -0
  3. package/accordion/accordion-item.d.ts +22 -0
  4. package/accordion/accordion-item.js +254 -0
  5. package/accordion/accordion.d.ts +20 -0
  6. package/accordion/accordion.js +185 -0
  7. package/accordion/index.d.ts +3 -0
  8. package/accordion/index.js +2 -0
  9. package/accordion/register.d.ts +1 -0
  10. package/accordion/register.js +8 -0
  11. package/alert-dialog/alert-dialog-close.d.ts +15 -0
  12. package/alert-dialog/alert-dialog-close.js +35 -0
  13. package/alert-dialog/alert-dialog-context.d.ts +13 -0
  14. package/alert-dialog/alert-dialog-context.js +3 -0
  15. package/alert-dialog/alert-dialog-popup.d.ts +34 -0
  16. package/alert-dialog/alert-dialog-popup.js +260 -0
  17. package/alert-dialog/alert-dialog-trigger.d.ts +15 -0
  18. package/alert-dialog/alert-dialog-trigger.js +52 -0
  19. package/alert-dialog/alert-dialog.d.ts +30 -0
  20. package/alert-dialog/alert-dialog.js +97 -0
  21. package/alert-dialog/index.d.ts +6 -0
  22. package/alert-dialog/index.js +4 -0
  23. package/alert-dialog/register.d.ts +1 -0
  24. package/alert-dialog/register.js +16 -0
  25. package/all.d.ts +86 -0
  26. package/all.js +191 -0
  27. package/avatar/avatar.d.ts +41 -0
  28. package/avatar/avatar.js +188 -0
  29. package/avatar/index.d.ts +2 -0
  30. package/avatar/index.js +1 -0
  31. package/avatar/register.d.ts +1 -0
  32. package/avatar/register.js +4 -0
  33. package/badge/badge.d.ts +14 -0
  34. package/badge/badge.js +43 -0
  35. package/badge/index.d.ts +2 -0
  36. package/badge/index.js +1 -0
  37. package/badge/register.d.ts +1 -0
  38. package/badge/register.js +4 -0
  39. package/breadcrumb/breadcrumb-ellipsis.d.ts +14 -0
  40. package/breadcrumb/breadcrumb-ellipsis.js +39 -0
  41. package/breadcrumb/breadcrumb-item.d.ts +13 -0
  42. package/breadcrumb/breadcrumb-item.js +31 -0
  43. package/breadcrumb/breadcrumb-link.d.ts +14 -0
  44. package/breadcrumb/breadcrumb-link.js +32 -0
  45. package/breadcrumb/breadcrumb-page.d.ts +13 -0
  46. package/breadcrumb/breadcrumb-page.js +36 -0
  47. package/breadcrumb/breadcrumb-separator.d.ts +14 -0
  48. package/breadcrumb/breadcrumb-separator.js +36 -0
  49. package/breadcrumb/breadcrumb.d.ts +14 -0
  50. package/breadcrumb/breadcrumb.js +38 -0
  51. package/breadcrumb/index.d.ts +6 -0
  52. package/breadcrumb/index.js +6 -0
  53. package/breadcrumb/register.d.ts +1 -0
  54. package/breadcrumb/register.js +14 -0
  55. package/button/button.d.ts +38 -0
  56. package/button/button.js +143 -0
  57. package/button/index.d.ts +2 -0
  58. package/button/index.js +1 -0
  59. package/button/register.d.ts +1 -0
  60. package/button/register.js +4 -0
  61. package/calendar/calendar.d.ts +33 -0
  62. package/calendar/calendar.js +428 -0
  63. package/calendar/index.d.ts +1 -0
  64. package/calendar/index.js +1 -0
  65. package/calendar/register.d.ts +1 -0
  66. package/calendar/register.js +4 -0
  67. package/center/center.d.ts +14 -0
  68. package/center/center.js +37 -0
  69. package/center/index.d.ts +1 -0
  70. package/center/index.js +1 -0
  71. package/center/register.d.ts +1 -0
  72. package/center/register.js +4 -0
  73. package/checkbox/checkbox-group-context.d.ts +11 -0
  74. package/checkbox/checkbox-group-context.js +3 -0
  75. package/checkbox/checkbox-group.d.ts +34 -0
  76. package/checkbox/checkbox-group.js +128 -0
  77. package/checkbox/checkbox.d.ts +46 -0
  78. package/checkbox/checkbox.js +314 -0
  79. package/checkbox/index.d.ts +3 -0
  80. package/checkbox/index.js +2 -0
  81. package/checkbox/register.d.ts +1 -0
  82. package/checkbox/register.js +8 -0
  83. package/collapsible/collapsible.d.ts +22 -0
  84. package/collapsible/collapsible.js +227 -0
  85. package/collapsible/index.d.ts +1 -0
  86. package/collapsible/index.js +1 -0
  87. package/collapsible/register.d.ts +1 -0
  88. package/collapsible/register.js +4 -0
  89. package/combobox/combobox.d.ts +46 -0
  90. package/combobox/combobox.js +524 -0
  91. package/combobox/index.d.ts +2 -0
  92. package/combobox/index.js +1 -0
  93. package/combobox/register.d.ts +1 -0
  94. package/combobox/register.js +4 -0
  95. package/command/command-context.d.ts +30 -0
  96. package/command/command-context.js +3 -0
  97. package/command/command-empty.d.ts +10 -0
  98. package/command/command-empty.js +50 -0
  99. package/command/command-group.d.ts +15 -0
  100. package/command/command-group.js +79 -0
  101. package/command/command-input.d.ts +13 -0
  102. package/command/command-input.js +106 -0
  103. package/command/command-item.d.ts +20 -0
  104. package/command/command-item.js +175 -0
  105. package/command/command-list.d.ts +9 -0
  106. package/command/command-list.js +43 -0
  107. package/command/command-score.d.ts +6 -0
  108. package/command/command-score.js +31 -0
  109. package/command/command-separator.d.ts +7 -0
  110. package/command/command-separator.js +15 -0
  111. package/command/command-shortcut.d.ts +7 -0
  112. package/command/command-shortcut.js +16 -0
  113. package/command/command.d.ts +25 -0
  114. package/command/command.js +278 -0
  115. package/command/index.d.ts +10 -0
  116. package/command/index.js +9 -0
  117. package/command/register.d.ts +1 -0
  118. package/command/register.js +22 -0
  119. package/data-table/data-table.d.ts +59 -0
  120. package/data-table/data-table.js +416 -0
  121. package/data-table/index.d.ts +2 -0
  122. package/data-table/index.js +1 -0
  123. package/data-table/register.d.ts +1 -0
  124. package/data-table/register.js +4 -0
  125. package/dialog/dialog-close.d.ts +15 -0
  126. package/dialog/dialog-close.js +35 -0
  127. package/dialog/dialog-context.d.ts +13 -0
  128. package/dialog/dialog-context.js +3 -0
  129. package/dialog/dialog-popup.d.ts +36 -0
  130. package/dialog/dialog-popup.js +277 -0
  131. package/dialog/dialog-trigger.d.ts +15 -0
  132. package/dialog/dialog-trigger.js +52 -0
  133. package/dialog/dialog.d.ts +30 -0
  134. package/dialog/dialog.js +97 -0
  135. package/dialog/index.d.ts +6 -0
  136. package/dialog/index.js +4 -0
  137. package/dialog/register.d.ts +1 -0
  138. package/dialog/register.js +16 -0
  139. package/dropzone/dropzone.d.ts +74 -0
  140. package/dropzone/dropzone.js +357 -0
  141. package/dropzone/index.d.ts +2 -0
  142. package/dropzone/index.js +1 -0
  143. package/dropzone/register.d.ts +1 -0
  144. package/dropzone/register.js +4 -0
  145. package/field/field-context.d.ts +20 -0
  146. package/field/field-context.js +2 -0
  147. package/field/index.d.ts +2 -0
  148. package/field/index.js +1 -0
  149. package/global.d.ts +189 -0
  150. package/hstack/hstack.d.ts +25 -0
  151. package/hstack/hstack.js +141 -0
  152. package/hstack/index.d.ts +2 -0
  153. package/hstack/index.js +1 -0
  154. package/hstack/register.d.ts +1 -0
  155. package/hstack/register.js +4 -0
  156. package/icon/icon.d.ts +16 -0
  157. package/icon/icon.js +34 -0
  158. package/icon/index.d.ts +1 -0
  159. package/icon/index.js +1 -0
  160. package/icon/register.d.ts +1 -0
  161. package/icon/register.js +4 -0
  162. package/input/index.d.ts +1 -0
  163. package/input/index.js +1 -0
  164. package/input/input.d.ts +47 -0
  165. package/input/input.js +205 -0
  166. package/input/register.d.ts +1 -0
  167. package/input/register.js +4 -0
  168. package/link/index.d.ts +1 -0
  169. package/link/index.js +1 -0
  170. package/link/link.d.ts +27 -0
  171. package/link/link.js +57 -0
  172. package/link/register.d.ts +1 -0
  173. package/link/register.js +4 -0
  174. package/menu/index.d.ts +2 -0
  175. package/menu/index.js +2 -0
  176. package/menu/menu-item.d.ts +17 -0
  177. package/menu/menu-item.js +62 -0
  178. package/menu/menu.d.ts +15 -0
  179. package/menu/menu.js +228 -0
  180. package/menu/register.d.ts +1 -0
  181. package/menu/register.js +8 -0
  182. package/menubar/index.d.ts +2 -0
  183. package/menubar/index.js +1 -0
  184. package/menubar/menubar-context.d.ts +9 -0
  185. package/menubar/menubar-context.js +2 -0
  186. package/menubar/menubar.d.ts +19 -0
  187. package/menubar/menubar.js +130 -0
  188. package/menubar/register.d.ts +1 -0
  189. package/menubar/register.js +4 -0
  190. package/number-field/index.d.ts +1 -0
  191. package/number-field/index.js +1 -0
  192. package/number-field/number-field.d.ts +34 -0
  193. package/number-field/number-field.js +326 -0
  194. package/number-field/register.d.ts +1 -0
  195. package/number-field/register.js +4 -0
  196. package/package.json +217 -0
  197. package/page-inset/index.d.ts +1 -0
  198. package/page-inset/index.js +1 -0
  199. package/page-inset/page-inset.d.ts +28 -0
  200. package/page-inset/page-inset.js +103 -0
  201. package/page-inset/register.d.ts +1 -0
  202. package/page-inset/register.js +4 -0
  203. package/popover/index.d.ts +6 -0
  204. package/popover/index.js +4 -0
  205. package/popover/popover-close.d.ts +13 -0
  206. package/popover/popover-close.js +33 -0
  207. package/popover/popover-context.d.ts +17 -0
  208. package/popover/popover-context.js +3 -0
  209. package/popover/popover-popup.d.ts +20 -0
  210. package/popover/popover-popup.js +176 -0
  211. package/popover/popover-trigger.d.ts +13 -0
  212. package/popover/popover-trigger.js +57 -0
  213. package/popover/popover.d.ts +30 -0
  214. package/popover/popover.js +140 -0
  215. package/popover/register.d.ts +1 -0
  216. package/popover/register.js +16 -0
  217. package/portal/index.d.ts +2 -0
  218. package/portal/index.js +1 -0
  219. package/portal/portal.d.ts +29 -0
  220. package/portal/portal.js +115 -0
  221. package/portal/register.d.ts +1 -0
  222. package/portal/register.js +4 -0
  223. package/preview-card/index.d.ts +5 -0
  224. package/preview-card/index.js +3 -0
  225. package/preview-card/preview-card-context.d.ts +16 -0
  226. package/preview-card/preview-card-context.js +3 -0
  227. package/preview-card/preview-card-popup.d.ts +16 -0
  228. package/preview-card/preview-card-popup.js +167 -0
  229. package/preview-card/preview-card-trigger.d.ts +13 -0
  230. package/preview-card/preview-card-trigger.js +75 -0
  231. package/preview-card/preview-card.d.ts +34 -0
  232. package/preview-card/preview-card.js +164 -0
  233. package/preview-card/register.d.ts +1 -0
  234. package/preview-card/register.js +12 -0
  235. package/progress/index.d.ts +1 -0
  236. package/progress/index.js +1 -0
  237. package/progress/progress.d.ts +19 -0
  238. package/progress/progress.js +94 -0
  239. package/progress/register.d.ts +1 -0
  240. package/progress/register.js +4 -0
  241. package/radio/index.d.ts +3 -0
  242. package/radio/index.js +2 -0
  243. package/radio/radio-group-context.d.ts +11 -0
  244. package/radio/radio-group-context.js +2 -0
  245. package/radio/radio-group.d.ts +37 -0
  246. package/radio/radio-group.js +135 -0
  247. package/radio/radio.d.ts +27 -0
  248. package/radio/radio.js +204 -0
  249. package/radio/register.d.ts +1 -0
  250. package/radio/register.js +8 -0
  251. package/scroll-area/index.d.ts +1 -0
  252. package/scroll-area/index.js +1 -0
  253. package/scroll-area/register.d.ts +1 -0
  254. package/scroll-area/register.js +4 -0
  255. package/scroll-area/scroll-area.d.ts +38 -0
  256. package/scroll-area/scroll-area.js +453 -0
  257. package/select/index.d.ts +2 -0
  258. package/select/index.js +1 -0
  259. package/select/register.d.ts +1 -0
  260. package/select/register.js +4 -0
  261. package/select/select.d.ts +36 -0
  262. package/select/select.js +404 -0
  263. package/separator/index.d.ts +1 -0
  264. package/separator/index.js +1 -0
  265. package/separator/register.d.ts +1 -0
  266. package/separator/register.js +4 -0
  267. package/separator/separator.d.ts +12 -0
  268. package/separator/separator.js +50 -0
  269. package/sidebar/index.d.ts +16 -0
  270. package/sidebar/index.js +13 -0
  271. package/sidebar/register.d.ts +1 -0
  272. package/sidebar/register.js +52 -0
  273. package/sidebar/sidebar-content.d.ts +14 -0
  274. package/sidebar/sidebar-content.js +30 -0
  275. package/sidebar/sidebar-context.d.ts +15 -0
  276. package/sidebar/sidebar-context.js +3 -0
  277. package/sidebar/sidebar-footer.d.ts +12 -0
  278. package/sidebar/sidebar-footer.js +21 -0
  279. package/sidebar/sidebar-group-label.d.ts +17 -0
  280. package/sidebar/sidebar-group-label.js +49 -0
  281. package/sidebar/sidebar-group.d.ts +15 -0
  282. package/sidebar/sidebar-group.js +29 -0
  283. package/sidebar/sidebar-header.d.ts +12 -0
  284. package/sidebar/sidebar-header.js +21 -0
  285. package/sidebar/sidebar-inset.d.ts +15 -0
  286. package/sidebar/sidebar-inset.js +29 -0
  287. package/sidebar/sidebar-menu-button.d.ts +31 -0
  288. package/sidebar/sidebar-menu-button.js +201 -0
  289. package/sidebar/sidebar-menu-item.d.ts +12 -0
  290. package/sidebar/sidebar-menu-item.js +20 -0
  291. package/sidebar/sidebar-menu.d.ts +14 -0
  292. package/sidebar/sidebar-menu.js +30 -0
  293. package/sidebar/sidebar-provider.d.ts +34 -0
  294. package/sidebar/sidebar-provider.js +157 -0
  295. package/sidebar/sidebar-separator.d.ts +12 -0
  296. package/sidebar/sidebar-separator.js +24 -0
  297. package/sidebar/sidebar-trigger.d.ts +16 -0
  298. package/sidebar/sidebar-trigger.js +50 -0
  299. package/sidebar/sidebar.d.ts +21 -0
  300. package/sidebar/sidebar.js +228 -0
  301. package/slider/index.d.ts +1 -0
  302. package/slider/index.js +1 -0
  303. package/slider/register.d.ts +1 -0
  304. package/slider/register.js +4 -0
  305. package/slider/slider.d.ts +37 -0
  306. package/slider/slider.js +268 -0
  307. package/spinner/index.d.ts +1 -0
  308. package/spinner/index.js +1 -0
  309. package/spinner/register.d.ts +1 -0
  310. package/spinner/register.js +4 -0
  311. package/spinner/spinner.d.ts +18 -0
  312. package/spinner/spinner.js +138 -0
  313. package/switch/index.d.ts +1 -0
  314. package/switch/index.js +1 -0
  315. package/switch/register.d.ts +1 -0
  316. package/switch/register.js +4 -0
  317. package/switch/switch.d.ts +29 -0
  318. package/switch/switch.js +201 -0
  319. package/tabs/index.d.ts +6 -0
  320. package/tabs/index.js +5 -0
  321. package/tabs/register.d.ts +1 -0
  322. package/tabs/register.js +10 -0
  323. package/tabs/tab.d.ts +16 -0
  324. package/tabs/tab.js +98 -0
  325. package/tabs/tabs-context.d.ts +8 -0
  326. package/tabs/tabs-context.js +2 -0
  327. package/tabs/tabs-indicator.d.ts +11 -0
  328. package/tabs/tabs-indicator.js +27 -0
  329. package/tabs/tabs-list.d.ts +17 -0
  330. package/tabs/tabs-list.js +85 -0
  331. package/tabs/tabs-panel.d.ts +18 -0
  332. package/tabs/tabs-panel.js +85 -0
  333. package/tabs/tabs.d.ts +24 -0
  334. package/tabs/tabs.js +111 -0
  335. package/textarea/index.d.ts +2 -0
  336. package/textarea/index.js +1 -0
  337. package/textarea/register.d.ts +1 -0
  338. package/textarea/register.js +4 -0
  339. package/textarea/textarea.d.ts +37 -0
  340. package/textarea/textarea.js +170 -0
  341. package/toggle/index.d.ts +3 -0
  342. package/toggle/index.js +2 -0
  343. package/toggle/register.d.ts +1 -0
  344. package/toggle/register.js +8 -0
  345. package/toggle/toggle-group-context.d.ts +9 -0
  346. package/toggle/toggle-group-context.js +2 -0
  347. package/toggle/toggle-group.d.ts +27 -0
  348. package/toggle/toggle-group.js +163 -0
  349. package/toggle/toggle.d.ts +25 -0
  350. package/toggle/toggle.js +124 -0
  351. package/toolbar/index.d.ts +1 -0
  352. package/toolbar/index.js +1 -0
  353. package/toolbar/register.d.ts +1 -0
  354. package/toolbar/register.js +4 -0
  355. package/toolbar/toolbar.d.ts +15 -0
  356. package/toolbar/toolbar.js +89 -0
  357. package/tooltip/index.d.ts +5 -0
  358. package/tooltip/index.js +3 -0
  359. package/tooltip/register.d.ts +1 -0
  360. package/tooltip/register.js +12 -0
  361. package/tooltip/tooltip-context.d.ts +17 -0
  362. package/tooltip/tooltip-context.js +3 -0
  363. package/tooltip/tooltip-popup.d.ts +16 -0
  364. package/tooltip/tooltip-popup.js +162 -0
  365. package/tooltip/tooltip-trigger.d.ts +15 -0
  366. package/tooltip/tooltip-trigger.js +110 -0
  367. package/tooltip/tooltip.d.ts +36 -0
  368. package/tooltip/tooltip.js +176 -0
  369. package/trunc/index.d.ts +1 -0
  370. package/trunc/index.js +1 -0
  371. package/trunc/register.d.ts +1 -0
  372. package/trunc/register.js +4 -0
  373. package/trunc/trunc.d.ts +19 -0
  374. package/trunc/trunc.js +68 -0
  375. package/vstack/index.d.ts +1 -0
  376. package/vstack/index.js +1 -0
  377. package/vstack/register.d.ts +1 -0
  378. package/vstack/register.js +4 -0
  379. package/vstack/vstack.d.ts +17 -0
  380. package/vstack/vstack.js +83 -0
package/tabs/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { DuiTabs, valueChangeEvent } from "./tabs.js";
2
+ export { DuiTabsList } from "./tabs-list.js";
3
+ export { DuiTab } from "./tab.js";
4
+ export { DuiTabsPanel } from "./tabs-panel.js";
5
+ export { DuiTabsIndicator } from "./tabs-indicator.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { DuiTabs } from "./tabs.js";
2
+ import { DuiTabsList } from "./tabs-list.js";
3
+ import { DuiTab } from "./tab.js";
4
+ import { DuiTabsPanel } from "./tabs-panel.js";
5
+ import { DuiTabsIndicator } from "./tabs-indicator.js";
6
+ for (const C of [DuiTabs, DuiTabsList, DuiTab, DuiTabsPanel, DuiTabsIndicator]) {
7
+ if (!customElements.get(C.tagName)) {
8
+ customElements.define(C.tagName, C);
9
+ }
10
+ }
package/tabs/tab.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/tabs */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ import { type TabsContext } from "./tabs-context.js";
4
+ /**
5
+ * Individual tab trigger button.
6
+ */
7
+ export declare class DuiTab extends LitElement {
8
+ #private;
9
+ static tagName: "dui-tab";
10
+ static styles: import("lit").CSSResult[];
11
+ /** Tab value used to match with the corresponding panel. */
12
+ accessor value: string;
13
+ accessor disabled: boolean;
14
+ accessor _ctx: TabsContext;
15
+ render(): TemplateResult;
16
+ }
package/tabs/tab.js ADDED
@@ -0,0 +1,98 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/tabs */
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ import { css, html, LitElement } from "lit";
9
+ import { property } from "lit/decorators.js";
10
+ import { consume } from "@lit/context";
11
+ import { base } from "@deepfuture/dui-core/base";
12
+ import { tabsContext } from "./tabs-context.js";
13
+ const styles = css `
14
+ :host {
15
+ display: block;
16
+ }
17
+
18
+ [part="tab"] {
19
+ display: flex;
20
+ align-items: center;
21
+ justify-content: center;
22
+ border: 0;
23
+ margin: 0;
24
+ outline: 0;
25
+ background: none;
26
+ appearance: none;
27
+ font-family: inherit;
28
+ user-select: none;
29
+ white-space: nowrap;
30
+ word-break: keep-all;
31
+ cursor: pointer;
32
+ transition-property: color, box-shadow, background, filter, transform;
33
+ }
34
+
35
+ [part="tab"][data-disabled] {
36
+ cursor: not-allowed;
37
+ }
38
+ `;
39
+ /**
40
+ * Individual tab trigger button.
41
+ */
42
+ export class DuiTab extends LitElement {
43
+ static { this.tagName = "dui-tab"; }
44
+ static { this.styles = [base, styles]; }
45
+ #value_accessor_storage = "";
46
+ /** Tab value used to match with the corresponding panel. */
47
+ get value() { return this.#value_accessor_storage; }
48
+ set value(value) { this.#value_accessor_storage = value; }
49
+ #disabled_accessor_storage = false;
50
+ get disabled() { return this.#disabled_accessor_storage; }
51
+ set disabled(value) { this.#disabled_accessor_storage = value; }
52
+ #_ctx_accessor_storage;
53
+ get _ctx() { return this.#_ctx_accessor_storage; }
54
+ set _ctx(value) { this.#_ctx_accessor_storage = value; }
55
+ get #isActive() {
56
+ return this._ctx?.value === this.value;
57
+ }
58
+ #handleClick = () => {
59
+ if (this.disabled)
60
+ return;
61
+ this._ctx?.select(this.value);
62
+ };
63
+ #handleKeyDown = (event) => {
64
+ if (this.disabled)
65
+ return;
66
+ if (event.key === "Enter" || event.key === " ") {
67
+ event.preventDefault();
68
+ this._ctx?.select(this.value);
69
+ }
70
+ };
71
+ render() {
72
+ const isActive = this.#isActive;
73
+ return html `
74
+ <button
75
+ part="tab"
76
+ role="tab"
77
+ aria-selected=${isActive}
78
+ ?data-active=${isActive}
79
+ ?data-disabled=${this.disabled}
80
+ ?disabled=${this.disabled}
81
+ tabindex=${isActive ? 0 : -1}
82
+ @click=${this.#handleClick}
83
+ @keydown=${this.#handleKeyDown}
84
+ >
85
+ <slot></slot>
86
+ </button>
87
+ `;
88
+ }
89
+ }
90
+ __decorate([
91
+ property()
92
+ ], DuiTab.prototype, "value", null);
93
+ __decorate([
94
+ property({ type: Boolean, reflect: true })
95
+ ], DuiTab.prototype, "disabled", null);
96
+ __decorate([
97
+ consume({ context: tabsContext, subscribe: true })
98
+ ], DuiTab.prototype, "_ctx", null);
@@ -0,0 +1,8 @@
1
+ export type TabsContext = {
2
+ readonly value: string | undefined;
3
+ readonly orientation: "horizontal" | "vertical";
4
+ readonly select: (value: string) => void;
5
+ };
6
+ export declare const tabsContext: {
7
+ __context__: TabsContext;
8
+ };
@@ -0,0 +1,2 @@
1
+ import { createContext } from "@lit/context";
2
+ export const tabsContext = createContext(Symbol("dui-tabs"));
@@ -0,0 +1,11 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/tabs */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ /**
4
+ * Animated visual indicator that highlights the active tab.
5
+ * Place inside dui-tabs-list.
6
+ */
7
+ export declare class DuiTabsIndicator extends LitElement {
8
+ static tagName: "dui-tabs-indicator";
9
+ static styles: import("lit").CSSResult[];
10
+ render(): TemplateResult;
11
+ }
@@ -0,0 +1,27 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/tabs */
2
+ import { css, html, LitElement } from "lit";
3
+ import { base } from "@deepfuture/dui-core/base";
4
+ const styles = css `
5
+ :host {
6
+ display: block;
7
+ position: absolute;
8
+ z-index: -1;
9
+ left: 0;
10
+ top: 50%;
11
+ translate: var(--active-tab-left, 0) -50%;
12
+ width: var(--active-tab-width, 0);
13
+ pointer-events: none;
14
+ transition-property: translate, width;
15
+ }
16
+ `;
17
+ /**
18
+ * Animated visual indicator that highlights the active tab.
19
+ * Place inside dui-tabs-list.
20
+ */
21
+ export class DuiTabsIndicator extends LitElement {
22
+ static { this.tagName = "dui-tabs-indicator"; }
23
+ static { this.styles = [base, styles]; }
24
+ render() {
25
+ return html `<span part="indicator"></span>`;
26
+ }
27
+ }
@@ -0,0 +1,17 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/tabs */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ import { type TabsContext } from "./tabs-context.js";
4
+ /**
5
+ * Container for tab triggers. Manages indicator positioning via CSS custom properties.
6
+ */
7
+ export declare class DuiTabsList extends LitElement {
8
+ #private;
9
+ static tagName: "dui-tabs-list";
10
+ static styles: import("lit").CSSResult[];
11
+ accessor _ctx: TabsContext;
12
+ connectedCallback(): void;
13
+ disconnectedCallback(): void;
14
+ protected firstUpdated(): void;
15
+ protected updated(): void;
16
+ render(): TemplateResult;
17
+ }
@@ -0,0 +1,85 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/tabs */
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ import { css, html, LitElement } from "lit";
9
+ import { consume } from "@lit/context";
10
+ import { base } from "@deepfuture/dui-core/base";
11
+ import { tabsContext } from "./tabs-context.js";
12
+ const styles = css `
13
+ :host {
14
+ display: block;
15
+ }
16
+
17
+ [part="list"] {
18
+ display: flex;
19
+ position: relative;
20
+ z-index: 0;
21
+ }
22
+
23
+ [part="list"][data-orientation="vertical"] {
24
+ flex-direction: column;
25
+ }
26
+ `;
27
+ /**
28
+ * Container for tab triggers. Manages indicator positioning via CSS custom properties.
29
+ */
30
+ export class DuiTabsList extends LitElement {
31
+ static { this.tagName = "dui-tabs-list"; }
32
+ static { this.styles = [base, styles]; }
33
+ #_ctx_accessor_storage;
34
+ get _ctx() { return this.#_ctx_accessor_storage; }
35
+ set _ctx(value) { this.#_ctx_accessor_storage = value; }
36
+ #resizeObserver;
37
+ connectedCallback() {
38
+ super.connectedCallback();
39
+ this.#resizeObserver = new ResizeObserver(() => {
40
+ this.#updateIndicatorPosition();
41
+ });
42
+ }
43
+ disconnectedCallback() {
44
+ super.disconnectedCallback();
45
+ this.#resizeObserver?.disconnect();
46
+ }
47
+ firstUpdated() {
48
+ const list = this.shadowRoot?.querySelector("[part='list']");
49
+ if (list) {
50
+ this.#resizeObserver?.observe(list);
51
+ }
52
+ this.#updateIndicatorPosition();
53
+ }
54
+ updated() {
55
+ this.#updateIndicatorPosition();
56
+ }
57
+ #updateIndicatorPosition() {
58
+ const list = this.shadowRoot?.querySelector("[part='list']");
59
+ if (!list)
60
+ return;
61
+ const slot = this.shadowRoot?.querySelector("slot");
62
+ const slottedElements = slot?.assignedElements() ?? [];
63
+ const activeTab = slottedElements.find((el) => el.tagName === "DUI-TAB" &&
64
+ el.getAttribute("value") === this._ctx?.value);
65
+ if (activeTab) {
66
+ const listRect = list.getBoundingClientRect();
67
+ const tabRect = activeTab.getBoundingClientRect();
68
+ const left = tabRect.left - listRect.left;
69
+ const width = tabRect.width;
70
+ list.style.setProperty("--active-tab-left", `${left}px`);
71
+ list.style.setProperty("--active-tab-width", `${width}px`);
72
+ }
73
+ }
74
+ render() {
75
+ const orientation = this._ctx?.orientation ?? "horizontal";
76
+ return html `
77
+ <div part="list" role="tablist" data-orientation=${orientation}>
78
+ <slot></slot>
79
+ </div>
80
+ `;
81
+ }
82
+ }
83
+ __decorate([
84
+ consume({ context: tabsContext, subscribe: true })
85
+ ], DuiTabsList.prototype, "_ctx", null);
@@ -0,0 +1,18 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/tabs */
2
+ import { LitElement, nothing, type TemplateResult } from "lit";
3
+ import { type TabsContext } from "./tabs-context.js";
4
+ /**
5
+ * Content panel for a tab. Shown when the matching tab is active.
6
+ */
7
+ export declare class DuiTabsPanel extends LitElement {
8
+ #private;
9
+ static tagName: "dui-tabs-panel";
10
+ static styles: import("lit").CSSResult[];
11
+ /** Panel value — must match the corresponding tab's value. */
12
+ accessor value: string;
13
+ /** Keep panel in DOM when not active. */
14
+ accessor keepMounted: boolean;
15
+ accessor _ctx: TabsContext;
16
+ willUpdate(): void;
17
+ render(): TemplateResult | typeof nothing;
18
+ }
@@ -0,0 +1,85 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/tabs */
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ import { css, html, LitElement, nothing } from "lit";
9
+ import { property } from "lit/decorators.js";
10
+ import { consume } from "@lit/context";
11
+ import { base } from "@deepfuture/dui-core/base";
12
+ import { tabsContext } from "./tabs-context.js";
13
+ const styles = css `
14
+ :host {
15
+ display: block;
16
+ }
17
+
18
+ :host([data-hidden]) {
19
+ display: none;
20
+ }
21
+
22
+ [part="panel"] {
23
+ position: relative;
24
+ outline: 0;
25
+ transition-property: box-shadow;
26
+ }
27
+
28
+ [part="panel"][hidden] {
29
+ display: none;
30
+ }
31
+ `;
32
+ /**
33
+ * Content panel for a tab. Shown when the matching tab is active.
34
+ */
35
+ export class DuiTabsPanel extends LitElement {
36
+ static { this.tagName = "dui-tabs-panel"; }
37
+ static { this.styles = [base, styles]; }
38
+ #value_accessor_storage = "";
39
+ /** Panel value — must match the corresponding tab's value. */
40
+ get value() { return this.#value_accessor_storage; }
41
+ set value(value) { this.#value_accessor_storage = value; }
42
+ #keepMounted_accessor_storage = false;
43
+ /** Keep panel in DOM when not active. */
44
+ get keepMounted() { return this.#keepMounted_accessor_storage; }
45
+ set keepMounted(value) { this.#keepMounted_accessor_storage = value; }
46
+ #_ctx_accessor_storage;
47
+ get _ctx() { return this.#_ctx_accessor_storage; }
48
+ set _ctx(value) { this.#_ctx_accessor_storage = value; }
49
+ get #isActive() {
50
+ return this._ctx?.value === this.value;
51
+ }
52
+ willUpdate() {
53
+ if (this.#isActive) {
54
+ this.removeAttribute("data-hidden");
55
+ }
56
+ else {
57
+ this.setAttribute("data-hidden", "");
58
+ }
59
+ }
60
+ render() {
61
+ const isActive = this.#isActive;
62
+ if (!isActive && !this.keepMounted) {
63
+ return nothing;
64
+ }
65
+ return html `
66
+ <div
67
+ part="panel"
68
+ role="tabpanel"
69
+ ?hidden=${!isActive}
70
+ tabindex="0"
71
+ >
72
+ <slot></slot>
73
+ </div>
74
+ `;
75
+ }
76
+ }
77
+ __decorate([
78
+ property()
79
+ ], DuiTabsPanel.prototype, "value", null);
80
+ __decorate([
81
+ property({ type: Boolean, attribute: "keep-mounted" })
82
+ ], DuiTabsPanel.prototype, "keepMounted", null);
83
+ __decorate([
84
+ consume({ context: tabsContext, subscribe: true })
85
+ ], DuiTabsPanel.prototype, "_ctx", null);
package/tabs/tabs.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/tabs */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ import { type TabsContext } from "./tabs-context.js";
4
+ export declare const valueChangeEvent: (detail: string) => CustomEvent<string>;
5
+ /**
6
+ * A tabbed interface component with animated indicator and keyboard navigation.
7
+ */
8
+ export declare class DuiTabs extends LitElement {
9
+ #private;
10
+ static tagName: "dui-tabs";
11
+ static styles: import("lit").CSSResult[];
12
+ /** Controlled active tab value. */
13
+ accessor value: string | undefined;
14
+ /** Initial active tab value (uncontrolled mode). */
15
+ accessor defaultValue: string | undefined;
16
+ /** Layout orientation. */
17
+ accessor orientation: "horizontal" | "vertical";
18
+ /** Whether tab list appears above or below content. */
19
+ accessor controls: "header" | "footer";
20
+ accessor _ctx: TabsContext;
21
+ connectedCallback(): void;
22
+ willUpdate(): void;
23
+ render(): TemplateResult;
24
+ }
package/tabs/tabs.js ADDED
@@ -0,0 +1,111 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/tabs */
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ import { css, html, LitElement } from "lit";
9
+ import { property, state } from "lit/decorators.js";
10
+ import { provide } from "@lit/context";
11
+ import { base } from "@deepfuture/dui-core/base";
12
+ import { customEvent } from "@deepfuture/dui-core/event";
13
+ import { tabsContext } from "./tabs-context.js";
14
+ export const valueChangeEvent = customEvent("value-change", {
15
+ bubbles: true,
16
+ composed: true,
17
+ });
18
+ const styles = css `
19
+ :host {
20
+ display: block;
21
+ }
22
+
23
+ [part="root"] {
24
+ display: flex;
25
+ flex-direction: column;
26
+ }
27
+
28
+ [part="root"][data-orientation="vertical"] {
29
+ flex-direction: row;
30
+ }
31
+
32
+ :host([controls="footer"]) [part="root"] {
33
+ flex-direction: column-reverse;
34
+ }
35
+ `;
36
+ /**
37
+ * A tabbed interface component with animated indicator and keyboard navigation.
38
+ */
39
+ export class DuiTabs extends LitElement {
40
+ static { this.tagName = "dui-tabs"; }
41
+ static { this.styles = [base, styles]; }
42
+ #value_accessor_storage = undefined;
43
+ /** Controlled active tab value. */
44
+ get value() { return this.#value_accessor_storage; }
45
+ set value(value) { this.#value_accessor_storage = value; }
46
+ #defaultValue_accessor_storage = undefined;
47
+ /** Initial active tab value (uncontrolled mode). */
48
+ get defaultValue() { return this.#defaultValue_accessor_storage; }
49
+ set defaultValue(value) { this.#defaultValue_accessor_storage = value; }
50
+ #orientation_accessor_storage = "horizontal";
51
+ /** Layout orientation. */
52
+ get orientation() { return this.#orientation_accessor_storage; }
53
+ set orientation(value) { this.#orientation_accessor_storage = value; }
54
+ #controls_accessor_storage = "header";
55
+ /** Whether tab list appears above or below content. */
56
+ get controls() { return this.#controls_accessor_storage; }
57
+ set controls(value) { this.#controls_accessor_storage = value; }
58
+ #internalValue_accessor_storage = undefined;
59
+ get #internalValue() { return this.#internalValue_accessor_storage; }
60
+ set #internalValue(value) { this.#internalValue_accessor_storage = value; }
61
+ #getValue = () => this.value ?? this.#internalValue;
62
+ #select = (tabValue) => {
63
+ if (this.value === undefined) {
64
+ this.#internalValue = tabValue;
65
+ }
66
+ this.dispatchEvent(valueChangeEvent(tabValue));
67
+ };
68
+ #_ctx_accessor_storage = this.#buildContext();
69
+ get _ctx() { return this.#_ctx_accessor_storage; }
70
+ set _ctx(value) { this.#_ctx_accessor_storage = value; }
71
+ #buildContext() {
72
+ return {
73
+ value: this.#getValue(),
74
+ orientation: this.orientation,
75
+ select: this.#select,
76
+ };
77
+ }
78
+ connectedCallback() {
79
+ super.connectedCallback();
80
+ if (this.value === undefined && this.defaultValue !== undefined) {
81
+ this.#internalValue = this.defaultValue;
82
+ }
83
+ this._ctx = this.#buildContext();
84
+ }
85
+ willUpdate() {
86
+ this._ctx = this.#buildContext();
87
+ }
88
+ render() {
89
+ return html `
90
+ <div part="root" data-orientation=${this.orientation}>
91
+ <slot></slot>
92
+ </div>
93
+ `;
94
+ }
95
+ }
96
+ __decorate([
97
+ property()
98
+ ], DuiTabs.prototype, "value", null);
99
+ __decorate([
100
+ property({ attribute: "default-value" })
101
+ ], DuiTabs.prototype, "defaultValue", null);
102
+ __decorate([
103
+ property({ reflect: true })
104
+ ], DuiTabs.prototype, "orientation", null);
105
+ __decorate([
106
+ property({ reflect: true })
107
+ ], DuiTabs.prototype, "controls", null);
108
+ __decorate([
109
+ provide({ context: tabsContext }),
110
+ state()
111
+ ], DuiTabs.prototype, "_ctx", null);
@@ -0,0 +1,2 @@
1
+ export { DuiTextarea, textareaChangeEvent } from "./textarea.js";
2
+ export type { TextareaResize, TextareaVariant } from "./textarea.js";
@@ -0,0 +1 @@
1
+ export { DuiTextarea, textareaChangeEvent } from "./textarea.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { DuiTextarea } from "./textarea.js";
2
+ if (!customElements.get(DuiTextarea.tagName)) {
3
+ customElements.define(DuiTextarea.tagName, DuiTextarea);
4
+ }
@@ -0,0 +1,37 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/textarea */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ export type TextareaResize = "none" | "vertical" | "horizontal" | "both" | "auto";
4
+ export type TextareaVariant = "default" | "ghost";
5
+ export declare const textareaChangeEvent: (detail: {
6
+ value: string;
7
+ }) => CustomEvent<{
8
+ value: string;
9
+ }>;
10
+ /**
11
+ * A multi-line text input with resize modes including auto-grow.
12
+ */
13
+ export declare class DuiTextarea extends LitElement {
14
+ #private;
15
+ static tagName: "dui-textarea";
16
+ static shadowRootOptions: ShadowRootInit;
17
+ static styles: import("lit").CSSResult[];
18
+ /** Current textarea value. */
19
+ accessor value: string;
20
+ /** Placeholder text. */
21
+ accessor placeholder: string;
22
+ accessor disabled: boolean;
23
+ accessor required: boolean;
24
+ accessor readonly: boolean;
25
+ /** Number of visible text rows. */
26
+ accessor rows: number | undefined;
27
+ accessor minLength: number | undefined;
28
+ accessor maxLength: number | undefined;
29
+ accessor name: string;
30
+ /** Visual variant: "default" or "ghost" (no border/background). */
31
+ accessor variant: TextareaVariant;
32
+ /** Resize behavior: "none" | "vertical" | "horizontal" | "both" | "auto". */
33
+ accessor resize: TextareaResize;
34
+ /** Maximum height (CSS value). Textarea scrolls when content exceeds this. */
35
+ accessor maxHeight: string | undefined;
36
+ render(): TemplateResult;
37
+ }