@nonoun/native-tokens 0.4.1 → 0.5.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.
@@ -1,2 +1,70 @@
1
- export declare function buildTokens(container: HTMLElement): void;
1
+ /** A variable slider: name, CSS custom property, default value, and range. */
2
+ export interface TokenVariable {
3
+ type: 'variable';
4
+ name: string;
5
+ token: string;
6
+ value: number;
7
+ step?: number;
8
+ min?: number;
9
+ max?: number;
10
+ }
11
+ /** A labeled row of color swatches. */
12
+ export interface TokenStrip {
13
+ type: 'strip';
14
+ label: string;
15
+ colors: Array<{
16
+ name: string;
17
+ token: string;
18
+ }>;
19
+ }
20
+ /** One item inside a section — either a slider or a color strip. */
21
+ export type TokenSectionItem = TokenVariable | TokenStrip;
22
+ /** A titled group of items, optionally tagged with a family for filtering. */
23
+ export interface TokenSection {
24
+ title: string;
25
+ family?: string;
26
+ items: TokenSectionItem[];
27
+ }
28
+ /** Top-level schema describing the full token inspector content. */
29
+ export interface TokenSchema {
30
+ sections: TokenSection[];
31
+ }
32
+ /** Available theme presets. */
33
+ export declare const themes: readonly [{
34
+ readonly name: "Default";
35
+ readonly value: "";
36
+ }, {
37
+ readonly name: "Forest";
38
+ readonly value: "forest";
39
+ }, {
40
+ readonly name: "Rose";
41
+ readonly value: "rose";
42
+ }, {
43
+ readonly name: "Zinc";
44
+ readonly value: "zinc";
45
+ }];
46
+ /** Color family names. */
47
+ export declare const families: readonly ["neutral", "accent", "info", "success", "warning", "danger"];
48
+ /** Pre-built options for a family filter `<n-select>`. */
49
+ export declare const familyFilterOptions: {
50
+ value: string;
51
+ label: string;
52
+ }[];
53
+ /**
54
+ * Returns the default token schema — all env params + all 6 color families
55
+ * with their full ramp of surfaces, solids, semantics, and scrims.
56
+ *
57
+ * Hosts can call this, mutate the result (drop sections, reorder, add custom
58
+ * tokens), and pass the modified schema to `<native-tokens>`.
59
+ */
60
+ export declare function createDefaultSchema(): TokenSchema;
61
+ /**
62
+ * Stamps token sections into `container` from the given schema.
63
+ * Falls back to `createDefaultSchema()` when no schema is provided.
64
+ *
65
+ * This is a pure renderer — no header, filter, or theme controls.
66
+ * The host provides those and wires them to the `<native-tokens>` element's
67
+ * `family` attribute and the `native-tokens-theme-change` event.
68
+ */
69
+ export declare function buildTokens(container: HTMLElement, schema?: TokenSchema): void;
2
70
  //# sourceMappingURL=build-tokens.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-tokens.d.ts","sourceRoot":"","sources":["../src/build-tokens.ts"],"names":[],"mappings":"AA0EA,wBAAgB,WAAW,CAAC,SAAS,EAAE,WAAW,GAAG,IAAI,CAgIxD"}
1
+ {"version":3,"file":"build-tokens.d.ts","sourceRoot":"","sources":["../src/build-tokens.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,uCAAuC;AACvC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;AAED,oEAAoE;AACpE,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG,UAAU,CAAC;AAE1D,8EAA8E;AAC9E,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAED,oEAAoE;AACpE,MAAM,WAAW,WAAW;IAC1B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