@deepfuture/dui-components 0.0.21 → 1.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.
- package/README.md +56 -65
- package/_install.js +11 -0
- package/accordion/accordion-item.d.ts +3 -20
- package/accordion/accordion-item.js +92 -292
- package/accordion/accordion.d.ts +3 -18
- package/accordion/accordion.js +9 -247
- package/accordion/index.d.ts +6 -6
- package/accordion/index.js +5 -5
- package/alert-dialog/alert-dialog-close.d.ts +3 -14
- package/alert-dialog/alert-dialog-close.js +4 -34
- package/alert-dialog/alert-dialog-popup.d.ts +3 -32
- package/alert-dialog/alert-dialog-popup.js +68 -317
- package/alert-dialog/alert-dialog-trigger.d.ts +3 -14
- package/alert-dialog/alert-dialog-trigger.js +4 -51
- package/alert-dialog/alert-dialog.d.ts +3 -30
- package/alert-dialog/alert-dialog.js +8 -158
- package/alert-dialog/index.d.ts +11 -11
- package/alert-dialog/index.js +9 -9
- package/all.d.ts +159 -123
- package/all.js +134 -231
- package/avatar/avatar.d.ts +3 -39
- package/avatar/avatar.js +18 -238
- package/avatar/index.d.ts +4 -4
- package/avatar/index.js +3 -3
- package/badge/badge.d.ts +3 -10
- package/badge/badge.js +87 -22
- package/badge/index.d.ts +2 -3
- package/badge/index.js +2 -3
- package/breadcrumb/breadcrumb-ellipsis.d.ts +3 -12
- package/breadcrumb/breadcrumb-ellipsis.js +8 -34
- package/breadcrumb/breadcrumb-item.d.ts +3 -11
- package/breadcrumb/breadcrumb-item.js +7 -26
- package/breadcrumb/breadcrumb-link.d.ts +3 -12
- package/breadcrumb/breadcrumb-link.js +16 -26
- package/breadcrumb/breadcrumb-page.d.ts +3 -11
- package/breadcrumb/breadcrumb-page.js +8 -31
- package/breadcrumb/breadcrumb-separator.d.ts +3 -12
- package/breadcrumb/breadcrumb-separator.js +8 -31
- package/breadcrumb/breadcrumb.d.ts +3 -12
- package/breadcrumb/breadcrumb.js +10 -33
- package/breadcrumb/index.d.ts +12 -13
- package/breadcrumb/index.js +12 -13
- package/button/button.d.ts +3 -32
- package/button/button.js +220 -165
- package/button/index.d.ts +3 -3
- package/button/index.js +3 -3
- package/calendar/calendar.d.ts +3 -31
- package/calendar/calendar.js +71 -481
- package/calendar/index.d.ts +3 -3
- package/calendar/index.js +3 -3
- package/card/card.d.ts +3 -27
- package/card/card.js +80 -163
- package/card/index.d.ts +2 -3
- package/card/index.js +2 -3
- package/card-grid/card-grid.d.ts +3 -15
- package/card-grid/card-grid.js +8 -106
- package/card-grid/index.d.ts +2 -3
- package/card-grid/index.js +2 -3
- package/checkbox/checkbox-group.d.ts +3 -34
- package/checkbox/checkbox-group.js +11 -188
- package/checkbox/checkbox.d.ts +3 -47
- package/checkbox/checkbox.js +43 -341
- package/checkbox/index.d.ts +6 -6
- package/checkbox/index.js +5 -5
- package/collapsible/collapsible.d.ts +3 -20
- package/collapsible/collapsible.js +82 -277
- package/collapsible/index.d.ts +3 -3
- package/collapsible/index.js +3 -3
- package/combobox/combobox.d.ts +3 -47
- package/combobox/combobox.js +136 -538
- package/combobox/index.d.ts +4 -4
- package/combobox/index.js +3 -3
- package/command/command-empty.d.ts +3 -8
- package/command/command-empty.js +10 -88
- package/command/command-group.d.ts +3 -13
- package/command/command-group.js +14 -114
- package/command/command-input.d.ts +3 -11
- package/command/command-input.js +20 -136
- package/command/command-item.d.ts +3 -18
- package/command/command-item.js +23 -212
- package/command/command-list.d.ts +3 -7
- package/command/command-list.js +11 -79
- package/command/command-separator.d.ts +3 -5
- package/command/command-separator.js +10 -11
- package/command/command-shortcut.d.ts +3 -5
- package/command/command-shortcut.js +9 -12
- package/command/command.d.ts +3 -23
- package/command/command.js +10 -339
- package/command/index.d.ts +17 -19
- package/command/index.js +16 -18
- package/data-table/data-table.d.ts +3 -57
- package/data-table/data-table.js +85 -449
- package/data-table/index.d.ts +3 -4
- package/data-table/index.js +2 -3
- package/dialog/dialog-close.d.ts +3 -14
- package/dialog/dialog-close.js +4 -34
- package/dialog/dialog-popup.d.ts +3 -34
- package/dialog/dialog-popup.js +70 -336
- package/dialog/dialog-trigger.d.ts +3 -14
- package/dialog/dialog-trigger.js +4 -51
- package/dialog/dialog.d.ts +3 -30
- package/dialog/dialog.js +8 -158
- package/dialog/index.d.ts +11 -11
- package/dialog/index.js +9 -9
- package/dropzone/dropzone.d.ts +3 -72
- package/dropzone/dropzone.js +29 -407
- package/dropzone/index.d.ts +4 -4
- package/dropzone/index.js +3 -3
- package/field/field.d.ts +3 -30
- package/field/field.js +34 -353
- package/field/index.d.ts +1 -0
- package/field/index.js +1 -0
- package/fieldset/fieldset.d.ts +3 -18
- package/fieldset/fieldset.js +21 -110
- package/fieldset/index.d.ts +1 -0
- package/fieldset/index.js +1 -0
- package/icon/icon.d.ts +3 -15
- package/icon/icon.js +4 -33
- package/icon/index.d.ts +2 -3
- package/icon/index.js +2 -3
- package/input/index.d.ts +3 -3
- package/input/index.js +3 -3
- package/input/input.d.ts +3 -49
- package/input/input.js +57 -238
- package/menu/index.d.ts +4 -5
- package/menu/index.js +4 -5
- package/menu/menu-item.d.ts +3 -13
- package/menu/menu-item.js +40 -91
- package/menu/menu.d.ts +3 -15
- package/menu/menu.js +27 -277
- package/menubar/index.d.ts +3 -4
- package/menubar/index.js +2 -3
- package/menubar/menubar.d.ts +3 -19
- package/menubar/menubar.js +12 -183
- package/number-field/index.d.ts +3 -3
- package/number-field/index.js +3 -3
- package/number-field/number-field.d.ts +3 -55
- package/number-field/number-field.js +205 -698
- package/package.json +125 -113
- package/popover/index.d.ts +11 -11
- package/popover/index.js +9 -9
- package/popover/popover-close.d.ts +3 -12
- package/popover/popover-close.js +4 -32
- package/popover/popover-popup.d.ts +3 -18
- package/popover/popover-popup.js +28 -205
- package/popover/popover-trigger.d.ts +3 -13
- package/popover/popover-trigger.js +4 -73
- package/popover/popover.d.ts +3 -29
- package/popover/popover.js +8 -207
- package/portal/index.d.ts +3 -4
- package/portal/index.js +2 -3
- package/portal/portal.d.ts +3 -27
- package/portal/portal.js +8 -157
- package/preview-card/index.d.ts +9 -9
- package/preview-card/index.js +7 -7
- package/preview-card/preview-card-popup.d.ts +3 -14
- package/preview-card/preview-card-popup.js +29 -194
- package/preview-card/preview-card-trigger.d.ts +3 -12
- package/preview-card/preview-card-trigger.js +4 -74
- package/preview-card/preview-card.d.ts +3 -33
- package/preview-card/preview-card.js +8 -239
- package/progress/index.d.ts +2 -3
- package/progress/index.js +2 -3
- package/progress/progress.d.ts +3 -17
- package/progress/progress.js +28 -130
- package/radio/index.d.ts +6 -6
- package/radio/index.js +5 -5
- package/radio/radio-group.d.ts +3 -37
- package/radio/radio-group.js +8 -200
- package/radio/radio.d.ts +3 -28
- package/radio/radio.js +38 -213
- package/scroll-area/index.d.ts +2 -3
- package/scroll-area/index.js +2 -3
- package/scroll-area/scroll-area.d.ts +3 -36
- package/scroll-area/scroll-area.js +25 -535
- package/select/index.d.ts +3 -4
- package/select/index.js +2 -3
- package/select/select.d.ts +3 -39
- package/select/select.js +115 -425
- package/separator/index.d.ts +2 -3
- package/separator/index.js +2 -3
- package/separator/separator.d.ts +3 -10
- package/separator/separator.js +23 -85
- package/sidebar/index.d.ts +29 -29
- package/sidebar/index.js +27 -32
- package/sidebar/sidebar-content.d.ts +3 -12
- package/sidebar/sidebar-content.js +7 -29
- package/sidebar/sidebar-footer.d.ts +3 -10
- package/sidebar/sidebar-footer.js +7 -20
- package/sidebar/sidebar-group-label.d.ts +3 -15
- package/sidebar/sidebar-group-label.js +16 -41
- package/sidebar/sidebar-group.d.ts +3 -13
- package/sidebar/sidebar-group.js +7 -24
- package/sidebar/sidebar-header.d.ts +3 -10
- package/sidebar/sidebar-header.js +7 -16
- package/sidebar/sidebar-inset.d.ts +3 -13
- package/sidebar/sidebar-inset.js +7 -28
- package/sidebar/sidebar-menu-button.d.ts +3 -26
- package/sidebar/sidebar-menu-button.js +59 -217
- package/sidebar/sidebar-menu-item.d.ts +3 -10
- package/sidebar/sidebar-menu-item.js +7 -19
- package/sidebar/sidebar-menu.d.ts +3 -12
- package/sidebar/sidebar-menu.js +7 -25
- package/sidebar/sidebar-provider.d.ts +3 -34
- package/sidebar/sidebar-provider.js +22 -232
- package/sidebar/sidebar-separator.d.ts +3 -10
- package/sidebar/sidebar-separator.js +9 -19
- package/sidebar/sidebar-trigger.d.ts +3 -14
- package/sidebar/sidebar-trigger.js +10 -46
- package/sidebar/sidebar.d.ts +3 -19
- package/sidebar/sidebar.js +65 -262
- package/slider/index.d.ts +3 -3
- package/slider/index.js +3 -3
- package/slider/slider.d.ts +3 -45
- package/slider/slider.js +97 -382
- package/spinner/index.d.ts +2 -3
- package/spinner/index.js +2 -3
- package/spinner/spinner.d.ts +3 -11
- package/spinner/spinner.js +20 -163
- package/split-button/index.d.ts +3 -1
- package/split-button/index.js +3 -1
- package/split-button/split-button.d.ts +3 -33
- package/split-button/split-button.js +306 -394
- package/stepper/index.d.ts +3 -3
- package/stepper/index.js +3 -3
- package/stepper/stepper.d.ts +3 -41
- package/stepper/stepper.js +57 -381
- package/switch/index.d.ts +3 -3
- package/switch/index.js +3 -3
- package/switch/switch.d.ts +3 -30
- package/switch/switch.js +63 -228
- package/tabs/index.d.ts +12 -12
- package/tabs/index.js +11 -11
- package/tabs/tab.d.ts +3 -14
- package/tabs/tab.js +32 -131
- package/tabs/tabs-indicator.d.ts +3 -9
- package/tabs/tabs-indicator.js +17 -22
- package/tabs/tabs-list.d.ts +3 -15
- package/tabs/tabs-list.js +14 -113
- package/tabs/tabs-panel.d.ts +3 -16
- package/tabs/tabs-panel.js +32 -114
- package/tabs/tabs.d.ts +3 -22
- package/tabs/tabs.js +8 -170
- package/textarea/index.d.ts +4 -4
- package/textarea/index.js +3 -3
- package/textarea/textarea.d.ts +3 -36
- package/textarea/textarea.js +63 -220
- package/toggle/index.d.ts +6 -6
- package/toggle/index.js +5 -5
- package/toggle/toggle-group.d.ts +3 -27
- package/toggle/toggle-group.js +9 -224
- package/toggle/toggle.d.ts +3 -26
- package/toggle/toggle.js +93 -178
- package/tokens/properties.css +361 -0
- package/tokens/prose.css +250 -0
- package/tokens/prose.d.ts +2 -0
- package/tokens/prose.js +4 -0
- package/tokens/tokens-raw.d.ts +2 -0
- package/tokens/tokens-raw.js +2 -0
- package/tokens/tokens.css +409 -0
- package/tokens/tokens.d.ts +2 -0
- package/tokens/tokens.js +5 -0
- package/toolbar/index.d.ts +2 -3
- package/toolbar/index.js +2 -3
- package/toolbar/toolbar.d.ts +3 -11
- package/toolbar/toolbar.js +25 -116
- package/tooltip/index.d.ts +9 -9
- package/tooltip/index.js +7 -7
- package/tooltip/tooltip-popup.d.ts +3 -14
- package/tooltip/tooltip-popup.js +31 -185
- package/tooltip/tooltip-trigger.d.ts +3 -14
- package/tooltip/tooltip-trigger.js +5 -148
- package/tooltip/tooltip.d.ts +3 -35
- package/tooltip/tooltip.js +8 -253
- package/trunc/index.d.ts +2 -3
- package/trunc/index.js +2 -3
- package/trunc/trunc.d.ts +3 -17
- package/trunc/trunc.js +10 -108
- package/_deprecated/center/center.d.ts +0 -14
- package/_deprecated/center/center.js +0 -37
- package/_deprecated/center/index.d.ts +0 -3
- package/_deprecated/center/index.js +0 -3
- package/_deprecated/center/register.js +0 -4
- package/_deprecated/hstack/hstack.d.ts +0 -25
- package/_deprecated/hstack/hstack.js +0 -187
- package/_deprecated/hstack/index.d.ts +0 -4
- package/_deprecated/hstack/index.js +0 -3
- package/_deprecated/hstack/register.d.ts +0 -1
- package/_deprecated/hstack/register.js +0 -4
- package/_deprecated/page-inset/index.d.ts +0 -3
- package/_deprecated/page-inset/index.js +0 -3
- package/_deprecated/page-inset/page-inset.d.ts +0 -28
- package/_deprecated/page-inset/page-inset.js +0 -151
- package/_deprecated/page-inset/register.d.ts +0 -1
- package/_deprecated/page-inset/register.js +0 -4
- package/_deprecated/vstack/index.d.ts +0 -3
- package/_deprecated/vstack/index.js +0 -3
- package/_deprecated/vstack/register.d.ts +0 -1
- package/_deprecated/vstack/register.js +0 -4
- package/_deprecated/vstack/vstack.d.ts +0 -17
- package/_deprecated/vstack/vstack.js +0 -125
- package/accordion/accordion-context.d.ts +0 -15
- package/accordion/accordion-context.js +0 -3
- package/alert-dialog/alert-dialog-context.d.ts +0 -13
- package/alert-dialog/alert-dialog-context.js +0 -3
- package/checkbox/checkbox-group-context.d.ts +0 -11
- package/checkbox/checkbox-group-context.js +0 -3
- package/command/command-context.d.ts +0 -30
- package/command/command-context.js +0 -3
- package/command/command-score.d.ts +0 -6
- package/command/command-score.js +0 -31
- package/dialog/dialog-context.d.ts +0 -13
- package/dialog/dialog-context.js +0 -3
- package/global.d.ts +0 -179
- package/menubar/menubar-context.d.ts +0 -9
- package/menubar/menubar-context.js +0 -2
- package/popover/popover-context.d.ts +0 -17
- package/popover/popover-context.js +0 -3
- package/preview-card/preview-card-context.d.ts +0 -16
- package/preview-card/preview-card-context.js +0 -3
- package/radio/radio-group-context.d.ts +0 -11
- package/radio/radio-group-context.js +0 -2
- package/sidebar/sidebar-context.d.ts +0 -15
- package/sidebar/sidebar-context.js +0 -3
- package/split-button/register.d.ts +0 -1
- package/split-button/register.js +0 -4
- package/tabs/tabs-context.d.ts +0 -8
- package/tabs/tabs-context.js +0 -2
- package/toggle/toggle-group-context.d.ts +0 -9
- package/toggle/toggle-group-context.js +0 -2
- package/tooltip/tooltip-context.d.ts +0 -17
- package/tooltip/tooltip-context.js +0 -3
- /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
|
[](LICENSE)
|
|
4
|
-
[](https://www.npmjs.com/package/@deepfuture/dui-components)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
Styled [Lit](https://lit.dev) web component library built on [dui-primitives](https://github.com/deepfuturenow/dui-primitives).
|
|
7
7
|
|
|
8
|
-
|
|
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-
|
|
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
|
|
38
|
-
import
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
66
|
+
DuiButtonPrimitive (structure, ARIA, keyboard)
|
|
67
|
+
↓ extends
|
|
68
|
+
DuiButton (tokens, variants, aesthetic CSS, customElements.define())
|
|
80
69
|
```
|
|
81
70
|
|
|
82
|
-
No build step, no
|
|
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,
|
|
91
|
-
| **Forms** | Input, Textarea, Select, Combobox, Checkbox,
|
|
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** |
|
|
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
|
|
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
|
-
|
|
130
|
+
Toggle dark mode by setting `data-theme="dark"` on the `<html>` element:
|
|
142
131
|
|
|
143
132
|
```html
|
|
144
|
-
<
|
|
133
|
+
<html data-theme="dark">
|
|
145
134
|
<!-- All DUI components render in dark mode -->
|
|
146
|
-
</
|
|
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
|
|
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-
|
|
143
|
+
npm install @deepfuture/dui-templates
|
|
155
144
|
```
|
|
156
145
|
|
|
157
146
|
```typescript
|
|
158
|
-
import
|
|
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
|
|
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-
|
|
184
|
-
| [`@deepfuture/dui-
|
|
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-primitives/core` | Base reset, event factory, floating UI utilities (part of dui-primitives) |
|
|
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) —
|
|
210
|
-
- [Creating Components](docs/creating-components.md) —
|
|
211
|
-
- [Creating Templates](docs/creating-templates.md) —
|
|
212
|
-
- [Theming](docs/theming.md) —
|
|
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
|
-
##
|
|
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-primitives`
|
|
207
|
+
2. Extend primitives with your own aesthetic CSS
|
|
208
|
+
3. Call `customElements.define()` to self-register
|
|
218
209
|
|
|
219
|
-
See [
|
|
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
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
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
|
}
|