@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,326 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ 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;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { css, html, LitElement, nothing } from "lit";
8
+ import { property } from "lit/decorators.js";
9
+ import { live } from "lit/directives/live.js";
10
+ import { base } from "@deepfuture/dui-core/base";
11
+ import { customEvent } from "@deepfuture/dui-core/event";
12
+ export const valueChangeEvent = customEvent("value-change", { bubbles: true, composed: true });
13
+ /** Structural styles only — layout CSS. */
14
+ const styles = css `
15
+ :host {
16
+ display: block;
17
+ }
18
+
19
+ [part="root"] {
20
+ display: inline-flex;
21
+ align-items: center;
22
+ }
23
+
24
+ [part="input"] {
25
+ box-sizing: border-box;
26
+ outline: none;
27
+ border: none;
28
+ background: none;
29
+ font: inherit;
30
+ color: inherit;
31
+ text-align: center;
32
+ min-width: 0;
33
+ }
34
+
35
+ [part="input"]:disabled {
36
+ cursor: not-allowed;
37
+ }
38
+
39
+ [part="decrement"],
40
+ [part="increment"] {
41
+ display: inline-flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ cursor: pointer;
45
+ border: none;
46
+ background: none;
47
+ padding: 0;
48
+ margin: 0;
49
+ font: inherit;
50
+ color: inherit;
51
+ flex-shrink: 0;
52
+ }
53
+
54
+ [part="decrement"]:disabled,
55
+ [part="increment"]:disabled {
56
+ cursor: not-allowed;
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
+ /**
69
+ * `<dui-number-field>` — A numeric input with increment/decrement buttons.
70
+ *
71
+ * @csspart root - The outer container.
72
+ * @csspart input - The text input element.
73
+ * @csspart decrement - The decrement button.
74
+ * @csspart increment - The increment button.
75
+ * @fires value-change - Fired when value changes. Detail: { value: number }
76
+ */
77
+ export class DuiNumberField extends LitElement {
78
+ static { this.tagName = "dui-number-field"; }
79
+ static { this.shadowRootOptions = {
80
+ ...LitElement.shadowRootOptions,
81
+ delegatesFocus: true,
82
+ }; }
83
+ static { this.styles = [base, styles]; }
84
+ #value_accessor_storage = undefined;
85
+ get value() { return this.#value_accessor_storage; }
86
+ set value(value) { this.#value_accessor_storage = value; }
87
+ #defaultValue_accessor_storage = undefined;
88
+ get defaultValue() { return this.#defaultValue_accessor_storage; }
89
+ set defaultValue(value) { this.#defaultValue_accessor_storage = value; }
90
+ #min_accessor_storage = undefined;
91
+ get min() { return this.#min_accessor_storage; }
92
+ set min(value) { this.#min_accessor_storage = value; }
93
+ #max_accessor_storage = undefined;
94
+ get max() { return this.#max_accessor_storage; }
95
+ set max(value) { this.#max_accessor_storage = value; }
96
+ #step_accessor_storage = 1;
97
+ get step() { return this.#step_accessor_storage; }
98
+ set step(value) { this.#step_accessor_storage = value; }
99
+ #largeStep_accessor_storage = 10;
100
+ get largeStep() { return this.#largeStep_accessor_storage; }
101
+ set largeStep(value) { this.#largeStep_accessor_storage = value; }
102
+ #disabled_accessor_storage = false;
103
+ get disabled() { return this.#disabled_accessor_storage; }
104
+ set disabled(value) { this.#disabled_accessor_storage = value; }
105
+ #readOnly_accessor_storage = false;
106
+ get readOnly() { return this.#readOnly_accessor_storage; }
107
+ set readOnly(value) { this.#readOnly_accessor_storage = value; }
108
+ #required_accessor_storage = false;
109
+ get required() { return this.#required_accessor_storage; }
110
+ set required(value) { this.#required_accessor_storage = value; }
111
+ #name_accessor_storage = undefined;
112
+ get name() { return this.#name_accessor_storage; }
113
+ set name(value) { this.#name_accessor_storage = value; }
114
+ #internalValue_accessor_storage = undefined;
115
+ get #internalValue() { return this.#internalValue_accessor_storage; }
116
+ set #internalValue(value) { this.#internalValue_accessor_storage = value; }
117
+ #inputText_accessor_storage = "";
118
+ get #inputText() { return this.#inputText_accessor_storage; }
119
+ set #inputText(value) { this.#inputText_accessor_storage = value; }
120
+ #fieldCtx_accessor_storage;
121
+ get #fieldCtx() { return this.#fieldCtx_accessor_storage; }
122
+ set #fieldCtx(value) { this.#fieldCtx_accessor_storage = value; }
123
+ get #currentValue() {
124
+ return this.value ?? this.#internalValue;
125
+ }
126
+ get #isDisabled() {
127
+ return this.disabled || (this.#fieldCtx?.disabled ?? false);
128
+ }
129
+ get #isInvalid() {
130
+ return this.#fieldCtx?.invalid ?? false;
131
+ }
132
+ get #canDecrement() {
133
+ const v = this.#currentValue;
134
+ if (v === undefined)
135
+ return true;
136
+ return this.min === undefined || v > this.min;
137
+ }
138
+ get #canIncrement() {
139
+ const v = this.#currentValue;
140
+ if (v === undefined)
141
+ return true;
142
+ return this.max === undefined || v < this.max;
143
+ }
144
+ connectedCallback() {
145
+ super.connectedCallback();
146
+ if (this.value === undefined && this.defaultValue !== undefined) {
147
+ this.#internalValue = this.#clamp(this.defaultValue);
148
+ }
149
+ this.#syncInputText();
150
+ }
151
+ willUpdate() {
152
+ this.#syncInputText();
153
+ }
154
+ #syncInputText() {
155
+ const v = this.#currentValue;
156
+ this.#inputText = v !== undefined ? String(v) : "";
157
+ }
158
+ #clamp(val) {
159
+ if (this.min !== undefined)
160
+ val = Math.max(this.min, val);
161
+ if (this.max !== undefined)
162
+ val = Math.min(this.max, val);
163
+ return val;
164
+ }
165
+ #setValue(val) {
166
+ const clamped = this.#clamp(val);
167
+ if (this.value === undefined) {
168
+ this.#internalValue = clamped;
169
+ }
170
+ this.#fieldCtx?.markDirty();
171
+ this.#fieldCtx?.setFilled(true);
172
+ this.dispatchEvent(valueChangeEvent({ value: clamped }));
173
+ }
174
+ #increment = (amount) => {
175
+ if (this.#isDisabled || this.readOnly)
176
+ return;
177
+ const current = this.#currentValue ?? this.min ?? 0;
178
+ this.#setValue(current + amount);
179
+ };
180
+ #decrement = (amount) => {
181
+ if (this.#isDisabled || this.readOnly)
182
+ return;
183
+ const current = this.#currentValue ?? this.max ?? 0;
184
+ this.#setValue(current - amount);
185
+ };
186
+ #commitInput() {
187
+ const parsed = parseFloat(this.#inputText);
188
+ if (Number.isNaN(parsed)) {
189
+ this.#syncInputText();
190
+ }
191
+ else {
192
+ this.#setValue(parsed);
193
+ }
194
+ }
195
+ #onInput = (e) => {
196
+ this.#inputText = e.target.value;
197
+ };
198
+ #onBlur = () => {
199
+ this.#commitInput();
200
+ this.#fieldCtx?.setFocused(false);
201
+ this.#fieldCtx?.markTouched();
202
+ };
203
+ #onFocus = () => {
204
+ this.#fieldCtx?.setFocused(true);
205
+ };
206
+ #onKeyDown = (e) => {
207
+ switch (e.key) {
208
+ case "ArrowUp":
209
+ e.preventDefault();
210
+ this.#increment(e.shiftKey ? this.largeStep : this.step);
211
+ break;
212
+ case "ArrowDown":
213
+ e.preventDefault();
214
+ this.#decrement(e.shiftKey ? this.largeStep : this.step);
215
+ break;
216
+ case "Home":
217
+ if (this.min !== undefined) {
218
+ e.preventDefault();
219
+ this.#setValue(this.min);
220
+ }
221
+ break;
222
+ case "End":
223
+ if (this.max !== undefined) {
224
+ e.preventDefault();
225
+ this.#setValue(this.max);
226
+ }
227
+ break;
228
+ case "Enter":
229
+ this.#commitInput();
230
+ break;
231
+ }
232
+ };
233
+ #onDecrementClick = () => {
234
+ this.#decrement(this.step);
235
+ };
236
+ #onIncrementClick = () => {
237
+ this.#increment(this.step);
238
+ };
239
+ render() {
240
+ const isDisabled = this.#isDisabled;
241
+ const isInvalid = this.#isInvalid;
242
+ const controlId = this.#fieldCtx?.controlId ?? "";
243
+ const currentValue = this.#currentValue;
244
+ return html `
245
+ <div
246
+ part="root"
247
+ ?data-disabled="${isDisabled}"
248
+ ?data-invalid="${isInvalid}"
249
+ >
250
+ <button
251
+ part="decrement"
252
+ type="button"
253
+ tabindex="-1"
254
+ aria-label="Decrease"
255
+ ?disabled="${isDisabled || this.readOnly || !this.#canDecrement}"
256
+ @click="${this.#onDecrementClick}"
257
+ >
258
+ <slot name="decrement">&minus;</slot>
259
+ </button>
260
+ <input
261
+ part="input"
262
+ id="${controlId || nothing}"
263
+ type="text"
264
+ inputmode="decimal"
265
+ .value="${live(this.#inputText)}"
266
+ ?disabled="${isDisabled}"
267
+ ?readonly="${this.readOnly}"
268
+ ?required="${this.required}"
269
+ aria-invalid="${isInvalid ? "true" : nothing}"
270
+ ?data-disabled="${isDisabled}"
271
+ @input="${this.#onInput}"
272
+ @keydown="${this.#onKeyDown}"
273
+ @focus="${this.#onFocus}"
274
+ @blur="${this.#onBlur}"
275
+ />
276
+ <button
277
+ part="increment"
278
+ type="button"
279
+ tabindex="-1"
280
+ aria-label="Increase"
281
+ ?disabled="${isDisabled || this.readOnly || !this.#canIncrement}"
282
+ @click="${this.#onIncrementClick}"
283
+ >
284
+ <slot name="increment">+</slot>
285
+ </button>
286
+ ${this.name
287
+ ? html `<input
288
+ type="hidden"
289
+ name="${this.name}"
290
+ .value="${String(currentValue ?? "")}"
291
+ />`
292
+ : nothing}
293
+ </div>
294
+ `;
295
+ }
296
+ }
297
+ __decorate([
298
+ property({ type: Number })
299
+ ], DuiNumberField.prototype, "value", null);
300
+ __decorate([
301
+ property({ type: Number, attribute: "default-value" })
302
+ ], DuiNumberField.prototype, "defaultValue", null);
303
+ __decorate([
304
+ property({ type: Number })
305
+ ], DuiNumberField.prototype, "min", null);
306
+ __decorate([
307
+ property({ type: Number })
308
+ ], DuiNumberField.prototype, "max", null);
309
+ __decorate([
310
+ property({ type: Number })
311
+ ], DuiNumberField.prototype, "step", null);
312
+ __decorate([
313
+ property({ type: Number, attribute: "large-step" })
314
+ ], DuiNumberField.prototype, "largeStep", null);
315
+ __decorate([
316
+ property({ type: Boolean, reflect: true })
317
+ ], DuiNumberField.prototype, "disabled", null);
318
+ __decorate([
319
+ property({ type: Boolean, reflect: true, attribute: "read-only" })
320
+ ], DuiNumberField.prototype, "readOnly", null);
321
+ __decorate([
322
+ property({ type: Boolean })
323
+ ], DuiNumberField.prototype, "required", null);
324
+ __decorate([
325
+ property()
326
+ ], DuiNumberField.prototype, "name", null);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { DuiNumberField } from "./index.js";
2
+ if (!customElements.get(DuiNumberField.tagName)) {
3
+ customElements.define(DuiNumberField.tagName, DuiNumberField);
4
+ }
package/package.json ADDED
@@ -0,0 +1,217 @@
1
+ {
2
+ "name": "@deepfuture/dui-components",
3
+ "version": "0.0.1",
4
+ "description": "DUI unstyled web components — structural CSS only, themed via applyTheme()",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/nicholasgasior/dui.git",
10
+ "directory": "packages/components"
11
+ },
12
+ "exports": {
13
+ "./button": {
14
+ "import": "./button/index.js",
15
+ "types": "./button/index.d.ts"
16
+ },
17
+ "./switch": {
18
+ "import": "./switch/index.js",
19
+ "types": "./switch/index.d.ts"
20
+ },
21
+ "./accordion": {
22
+ "import": "./accordion/index.js",
23
+ "types": "./accordion/index.d.ts"
24
+ },
25
+ "./badge": {
26
+ "import": "./badge/index.js",
27
+ "types": "./badge/index.d.ts"
28
+ },
29
+ "./icon": {
30
+ "import": "./icon/index.js",
31
+ "types": "./icon/index.d.ts"
32
+ },
33
+ "./scroll-area": {
34
+ "import": "./scroll-area/index.js",
35
+ "types": "./scroll-area/index.d.ts"
36
+ },
37
+ "./combobox": {
38
+ "import": "./combobox/index.js",
39
+ "types": "./combobox/index.d.ts"
40
+ },
41
+ "./menu": {
42
+ "import": "./menu/index.js",
43
+ "types": "./menu/index.d.ts"
44
+ },
45
+ "./popover": {
46
+ "import": "./popover/index.js",
47
+ "types": "./popover/index.d.ts"
48
+ },
49
+ "./tooltip": {
50
+ "import": "./tooltip/index.js",
51
+ "types": "./tooltip/index.d.ts"
52
+ },
53
+ "./dialog": {
54
+ "import": "./dialog/index.js",
55
+ "types": "./dialog/index.d.ts"
56
+ },
57
+ "./alert-dialog": {
58
+ "import": "./alert-dialog/index.js",
59
+ "types": "./alert-dialog/index.d.ts"
60
+ },
61
+ "./breadcrumb": {
62
+ "import": "./breadcrumb/index.js",
63
+ "types": "./breadcrumb/index.d.ts"
64
+ },
65
+ "./checkbox": {
66
+ "import": "./checkbox/index.js",
67
+ "types": "./checkbox/index.d.ts"
68
+ },
69
+ "./collapsible": {
70
+ "import": "./collapsible/index.js",
71
+ "types": "./collapsible/index.d.ts"
72
+ },
73
+ "./toolbar": {
74
+ "import": "./toolbar/index.js",
75
+ "types": "./toolbar/index.d.ts"
76
+ },
77
+ "./slider": {
78
+ "import": "./slider/index.js",
79
+ "types": "./slider/index.d.ts"
80
+ },
81
+ "./spinner": {
82
+ "import": "./spinner/index.js",
83
+ "types": "./spinner/index.d.ts"
84
+ },
85
+ "./tabs": {
86
+ "import": "./tabs/index.js",
87
+ "types": "./tabs/index.d.ts"
88
+ },
89
+ "./textarea": {
90
+ "import": "./textarea/index.js",
91
+ "types": "./textarea/index.d.ts"
92
+ },
93
+ "./trunc": {
94
+ "import": "./trunc/index.js",
95
+ "types": "./trunc/index.d.ts"
96
+ },
97
+ "./center": {
98
+ "import": "./center/index.js",
99
+ "types": "./center/index.d.ts"
100
+ },
101
+ "./hstack": {
102
+ "import": "./hstack/index.js",
103
+ "types": "./hstack/index.d.ts"
104
+ },
105
+ "./vstack": {
106
+ "import": "./vstack/index.js",
107
+ "types": "./vstack/index.d.ts"
108
+ },
109
+ "./page-inset": {
110
+ "import": "./page-inset/index.js",
111
+ "types": "./page-inset/index.d.ts"
112
+ },
113
+ "./link": {
114
+ "import": "./link/index.js",
115
+ "types": "./link/index.d.ts"
116
+ },
117
+ "./avatar": {
118
+ "import": "./avatar/index.js",
119
+ "types": "./avatar/index.d.ts"
120
+ },
121
+ "./portal": {
122
+ "import": "./portal/index.js",
123
+ "types": "./portal/index.d.ts"
124
+ },
125
+ "./field": {
126
+ "import": "./field/index.js",
127
+ "types": "./field/index.d.ts"
128
+ },
129
+ "./input": {
130
+ "import": "./input/index.js",
131
+ "types": "./input/index.d.ts"
132
+ },
133
+ "./radio": {
134
+ "import": "./radio/index.js",
135
+ "types": "./radio/index.d.ts"
136
+ },
137
+ "./dropzone": {
138
+ "import": "./dropzone/index.js",
139
+ "types": "./dropzone/index.d.ts"
140
+ },
141
+ "./select": {
142
+ "import": "./select/index.js",
143
+ "types": "./select/index.d.ts"
144
+ },
145
+ "./preview-card": {
146
+ "import": "./preview-card/index.js",
147
+ "types": "./preview-card/index.d.ts"
148
+ },
149
+ "./data-table": {
150
+ "import": "./data-table/index.js",
151
+ "types": "./data-table/index.d.ts"
152
+ },
153
+ "./command": {
154
+ "import": "./command/index.js",
155
+ "types": "./command/index.d.ts"
156
+ },
157
+ "./sidebar": {
158
+ "import": "./sidebar/index.js",
159
+ "types": "./sidebar/index.d.ts"
160
+ },
161
+ "./separator": {
162
+ "import": "./separator/index.js",
163
+ "types": "./separator/index.d.ts"
164
+ },
165
+ "./progress": {
166
+ "import": "./progress/index.js",
167
+ "types": "./progress/index.d.ts"
168
+ },
169
+ "./toggle": {
170
+ "import": "./toggle/index.js",
171
+ "types": "./toggle/index.d.ts"
172
+ },
173
+ "./number-field": {
174
+ "import": "./number-field/index.js",
175
+ "types": "./number-field/index.d.ts"
176
+ },
177
+ "./menubar": {
178
+ "import": "./menubar/index.js",
179
+ "types": "./menubar/index.d.ts"
180
+ },
181
+ "./calendar": {
182
+ "import": "./calendar/index.js",
183
+ "types": "./calendar/index.d.ts"
184
+ },
185
+ "./all": {
186
+ "import": "./all.js",
187
+ "types": "./all.d.ts"
188
+ }
189
+ },
190
+ "files": [
191
+ "**/*.js",
192
+ "**/*.d.ts",
193
+ "**/*.css"
194
+ ],
195
+ "dependencies": {
196
+ "@deepfuture/dui-core": "0.0.1",
197
+ "lit": "^3.3.2",
198
+ "@lit/context": "^1.1.3"
199
+ },
200
+ "sideEffects": false,
201
+ "keywords": [
202
+ "web-components",
203
+ "lit",
204
+ "unstyled",
205
+ "components",
206
+ "dui",
207
+ "theme"
208
+ ],
209
+ "types": "./global.d.ts",
210
+ "typesVersions": {
211
+ "*": {
212
+ "*": [
213
+ "./*"
214
+ ]
215
+ }
216
+ }
217
+ }
@@ -0,0 +1 @@
1
+ export { DuiPageInset } from "./page-inset.js";
@@ -0,0 +1 @@
1
+ export { DuiPageInset } from "./page-inset.js";
@@ -0,0 +1,28 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/page-inset */
2
+ import { LitElement, type PropertyValues, type TemplateResult } from "lit";
3
+ /**
4
+ * `<dui-page-inset>` — Centers content with max-width constraints and configurable padding.
5
+ *
6
+ * @slot - Content to be centered within the inset area.
7
+ * @csspart root - The outer container element.
8
+ * @csspart inner - The inner content wrapper with max-width constraint.
9
+ * @cssprop --page-inset-pad-x - Horizontal padding (default: var(--space-16)).
10
+ * @cssprop --page-inset-pad-y - Vertical padding (default: var(--space-12)).
11
+ * @cssprop --page-inset-max-width - Max width of inner content (default: 48rem).
12
+ * @cssprop --page-inset-min-width - Min width of inner content (default: auto).
13
+ */
14
+ export declare class DuiPageInset extends LitElement {
15
+ #private;
16
+ static tagName: "dui-page-inset";
17
+ static styles: import("lit").CSSResult[];
18
+ /** Maximum width of the inner content area. Overrides --page-inset-max-width. */
19
+ accessor maxWidth: string | undefined;
20
+ /** Minimum width of the inner content area. Overrides --page-inset-min-width. */
21
+ accessor minWidth: string | undefined;
22
+ /** Horizontal padding. Overrides --page-inset-pad-x. */
23
+ accessor padX: string | undefined;
24
+ /** Vertical padding. Overrides --page-inset-pad-y. */
25
+ accessor padY: string | undefined;
26
+ protected willUpdate(changed: PropertyValues): void;
27
+ render(): TemplateResult;
28
+ }
@@ -0,0 +1,103 @@
1
+ /** Ported from original DUI: deep-future-app/app/client/components/dui/page-inset */
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
+ /** Structural styles only — layout CSS. */
12
+ const styles = css `
13
+ :host {
14
+ display: block;
15
+ --page-inset-pad-x: var(--space-16);
16
+ --page-inset-pad-y: var(--space-12);
17
+ --page-inset-max-width: 48rem;
18
+ --page-inset-min-width: auto;
19
+ }
20
+
21
+ [part="root"] {
22
+ display: flex;
23
+ flex-direction: column;
24
+ align-items: center;
25
+ padding: var(--page-inset-pad-y) var(--page-inset-pad-x);
26
+ min-height: 100cqh;
27
+ max-width: 100cqw;
28
+ }
29
+
30
+ [part="inner"] {
31
+ max-width: var(--page-inset-max-width);
32
+ min-width: var(--page-inset-min-width);
33
+ width: 100%;
34
+ }
35
+ `;
36
+ /**
37
+ * `<dui-page-inset>` — Centers content with max-width constraints and configurable padding.
38
+ *
39
+ * @slot - Content to be centered within the inset area.
40
+ * @csspart root - The outer container element.
41
+ * @csspart inner - The inner content wrapper with max-width constraint.
42
+ * @cssprop --page-inset-pad-x - Horizontal padding (default: var(--space-16)).
43
+ * @cssprop --page-inset-pad-y - Vertical padding (default: var(--space-12)).
44
+ * @cssprop --page-inset-max-width - Max width of inner content (default: 48rem).
45
+ * @cssprop --page-inset-min-width - Min width of inner content (default: auto).
46
+ */
47
+ export class DuiPageInset extends LitElement {
48
+ static { this.tagName = "dui-page-inset"; }
49
+ static { this.styles = [base, styles]; }
50
+ #maxWidth_accessor_storage;
51
+ /** Maximum width of the inner content area. Overrides --page-inset-max-width. */
52
+ get maxWidth() { return this.#maxWidth_accessor_storage; }
53
+ set maxWidth(value) { this.#maxWidth_accessor_storage = value; }
54
+ #minWidth_accessor_storage;
55
+ /** Minimum width of the inner content area. Overrides --page-inset-min-width. */
56
+ get minWidth() { return this.#minWidth_accessor_storage; }
57
+ set minWidth(value) { this.#minWidth_accessor_storage = value; }
58
+ #padX_accessor_storage;
59
+ /** Horizontal padding. Overrides --page-inset-pad-x. */
60
+ get padX() { return this.#padX_accessor_storage; }
61
+ set padX(value) { this.#padX_accessor_storage = value; }
62
+ #padY_accessor_storage;
63
+ /** Vertical padding. Overrides --page-inset-pad-y. */
64
+ get padY() { return this.#padY_accessor_storage; }
65
+ set padY(value) { this.#padY_accessor_storage = value; }
66
+ #setOrRemove(prop, value) {
67
+ if (value)
68
+ this.style.setProperty(prop, value);
69
+ else
70
+ this.style.removeProperty(prop);
71
+ }
72
+ willUpdate(changed) {
73
+ if (changed.has("maxWidth"))
74
+ this.#setOrRemove("--page-inset-max-width", this.maxWidth);
75
+ if (changed.has("minWidth"))
76
+ this.#setOrRemove("--page-inset-min-width", this.minWidth);
77
+ if (changed.has("padX"))
78
+ this.#setOrRemove("--page-inset-pad-x", this.padX);
79
+ if (changed.has("padY"))
80
+ this.#setOrRemove("--page-inset-pad-y", this.padY);
81
+ }
82
+ render() {
83
+ return html `
84
+ <div part="root">
85
+ <div part="inner">
86
+ <slot></slot>
87
+ </div>
88
+ </div>
89
+ `;
90
+ }
91
+ }
92
+ __decorate([
93
+ property({ attribute: "max-width" })
94
+ ], DuiPageInset.prototype, "maxWidth", null);
95
+ __decorate([
96
+ property({ attribute: "min-width" })
97
+ ], DuiPageInset.prototype, "minWidth", null);
98
+ __decorate([
99
+ property({ attribute: "pad-x" })
100
+ ], DuiPageInset.prototype, "padX", null);
101
+ __decorate([
102
+ property({ attribute: "pad-y" })
103
+ ], DuiPageInset.prototype, "padY", null);
@@ -0,0 +1 @@
1
+ export {};