@takazudo/zdtp 0.3.2 → 0.4.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 +37 -0
- package/dist/apply/build-apply-overrides.d.ts.map +1 -1
- package/dist/components/color-picker/color-field.d.ts +38 -0
- package/dist/components/color-picker/color-field.d.ts.map +1 -0
- package/dist/components/color-picker/color-picker.d.ts +28 -4
- package/dist/components/color-picker/color-picker.d.ts.map +1 -1
- package/dist/components/palette-chart/index.d.ts +3 -0
- package/dist/components/palette-chart/index.d.ts.map +1 -0
- package/dist/components/palette-chart/palette-chart.d.ts +76 -0
- package/dist/components/palette-chart/palette-chart.d.ts.map +1 -0
- package/dist/index.js +3347 -2257
- package/dist/panel.d.ts.map +1 -1
- package/dist/tabs/_generic-item-editor.d.ts +3 -0
- package/dist/tabs/_generic-item-editor.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/palette/palette-check-view.d.ts +22 -0
- package/dist/tabs/palette/palette-check-view.d.ts.map +1 -0
- package/dist/tabs/palette/palette-edit-view.d.ts +57 -0
- package/dist/tabs/palette/palette-edit-view.d.ts.map +1 -0
- package/dist/tabs/palette/palette-readout.d.ts +23 -0
- package/dist/tabs/palette/palette-readout.d.ts.map +1 -0
- package/dist/tabs/palette/palette-tab.d.ts +37 -0
- package/dist/tabs/palette/palette-tab.d.ts.map +1 -0
- package/dist/tokens/tier-model.d.ts +8 -1
- package/dist/tokens/tier-model.d.ts.map +1 -1
- package/dist/utils/color-oklch.d.ts +17 -0
- package/dist/utils/color-oklch.d.ts.map +1 -1
- package/dist/utils/palette-curve.d.ts +62 -0
- package/dist/utils/palette-curve.d.ts.map +1 -0
- package/dist/utils/wcag-contrast.d.ts +32 -0
- package/dist/utils/wcag-contrast.d.ts.map +1 -0
- package/dist/zdtp.css +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- **Palette tab — an OKLCH palette generator & checker built into the panel.** A new reserved `palette` tab (joining `color` / `font` / `spacing` / `size`) lets a host define grouped color scales as `{ kind: "color", format: "oklch" }` tier items (`--palette-{group}-{n}`) and edit/verify them in-panel with no lossy hex round-trip. Two modes:
|
|
8
|
+
- **Edit mode** — a grouped step grid plus a `PrismChart` OKLCH L/C/H curve editor; dragging a curve re-derives every step in the group and commits the whole group in one batched write on pointer-up. ([#390](https://github.com/Takazudo/zudo-design-token-panel/issues/390), [#393](https://github.com/Takazudo/zudo-design-token-panel/issues/393), [#395](https://github.com/Takazudo/zudo-design-token-panel/issues/395))
|
|
9
|
+
- **Check mode** — a WCAG contrast-checker view over the live palette. ([#394](https://github.com/Takazudo/zudo-design-token-panel/issues/394))
|
|
10
|
+
- Backed by new OKLCH curve math + WCAG contrast helpers, and wired through the generic-tab apply path (`buildApplyOverrides` emits `state.tabs[*]`) so palette overrides apply, persist, and round-trip through Export/Load. ([#391](https://github.com/Takazudo/zudo-design-token-panel/issues/391), [#392](https://github.com/Takazudo/zudo-design-token-panel/issues/392))
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Palette flat-mode tier ids, persist-safe hue handling, and serialize arity (post-codex-review hardening). (f9c38f9)
|
|
15
|
+
|
|
16
|
+
### Other Changes
|
|
17
|
+
|
|
18
|
+
- Integration + serde + browser-confirm test coverage for the palette tab. ([#396](https://github.com/Takazudo/zudo-design-token-panel/issues/396))
|
|
19
|
+
- Add a grouped palette tab recipe + reference docs (EN + JA). ([#397](https://github.com/Takazudo/zudo-design-token-panel/issues/397))
|
|
20
|
+
|
|
21
|
+
## 0.3.3
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
- **OKLCH display & edit for opt-in GenericTab color items.** A `GenericTab` `{ kind: "color" }` tier item can now set `format: "oklch"` to route through the OKLCH/HSL `ColorPicker` instead of the native `<input type="color">`, so host/secondary panels can faithfully **display and edit** wide-gamut oklch/P3 palette values (e.g. a family-named `--palette-cool-700: oklch(...)`) with **no lossy hex round-trip on commit**. Additive and backward compatible — omitting `format` (or `"hex"`) keeps the native color input, so existing consumers, `ColorTab`, and the highlight popover are unchanged. ([#373](https://github.com/Takazudo/zudo-design-token-panel/issues/373), supersedes [#372](https://github.com/Takazudo/zudo-design-token-panel/issues/372))
|
|
26
|
+
- Add a `cssToOklcha` CSS Color 4 `oklch()` parser (number/percentage L, chroma `%` = 0.4, deg/rad/grad/turn hue, `none`, alpha; strict — rejects malformed channels). ([#374](https://github.com/Takazudo/zudo-design-token-panel/issues/374))
|
|
27
|
+
- Extend the public `{ kind: "color" }` tier-item type with optional `format?: "hex" | "oklch"`. ([#375](https://github.com/Takazudo/zudo-design-token-panel/issues/375))
|
|
28
|
+
- Give `ColorPicker` a `valueFormat` contract: in oklch mode a canonical `Oklcha` is the source of truth and wide-gamut chroma survives prop→edit→emit without sRGB clamping. ([#376](https://github.com/Takazudo/zudo-design-token-panel/issues/376))
|
|
29
|
+
- HSL/alpha/preset hardening: the OKLCH↔HSL mode toggle is emit-free; only an HSL slider edit is a (documented) sRGB-oriented path. ([#377](https://github.com/Takazudo/zudo-design-token-panel/issues/377))
|
|
30
|
+
- Add a shared `ColorField` (swatch-button → picker popover) and route both generic item editors through it. ([#378](https://github.com/Takazudo/zudo-design-token-panel/issues/378))
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- **Style the `ColorField` swatch and reject malformed oklch tokens.** The new opt-in swatch had no CSS (an empty `div` with only a background color → zero-size/invisible affordance); added sized swatch styles. The `cssToOklcha` tokenizer also accepted malformed channels (e.g. `oklch(50px 0.1 120)`) by silently extracting numeric substrings; it now requires exactly three fully-anchored channel tokens and rejects unknown suffixes. ([#380](https://github.com/Takazudo/zudo-design-token-panel/pull/380)) (2d045d0)
|
|
35
|
+
|
|
36
|
+
### Other Changes
|
|
37
|
+
|
|
38
|
+
- Add an end-to-end test asserting the oklch round-trip (panel `onChange` + apply path both emit `oklch(...)`) and wide-gamut P3 preservation. ([#379](https://github.com/Takazudo/zudo-design-token-panel/issues/379)) (0595f28)
|
|
39
|
+
|
|
3
40
|
## 0.3.2
|
|
4
41
|
|
|
5
42
|
### Fixed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-apply-overrides.d.ts","sourceRoot":"","sources":["../../src/apply/build-apply-overrides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,aAAa,EAAE,eAAe,GAAG,SAAS,EAC1C,OAAO,GAAE,kBAA8C,EACvD,IAAI,GAAE,SAAS,SAAS,EAA0B,GACjD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"build-apply-overrides.d.ts","sourceRoot":"","sources":["../../src/apply/build-apply-overrides.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAItD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,aAAa,EAAE,eAAe,GAAG,SAAS,EAC1C,OAAO,GAAE,kBAA8C,EACvD,IAAI,GAAE,SAAS,SAAS,EAA0B,GACjD,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA8ExB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ColorField — swatch-button that opens a ColorPicker popover.
|
|
3
|
+
*
|
|
4
|
+
* A swatch div (div[role="button"]) + isOpen state + anchorRef pattern,
|
|
5
|
+
* mirroring ColorSwatch in color-tab.tsx.
|
|
6
|
+
*
|
|
7
|
+
* DOM-hygiene compliant: div-button with onClick + onKeyDown (Enter/Space);
|
|
8
|
+
* no banned semantic tags — hostile-host policy (CLAUDE.md).
|
|
9
|
+
*/
|
|
10
|
+
import type { ColorPickerValueFormat } from './color-picker';
|
|
11
|
+
export interface ColorFieldProps {
|
|
12
|
+
/** Current color value. Hex string in hex mode; `oklch(...)` string in oklch mode. */
|
|
13
|
+
value: string;
|
|
14
|
+
/** Called with the new color string when the user commits a change. */
|
|
15
|
+
onChange: (next: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Output format for `value` / `onChange`. Defaults to 'hex' (back-compatible
|
|
18
|
+
* with the native <input type="color"> path).
|
|
19
|
+
*/
|
|
20
|
+
valueFormat?: ColorPickerValueFormat;
|
|
21
|
+
/** Display label shown in the picker header and aria-label. */
|
|
22
|
+
label: string;
|
|
23
|
+
/** Optional CSS custom property name (e.g. `--my-color`). Used for aria-label. */
|
|
24
|
+
cssVar?: string;
|
|
25
|
+
/**
|
|
26
|
+
* When true, the swatch is shown but clicking / Enter / Space does NOT open
|
|
27
|
+
* the picker. Mirrors the `disabled` behavior of the native <input type="color">.
|
|
28
|
+
*/
|
|
29
|
+
readonly?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Swatch-button that opens a ColorPicker popover.
|
|
33
|
+
*
|
|
34
|
+
* Readonly items show the swatch but do not open the picker on interaction.
|
|
35
|
+
*/
|
|
36
|
+
export declare function ColorField({ value, onChange, valueFormat, label, cssVar, readonly: isReadonly, }: ColorFieldProps): import("preact").JSX.Element;
|
|
37
|
+
export default ColorField;
|
|
38
|
+
//# sourceMappingURL=color-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-field.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/color-field.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,WAAW,eAAe;IAC9B,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC;;;OAGG;IACH,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,WAAmB,EACnB,KAAK,EACL,MAAM,EACN,QAAQ,EAAE,UAAkB,GAC7B,EAAE,eAAe,gCA6CjB;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -19,11 +19,35 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type { JSX } from 'preact';
|
|
21
21
|
export type ColorPickerMode = 'oklch' | 'hsl';
|
|
22
|
+
/**
|
|
23
|
+
* Output value format for the picker.
|
|
24
|
+
*
|
|
25
|
+
* 'hex' — `color` prop is a hex string, `onChange` emits hex. The internal
|
|
26
|
+
* source of truth is the hex string. (Default — back-compatible.)
|
|
27
|
+
* 'oklch' — `color` prop is a CSS `oklch(...)` string (a hex is also tolerated
|
|
28
|
+
* on input), `onChange` emits a normalized `oklch(...)` string. The
|
|
29
|
+
* internal source of truth is a canonical `Oklcha`, so wide-gamut
|
|
30
|
+
* chroma and sub-step precision survive edits without sRGB clamping.
|
|
31
|
+
*/
|
|
32
|
+
export type ColorPickerValueFormat = 'hex' | 'oklch';
|
|
22
33
|
export interface ColorPickerProps {
|
|
23
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Current color. In `valueFormat='hex'` (default) this is a hex string
|
|
36
|
+
* (#RRGGBB or #RRGGBBAA). In `valueFormat='oklch'` this is a CSS `oklch(...)`
|
|
37
|
+
* string (a hex is tolerated and parsed via the hex path as a fallback).
|
|
38
|
+
*/
|
|
24
39
|
color: string;
|
|
25
|
-
/**
|
|
26
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Called when the user commits a new color via any sub-control. The argument
|
|
42
|
+
* matches `valueFormat`: a hex string in 'hex' mode, an `oklch(...)` string
|
|
43
|
+
* in 'oklch' mode.
|
|
44
|
+
*/
|
|
45
|
+
onChange: (value: string) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Output format for `color` / `onChange`. Defaults to 'hex' (back-compatible
|
|
48
|
+
* with existing callers that pass no value).
|
|
49
|
+
*/
|
|
50
|
+
valueFormat?: ColorPickerValueFormat;
|
|
27
51
|
/** Optional label rendered in the picker header. */
|
|
28
52
|
label?: string;
|
|
29
53
|
/**
|
|
@@ -59,6 +83,6 @@ export declare function usePopoverClose(containerRef: React.RefObject<HTMLElemen
|
|
|
59
83
|
* The parent renders `{isOpen && <ColorPicker ... />}`. This component does
|
|
60
84
|
* NOT render a trigger swatch and does NOT use createPortal.
|
|
61
85
|
*/
|
|
62
|
-
export declare function ColorPicker({ color, onChange, label, defaultMode, anchorRef, onClose, }: ColorPickerProps): JSX.Element;
|
|
86
|
+
export declare function ColorPicker({ color, onChange, valueFormat, label, defaultMode, anchorRef, onClose, }: ColorPickerProps): JSX.Element;
|
|
63
87
|
export default ColorPicker;
|
|
64
88
|
//# sourceMappingURL=color-picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-picker.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/color-picker.tsx"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"color-picker.d.ts","sourceRoot":"","sources":["../../../src/components/color-picker/color-picker.tsx"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;GAkBG;AAUH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAmBlC,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,KAAK,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,GAAG,OAAO,CAAC;AAErD,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,2EAA2E;IAC3E,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC/C,gFAAgF;IAChF,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAID,eAAO,MAAM,iBAAiB,gCAAgC,CAAC;AAuL/D;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,GAAG,IAAI,EAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,GAAG,CAAC,aAAa,CAuCnB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACjD,OAAO,EAAE,MAAM,IAAI,GAClB,IAAI,CA2BN;AAID;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,WAAmB,EACnB,KAAK,EACL,WAAqB,EACrB,SAAS,EACT,OAAO,GACR,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAikBhC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/palette-chart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,iBAAiB,EACtB,KAAK,MAAM,EACX,KAAK,OAAO,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { JSX } from 'preact';
|
|
2
|
+
import { type Channel } from '../../utils/palette-curve';
|
|
3
|
+
import { type Oklcha } from '../../utils/color-oklch';
|
|
4
|
+
import './palette-chart.css';
|
|
5
|
+
/**
|
|
6
|
+
* PaletteChart — controlled, presentational OKLCH L/C/H curve editor.
|
|
7
|
+
*
|
|
8
|
+
* Ported from pgen's PrismChart (OKHsl H/S/L) to zdtp's OKLCH L/C/H space.
|
|
9
|
+
* Composition:
|
|
10
|
+
* • Background = N vertical color bands, one per palette color. Band `i` is
|
|
11
|
+
* painted `oklchaToHex(colors[i])` and spans the FULL chart height. The
|
|
12
|
+
* selected band renders at full opacity; the rest are dimmed.
|
|
13
|
+
* • One overlaid draggable curve per VISIBLE channel — L, C, H — EACH IN ITS
|
|
14
|
+
* OWN SVG with its OWN Y-domain (L 0–100, C 0–MAX_OKLCH_CHROMA, H 0–360)
|
|
15
|
+
* mapped to the SAME pixel height. The vertical bands (x = step) are the
|
|
16
|
+
* only shared reference; the three channels deliberately do NOT share one
|
|
17
|
+
* numeric Y axis (Prism's key trick).
|
|
18
|
+
* • N nodes per curve at x = stepIndex (centered over band `i`), y = inverted
|
|
19
|
+
* channel value. Dragging a node vertically reports the new value.
|
|
20
|
+
*
|
|
21
|
+
* Ownership boundary: this chart is FULLY CONTROLLED. It owns no color state;
|
|
22
|
+
* `colors` is the single source of truth supplied by the parent (#395). It only
|
|
23
|
+
* CONSUMES `visibleChannels` (to draw/hide each curve) and reports intents via
|
|
24
|
+
* `onChange` / `onSelectIndex` / `onToggleChannel`. Commit boundaries for
|
|
25
|
+
* batched persistence are signalled by `onChangeStart` / `onChangeEnd`.
|
|
26
|
+
*
|
|
27
|
+
* Drag modes (Prism parity):
|
|
28
|
+
* • Per-node drag — grab a single node and move it vertically.
|
|
29
|
+
* • Whole-curve drag — grab the connecting LINE and translate EVERY node of
|
|
30
|
+
* that channel by one clamped delta, preserving the curve's relative shape
|
|
31
|
+
* and stopping when any node hits 0 or CHANNEL_MAX.
|
|
32
|
+
* Nodes WIN over line drag: the node hit circles render AFTER the hit-polyline
|
|
33
|
+
* within the same SVG, so a pointer-down on a node hits the circle (DOM order
|
|
34
|
+
* within an SVG determines paint/hit precedence).
|
|
35
|
+
*/
|
|
36
|
+
export type { Oklcha } from '../../utils/color-oklch';
|
|
37
|
+
export type { Channel } from '../../utils/palette-curve';
|
|
38
|
+
export interface PaletteChartProps {
|
|
39
|
+
/** Palette colors in OKLCH space. Band `i` = oklchaToHex(colors[i]). */
|
|
40
|
+
colors: Oklcha[];
|
|
41
|
+
/** Index of the currently selected color/step (highlighted band + node column). */
|
|
42
|
+
selectedIndex: number;
|
|
43
|
+
/** Which curves are drawn. Owned by the parent; chart only consumes. */
|
|
44
|
+
visibleChannels: {
|
|
45
|
+
l: boolean;
|
|
46
|
+
c: boolean;
|
|
47
|
+
h: boolean;
|
|
48
|
+
};
|
|
49
|
+
/** Fired when a node is dragged/keyed — value is clamped+quantized to the channel range. */
|
|
50
|
+
onChange: (index: number, channel: Channel, value: number) => void;
|
|
51
|
+
/** Fired when a node/band is picked. */
|
|
52
|
+
onSelectIndex: (i: number) => void;
|
|
53
|
+
/** Fired to request a channel visibility toggle. Chart does NOT own the state. */
|
|
54
|
+
onToggleChannel: (c: Channel) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Commit-boundary start. Fires ONCE at the beginning of an edit gesture:
|
|
57
|
+
* pointer-down on a node or curve line, or the first key of a keyboard edit.
|
|
58
|
+
* The parent (#395) opens a transient/preview write here.
|
|
59
|
+
*/
|
|
60
|
+
onChangeStart?: () => void;
|
|
61
|
+
/**
|
|
62
|
+
* Commit-boundary end. Fires ONCE when the edit gesture completes: pointer-up
|
|
63
|
+
* / pointer-cancel, or immediately after a keyboard edit. The parent batches
|
|
64
|
+
* the whole gesture into a single persist on this signal.
|
|
65
|
+
*/
|
|
66
|
+
onChangeEnd?: () => void;
|
|
67
|
+
}
|
|
68
|
+
declare function PaletteChartImpl({ colors, selectedIndex, visibleChannels, onChange, onSelectIndex, onChangeStart, onChangeEnd, }: PaletteChartProps): JSX.Element;
|
|
69
|
+
/**
|
|
70
|
+
* Memoized so parent re-renders that don't change props don't re-walk every
|
|
71
|
+
* band/curve/node. The drag state lives in refs, so a controlled-value update
|
|
72
|
+
* from the parent flows back through props as the single source of truth.
|
|
73
|
+
*/
|
|
74
|
+
export declare const PaletteChart: typeof PaletteChartImpl;
|
|
75
|
+
export default PaletteChart;
|
|
76
|
+
//# sourceMappingURL=palette-chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette-chart.d.ts","sourceRoot":"","sources":["../../../src/components/palette-chart/palette-chart.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAKL,KAAK,OAAO,EACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,YAAY,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,YAAY,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAsDzD,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,mFAAmF;IACnF,aAAa,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,eAAe,EAAE;QAAE,CAAC,EAAE,OAAO,CAAC;QAAC,CAAC,EAAE,OAAO,CAAC;QAAC,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACxD,4FAA4F;IAC5F,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnE,wCAAwC;IACxC,aAAa,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,kFAAkF;IAClF,eAAe,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAsCD,iBAAS,gBAAgB,CAAC,EACxB,MAAM,EACN,aAAa,EACb,eAAe,EACf,QAAQ,EACR,aAAa,EAIb,aAAa,EACb,WAAW,GACZ,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAgYjC;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,yBAAyB,CAAC;AAEnD,eAAe,YAAY,CAAC"}
|