@deepfuture/dui-components 0.0.11 → 0.0.13

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 (250) hide show
  1. package/README.md +191 -0
  2. package/_deprecated/center/center.js +2 -2
  3. package/_deprecated/center/index.d.ts +3 -1
  4. package/_deprecated/center/index.js +3 -1
  5. package/_deprecated/hstack/hstack.js +79 -33
  6. package/_deprecated/hstack/index.d.ts +3 -1
  7. package/_deprecated/hstack/index.js +3 -1
  8. package/_deprecated/page-inset/index.d.ts +3 -1
  9. package/_deprecated/page-inset/index.js +3 -1
  10. package/_deprecated/page-inset/page-inset.js +104 -56
  11. package/_deprecated/vstack/index.d.ts +3 -1
  12. package/_deprecated/vstack/index.js +3 -1
  13. package/_deprecated/vstack/vstack.js +61 -19
  14. package/accordion/accordion-item.js +217 -147
  15. package/accordion/accordion.js +214 -149
  16. package/accordion/index.d.ts +5 -2
  17. package/accordion/index.js +5 -2
  18. package/alert-dialog/alert-dialog-close.js +2 -2
  19. package/alert-dialog/alert-dialog-popup.js +230 -166
  20. package/alert-dialog/alert-dialog-trigger.js +2 -2
  21. package/alert-dialog/alert-dialog.js +128 -73
  22. package/alert-dialog/index.d.ts +9 -4
  23. package/alert-dialog/index.js +9 -4
  24. package/avatar/avatar.js +175 -115
  25. package/avatar/index.d.ts +3 -1
  26. package/avatar/index.js +3 -1
  27. package/badge/badge.js +2 -2
  28. package/badge/index.d.ts +3 -1
  29. package/badge/index.js +3 -1
  30. package/breadcrumb/breadcrumb-ellipsis.js +2 -2
  31. package/breadcrumb/breadcrumb-item.js +2 -2
  32. package/breadcrumb/breadcrumb-link.js +2 -2
  33. package/breadcrumb/breadcrumb-page.js +2 -2
  34. package/breadcrumb/breadcrumb-separator.js +2 -2
  35. package/breadcrumb/breadcrumb.js +2 -2
  36. package/breadcrumb/index.d.ts +13 -6
  37. package/breadcrumb/index.js +13 -6
  38. package/button/button.js +109 -65
  39. package/button/index.d.ts +3 -1
  40. package/button/index.js +3 -1
  41. package/calendar/calendar.js +368 -290
  42. package/calendar/index.d.ts +3 -1
  43. package/calendar/index.js +3 -1
  44. package/checkbox/checkbox-group.js +146 -87
  45. package/checkbox/checkbox.js +232 -167
  46. package/checkbox/index.d.ts +5 -2
  47. package/checkbox/index.js +5 -2
  48. package/collapsible/collapsible.js +210 -132
  49. package/collapsible/index.d.ts +3 -1
  50. package/collapsible/index.js +3 -1
  51. package/combobox/combobox.js +318 -252
  52. package/combobox/index.d.ts +3 -1
  53. package/combobox/index.js +3 -1
  54. package/command/command-empty.js +67 -25
  55. package/command/command-group.js +87 -47
  56. package/command/command-input.js +84 -44
  57. package/command/command-item.js +168 -124
  58. package/command/command-list.js +60 -18
  59. package/command/command-separator.js +2 -2
  60. package/command/command-shortcut.js +2 -2
  61. package/command/command.js +297 -232
  62. package/command/index.d.ts +17 -8
  63. package/command/index.js +17 -8
  64. package/data-table/data-table.js +225 -153
  65. package/data-table/index.d.ts +3 -1
  66. package/data-table/index.js +3 -1
  67. package/dialog/dialog-close.js +2 -2
  68. package/dialog/dialog-popup.js +247 -181
  69. package/dialog/dialog-trigger.js +2 -2
  70. package/dialog/dialog.js +128 -73
  71. package/dialog/index.d.ts +9 -4
  72. package/dialog/index.js +9 -4
  73. package/dropzone/dropzone.js +310 -249
  74. package/dropzone/index.d.ts +3 -1
  75. package/dropzone/index.js +3 -1
  76. package/icon/icon.js +2 -2
  77. package/icon/index.d.ts +3 -1
  78. package/icon/index.js +3 -1
  79. package/input/index.d.ts +3 -1
  80. package/input/index.js +3 -1
  81. package/input/input.js +204 -143
  82. package/link/index.d.ts +3 -1
  83. package/link/index.js +3 -1
  84. package/link/link.js +62 -24
  85. package/menu/index.d.ts +5 -2
  86. package/menu/index.js +5 -2
  87. package/menu/menu-item.js +66 -24
  88. package/menu/menu.js +189 -136
  89. package/menubar/index.d.ts +3 -1
  90. package/menubar/index.js +3 -1
  91. package/menubar/menubar.js +142 -91
  92. package/number-field/index.d.ts +3 -1
  93. package/number-field/index.js +3 -1
  94. package/number-field/number-field.js +277 -204
  95. package/package.json +5 -4
  96. package/popover/index.d.ts +9 -4
  97. package/popover/index.js +9 -4
  98. package/popover/popover-close.js +2 -2
  99. package/popover/popover-popup.js +126 -76
  100. package/popover/popover-trigger.js +2 -2
  101. package/popover/popover.js +181 -120
  102. package/portal/index.d.ts +3 -1
  103. package/portal/index.js +3 -1
  104. package/portal/portal.js +128 -86
  105. package/preview-card/index.d.ts +7 -3
  106. package/preview-card/index.js +7 -3
  107. package/preview-card/preview-card-popup.js +114 -66
  108. package/preview-card/preview-card-trigger.js +2 -2
  109. package/preview-card/preview-card.js +211 -142
  110. package/progress/index.d.ts +3 -1
  111. package/progress/index.js +3 -1
  112. package/progress/progress.js +91 -45
  113. package/radio/index.d.ts +5 -2
  114. package/radio/index.js +5 -2
  115. package/radio/radio-group.js +153 -90
  116. package/radio/radio.js +137 -94
  117. package/scroll-area/index.d.ts +3 -1
  118. package/scroll-area/index.js +3 -1
  119. package/scroll-area/scroll-area.js +382 -276
  120. package/select/index.d.ts +3 -1
  121. package/select/index.js +3 -1
  122. package/select/select.js +260 -203
  123. package/separator/index.d.ts +3 -1
  124. package/separator/index.js +3 -1
  125. package/separator/separator.js +60 -18
  126. package/sidebar/index.d.ts +27 -13
  127. package/sidebar/index.js +32 -13
  128. package/sidebar/sidebar-content.js +2 -2
  129. package/sidebar/sidebar-footer.js +2 -2
  130. package/sidebar/sidebar-group-label.js +2 -2
  131. package/sidebar/sidebar-group.js +2 -2
  132. package/sidebar/sidebar-header.js +2 -2
  133. package/sidebar/sidebar-inset.js +2 -2
  134. package/sidebar/sidebar-menu-button.js +118 -74
  135. package/sidebar/sidebar-menu-item.js +2 -2
  136. package/sidebar/sidebar-menu.js +2 -2
  137. package/sidebar/sidebar-provider.js +202 -129
  138. package/sidebar/sidebar-separator.js +2 -2
  139. package/sidebar/sidebar-trigger.js +2 -2
  140. package/sidebar/sidebar.js +150 -85
  141. package/slider/index.d.ts +3 -1
  142. package/slider/index.js +3 -1
  143. package/slider/slider.js +217 -159
  144. package/spinner/index.d.ts +3 -1
  145. package/spinner/index.js +3 -1
  146. package/spinner/spinner.js +70 -28
  147. package/switch/index.d.ts +3 -1
  148. package/switch/index.js +3 -1
  149. package/switch/switch.js +174 -111
  150. package/tabs/index.d.ts +11 -5
  151. package/tabs/index.js +11 -5
  152. package/tabs/tab.js +89 -47
  153. package/tabs/tabs-indicator.js +2 -2
  154. package/tabs/tabs-list.js +92 -54
  155. package/tabs/tabs-panel.js +90 -44
  156. package/tabs/tabs.js +130 -71
  157. package/textarea/index.d.ts +3 -1
  158. package/textarea/index.js +3 -1
  159. package/textarea/textarea.js +153 -95
  160. package/toggle/index.d.ts +5 -2
  161. package/toggle/index.js +5 -2
  162. package/toggle/toggle-group.js +184 -125
  163. package/toggle/toggle.js +131 -76
  164. package/toolbar/index.d.ts +3 -1
  165. package/toolbar/index.js +3 -1
  166. package/toolbar/toolbar.js +79 -33
  167. package/tooltip/index.d.ts +7 -3
  168. package/tooltip/index.js +7 -3
  169. package/tooltip/tooltip-popup.js +108 -60
  170. package/tooltip/tooltip-trigger.js +93 -55
  171. package/tooltip/tooltip.js +225 -154
  172. package/trunc/index.d.ts +3 -1
  173. package/trunc/index.js +3 -1
  174. package/trunc/trunc.js +78 -34
  175. package/accordion/register.d.ts +0 -1
  176. package/accordion/register.js +0 -8
  177. package/alert-dialog/register.d.ts +0 -1
  178. package/alert-dialog/register.js +0 -16
  179. package/avatar/register.d.ts +0 -1
  180. package/avatar/register.js +0 -4
  181. package/badge/register.d.ts +0 -1
  182. package/badge/register.js +0 -4
  183. package/breadcrumb/register.d.ts +0 -1
  184. package/breadcrumb/register.js +0 -14
  185. package/button/register.d.ts +0 -1
  186. package/button/register.js +0 -4
  187. package/calendar/register.d.ts +0 -1
  188. package/calendar/register.js +0 -4
  189. package/checkbox/register.d.ts +0 -1
  190. package/checkbox/register.js +0 -8
  191. package/collapsible/register.d.ts +0 -1
  192. package/collapsible/register.js +0 -4
  193. package/combobox/register.d.ts +0 -1
  194. package/combobox/register.js +0 -4
  195. package/command/register.d.ts +0 -1
  196. package/command/register.js +0 -22
  197. package/data-table/register.d.ts +0 -1
  198. package/data-table/register.js +0 -4
  199. package/dialog/register.d.ts +0 -1
  200. package/dialog/register.js +0 -16
  201. package/dropzone/register.d.ts +0 -1
  202. package/dropzone/register.js +0 -4
  203. package/icon/register.d.ts +0 -1
  204. package/icon/register.js +0 -4
  205. package/input/register.d.ts +0 -1
  206. package/input/register.js +0 -4
  207. package/link/register.d.ts +0 -1
  208. package/link/register.js +0 -4
  209. package/menu/register.d.ts +0 -1
  210. package/menu/register.js +0 -8
  211. package/menubar/register.d.ts +0 -1
  212. package/menubar/register.js +0 -4
  213. package/number-field/register.d.ts +0 -1
  214. package/number-field/register.js +0 -4
  215. package/popover/register.d.ts +0 -1
  216. package/popover/register.js +0 -16
  217. package/portal/register.d.ts +0 -1
  218. package/portal/register.js +0 -4
  219. package/preview-card/register.d.ts +0 -1
  220. package/preview-card/register.js +0 -12
  221. package/progress/register.d.ts +0 -1
  222. package/progress/register.js +0 -4
  223. package/radio/register.d.ts +0 -1
  224. package/radio/register.js +0 -8
  225. package/scroll-area/register.d.ts +0 -1
  226. package/scroll-area/register.js +0 -4
  227. package/select/register.d.ts +0 -1
  228. package/select/register.js +0 -4
  229. package/separator/register.d.ts +0 -1
  230. package/separator/register.js +0 -4
  231. package/sidebar/register.d.ts +0 -1
  232. package/sidebar/register.js +0 -52
  233. package/slider/register.d.ts +0 -1
  234. package/slider/register.js +0 -4
  235. package/spinner/register.d.ts +0 -1
  236. package/spinner/register.js +0 -4
  237. package/switch/register.d.ts +0 -1
  238. package/switch/register.js +0 -4
  239. package/tabs/register.d.ts +0 -1
  240. package/tabs/register.js +0 -10
  241. package/textarea/register.d.ts +0 -1
  242. package/textarea/register.js +0 -4
  243. package/toggle/register.d.ts +0 -1
  244. package/toggle/register.js +0 -8
  245. package/toolbar/register.d.ts +0 -1
  246. package/toolbar/register.js +0 -4
  247. package/tooltip/register.d.ts +0 -1
  248. package/tooltip/register.js +0 -12
  249. package/trunc/register.d.ts +0 -1
  250. package/trunc/register.js +0 -4
