@deepfuture/dui-components 0.0.20 → 1.0.0

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 (333) hide show
  1. package/README.md +56 -65
  2. package/_install.js +11 -0
  3. package/accordion/accordion-item.d.ts +3 -20
  4. package/accordion/accordion-item.js +93 -292
  5. package/accordion/accordion.d.ts +3 -18
  6. package/accordion/accordion.js +9 -247
  7. package/accordion/index.d.ts +6 -6
  8. package/accordion/index.js +5 -5
  9. package/alert-dialog/alert-dialog-close.d.ts +3 -14
  10. package/alert-dialog/alert-dialog-close.js +4 -34
  11. package/alert-dialog/alert-dialog-popup.d.ts +3 -32
  12. package/alert-dialog/alert-dialog-popup.js +68 -317
  13. package/alert-dialog/alert-dialog-trigger.d.ts +3 -14
  14. package/alert-dialog/alert-dialog-trigger.js +4 -51
  15. package/alert-dialog/alert-dialog.d.ts +3 -30
  16. package/alert-dialog/alert-dialog.js +8 -158
  17. package/alert-dialog/index.d.ts +11 -11
  18. package/alert-dialog/index.js +9 -9
  19. package/all.d.ts +159 -123
  20. package/all.js +134 -231
  21. package/avatar/avatar.d.ts +3 -39
  22. package/avatar/avatar.js +18 -238
  23. package/avatar/index.d.ts +4 -4
  24. package/avatar/index.js +3 -3
  25. package/badge/badge.d.ts +3 -10
  26. package/badge/badge.js +88 -22
  27. package/badge/index.d.ts +2 -3
  28. package/badge/index.js +2 -3
  29. package/breadcrumb/breadcrumb-ellipsis.d.ts +3 -12
  30. package/breadcrumb/breadcrumb-ellipsis.js +8 -34
  31. package/breadcrumb/breadcrumb-item.d.ts +3 -11
  32. package/breadcrumb/breadcrumb-item.js +7 -26
  33. package/breadcrumb/breadcrumb-link.d.ts +3 -12
  34. package/breadcrumb/breadcrumb-link.js +16 -26
  35. package/breadcrumb/breadcrumb-page.d.ts +3 -11
  36. package/breadcrumb/breadcrumb-page.js +8 -31
  37. package/breadcrumb/breadcrumb-separator.d.ts +3 -12
  38. package/breadcrumb/breadcrumb-separator.js +8 -31
  39. package/breadcrumb/breadcrumb.d.ts +3 -12
  40. package/breadcrumb/breadcrumb.js +10 -33
  41. package/breadcrumb/index.d.ts +12 -13
  42. package/breadcrumb/index.js +12 -13
  43. package/button/button.d.ts +3 -32
  44. package/button/button.js +221 -165
  45. package/button/index.d.ts +3 -3
  46. package/button/index.js +3 -3
  47. package/calendar/calendar.d.ts +3 -31
  48. package/calendar/calendar.js +71 -481
  49. package/calendar/index.d.ts +3 -3
  50. package/calendar/index.js +3 -3
  51. package/card/card.d.ts +3 -27
  52. package/card/card.js +80 -163
  53. package/card/index.d.ts +2 -3
  54. package/card/index.js +2 -3
  55. package/card-grid/card-grid.d.ts +3 -15
  56. package/card-grid/card-grid.js +8 -106
  57. package/card-grid/index.d.ts +2 -3
  58. package/card-grid/index.js +2 -3
  59. package/checkbox/checkbox-group.d.ts +3 -34
  60. package/checkbox/checkbox-group.js +11 -188
  61. package/checkbox/checkbox.d.ts +3 -47
  62. package/checkbox/checkbox.js +43 -341
  63. package/checkbox/index.d.ts +6 -6
  64. package/checkbox/index.js +5 -5
  65. package/collapsible/collapsible.d.ts +3 -20
  66. package/collapsible/collapsible.js +83 -277
  67. package/collapsible/index.d.ts +3 -3
  68. package/collapsible/index.js +3 -3
  69. package/combobox/combobox.d.ts +3 -47
  70. package/combobox/combobox.js +136 -538
  71. package/combobox/index.d.ts +4 -4
  72. package/combobox/index.js +3 -3
  73. package/command/command-empty.d.ts +3 -8
  74. package/command/command-empty.js +10 -88
  75. package/command/command-group.d.ts +3 -13
  76. package/command/command-group.js +15 -114
  77. package/command/command-input.d.ts +3 -11
  78. package/command/command-input.js +20 -136
  79. package/command/command-item.d.ts +3 -18
  80. package/command/command-item.js +24 -212
  81. package/command/command-list.d.ts +3 -7
  82. package/command/command-list.js +11 -79
  83. package/command/command-separator.d.ts +3 -5
  84. package/command/command-separator.js +10 -11
  85. package/command/command-shortcut.d.ts +3 -5
  86. package/command/command-shortcut.js +9 -12
  87. package/command/command.d.ts +3 -23
  88. package/command/command.js +10 -339
  89. package/command/index.d.ts +17 -19
  90. package/command/index.js +16 -18
  91. package/data-table/data-table.d.ts +3 -57
  92. package/data-table/data-table.js +86 -449
  93. package/data-table/index.d.ts +3 -4
  94. package/data-table/index.js +2 -3
  95. package/dialog/dialog-close.d.ts +3 -14
  96. package/dialog/dialog-close.js +4 -34
  97. package/dialog/dialog-popup.d.ts +3 -34
  98. package/dialog/dialog-popup.js +70 -336
  99. package/dialog/dialog-trigger.d.ts +3 -14
  100. package/dialog/dialog-trigger.js +4 -51
  101. package/dialog/dialog.d.ts +3 -30
  102. package/dialog/dialog.js +8 -158
  103. package/dialog/index.d.ts +11 -11
  104. package/dialog/index.js +9 -9
  105. package/dropzone/dropzone.d.ts +3 -72
  106. package/dropzone/dropzone.js +29 -407
  107. package/dropzone/index.d.ts +4 -4
  108. package/dropzone/index.js +3 -3
  109. package/field/field.d.ts +3 -30
  110. package/field/field.js +34 -353
  111. package/field/index.d.ts +1 -0
  112. package/field/index.js +1 -0
  113. package/fieldset/fieldset.d.ts +3 -18
  114. package/fieldset/fieldset.js +21 -110
  115. package/fieldset/index.d.ts +1 -0
  116. package/fieldset/index.js +1 -0
  117. package/icon/icon.d.ts +3 -15
  118. package/icon/icon.js +4 -33
  119. package/icon/index.d.ts +2 -3
  120. package/icon/index.js +2 -3
  121. package/input/index.d.ts +3 -3
  122. package/input/index.js +3 -3
  123. package/input/input.d.ts +3 -49
  124. package/input/input.js +57 -238
  125. package/menu/index.d.ts +4 -5
  126. package/menu/index.js +4 -5
  127. package/menu/menu-item.d.ts +3 -13
  128. package/menu/menu-item.js +41 -91
  129. package/menu/menu.d.ts +3 -15
  130. package/menu/menu.js +27 -277
  131. package/menubar/index.d.ts +3 -4
  132. package/menubar/index.js +2 -3
  133. package/menubar/menubar.d.ts +3 -19
  134. package/menubar/menubar.js +12 -183
  135. package/number-field/index.d.ts +3 -3
  136. package/number-field/index.js +3 -3
  137. package/number-field/number-field.d.ts +3 -55
  138. package/number-field/number-field.js +205 -698
  139. package/package.json +126 -113
  140. package/popover/index.d.ts +11 -11
  141. package/popover/index.js +9 -9
  142. package/popover/popover-close.d.ts +3 -12
  143. package/popover/popover-close.js +4 -32
  144. package/popover/popover-popup.d.ts +3 -18
  145. package/popover/popover-popup.js +28 -205
  146. package/popover/popover-trigger.d.ts +3 -13
  147. package/popover/popover-trigger.js +4 -73
  148. package/popover/popover.d.ts +3 -29
  149. package/popover/popover.js +8 -207
  150. package/portal/index.d.ts +3 -4
  151. package/portal/index.js +2 -3
  152. package/portal/portal.d.ts +3 -27
  153. package/portal/portal.js +8 -157
  154. package/preview-card/index.d.ts +9 -9
  155. package/preview-card/index.js +7 -7
  156. package/preview-card/preview-card-popup.d.ts +3 -14
  157. package/preview-card/preview-card-popup.js +29 -193
  158. package/preview-card/preview-card-trigger.d.ts +3 -12
  159. package/preview-card/preview-card-trigger.js +4 -74
  160. package/preview-card/preview-card.d.ts +3 -33
  161. package/preview-card/preview-card.js +8 -239
  162. package/progress/index.d.ts +2 -3
  163. package/progress/index.js +2 -3
  164. package/progress/progress.d.ts +3 -17
  165. package/progress/progress.js +28 -130
  166. package/radio/index.d.ts +6 -6
  167. package/radio/index.js +5 -5
  168. package/radio/radio-group.d.ts +3 -37
  169. package/radio/radio-group.js +8 -200
  170. package/radio/radio.d.ts +3 -28
  171. package/radio/radio.js +38 -213
  172. package/scroll-area/index.d.ts +2 -3
  173. package/scroll-area/index.js +2 -3
  174. package/scroll-area/scroll-area.d.ts +3 -36
  175. package/scroll-area/scroll-area.js +25 -546
  176. package/select/index.d.ts +3 -4
  177. package/select/index.js +2 -3
  178. package/select/select.d.ts +3 -37
  179. package/select/select.js +115 -403
  180. package/separator/index.d.ts +2 -3
  181. package/separator/index.js +2 -3
  182. package/separator/separator.d.ts +3 -10
  183. package/separator/separator.js +23 -84
  184. package/sidebar/index.d.ts +29 -29
  185. package/sidebar/index.js +27 -32
  186. package/sidebar/sidebar-content.d.ts +3 -12
  187. package/sidebar/sidebar-content.js +7 -29
  188. package/sidebar/sidebar-footer.d.ts +3 -10
  189. package/sidebar/sidebar-footer.js +7 -20
  190. package/sidebar/sidebar-group-label.d.ts +3 -15
  191. package/sidebar/sidebar-group-label.js +17 -41
  192. package/sidebar/sidebar-group.d.ts +3 -13
  193. package/sidebar/sidebar-group.js +7 -24
  194. package/sidebar/sidebar-header.d.ts +3 -10
  195. package/sidebar/sidebar-header.js +7 -16
  196. package/sidebar/sidebar-inset.d.ts +3 -13
  197. package/sidebar/sidebar-inset.js +7 -28
  198. package/sidebar/sidebar-menu-button.d.ts +3 -26
  199. package/sidebar/sidebar-menu-button.js +60 -217
  200. package/sidebar/sidebar-menu-item.d.ts +3 -10
  201. package/sidebar/sidebar-menu-item.js +7 -19
  202. package/sidebar/sidebar-menu.d.ts +3 -12
  203. package/sidebar/sidebar-menu.js +7 -25
  204. package/sidebar/sidebar-provider.d.ts +3 -34
  205. package/sidebar/sidebar-provider.js +22 -232
  206. package/sidebar/sidebar-separator.d.ts +3 -10
  207. package/sidebar/sidebar-separator.js +9 -19
  208. package/sidebar/sidebar-trigger.d.ts +3 -14
  209. package/sidebar/sidebar-trigger.js +10 -46
  210. package/sidebar/sidebar.d.ts +3 -19
  211. package/sidebar/sidebar.js +65 -262
  212. package/slider/index.d.ts +3 -3
  213. package/slider/index.js +3 -3
  214. package/slider/slider.d.ts +3 -45
  215. package/slider/slider.js +97 -382
  216. package/spinner/index.d.ts +2 -3
  217. package/spinner/index.js +2 -3
  218. package/spinner/spinner.d.ts +3 -11
  219. package/spinner/spinner.js +20 -163
  220. package/split-button/index.d.ts +3 -1
  221. package/split-button/index.js +3 -1
  222. package/split-button/split-button.d.ts +3 -31
  223. package/split-button/split-button.js +307 -384
  224. package/stepper/index.d.ts +3 -3
  225. package/stepper/index.js +3 -3
  226. package/stepper/stepper.d.ts +3 -41
  227. package/stepper/stepper.js +57 -381
  228. package/switch/index.d.ts +3 -3
  229. package/switch/index.js +3 -3
  230. package/switch/switch.d.ts +3 -30
  231. package/switch/switch.js +63 -228
  232. package/tabs/index.d.ts +12 -12
  233. package/tabs/index.js +11 -11
  234. package/tabs/tab.d.ts +3 -14
  235. package/tabs/tab.js +33 -131
  236. package/tabs/tabs-indicator.d.ts +3 -9
  237. package/tabs/tabs-indicator.js +17 -22
  238. package/tabs/tabs-list.d.ts +3 -15
  239. package/tabs/tabs-list.js +14 -113
  240. package/tabs/tabs-panel.d.ts +3 -16
  241. package/tabs/tabs-panel.js +32 -114
  242. package/tabs/tabs.d.ts +3 -22
  243. package/tabs/tabs.js +8 -170
  244. package/textarea/index.d.ts +4 -4
  245. package/textarea/index.js +3 -3
  246. package/textarea/textarea.d.ts +3 -36
  247. package/textarea/textarea.js +63 -220
  248. package/toggle/index.d.ts +6 -6
  249. package/toggle/index.js +5 -5
  250. package/toggle/toggle-group.d.ts +3 -27
  251. package/toggle/toggle-group.js +9 -224
  252. package/toggle/toggle.d.ts +3 -26
  253. package/toggle/toggle.js +94 -178
  254. package/tokens/properties.css +361 -0
  255. package/tokens/prose.css +250 -0
  256. package/tokens/prose.d.ts +2 -0
  257. package/tokens/prose.js +4 -0
  258. package/tokens/tokens-raw.d.ts +2 -0
  259. package/tokens/tokens-raw.js +2 -0
  260. package/tokens/tokens.css +409 -0
  261. package/tokens/tokens.d.ts +2 -0
  262. package/tokens/tokens.js +5 -0
  263. package/toolbar/index.d.ts +2 -3
  264. package/toolbar/index.js +2 -3
  265. package/toolbar/toolbar.d.ts +3 -11
  266. package/toolbar/toolbar.js +25 -116
  267. package/tooltip/index.d.ts +9 -9
  268. package/tooltip/index.js +7 -7
  269. package/tooltip/tooltip-popup.d.ts +3 -14
  270. package/tooltip/tooltip-popup.js +32 -185
  271. package/tooltip/tooltip-trigger.d.ts +3 -14
  272. package/tooltip/tooltip-trigger.js +5 -148
  273. package/tooltip/tooltip.d.ts +3 -35
  274. package/tooltip/tooltip.js +8 -253
  275. package/trunc/index.d.ts +2 -3
  276. package/trunc/index.js +2 -3
  277. package/trunc/trunc.d.ts +3 -17
  278. package/trunc/trunc.js +10 -108
  279. package/_deprecated/center/center.d.ts +0 -14
  280. package/_deprecated/center/center.js +0 -37
  281. package/_deprecated/center/index.d.ts +0 -3
  282. package/_deprecated/center/index.js +0 -3
  283. package/_deprecated/center/register.js +0 -4
  284. package/_deprecated/hstack/hstack.d.ts +0 -25
  285. package/_deprecated/hstack/hstack.js +0 -187
  286. package/_deprecated/hstack/index.d.ts +0 -4
  287. package/_deprecated/hstack/index.js +0 -3
  288. package/_deprecated/hstack/register.d.ts +0 -1
  289. package/_deprecated/hstack/register.js +0 -4
  290. package/_deprecated/page-inset/index.d.ts +0 -3
  291. package/_deprecated/page-inset/index.js +0 -3
  292. package/_deprecated/page-inset/page-inset.d.ts +0 -28
  293. package/_deprecated/page-inset/page-inset.js +0 -151
  294. package/_deprecated/page-inset/register.d.ts +0 -1
  295. package/_deprecated/page-inset/register.js +0 -4
  296. package/_deprecated/vstack/index.d.ts +0 -3
  297. package/_deprecated/vstack/index.js +0 -3
  298. package/_deprecated/vstack/register.d.ts +0 -1
  299. package/_deprecated/vstack/register.js +0 -4
  300. package/_deprecated/vstack/vstack.d.ts +0 -17
  301. package/_deprecated/vstack/vstack.js +0 -125
  302. package/accordion/accordion-context.d.ts +0 -15
  303. package/accordion/accordion-context.js +0 -3
  304. package/alert-dialog/alert-dialog-context.d.ts +0 -13
  305. package/alert-dialog/alert-dialog-context.js +0 -3
  306. package/checkbox/checkbox-group-context.d.ts +0 -11
  307. package/checkbox/checkbox-group-context.js +0 -3
  308. package/command/command-context.d.ts +0 -30
  309. package/command/command-context.js +0 -3
  310. package/command/command-score.d.ts +0 -6
  311. package/command/command-score.js +0 -31
  312. package/dialog/dialog-context.d.ts +0 -13
  313. package/dialog/dialog-context.js +0 -3
  314. package/global.d.ts +0 -179
  315. package/menubar/menubar-context.d.ts +0 -9
  316. package/menubar/menubar-context.js +0 -2
  317. package/popover/popover-context.d.ts +0 -17
  318. package/popover/popover-context.js +0 -3
  319. package/preview-card/preview-card-context.d.ts +0 -16
  320. package/preview-card/preview-card-context.js +0 -3
  321. package/radio/radio-group-context.d.ts +0 -11
  322. package/radio/radio-group-context.js +0 -2
  323. package/sidebar/sidebar-context.d.ts +0 -15
  324. package/sidebar/sidebar-context.js +0 -3
  325. package/split-button/register.d.ts +0 -1
  326. package/split-button/register.js +0 -4
  327. package/tabs/tabs-context.d.ts +0 -8
  328. package/tabs/tabs-context.js +0 -2
  329. package/toggle/toggle-group-context.d.ts +0 -9
  330. package/toggle/toggle-group-context.js +0 -2
  331. package/tooltip/tooltip-context.d.ts +0 -17
  332. package/tooltip/tooltip-context.js +0 -3
  333. /package/{_deprecated/center/register.d.ts → _install.d.ts} +0 -0
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # DUI
2
2
 
