@bug-on/md3-react 3.0.0 → 3.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/.turbo/turbo-build.log +42 -33
- package/CHANGELOG.md +14 -0
- package/dist/index.css +178 -0
- package/dist/index.d.mts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +35 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -18
- package/dist/index.mjs.map +1 -1
- package/dist/plugin.d.mts +1 -0
- package/dist/plugin.d.ts +1 -0
- package/dist/plugin.js +13 -0
- package/dist/plugin.js.map +1 -0
- package/dist/plugin.mjs +3 -0
- package/dist/plugin.mjs.map +1 -0
- package/package.json +8 -2
- package/scripts/copy-assets.js +36 -3
- package/src/index.ts +1 -1
- package/src/lib/theme-utils.ts +19 -4
- package/src/plugin.ts +12 -0
- package/src/ui/button.test.tsx +19 -10
- package/src/ui/button.tsx +2 -6
- package/src/ui/navigation-rail.tsx +9 -6
- package/src/ui/shared/constants.ts +13 -0
- package/src/ui/theme-provider/index.tsx +32 -7
- package/tsup.config.ts +3 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,33 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
✅
|
|
26
|
-
✅
|
|
27
|
-
✅
|
|
28
|
-
✅
|
|
29
|
-
✅
|
|
30
|
-
✅
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @bug-on/md3-react@3.0.1 build /Users/stark/Documents/GitHub/bug-on-md3-expressive/packages/react
|
|
4
|
+
> tsup
|
|
5
|
+
|
|
6
|
+
CLI Building entry: src/index.ts, src/plugin.ts
|
|
7
|
+
CLI Using tsconfig: tsconfig.json
|
|
8
|
+
CLI tsup v8.5.1
|
|
9
|
+
CLI Using tsup config: /Users/stark/Documents/GitHub/bug-on-md3-expressive/packages/react/tsup.config.ts
|
|
10
|
+
CLI Target: es2017
|
|
11
|
+
CJS Build start
|
|
12
|
+
ESM Build start
|
|
13
|
+
DTS Build start
|
|
14
|
+
ESM dist/plugin.mjs 119.00 B
|
|
15
|
+
ESM dist/plugin.mjs.map 91.00 B
|
|
16
|
+
ESM dist/index.mjs 481.27 KB
|
|
17
|
+
ESM dist/index.mjs.map 1.11 MB
|
|
18
|
+
ESM ⚡️ Build success in 1434ms
|
|
19
|
+
CJS dist/plugin.js 337.00 B
|
|
20
|
+
CJS dist/plugin.js.map 90.00 B
|
|
21
|
+
CJS dist/index.js 500.12 KB
|
|
22
|
+
CJS dist/index.js.map 1.11 MB
|
|
23
|
+
CJS ⚡️ Build success in 1434ms
|
|
24
|
+
Copying assets to dist...
|
|
25
|
+
✅ Copied src/assets to dist/assets
|
|
26
|
+
✅ Copied typography.css to dist/typography.css
|
|
27
|
+
✅ Bundled colors.css from md3-tokens into index.css
|
|
28
|
+
✅ Bundled shape.css from md3-tokens into index.css
|
|
29
|
+
✅ Built bundled index.css (tokens + component base) to dist/index.css
|
|
30
|
+
✅ Copied material-symbols-cdn.css to dist/material-symbols-cdn.css
|
|
31
|
+
✅ Copied material-symbols-self-hosted.css to dist/material-symbols-self-hosted.css
|
|
32
|
+
✅ Generated index.css.d.ts
|
|
33
|
+
✅ Generated typography.css.d.ts
|
|
34
|
+
✅ Generated material-symbols-cdn.css.d.ts
|
|
35
|
+
✅ Generated material-symbols-self-hosted.css.d.ts
|
|
36
|
+
✅ Prepended "use client" to index.js
|
|
37
|
+
✅ Prepended "use client" to index.mjs
|
|
38
|
+
DTS ⚡️ Build success in 5446ms
|
|
39
|
+
DTS dist/plugin.d.ts 48.00 B
|
|
40
|
+
DTS dist/index.d.ts 234.14 KB
|
|
41
|
+
DTS dist/plugin.d.mts 48.00 B
|
|
42
|
+
DTS dist/index.d.mts 234.14 KB
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @bug-on/md3-react
|
|
2
2
|
|
|
3
|
+
## 3.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- - **React**: Automatically bundle CSS tokens into `index.css` for easier setup.
|
|
8
|
+
- **React**: Re-export Tailwind plugin via `@bug-on/md3-react/plugin`.
|
|
9
|
+
- **React**: Add `@bug-on/md3-tailwind` and `@bug-on/md3-tokens` as direct dependencies.
|
|
10
|
+
- **Tokens**: Fix build warning when `index.css` is missing in src.
|
|
11
|
+
- **Tailwind**: Improved compatibility for Tailwind v3 and v4.
|
|
12
|
+
- **Build**: Optimized build process using native tsup features.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @bug-on/md3-tailwind@3.0.1
|
|
15
|
+
- @bug-on/md3-tokens@3.0.1
|
|
16
|
+
|
|
3
17
|
## 3.0.0
|
|
4
18
|
|
|
5
19
|
### Major Changes
|
package/dist/index.css
CHANGED
|
@@ -1,3 +1,181 @@
|
|
|
1
|
+
/* @bug-on/md3-tokens — MD3 System Color Tokens */
|
|
2
|
+
/* MD3 System Color Tokens — Light Theme (Baseline Scheme)
|
|
3
|
+
*
|
|
4
|
+
* Mapping: PaletteTokens → ColorLightTokens → CSS variable
|
|
5
|
+
* Reference: ColorLightTokens.kt, ColorDarkTokens.kt, PaletteTokens.kt
|
|
6
|
+
*/
|
|
7
|
+
:root {
|
|
8
|
+
/* ── Primary ─────────────────────────────────────────────────────────── */
|
|
9
|
+
--md-sys-color-primary: #6750a4; /* Primary40 */
|
|
10
|
+
--md-sys-color-on-primary: #ffffff; /* Primary100 */
|
|
11
|
+
--md-sys-color-primary-container: #eaddff; /* Primary90 */
|
|
12
|
+
--md-sys-color-on-primary-container: #21005d; /* Primary10 */
|
|
13
|
+
--md-sys-color-inverse-primary: #d0bcff; /* Primary80 */
|
|
14
|
+
|
|
15
|
+
/* ── Primary Fixed (stable across light/dark) ────────────────────────── */
|
|
16
|
+
--md-sys-color-primary-fixed: #eaddff; /* Primary90 */
|
|
17
|
+
--md-sys-color-primary-fixed-dim: #d0bcff; /* Primary80 */
|
|
18
|
+
--md-sys-color-on-primary-fixed: #21005d; /* Primary10 */
|
|
19
|
+
--md-sys-color-on-primary-fixed-variant: #4f378b; /* Primary30 */
|
|
20
|
+
|
|
21
|
+
/* ── Secondary ───────────────────────────────────────────────────────── */
|
|
22
|
+
--md-sys-color-secondary: #625b71; /* Secondary40 */
|
|
23
|
+
--md-sys-color-on-secondary: #ffffff; /* Secondary100 */
|
|
24
|
+
--md-sys-color-secondary-container: #e8def8; /* Secondary90 */
|
|
25
|
+
--md-sys-color-on-secondary-container: #1d192b; /* Secondary10 */
|
|
26
|
+
|
|
27
|
+
/* ── Secondary Fixed (stable across light/dark) ──────────────────────── */
|
|
28
|
+
--md-sys-color-secondary-fixed: #e8def8; /* Secondary90 */
|
|
29
|
+
--md-sys-color-secondary-fixed-dim: #ccc2dc; /* Secondary80 */
|
|
30
|
+
--md-sys-color-on-secondary-fixed: #1d192b; /* Secondary10 */
|
|
31
|
+
--md-sys-color-on-secondary-fixed-variant: #4a4458; /* Secondary30 */
|
|
32
|
+
|
|
33
|
+
/* ── Tertiary ────────────────────────────────────────────────────────── */
|
|
34
|
+
--md-sys-color-tertiary: #7d5260; /* Tertiary40 */
|
|
35
|
+
--md-sys-color-on-tertiary: #ffffff; /* Tertiary100 */
|
|
36
|
+
--md-sys-color-tertiary-container: #ffd8e4; /* Tertiary90 */
|
|
37
|
+
--md-sys-color-on-tertiary-container: #31111d; /* Tertiary10 */
|
|
38
|
+
|
|
39
|
+
/* ── Tertiary Fixed (stable across light/dark) ───────────────────────── */
|
|
40
|
+
--md-sys-color-tertiary-fixed: #ffd8e4; /* Tertiary90 */
|
|
41
|
+
--md-sys-color-tertiary-fixed-dim: #efb8c8; /* Tertiary80 */
|
|
42
|
+
--md-sys-color-on-tertiary-fixed: #31111d; /* Tertiary10 */
|
|
43
|
+
--md-sys-color-on-tertiary-fixed-variant: #633b48; /* Tertiary30 */
|
|
44
|
+
|
|
45
|
+
/* ── Error ───────────────────────────────────────────────────────────── */
|
|
46
|
+
--md-sys-color-error: #b3261e; /* Error40 */
|
|
47
|
+
--md-sys-color-on-error: #ffffff; /* Error100 */
|
|
48
|
+
--md-sys-color-error-container: #f9dedc; /* Error90 */
|
|
49
|
+
--md-sys-color-on-error-container: #410e0b; /* Error10 */
|
|
50
|
+
|
|
51
|
+
/* ── Surface ─────────────────────────────────────────────────────────── */
|
|
52
|
+
--md-sys-color-surface: #fef7ff; /* Neutral98 */
|
|
53
|
+
--md-sys-color-on-surface: #1c1b1f; /* Neutral10 */
|
|
54
|
+
--md-sys-color-surface-variant: #e7e0eb; /* NeutralVariant90 */
|
|
55
|
+
--md-sys-color-on-surface-variant: #49454f; /* NeutralVariant30 */
|
|
56
|
+
--md-sys-color-surface-dim: #ded8e1; /* Neutral87 */
|
|
57
|
+
--md-sys-color-surface-bright: #fef7ff; /* Neutral98 */
|
|
58
|
+
--md-sys-color-surface-tint: #6750a4; /* = primary */
|
|
59
|
+
--md-sys-color-surface-container-lowest: #ffffff; /* Neutral100 */
|
|
60
|
+
--md-sys-color-surface-container-low: #f7f2fa; /* Neutral96 */
|
|
61
|
+
--md-sys-color-surface-container: #f3edf7; /* Neutral94 */
|
|
62
|
+
--md-sys-color-surface-container-high: #ece6f0; /* Neutral92 */
|
|
63
|
+
--md-sys-color-surface-container-highest: #e6e0e9; /* Neutral90 */
|
|
64
|
+
|
|
65
|
+
/* ── Inverse Surface ─────────────────────────────────────────────────── */
|
|
66
|
+
--md-sys-color-inverse-surface: #313033; /* Neutral20 */
|
|
67
|
+
--md-sys-color-inverse-on-surface: #f4eff4; /* Neutral95 */
|
|
68
|
+
|
|
69
|
+
/* ── Background ──────────────────────────────────────────────────────── */
|
|
70
|
+
--md-sys-color-background: #fef7ff; /* Neutral98 — same as surface */
|
|
71
|
+
--md-sys-color-on-background: #1c1b1f; /* Neutral10 */
|
|
72
|
+
|
|
73
|
+
/* ── Outline ─────────────────────────────────────────────────────────── */
|
|
74
|
+
--md-sys-color-outline: #79747e; /* NeutralVariant50 */
|
|
75
|
+
--md-sys-color-outline-variant: #cac4d0; /* NeutralVariant80 */
|
|
76
|
+
|
|
77
|
+
/* ── Utility ─────────────────────────────────────────────────────────── */
|
|
78
|
+
--md-sys-color-scrim: #000000; /* Neutral0 */
|
|
79
|
+
--md-sys-color-shadow: #000000; /* Neutral0 */
|
|
80
|
+
|
|
81
|
+
/* ── Indicator tokens — Loading & Progress ───────────────────────────── */
|
|
82
|
+
--md-sys-color-indicator-active: var(--md-sys-color-primary);
|
|
83
|
+
--md-sys-color-indicator-container: var(--md-sys-color-secondary-container);
|
|
84
|
+
--md-sys-color-indicator-contained-active: var(
|
|
85
|
+
--md-sys-color-on-primary-container
|
|
86
|
+
);
|
|
87
|
+
--md-sys-color-indicator-contained-container: var(
|
|
88
|
+
--md-sys-color-primary-container
|
|
89
|
+
);
|
|
90
|
+
--md-sys-color-indicator-track: var(--md-sys-color-surface-variant);
|
|
91
|
+
--md-sys-color-indicator-stop: var(--md-sys-color-primary);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Dark Theme overrides
|
|
95
|
+
* Mapping: PaletteTokens → ColorDarkTokens → CSS variable
|
|
96
|
+
*/
|
|
97
|
+
[data-theme="dark"],
|
|
98
|
+
.dark {
|
|
99
|
+
/* ── Primary ─────────────────────────────────────────────────────────── */
|
|
100
|
+
--md-sys-color-primary: #d0bcff; /* Primary80 */
|
|
101
|
+
--md-sys-color-on-primary: #381e72; /* Primary20 */
|
|
102
|
+
--md-sys-color-primary-container: #4f378b; /* Primary30 */
|
|
103
|
+
--md-sys-color-on-primary-container: #eaddff; /* Primary90 */
|
|
104
|
+
--md-sys-color-inverse-primary: #6750a4; /* Primary40 */
|
|
105
|
+
|
|
106
|
+
/* ── Secondary ───────────────────────────────────────────────────────── */
|
|
107
|
+
--md-sys-color-secondary: #ccc2dc; /* Secondary80 */
|
|
108
|
+
--md-sys-color-on-secondary: #332d41; /* Secondary20 */
|
|
109
|
+
--md-sys-color-secondary-container: #4a4458; /* Secondary30 */
|
|
110
|
+
--md-sys-color-on-secondary-container: #e8def8; /* Secondary90 */
|
|
111
|
+
|
|
112
|
+
/* ── Tertiary ────────────────────────────────────────────────────────── */
|
|
113
|
+
--md-sys-color-tertiary: #efb8c8; /* Tertiary80 */
|
|
114
|
+
--md-sys-color-on-tertiary: #492532; /* Tertiary20 */
|
|
115
|
+
--md-sys-color-tertiary-container: #633b48; /* Tertiary30 */
|
|
116
|
+
--md-sys-color-on-tertiary-container: #ffd8e4; /* Tertiary90 */
|
|
117
|
+
|
|
118
|
+
/* ── Error ───────────────────────────────────────────────────────────── */
|
|
119
|
+
--md-sys-color-error: #f2b8b5; /* Error80 */
|
|
120
|
+
--md-sys-color-on-error: #601410; /* Error20 */
|
|
121
|
+
--md-sys-color-error-container: #8c1d18; /* Error30 */
|
|
122
|
+
--md-sys-color-on-error-container: #f9dedc; /* Error90 */
|
|
123
|
+
|
|
124
|
+
/* ── Surface ─────────────────────────────────────────────────────────── */
|
|
125
|
+
--md-sys-color-surface: #141218; /* Neutral6 */
|
|
126
|
+
--md-sys-color-on-surface: #e6e1e5; /* Neutral90 */
|
|
127
|
+
--md-sys-color-surface-variant: #49454f; /* NeutralVariant30 */
|
|
128
|
+
--md-sys-color-on-surface-variant: #cac4d0; /* NeutralVariant80 */
|
|
129
|
+
--md-sys-color-surface-dim: #141218; /* Neutral6 */
|
|
130
|
+
--md-sys-color-surface-bright: #3b383e; /* Neutral24 */
|
|
131
|
+
--md-sys-color-surface-tint: #d0bcff; /* = primary (dark) */
|
|
132
|
+
--md-sys-color-surface-container-lowest: #0f0d13; /* Neutral4 */
|
|
133
|
+
--md-sys-color-surface-container-low: #1d1b20; /* Neutral10 */
|
|
134
|
+
--md-sys-color-surface-container: #211f26; /* Neutral12 */
|
|
135
|
+
--md-sys-color-surface-container-high: #2b2930; /* Neutral17 */
|
|
136
|
+
--md-sys-color-surface-container-highest: #36343b; /* Neutral22 */
|
|
137
|
+
|
|
138
|
+
/* ── Inverse Surface ─────────────────────────────────────────────────── */
|
|
139
|
+
--md-sys-color-inverse-surface: #e6e1e5; /* Neutral90 */
|
|
140
|
+
--md-sys-color-inverse-on-surface: #313033; /* Neutral20 */
|
|
141
|
+
|
|
142
|
+
/* ── Background ──────────────────────────────────────────────────────── */
|
|
143
|
+
--md-sys-color-background: #141218; /* Neutral6 — same as dark surface */
|
|
144
|
+
--md-sys-color-on-background: #e6e1e5; /* Neutral90 */
|
|
145
|
+
|
|
146
|
+
/* ── Outline ─────────────────────────────────────────────────────────── */
|
|
147
|
+
--md-sys-color-outline: #938f99; /* NeutralVariant60 */
|
|
148
|
+
--md-sys-color-outline-variant: #49454f; /* NeutralVariant30 */
|
|
149
|
+
|
|
150
|
+
/* ── Utility ─────────────────────────────────────────────────────────── */
|
|
151
|
+
--md-sys-color-scrim: #000000;
|
|
152
|
+
--md-sys-color-shadow: #000000;
|
|
153
|
+
|
|
154
|
+
/* ── Indicator tokens — Dark ─────────────────────────────────────────── */
|
|
155
|
+
--md-sys-color-indicator-active: var(--md-sys-color-primary);
|
|
156
|
+
--md-sys-color-indicator-container: var(--md-sys-color-secondary-container);
|
|
157
|
+
--md-sys-color-indicator-contained-active: var(
|
|
158
|
+
--md-sys-color-on-primary-container
|
|
159
|
+
);
|
|
160
|
+
--md-sys-color-indicator-contained-container: var(
|
|
161
|
+
--md-sys-color-primary-container
|
|
162
|
+
);
|
|
163
|
+
--md-sys-color-indicator-track: var(--md-sys-color-surface-variant);
|
|
164
|
+
--md-sys-color-indicator-stop: var(--md-sys-color-primary);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:root {
|
|
168
|
+
--md-sys-shape-corner-none: 0px;
|
|
169
|
+
--md-sys-shape-corner-extra-small: 4px;
|
|
170
|
+
--md-sys-shape-corner-small: 8px;
|
|
171
|
+
--md-sys-shape-corner-medium: 12px;
|
|
172
|
+
--md-sys-shape-corner-large: 16px;
|
|
173
|
+
--md-sys-shape-corner-extra-large: 28px;
|
|
174
|
+
--md-sys-shape-corner-full: 9999px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
/* @bug-on/md3-react — Component Base Reset */
|
|
1
179
|
/* @bug-on/md3-react - Base Reset Styles */
|
|
2
180
|
|
|
3
181
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -92,7 +92,13 @@ interface MaterialSymbolsPreconnectProps {
|
|
|
92
92
|
}
|
|
93
93
|
declare function MaterialSymbolsPreconnect({ variants, }: MaterialSymbolsPreconnectProps): react_jsx_runtime.JSX.Element;
|
|
94
94
|
|
|
95
|
-
type ThemeMode = "light" | "dark";
|
|
95
|
+
type ThemeMode = "light" | "dark" | "system";
|
|
96
|
+
/**
|
|
97
|
+
* Resolves the effective color scheme from a ThemeMode.
|
|
98
|
+
* When mode is "system", reads the OS preference via matchMedia.
|
|
99
|
+
* Returns "light" as the safe default in SSR environments.
|
|
100
|
+
*/
|
|
101
|
+
declare function resolveMode(mode: ThemeMode): "light" | "dark";
|
|
96
102
|
interface MD3ColorScheme {
|
|
97
103
|
primary: string;
|
|
98
104
|
onPrimary: string;
|
|
@@ -146,7 +152,7 @@ interface MD3ColorScheme {
|
|
|
146
152
|
* Generate a complete MD3 color scheme from a source color hex string.
|
|
147
153
|
* Uses the HCT color space algorithm — same as Material You on Android.
|
|
148
154
|
*/
|
|
149
|
-
declare function generateM3Theme(sourceColorHex: string, mode?:
|
|
155
|
+
declare function generateM3Theme(sourceColorHex: string, mode?: "light" | "dark"): MD3ColorScheme;
|
|
150
156
|
/**
|
|
151
157
|
* Apply an MD3 dynamic color scheme to the document root as CSS custom properties.
|
|
152
158
|
* Sets both `--md-sys-color-*` tokens (used by components) and
|
|
@@ -5750,6 +5756,8 @@ interface ThemeContextValue {
|
|
|
5750
5756
|
setSourceColor: (color: string) => void;
|
|
5751
5757
|
mode: ThemeMode;
|
|
5752
5758
|
setMode: (mode: ThemeMode) => void;
|
|
5759
|
+
/** The resolved color scheme actually applied — always "light" or "dark". */
|
|
5760
|
+
effectiveMode: "light" | "dark";
|
|
5753
5761
|
}
|
|
5754
5762
|
interface MD3ThemeProviderProps {
|
|
5755
5763
|
children: ReactNode;
|
|
@@ -5787,7 +5795,7 @@ interface MD3ThemeProviderProps {
|
|
|
5787
5795
|
}
|
|
5788
5796
|
declare function MD3ThemeProvider({ children, sourceColor: initialSourceColor, defaultMode, persistToLocalStorage, typography: typographyProp, fontFamily, fontVariationAxes, enableSnackbar, }: MD3ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
5789
5797
|
declare function useTheme(): ThemeContextValue;
|
|
5790
|
-
declare function useThemeMode(): Pick<ThemeContextValue, "mode" | "setMode">;
|
|
5798
|
+
declare function useThemeMode(): Pick<ThemeContextValue, "mode" | "setMode" | "effectiveMode">;
|
|
5791
5799
|
|
|
5792
5800
|
/**
|
|
5793
5801
|
* A single entry in the Table of Contents.
|
|
@@ -6124,4 +6132,4 @@ declare const TypeScaleTokens: {
|
|
|
6124
6132
|
};
|
|
6125
6133
|
type TypeScaleTokensType = typeof TypeScaleTokens;
|
|
6126
6134
|
|
|
6127
|
-
export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, type AppBarColors, AppBarColumn, type AppBarColumnProps, type AppBarItem, type AppBarItemType, type AppBarMenuState, AppBarOverflowIndicator, type AppBarOverflowIndicatorProps, AppBarRow, type AppBarRowProps, type AppBarScrollBehavior, AppBarTokens, Badge, type BadgeProps, BadgedBox, type BadgedBoxProps, type BaseAppBarProps, type BaseButtonProps, type BaseIconButtonProps, BottomAppBar, type BottomAppBarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CHECK_ICON_VARIANTS, Card, type CardProps, type CaretConfig, Checkbox, type CheckboxProps, type CheckboxState, Chip, type ChipProps, type CircularProgressProps, CodeBlock, type CodeBlockProps, ContextMenu, ContextMenuContent, type ContextMenuContentProps, type ContextMenuProps, ContextMenuTrigger, type ContextMenuTriggerProps, DIVIDER_COLOR, DIVIDER_PADDING, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogFullScreenContent, type DialogFullScreenContentProps, DialogHeader, DialogIcon, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, DialogTrigger, Divider, type DividerProps, DockedToolbar, type DockedToolbarProps, Drawer, DrawerClose, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, type DrawerProps, DrawerTitle, DrawerTrigger, FAB, FABMenu, FABMenuItem, type FABMenuItemData, type FABMenuItemProps, type FABMenuProps, FABPosition, type FABPositionProps, type FABProps, FAST_EFFECTS_TRANSITION, FAST_SPATIAL_SPRING, type FlexibleAppBarProps, GROUP_SHAPES, ITEM_SHAPE_CLASSES, Icon, IconButton, type IconButtonProps, type IconProps, LargeFlexibleAppBar, type LinearProgressProps, LoadingIndicator, type LoadingIndicatorProps, type MD3ColorScheme, type MD3ColorStyle, type MD3Shape, type MD3Size, MD3ThemeProvider, type MD3ThemeProviderProps, MD3_EXPRESSIVE_FONT_VARIATION, MENU_CHECK_ICON_SIZE, MENU_CONTAINER_VARIANTS, MENU_GROUP_GAP, MENU_ICON_SIZE, MENU_ITEM_MIN_HEIGHT, MENU_MAX_WIDTH, MENU_MIN_WIDTH, MaterialSymbolsPreconnect, MediumFlexibleAppBar, Menu, type MenuColorVariant, MenuContent, type MenuContentProps, MenuDivider, type MenuDividerProps, MenuGroup, type MenuGroupPosition, type MenuGroupProps, MenuItem, type MenuItemPosition, type MenuItemProps, type MenuPrimitive, type MenuProps, MenuProvider, MenuTrigger, type MenuTriggerProps, type MenuVariant, NavigationRail, NavigationRailItem, type NavigationRailItemProps, type NavigationRailLabelVisibility, type NavigationRailProps, type NavigationRailVariant, PlainTooltip, type PlainTooltipProps, type PolymorphicProps, type PolymorphicRef, ProgressIndicator, type ProgressIndicatorProps, RadioButton, type RadioButtonColors, type RadioButtonProps, RadioGroup, type RadioGroupProps, RangeSlider, type RangeSliderProps, RichTooltip, type RichTooltipProps, Ripple, type RippleOrigin, type RippleProps, SEARCH_BAR_EXPAND_SPRING, SEARCH_COLORS, SEARCH_DOCKED_REVEAL_SPRING, SEARCH_FULLSCREEN_SPRING, SEARCH_TYPOGRAPHY, SEARCH_VIEW_SPRING, STANDARD_COLORS, SUBMENU_CONTAINER_VARIANTS, ScrollArea, type ScrollAreaOrientation, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaType, Search, SearchAppBar, type SearchAppBarProps, SearchBar, type SearchBarVariant, type SearchProps, type SearchStyleType, SearchTokens, type SearchVariant, SearchView, SearchViewContainer, SearchViewDocked, SearchViewFullScreen, type SearchViewProps, Slider, SliderColors, type SliderOrientation, type SliderProps, SliderTokens, type SliderTrackSize, type SliderVariant, SmallAppBar, type SmallAppBarProps, Snackbar, type SnackbarData, type SnackbarDuration, SnackbarHost, type SnackbarHostProps, type SnackbarProps, SnackbarProvider, type SnackbarResult, type SnackbarVisuals, SubMenu, type SubMenuProps, Switch, SwitchColors, type SwitchProps, SwitchTokens, Tab, type TabProps, TableOfContents, type TableOfContentsProps, Tabs, TabsColors, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTokens, type TabsVariant, Text, TextField, type TextFieldHandle, type TextFieldInputType, type TextFieldProps, type TextFieldTrailingIconMode, type TextFieldVariant, type TextProps, type TextStyle, type ThemeMode, type TitleAlignment, type ToCItem, ToggleFAB, type ToggleFABProps, TooltipBox, type TooltipBoxProps, TooltipCaretShape, type TooltipPlacement, type TooltipState, type TooltipStateConfig, TooltipTokens, type TooltipTrigger, TriStateCheckbox, type TriStateCheckboxProps, TypeScaleTokens, type TypeScaleTokensType, Typography, TypographyContext, TypographyKeyTokens, TypographyProvider, type TypographyProviderProps, TypographyTokens, type UseAppBarScrollReturn, type UseRippleStateOptions, type UseSnackbarStateReturn, VIBRANT_COLORS, VerticalMenu, VerticalMenuContent, type VerticalMenuContentProps, VerticalMenuDivider, type VerticalMenuDividerProps, VerticalMenuGroup, type VerticalMenuGroupProps, type VerticalMenuProps, type VerticalMenuSeparatorStyle, appBarTypography, applyTheme, buildWavePath, cn, generateM3Theme, useAppBarScroll, useRipple$1 as useDOMRipple, useMediaQuery, useMenuContext, useRipple, useRippleState, useSearchKeyboard, useSnackbar, useSnackbarState, useTheme, useThemeMode, useTooltipPosition, useTooltipState, useTypography };
|
|
6135
|
+
export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, type AppBarColors, AppBarColumn, type AppBarColumnProps, type AppBarItem, type AppBarItemType, type AppBarMenuState, AppBarOverflowIndicator, type AppBarOverflowIndicatorProps, AppBarRow, type AppBarRowProps, type AppBarScrollBehavior, AppBarTokens, Badge, type BadgeProps, BadgedBox, type BadgedBoxProps, type BaseAppBarProps, type BaseButtonProps, type BaseIconButtonProps, BottomAppBar, type BottomAppBarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CHECK_ICON_VARIANTS, Card, type CardProps, type CaretConfig, Checkbox, type CheckboxProps, type CheckboxState, Chip, type ChipProps, type CircularProgressProps, CodeBlock, type CodeBlockProps, ContextMenu, ContextMenuContent, type ContextMenuContentProps, type ContextMenuProps, ContextMenuTrigger, type ContextMenuTriggerProps, DIVIDER_COLOR, DIVIDER_PADDING, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogFullScreenContent, type DialogFullScreenContentProps, DialogHeader, DialogIcon, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, DialogTrigger, Divider, type DividerProps, DockedToolbar, type DockedToolbarProps, Drawer, DrawerClose, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, type DrawerProps, DrawerTitle, DrawerTrigger, FAB, FABMenu, FABMenuItem, type FABMenuItemData, type FABMenuItemProps, type FABMenuProps, FABPosition, type FABPositionProps, type FABProps, FAST_EFFECTS_TRANSITION, FAST_SPATIAL_SPRING, type FlexibleAppBarProps, GROUP_SHAPES, ITEM_SHAPE_CLASSES, Icon, IconButton, type IconButtonProps, type IconProps, LargeFlexibleAppBar, type LinearProgressProps, LoadingIndicator, type LoadingIndicatorProps, type MD3ColorScheme, type MD3ColorStyle, type MD3Shape, type MD3Size, MD3ThemeProvider, type MD3ThemeProviderProps, MD3_EXPRESSIVE_FONT_VARIATION, MENU_CHECK_ICON_SIZE, MENU_CONTAINER_VARIANTS, MENU_GROUP_GAP, MENU_ICON_SIZE, MENU_ITEM_MIN_HEIGHT, MENU_MAX_WIDTH, MENU_MIN_WIDTH, MaterialSymbolsPreconnect, MediumFlexibleAppBar, Menu, type MenuColorVariant, MenuContent, type MenuContentProps, MenuDivider, type MenuDividerProps, MenuGroup, type MenuGroupPosition, type MenuGroupProps, MenuItem, type MenuItemPosition, type MenuItemProps, type MenuPrimitive, type MenuProps, MenuProvider, MenuTrigger, type MenuTriggerProps, type MenuVariant, NavigationRail, NavigationRailItem, type NavigationRailItemProps, type NavigationRailLabelVisibility, type NavigationRailProps, type NavigationRailVariant, PlainTooltip, type PlainTooltipProps, type PolymorphicProps, type PolymorphicRef, ProgressIndicator, type ProgressIndicatorProps, RadioButton, type RadioButtonColors, type RadioButtonProps, RadioGroup, type RadioGroupProps, RangeSlider, type RangeSliderProps, RichTooltip, type RichTooltipProps, Ripple, type RippleOrigin, type RippleProps, SEARCH_BAR_EXPAND_SPRING, SEARCH_COLORS, SEARCH_DOCKED_REVEAL_SPRING, SEARCH_FULLSCREEN_SPRING, SEARCH_TYPOGRAPHY, SEARCH_VIEW_SPRING, STANDARD_COLORS, SUBMENU_CONTAINER_VARIANTS, ScrollArea, type ScrollAreaOrientation, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaType, Search, SearchAppBar, type SearchAppBarProps, SearchBar, type SearchBarVariant, type SearchProps, type SearchStyleType, SearchTokens, type SearchVariant, SearchView, SearchViewContainer, SearchViewDocked, SearchViewFullScreen, type SearchViewProps, Slider, SliderColors, type SliderOrientation, type SliderProps, SliderTokens, type SliderTrackSize, type SliderVariant, SmallAppBar, type SmallAppBarProps, Snackbar, type SnackbarData, type SnackbarDuration, SnackbarHost, type SnackbarHostProps, type SnackbarProps, SnackbarProvider, type SnackbarResult, type SnackbarVisuals, SubMenu, type SubMenuProps, Switch, SwitchColors, type SwitchProps, SwitchTokens, Tab, type TabProps, TableOfContents, type TableOfContentsProps, Tabs, TabsColors, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTokens, type TabsVariant, Text, TextField, type TextFieldHandle, type TextFieldInputType, type TextFieldProps, type TextFieldTrailingIconMode, type TextFieldVariant, type TextProps, type TextStyle, type ThemeMode, type TitleAlignment, type ToCItem, ToggleFAB, type ToggleFABProps, TooltipBox, type TooltipBoxProps, TooltipCaretShape, type TooltipPlacement, type TooltipState, type TooltipStateConfig, TooltipTokens, type TooltipTrigger, TriStateCheckbox, type TriStateCheckboxProps, TypeScaleTokens, type TypeScaleTokensType, Typography, TypographyContext, TypographyKeyTokens, TypographyProvider, type TypographyProviderProps, TypographyTokens, type UseAppBarScrollReturn, type UseRippleStateOptions, type UseSnackbarStateReturn, VIBRANT_COLORS, VerticalMenu, VerticalMenuContent, type VerticalMenuContentProps, VerticalMenuDivider, type VerticalMenuDividerProps, VerticalMenuGroup, type VerticalMenuGroupProps, type VerticalMenuProps, type VerticalMenuSeparatorStyle, appBarTypography, applyTheme, buildWavePath, cn, generateM3Theme, resolveMode, useAppBarScroll, useRipple$1 as useDOMRipple, useMediaQuery, useMenuContext, useRipple, useRippleState, useSearchKeyboard, useSnackbar, useSnackbarState, useTheme, useThemeMode, useTooltipPosition, useTooltipState, useTypography };
|
package/dist/index.d.ts
CHANGED
|
@@ -92,7 +92,13 @@ interface MaterialSymbolsPreconnectProps {
|
|
|
92
92
|
}
|
|
93
93
|
declare function MaterialSymbolsPreconnect({ variants, }: MaterialSymbolsPreconnectProps): react_jsx_runtime.JSX.Element;
|
|
94
94
|
|
|
95
|
-
type ThemeMode = "light" | "dark";
|
|
95
|
+
type ThemeMode = "light" | "dark" | "system";
|
|
96
|
+
/**
|
|
97
|
+
* Resolves the effective color scheme from a ThemeMode.
|
|
98
|
+
* When mode is "system", reads the OS preference via matchMedia.
|
|
99
|
+
* Returns "light" as the safe default in SSR environments.
|
|
100
|
+
*/
|
|
101
|
+
declare function resolveMode(mode: ThemeMode): "light" | "dark";
|
|
96
102
|
interface MD3ColorScheme {
|
|
97
103
|
primary: string;
|
|
98
104
|
onPrimary: string;
|
|
@@ -146,7 +152,7 @@ interface MD3ColorScheme {
|
|
|
146
152
|
* Generate a complete MD3 color scheme from a source color hex string.
|
|
147
153
|
* Uses the HCT color space algorithm — same as Material You on Android.
|
|
148
154
|
*/
|
|
149
|
-
declare function generateM3Theme(sourceColorHex: string, mode?:
|
|
155
|
+
declare function generateM3Theme(sourceColorHex: string, mode?: "light" | "dark"): MD3ColorScheme;
|
|
150
156
|
/**
|
|
151
157
|
* Apply an MD3 dynamic color scheme to the document root as CSS custom properties.
|
|
152
158
|
* Sets both `--md-sys-color-*` tokens (used by components) and
|
|
@@ -5750,6 +5756,8 @@ interface ThemeContextValue {
|
|
|
5750
5756
|
setSourceColor: (color: string) => void;
|
|
5751
5757
|
mode: ThemeMode;
|
|
5752
5758
|
setMode: (mode: ThemeMode) => void;
|
|
5759
|
+
/** The resolved color scheme actually applied — always "light" or "dark". */
|
|
5760
|
+
effectiveMode: "light" | "dark";
|
|
5753
5761
|
}
|
|
5754
5762
|
interface MD3ThemeProviderProps {
|
|
5755
5763
|
children: ReactNode;
|
|
@@ -5787,7 +5795,7 @@ interface MD3ThemeProviderProps {
|
|
|
5787
5795
|
}
|
|
5788
5796
|
declare function MD3ThemeProvider({ children, sourceColor: initialSourceColor, defaultMode, persistToLocalStorage, typography: typographyProp, fontFamily, fontVariationAxes, enableSnackbar, }: MD3ThemeProviderProps): react_jsx_runtime.JSX.Element;
|
|
5789
5797
|
declare function useTheme(): ThemeContextValue;
|
|
5790
|
-
declare function useThemeMode(): Pick<ThemeContextValue, "mode" | "setMode">;
|
|
5798
|
+
declare function useThemeMode(): Pick<ThemeContextValue, "mode" | "setMode" | "effectiveMode">;
|
|
5791
5799
|
|
|
5792
5800
|
/**
|
|
5793
5801
|
* A single entry in the Table of Contents.
|
|
@@ -6124,4 +6132,4 @@ declare const TypeScaleTokens: {
|
|
|
6124
6132
|
};
|
|
6125
6133
|
type TypeScaleTokensType = typeof TypeScaleTokens;
|
|
6126
6134
|
|
|
6127
|
-
export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, type AppBarColors, AppBarColumn, type AppBarColumnProps, type AppBarItem, type AppBarItemType, type AppBarMenuState, AppBarOverflowIndicator, type AppBarOverflowIndicatorProps, AppBarRow, type AppBarRowProps, type AppBarScrollBehavior, AppBarTokens, Badge, type BadgeProps, BadgedBox, type BadgedBoxProps, type BaseAppBarProps, type BaseButtonProps, type BaseIconButtonProps, BottomAppBar, type BottomAppBarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CHECK_ICON_VARIANTS, Card, type CardProps, type CaretConfig, Checkbox, type CheckboxProps, type CheckboxState, Chip, type ChipProps, type CircularProgressProps, CodeBlock, type CodeBlockProps, ContextMenu, ContextMenuContent, type ContextMenuContentProps, type ContextMenuProps, ContextMenuTrigger, type ContextMenuTriggerProps, DIVIDER_COLOR, DIVIDER_PADDING, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogFullScreenContent, type DialogFullScreenContentProps, DialogHeader, DialogIcon, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, DialogTrigger, Divider, type DividerProps, DockedToolbar, type DockedToolbarProps, Drawer, DrawerClose, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, type DrawerProps, DrawerTitle, DrawerTrigger, FAB, FABMenu, FABMenuItem, type FABMenuItemData, type FABMenuItemProps, type FABMenuProps, FABPosition, type FABPositionProps, type FABProps, FAST_EFFECTS_TRANSITION, FAST_SPATIAL_SPRING, type FlexibleAppBarProps, GROUP_SHAPES, ITEM_SHAPE_CLASSES, Icon, IconButton, type IconButtonProps, type IconProps, LargeFlexibleAppBar, type LinearProgressProps, LoadingIndicator, type LoadingIndicatorProps, type MD3ColorScheme, type MD3ColorStyle, type MD3Shape, type MD3Size, MD3ThemeProvider, type MD3ThemeProviderProps, MD3_EXPRESSIVE_FONT_VARIATION, MENU_CHECK_ICON_SIZE, MENU_CONTAINER_VARIANTS, MENU_GROUP_GAP, MENU_ICON_SIZE, MENU_ITEM_MIN_HEIGHT, MENU_MAX_WIDTH, MENU_MIN_WIDTH, MaterialSymbolsPreconnect, MediumFlexibleAppBar, Menu, type MenuColorVariant, MenuContent, type MenuContentProps, MenuDivider, type MenuDividerProps, MenuGroup, type MenuGroupPosition, type MenuGroupProps, MenuItem, type MenuItemPosition, type MenuItemProps, type MenuPrimitive, type MenuProps, MenuProvider, MenuTrigger, type MenuTriggerProps, type MenuVariant, NavigationRail, NavigationRailItem, type NavigationRailItemProps, type NavigationRailLabelVisibility, type NavigationRailProps, type NavigationRailVariant, PlainTooltip, type PlainTooltipProps, type PolymorphicProps, type PolymorphicRef, ProgressIndicator, type ProgressIndicatorProps, RadioButton, type RadioButtonColors, type RadioButtonProps, RadioGroup, type RadioGroupProps, RangeSlider, type RangeSliderProps, RichTooltip, type RichTooltipProps, Ripple, type RippleOrigin, type RippleProps, SEARCH_BAR_EXPAND_SPRING, SEARCH_COLORS, SEARCH_DOCKED_REVEAL_SPRING, SEARCH_FULLSCREEN_SPRING, SEARCH_TYPOGRAPHY, SEARCH_VIEW_SPRING, STANDARD_COLORS, SUBMENU_CONTAINER_VARIANTS, ScrollArea, type ScrollAreaOrientation, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaType, Search, SearchAppBar, type SearchAppBarProps, SearchBar, type SearchBarVariant, type SearchProps, type SearchStyleType, SearchTokens, type SearchVariant, SearchView, SearchViewContainer, SearchViewDocked, SearchViewFullScreen, type SearchViewProps, Slider, SliderColors, type SliderOrientation, type SliderProps, SliderTokens, type SliderTrackSize, type SliderVariant, SmallAppBar, type SmallAppBarProps, Snackbar, type SnackbarData, type SnackbarDuration, SnackbarHost, type SnackbarHostProps, type SnackbarProps, SnackbarProvider, type SnackbarResult, type SnackbarVisuals, SubMenu, type SubMenuProps, Switch, SwitchColors, type SwitchProps, SwitchTokens, Tab, type TabProps, TableOfContents, type TableOfContentsProps, Tabs, TabsColors, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTokens, type TabsVariant, Text, TextField, type TextFieldHandle, type TextFieldInputType, type TextFieldProps, type TextFieldTrailingIconMode, type TextFieldVariant, type TextProps, type TextStyle, type ThemeMode, type TitleAlignment, type ToCItem, ToggleFAB, type ToggleFABProps, TooltipBox, type TooltipBoxProps, TooltipCaretShape, type TooltipPlacement, type TooltipState, type TooltipStateConfig, TooltipTokens, type TooltipTrigger, TriStateCheckbox, type TriStateCheckboxProps, TypeScaleTokens, type TypeScaleTokensType, Typography, TypographyContext, TypographyKeyTokens, TypographyProvider, type TypographyProviderProps, TypographyTokens, type UseAppBarScrollReturn, type UseRippleStateOptions, type UseSnackbarStateReturn, VIBRANT_COLORS, VerticalMenu, VerticalMenuContent, type VerticalMenuContentProps, VerticalMenuDivider, type VerticalMenuDividerProps, VerticalMenuGroup, type VerticalMenuGroupProps, type VerticalMenuProps, type VerticalMenuSeparatorStyle, appBarTypography, applyTheme, buildWavePath, cn, generateM3Theme, useAppBarScroll, useRipple$1 as useDOMRipple, useMediaQuery, useMenuContext, useRipple, useRippleState, useSearchKeyboard, useSnackbar, useSnackbarState, useTheme, useThemeMode, useTooltipPosition, useTooltipState, useTypography };
|
|
6135
|
+
export { APP_BAR_BOTTOM_SPRING, APP_BAR_COLORS, APP_BAR_COLOR_TRANSITION, APP_BAR_ENTER_ALWAYS_SPRING, APP_BAR_TITLE_FADE, type AppBarColors, AppBarColumn, type AppBarColumnProps, type AppBarItem, type AppBarItemType, type AppBarMenuState, AppBarOverflowIndicator, type AppBarOverflowIndicatorProps, AppBarRow, type AppBarRowProps, type AppBarScrollBehavior, AppBarTokens, Badge, type BadgeProps, BadgedBox, type BadgedBoxProps, type BaseAppBarProps, type BaseButtonProps, type BaseIconButtonProps, BottomAppBar, type BottomAppBarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CHECK_ICON_VARIANTS, Card, type CardProps, type CaretConfig, Checkbox, type CheckboxProps, type CheckboxState, Chip, type ChipProps, type CircularProgressProps, CodeBlock, type CodeBlockProps, ContextMenu, ContextMenuContent, type ContextMenuContentProps, type ContextMenuProps, ContextMenuTrigger, type ContextMenuTriggerProps, DIVIDER_COLOR, DIVIDER_PADDING, Dialog, DialogBody, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogFullScreenContent, type DialogFullScreenContentProps, DialogHeader, DialogIcon, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, DialogTrigger, Divider, type DividerProps, DockedToolbar, type DockedToolbarProps, Drawer, DrawerClose, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, type DrawerProps, DrawerTitle, DrawerTrigger, FAB, FABMenu, FABMenuItem, type FABMenuItemData, type FABMenuItemProps, type FABMenuProps, FABPosition, type FABPositionProps, type FABProps, FAST_EFFECTS_TRANSITION, FAST_SPATIAL_SPRING, type FlexibleAppBarProps, GROUP_SHAPES, ITEM_SHAPE_CLASSES, Icon, IconButton, type IconButtonProps, type IconProps, LargeFlexibleAppBar, type LinearProgressProps, LoadingIndicator, type LoadingIndicatorProps, type MD3ColorScheme, type MD3ColorStyle, type MD3Shape, type MD3Size, MD3ThemeProvider, type MD3ThemeProviderProps, MD3_EXPRESSIVE_FONT_VARIATION, MENU_CHECK_ICON_SIZE, MENU_CONTAINER_VARIANTS, MENU_GROUP_GAP, MENU_ICON_SIZE, MENU_ITEM_MIN_HEIGHT, MENU_MAX_WIDTH, MENU_MIN_WIDTH, MaterialSymbolsPreconnect, MediumFlexibleAppBar, Menu, type MenuColorVariant, MenuContent, type MenuContentProps, MenuDivider, type MenuDividerProps, MenuGroup, type MenuGroupPosition, type MenuGroupProps, MenuItem, type MenuItemPosition, type MenuItemProps, type MenuPrimitive, type MenuProps, MenuProvider, MenuTrigger, type MenuTriggerProps, type MenuVariant, NavigationRail, NavigationRailItem, type NavigationRailItemProps, type NavigationRailLabelVisibility, type NavigationRailProps, type NavigationRailVariant, PlainTooltip, type PlainTooltipProps, type PolymorphicProps, type PolymorphicRef, ProgressIndicator, type ProgressIndicatorProps, RadioButton, type RadioButtonColors, type RadioButtonProps, RadioGroup, type RadioGroupProps, RangeSlider, type RangeSliderProps, RichTooltip, type RichTooltipProps, Ripple, type RippleOrigin, type RippleProps, SEARCH_BAR_EXPAND_SPRING, SEARCH_COLORS, SEARCH_DOCKED_REVEAL_SPRING, SEARCH_FULLSCREEN_SPRING, SEARCH_TYPOGRAPHY, SEARCH_VIEW_SPRING, STANDARD_COLORS, SUBMENU_CONTAINER_VARIANTS, ScrollArea, type ScrollAreaOrientation, type ScrollAreaProps, ScrollAreaScrollbar, type ScrollAreaType, Search, SearchAppBar, type SearchAppBarProps, SearchBar, type SearchBarVariant, type SearchProps, type SearchStyleType, SearchTokens, type SearchVariant, SearchView, SearchViewContainer, SearchViewDocked, SearchViewFullScreen, type SearchViewProps, Slider, SliderColors, type SliderOrientation, type SliderProps, SliderTokens, type SliderTrackSize, type SliderVariant, SmallAppBar, type SmallAppBarProps, Snackbar, type SnackbarData, type SnackbarDuration, SnackbarHost, type SnackbarHostProps, type SnackbarProps, SnackbarProvider, type SnackbarResult, type SnackbarVisuals, SubMenu, type SubMenuProps, Switch, SwitchColors, type SwitchProps, SwitchTokens, Tab, type TabProps, TableOfContents, type TableOfContentsProps, Tabs, TabsColors, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsProps, TabsTokens, type TabsVariant, Text, TextField, type TextFieldHandle, type TextFieldInputType, type TextFieldProps, type TextFieldTrailingIconMode, type TextFieldVariant, type TextProps, type TextStyle, type ThemeMode, type TitleAlignment, type ToCItem, ToggleFAB, type ToggleFABProps, TooltipBox, type TooltipBoxProps, TooltipCaretShape, type TooltipPlacement, type TooltipState, type TooltipStateConfig, TooltipTokens, type TooltipTrigger, TriStateCheckbox, type TriStateCheckboxProps, TypeScaleTokens, type TypeScaleTokensType, Typography, TypographyContext, TypographyKeyTokens, TypographyProvider, type TypographyProviderProps, TypographyTokens, type UseAppBarScrollReturn, type UseRippleStateOptions, type UseSnackbarStateReturn, VIBRANT_COLORS, VerticalMenu, VerticalMenuContent, type VerticalMenuContentProps, VerticalMenuDivider, type VerticalMenuDividerProps, VerticalMenuGroup, type VerticalMenuGroupProps, type VerticalMenuProps, type VerticalMenuSeparatorStyle, appBarTypography, applyTheme, buildWavePath, cn, generateM3Theme, resolveMode, useAppBarScroll, useRipple$1 as useDOMRipple, useMediaQuery, useMenuContext, useRipple, useRippleState, useSearchKeyboard, useSnackbar, useSnackbarState, useTheme, useThemeMode, useTooltipPosition, useTooltipState, useTypography };
|
package/dist/index.js
CHANGED
|
@@ -178,6 +178,11 @@ function MaterialSymbolsPreconnect({
|
|
|
178
178
|
)
|
|
179
179
|
] });
|
|
180
180
|
}
|
|
181
|
+
function resolveMode(mode) {
|
|
182
|
+
if (mode !== "system") return mode;
|
|
183
|
+
if (typeof window === "undefined") return "light";
|
|
184
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
185
|
+
}
|
|
181
186
|
function generateM3Theme(sourceColorHex, mode = "light") {
|
|
182
187
|
const sourceColor = materialColorUtilities.argbFromHex(sourceColorHex);
|
|
183
188
|
const theme = materialColorUtilities.themeFromSourceColor(sourceColor);
|
|
@@ -236,13 +241,14 @@ function generateM3Theme(sourceColorHex, mode = "light") {
|
|
|
236
241
|
};
|
|
237
242
|
}
|
|
238
243
|
function applyTheme(sourceColorHex, mode = "light", root = document.documentElement) {
|
|
239
|
-
const
|
|
244
|
+
const resolved = resolveMode(mode);
|
|
245
|
+
const colors = generateM3Theme(sourceColorHex, resolved);
|
|
240
246
|
for (const [key, value] of Object.entries(colors)) {
|
|
241
247
|
const kebabKey = key.replace(/[A-Z]/g, (m47) => `-${m47.toLowerCase()}`);
|
|
242
248
|
root.style.setProperty(`--md-sys-color-${kebabKey}`, value);
|
|
243
249
|
root.style.setProperty(`--color-m3-${kebabKey}`, value);
|
|
244
250
|
}
|
|
245
|
-
root.setAttribute("data-theme",
|
|
251
|
+
root.setAttribute("data-theme", resolved);
|
|
246
252
|
}
|
|
247
253
|
function cn(...inputs) {
|
|
248
254
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
@@ -1111,6 +1117,11 @@ var SPRING_TRANSITION = {
|
|
|
1111
1117
|
bounce: 0,
|
|
1112
1118
|
duration: 0.3
|
|
1113
1119
|
};
|
|
1120
|
+
var SPRING_TRANSITION_EXPRESSIVE = {
|
|
1121
|
+
type: "spring",
|
|
1122
|
+
bounce: 0.35,
|
|
1123
|
+
duration: 0.4
|
|
1124
|
+
};
|
|
1114
1125
|
var ICON_SPAN_VARIANTS = {
|
|
1115
1126
|
initial: { scale: 0.01 },
|
|
1116
1127
|
animate: { scale: 1 },
|
|
@@ -3951,15 +3962,12 @@ var buttonColorVariants = classVarianceAuthority.cva(
|
|
|
3951
3962
|
defaultVariants: { colorStyle: "filled" }
|
|
3952
3963
|
}
|
|
3953
3964
|
);
|
|
3954
|
-
function toSentenceCase(text) {
|
|
3955
|
-
return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();
|
|
3956
|
-
}
|
|
3957
3965
|
function resolveLabel(children, asChild) {
|
|
3958
3966
|
if (asChild) {
|
|
3959
3967
|
const child = React38__namespace.Children.only(children);
|
|
3960
3968
|
return child.props.children;
|
|
3961
3969
|
}
|
|
3962
|
-
return
|
|
3970
|
+
return children;
|
|
3963
3971
|
}
|
|
3964
3972
|
var MOTION_PROP_KEYS = [
|
|
3965
3973
|
"animate",
|
|
@@ -4148,7 +4156,7 @@ var ButtonComponent = React38__namespace.forwardRef(
|
|
|
4148
4156
|
react.m.span,
|
|
4149
4157
|
{
|
|
4150
4158
|
layout: "size",
|
|
4151
|
-
className: "inline-flex items-center gap-[inherit]",
|
|
4159
|
+
className: "inline-flex items-center h-full gap-[inherit]",
|
|
4152
4160
|
transition: SPRING_TRANSITION,
|
|
4153
4161
|
children: labelText
|
|
4154
4162
|
}
|
|
@@ -7010,11 +7018,11 @@ function ActivePill({ layoutId, disableInitial = false }) {
|
|
|
7010
7018
|
{
|
|
7011
7019
|
layoutId,
|
|
7012
7020
|
className: "absolute inset-0 bg-m3-secondary-container pointer-events-none",
|
|
7013
|
-
style: { borderRadius: 9999, zIndex: 0 },
|
|
7014
|
-
initial: disableInitial ? false : { opacity: 0 },
|
|
7015
|
-
animate: { opacity: 1 },
|
|
7016
|
-
exit: { opacity: 0 },
|
|
7017
|
-
transition:
|
|
7021
|
+
style: { borderRadius: 9999, zIndex: 0, originX: 0.5, originY: 0.5 },
|
|
7022
|
+
initial: disableInitial ? false : { opacity: 0, scale: 0.5 },
|
|
7023
|
+
animate: { opacity: 1, scale: 1 },
|
|
7024
|
+
exit: { opacity: 0, scale: 0.5, transition: { duration: 0.15 } },
|
|
7025
|
+
transition: SPRING_TRANSITION_EXPRESSIVE
|
|
7018
7026
|
}
|
|
7019
7027
|
);
|
|
7020
7028
|
}
|
|
@@ -13071,7 +13079,8 @@ function MD3ThemeProvider({
|
|
|
13071
13079
|
STORAGE_KEY_MODE
|
|
13072
13080
|
);
|
|
13073
13081
|
if (savedColor) setSourceColor(savedColor);
|
|
13074
|
-
if (savedMode === "light" || savedMode === "dark"
|
|
13082
|
+
if (savedMode === "light" || savedMode === "dark" || savedMode === "system")
|
|
13083
|
+
setMode(savedMode);
|
|
13075
13084
|
setIsHydrated(true);
|
|
13076
13085
|
}, [persistToLocalStorage]);
|
|
13077
13086
|
React38.useEffect(() => {
|
|
@@ -13082,9 +13091,17 @@ function MD3ThemeProvider({
|
|
|
13082
13091
|
localStorage.setItem(STORAGE_KEY_MODE, mode);
|
|
13083
13092
|
}
|
|
13084
13093
|
}, [sourceColor, mode, persistToLocalStorage, isHydrated]);
|
|
13094
|
+
React38.useEffect(() => {
|
|
13095
|
+
if (mode !== "system" || typeof window === "undefined") return;
|
|
13096
|
+
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
13097
|
+
const handleChange = () => applyTheme(sourceColor, "system");
|
|
13098
|
+
mediaQuery.addEventListener("change", handleChange);
|
|
13099
|
+
return () => mediaQuery.removeEventListener("change", handleChange);
|
|
13100
|
+
}, [mode, sourceColor]);
|
|
13101
|
+
const effectiveMode = resolveMode(mode);
|
|
13085
13102
|
const themeValue = React38.useMemo(
|
|
13086
|
-
() => ({ sourceColor, setSourceColor, mode, setMode }),
|
|
13087
|
-
[sourceColor, mode]
|
|
13103
|
+
() => ({ sourceColor, setSourceColor, mode, setMode, effectiveMode }),
|
|
13104
|
+
[sourceColor, mode, effectiveMode]
|
|
13088
13105
|
);
|
|
13089
13106
|
const typographyValue = React38.useMemo(() => {
|
|
13090
13107
|
if (typographyProp) return typographyProp;
|
|
@@ -13116,8 +13133,8 @@ function useTheme() {
|
|
|
13116
13133
|
return context;
|
|
13117
13134
|
}
|
|
13118
13135
|
function useThemeMode() {
|
|
13119
|
-
const { mode, setMode } = useTheme();
|
|
13120
|
-
return { mode, setMode };
|
|
13136
|
+
const { mode, setMode, effectiveMode } = useTheme();
|
|
13137
|
+
return { mode, setMode, effectiveMode };
|
|
13121
13138
|
}
|
|
13122
13139
|
function TableOfContents({
|
|
13123
13140
|
items,
|
|
@@ -13932,6 +13949,7 @@ exports.applyTheme = applyTheme;
|
|
|
13932
13949
|
exports.buildWavePath = buildWavePath;
|
|
13933
13950
|
exports.cn = cn;
|
|
13934
13951
|
exports.generateM3Theme = generateM3Theme;
|
|
13952
|
+
exports.resolveMode = resolveMode;
|
|
13935
13953
|
exports.useAppBarScroll = useAppBarScroll;
|
|
13936
13954
|
exports.useDOMRipple = useRipple;
|
|
13937
13955
|
exports.useMediaQuery = useMediaQuery;
|