@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,157 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/sidebar */
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 { 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: flex;
16
+ width: 100%;
17
+ height: 100%;
18
+ }
19
+ `;
20
+ /**
21
+ * `<dui-sidebar-provider>` — Root state manager for the sidebar compound component.
22
+ *
23
+ * Manages open/close state, mobile detection, and provides context to all
24
+ * sidebar sub-components. Wraps the entire layout (sidebar + main content).
25
+ *
26
+ * @slot - Default slot for sidebar and content areas.
27
+ * @fires open-change - Fired when the sidebar opens or closes. Detail: { open: boolean }
28
+ */
29
+ export class DuiSidebarProvider extends LitElement {
30
+ static { this.tagName = "dui-sidebar-provider"; }
31
+ static { this.styles = [base, styles]; }
32
+ #open_accessor_storage = undefined;
33
+ /** Controls the sidebar open state (controlled mode). */
34
+ get open() { return this.#open_accessor_storage; }
35
+ set open(value) { this.#open_accessor_storage = value; }
36
+ #defaultOpen_accessor_storage = true;
37
+ /** Initial open state for uncontrolled mode. Defaults to true. */
38
+ get defaultOpen() { return this.#defaultOpen_accessor_storage; }
39
+ set defaultOpen(value) { this.#defaultOpen_accessor_storage = value; }
40
+ #side_accessor_storage = "left";
41
+ /** Which side the sidebar appears on. */
42
+ get side() { return this.#side_accessor_storage; }
43
+ set side(value) { this.#side_accessor_storage = value; }
44
+ #variant_accessor_storage = "sidebar";
45
+ /** Visual variant of the sidebar. */
46
+ get variant() { return this.#variant_accessor_storage; }
47
+ set variant(value) { this.#variant_accessor_storage = value; }
48
+ #collapsible_accessor_storage = "offcanvas";
49
+ /** How the sidebar collapses. */
50
+ get collapsible() { return this.#collapsible_accessor_storage; }
51
+ set collapsible(value) { this.#collapsible_accessor_storage = value; }
52
+ #internalOpen_accessor_storage = true;
53
+ get #internalOpen() { return this.#internalOpen_accessor_storage; }
54
+ set #internalOpen(value) { this.#internalOpen_accessor_storage = value; }
55
+ #openMobile_accessor_storage = false;
56
+ get #openMobile() { return this.#openMobile_accessor_storage; }
57
+ set #openMobile(value) { this.#openMobile_accessor_storage = value; }
58
+ #isMobile_accessor_storage = false;
59
+ get #isMobile() { return this.#isMobile_accessor_storage; }
60
+ set #isMobile(value) { this.#isMobile_accessor_storage = value; }
61
+ #mediaQuery;
62
+ #boundOnMediaChange;
63
+ #boundOnKeyDown;
64
+ get #isOpen() {
65
+ return this.open ?? this.#internalOpen;
66
+ }
67
+ #setOpen = (value) => {
68
+ if (this.#isMobile) {
69
+ this.#openMobile = value;
70
+ }
71
+ else {
72
+ if (this.open === undefined) {
73
+ this.#internalOpen = value;
74
+ }
75
+ this.dispatchEvent(openChangeEvent({ open: value }));
76
+ }
77
+ };
78
+ #toggleSidebar = () => {
79
+ if (this.#isMobile) {
80
+ this.#openMobile = !this.#openMobile;
81
+ }
82
+ else {
83
+ this.#setOpen(!this.#isOpen);
84
+ }
85
+ };
86
+ #onMediaChange = (e) => {
87
+ this.#isMobile = !e.matches;
88
+ if (!this.#isMobile) {
89
+ this.#openMobile = false;
90
+ }
91
+ };
92
+ #onKeyDown = (e) => {
93
+ if (e.key === "b" && (e.metaKey || e.ctrlKey)) {
94
+ e.preventDefault();
95
+ this.#toggleSidebar();
96
+ }
97
+ };
98
+ #ctx_accessor_storage = this.#buildContext();
99
+ get #ctx() { return this.#ctx_accessor_storage; }
100
+ set #ctx(value) { this.#ctx_accessor_storage = value; }
101
+ #buildContext() {
102
+ return {
103
+ state: this.#isOpen ? "expanded" : "collapsed",
104
+ open: this.#isOpen,
105
+ openMobile: this.#openMobile,
106
+ isMobile: this.#isMobile,
107
+ side: this.side,
108
+ variant: this.variant,
109
+ collapsible: this.collapsible,
110
+ setOpen: this.#setOpen,
111
+ toggleSidebar: this.#toggleSidebar,
112
+ };
113
+ }
114
+ connectedCallback() {
115
+ super.connectedCallback();
116
+ if (this.open === undefined) {
117
+ this.#internalOpen = this.defaultOpen;
118
+ }
119
+ this.#mediaQuery = matchMedia("(min-width: 768px)");
120
+ this.#isMobile = !this.#mediaQuery.matches;
121
+ this.#boundOnMediaChange = this.#onMediaChange.bind(this);
122
+ this.#mediaQuery.addEventListener("change", this.#boundOnMediaChange);
123
+ this.#boundOnKeyDown = this.#onKeyDown.bind(this);
124
+ document.addEventListener("keydown", this.#boundOnKeyDown);
125
+ this.#ctx = this.#buildContext();
126
+ }
127
+ disconnectedCallback() {
128
+ super.disconnectedCallback();
129
+ if (this.#mediaQuery && this.#boundOnMediaChange) {
130
+ this.#mediaQuery.removeEventListener("change", this.#boundOnMediaChange);
131
+ }
132
+ if (this.#boundOnKeyDown) {
133
+ document.removeEventListener("keydown", this.#boundOnKeyDown);
134
+ }
135
+ }
136
+ willUpdate() {
137
+ this.#ctx = this.#buildContext();
138
+ }
139
+ render() {
140
+ return html `<slot></slot>`;
141
+ }
142
+ }
143
+ __decorate([
144
+ property({ type: Boolean })
145
+ ], DuiSidebarProvider.prototype, "open", null);
146
+ __decorate([
147
+ property({ type: Boolean, attribute: "default-open" })
148
+ ], DuiSidebarProvider.prototype, "defaultOpen", null);
149
+ __decorate([
150
+ property({ reflect: true })
151
+ ], DuiSidebarProvider.prototype, "side", null);
152
+ __decorate([
153
+ property({ reflect: true })
154
+ ], DuiSidebarProvider.prototype, "variant", null);
155
+ __decorate([
156
+ property({ reflect: true })
157
+ ], DuiSidebarProvider.prototype, "collapsible", null);
@@ -0,0 +1,12 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/sidebar */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ /**
4
+ * `<dui-sidebar-separator>` — Visual divider within the sidebar.
5
+ *
6
+ * Renders a horizontal rule with `role="separator"`.
7
+ */
8
+ export declare class DuiSidebarSeparator extends LitElement {
9
+ static tagName: "dui-sidebar-separator";
10
+ static styles: import("lit").CSSResult[];
11
+ render(): TemplateResult;
12
+ }
@@ -0,0 +1,24 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/sidebar */
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
+ }
8
+
9
+ .Separator {
10
+ /* Structural only — height and color from theme */
11
+ }
12
+ `;
13
+ /**
14
+ * `<dui-sidebar-separator>` — Visual divider within the sidebar.
15
+ *
16
+ * Renders a horizontal rule with `role="separator"`.
17
+ */
18
+ export class DuiSidebarSeparator extends LitElement {
19
+ static { this.tagName = "dui-sidebar-separator"; }
20
+ static { this.styles = [base, styles]; }
21
+ render() {
22
+ return html `<div class="Separator" role="separator"></div>`;
23
+ }
24
+ }
@@ -0,0 +1,16 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/sidebar */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ /**
4
+ * `<dui-sidebar-trigger>` — Toggle button for the sidebar.
5
+ *
6
+ * Consumes sidebar context and calls `toggleSidebar()` on click.
7
+ * Renders a ghost button with a default panel icon.
8
+ *
9
+ * @slot - Override the default icon.
10
+ */
11
+ export declare class DuiSidebarTrigger extends LitElement {
12
+ #private;
13
+ static tagName: "dui-sidebar-trigger";
14
+ static styles: import("lit").CSSResult[];
15
+ render(): TemplateResult;
16
+ }
@@ -0,0 +1,50 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/sidebar */
2
+ import { css, html, LitElement } from "lit";
3
+ import { ContextConsumer } from "@lit/context";
4
+ import { base } from "@deepfuture/dui-core/base";
5
+ import { sidebarContext } from "./sidebar-context.js";
6
+ const styles = css `
7
+ :host {
8
+ display: inline-block;
9
+ }
10
+ `;
11
+ // Inline panel-left SVG
12
+ const panelLeftSvg = html `<svg
13
+ viewBox="0 0 24 24"
14
+ fill="none"
15
+ stroke="currentColor"
16
+ stroke-width="2"
17
+ stroke-linecap="round"
18
+ stroke-linejoin="round"
19
+ >
20
+ <rect width="18" height="18" x="3" y="3" rx="2" />
21
+ <path d="M9 3v18" />
22
+ </svg>`;
23
+ /**
24
+ * `<dui-sidebar-trigger>` — Toggle button for the sidebar.
25
+ *
26
+ * Consumes sidebar context and calls `toggleSidebar()` on click.
27
+ * Renders a ghost button with a default panel icon.
28
+ *
29
+ * @slot - Override the default icon.
30
+ */
31
+ export class DuiSidebarTrigger extends LitElement {
32
+ static { this.tagName = "dui-sidebar-trigger"; }
33
+ static { this.styles = [base, styles]; }
34
+ #ctx = new ContextConsumer(this, {
35
+ context: sidebarContext,
36
+ subscribe: true,
37
+ });
38
+ #onClick = () => {
39
+ this.#ctx.value?.toggleSidebar();
40
+ };
41
+ render() {
42
+ return html `
43
+ <dui-button variant="ghost" size="sm" @click=${this.#onClick}>
44
+ <slot>
45
+ <dui-icon>${panelLeftSvg}</dui-icon>
46
+ </slot>
47
+ </dui-button>
48
+ `;
49
+ }
50
+ }
@@ -0,0 +1,21 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/sidebar */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ /**
4
+ * `<dui-sidebar>` — Main sidebar container.
5
+ *
6
+ * Consumes sidebar context and renders the appropriate desktop or mobile layout.
7
+ * Desktop uses a width-transitioning wrapper; mobile uses a backdrop + sliding panel.
8
+ *
9
+ * @slot - Default slot for sidebar content (header, content, footer, etc.).
10
+ * @csspart desktop-outer - The outer desktop wrapper that transitions width.
11
+ * @csspart desktop-inner - The inner desktop container with content.
12
+ * @csspart backdrop - The mobile backdrop overlay.
13
+ * @csspart mobile-panel - The sliding mobile panel.
14
+ */
15
+ export declare class DuiSidebar extends LitElement {
16
+ #private;
17
+ static tagName: "dui-sidebar";
18
+ static styles: import("lit").CSSResult[];
19
+ willUpdate(): void;
20
+ render(): TemplateResult;
21
+ }
@@ -0,0 +1,228 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/sidebar */
2
+ import { css, html, LitElement } from "lit";
3
+ import { ContextConsumer } from "@lit/context";
4
+ import { base } from "@deepfuture/dui-core/base";
5
+ import { sidebarContext } from "./sidebar-context.js";
6
+ const styles = css `
7
+ :host {
8
+ display: block;
9
+ flex-shrink: 0;
10
+ height: 100%;
11
+ }
12
+
13
+ .DesktopOuter {
14
+ position: relative;
15
+ height: 100%;
16
+ overflow: hidden;
17
+ transition-property: width;
18
+ }
19
+
20
+ .DesktopInner {
21
+ position: absolute;
22
+ top: 0;
23
+ bottom: 0;
24
+ z-index: 10;
25
+ display: flex;
26
+ flex-direction: column;
27
+ overflow-y: auto;
28
+ overflow-x: hidden;
29
+ }
30
+
31
+ :host([data-side="left"]) .DesktopInner {
32
+ left: 0;
33
+ }
34
+
35
+ :host([data-side="right"]) .DesktopInner {
36
+ right: 0;
37
+ }
38
+
39
+ :host([data-collapsible="offcanvas"][data-state="collapsed"][data-side="left"])
40
+ .DesktopInner {
41
+ left: calc(-1 * var(--sidebar-width));
42
+ }
43
+
44
+ :host([data-collapsible="offcanvas"][data-state="collapsed"][data-side="right"])
45
+ .DesktopInner {
46
+ right: calc(-1 * var(--sidebar-width));
47
+ }
48
+
49
+ :host([data-variant="floating"]) .DesktopInner,
50
+ :host([data-variant="inset"]) .DesktopInner {
51
+ top: 0;
52
+ bottom: 0;
53
+ }
54
+
55
+ :host([data-collapsible="icon"][data-state="collapsed"]) .DesktopInner {
56
+ overflow: hidden;
57
+ }
58
+
59
+ .Backdrop {
60
+ position: fixed;
61
+ inset: 0;
62
+ z-index: 999;
63
+ transition-property: opacity;
64
+ }
65
+
66
+ .MobilePanel {
67
+ position: fixed;
68
+ top: 0;
69
+ bottom: 0;
70
+ z-index: 1000;
71
+ display: flex;
72
+ flex-direction: column;
73
+ overflow-y: auto;
74
+ transition-property: transform;
75
+ }
76
+
77
+ :host([data-side="left"]) .MobilePanel {
78
+ left: 0;
79
+ }
80
+
81
+ :host([data-side="right"]) .MobilePanel {
82
+ right: 0;
83
+ }
84
+
85
+ .MobilePanel[data-starting-style] {
86
+ transform: translateX(var(--mobile-start-x));
87
+ }
88
+
89
+ .MobilePanel[data-ending-style] {
90
+ transform: translateX(var(--mobile-end-x));
91
+ }
92
+ `;
93
+ /**
94
+ * `<dui-sidebar>` — Main sidebar container.
95
+ *
96
+ * Consumes sidebar context and renders the appropriate desktop or mobile layout.
97
+ * Desktop uses a width-transitioning wrapper; mobile uses a backdrop + sliding panel.
98
+ *
99
+ * @slot - Default slot for sidebar content (header, content, footer, etc.).
100
+ * @csspart desktop-outer - The outer desktop wrapper that transitions width.
101
+ * @csspart desktop-inner - The inner desktop container with content.
102
+ * @csspart backdrop - The mobile backdrop overlay.
103
+ * @csspart mobile-panel - The sliding mobile panel.
104
+ */
105
+ export class DuiSidebar extends LitElement {
106
+ static { this.tagName = "dui-sidebar"; }
107
+ static { this.styles = [base, styles]; }
108
+ #mounted_accessor_storage = false;
109
+ get #mounted() { return this.#mounted_accessor_storage; }
110
+ set #mounted(value) { this.#mounted_accessor_storage = value; }
111
+ #startingStyle_accessor_storage = false;
112
+ get #startingStyle() { return this.#startingStyle_accessor_storage; }
113
+ set #startingStyle(value) { this.#startingStyle_accessor_storage = value; }
114
+ #endingStyle_accessor_storage = false;
115
+ get #endingStyle() { return this.#endingStyle_accessor_storage; }
116
+ set #endingStyle(value) { this.#endingStyle_accessor_storage = value; }
117
+ #ctx = new ContextConsumer(this, {
118
+ context: sidebarContext,
119
+ subscribe: true,
120
+ });
121
+ willUpdate() {
122
+ const ctx = this.#ctx.value;
123
+ if (!ctx)
124
+ return;
125
+ this.dataset.state = ctx.state;
126
+ this.dataset.side = ctx.side;
127
+ this.dataset.variant = ctx.variant;
128
+ this.dataset.collapsible = ctx.collapsible;
129
+ // Handle mobile panel animation
130
+ if (ctx.isMobile) {
131
+ if (ctx.openMobile && !this.#mounted) {
132
+ this.#animateOpen();
133
+ }
134
+ else if (!ctx.openMobile && this.#mounted && !this.#endingStyle) {
135
+ this.#animateClose();
136
+ }
137
+ }
138
+ }
139
+ async #animateOpen() {
140
+ this.#mounted = true;
141
+ this.#startingStyle = true;
142
+ await new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(() => r())));
143
+ this.#startingStyle = false;
144
+ }
145
+ #animateClose() {
146
+ this.#endingStyle = true;
147
+ const panel = this.shadowRoot?.querySelector(".MobilePanel");
148
+ if (!panel) {
149
+ this.#finishClose();
150
+ return;
151
+ }
152
+ let called = false;
153
+ const done = () => {
154
+ if (called)
155
+ return;
156
+ called = true;
157
+ panel.removeEventListener("transitionend", onEnd);
158
+ clearTimeout(timer);
159
+ this.#finishClose();
160
+ };
161
+ const onEnd = () => {
162
+ done();
163
+ };
164
+ panel.addEventListener("transitionend", onEnd);
165
+ const timer = setTimeout(done, 250);
166
+ }
167
+ #finishClose() {
168
+ this.#endingStyle = false;
169
+ this.#mounted = false;
170
+ }
171
+ #onBackdropClick = () => {
172
+ this.#ctx.value?.setOpen(false);
173
+ };
174
+ #onMobileKeyDown = (e) => {
175
+ if (e.key === "Escape") {
176
+ e.preventDefault();
177
+ this.#ctx.value?.setOpen(false);
178
+ }
179
+ };
180
+ render() {
181
+ const ctx = this.#ctx.value;
182
+ if (!ctx)
183
+ return html ``;
184
+ const side = ctx.side;
185
+ const startX = side === "left" ? "-100%" : "100%";
186
+ if (ctx.isMobile) {
187
+ if (!this.#mounted)
188
+ return html ``;
189
+ return html `
190
+ <div
191
+ class="Backdrop"
192
+ part="backdrop"
193
+ ?data-starting-style=${this.#startingStyle}
194
+ ?data-ending-style=${this.#endingStyle}
195
+ @click=${this.#onBackdropClick}
196
+ ></div>
197
+ <div
198
+ class="MobilePanel"
199
+ part="mobile-panel"
200
+ role="dialog"
201
+ tabindex="-1"
202
+ style="--mobile-start-x: ${startX}; --mobile-end-x: ${startX}"
203
+ ?data-starting-style=${this.#startingStyle}
204
+ ?data-ending-style=${this.#endingStyle}
205
+ @keydown=${this.#onMobileKeyDown}
206
+ >
207
+ <slot></slot>
208
+ </div>
209
+ `;
210
+ }
211
+ if (ctx.collapsible === "none") {
212
+ return html `
213
+ <div class="DesktopOuter" part="desktop-outer">
214
+ <div class="DesktopInner" part="desktop-inner">
215
+ <slot></slot>
216
+ </div>
217
+ </div>
218
+ `;
219
+ }
220
+ return html `
221
+ <div class="DesktopOuter" part="desktop-outer">
222
+ <div class="DesktopInner" part="desktop-inner">
223
+ <slot></slot>
224
+ </div>
225
+ </div>
226
+ `;
227
+ }
228
+ }
@@ -0,0 +1 @@
1
+ export { DuiSlider, valueChangeEvent, valueCommittedEvent } from "./slider.js";
@@ -0,0 +1 @@
1
+ export { DuiSlider, valueChangeEvent, valueCommittedEvent } from "./slider.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { DuiSlider } from "./slider.js";
2
+ if (!customElements.get(DuiSlider.tagName)) {
3
+ customElements.define(DuiSlider.tagName, DuiSlider);
4
+ }
@@ -0,0 +1,37 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/slider */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ export declare const valueChangeEvent: (detail: {
4
+ value: number;
5
+ }) => CustomEvent<{
6
+ value: number;
7
+ }>;
8
+ export declare const valueCommittedEvent: (detail: {
9
+ value: number;
10
+ }) => CustomEvent<{
11
+ value: number;
12
+ }>;
13
+ /**
14
+ * A slider for selecting numeric values within a range.
15
+ *
16
+ * Supports pointer drag, keyboard navigation (arrows, Page Up/Down, Home/End),
17
+ * and a hidden native range input for accessibility.
18
+ */
19
+ export declare class DuiSlider extends LitElement {
20
+ #private;
21
+ static tagName: "dui-slider";
22
+ static styles: import("lit").CSSResult[];
23
+ /** Current value. */
24
+ accessor value: number;
25
+ /** Minimum value. */
26
+ accessor min: number;
27
+ /** Maximum value. */
28
+ accessor max: number;
29
+ /** Step increment. */
30
+ accessor step: number;
31
+ /** Whether the slider is disabled. */
32
+ accessor disabled: boolean;
33
+ /** Name for form submission. */
34
+ accessor name: string;
35
+ disconnectedCallback(): void;
36
+ render(): TemplateResult;
37
+ }