@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,453 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/scroll-area */
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
+ var _a;
9
+ import { css, html, LitElement, nothing, } from "lit";
10
+ import { property } from "lit/decorators.js";
11
+ import { base } from "@deepfuture/dui-core/base";
12
+ const styles = css `
13
+ :host {
14
+ display: block;
15
+ position: relative;
16
+ overflow: hidden;
17
+ height: 100%;
18
+ max-height: var(--scroll-area-max-height, none);
19
+ }
20
+
21
+ .ScrollArea {
22
+ position: relative;
23
+ width: 100%;
24
+ height: 100%;
25
+ max-height: inherit;
26
+ }
27
+
28
+ .Viewport {
29
+ width: 100%;
30
+ height: 100%;
31
+ max-height: inherit;
32
+ overflow: auto;
33
+ overscroll-behavior: auto;
34
+ scrollbar-width: none;
35
+
36
+ &::-webkit-scrollbar {
37
+ display: none;
38
+ }
39
+ }
40
+
41
+ .ScrollFade {
42
+ position: absolute;
43
+ top: 0;
44
+ left: 0;
45
+ right: 0;
46
+ height: 0;
47
+ pointer-events: none;
48
+ z-index: 1;
49
+ }
50
+
51
+ .Scrollbar {
52
+ position: absolute;
53
+ display: flex;
54
+ justify-content: center;
55
+ opacity: 0;
56
+ pointer-events: none;
57
+
58
+ &[data-hovering],
59
+ &[data-scrolling] {
60
+ opacity: 1;
61
+ pointer-events: auto;
62
+ }
63
+
64
+ &[data-scrolling] {
65
+ transition-duration: 0ms;
66
+ }
67
+ }
68
+
69
+ .Scrollbar::before {
70
+ content: "";
71
+ position: absolute;
72
+ }
73
+
74
+ .Scrollbar[data-orientation="vertical"] {
75
+ top: 0;
76
+ right: 0;
77
+ bottom: 0;
78
+
79
+ &::before {
80
+ width: 1.25rem;
81
+ height: 100%;
82
+ left: 50%;
83
+ transform: translateX(-50%);
84
+ }
85
+ }
86
+
87
+ .Scrollbar[data-orientation="horizontal"] {
88
+ left: 0;
89
+ right: 0;
90
+ bottom: 0;
91
+
92
+ &::before {
93
+ width: 100%;
94
+ height: 1.25rem;
95
+ bottom: -0.25rem;
96
+ }
97
+ }
98
+
99
+ .Thumb[data-orientation="vertical"] {
100
+ width: 100%;
101
+ min-height: 1.25rem;
102
+ }
103
+
104
+ .Thumb[data-orientation="horizontal"] {
105
+ height: 100%;
106
+ min-width: 1.25rem;
107
+ }
108
+ `;
109
+ /**
110
+ * `<dui-scroll-area>` — A scroll container with custom styled scrollbar.
111
+ *
112
+ * Hides the native scrollbar and renders a custom track + thumb with
113
+ * auto-hide behavior. Supports vertical, horizontal, or both orientations.
114
+ *
115
+ * @slot - Default slot for scrollable content.
116
+ *
117
+ * @cssprop [--scroll-area-max-height] - Max-height constraint.
118
+ * @cssprop [--scroll-area-thumb-color] - Scrollbar thumb color.
119
+ * @cssprop [--scroll-fade-color] - Fade overlay color.
120
+ */
121
+ export class DuiScrollArea extends LitElement {
122
+ static { this.tagName = "dui-scroll-area"; }
123
+ static { this.styles = [base, styles]; }
124
+ #orientation_accessor_storage = "vertical";
125
+ /** Scroll direction(s). */
126
+ get orientation() { return this.#orientation_accessor_storage; }
127
+ set orientation(value) { this.#orientation_accessor_storage = value; }
128
+ #fade_accessor_storage = false;
129
+ /** Show a fade overlay at the top when scrolled. */
130
+ get fade() { return this.#fade_accessor_storage; }
131
+ set fade(value) { this.#fade_accessor_storage = value; }
132
+ #maxHeight_accessor_storage = undefined;
133
+ /** Optional max-height constraint (CSS value). */
134
+ get maxHeight() { return this.#maxHeight_accessor_storage; }
135
+ set maxHeight(value) { this.#maxHeight_accessor_storage = value; }
136
+ willUpdate(changed) {
137
+ if (changed.has("maxHeight")) {
138
+ if (this.maxHeight)
139
+ this.style.setProperty("--scroll-area-max-height", this.maxHeight);
140
+ else
141
+ this.style.removeProperty("--scroll-area-max-height");
142
+ }
143
+ }
144
+ #hasOverflowX_accessor_storage = false;
145
+ // --- Internal state ---
146
+ get #hasOverflowX() { return this.#hasOverflowX_accessor_storage; }
147
+ set #hasOverflowX(value) { this.#hasOverflowX_accessor_storage = value; }
148
+ #hasOverflowY_accessor_storage = false;
149
+ get #hasOverflowY() { return this.#hasOverflowY_accessor_storage; }
150
+ set #hasOverflowY(value) { this.#hasOverflowY_accessor_storage = value; }
151
+ #hovering_accessor_storage = false;
152
+ get #hovering() { return this.#hovering_accessor_storage; }
153
+ set #hovering(value) { this.#hovering_accessor_storage = value; }
154
+ #scrolling_accessor_storage = false;
155
+ get #scrolling() { return this.#scrolling_accessor_storage; }
156
+ set #scrolling(value) { this.#scrolling_accessor_storage = value; }
157
+ #thumbHeightPercent_accessor_storage = 0;
158
+ get #thumbHeightPercent() { return this.#thumbHeightPercent_accessor_storage; }
159
+ set #thumbHeightPercent(value) { this.#thumbHeightPercent_accessor_storage = value; }
160
+ #thumbWidthPercent_accessor_storage = 0;
161
+ get #thumbWidthPercent() { return this.#thumbWidthPercent_accessor_storage; }
162
+ set #thumbWidthPercent(value) { this.#thumbWidthPercent_accessor_storage = value; }
163
+ #thumbTopPercent_accessor_storage = 0;
164
+ get #thumbTopPercent() { return this.#thumbTopPercent_accessor_storage; }
165
+ set #thumbTopPercent(value) { this.#thumbTopPercent_accessor_storage = value; }
166
+ #thumbLeftPercent_accessor_storage = 0;
167
+ get #thumbLeftPercent() { return this.#thumbLeftPercent_accessor_storage; }
168
+ set #thumbLeftPercent(value) { this.#thumbLeftPercent_accessor_storage = value; }
169
+ #isAtTop_accessor_storage = true;
170
+ get #isAtTop() { return this.#isAtTop_accessor_storage; }
171
+ set #isAtTop(value) { this.#isAtTop_accessor_storage = value; }
172
+ static #SCROLL_BOTTOM_TOLERANCE = 1;
173
+ #isAtBottom = true;
174
+ #prevScrollTop = 0;
175
+ #scrollEndTimer;
176
+ #resizeObserver;
177
+ #dragging;
178
+ #dragStartPointer = 0;
179
+ #dragStartScroll = 0;
180
+ // --- Lifecycle ---
181
+ connectedCallback() {
182
+ super.connectedCallback();
183
+ this.addEventListener("pointerenter", this.#onPointerEnter);
184
+ this.addEventListener("pointerleave", this.#onPointerLeave);
185
+ }
186
+ disconnectedCallback() {
187
+ super.disconnectedCallback();
188
+ this.removeEventListener("pointerenter", this.#onPointerEnter);
189
+ this.removeEventListener("pointerleave", this.#onPointerLeave);
190
+ this.#resizeObserver?.disconnect();
191
+ clearTimeout(this.#scrollEndTimer);
192
+ }
193
+ firstUpdated() {
194
+ const viewport = this.#viewport;
195
+ if (!viewport)
196
+ return;
197
+ this.#resizeObserver = new ResizeObserver(() => this.#measure());
198
+ this.#resizeObserver.observe(viewport);
199
+ const slot = viewport.querySelector("slot");
200
+ if (slot) {
201
+ slot.addEventListener("slotchange", () => {
202
+ requestAnimationFrame(() => this.#measure());
203
+ });
204
+ }
205
+ this.#measure();
206
+ }
207
+ // --- Public methods ---
208
+ /** Scroll the viewport to the bottom. */
209
+ async scrollToBottom() {
210
+ await this.updateComplete;
211
+ const viewport = this.#viewport;
212
+ if (viewport) {
213
+ viewport.scrollTop = viewport.scrollHeight;
214
+ this.#isAtBottom = true;
215
+ this.#prevScrollTop = viewport.scrollTop;
216
+ }
217
+ }
218
+ /** Whether the viewport is scrolled to the top. */
219
+ get isAtTop() {
220
+ return this.#isAtTop;
221
+ }
222
+ /** Whether the viewport is scrolled to the bottom. */
223
+ get isAtBottom() {
224
+ return this.#isAtBottom;
225
+ }
226
+ // --- Getters ---
227
+ get #viewport() {
228
+ return this.shadowRoot?.querySelector(".Viewport") ?? null;
229
+ }
230
+ get #showVertical() {
231
+ return this.orientation === "vertical" || this.orientation === "both";
232
+ }
233
+ get #showHorizontal() {
234
+ return this.orientation === "horizontal" || this.orientation === "both";
235
+ }
236
+ // --- Measurement ---
237
+ #measure = () => {
238
+ const vp = this.#viewport;
239
+ if (!vp)
240
+ return;
241
+ const hasOverflowY = vp.scrollHeight > vp.clientHeight;
242
+ const hasOverflowX = vp.scrollWidth > vp.clientWidth;
243
+ this.#hasOverflowY = hasOverflowY;
244
+ this.#hasOverflowX = hasOverflowX;
245
+ if (hasOverflowY) {
246
+ this.#thumbHeightPercent = (vp.clientHeight / vp.scrollHeight) * 100;
247
+ }
248
+ if (hasOverflowX) {
249
+ this.#thumbWidthPercent = (vp.clientWidth / vp.scrollWidth) * 100;
250
+ }
251
+ this.#updateThumbPosition(vp);
252
+ };
253
+ #updateThumbPosition = (vp) => {
254
+ if (this.#hasOverflowY) {
255
+ const maxScrollTop = vp.scrollHeight - vp.clientHeight;
256
+ this.#thumbTopPercent =
257
+ maxScrollTop > 0
258
+ ? (vp.scrollTop / maxScrollTop) * (100 - this.#thumbHeightPercent)
259
+ : 0;
260
+ }
261
+ if (this.#hasOverflowX) {
262
+ const maxScrollLeft = vp.scrollWidth - vp.clientWidth;
263
+ this.#thumbLeftPercent =
264
+ maxScrollLeft > 0
265
+ ? (vp.scrollLeft / maxScrollLeft) * (100 - this.#thumbWidthPercent)
266
+ : 0;
267
+ }
268
+ };
269
+ // --- Event handlers ---
270
+ #onScroll = () => {
271
+ const vp = this.#viewport;
272
+ if (!vp)
273
+ return;
274
+ this.#scrolling = true;
275
+ this.#updateThumbPosition(vp);
276
+ const wasAtBottom = this.#isAtBottom;
277
+ const scrolledUp = vp.scrollTop < this.#prevScrollTop;
278
+ this.#isAtTop = vp.scrollTop <= 0;
279
+ this.#isAtBottom =
280
+ vp.scrollTop + vp.clientHeight >=
281
+ vp.scrollHeight - _a.#SCROLL_BOTTOM_TOLERANCE;
282
+ if (scrolledUp && wasAtBottom && !this.#isAtBottom) {
283
+ this.dispatchEvent(new Event("scrolled-from-bottom", { bubbles: true, composed: true }));
284
+ }
285
+ else if (!wasAtBottom && this.#isAtBottom) {
286
+ this.dispatchEvent(new Event("scrolled-to-bottom", { bubbles: true, composed: true }));
287
+ }
288
+ this.#prevScrollTop = vp.scrollTop;
289
+ clearTimeout(this.#scrollEndTimer);
290
+ this.#scrollEndTimer = setTimeout(() => {
291
+ this.#scrolling = false;
292
+ }, 1000);
293
+ };
294
+ #onPointerEnter = () => {
295
+ this.#hovering = true;
296
+ this.#measure();
297
+ };
298
+ #onPointerLeave = () => {
299
+ this.#hovering = false;
300
+ };
301
+ // --- Track click (jump to position) ---
302
+ #onTrackPointerDown = (orientation, event) => {
303
+ event.preventDefault();
304
+ event.stopPropagation();
305
+ const vp = this.#viewport;
306
+ if (!vp)
307
+ return;
308
+ if (orientation === "vertical") {
309
+ const track = this.shadowRoot?.querySelector('.Scrollbar[data-orientation="vertical"]');
310
+ if (!track)
311
+ return;
312
+ const rect = track.getBoundingClientRect();
313
+ const fraction = (event.clientY - rect.top) / rect.height;
314
+ vp.scrollTop = fraction * (vp.scrollHeight - vp.clientHeight);
315
+ }
316
+ else {
317
+ const track = this.shadowRoot?.querySelector('.Scrollbar[data-orientation="horizontal"]');
318
+ if (!track)
319
+ return;
320
+ const rect = track.getBoundingClientRect();
321
+ const fraction = (event.clientX - rect.left) / rect.width;
322
+ vp.scrollLeft = fraction * (vp.scrollWidth - vp.clientWidth);
323
+ }
324
+ };
325
+ // --- Thumb drag ---
326
+ #onThumbPointerDown = (orientation, event) => {
327
+ event.preventDefault();
328
+ event.stopPropagation();
329
+ const vp = this.#viewport;
330
+ if (!vp)
331
+ return;
332
+ this.#dragging = orientation;
333
+ if (orientation === "vertical") {
334
+ this.#dragStartPointer = event.clientY;
335
+ this.#dragStartScroll = vp.scrollTop;
336
+ }
337
+ else {
338
+ this.#dragStartPointer = event.clientX;
339
+ this.#dragStartScroll = vp.scrollLeft;
340
+ }
341
+ document.addEventListener("pointermove", this.#onDragMove);
342
+ document.addEventListener("pointerup", this.#onDragEnd);
343
+ };
344
+ #onDragMove = (event) => {
345
+ const vp = this.#viewport;
346
+ if (!vp || !this.#dragging)
347
+ return;
348
+ if (this.#dragging === "vertical") {
349
+ const track = this.shadowRoot?.querySelector('.Scrollbar[data-orientation="vertical"]');
350
+ if (!track)
351
+ return;
352
+ const delta = event.clientY - this.#dragStartPointer;
353
+ const trackHeight = track.clientHeight;
354
+ const scrollRange = vp.scrollHeight - vp.clientHeight;
355
+ vp.scrollTop =
356
+ this.#dragStartScroll + (delta / trackHeight) * scrollRange;
357
+ }
358
+ else {
359
+ const track = this.shadowRoot?.querySelector('.Scrollbar[data-orientation="horizontal"]');
360
+ if (!track)
361
+ return;
362
+ const delta = event.clientX - this.#dragStartPointer;
363
+ const trackWidth = track.clientWidth;
364
+ const scrollRange = vp.scrollWidth - vp.clientWidth;
365
+ vp.scrollLeft =
366
+ this.#dragStartScroll + (delta / trackWidth) * scrollRange;
367
+ }
368
+ };
369
+ #onDragEnd = () => {
370
+ this.#dragging = undefined;
371
+ document.removeEventListener("pointermove", this.#onDragMove);
372
+ document.removeEventListener("pointerup", this.#onDragEnd);
373
+ };
374
+ // --- Render ---
375
+ #renderVerticalScrollbar() {
376
+ if (!this.#showVertical || !this.#hasOverflowY)
377
+ return nothing;
378
+ return html `
379
+ <div
380
+ class="Scrollbar"
381
+ part="scrollbar-vertical"
382
+ data-orientation="vertical"
383
+ ?data-hovering="${this.#hovering}"
384
+ ?data-scrolling="${this.#scrolling}"
385
+ @pointerdown="${(e) => this.#onTrackPointerDown("vertical", e)}"
386
+ >
387
+ <div
388
+ class="Thumb"
389
+ part="thumb-vertical"
390
+ data-orientation="vertical"
391
+ style="height: ${this.#thumbHeightPercent}%; top: ${this
392
+ .#thumbTopPercent}%; position: absolute;"
393
+ @pointerdown="${(e) => this.#onThumbPointerDown("vertical", e)}"
394
+ ></div>
395
+ </div>
396
+ `;
397
+ }
398
+ #renderHorizontalScrollbar() {
399
+ if (!this.#showHorizontal || !this.#hasOverflowX)
400
+ return nothing;
401
+ return html `
402
+ <div
403
+ class="Scrollbar"
404
+ part="scrollbar-horizontal"
405
+ data-orientation="horizontal"
406
+ ?data-hovering="${this.#hovering}"
407
+ ?data-scrolling="${this.#scrolling}"
408
+ @pointerdown="${(e) => this.#onTrackPointerDown("horizontal", e)}"
409
+ >
410
+ <div
411
+ class="Thumb"
412
+ part="thumb-horizontal"
413
+ data-orientation="horizontal"
414
+ style="width: ${this.#thumbWidthPercent}%; left: ${this
415
+ .#thumbLeftPercent}%; position: absolute;"
416
+ @pointerdown="${(e) => this.#onThumbPointerDown("horizontal", e)}"
417
+ ></div>
418
+ </div>
419
+ `;
420
+ }
421
+ render() {
422
+ return html `
423
+ <div
424
+ class="ScrollArea"
425
+ part="root"
426
+ ?data-has-overflow-x="${this.#hasOverflowX}"
427
+ ?data-has-overflow-y="${this.#hasOverflowY}"
428
+ ?data-scrolling="${this.#scrolling}"
429
+ >
430
+ ${this.fade
431
+ ? html `<div
432
+ class="ScrollFade"
433
+ ?data-scrolled="${!this.#isAtTop}"
434
+ ></div>`
435
+ : nothing}
436
+ <div class="Viewport" part="viewport" @scroll="${this.#onScroll}">
437
+ <slot></slot>
438
+ </div>
439
+ ${this.#renderVerticalScrollbar()} ${this.#renderHorizontalScrollbar()}
440
+ </div>
441
+ `;
442
+ }
443
+ }
444
+ _a = DuiScrollArea;
445
+ __decorate([
446
+ property({ reflect: true })
447
+ ], DuiScrollArea.prototype, "orientation", null);
448
+ __decorate([
449
+ property({ type: Boolean, reflect: true })
450
+ ], DuiScrollArea.prototype, "fade", null);
451
+ __decorate([
452
+ property({ attribute: "max-height" })
453
+ ], DuiScrollArea.prototype, "maxHeight", null);
@@ -0,0 +1,2 @@
1
+ export { DuiSelect } from "./select.js";
2
+ export type { SelectOption } from "./select.js";
@@ -0,0 +1 @@
1
+ export { DuiSelect } from "./select.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { DuiSelect } from "./select.js";
2
+ if (!customElements.get(DuiSelect.tagName)) {
3
+ customElements.define(DuiSelect.tagName, DuiSelect);
4
+ }
@@ -0,0 +1,36 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/select */
2
+ import { LitElement, type TemplateResult } from "lit";
3
+ export type SelectOption = {
4
+ label: string;
5
+ value: string;
6
+ disabled?: boolean;
7
+ };
8
+ export type SelectValueChangeDetail = {
9
+ value: string;
10
+ option: SelectOption;
11
+ };
12
+ export declare const valueChangeEvent: (detail: SelectValueChangeDetail) => CustomEvent<SelectValueChangeDetail>;
13
+ /**
14
+ * `<dui-select>` — A dropdown select for choosing from a list of options.
15
+ *
16
+ * @csspart trigger - The trigger button.
17
+ * @csspart value - The displayed value text.
18
+ * @fires value-change - Fired when the selected value changes.
19
+ * Detail: { value: string, option: SelectOption }
20
+ */
21
+ export declare class DuiSelect extends LitElement {
22
+ #private;
23
+ static tagName: "dui-select";
24
+ static styles: import("lit").CSSResult[];
25
+ /** The available options. */
26
+ accessor options: SelectOption[];
27
+ /** Currently selected value. */
28
+ accessor value: string;
29
+ /** Placeholder text shown when no value is selected. */
30
+ accessor placeholder: string;
31
+ /** Whether the select is disabled. */
32
+ accessor disabled: boolean;
33
+ /** Name for form submission. */
34
+ accessor name: string;
35
+ render(): TemplateResult;
36
+ }