material-theme-builder 2.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -7
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -52,11 +52,12 @@ theme.toShadcn();
|
|
|
52
52
|
|
|
53
53
|
> [!NOTE]
|
|
54
54
|
>
|
|
55
|
-
>
|
|
56
|
-
>
|
|
55
|
+
> The root entry costs a client bundle nothing. It holds `builder` alone — the
|
|
56
|
+
> React bindings live at [`material-theme-builder/react`](#react) and are the
|
|
57
|
+
> only thing carrying `"use client"`. So you can call `builder` from a
|
|
57
58
|
> [React Server Component](https://react.dev/reference/rsc/server-components)
|
|
58
|
-
>
|
|
59
|
-
>
|
|
59
|
+
> and emit `toCss()` into the document yourself, rather than let `<Mcu>` do it
|
|
60
|
+
> on the client, without shipping React components the page never renders.
|
|
60
61
|
|
|
61
62
|
## CLI
|
|
62
63
|
|
|
@@ -70,10 +71,12 @@ See `npx material-theme-builder --help` for all available options.
|
|
|
70
71
|
|
|
71
72
|
## React
|
|
72
73
|
|
|
74
|
+
The React bindings live on their own entry point, `material-theme-builder/react`.
|
|
75
|
+
|
|
73
76
|
CSS variables are injected into the page:
|
|
74
77
|
|
|
75
78
|
```tsx
|
|
76
|
-
import { Mcu } from "material-theme-builder";
|
|
79
|
+
import { Mcu } from "material-theme-builder/react";
|
|
77
80
|
|
|
78
81
|
<Mcu
|
|
79
82
|
source="#0e1216"
|
|
@@ -112,7 +115,7 @@ import { Mcu } from "material-theme-builder";
|
|
|
112
115
|
A hook is also provided:
|
|
113
116
|
|
|
114
117
|
```tsx
|
|
115
|
-
import { useMcu } from "material-theme-builder";
|
|
118
|
+
import { useMcu } from "material-theme-builder/react";
|
|
116
119
|
|
|
117
120
|
const { initials, setMcuConfig, getMcuColor } = useMcu();
|
|
118
121
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CustomColor, TonalPalette } from '@material/material-color-utilities';
|
|
2
|
-
export { ExportButton, Mcu, useMcu } from './react.js';
|
|
3
2
|
|
|
4
3
|
/** DTCG color value (direct, non-alias) */
|
|
5
4
|
type DtcgColorValue = {
|
|
@@ -162,4 +161,4 @@ declare function builder(hexSource: McuConfig["source"], { scheme, contrast, pri
|
|
|
162
161
|
};
|
|
163
162
|
};
|
|
164
163
|
|
|
165
|
-
export { builder };
|
|
164
|
+
export { type McuConfig, builder };
|
package/dist/index.js
CHANGED
|
@@ -1074,12 +1074,6 @@ function builder(hexSource, {
|
|
|
1074
1074
|
allPalettes
|
|
1075
1075
|
};
|
|
1076
1076
|
}
|
|
1077
|
-
|
|
1078
|
-
// src/index.ts
|
|
1079
|
-
import { ExportButton, Mcu, useMcu } from "./react.js";
|
|
1080
1077
|
export {
|
|
1081
|
-
|
|
1082
|
-
Mcu,
|
|
1083
|
-
builder,
|
|
1084
|
-
useMcu
|
|
1078
|
+
builder
|
|
1085
1079
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "material-theme-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "m3 color-system for JS/TS ecosystem",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"import": "./dist/index.js"
|
|
14
14
|
},
|
|
15
|
+
"./react": {
|
|
16
|
+
"types": "./dist/react.d.ts",
|
|
17
|
+
"import": "./dist/react.js"
|
|
18
|
+
},
|
|
15
19
|
"./tailwind.css": "./dist/tailwind.css"
|
|
16
20
|
},
|
|
17
21
|
"homepage": "https://github.com/abernier/material-theme-builder",
|