3
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)
4
+ [![npm](https://img.shields.io/npm/v/@deepfuture/dui-components.svg)](https://www.npmjs.com/package/@deepfuture/dui-components)
5
5
 
6
- Unstyled [Lit](https://lit.dev) web component library with composable themes.
6
+ Styled [Lit](https://lit.dev) web component library built on [dui-primitives](https://github.com/deepfuturenow/dui-primitives).
7
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.
8
+ DUI extends unstyled, accessible primitive components with a complete design system design tokens, variant systems, and aesthetic CSS. Import a component and it's ready to use. No setup, no configuration.
9
9
 
10
10
  **[Live Docs & Demos →](https://deepfuturenow.github.io/dui/)**
11
11
 
@@ -14,15 +14,7 @@ Components provide structure and behavior with zero visual opinions. Themes prov
14
14
  **npm / pnpm / yarn:**
15
15
 
16
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";
17
+ npm install @deepfuture/dui-components
26
18
  ```
27
19
 
28
20
  **CDN (zero setup):**
@@ -33,17 +25,11 @@ import { allComponents } from "npm:@deepfuture/dui-components/all";
33
25
 
34
26
  ## Quick Start
35
27
 
28
+ Import the components you need — they self-register on import:
29
+
36
30
  ```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
- });
31
+ import "@deepfuture/dui-components/button";
32
+ import "@deepfuture/dui-components/dialog";
47
33
  ```
48
34
 
49
35
  ```html
@@ -55,7 +41,7 @@ applyTheme({
55
41
  <h2>Hello</h2>
56
42
  <p>This is a dialog.</p>
57
43
  <dui-dialog-close>
58
- <dui-button variant="outline">Close</dui-button>
44
+ <dui-button appearance="outline">Close</dui-button>
59
45
  </dui-dialog-close>
60
46
  </dui-dialog-popup>
61
47
  </dui-dialog>
@@ -64,22 +50,25 @@ applyTheme({
64
50
  Or register everything at once:
65
51
 
66
52
  ```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 });
53
+ import "@deepfuture/dui-components";
72
54
  ```
73
55
 
74
56
  ## How It Works
75
57
 
76
- `applyTheme()` takes unstyled component classes and a theme, creates themed subclasses with composed styles, and registers them as custom elements.
58
+ DUI uses a two-layer inheritance model:
59
+
60
+ 1. **Primitives** (`@dui/primitives`) — unstyled base classes with accessibility, keyboard behavior, and ARIA built in
61
+ 2. **Components** (`@dui/components`) — extend primitives with design tokens, variant systems, and aesthetic CSS
62
+
63
+ Each component self-registers via `customElements.define()` when imported. Design tokens are automatically injected into `document.adoptedStyleSheets` on first import.
77
64
 
78
65
  ```
79
- Component structural CSS → Theme base styles → Theme component styles
66
+ DuiButtonPrimitive (structure, ARIA, keyboard)
67
+ ↓ extends
68
+ DuiButton (tokens, variants, aesthetic CSS, customElements.define())
80
69
  ```
81
70
 
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.
71
+ No build step, no setup function, no configuration — just import and use.
83
72
 
84
73
  ## Components
85
74
 
@@ -87,18 +76,18 @@ No build step, no decorators, no code generation — just a function call. Compo
87
76
 
88
77
  | Category | Components |
89
78
  |----------|-----------|
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 |
79
+ | **Actions** | Button, Toggle, Toggle Group, Toolbar, Split Button |
80
+ | **Forms** | Input, Textarea, Select, Combobox, Checkbox, Radio, Switch, Slider, Number Field, Dropzone, Field, Fieldset |
92
81
  | **Data Display** | Badge, Avatar, Calendar, Data Table, Progress, Spinner, Separator, Trunc |
93
82
  | **Overlays** | Dialog, Alert Dialog, Popover, Tooltip, Menu, Menubar, Preview Card, Command |
94
83
  | **Disclosure** | Accordion, Collapsible, Tabs |
95
- | **Navigation** | Breadcrumb, Sidebar (with 12 sub-components) |
96
- | **Layout** | HStack, VStack, Center, Page Inset, Scroll Area, Portal |
84
+ | **Navigation** | Breadcrumb, Sidebar (with 12 sub-components), Stepper |
85
+ | **Layout** | Card, Card Grid, Scroll Area, Portal |
97
86
  | **Utility** | Icon |
98
87
 
99
88
  ## Styling
100
89
 
101
- DUI uses a two-layer styling approach:
90
+ DUI uses a two-layer approach to styling:
102
91
 
103
92
  ### CSS Variables — for the variant system
104
93
 
@@ -138,29 +127,24 @@ No need for the library to anticipate every CSS property — `::part()` gives yo
138
127
 
139
128
  ## Dark Mode
140
129
 
141
- DUI uses CSS custom properties for theming. Toggle dark mode by adding `class="dark"` to a parent element:
130
+ Toggle dark mode by setting `data-theme="dark"` on the `<html>` element:
142
131
 
143
132
  ```html
144
- <body class="dark">
133
+ <html data-theme="dark">
145
134
  <!-- All DUI components render in dark mode -->
146
- </body>
135
+ </html>
147
136
  ```
148
137
 
149
138
  ## Templates
150
139
 
151
- Pre-composed UI patterns built from DUI components — ready-to-use cards, feed items, and other building blocks. Templates are theme-scoped: they use the default theme's variant vocabulary and tokens, so they adapt automatically to dark mode and custom token overrides.
140
+ Pre-composed UI patterns built from DUI components — ready-to-use cards, feed items, and other building blocks. Templates adapt automatically to dark mode and token overrides.
152
141
 
153
142
  ```bash
154
- npm install @deepfuture/dui-theme-default-templates
143
+ npm install @deepfuture/dui-templates
155
144
  ```
156
145
 
157
146
  ```typescript
158
- import { DuiFeedItem } from "@deepfuture/dui-theme-default-templates/feed";
159
-
160
- applyTheme({
161
- theme: defaultTheme,
162
- components: [DuiFeedItem], // dependencies (DuiBadge, etc.) auto-register
163
- });
147
+ import "@deepfuture/dui-templates/feed";
164
148
  ```
165
149
 
166
150
  ```html
@@ -174,17 +158,23 @@ applyTheme({
174
158
  ></dui-feed-item>
175
159
  ```
176
160
 
177
- Templates declare their component dependencies via `static dependencies` — `applyTheme` auto-registers them, so you don't need to import `DuiBadge` separately.
161
+ Templates self-register on import, just like components.
178
162
 
179
163
  ## Packages
180
164
 
181
165
  | Package | Purpose |
182
166
  |---------|---------|
183
- | [`@deepfuture/dui-core`](https://www.npmjs.com/package/@deepfuture/dui-core) | `applyTheme()`, event factory, base styles |
184
- | [`@deepfuture/dui-components`](https://www.npmjs.com/package/@deepfuture/dui-components) | Unstyled component classes |
185
- | [`@deepfuture/dui-theme-default`](https://www.npmjs.com/package/@deepfuture/dui-theme-default) | Design tokens + aesthetic styles |
186
- | [`@deepfuture/dui-theme-default-templates`](https://www.npmjs.com/package/@deepfuture/dui-theme-default-templates) | Pre-composed UI patterns for the default theme |
167
+ | [`@deepfuture/dui-components`](https://www.npmjs.com/package/@deepfuture/dui-components) | Styled components (extends dui-primitives) |
168
+ | [`@deepfuture/dui-templates`](https://www.npmjs.com/package/@deepfuture/dui-templates) | Pre-composed UI patterns |
187
169
  | [`@deepfuture/dui-cdn`](https://www.npmjs.com/package/@deepfuture/dui-cdn) | Pre-bundled CDN build (all deps inlined) |
170
+ | [`@deepfuture/dui-inspector`](https://www.npmjs.com/package/@deepfuture/dui-inspector) | Runtime inspector & mutation API |
171
+
172
+ **Foundation (separate repo):**
173
+
174
+ | Package | Purpose |
175
+ |---------|---------|
176
+ | [`@deepfuture/dui-core`](https://www.npmjs.com/package/@deepfuture/dui-core) | Base reset, event factory, floating UI utilities |
177
+ | [`@deepfuture/dui-primitives`](https://www.npmjs.com/package/@deepfuture/dui-primitives) | Unstyled accessible component classes |
188
178
 
189
179
  ## Dev Tools
190
180
 
@@ -194,29 +184,30 @@ A visual editor for design tokens. Edit colors with OKLCH sliders, tweak spacing
194
184
 
195
185
  ### Inspector
196
186
 
197
- A runtime inspector and mutation API for DUI components. Two interfaces:
187
+ A runtime inspector and mutation API for DUI components ([separate package](https://github.com/deepfuturenow/dui-inspector)). Two interfaces:
198
188
 
199
189
  - **Visual UI** (Ctrl+Shift+I) — hover-highlight components, inspect properties/tokens/styles, edit theme CSS and design tokens live
200
190
  - **Console API** — `window.__dui_inspect()`, `window.__dui_mutate.*`, `window.__dui_export()` for programmatic access by agents or scripts
201
191
 
202
- Both share a changelog, so agent and human edits are visible to each other. Changes can be exported as structured source file diffs.
203
-
204
- See **[Inspector docs](docs/inspector.md)** for the full API reference and usage guide.
205
-
206
192
  ## Documentation
207
193
 
208
194
  - **[Live Docs](https://deepfuturenow.github.io/dui/)** — interactive demos for every component
209
- - [Architecture](docs/architecture.md) — mental model, package responsibilities, design decisions
210
- - [Creating Components](docs/creating-components.md) — guide for adding new components
211
- - [Creating Templates](docs/creating-templates.md) — guide for building theme-scoped templates
212
- - [Theming](docs/theming.md) — theme system, design tokens, writing component styles
195
+ - [Architecture](docs/architecture.md) — two-layer inheritance model, package responsibilities
196
+ - [Creating Components](docs/creating-components.md) — extending primitives into styled components
197
+ - [Creating Templates](docs/creating-templates.md) — building pre-composed UI patterns
198
+ - [Theming](docs/theming.md) — color system, design tokens, variant CSS
199
+ - [Styling](docs/styling.md) — customizing components with variables and `::part()`
213
200
  - [Consuming](docs/consuming.md) — integrating DUI into an app
214
- - [Inspector](docs/inspector.md) — runtime inspection, mutation API, and visual editor
215
- - [Accessibility](docs/accessibility.md) — accessibility patterns and guidelines
216
201
 
217
- ## Contributing
202
+ ## Building Your Own Component Set
203
+
204
+ DUI itself is an example of extending [dui-primitives](https://github.com/deepfuturenow/dui-primitives). You can build your own styled component library the same way:
205
+
206
+ 1. Install `@deepfuture/dui-core` + `@deepfuture/dui-primitives`
207
+ 2. Extend primitives with your own aesthetic CSS
208
+ 3. Call `customElements.define()` to self-register
218
209
 
219
- See [CONTRIBUTING.md](CONTRIBUTING.md) for dev setup, code conventions, and PR guidelines.
210
+ See [Creating Components](docs/creating-components.md) for the full pattern.
220
211
 
221
212
  ## License
222
213
 
package/_install.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Side-effect module — injects design tokens and prose styles into the document.
3
+ * Runs once on first import; subsequent imports are no-ops (ES module caching).
4
+ */
5
+ import { tokenSheet } from "./tokens/tokens.js";
6
+ import { proseSheet } from "./tokens/prose.js";
7
+ for (const sheet of [tokenSheet, proseSheet]) {
8
+ if (sheet && !document.adoptedStyleSheets.includes(sheet)) {
9
+ document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
10
+ }
11
+ }
@@ -1,22 +1,5 @@
1
- /** Ported from original DUI: deep-future-app/app/client/components/dui/accordion */
2
- import { LitElement, type TemplateResult } from "lit";
3
- import { type AccordionContext } from "./accordion-context.js";
4
- export declare const openChangeEvent: (detail: {
5
- value: string;
6
- open: boolean;
7
- }) => CustomEvent<{
8
- value: string;
9
- open: boolean;
10
- }>;
11
- export declare class DuiAccordionItem extends LitElement {
12
- #private;
13
- static tagName: "dui-accordion-item";
1
+ import { DuiAccordionItemPrimitive } from "@deepfuture/dui-primitives/accordion";
2
+ import "../_install.js";
3
+ export declare class DuiAccordionItem extends DuiAccordionItemPrimitive {
14
4
  static styles: import("lit").CSSResult[];
15
- accessor value: string;
16
- accessor disabled: boolean;
17
- accessor _ctx: AccordionContext;
18
- connectedCallback(): void;
19
- disconnectedCallback(): void;
20
- willUpdate(): void;
21
- render(): TemplateResult;
22
5
  }