@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
@@ -0,0 +1,46 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/checkbox */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ export declare const checkedChangeEvent: (detail: {
4
+ checked: boolean;
5
+ indeterminate: boolean;
6
+ }) => CustomEvent<{
7
+ checked: boolean;
8
+ indeterminate: boolean;
9
+ }>;
10
+ /**
11
+ * `<dui-checkbox>` — A checkbox input with optional indeterminate state.
12
+ *
13
+ * Supports controlled and uncontrolled usage, group context integration,
14
+ * and field context for form validation states.
15
+ *
16
+ * @csspart root - The checkbox box element.
17
+ * @csspart indicator - The check/indeterminate indicator.
18
+ *
19
+ * @fires checked-change - Fired when checked state changes. Detail: { checked, indeterminate }
20
+ */
21
+ export declare class DuiCheckbox extends LitElement {
22
+ #private;
23
+ static tagName: "dui-checkbox";
24
+ static styles: import("lit").CSSResult[];
25
+ /** Whether the checkbox is checked (controlled). */
26
+ accessor checked: boolean | undefined;
27
+ /** Initial checked state for uncontrolled usage. */
28
+ accessor defaultChecked: boolean;
29
+ /** Whether the checkbox is in an indeterminate (mixed) state. */
30
+ accessor indeterminate: boolean;
31
+ /** Whether the checkbox is disabled. */
32
+ accessor disabled: boolean;
33
+ /** Whether the checkbox is read-only. */
34
+ accessor readOnly: boolean;
35
+ /** Whether the checkbox is required for form submission. */
36
+ accessor required: boolean;
37
+ /** The name attribute for form submission. */
38
+ accessor name: string | undefined;
39
+ /** The value attribute for form submission. */
40
+ accessor value: string | undefined;
41
+ /** When true, acts as a parent (select-all) checkbox within a group. */
42
+ accessor parent: boolean;
43
+ connectedCallback(): void;
44
+ disconnectedCallback(): void;
45
+ render(): TemplateResult;
46
+ }
@@ -0,0 +1,314 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/checkbox */
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 { ContextConsumer } from "@lit/context";
11
+ import { base } from "@deepfuture/dui-core/base";
12
+ import { customEvent } from "@deepfuture/dui-core/event";
13
+ import { checkboxGroupContext } from "./checkbox-group-context.js";
14
+ export const checkedChangeEvent = customEvent("checked-change", { bubbles: true, composed: true });
15
+ /** Structural styles only — layout and behavioral CSS. */
16
+ const styles = css `
17
+ :host {
18
+ display: inline-flex;
19
+ align-items: start;
20
+ cursor: pointer;
21
+ text-align: start;
22
+ }
23
+
24
+ :host([disabled]) {
25
+ cursor: not-allowed;
26
+ }
27
+
28
+ [part="root"] {
29
+ box-sizing: border-box;
30
+ display: flex;
31
+ flex-shrink: 0;
32
+ align-items: center;
33
+ justify-content: center;
34
+ padding: 0;
35
+ margin-block-end: 0;
36
+ margin-inline: 0;
37
+ border: none;
38
+ outline: 0;
39
+ cursor: pointer;
40
+ transition-property: background, border-color, box-shadow, filter, transform;
41
+ }
42
+
43
+ [part="root"][data-disabled] {
44
+ cursor: not-allowed;
45
+ }
46
+
47
+ [part="root"][data-readonly] {
48
+ cursor: default;
49
+ }
50
+
51
+ [part="indicator"] {
52
+ display: flex;
53
+ }
54
+
55
+ [part="indicator"][data-unchecked] {
56
+ display: none;
57
+ }
58
+
59
+ .HiddenInput {
60
+ position: absolute;
61
+ pointer-events: none;
62
+ opacity: 0;
63
+ margin: 0;
64
+ width: 0;
65
+ height: 0;
66
+ }
67
+ `;
68
+ const checkIcon = html `
69
+ <svg
70
+ class="Icon"
71
+ xmlns="http://www.w3.org/2000/svg"
72
+ viewBox="0 0 24 24"
73
+ fill="none"
74
+ stroke="currentColor"
75
+ stroke-width="3"
76
+ stroke-linecap="round"
77
+ stroke-linejoin="round"
78
+ >
79
+ <polyline points="20 6 9 17 4 12"></polyline>
80
+ </svg>
81
+ `;
82
+ const indeterminateIcon = html `
83
+ <svg
84
+ class="Icon"
85
+ xmlns="http://www.w3.org/2000/svg"
86
+ viewBox="0 0 24 24"
87
+ fill="none"
88
+ stroke="currentColor"
89
+ stroke-width="3"
90
+ stroke-linecap="round"
91
+ stroke-linejoin="round"
92
+ >
93
+ <line x1="5" y1="12" x2="19" y2="12"></line>
94
+ </svg>
95
+ `;
96
+ /**
97
+ * `<dui-checkbox>` — A checkbox input with optional indeterminate state.
98
+ *
99
+ * Supports controlled and uncontrolled usage, group context integration,
100
+ * and field context for form validation states.
101
+ *
102
+ * @csspart root - The checkbox box element.
103
+ * @csspart indicator - The check/indeterminate indicator.
104
+ *
105
+ * @fires checked-change - Fired when checked state changes. Detail: { checked, indeterminate }
106
+ */
107
+ export class DuiCheckbox extends LitElement {
108
+ static { this.tagName = "dui-checkbox"; }
109
+ static { this.styles = [base, styles]; }
110
+ #checked_accessor_storage = undefined;
111
+ /** Whether the checkbox is checked (controlled). */
112
+ get checked() { return this.#checked_accessor_storage; }
113
+ set checked(value) { this.#checked_accessor_storage = value; }
114
+ #defaultChecked_accessor_storage = false;
115
+ /** Initial checked state for uncontrolled usage. */
116
+ get defaultChecked() { return this.#defaultChecked_accessor_storage; }
117
+ set defaultChecked(value) { this.#defaultChecked_accessor_storage = value; }
118
+ #indeterminate_accessor_storage = false;
119
+ /** Whether the checkbox is in an indeterminate (mixed) state. */
120
+ get indeterminate() { return this.#indeterminate_accessor_storage; }
121
+ set indeterminate(value) { this.#indeterminate_accessor_storage = value; }
122
+ #disabled_accessor_storage = false;
123
+ /** Whether the checkbox is disabled. */
124
+ get disabled() { return this.#disabled_accessor_storage; }
125
+ set disabled(value) { this.#disabled_accessor_storage = value; }
126
+ #readOnly_accessor_storage = false;
127
+ /** Whether the checkbox is read-only. */
128
+ get readOnly() { return this.#readOnly_accessor_storage; }
129
+ set readOnly(value) { this.#readOnly_accessor_storage = value; }
130
+ #required_accessor_storage = false;
131
+ /** Whether the checkbox is required for form submission. */
132
+ get required() { return this.#required_accessor_storage; }
133
+ set required(value) { this.#required_accessor_storage = value; }
134
+ #name_accessor_storage = undefined;
135
+ /** The name attribute for form submission. */
136
+ get name() { return this.#name_accessor_storage; }
137
+ set name(value) { this.#name_accessor_storage = value; }
138
+ #value_accessor_storage = undefined;
139
+ /** The value attribute for form submission. */
140
+ get value() { return this.#value_accessor_storage; }
141
+ set value(value) { this.#value_accessor_storage = value; }
142
+ #parent_accessor_storage = false;
143
+ /** When true, acts as a parent (select-all) checkbox within a group. */
144
+ get parent() { return this.#parent_accessor_storage; }
145
+ set parent(value) { this.#parent_accessor_storage = value; }
146
+ #internalChecked_accessor_storage = false;
147
+ get #internalChecked() { return this.#internalChecked_accessor_storage; }
148
+ set #internalChecked(value) { this.#internalChecked_accessor_storage = value; }
149
+ #groupCtx = new ContextConsumer(this, {
150
+ context: checkboxGroupContext,
151
+ subscribe: true,
152
+ });
153
+ #fieldCtx_accessor_storage;
154
+ get #fieldCtx() { return this.#fieldCtx_accessor_storage; }
155
+ set #fieldCtx(value) { this.#fieldCtx_accessor_storage = value; }
156
+ get #isChecked() {
157
+ const ctx = this.#groupCtx.value;
158
+ if (ctx && this.value !== undefined) {
159
+ if (this.parent) {
160
+ return (ctx.allValues.length > 0 &&
161
+ ctx.allValues.every((v) => ctx.checkedValues.includes(v)));
162
+ }
163
+ return ctx.checkedValues.includes(this.value);
164
+ }
165
+ return this.checked ?? this.#internalChecked;
166
+ }
167
+ get #isIndeterminate() {
168
+ const ctx = this.#groupCtx.value;
169
+ if (ctx && this.parent && this.value !== undefined) {
170
+ const count = ctx.allValues.filter((v) => ctx.checkedValues.includes(v)).length;
171
+ return count > 0 && count < ctx.allValues.length;
172
+ }
173
+ return this.indeterminate;
174
+ }
175
+ get #isDisabled() {
176
+ return (this.disabled ||
177
+ (this.#groupCtx.value?.disabled ?? false) ||
178
+ (this.#fieldCtx?.disabled ?? false));
179
+ }
180
+ get #isInvalid() {
181
+ return this.#fieldCtx?.invalid ?? false;
182
+ }
183
+ connectedCallback() {
184
+ super.connectedCallback();
185
+ if (this.checked === undefined && this.defaultChecked) {
186
+ this.#internalChecked = true;
187
+ }
188
+ this.addEventListener("click", this.#handleHostClick);
189
+ }
190
+ disconnectedCallback() {
191
+ super.disconnectedCallback();
192
+ this.removeEventListener("click", this.#handleHostClick);
193
+ }
194
+ #handleHostClick = (_e) => {
195
+ this.#handleClick();
196
+ };
197
+ #handleClick = () => {
198
+ if (this.#isDisabled || this.readOnly)
199
+ return;
200
+ const ctx = this.#groupCtx.value;
201
+ // Within a group: delegate to context
202
+ if (ctx && this.value !== undefined) {
203
+ if (this.parent) {
204
+ ctx.toggleAll(!this.#isChecked);
205
+ }
206
+ else {
207
+ ctx.toggle(this.value);
208
+ }
209
+ this.#fieldCtx?.markDirty();
210
+ this.#fieldCtx?.markTouched();
211
+ return;
212
+ }
213
+ // Standalone behavior
214
+ const newChecked = !this.#isChecked;
215
+ if (this.checked === undefined) {
216
+ this.#internalChecked = newChecked;
217
+ this.indeterminate = false;
218
+ }
219
+ this.#fieldCtx?.markDirty();
220
+ this.#fieldCtx?.markTouched();
221
+ this.dispatchEvent(checkedChangeEvent({
222
+ checked: newChecked,
223
+ indeterminate: false,
224
+ }));
225
+ };
226
+ #handleKeyDown = (e) => {
227
+ if (e.key === " ") {
228
+ e.preventDefault();
229
+ this.#handleClick();
230
+ }
231
+ };
232
+ render() {
233
+ const isChecked = this.#isChecked;
234
+ const isIndeterminate = this.#isIndeterminate;
235
+ const isDisabled = this.#isDisabled;
236
+ const isInvalid = this.#isInvalid;
237
+ const showIndicator = isChecked || isIndeterminate;
238
+ const controlId = this.#fieldCtx?.controlId ?? "";
239
+ return html `
240
+ <span
241
+ part="root"
242
+ role="checkbox"
243
+ id="${controlId || nothing}"
244
+ aria-checked="${isIndeterminate ? "mixed" : String(isChecked)}"
245
+ aria-disabled="${isDisabled ? "true" : nothing}"
246
+ aria-readonly="${this.readOnly ? "true" : nothing}"
247
+ aria-required="${this.required ? "true" : nothing}"
248
+ aria-invalid="${isInvalid ? "true" : nothing}"
249
+ tabindex="${isDisabled ? nothing : "0"}"
250
+ ?data-checked="${isChecked && !isIndeterminate}"
251
+ ?data-unchecked="${!isChecked && !isIndeterminate}"
252
+ ?data-indeterminate="${isIndeterminate}"
253
+ ?data-disabled="${isDisabled}"
254
+ ?data-readonly="${this.readOnly}"
255
+ ?data-required="${this.required}"
256
+ ?data-invalid="${isInvalid}"
257
+ @keydown="${this.#handleKeyDown}"
258
+ >
259
+ <span
260
+ part="indicator"
261
+ ?data-checked="${isChecked && !isIndeterminate}"
262
+ ?data-unchecked="${!isChecked && !isIndeterminate}"
263
+ ?data-indeterminate="${isIndeterminate}"
264
+ >
265
+ ${showIndicator
266
+ ? isIndeterminate
267
+ ? indeterminateIcon
268
+ : checkIcon
269
+ : nothing}
270
+ </span>
271
+ <input
272
+ type="checkbox"
273
+ name="${this.name ?? nothing}"
274
+ value="${this.value ?? nothing}"
275
+ .checked="${isChecked}"
276
+ .indeterminate="${isIndeterminate}"
277
+ ?disabled="${isDisabled}"
278
+ ?required="${this.required}"
279
+ class="HiddenInput"
280
+ aria-hidden="true"
281
+ tabindex="-1"
282
+ />
283
+ </span>
284
+ <slot></slot>
285
+ `;
286
+ }
287
+ }
288
+ __decorate([
289
+ property({ type: Boolean, reflect: true })
290
+ ], DuiCheckbox.prototype, "checked", null);
291
+ __decorate([
292
+ property({ type: Boolean, attribute: "default-checked" })
293
+ ], DuiCheckbox.prototype, "defaultChecked", null);
294
+ __decorate([
295
+ property({ type: Boolean, reflect: true })
296
+ ], DuiCheckbox.prototype, "indeterminate", null);
297
+ __decorate([
298
+ property({ type: Boolean, reflect: true })
299
+ ], DuiCheckbox.prototype, "disabled", null);
300
+ __decorate([
301
+ property({ type: Boolean, reflect: true, attribute: "read-only" })
302
+ ], DuiCheckbox.prototype, "readOnly", null);
303
+ __decorate([
304
+ property({ type: Boolean, reflect: true })
305
+ ], DuiCheckbox.prototype, "required", null);
306
+ __decorate([
307
+ property()
308
+ ], DuiCheckbox.prototype, "name", null);
309
+ __decorate([
310
+ property()
311
+ ], DuiCheckbox.prototype, "value", null);
312
+ __decorate([
313
+ property({ type: Boolean })
314
+ ], DuiCheckbox.prototype, "parent", null);
@@ -0,0 +1,3 @@
1
+ export { DuiCheckbox, checkedChangeEvent } from "./checkbox.js";
2
+ export { DuiCheckboxGroup, valueChangeEvent } from "./checkbox-group.js";
3
+ export type { CheckboxGroupContext } from "./checkbox-group-context.js";
@@ -0,0 +1,2 @@
1
+ export { DuiCheckbox, checkedChangeEvent } from "./checkbox.js";
2
+ export { DuiCheckboxGroup, valueChangeEvent } from "./checkbox-group.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { DuiCheckbox } from "./checkbox.js";
2
+ import { DuiCheckboxGroup } from "./checkbox-group.js";
3
+ if (!customElements.get(DuiCheckbox.tagName)) {
4
+ customElements.define(DuiCheckbox.tagName, DuiCheckbox);
5
+ }
6
+ if (!customElements.get(DuiCheckboxGroup.tagName)) {
7
+ customElements.define(DuiCheckboxGroup.tagName, DuiCheckboxGroup);
8
+ }
@@ -0,0 +1,22 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/collapsible */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ export declare const openChangeEvent: (detail: {
4
+ open: boolean;
5
+ }) => CustomEvent<{
6
+ open: boolean;
7
+ }>;
8
+ export declare class DuiCollapsible extends LitElement {
9
+ #private;
10
+ static tagName: "dui-collapsible";
11
+ static styles: import("lit").CSSResult[];
12
+ /** Controlled open state. When set, the component is fully controlled. */
13
+ accessor open: boolean;
14
+ /** Uncontrolled initial open state. Only used on first render. */
15
+ accessor defaultOpen: boolean;
16
+ accessor disabled: boolean;
17
+ /** Keep panel content mounted when closed. */
18
+ accessor keepMounted: boolean;
19
+ connectedCallback(): void;
20
+ willUpdate(changed: Map<string, unknown>): void;
21
+ render(): TemplateResult;
22
+ }
@@ -0,0 +1,227 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/collapsible */
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 { base } from "@deepfuture/dui-core/base";
11
+ import { customEvent } from "@deepfuture/dui-core/event";
12
+ export const openChangeEvent = customEvent("open-change", { bubbles: true, composed: true });
13
+ const styles = css `
14
+ :host {
15
+ display: block;
16
+ }
17
+
18
+ [part="trigger"] {
19
+ display: flex;
20
+ width: 100%;
21
+ align-items: center;
22
+ justify-content: space-between;
23
+ cursor: pointer;
24
+ user-select: none;
25
+ border: none;
26
+ background: none;
27
+ text-align: left;
28
+ outline: none;
29
+ box-sizing: border-box;
30
+ transition-property: background, box-shadow, filter, transform;
31
+ }
32
+
33
+ [part="trigger"][data-disabled] {
34
+ cursor: default;
35
+ }
36
+
37
+ [part="indicator"] {
38
+ flex-shrink: 0;
39
+ transition-property: transform;
40
+ }
41
+
42
+ [part="panel"] {
43
+ overflow: hidden;
44
+ transition-property: height;
45
+ }
46
+ `;
47
+ // Inline chevron-down SVG to avoid icon component dependency
48
+ const chevronSvg = html `<svg
49
+ part="indicator"
50
+ width="16"
51
+ height="16"
52
+ viewBox="0 0 24 24"
53
+ fill="none"
54
+ stroke="currentColor"
55
+ stroke-width="2"
56
+ stroke-linecap="round"
57
+ stroke-linejoin="round"
58
+ >
59
+ <path d="m6 9 6 6 6-6" />
60
+ </svg>`;
61
+ export class DuiCollapsible extends LitElement {
62
+ static { this.tagName = "dui-collapsible"; }
63
+ static { this.styles = [base, styles]; }
64
+ #open_accessor_storage = false;
65
+ /** Controlled open state. When set, the component is fully controlled. */
66
+ get open() { return this.#open_accessor_storage; }
67
+ set open(value) { this.#open_accessor_storage = value; }
68
+ #defaultOpen_accessor_storage = false;
69
+ /** Uncontrolled initial open state. Only used on first render. */
70
+ get defaultOpen() { return this.#defaultOpen_accessor_storage; }
71
+ set defaultOpen(value) { this.#defaultOpen_accessor_storage = value; }
72
+ #disabled_accessor_storage = false;
73
+ get disabled() { return this.#disabled_accessor_storage; }
74
+ set disabled(value) { this.#disabled_accessor_storage = value; }
75
+ #keepMounted_accessor_storage = false;
76
+ /** Keep panel content mounted when closed. */
77
+ get keepMounted() { return this.#keepMounted_accessor_storage; }
78
+ set keepMounted(value) { this.#keepMounted_accessor_storage = value; }
79
+ #starting_accessor_storage = false;
80
+ get #starting() { return this.#starting_accessor_storage; }
81
+ set #starting(value) { this.#starting_accessor_storage = value; }
82
+ #ending_accessor_storage = false;
83
+ get #ending() { return this.#ending_accessor_storage; }
84
+ set #ending(value) { this.#ending_accessor_storage = value; }
85
+ #panelHeight_accessor_storage = "0";
86
+ get #panelHeight() { return this.#panelHeight_accessor_storage; }
87
+ set #panelHeight(value) { this.#panelHeight_accessor_storage = value; }
88
+ #visible_accessor_storage = false;
89
+ get #visible() { return this.#visible_accessor_storage; }
90
+ set #visible(value) { this.#visible_accessor_storage = value; }
91
+ #internalOpen_accessor_storage = false;
92
+ get #internalOpen() { return this.#internalOpen_accessor_storage; }
93
+ set #internalOpen(value) { this.#internalOpen_accessor_storage = value; }
94
+ #prevOpen = undefined;
95
+ #animGen = 0;
96
+ #controlled = false;
97
+ get #isOpen() {
98
+ return this.#controlled ? this.open : this.#internalOpen;
99
+ }
100
+ connectedCallback() {
101
+ super.connectedCallback();
102
+ // Check if `open` attribute was explicitly set (controlled mode)
103
+ this.#controlled = this.hasAttribute("open");
104
+ if (!this.#controlled && this.defaultOpen) {
105
+ this.#internalOpen = true;
106
+ }
107
+ }
108
+ willUpdate(changed) {
109
+ // If `open` property is set after initial render, switch to controlled mode
110
+ if (changed.has("open") && this.#prevOpen !== undefined) {
111
+ this.#controlled = true;
112
+ }
113
+ const isOpen = this.#isOpen;
114
+ if (this.#prevOpen === undefined) {
115
+ this.#visible = isOpen;
116
+ this.#panelHeight = isOpen ? "auto" : "0";
117
+ }
118
+ else if (this.#prevOpen !== isOpen) {
119
+ if (isOpen) {
120
+ this.#startOpenAnimation();
121
+ }
122
+ else {
123
+ this.#startCloseAnimation();
124
+ }
125
+ }
126
+ this.#prevOpen = isOpen;
127
+ }
128
+ #startOpenAnimation() {
129
+ const gen = ++this.#animGen;
130
+ this.#ending = false;
131
+ this.#visible = true;
132
+ this.#starting = true;
133
+ this.#panelHeight = "0";
134
+ requestAnimationFrame(() => {
135
+ if (this.#animGen !== gen)
136
+ return;
137
+ const panel = this.shadowRoot?.querySelector("[part='panel']");
138
+ if (panel) {
139
+ this.#panelHeight = `${panel.scrollHeight}px`;
140
+ }
141
+ this.#starting = false;
142
+ });
143
+ }
144
+ #startCloseAnimation() {
145
+ const gen = ++this.#animGen;
146
+ this.#starting = false;
147
+ const panel = this.shadowRoot?.querySelector("[part='panel']");
148
+ if (panel) {
149
+ this.#panelHeight = `${panel.scrollHeight}px`;
150
+ }
151
+ requestAnimationFrame(() => {
152
+ if (this.#animGen !== gen)
153
+ return;
154
+ this.#ending = true;
155
+ this.#panelHeight = "0";
156
+ });
157
+ }
158
+ #onTransitionEnd = (event) => {
159
+ if (event.propertyName !== "height")
160
+ return;
161
+ if (this.#ending) {
162
+ this.#ending = false;
163
+ if (!this.keepMounted) {
164
+ this.#visible = false;
165
+ }
166
+ }
167
+ else if (this.#isOpen) {
168
+ this.#panelHeight = "auto";
169
+ }
170
+ };
171
+ #onClick = () => {
172
+ if (this.disabled)
173
+ return;
174
+ const nextOpen = !this.#isOpen;
175
+ if (!this.#controlled) {
176
+ this.#internalOpen = nextOpen;
177
+ }
178
+ this.dispatchEvent(openChangeEvent({ open: nextOpen }));
179
+ };
180
+ render() {
181
+ const isOpen = this.#isOpen;
182
+ const shouldRender = this.#visible || this.keepMounted;
183
+ return html `
184
+ <button
185
+ part="trigger"
186
+ aria-expanded=${isOpen}
187
+ ?data-open=${isOpen}
188
+ ?data-disabled=${this.disabled}
189
+ ?disabled=${this.disabled}
190
+ @click=${this.#onClick}
191
+ >
192
+ <slot name="trigger"></slot>
193
+ ${chevronSvg}
194
+ </button>
195
+ ${shouldRender
196
+ ? html `
197
+ <div
198
+ part="panel"
199
+ role="region"
200
+ style="height: ${this.#panelHeight}"
201
+ ?data-open=${isOpen && !this.#starting}
202
+ ?data-starting-style=${this.#starting}
203
+ ?data-ending-style=${this.#ending}
204
+ ?hidden=${!this.#visible && !this.#ending}
205
+ @transitionend=${this.#onTransitionEnd}
206
+ >
207
+ <div part="content">
208
+ <slot></slot>
209
+ </div>
210
+ </div>
211
+ `
212
+ : nothing}
213
+ `;
214
+ }
215
+ }
216
+ __decorate([
217
+ property({ type: Boolean, reflect: true })
218
+ ], DuiCollapsible.prototype, "open", null);
219
+ __decorate([
220
+ property({ type: Boolean, attribute: "default-open" })
221
+ ], DuiCollapsible.prototype, "defaultOpen", null);
222
+ __decorate([
223
+ property({ type: Boolean, reflect: true })
224
+ ], DuiCollapsible.prototype, "disabled", null);
225
+ __decorate([
226
+ property({ type: Boolean, attribute: "keep-mounted" })
227
+ ], DuiCollapsible.prototype, "keepMounted", null);
@@ -0,0 +1 @@
1
+ export { DuiCollapsible, openChangeEvent } from "./collapsible.js";
@@ -0,0 +1 @@
1
+ export { DuiCollapsible, openChangeEvent } from "./collapsible.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { DuiCollapsible } from "./collapsible.js";
2
+ if (!customElements.get(DuiCollapsible.tagName)) {
3
+ customElements.define(DuiCollapsible.tagName, DuiCollapsible);
4
+ }