@takazudo/zdtp 0.6.1 → 0.7.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/CHANGELOG.md +34 -0
- package/PORTABLE-CONTRACT.md +17 -7
- package/README.md +18 -7
- package/dist/astro/host-adapter.js +1 -1
- package/dist/components/color-picker/color-field.d.ts +3 -1
- package/dist/components/color-picker/color-picker.d.ts +3 -1
- package/dist/components/color-picker/custom-slider.d.ts +2 -1
- package/dist/dashboard/index.d.ts +1 -1
- package/dist/dashboard/index.js +224 -223
- package/dist/dashboard/styles.css +70 -36
- package/dist/dashboard/token-dashboard.d.ts +6 -2
- package/dist/dashboard/types.d.ts +2 -0
- package/dist/{index-LYsbHWcy.js → index-BcqHRoxf.js} +1 -1
- package/dist/{index-DWs1XPfy.js → index-CUWkR-Gb.js} +4006 -3935
- package/dist/index.js +2 -2
- package/dist/testing.js +1 -1
- package/dist/{tweak-state-Dzr5kDhX.js → tweak-state-Dhjqig0C.js} +8 -8
- package/dist/utils/resolve-css-color.d.ts +12 -0
- package/dist/zdtp.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,40 @@ All notable changes to `@takazudo/zdtp` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on Keep a Changelog, and release notes are generated from the changelog MDX pages.
|
|
6
6
|
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
No unreleased changes yet.
|
|
10
|
+
|
|
11
|
+
## [0.7.0] - 2026-09-09
|
|
12
|
+
|
|
13
|
+
### Breaking Changes
|
|
14
|
+
|
|
15
|
+
- feat(dashboard): separate chrome theme from specimen mode (84d4d8a). `TokenDashboard` no longer derives its chrome appearance from `mode`: with `mode="dark"` the inventory scope previously carried `color-scheme: dark`, and now only `.zdtp-dashboard__specimen` does, with chrome defaulting to light. **Migration**: pass the new `chrome="dark"` prop alongside `mode="dark"` to restore the previous dark chrome, or `chrome="host"` to inherit the host's effective color scheme.
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
- feat: resolve CSS color expressions in host context ([#919](https://github.com/Takazudo/zudo-design-token-panel/issues/919)) (30dbabc)
|
|
20
|
+
- feat: require explicit conversion before editing color expressions (ffad163)
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Fix invalid CSS color probe fallback (a1d468f)
|
|
25
|
+
- Reject unchanged invalid color declarations before measurement (27fbc70)
|
|
26
|
+
|
|
27
|
+
### Other Changes
|
|
28
|
+
|
|
29
|
+
- docs(dashboard): document host chrome and add static theme examples (1b8e26d)
|
|
30
|
+
- docs(dashboard): document chrome contract (83778e8)
|
|
31
|
+
- test: cover dashboard chrome themes in browser (5682c72)
|
|
32
|
+
- test: strengthen dashboard specimen isolation assertions (cc62be6)
|
|
33
|
+
- test: prove dashboard host chrome from packed consumer (7a251f0)
|
|
34
|
+
- test(evidence): record dashboard chrome integration proof (690af1f)
|
|
35
|
+
- test: wire semantic expression picker modes (90af515)
|
|
36
|
+
- Cover empty CSS color resolution (18f45ba)
|
|
37
|
+
- docs: record reference-aware color picker fix (b1bb048)
|
|
38
|
+
- test: record reference-aware picker confirmation (045603b)
|
|
39
|
+
- docs: correct picker evidence provenance (89e0322)
|
|
40
|
+
|
|
7
41
|
## [0.6.1] - 2026-09-08
|
|
8
42
|
|
|
9
43
|
### Features
|
package/PORTABLE-CONTRACT.md
CHANGED
|
@@ -1743,15 +1743,18 @@ on across a release bump.
|
|
|
1743
1743
|
|
|
1744
1744
|
## 12. Static token dashboard
|
|
1745
1745
|
|
|
1746
|
-
This entry is available from v0.6.1.
|
|
1747
|
-
not
|
|
1746
|
+
This entry is available from v0.6.1. The `chrome` prop is **unreleased (next
|
|
1747
|
+
release)** and is not supported in v0.6.1. It does not change the
|
|
1748
|
+
`configurePanel` or persistence contracts above.
|
|
1748
1749
|
|
|
1749
1750
|
`@takazudo/zdtp/dashboard` exports the Preact `TokenDashboard` component and
|
|
1750
|
-
`TokenDashboardProps`, `DashboardMode`, `
|
|
1751
|
-
`TierConfig`, and `TierItem` types. The
|
|
1751
|
+
`TokenDashboardProps`, `DashboardMode`, `DashboardChrome`,
|
|
1752
|
+
`DashboardPreviewKind`, `TabConfig`, `TierConfig`, and `TierItem` types. The
|
|
1753
|
+
internal value model is not a public API.
|
|
1752
1754
|
|
|
1753
1755
|
```ts
|
|
1754
1756
|
export type DashboardMode = 'light' | 'dark';
|
|
1757
|
+
export type DashboardChrome = 'light' | 'dark' | 'host';
|
|
1755
1758
|
export type DashboardPreviewKind =
|
|
1756
1759
|
| 'bar' | 'size' | 'line-height' | 'family' | 'weight' | 'radius' | 'duration'
|
|
1757
1760
|
| 'color' | 'shadow' | 'text';
|
|
@@ -1759,6 +1762,7 @@ export type DashboardPreviewKind =
|
|
|
1759
1762
|
export interface TokenDashboardProps {
|
|
1760
1763
|
tabs: readonly TabConfig[];
|
|
1761
1764
|
mode?: DashboardMode; // default: light
|
|
1765
|
+
chrome?: DashboardChrome; // default: light; unreleased (next release)
|
|
1762
1766
|
title?: string; // default: Token dashboard
|
|
1763
1767
|
previewText?: string; // static typography passage; default English/Japanese prose
|
|
1764
1768
|
id?: string; // optional root ID; caller owns uniqueness
|
|
@@ -1775,9 +1779,15 @@ export interface TokenDashboardProps {
|
|
|
1775
1779
|
JavaScript has no CSS side-effect import; the host must include this asset
|
|
1776
1780
|
through its CSS build or a static stylesheet link. It is not appended to the
|
|
1777
1781
|
existing panel stylesheet, which is unnecessary for a dashboard-only page.
|
|
1778
|
-
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1782
|
+
- The dashboard root's chrome appearance follows `chrome`: `light` and `dark`
|
|
1783
|
+
fix the shell scheme, while `host` inherits the host's effective
|
|
1784
|
+
`color-scheme` and requires the host to set it on an ancestor. The dashboard
|
|
1785
|
+
uses no media query, so an explicit application theme takes precedence over
|
|
1786
|
+
the OS preference. Inventory specimens retain their own `color-scheme` from
|
|
1787
|
+
`mode`, which also selects declared per-mode defaults. Chrome and specimens
|
|
1788
|
+
are independent; chrome uses package-owned CSS custom properties and never
|
|
1789
|
+
reads inventory variables. The component never writes to `:root` or host
|
|
1790
|
+
state.
|
|
1781
1791
|
- Tabs, tiers, and rows render in input order. All token rows remain visible;
|
|
1782
1792
|
no collapsed sections or automatic IDs are introduced. Empty input is valid.
|
|
1783
1793
|
Notes-only tabs are omitted, and arbitrary notes HTML is never injected.
|
package/README.md
CHANGED
|
@@ -43,7 +43,8 @@ walkthrough and the shortcut table.
|
|
|
43
43
|
## Static token dashboard
|
|
44
44
|
|
|
45
45
|
Import `TokenDashboard` from `@takazudo/zdtp/dashboard` to render the same tab
|
|
46
|
-
manifest on a plain page. This entry is available from v0.6.1. The
|
|
46
|
+
manifest on a plain page. This entry is available from v0.6.1. The `chrome`
|
|
47
|
+
prop is **unreleased (next release)** and is not supported in v0.6.1. The [live workspace demo](https://zdtp-playground.zudolab.dev/dashboard/)
|
|
47
48
|
shows both modes and a compact embedded instance.
|
|
48
49
|
|
|
49
50
|
```tsx
|
|
@@ -92,9 +93,18 @@ public assets directory and add a stylesheet link. The
|
|
|
92
93
|
[static dashboard recipe](https://zdtp.zudolab.dev/docs/recipes/static-token-dashboard/)
|
|
93
94
|
provides complete data and CSS-copy examples.
|
|
94
95
|
|
|
95
|
-
Optional props are `mode` (`light` by default), `
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
Optional props are `mode` (`light` by default), `chrome` (`light` by default;
|
|
97
|
+
**unreleased for the next release**), `title`, caller-owned unique `id`,
|
|
98
|
+
`previewText`, and `previewOverrides` keyed by CSS variable (for example, a
|
|
99
|
+
text-editor shadow can use `'shadow'`). Existing `TierConfig.preview` metadata is reused.
|
|
100
|
+
|
|
101
|
+
`chrome="light"` and `chrome="dark"` fix the dashboard shell appearance;
|
|
102
|
+
`chrome="host"` inherits the host's effective `color-scheme` and requires the
|
|
103
|
+
host to set it on an ancestor. Chrome is independent of `mode`: `mode` selects
|
|
104
|
+
declared per-mode defaults and each specimen's own `color-scheme`, while chrome
|
|
105
|
+
uses package-owned CSS custom properties and never reads inventory variables.
|
|
106
|
+
The dashboard uses no media query, so an explicit application theme wins over
|
|
107
|
+
the OS preference.
|
|
98
108
|
|
|
99
109
|
Spacing uses actual-size rulers with local scrolling. Nonnegative px/rem, zero,
|
|
100
110
|
and resolved direct aliases are supported; other lengths keep a readable fallback.
|
|
@@ -110,9 +120,10 @@ The inventory uses **declared defaults**: item defaults, per-mode
|
|
|
110
120
|
named color presets, panel initialization, or persisted edits. CSS expressions
|
|
111
121
|
remain expressions; samples depend on browser layout and available fonts.
|
|
112
122
|
Missing/context-dependent references and invalid declarations remain readable
|
|
113
|
-
with diagnostics rather than misleading samples.
|
|
114
|
-
|
|
115
|
-
|
|
123
|
+
with diagnostics rather than misleading samples. The dashboard root's chrome
|
|
124
|
+
scheme follows `chrome`, while each specimen's `color-scheme` follows `mode`;
|
|
125
|
+
both are local to the instance, and the component never writes to `:root`.
|
|
126
|
+
Arbitrary notes HTML and URL/mask assets are not rendered or loaded.
|
|
116
127
|
|
|
117
128
|
This checkpoint provides a Preact component. An HTML-export API/CLI, React
|
|
118
129
|
adapter, and automatic panel-state synchronization are outside its scope.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as y, g as m, a as w, b, i as P } from "../panel-config-Crn5QJGy.js";
|
|
2
|
-
import { g, Z as A } from "../tweak-state-
|
|
2
|
+
import { g, Z as A } from "../tweak-state-Dhjqig0C.js";
|
|
3
3
|
import { s as D, l as E, a as _, i as c, r as f, c as k, b as S, d } from "../autoload-state-CGnis85c.js";
|
|
4
4
|
import { READABLE_STATE_KEY_SUFFIXES as T } from "../constants.js";
|
|
5
5
|
const u = "tokenpanel-config";
|
|
@@ -18,6 +18,8 @@ export interface ColorFieldProps {
|
|
|
18
18
|
* with the native <input type="color"> path).
|
|
19
19
|
*/
|
|
20
20
|
valueFormat?: ColorPickerValueFormat;
|
|
21
|
+
/** Host color scheme used to resolve CSS expressions. */
|
|
22
|
+
resolveMode?: 'light' | 'dark';
|
|
21
23
|
/** Display label shown in the picker header and aria-label. */
|
|
22
24
|
label: string;
|
|
23
25
|
/** Optional CSS custom property name (e.g. `--my-color`). Used for aria-label. */
|
|
@@ -33,5 +35,5 @@ export interface ColorFieldProps {
|
|
|
33
35
|
*
|
|
34
36
|
* Readonly items show the swatch but do not open the picker on interaction.
|
|
35
37
|
*/
|
|
36
|
-
export declare function ColorField({ value, onChange, valueFormat, label, cssVar, readonly: isReadonly, }: ColorFieldProps): import("preact").JSX.Element;
|
|
38
|
+
export declare function ColorField({ value, onChange, valueFormat, resolveMode, label, cssVar, readonly: isReadonly, }: ColorFieldProps): import("preact").JSX.Element;
|
|
37
39
|
export default ColorField;
|
|
@@ -48,6 +48,8 @@ export interface ColorPickerProps {
|
|
|
48
48
|
* with existing callers that pass no value).
|
|
49
49
|
*/
|
|
50
50
|
valueFormat?: ColorPickerValueFormat;
|
|
51
|
+
/** Host color scheme used to resolve CSS expressions. */
|
|
52
|
+
resolveMode?: 'light' | 'dark';
|
|
51
53
|
/** Optional label rendered in the picker header. */
|
|
52
54
|
label?: string;
|
|
53
55
|
/**
|
|
@@ -93,5 +95,5 @@ export declare function usePopoverClose(containerRef: React.RefObject<HTMLElemen
|
|
|
93
95
|
* The parent renders `{isOpen && <ColorPicker ... />}`. This component does
|
|
94
96
|
* NOT render a trigger swatch and does NOT use createPortal.
|
|
95
97
|
*/
|
|
96
|
-
export declare function ColorPicker({ color, onChange, valueFormat, label, defaultMode, anchorRef, onClose, }: ColorPickerProps): JSX.Element;
|
|
98
|
+
export declare function ColorPicker({ color, onChange, valueFormat, resolveMode, label, defaultMode, anchorRef, onClose, }: ColorPickerProps): JSX.Element;
|
|
97
99
|
export default ColorPicker;
|
|
@@ -12,6 +12,7 @@ export interface SliderConfig {
|
|
|
12
12
|
format: (v: number) => string;
|
|
13
13
|
}
|
|
14
14
|
export interface CustomSliderProps {
|
|
15
|
+
disabled?: boolean;
|
|
15
16
|
config: SliderConfig;
|
|
16
17
|
value: number;
|
|
17
18
|
/** CSS gradient string applied to the track div's background. */
|
|
@@ -20,5 +21,5 @@ export interface CustomSliderProps {
|
|
|
20
21
|
onDragStart: () => void;
|
|
21
22
|
onDragEnd: () => void;
|
|
22
23
|
}
|
|
23
|
-
export declare function CustomSlider({ config, value, gradient, onChange, onDragStart, onDragEnd, }: CustomSliderProps): JSX.Element;
|
|
24
|
+
export declare function CustomSlider({ disabled, config, value, gradient, onChange, onDragStart, onDragEnd, }: CustomSliderProps): JSX.Element;
|
|
24
25
|
export default CustomSlider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { TokenDashboard } from "./token-dashboard.js";
|
|
2
2
|
export type { TokenDashboardProps, DashboardPreviewKind } from "./token-dashboard.js";
|
|
3
|
-
export type { DashboardMode } from "./types.js";
|
|
3
|
+
export type { DashboardMode, DashboardChrome } from "./types.js";
|
|
4
4
|
export type { TabConfig, TierConfig, TierItem } from "../tokens/tier-model.js";
|