package/README.md ADDED
@@ -0,0 +1,191 @@
1
+ # DUI
2
+
3
+ [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
4
+ [![npm](https://img.shields.io/npm/v/@deepfuture/dui-core.svg)](https://www.npmjs.com/package/@deepfuture/dui-core)
5
+
6
+ Unstyled [Lit](https://lit.dev) web component library with composable themes.
7
+
8
+ Components provide structure and behavior with zero visual opinions. Themes provide all aesthetics — colors, spacing, typography, borders. Swap the theme to completely change the look without touching component code.
9
+
10
+ **[Live Docs & Demos →](https://deepfuturenow.github.io/dui/)**
11
+
12
+ ## Install
13
+
14
+ **npm / pnpm / yarn:**
15
+
16
+ ```bash
17
+ npm install @deepfuture/dui-core @deepfuture/dui-components @deepfuture/dui-theme-default
18
+ ```
19
+
20
+ **Deno:**
21
+
22
+ ```typescript
23
+ import { applyTheme } from "npm:@deepfuture/dui-core/apply-theme";
24
+ import { defaultTheme } from "npm:@deepfuture/dui-theme-default";
25
+ import { allComponents } from "npm:@deepfuture/dui-components/all";
26
+ ```
27
+
28
+ **CDN (zero setup):**
29
+
30
+ ```html
31
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@deepfuture/dui-cdn/dui.min.js"></script>
32
+ ```
33
+
34
+ ## Quick Start
35
+
36
+ ```typescript
37
+ import { applyTheme } from "@deepfuture/dui-core/apply-theme";
38
+ import { defaultTheme } from "@deepfuture/dui-theme-default";
39
+ import { DuiButton } from "@deepfuture/dui-components/button";
40
+ import { DuiDialog, DuiDialogTrigger, DuiDialogPopup, DuiDialogClose } from "@deepfuture/dui-components/dialog";
41
+
42
+ // Register components with a theme — this is the only setup needed
43
+ applyTheme({
44
+ theme: defaultTheme,
45
+ components: [DuiButton, DuiDialog, DuiDialogTrigger, DuiDialogPopup, DuiDialogClose],
46
+ });
47
+ ```
48
+
49
+ ```html
50
+ <dui-dialog>
51
+ <dui-dialog-trigger>
52
+ <dui-button>Open Dialog</dui-button>
53
+ </dui-dialog-trigger>
54
+ <dui-dialog-popup>
55
+ <h2>Hello</h2>
56
+ <p>This is a dialog.</p>
57
+ <dui-dialog-close>
58
+ <dui-button variant="outline">Close</dui-button>
59
+ </dui-dialog-close>
60
+ </dui-dialog-popup>
61
+ </dui-dialog>
62
+ ```
63
+
64
+ Or register everything at once:
65
+
66
+ ```typescript
67
+ import { applyTheme } from "@deepfuture/dui-core/apply-theme";
68
+ import { defaultTheme } from "@deepfuture/dui-theme-default";
69
+ import { allComponents } from "@deepfuture/dui-components/all";
70
+
71
+ applyTheme({ theme: defaultTheme, components: allComponents });
72
+ ```
73
+
74
+ ## How It Works
75
+
76
+ `applyTheme()` takes unstyled component classes and a theme, creates themed subclasses with composed styles, and registers them as custom elements.
77
+
78
+ ```
79
+ Component structural CSS → Theme base styles → Theme component styles
80
+ ```
81
+
82
+ No build step, no decorators, no code generation — just a function call. Components are standard web components that work in any framework or plain HTML.
83
+
84
+ ## Components
85
+
86
+ 43 component families, 85+ elements total.
87
+
88
+ | Category | Components |
89
+ |----------|-----------|
90
+ | **Actions** | Button, Link, Toggle, Toggle Group, Toolbar |
91
+ | **Forms** | Input, Textarea, Select, Combobox, Checkbox, Checkbox Group, Radio, Radio Group, Switch, Slider, Number Field, Dropzone |
92
+ | **Data Display** | Badge, Avatar, Calendar, Data Table, Progress, Spinner, Separator, Trunc |
93
+ | **Overlays** | Dialog, Alert Dialog, Popover, Tooltip, Menu, Menubar, Preview Card, Command |
94
+ | **Disclosure** | Accordion, Collapsible, Tabs |
95
+ | **Navigation** | Breadcrumb, Sidebar (with 12 sub-components) |
96
+ | **Layout** | HStack, VStack, Center, Page Inset, Scroll Area, Portal |
97
+ | **Utility** | Icon |
98
+
99
+ ## Styling
100
+
101
+ DUI uses a two-layer styling approach:
102
+
103
+ ### CSS Variables — for the variant system
104
+
105
+ Variables control values that variants, sizes, and states toggle:
106
+
107
+ ```css
108
+ /* Override variant colors */
109
+ dui-button {
110
+ --button-bg: linear-gradient(135deg, pink, purple);
111
+ --button-radius: var(--radius-full);
112
+ }
113
+ ```
114
+
115
+ ### `::part(root)` — for everything else
116
+
117
+ Every component exposes a `root` CSS part for full CSS expressiveness:
118
+
119
+ ```css
120
+ /* Frosted glass effect */
121
+ dui-dialog-popup::part(root) {
122
+ backdrop-filter: blur(12px);
123
+ }
124
+
125
+ /* Custom hover animation */
126
+ dui-button::part(root):hover {
127
+ filter: brightness(1.25);
128
+ transform: translateY(-1px);
129
+ }
130
+
131
+ /* Glow shadow */
132
+ dui-badge::part(root) {
133
+ box-shadow: 0 0 16px oklch(0.7 0.2 280 / 0.4);
134
+ }
135
+ ```
136
+
137
+ No need for the library to anticipate every CSS property — `::part()` gives you direct access.
138
+
139
+ ## Dark Mode
140
+
141
+ DUI uses CSS custom properties for theming. Toggle dark mode by adding `class="dark"` to a parent element:
142
+
143
+ ```html
144
+ <body class="dark">
145
+ <!-- All DUI components render in dark mode -->
146
+ </body>
147
+ ```
148
+
149
+ ## Packages
150
+
151
+ | Package | Purpose |
152
+ |---------|---------|
153
+ | [`@deepfuture/dui-core`](https://www.npmjs.com/package/@deepfuture/dui-core) | `applyTheme()`, event factory, base styles |
154
+ | [`@deepfuture/dui-components`](https://www.npmjs.com/package/@deepfuture/dui-components) | Unstyled component classes |
155
+ | [`@deepfuture/dui-theme-default`](https://www.npmjs.com/package/@deepfuture/dui-theme-default) | Design tokens + aesthetic styles |
156
+ | [`@deepfuture/dui-cdn`](https://www.npmjs.com/package/@deepfuture/dui-cdn) | Pre-bundled CDN build (all deps inlined) |
157
+
158
+ ## Dev Tools
159
+
160
+ ### Theme Editor
161
+
162
+ A visual editor for design tokens. Edit colors with OKLCH sliders, tweak spacing and typography, and export your customized `tokens.css`.
163
+
164
+ ### Inspector
165
+
166
+ A runtime inspector and mutation API for DUI components. Two interfaces:
167
+
168
+ - **Visual UI** (Ctrl+Shift+I) — hover-highlight components, inspect properties/tokens/styles, edit theme CSS and design tokens live
169
+ - **Console API** — `window.__dui_inspect()`, `window.__dui_mutate.*`, `window.__dui_export()` for programmatic access by agents or scripts
170
+
171
+ Both share a changelog, so agent and human edits are visible to each other. Changes can be exported as structured source file diffs.
172
+
173
+ See **[Inspector docs](docs/inspector.md)** for the full API reference and usage guide.
174
+
175
+ ## Documentation
176
+
177
+ - **[Live Docs](https://deepfuturenow.github.io/dui/)** — interactive demos for every component
178
+ - [Architecture](docs/architecture.md) — mental model, package responsibilities, design decisions
179
+ - [Creating Components](docs/creating-components.md) — guide for adding new components
180
+ - [Theming](docs/theming.md) — theme system, design tokens, writing component styles
181
+ - [Consuming](docs/consuming.md) — integrating DUI into an app
182
+ - [Inspector](docs/inspector.md) — runtime inspection, mutation API, and visual editor
183
+ - [Accessibility](docs/accessibility.md) — accessibility patterns and guidelines
184
+
185
+ ## Contributing
186
+
187
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for dev setup, code conventions, and PR guidelines.
188
+
189
+ ## License
190
+
191
+ [MIT](LICENSE)
@@ -25,8 +25,8 @@ const styles = css `
25
25
  * @csspart root - The centering container element.
26
26
  */
27
27
  export class DuiCenter extends LitElement {
28
- static { this.tagName = "dui-center"; }
29
- static { this.styles = [base, styles]; }
28
+ static tagName = "dui-center";
29
+ static styles = [base, styles];
30
30
  render() {
31
31
  return html `
32
32
  <div part="root">
@@ -1 +1,3 @@
1
- export { DuiCenter } from "./center.js";
1
+ import { DuiCenter } from "./center.js";
2
+ export { DuiCenter };
3
+ export declare const centerFamily: (typeof DuiCenter)[];
@@ -1 +1,3 @@
1
- export { DuiCenter } from "./center.js";
1
+ import { DuiCenter } from "./center.js";
2
+ export { DuiCenter };
3
+ export const centerFamily = [DuiCenter];
@@ -1,9 +1,37 @@
1
1
  /** Ported from original DUI: deep-future-app/app/client/components/dui/hstack */
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;
2
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
+ var _, done = false;
8
+ for (var i = decorators.length - 1; i >= 0; i--) {
9
+ var context = {};
10
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
+ if (kind === "accessor") {
15
+ if (result === void 0) continue;
16
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
+ if (_ = accept(result.get)) descriptor.get = _;
18
+ if (_ = accept(result.set)) descriptor.set = _;
19
+ if (_ = accept(result.init)) initializers.unshift(_);
20
+ }
21
+ else if (_ = accept(result)) {
22
+ if (kind === "field") initializers.unshift(_);
23
+ else descriptor[key] = _;
24
+ }
25
+ }
26
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
+ done = true;
28
+ };
29
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
+ var useValue = arguments.length > 2;
31
+ for (var i = 0; i < initializers.length; i++) {
32
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
+ }
34
+ return useValue ? value : void 0;
7
35
  };
8
36
  import { css, html, LitElement } from "lit";
9
37
  import { property } from "lit/decorators.js";
@@ -107,35 +135,53 @@ const styles = css `
107
135
  * @cssprop --hstack-align - Override align-items.
108
136
  * @cssprop --hstack-justify - Override justify-content.
109
137
  */
110
- export class DuiHstack extends LitElement {
111
- static { this.tagName = "dui-hstack"; }
112
- static { this.styles = [base, styles]; }
113
- #gap_accessor_storage = "4";
114
- /** Gap between stack items. Maps to space tokens. */
115
- get gap() { return this.#gap_accessor_storage; }
116
- set gap(value) { this.#gap_accessor_storage = value; }
117
- #align_accessor_storage = "center";
118
- /** Alignment of items on the cross axis. */
119
- get align() { return this.#align_accessor_storage; }
120
- set align(value) { this.#align_accessor_storage = value; }
121
- #justify_accessor_storage = "stretch";
122
- /** Justification of items on the main axis. */
123
- get justify() { return this.#justify_accessor_storage; }
124
- set justify(value) { this.#justify_accessor_storage = value; }
125
- render() {
126
- return html `
138
+ let DuiHstack = (() => {
139
+ let _classSuper = LitElement;
140
+ let _gap_decorators;
141
+ let _gap_initializers = [];
142
+ let _gap_extraInitializers = [];
143
+ let _align_decorators;
144
+ let _align_initializers = [];
145
+ let _align_extraInitializers = [];
146
+ let _justify_decorators;
147
+ let _justify_initializers = [];
148
+ let _justify_extraInitializers = [];
149
+ return class DuiHstack extends _classSuper {
150
+ static {
151
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
152
+ _gap_decorators = [property({ reflect: true })];
153
+ _align_decorators = [property({ reflect: true })];
154
+ _justify_decorators = [property({ reflect: true })];
155
+ __esDecorate(this, null, _gap_decorators, { kind: "accessor", name: "gap", static: false, private: false, access: { has: obj => "gap" in obj, get: obj => obj.gap, set: (obj, value) => { obj.gap = value; } }, metadata: _metadata }, _gap_initializers, _gap_extraInitializers);
156
+ __esDecorate(this, null, _align_decorators, { kind: "accessor", name: "align", static: false, private: false, access: { has: obj => "align" in obj, get: obj => obj.align, set: (obj, value) => { obj.align = value; } }, metadata: _metadata }, _align_initializers, _align_extraInitializers);
157
+ __esDecorate(this, null, _justify_decorators, { kind: "accessor", name: "justify", static: false, private: false, access: { has: obj => "justify" in obj, get: obj => obj.justify, set: (obj, value) => { obj.justify = value; } }, metadata: _metadata }, _justify_initializers, _justify_extraInitializers);
158
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
159
+ }
160
+ static tagName = "dui-hstack";
161
+ static styles = [base, styles];
162
+ #gap_accessor_storage = __runInitializers(this, _gap_initializers, "4");
163
+ /** Gap between stack items. Maps to space tokens. */
164
+ get gap() { return this.#gap_accessor_storage; }
165
+ set gap(value) { this.#gap_accessor_storage = value; }
166
+ #align_accessor_storage = (__runInitializers(this, _gap_extraInitializers), __runInitializers(this, _align_initializers, "center"));
167
+ /** Alignment of items on the cross axis. */
168
+ get align() { return this.#align_accessor_storage; }
169
+ set align(value) { this.#align_accessor_storage = value; }
170
+ #justify_accessor_storage = (__runInitializers(this, _align_extraInitializers), __runInitializers(this, _justify_initializers, "stretch"));
171
+ /** Justification of items on the main axis. */
172
+ get justify() { return this.#justify_accessor_storage; }
173
+ set justify(value) { this.#justify_accessor_storage = value; }
174
+ render() {
175
+ return html `
127
176
  <div part="root">
128
177
  <slot></slot>
129
178
  </div>
130
179
  `;
131
- }
132
- }
133
- __decorate([
134
- property({ reflect: true })
135
- ], DuiHstack.prototype, "gap", null);
136
- __decorate([
137
- property({ reflect: true })
138
- ], DuiHstack.prototype, "align", null);
139
- __decorate([
140
- property({ reflect: true })
141
- ], DuiHstack.prototype, "justify", null);
180
+ }
181
+ constructor() {
182
+ super(...arguments);
183
+ __runInitializers(this, _justify_extraInitializers);
184
+ }
185
+ };
186
+ })();
187
+ export { DuiHstack };
@@ -1,2 +1,4 @@
1
- export { DuiHstack } from "./hstack.js";
1
+ import { DuiHstack } from "./hstack.js";
2
+ export { DuiHstack };
2
3
  export type { HstackAlignment, HstackJustify } from "./hstack.js";
4
+ export declare const hstackFamily: (typeof DuiHstack)[];
@@ -1 +1,3 @@
1
- export { DuiHstack } from "./hstack.js";
1
+ import { DuiHstack } from "./hstack.js";
2
+ export { DuiHstack };
3
+ export const hstackFamily = [DuiHstack];
@@ -1 +1,3 @@
1
- export { DuiPageInset } from "./page-inset.js";
1
+ import { DuiPageInset } from "./page-inset.js";
2
+ export { DuiPageInset };
3
+ export declare const pageInsetFamily: (typeof DuiPageInset)[];
@@ -1 +1,3 @@
1
- export { DuiPageInset } from "./page-inset.js";
1
+ import { DuiPageInset } from "./page-inset.js";
2
+ export { DuiPageInset };
3
+ export const pageInsetFamily = [DuiPageInset];
@@ -1,9 +1,37 @@
1
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;
2
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
3
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
4
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
6
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
7
+ var _, done = false;
8
+ for (var i = decorators.length - 1; i >= 0; i--) {
9
+ var context = {};
10
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
11
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
12
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
13
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
14
+ if (kind === "accessor") {
15
+ if (result === void 0) continue;
16
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
17
+ if (_ = accept(result.get)) descriptor.get = _;
18
+ if (_ = accept(result.set)) descriptor.set = _;
19
+ if (_ = accept(result.init)) initializers.unshift(_);
20
+ }
21
+ else if (_ = accept(result)) {
22
+ if (kind === "field") initializers.unshift(_);
23
+ else descriptor[key] = _;
24
+ }
25
+ }
26
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
27
+ done = true;
28
+ };
29
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
30
+ var useValue = arguments.length > 2;
31
+ for (var i = 0; i < initializers.length; i++) {
32
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
33
+ }
34
+ return useValue ? value : void 0;
7
35
  };
8
36
  import { css, html, LitElement } from "lit";
9
37
  import { property } from "lit/decorators.js";
@@ -44,60 +72,80 @@ const styles = css `
44
72
  * @cssprop --page-inset-max-width - Max width of inner content (default: 48rem).
45
73
  * @cssprop --page-inset-min-width - Min width of inner content (default: auto).
46
74
  */
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 `
75
+ let DuiPageInset = (() => {
76
+ let _classSuper = LitElement;
77
+ let _maxWidth_decorators;
78
+ let _maxWidth_initializers = [];
79
+ let _maxWidth_extraInitializers = [];
80
+ let _minWidth_decorators;
81
+ let _minWidth_initializers = [];
82
+ let _minWidth_extraInitializers = [];
83
+ let _padX_decorators;
84
+ let _padX_initializers = [];
85
+ let _padX_extraInitializers = [];
86
+ let _padY_decorators;
87
+ let _padY_initializers = [];
88
+ let _padY_extraInitializers = [];
89
+ return class DuiPageInset extends _classSuper {
90
+ static {
91
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
92
+ _maxWidth_decorators = [property({ attribute: "max-width" })];
93
+ _minWidth_decorators = [property({ attribute: "min-width" })];
94
+ _padX_decorators = [property({ attribute: "pad-x" })];
95
+ _padY_decorators = [property({ attribute: "pad-y" })];
96
+ __esDecorate(this, null, _maxWidth_decorators, { kind: "accessor", name: "maxWidth", static: false, private: false, access: { has: obj => "maxWidth" in obj, get: obj => obj.maxWidth, set: (obj, value) => { obj.maxWidth = value; } }, metadata: _metadata }, _maxWidth_initializers, _maxWidth_extraInitializers);
97
+ __esDecorate(this, null, _minWidth_decorators, { kind: "accessor", name: "minWidth", static: false, private: false, access: { has: obj => "minWidth" in obj, get: obj => obj.minWidth, set: (obj, value) => { obj.minWidth = value; } }, metadata: _metadata }, _minWidth_initializers, _minWidth_extraInitializers);
98
+ __esDecorate(this, null, _padX_decorators, { kind: "accessor", name: "padX", static: false, private: false, access: { has: obj => "padX" in obj, get: obj => obj.padX, set: (obj, value) => { obj.padX = value; } }, metadata: _metadata }, _padX_initializers, _padX_extraInitializers);
99
+ __esDecorate(this, null, _padY_decorators, { kind: "accessor", name: "padY", static: false, private: false, access: { has: obj => "padY" in obj, get: obj => obj.padY, set: (obj, value) => { obj.padY = value; } }, metadata: _metadata }, _padY_initializers, _padY_extraInitializers);
100
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
101
+ }
102
+ static tagName = "dui-page-inset";
103
+ static styles = [base, styles];
104
+ #maxWidth_accessor_storage = __runInitializers(this, _maxWidth_initializers, void 0);
105
+ /** Maximum width of the inner content area. Overrides --page-inset-max-width. */
106
+ get maxWidth() { return this.#maxWidth_accessor_storage; }
107
+ set maxWidth(value) { this.#maxWidth_accessor_storage = value; }
108
+ #minWidth_accessor_storage = (__runInitializers(this, _maxWidth_extraInitializers), __runInitializers(this, _minWidth_initializers, void 0));
109
+ /** Minimum width of the inner content area. Overrides --page-inset-min-width. */
110
+ get minWidth() { return this.#minWidth_accessor_storage; }
111
+ set minWidth(value) { this.#minWidth_accessor_storage = value; }
112
+ #padX_accessor_storage = (__runInitializers(this, _minWidth_extraInitializers), __runInitializers(this, _padX_initializers, void 0));
113
+ /** Horizontal padding. Overrides --page-inset-pad-x. */
114
+ get padX() { return this.#padX_accessor_storage; }
115
+ set padX(value) { this.#padX_accessor_storage = value; }
116
+ #padY_accessor_storage = (__runInitializers(this, _padX_extraInitializers), __runInitializers(this, _padY_initializers, void 0));
117
+ /** Vertical padding. Overrides --page-inset-pad-y. */
118
+ get padY() { return this.#padY_accessor_storage; }
119
+ set padY(value) { this.#padY_accessor_storage = value; }
120
+ #setOrRemove(prop, value) {
121
+ if (value)
122
+ this.style.setProperty(prop, value);
123
+ else
124
+ this.style.removeProperty(prop);
125
+ }
126
+ willUpdate(changed) {
127
+ if (changed.has("maxWidth"))
128
+ this.#setOrRemove("--page-inset-max-width", this.maxWidth);
129
+ if (changed.has("minWidth"))
130
+ this.#setOrRemove("--page-inset-min-width", this.minWidth);
131
+ if (changed.has("padX"))
132
+ this.#setOrRemove("--page-inset-pad-x", this.padX);
133
+ if (changed.has("padY"))
134
+ this.#setOrRemove("--page-inset-pad-y", this.padY);
135
+ }
136
+ render() {
137
+ return html `
84
138
  <div part="root">
85
139
  <div part="inner">
86
140
  <slot></slot>
87
141
  </div>
88
142
  </div>
89
143
  `;
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);
144
+ }
145
+ constructor() {
146
+ super(...arguments);
147
+ __runInitializers(this, _padY_extraInitializers);
148
+ }
149
+ };
150
+ })();
151
+ export { DuiPageInset };
@@ -1 +1,3 @@
1
- export { DuiVstack } from "./vstack.js";
1
+ import { DuiVstack } from "./vstack.js";
2
+ export { DuiVstack };
3
+ export declare const vstackFamily: (typeof DuiVstack)[];
@@ -1 +1,3 @@
1
- export { DuiVstack } from "./vstack.js";
1
+ import { DuiVstack } from "./vstack.js";
2
+ export { DuiVstack };
3
+ export const vstackFamily = [DuiVstack];