@takazudo/zdtp 0.1.0-next.2 → 0.2.0-next.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/CHANGELOG.md +23 -0
- package/README.md +4 -4
- package/dist/controls/pill-slider-row.d.ts +1 -1
- package/dist/controls/slider-row.d.ts +2 -6
- package/dist/controls/slider-row.d.ts.map +1 -1
- package/dist/controls/tier-ref-selector.d.ts +10 -4
- package/dist/controls/tier-ref-selector.d.ts.map +1 -1
- package/dist/index.js +1511 -1563
- package/dist/tabs/_generic-item-editor.d.ts +1 -3
- package/dist/tabs/_generic-item-editor.d.ts.map +1 -1
- package/dist/tabs/font-tab.d.ts.map +1 -1
- package/dist/tabs/generic-tab.d.ts +1 -1
- package/dist/tabs/generic-tab.d.ts.map +1 -1
- package/dist/tabs/size-tab.d.ts.map +1 -1
- package/dist/tabs/spacing-tab.d.ts.map +1 -1
- package/dist/tokens/manifest.d.ts +3 -7
- package/dist/tokens/manifest.d.ts.map +1 -1
- package/dist/tokens/tier-model.d.ts +0 -4
- package/dist/tokens/tier-model.d.ts.map +1 -1
- package/dist/zdtp.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0-next.1
|
|
4
|
+
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
- **Removed the `min` and `max` properties from `TokenDef` and `TierValueKind` (`'length'` | `'number'` variants).** The panel no longer renders an `<input type="range">` slider on numeric token rows — they are now plain unconstrained number inputs. The mid-keystroke clamp and on-blur clamp logic added in [#313](https://github.com/Takazudo/zudo-design-token-panel/pull/313) are gone; values commit as typed, and the `aria-invalid` / red-border styling for out-of-range values is removed. Real-world use proved sliders too restrictive for a developer tool — devs want to type arbitrary values freely (including deliberately out-of-spec or experimental ones). **Migration**: remove every `min: ...` and `max: ...` field from your token manifests. The internal color-picker `SliderConfig.min` / `.max` (OKLCH/HSL axis bounds) is unrelated and unchanged. (a9b768e, [#325](https://github.com/Takazudo/zudo-design-token-panel/issues/325), [#328](https://github.com/Takazudo/zudo-design-token-panel/pull/328))
|
|
8
|
+
|
|
9
|
+
### Other Changes
|
|
10
|
+
|
|
11
|
+
- Strip `min` / `max` from 35+ test fixture files. (b8ef56e)
|
|
12
|
+
- Rewrite the [#313](https://github.com/Takazudo/zudo-design-token-panel/pull/313) clamp-regression tests to assert the new free-input contract — value commits as typed, no `aria-invalid` on out-of-range numeric input. (9798e07)
|
|
13
|
+
- Update `packages/zdtp/README.md` and `packages/zdtp/PORTABLE-CONTRACT.md` to drop slider-describing prose and the min/max examples. (e210a2d)
|
|
14
|
+
- Update doc-site reference pages (`token-manifest.mdx`, `architecture.mdx`, `configure-panel.mdx`) to drop the min/max examples and slider-UI prose. (9262585)
|
|
15
|
+
|
|
16
|
+
## 0.1.0-next.3
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- **Tier-ref selector is now a native `<select>` and reflects live override values.** The custom `role="listbox"` dropdown (with its open/focusedIndex state machine, ARIA plumbing, click-outside handler, and keyboard-nav callbacks) was replaced by a native `<select>`, dropping ~250 lines of UI code. Each `<option>` label now shows `--var-name (resolved-value)` using `resolveTierItemValue()` from the apply pipeline — so when a referenced tier-1 token's value is overridden via its slider/text row, the tier-2 selector's option labels reflect the new value immediately instead of staying stuck on the manifest default. (570a1b1) ([#312](https://github.com/Takazudo/zudo-design-token-panel/issues/312))
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **Number inputs no longer overwrite the user's draft mid-keystroke.** `SliderRow` and the generic-tab item editor used to parse-and-clamp on every keystroke, immediately commit the clamped value, and round-trip it back into the input — so typing `2` then `2` (expecting `22`) snapped the input to `6` when the token's `max` was `6`. Out-of-range or empty drafts are now flagged with a `--invalid` red border and held without committing; on blur, an invalid draft reverts to the last known-good value. The slider thumb continues to scrub live. (21d3afa) ([#313](https://github.com/Takazudo/zudo-design-token-panel/issues/313))
|
|
25
|
+
|
|
3
26
|
## 0.1.0-next.2
|
|
4
27
|
|
|
5
28
|
### Fixed
|
package/README.md
CHANGED
|
@@ -258,7 +258,7 @@ const spacingTier: TierConfig = {
|
|
|
258
258
|
label: 'Spacing M',
|
|
259
259
|
group: 'hsp',
|
|
260
260
|
default: '1rem',
|
|
261
|
-
type: { kind: 'length',
|
|
261
|
+
type: { kind: 'length', step: 0.0625, unit: 'rem' },
|
|
262
262
|
},
|
|
263
263
|
],
|
|
264
264
|
};
|
|
@@ -480,8 +480,8 @@ spec; this section is the consumer-oriented summary.
|
|
|
480
480
|
|
|
481
481
|
```ts
|
|
482
482
|
export type TierValueKind =
|
|
483
|
-
| { kind: 'length';
|
|
484
|
-
| { kind: 'number';
|
|
483
|
+
| { kind: 'length'; step: number; unit: string }
|
|
484
|
+
| { kind: 'number'; step: number }
|
|
485
485
|
| { kind: 'select'; options: readonly string[] }
|
|
486
486
|
| { kind: 'text' }
|
|
487
487
|
| { kind: 'cursor' }
|
|
@@ -555,7 +555,7 @@ export const spacingTab: TabConfig = {
|
|
|
555
555
|
label: 'Spacing M',
|
|
556
556
|
group: 'hsp',
|
|
557
557
|
default: '1rem',
|
|
558
|
-
type: { kind: 'length',
|
|
558
|
+
type: { kind: 'length', step: 0.0625, unit: 'rem' },
|
|
559
559
|
},
|
|
560
560
|
],
|
|
561
561
|
},
|
|
@@ -11,7 +11,7 @@ import type { TokenDef } from '../tokens/manifest';
|
|
|
11
11
|
* number input go read-only so the user can't accidentally de-pill via typing.
|
|
12
12
|
*
|
|
13
13
|
* When the checkbox is OFF the row behaves as a normal `SliderRow` — the user
|
|
14
|
-
* can
|
|
14
|
+
* can type any numeric value in the number input (unconstrained free input).
|
|
15
15
|
*
|
|
16
16
|
* Toggling between modes preserves the last custom value (kept in a ref so we
|
|
17
17
|
* don't round-trip it through state / persistence) — this is the "without data
|
|
@@ -3,10 +3,6 @@ import { type TokenDef } from '../tokens/manifest';
|
|
|
3
3
|
* One manifest-driven token row:
|
|
4
4
|
*
|
|
5
5
|
* [label] ... [ 1.25 rem] ← label + number input (unit suffix inside)
|
|
6
|
-
* [=========o==================] ← full-width range slider
|
|
7
|
-
*
|
|
8
|
-
* Range input and number input are two-way bound: dragging the slider fills
|
|
9
|
-
* the number input live, and typing a value moves the slider once it parses.
|
|
10
6
|
*
|
|
11
7
|
* The parent owns the persisted value (stored as a string like `"1.25rem"`);
|
|
12
8
|
* this row keeps a local "draft" string only for the number input, so users
|
|
@@ -24,8 +20,8 @@ export interface SliderRowProps {
|
|
|
24
20
|
/** Current persisted value (or the token's default if no override). */
|
|
25
21
|
value: string;
|
|
26
22
|
/** Called with the row's `token.id` and the new CSS string (e.g.
|
|
27
|
-
* `"0.75rem"`) whenever the user commits a change via
|
|
28
|
-
*
|
|
23
|
+
* `"0.75rem"`) whenever the user commits a change via a parseable
|
|
24
|
+
* number input. */
|
|
29
25
|
onChange: (id: string, next: string) => void;
|
|
30
26
|
}
|
|
31
27
|
declare function SliderRow({ token, value, onChange }: SliderRowProps): import("preact").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider-row.d.ts","sourceRoot":"","sources":["../../src/controls/slider-row.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAkC,MAAM,oBAAoB,CAAC;AAEnF
|
|
1
|
+
{"version":3,"file":"slider-row.d.ts","sourceRoot":"","sources":["../../src/controls/slider-row.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,QAAQ,EAAkC,MAAM,oBAAoB,CAAC;AAEnF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,QAAQ,CAAC;IAChB,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd;;wBAEoB;IACpB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,iBAAS,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,cAAc,gCAqE5D;;AAKD,wBAA+B"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { TabConfig } from '../tokens/tier-model';
|
|
2
2
|
/**
|
|
3
3
|
* Sentinel string passed to `onChange` when the user picks "Literal...".
|
|
4
|
-
* The parent component
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The parent component interprets this as a request to flip the item back
|
|
5
|
+
* into its kind-specific editor (slider / text / select) writing a literal
|
|
6
|
+
* CSS override.
|
|
7
7
|
*/
|
|
8
8
|
export declare const TIER_REF_LITERAL_SIGNAL: "__literal__";
|
|
9
9
|
export interface TierRefSelectorProps {
|
|
@@ -26,8 +26,14 @@ export interface TierRefSelectorProps {
|
|
|
26
26
|
* - Picking "Literal...": `onChange(itemId, TIER_REF_LITERAL_SIGNAL)`
|
|
27
27
|
*/
|
|
28
28
|
onChange: (itemId: string, next: string) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the resolved (override-aware) preview string for a tier-1 item id.
|
|
31
|
+
* Each option label is formatted as `${item.cssVar} (${truncated preview})`.
|
|
32
|
+
* Pass a wrapper around resolveTierItemValue using the current tweak-state map.
|
|
33
|
+
*/
|
|
34
|
+
previewValueFor: (refItemId: string) => string;
|
|
29
35
|
}
|
|
30
|
-
declare function TierRefSelector({ tab, tierId, itemId, value, onChange }: TierRefSelectorProps): import("preact").JSX.Element;
|
|
36
|
+
declare function TierRefSelector({ tab, tierId, itemId, value, onChange, previewValueFor }: TierRefSelectorProps): import("preact").JSX.Element;
|
|
31
37
|
declare const _default: typeof TierRefSelector;
|
|
32
38
|
export default _default;
|
|
33
39
|
//# sourceMappingURL=tier-ref-selector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tier-ref-selector.d.ts","sourceRoot":"","sources":["../../src/controls/tier-ref-selector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAwB,MAAM,sBAAsB,CAAC;AAM5E;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAG,aAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"tier-ref-selector.d.ts","sourceRoot":"","sources":["../../src/controls/tier-ref-selector.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAwB,MAAM,sBAAsB,CAAC;AAM5E;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAG,aAAsB,CAAC;AA6B9D,MAAM,WAAW,oBAAoB;IACnC,6EAA6E;IAC7E,GAAG,EAAE,SAAS,CAAC;IACf,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD;;;;OAIG;IACH,eAAe,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAChD;AAMD,iBAAS,eAAe,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,oBAAoB,gCAiDvG;;AAED,wBAAqC"}
|