@deepfuture/dui-theme-default 0.0.2 → 0.0.5
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 +9 -1
- package/components/accordion-item.js +11 -10
- package/components/alert-dialog-popup.js +9 -17
- package/components/avatar.js +2 -2
- package/components/badge.js +55 -29
- package/components/breadcrumb-ellipsis.js +1 -1
- package/components/breadcrumb-link.js +2 -2
- package/components/breadcrumb-page.js +1 -1
- package/components/breadcrumb-separator.js +1 -1
- package/components/breadcrumb.js +3 -2
- package/components/button.js +88 -51
- package/components/calendar.js +24 -21
- package/components/checkbox-group.js +1 -1
- package/components/checkbox.js +10 -9
- package/components/collapsible.js +11 -10
- package/components/combobox.js +65 -19
- package/components/command-empty.js +3 -2
- package/components/command-group.js +3 -2
- package/components/command-input.js +4 -3
- package/components/command-item.js +6 -5
- package/components/command-list.js +1 -1
- package/components/command-separator.js +1 -1
- package/components/command-shortcut.js +3 -2
- package/components/command.js +2 -2
- package/components/data-table.js +20 -19
- package/components/dialog-popup.js +9 -17
- package/components/dropzone.js +10 -9
- package/components/input.js +13 -12
- package/components/menu-item.js +11 -9
- package/components/menu.js +19 -1
- package/components/number-field.js +13 -11
- package/components/popover-popup.js +25 -1
- package/components/preview-card-popup.js +26 -1
- package/components/progress.js +2 -2
- package/components/radio.js +11 -10
- package/components/scroll-area.js +9 -9
- package/components/select.js +62 -10
- package/components/sidebar-group-label.js +2 -2
- package/components/sidebar-menu-button.js +6 -14
- package/components/sidebar-provider.js +6 -14
- package/components/sidebar.js +1 -1
- package/components/slider.js +8 -7
- package/components/switch.js +12 -11
- package/components/tab.js +10 -9
- package/components/tabs-indicator.js +3 -3
- package/components/tabs-panel.js +3 -2
- package/components/textarea.js +11 -10
- package/components/toggle-group.js +0 -1
- package/components/toggle.js +28 -11
- package/components/tooltip-popup.js +29 -1
- package/components/trunc.js +3 -3
- package/index.d.ts +4 -0
- package/index.js +6 -0
- package/package.json +14 -2
- package/prose.d.ts +2 -0
- package/prose.js +4 -0
- package/tokens-raw.js +1 -1
- package/tokens.css +95 -72
- package/tokens.js +3 -2
- package/types.d.ts +18 -0
- package/types.js +8 -0
- package/typography.d.ts +104 -0
- package/typography.js +103 -0
package/README.md
CHANGED
|
@@ -163,7 +163,14 @@ A visual editor for design tokens. Edit colors with OKLCH sliders, tweak spacing
|
|
|
163
163
|
|
|
164
164
|
### Inspector
|
|
165
165
|
|
|
166
|
-
|
|
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.
|
|
167
174
|
|
|
168
175
|
## Documentation
|
|
169
176
|
|
|
@@ -172,6 +179,7 @@ Toggle with **Ctrl+Shift+I** to inspect any DUI component at runtime — view pr
|
|
|
172
179
|
- [Creating Components](docs/creating-components.md) — guide for adding new components
|
|
173
180
|
- [Theming](docs/theming.md) — theme system, design tokens, writing component styles
|
|
174
181
|
- [Consuming](docs/consuming.md) — integrating DUI into an app
|
|
182
|
+
- [Inspector](docs/inspector.md) — runtime inspection, mutation API, and visual editor
|
|
175
183
|
- [Accessibility](docs/accessibility.md) — accessibility patterns and guidelines
|
|
176
184
|
|
|
177
185
|
## Contributing
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
|
+
import { type } from "../typography.js";
|
|
2
3
|
export const accordionItemStyles = css `
|
|
3
4
|
/* ── Item ── */
|
|
4
5
|
|
|
@@ -15,32 +16,32 @@ export const accordionItemStyles = css `
|
|
|
15
16
|
gap: var(--space-4);
|
|
16
17
|
padding-block: var(--space-2);
|
|
17
18
|
padding-inline: 0;
|
|
18
|
-
color: var(--
|
|
19
|
+
color: var(--text-1);
|
|
19
20
|
font-family: var(--font-sans);
|
|
20
21
|
font-weight: var(--font-weight-semibold);
|
|
21
|
-
|
|
22
|
+
${type("sm")}
|
|
22
23
|
height: var(--component-height-md);
|
|
23
|
-
line-height: var(--line-height-normal);
|
|
24
24
|
border-radius: var(--radius-sm);
|
|
25
|
+
transition-property: background, box-shadow, filter, transform;
|
|
25
26
|
transition-duration: var(--duration-fast);
|
|
26
27
|
transition-timing-function: var(--ease-out-3);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
@media (hover: hover) {
|
|
30
31
|
[part="trigger"]:hover {
|
|
31
|
-
background:
|
|
32
|
+
background: oklch(from var(--foreground) l c h / 0.05);
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
[part="trigger"]:focus-visible {
|
|
36
37
|
box-shadow:
|
|
37
|
-
0 0 0 var(--
|
|
38
|
-
0 0 0 var(--
|
|
38
|
+
0 0 0 var(--focus-ring-offset) var(--background),
|
|
39
|
+
0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width)) var(--focus-ring-color);
|
|
39
40
|
z-index: 1;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
[part="trigger"][data-disabled] {
|
|
43
|
-
opacity: 0.
|
|
44
|
+
opacity: 0.4;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
/* ── Indicator ── */
|
|
@@ -48,6 +49,7 @@ export const accordionItemStyles = css `
|
|
|
48
49
|
[part="indicator"] {
|
|
49
50
|
width: var(--space-4);
|
|
50
51
|
height: var(--space-4);
|
|
52
|
+
transition-property: transform;
|
|
51
53
|
transition-duration: var(--duration-fast);
|
|
52
54
|
transition-timing-function: var(--ease-out-3);
|
|
53
55
|
}
|
|
@@ -71,10 +73,9 @@ export const accordionItemStyles = css `
|
|
|
71
73
|
[part="content"] {
|
|
72
74
|
padding: 0 0 var(--space-3);
|
|
73
75
|
font-family: var(--font-sans);
|
|
74
|
-
|
|
76
|
+
${type("sm")}
|
|
75
77
|
font-weight: var(--font-weight-regular);
|
|
76
|
-
|
|
77
|
-
color: color-mix(in oklch, var(--foreground) 80%, transparent);
|
|
78
|
+
color: var(--text-2);
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
/* ── Reduced motion ── */
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
|
+
import { type } from "../typography.js";
|
|
2
3
|
export const alertDialogPopupStyles = css `
|
|
3
4
|
/* ── Backdrop ── */
|
|
4
5
|
|
|
5
6
|
[part="backdrop"] {
|
|
6
|
-
background:
|
|
7
|
-
opacity: 0.2;
|
|
7
|
+
background: var(--scrim);
|
|
8
8
|
transition: opacity var(--duration-fast) var(--ease-out-3);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
@container style(--theme: dark) {
|
|
12
|
-
[part="backdrop"] {
|
|
13
|
-
opacity: 0.7;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
11
|
[part="backdrop"][data-starting-style],
|
|
18
12
|
[part="backdrop"][data-ending-style] {
|
|
19
13
|
opacity: 0;
|
|
@@ -26,9 +20,10 @@ export const alertDialogPopupStyles = css `
|
|
|
26
20
|
padding: var(--space-6);
|
|
27
21
|
border-radius: var(--radius-lg);
|
|
28
22
|
border: var(--border-width-thin) solid var(--border);
|
|
29
|
-
background: var(--
|
|
30
|
-
color: var(--
|
|
23
|
+
background: var(--surface-2);
|
|
24
|
+
color: var(--text-1);
|
|
31
25
|
font-family: var(--font-sans);
|
|
26
|
+
box-shadow: var(--shadow-lg);
|
|
32
27
|
transition-duration: var(--duration-fast);
|
|
33
28
|
}
|
|
34
29
|
|
|
@@ -44,11 +39,9 @@ export const alertDialogPopupStyles = css `
|
|
|
44
39
|
margin-top: calc(-1 * var(--space-1));
|
|
45
40
|
margin-bottom: var(--space-1);
|
|
46
41
|
font-family: var(--font-sans);
|
|
47
|
-
|
|
48
|
-
letter-spacing: var(--letter-spacing-tighter);
|
|
49
|
-
line-height: var(--line-height-tight);
|
|
42
|
+
${type("lg", { letterSpacing: "var(--letter-spacing-tighter)", lineHeight: "var(--line-height-tight)" })}
|
|
50
43
|
font-weight: var(--font-weight-medium);
|
|
51
|
-
color: var(--
|
|
44
|
+
color: var(--text-1);
|
|
52
45
|
}
|
|
53
46
|
|
|
54
47
|
/* ── Description ── */
|
|
@@ -56,9 +49,8 @@ export const alertDialogPopupStyles = css `
|
|
|
56
49
|
[part="description"] {
|
|
57
50
|
margin: 0 0 var(--space-6);
|
|
58
51
|
font-family: var(--font-sans);
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
color: var(--muted-foreground);
|
|
52
|
+
${type("md")}
|
|
53
|
+
color: var(--text-2);
|
|
62
54
|
}
|
|
63
55
|
|
|
64
56
|
/* ── Reduced motion ── */
|
package/components/avatar.js
CHANGED
package/components/badge.js
CHANGED
|
@@ -1,43 +1,71 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
|
+
import { type } from "../typography.js";
|
|
2
3
|
export const badgeStyles = css `
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
/* =================================================================
|
|
5
|
+
* Two-axis variant system:
|
|
6
|
+
* variant → semantic intent (neutral, accent, danger)
|
|
7
|
+
* appearance → visual treatment (filled, outline, ghost)
|
|
8
|
+
* ================================================================= */
|
|
9
|
+
|
|
10
|
+
/* ---------------------------------------------------------------
|
|
11
|
+
* Layer 1 — Intent (sets --_intent-* private tokens)
|
|
12
|
+
* --------------------------------------------------------------- */
|
|
13
|
+
|
|
14
|
+
:host,
|
|
15
|
+
:host([variant=""]),
|
|
16
|
+
:host([variant="neutral"]) {
|
|
17
|
+
--_intent-base: var(--foreground);
|
|
18
|
+
--_intent-base-fg: var(--background);
|
|
19
|
+
--_intent-subtle: oklch(from var(--foreground) l c h / 0.08);
|
|
20
|
+
--_intent-subtle-fg: var(--text-1);
|
|
10
21
|
}
|
|
11
22
|
|
|
12
|
-
:host([variant="
|
|
13
|
-
--
|
|
14
|
-
--
|
|
23
|
+
:host([variant="primary"]) {
|
|
24
|
+
--_intent-base: var(--accent);
|
|
25
|
+
--_intent-base-fg: oklch(from var(--accent) 0.98 0.01 h);
|
|
26
|
+
--_intent-subtle: var(--accent-subtle);
|
|
27
|
+
--_intent-subtle-fg: var(--accent-text);
|
|
15
28
|
}
|
|
16
29
|
|
|
17
|
-
:host([variant="
|
|
18
|
-
--
|
|
19
|
-
--
|
|
30
|
+
:host([variant="danger"]) {
|
|
31
|
+
--_intent-base: var(--destructive);
|
|
32
|
+
--_intent-base-fg: oklch(from var(--destructive) 0.98 0.01 h);
|
|
33
|
+
--_intent-subtle: var(--destructive-subtle);
|
|
34
|
+
--_intent-subtle-fg: var(--destructive-text);
|
|
20
35
|
}
|
|
21
36
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
37
|
+
/* ---------------------------------------------------------------
|
|
38
|
+
* Layer 2 — Appearance (maps --_intent-* to --badge-*)
|
|
39
|
+
* --------------------------------------------------------------- */
|
|
40
|
+
|
|
41
|
+
:host,
|
|
42
|
+
:host([appearance=""]),
|
|
43
|
+
:host([appearance="filled"]) {
|
|
44
|
+
--badge-bg: var(--_intent-base);
|
|
45
|
+
--badge-fg: var(--_intent-base-fg);
|
|
46
|
+
--badge-border: transparent;
|
|
26
47
|
}
|
|
27
48
|
|
|
28
|
-
:host([
|
|
29
|
-
--badge-bg:
|
|
30
|
-
--badge-fg: var(--
|
|
49
|
+
:host([appearance="outline"]) {
|
|
50
|
+
--badge-bg: transparent;
|
|
51
|
+
--badge-fg: var(--_intent-subtle-fg);
|
|
52
|
+
--badge-border: var(--border);
|
|
31
53
|
}
|
|
32
54
|
|
|
33
|
-
:host([
|
|
34
|
-
--badge-bg: var(--
|
|
35
|
-
--badge-fg: var(--
|
|
55
|
+
:host([appearance="ghost"]) {
|
|
56
|
+
--badge-bg: var(--_intent-subtle);
|
|
57
|
+
--badge-fg: var(--_intent-subtle-fg);
|
|
58
|
+
--badge-border: transparent;
|
|
36
59
|
}
|
|
37
60
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
61
|
+
/* ---------------------------------------------------------------
|
|
62
|
+
* Sizing & base appearance
|
|
63
|
+
* --------------------------------------------------------------- */
|
|
64
|
+
|
|
65
|
+
:host {
|
|
66
|
+
--badge-icon-size: var(--space-3);
|
|
67
|
+
--icon-size: var(--badge-icon-size);
|
|
68
|
+
--icon-color: var(--badge-fg);
|
|
41
69
|
}
|
|
42
70
|
|
|
43
71
|
[part="root"] {
|
|
@@ -48,10 +76,8 @@ export const badgeStyles = css `
|
|
|
48
76
|
background: var(--badge-bg);
|
|
49
77
|
color: var(--badge-fg);
|
|
50
78
|
font-family: var(--font-sans);
|
|
51
|
-
|
|
52
|
-
letter-spacing: var(--letter-spacing-normal);
|
|
79
|
+
${type("xs", { letterSpacing: "var(--letter-spacing-normal)", lineHeight: "var(--line-height-snug)" })}
|
|
53
80
|
font-weight: var(--font-weight-medium);
|
|
54
|
-
line-height: var(--line-height-snug);
|
|
55
81
|
white-space: nowrap;
|
|
56
82
|
border: var(--border-width-thin) solid var(--badge-border);
|
|
57
83
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
2
|
export const breadcrumbLinkStyles = css `
|
|
3
3
|
[part="root"] {
|
|
4
|
-
color: var(--
|
|
4
|
+
color: var(--text-2);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
[part="root"] ::slotted(a) {
|
|
@@ -11,6 +11,6 @@ export const breadcrumbLinkStyles = css `
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
[part="root"] ::slotted(a:hover) {
|
|
14
|
-
color: var(--
|
|
14
|
+
color: var(--text-1);
|
|
15
15
|
}
|
|
16
16
|
`;
|
package/components/breadcrumb.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
|
+
import { type } from "../typography.js";
|
|
2
3
|
export const breadcrumbStyles = css `
|
|
3
4
|
[part="root"] {
|
|
4
5
|
gap: var(--space-2);
|
|
5
|
-
|
|
6
|
+
${type("sm")}
|
|
6
7
|
font-family: var(--font-sans);
|
|
7
|
-
color: var(--
|
|
8
|
+
color: var(--text-2);
|
|
8
9
|
}
|
|
9
10
|
`;
|
package/components/button.js
CHANGED
|
@@ -1,65 +1,81 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
2
|
export const buttonStyles = css `
|
|
3
|
+
/* =================================================================
|
|
4
|
+
* Two-axis variant system:
|
|
5
|
+
* variant → semantic intent (neutral, primary, danger)
|
|
6
|
+
* appearance → visual treatment (filled, outline, ghost, link)
|
|
7
|
+
*
|
|
8
|
+
* Uses the --_interact alpha overlay pattern for hover/active states.
|
|
9
|
+
* ================================================================= */
|
|
10
|
+
|
|
3
11
|
/* ---------------------------------------------------------------
|
|
4
|
-
*
|
|
5
|
-
* Everything else — filters, transforms, clip-paths, shadows,
|
|
6
|
-
* text-decoration — consumers style via ::part(root).
|
|
12
|
+
* Layer 1 — Intent (sets --_intent-* private tokens)
|
|
7
13
|
* --------------------------------------------------------------- */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
--
|
|
15
|
-
--button-width: auto;
|
|
16
|
-
--button-padding-y: var(--space-2);
|
|
17
|
-
--button-padding-x: var(--space-2_5);
|
|
18
|
-
--button-gap: var(--space-1_5);
|
|
19
|
-
--button-radius: var(--radius-md);
|
|
20
|
-
--button-font-size: var(--font-size-sm);
|
|
21
|
-
--button-icon-size: var(--space-4_5);
|
|
14
|
+
|
|
15
|
+
:host,
|
|
16
|
+
:host([variant=""]),
|
|
17
|
+
:host([variant="neutral"]) {
|
|
18
|
+
--_intent-base: var(--foreground);
|
|
19
|
+
--_intent-base-fg: var(--background);
|
|
20
|
+
--_intent-subtle-fg: var(--text-1);
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
:host([variant="primary"]) {
|
|
24
|
+
--_intent-base: var(--accent);
|
|
25
|
+
--_intent-base-fg: oklch(from var(--accent) 0.98 0.01 h);
|
|
26
|
+
--_intent-subtle-fg: var(--accent-text);
|
|
27
|
+
}
|
|
25
28
|
|
|
26
|
-
:host([variant="
|
|
27
|
-
--
|
|
28
|
-
--
|
|
29
|
-
--
|
|
29
|
+
:host([variant="danger"]) {
|
|
30
|
+
--_intent-base: var(--destructive);
|
|
31
|
+
--_intent-base-fg: oklch(from var(--destructive) 0.98 0.01 h);
|
|
32
|
+
--_intent-subtle-fg: var(--destructive-text);
|
|
30
33
|
}
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
/* ---------------------------------------------------------------
|
|
36
|
+
* Layer 2 — Appearance (maps --_intent-* to --button-*)
|
|
37
|
+
* --------------------------------------------------------------- */
|
|
38
|
+
|
|
39
|
+
:host,
|
|
40
|
+
:host([appearance=""]),
|
|
41
|
+
:host([appearance="filled"]) {
|
|
42
|
+
--button-bg: var(--_intent-base);
|
|
43
|
+
--button-fg: var(--_intent-base-fg);
|
|
35
44
|
--button-border: transparent;
|
|
36
45
|
}
|
|
37
46
|
|
|
38
|
-
:host([
|
|
39
|
-
--button-
|
|
40
|
-
--button-
|
|
41
|
-
--button-
|
|
42
|
-
--button-hover-bg: var(--muted);
|
|
43
|
-
--button-active-bg: var(--muted);
|
|
47
|
+
:host([appearance="outline"]) {
|
|
48
|
+
--button-bg: transparent;
|
|
49
|
+
--button-fg: var(--_intent-subtle-fg);
|
|
50
|
+
--button-border: var(--border);
|
|
44
51
|
}
|
|
45
52
|
|
|
46
|
-
:host([
|
|
53
|
+
:host([appearance="ghost"]) {
|
|
47
54
|
--button-bg: transparent;
|
|
48
|
-
--button-fg: var(--
|
|
55
|
+
--button-fg: var(--_intent-subtle-fg);
|
|
49
56
|
--button-border: transparent;
|
|
50
|
-
--button-hover-bg: var(--muted);
|
|
51
|
-
--button-active-bg: var(--muted);
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
:host([
|
|
59
|
+
:host([appearance="link"]) {
|
|
55
60
|
--button-bg: transparent;
|
|
56
|
-
--button-fg: var(--
|
|
61
|
+
--button-fg: var(--_intent-subtle-fg);
|
|
57
62
|
--button-border: transparent;
|
|
58
|
-
--button-hover-bg: transparent;
|
|
59
|
-
--button-active-bg: transparent;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
|
-
/*
|
|
65
|
+
/* ---------------------------------------------------------------
|
|
66
|
+
* Sizes (swap dimensions)
|
|
67
|
+
* --------------------------------------------------------------- */
|
|
68
|
+
|
|
69
|
+
:host {
|
|
70
|
+
--button-height: var(--component-height-md);
|
|
71
|
+
--button-width: auto;
|
|
72
|
+
--button-padding-y: var(--space-2);
|
|
73
|
+
--button-padding-x: var(--space-2_5);
|
|
74
|
+
--button-gap: var(--space-1_5);
|
|
75
|
+
--button-radius: var(--radius-md);
|
|
76
|
+
--button-font-size: var(--font-size-sm);
|
|
77
|
+
--button-icon-size: var(--space-4_5);
|
|
78
|
+
}
|
|
63
79
|
|
|
64
80
|
:host([size="sm"]) {
|
|
65
81
|
--button-height: var(--component-height-sm);
|
|
@@ -79,7 +95,9 @@ export const buttonStyles = css `
|
|
|
79
95
|
--button-icon-size: var(--space-4_5);
|
|
80
96
|
}
|
|
81
97
|
|
|
82
|
-
/*
|
|
98
|
+
/* ---------------------------------------------------------------
|
|
99
|
+
* Base appearance
|
|
100
|
+
* --------------------------------------------------------------- */
|
|
83
101
|
|
|
84
102
|
[part="root"] {
|
|
85
103
|
--icon-size: var(--button-icon-size);
|
|
@@ -98,40 +116,59 @@ export const buttonStyles = css `
|
|
|
98
116
|
letter-spacing: var(--letter-spacing-tight);
|
|
99
117
|
line-height: var(--line-height-snug);
|
|
100
118
|
white-space: nowrap;
|
|
119
|
+
transition-property: background, box-shadow, filter, transform, border-color;
|
|
101
120
|
transition-duration: var(--duration-faster);
|
|
102
121
|
transition-timing-function: var(--ease-out-3);
|
|
103
122
|
}
|
|
104
123
|
|
|
105
|
-
/*
|
|
124
|
+
/* ---------------------------------------------------------------
|
|
125
|
+
* Interactive states — filled variant uses filter for hover/active
|
|
126
|
+
* --------------------------------------------------------------- */
|
|
127
|
+
|
|
128
|
+
/* Filled: darken on hover, more on active */
|
|
129
|
+
:host(:not([appearance="outline"]):not([appearance="ghost"]):not([appearance="link"]))
|
|
130
|
+
[part="root"]:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
131
|
+
filter: brightness(0.88);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:host(:not([appearance="outline"]):not([appearance="ghost"]):not([appearance="link"]))
|
|
135
|
+
[part="root"]:active:not(:disabled):not([aria-disabled="true"]) {
|
|
136
|
+
filter: brightness(0.80);
|
|
137
|
+
}
|
|
106
138
|
|
|
107
|
-
|
|
108
|
-
|
|
139
|
+
/* Ghost / outline: alpha overlay on foreground */
|
|
140
|
+
:host([appearance="ghost"]) [part="root"]:hover:not(:disabled):not([aria-disabled="true"]),
|
|
141
|
+
:host([appearance="outline"]) [part="root"]:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
142
|
+
background: oklch(from var(--foreground) l c h / 0.05);
|
|
109
143
|
}
|
|
110
144
|
|
|
111
|
-
[part="root"]:active:not(:disabled):not([aria-disabled="true"])
|
|
112
|
-
|
|
145
|
+
:host([appearance="ghost"]) [part="root"]:active:not(:disabled):not([aria-disabled="true"]),
|
|
146
|
+
:host([appearance="outline"]) [part="root"]:active:not(:disabled):not([aria-disabled="true"]) {
|
|
147
|
+
background: oklch(from var(--foreground) l c h / 0.10);
|
|
113
148
|
}
|
|
114
149
|
|
|
115
150
|
[part="root"]:focus-visible {
|
|
116
151
|
outline: none;
|
|
117
152
|
box-shadow:
|
|
118
|
-
0 0 0 var(--
|
|
119
|
-
0 0 0 var(--
|
|
153
|
+
0 0 0 var(--focus-ring-offset) var(--background),
|
|
154
|
+
0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width)) var(--focus-ring-color);
|
|
120
155
|
}
|
|
121
156
|
|
|
122
157
|
[part="root"]:disabled,
|
|
123
158
|
[part="root"][aria-disabled="true"] {
|
|
124
|
-
opacity: 0.
|
|
159
|
+
opacity: 0.4;
|
|
125
160
|
cursor: not-allowed;
|
|
126
161
|
}
|
|
127
162
|
|
|
128
|
-
:
|
|
163
|
+
/* Link appearance: underline on hover */
|
|
164
|
+
:host([appearance="link"])
|
|
129
165
|
[part="root"]:hover:not(:disabled):not([aria-disabled="true"]) {
|
|
130
166
|
text-decoration: underline;
|
|
131
167
|
text-underline-offset: 4px;
|
|
132
168
|
}
|
|
133
169
|
|
|
170
|
+
/* Open state (e.g. button is a popover trigger) */
|
|
134
171
|
:host([data-open]) [part="root"]:not(:disabled):not([aria-disabled="true"]) {
|
|
135
|
-
background: var(--
|
|
172
|
+
background: oklch(from var(--foreground) l c h / 0.05);
|
|
136
173
|
}
|
|
137
174
|
`;
|
package/components/calendar.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { css } from "lit";
|
|
2
|
+
import { type } from "../typography.js";
|
|
2
3
|
export const calendarStyles = css `
|
|
3
4
|
[part="root"] {
|
|
4
5
|
padding: var(--space-3);
|
|
5
6
|
font-family: var(--font-sans);
|
|
6
|
-
|
|
7
|
+
${type("sm")}
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
[part="header"] {
|
|
@@ -11,9 +12,9 @@ export const calendarStyles = css `
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
[part="heading"] {
|
|
14
|
-
|
|
15
|
+
${type("sm")}
|
|
15
16
|
font-weight: var(--font-weight-medium);
|
|
16
|
-
color: var(--
|
|
17
|
+
color: var(--text-1);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
[part="prev"],
|
|
@@ -21,7 +22,7 @@ export const calendarStyles = css `
|
|
|
21
22
|
width: var(--space-7);
|
|
22
23
|
height: var(--space-7);
|
|
23
24
|
border-radius: var(--radius-md);
|
|
24
|
-
color: var(--
|
|
25
|
+
color: var(--text-2);
|
|
25
26
|
font-size: var(--font-size-lg);
|
|
26
27
|
transition-property: background, color;
|
|
27
28
|
transition-duration: var(--duration-fast);
|
|
@@ -30,17 +31,17 @@ export const calendarStyles = css `
|
|
|
30
31
|
@media (hover: hover) {
|
|
31
32
|
[part="prev"]:hover,
|
|
32
33
|
[part="next"]:hover {
|
|
33
|
-
background: var(--
|
|
34
|
-
color: var(--
|
|
34
|
+
background: var(--surface-1);
|
|
35
|
+
color: var(--text-1);
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
[part="weekday"] {
|
|
39
40
|
width: var(--space-8);
|
|
40
41
|
height: var(--space-8);
|
|
41
|
-
|
|
42
|
-
font-weight: var(--font-weight-
|
|
43
|
-
color: var(--
|
|
42
|
+
${type("xs")}
|
|
43
|
+
font-weight: var(--font-weight-regular);
|
|
44
|
+
color: var(--text-2);
|
|
44
45
|
display: flex;
|
|
45
46
|
align-items: center;
|
|
46
47
|
justify-content: center;
|
|
@@ -50,39 +51,41 @@ export const calendarStyles = css `
|
|
|
50
51
|
width: var(--space-8);
|
|
51
52
|
height: var(--space-8);
|
|
52
53
|
border-radius: var(--radius-md);
|
|
53
|
-
|
|
54
|
-
color: var(--
|
|
54
|
+
${type("sm")}
|
|
55
|
+
color: var(--text-1);
|
|
55
56
|
transition-property: background, color;
|
|
56
57
|
transition-duration: var(--duration-fast);
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
@media (hover: hover) {
|
|
60
61
|
[part="day"]:hover:not(:disabled):not([data-selected]) {
|
|
61
|
-
background: var(--
|
|
62
|
+
background: var(--surface-1);
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
[part="day"][data-today]:not([data-selected]) {
|
|
66
|
-
background: var(--accent);
|
|
67
|
-
color: var(--accent-
|
|
67
|
+
background: var(--accent-subtle);
|
|
68
|
+
color: var(--accent-text);
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
[part="day"][data-selected] {
|
|
71
|
-
background: var(--
|
|
72
|
-
color: var(--
|
|
72
|
+
background: var(--accent);
|
|
73
|
+
color: oklch(from var(--accent) 0.98 0.01 h);
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
[part="day"][data-outside-month] {
|
|
76
|
-
color: var(--
|
|
77
|
-
opacity: 0.
|
|
77
|
+
color: var(--text-2);
|
|
78
|
+
opacity: 0.4;
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
[part="day"]:disabled {
|
|
81
|
-
opacity: 0.
|
|
82
|
+
opacity: 0.4;
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
[part="day"]:focus-visible {
|
|
85
|
-
outline:
|
|
86
|
-
|
|
86
|
+
outline: none;
|
|
87
|
+
box-shadow:
|
|
88
|
+
0 0 0 var(--focus-ring-offset) var(--background),
|
|
89
|
+
0 0 0 calc(var(--focus-ring-offset) + var(--focus-ring-width)) var(--focus-ring-color);
|
|
87
90
|
}
|
|
88
91
|
`;
|