@mittwald/flow-react-components 1.1.0-next.11 → 1.1.0-next.12
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/MIGRATION.md +40 -0
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/js/packages/components/src/lib/theming/hooks/useDesignTokens.mjs +2 -2
- package/dist/js/packages/components/src/lib/theming/hooks/useDesignTokens.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/tokens/CategoricalColors.mjs +1 -1
- package/dist/js/packages/components/src/lib/tokens/CategoricalColors.mjs.map +1 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs +5789 -0
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs.map +1 -0
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs +5789 -0
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs.map +1 -0
- package/dist/types/lib/theming/hooks/useDesignTokens.d.ts +526 -19583
- package/dist/types/lib/theming/hooks/useDesignTokens.d.ts.map +1 -1
- package/dist/types/lib/theming/types.d.ts +1 -1
- package/dist/types/lib/theming/types.d.ts.map +1 -1
- package/dist/types/lib/tokens/CategoricalColors.d.ts +1 -1
- package/dist/types/lib/tokens/CategoricalColors.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/js/packages/design-tokens/dist/json/all-dark.mjs +0 -17519
- package/dist/js/packages/design-tokens/dist/json/all-dark.mjs.map +0 -1
- package/dist/js/packages/design-tokens/dist/json/all-light.mjs +0 -17519
- package/dist/js/packages/design-tokens/dist/json/all-light.mjs.map +0 -1
package/MIGRATION.md
CHANGED
|
@@ -23,6 +23,46 @@ rewrites files in place, so review the diff afterwards.
|
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
+
<a id="use-design-tokens-build-metadata-removed"></a>
|
|
27
|
+
|
|
28
|
+
## useDesignTokens(): no longer returns style-dictionary build metadata
|
|
29
|
+
|
|
30
|
+
**Since `1.0.16`** · migration · manual change
|
|
31
|
+
|
|
32
|
+
The hook imported the design tokens' full style-dictionary output, which carries
|
|
33
|
+
`filePath`, `isSource`, `original`, `name`, `attributes` and `key` on every one
|
|
34
|
+
of the 1538 tokens. That metadata is 94 % of the payload and meant nothing in a
|
|
35
|
+
browser — it put 1.37 MB of JavaScript into every bundle that touched the
|
|
36
|
+
package. The hook now reads a runtime build of the same tokens.
|
|
37
|
+
|
|
38
|
+
Every token keeps `value` and `path`, unchanged and with identical values, so
|
|
39
|
+
the common access patterns are untouched:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
const tokens = useDesignTokens();
|
|
43
|
+
tokens["loading-spinner"]["transition-duration"].value; // still works
|
|
44
|
+
tokens.axis.color.path; // still works
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Only the build metadata is gone. If you read one of those fields, take it from
|
|
48
|
+
`@mittwald/flow-design-tokens/json/all-light.json` (or `all-dark.json`) directly
|
|
49
|
+
— that artifact is unchanged. Do not import it into browser code; it is the
|
|
50
|
+
reason this change exists.
|
|
51
|
+
|
|
52
|
+
```diff
|
|
53
|
+
- const source = useDesignTokens().button["corner-radius"].filePath;
|
|
54
|
+
+ import tokens from "@mittwald/flow-design-tokens/json/all-light.json";
|
|
55
|
+
+ const source = tokens.button["corner-radius"].filePath;
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Apply:** Only affects code reading `filePath`, `isSource`, `original`, `name`,
|
|
59
|
+
`attributes` or `key` off a token returned by `useDesignTokens()`. Those fields
|
|
60
|
+
are gone; read them from `@mittwald/flow-design-tokens/json/all-light.json` (or
|
|
61
|
+
`all-dark.json`) instead, and never from browser code. `value` and `path` are
|
|
62
|
+
unchanged — code using only those needs no change.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
26
66
|
<a id="segmented-control-deprecated"></a>
|
|
27
67
|
|
|
28
68
|
## SegmentedControl deprecated
|