@xenosystem/elements 0.0.5 → 0.0.7

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.
Files changed (75) hide show
  1. package/README.md +65 -65
  2. package/dist/elements/align-bottom.d.ts +10 -0
  3. package/dist/elements/align-bottom.js +23 -0
  4. package/dist/elements/align-horizontal-centers.d.ts +11 -0
  5. package/dist/elements/align-horizontal-centers.js +27 -0
  6. package/dist/elements/align-left.d.ts +12 -0
  7. package/dist/elements/align-left.js +25 -0
  8. package/dist/elements/align-right.d.ts +9 -0
  9. package/dist/elements/align-right.js +22 -0
  10. package/dist/elements/align-top.d.ts +9 -0
  11. package/dist/elements/align-top.js +22 -0
  12. package/dist/elements/align-vertical-centers.d.ts +10 -0
  13. package/dist/elements/align-vertical-centers.js +26 -0
  14. package/dist/elements/archive.js +11 -0
  15. package/dist/elements/book-up.d.ts +10 -0
  16. package/dist/elements/book-up.js +22 -0
  17. package/dist/elements/bookmark.js +7 -0
  18. package/dist/elements/bring-to-front.d.ts +10 -0
  19. package/dist/elements/bring-to-front.js +25 -0
  20. package/dist/elements/broadcast.d.ts +12 -0
  21. package/dist/elements/broadcast.js +27 -0
  22. package/dist/elements/clipboard-check.d.ts +10 -0
  23. package/dist/elements/clipboard-check.js +23 -0
  24. package/dist/elements/cloud.d.ts +11 -0
  25. package/dist/elements/cloud.js +22 -0
  26. package/dist/elements/command.d.ts +11 -0
  27. package/dist/elements/command.js +26 -0
  28. package/dist/elements/distribute-horizontal.d.ts +12 -0
  29. package/dist/elements/distribute-horizontal.js +29 -0
  30. package/dist/elements/distribute-vertical.d.ts +10 -0
  31. package/dist/elements/distribute-vertical.js +27 -0
  32. package/dist/elements/ellipse.d.ts +15 -0
  33. package/dist/elements/ellipse.js +26 -0
  34. package/dist/elements/frame.d.ts +14 -0
  35. package/dist/elements/frame.js +28 -0
  36. package/dist/elements/group.d.ts +11 -0
  37. package/dist/elements/group.js +27 -0
  38. package/dist/elements/keyboard.d.ts +9 -0
  39. package/dist/elements/keyboard.js +28 -0
  40. package/dist/elements/next-dismiss.js +4 -0
  41. package/dist/elements/pen.d.ts +12 -0
  42. package/dist/elements/pen.js +27 -0
  43. package/dist/elements/pointer.d.ts +10 -0
  44. package/dist/elements/pointer.js +21 -0
  45. package/dist/elements/polygon.d.ts +10 -0
  46. package/dist/elements/polygon.js +21 -0
  47. package/dist/elements/send-to-back.d.ts +10 -0
  48. package/dist/elements/send-to-back.js +25 -0
  49. package/dist/elements/star.js +5 -0
  50. package/dist/elements/template.d.ts +11 -0
  51. package/dist/elements/template.js +25 -0
  52. package/dist/elements/ungroup.d.ts +9 -0
  53. package/dist/elements/ungroup.js +21 -0
  54. package/dist/elements/zoom-in.d.ts +10 -0
  55. package/dist/elements/zoom-in.js +23 -0
  56. package/dist/index.d.ts +1 -0
  57. package/dist/index.js +3 -0
  58. package/dist/schema.d.ts +15 -0
  59. package/dist/states.d.ts +75 -0
  60. package/dist/states.js +114 -0
  61. package/dist/tokens/border.d.ts +23 -0
  62. package/dist/tokens/border.js +22 -0
  63. package/dist/tokens/chart.d.ts +13 -0
  64. package/dist/tokens/chart.js +15 -0
  65. package/dist/tokens/index.d.ts +11 -0
  66. package/dist/tokens/index.js +11 -0
  67. package/dist/tokens/reading.d.ts +29 -0
  68. package/dist/tokens/reading.js +28 -0
  69. package/dist/tokens/scrollbar.d.ts +19 -0
  70. package/dist/tokens/scrollbar.js +18 -0
  71. package/dist/tokens/surfaces.d.ts +7 -0
  72. package/dist/tokens/surfaces.js +7 -0
  73. package/dist/tokens/terminal.d.ts +36 -0
  74. package/dist/tokens/terminal.js +37 -0
  75. package/package.json +9 -2
package/dist/states.js ADDED
@@ -0,0 +1,114 @@
1
+ /**
2
+ * State ENUMERATION — what a declaration's axes and signals imply, computed once, here.
3
+ *
4
+ * ## Why this belongs in the contract package
5
+ *
6
+ * `schema.ts` says what a state IS. This says which states an element HAS. Every tool that shows an
7
+ * element in all its states needs that answer — the workshop, `xeno-apps`' Library, an agent asking
8
+ * "show me the bookmark selected", a future screenshot gate on another platform — and if each works
9
+ * it out for itself they drift, silently, because nothing compares two tools' idea of a list. That
10
+ * drift is the Storybook failure (state coverage is whatever someone remembered to write) arriving
11
+ * by a different road: not hand-written stories, but hand-rolled enumerations.
12
+ *
13
+ * So the derivation lives beside the contract it derives from, and a consumer imports it. This is
14
+ * the same rule the components rung already follows, where a family exports its own `STATES`.
15
+ *
16
+ * ## It is DATA about data — still no code in a declaration
17
+ *
18
+ * This is a pure function over declarations, not something a declaration carries. Absolute rule 4
19
+ * ("declarations are DATA, never code") is untouched: nothing here is stored in, referenced by, or
20
+ * executed on behalf of an element. It reads `contract.axes` and `contract.signals` and returns a
21
+ * list. Zero dependencies, zero framework, zero platform — like everything else in this package.
22
+ *
23
+ * ## The two decisions worth knowing
24
+ *
25
+ * **Axes cross-multiply.** They co-occur: a disabled toggle that is `on`, a selected row being
26
+ * pressed. That is the schema's own argument against a single enum, and it means an element's
27
+ * discrete states are the cartesian product of the axes it DECLARES — not a flat list of axis
28
+ * values, which would be the same mistake one level up.
29
+ *
30
+ * **Signals do not.** A signal is a continuous VALUE, not a member of a set. Crossing it with the
31
+ * axes is unbounded in principle and uninformative in practice, so each declared signal contributes
32
+ * one sampled cell over the default axis state — the one a reviewer means when they ask what
33
+ * mid-gesture looks like.
34
+ *
35
+ * **An element declaring neither has exactly one state, and it is real.** A static glyph still
36
+ * renders; `default` is the thing a gate screenshots. Returning nothing for it would make the
37
+ * overwhelming majority of the set invisible to every consumer of this function.
38
+ *
39
+ * @module
40
+ */
41
+ /**
42
+ * Every value of every axis, in the schema's own order.
43
+ *
44
+ * Adding a value to an axis reaches every consumer through this constant — which is the point of
45
+ * having one. It is typed against {@link ElementState} so a value the schema does not permit cannot
46
+ * be added here without the compiler saying so.
47
+ */
48
+ const AXIS_VALUES = {
49
+ availability: ['enabled', 'disabled', 'busy'],
50
+ selection: ['off', 'on', 'mixed'],
51
+ interaction: ['idle', 'engaged', 'pressed'],
52
+ };
53
+ /**
54
+ * The one sample per signal an enumeration shows: `progress` mid-gesture, `activity` running.
55
+ *
56
+ * A sample, not a range. Enumerating a continuous value is a category error; showing one
57
+ * representative point of it is what a reviewer or a gate can actually look at.
58
+ */
59
+ const SIGNAL_SAMPLE = {
60
+ progress: { progress: 0.5 },
61
+ activity: { activity: true },
62
+ };
63
+ /**
64
+ * The schema's axis order.
65
+ *
66
+ * Load-bearing: the key is built in THIS order, never the declaration's, so two elements declaring
67
+ * the same axes the other way round produce the same key for the same state. Without it one state
68
+ * would have two names, and anything keyed by name — a URL, a screenshot baseline, an agent's
69
+ * request — would split in two.
70
+ */
71
+ const AXIS_ORDER = ['availability', 'selection', 'interaction'];
72
+ /** The values of `axis` this contract honours: its `values` narrowing if present, else every value. */
73
+ const valuesFor = (contract, axis) => contract.values?.[axis] ?? AXIS_VALUES[axis];
74
+ const cross = (contract) => AXIS_ORDER.filter((a) => contract.axes.includes(a)).reduce((acc, axis) => acc.flatMap((base) => valuesFor(contract, axis).map((v) => ({ ...base, [axis]: v }))), [{}]);
75
+ const keyFor = (state) => {
76
+ const parts = AXIS_ORDER.filter((a) => state[a] !== undefined).map((a) => `${a}-${state[a]}`);
77
+ return parts.length ? parts.join('_') : 'default';
78
+ };
79
+ /**
80
+ * The states of ONE declaration: every combination of the axes it declares, then one sample per
81
+ * signal it declares. Never empty — an element with neither yields a single `default` entry.
82
+ */
83
+ export function statesOf(decl) {
84
+ const discrete = cross(decl.contract).map((elementState) => ({
85
+ id: decl.id,
86
+ state: keyFor(elementState),
87
+ elementState,
88
+ signals: {},
89
+ }));
90
+ const sampled = decl.contract.signals.map((signal) => ({
91
+ id: decl.id,
92
+ state: `signal-${signal}`,
93
+ elementState: {},
94
+ signals: SIGNAL_SAMPLE[signal],
95
+ }));
96
+ return [...discrete, ...sampled];
97
+ }
98
+ /**
99
+ * The states of many declarations, id-sorted so the list is stable whatever order they were read in.
100
+ *
101
+ * Without the sort a consumer that globs a directory would see its own enumeration reorder when the
102
+ * filesystem does, which reads as a change in the surface rather than in the elements.
103
+ */
104
+ export function elementStates(decls) {
105
+ return [...decls].sort((a, b) => a.id.localeCompare(b.id)).flatMap(statesOf);
106
+ }
107
+ /**
108
+ * `xeno.chevron-down` → `xeno-chevron-down`.
109
+ *
110
+ * An element id is permanent and contains a dot; a URL segment and a filename are both happier
111
+ * without one. Consumers that address a state by path want the same spelling as each other, so the
112
+ * transform lives here rather than being reinvented per tool.
113
+ */
114
+ export const slugForId = (id) => id.replace(/\./g, '-');
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Border scale — `DESIGN_SYSTEM.md §2 Borders` and the identically-valued "Reference Color Tokens"
3
+ * table (`borderSubtle`/`borderDefault`/`borderMedium`/`borderStrong`).
4
+ *
5
+ * All four are white-at-opacity, on the same accent ladder `./interactive.ts` publishes — `medium`
6
+ * is numerically identical to `accent.secondary` (both `rgba(255, 255, 255, 0.10)`) and `strong` is
7
+ * numerically identical to `accent.base` (both `rgba(255, 255, 255, 0.15)`). That is the design
8
+ * system's own overlap (one opacity ladder, reused across semantic roles), not a coincidence this
9
+ * module invents — `strong`/`default` are exported here under their OWN name because a border and an
10
+ * accent fill are different roles that happen to share a value today; a consumer asking for "the
11
+ * strong border colour" should not have to know it is spelled `accent.base` this season.
12
+ */
13
+ export declare const border: {
14
+ /** The faintest separation. */
15
+ readonly subtle: "rgba(255, 255, 255, 0.05)";
16
+ /** Around containers, between panels. Byte-identical to `PANEL_COLORS.border` (`./panel.ts`). */
17
+ readonly default: "rgba(255, 255, 255, 0.08)";
18
+ /** Glassmorphism borders. Byte-identical to `accent.secondary` (`./interactive.ts`). */
19
+ readonly medium: "rgba(255, 255, 255, 0.10)";
20
+ /** Focus states, active selections, strong dividers. Byte-identical to `accent.base`. */
21
+ readonly strong: "rgba(255, 255, 255, 0.15)";
22
+ };
23
+ export type BorderToken = keyof typeof border;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Border scale — `DESIGN_SYSTEM.md §2 Borders` and the identically-valued "Reference Color Tokens"
3
+ * table (`borderSubtle`/`borderDefault`/`borderMedium`/`borderStrong`).
4
+ *
5
+ * All four are white-at-opacity, on the same accent ladder `./interactive.ts` publishes — `medium`
6
+ * is numerically identical to `accent.secondary` (both `rgba(255, 255, 255, 0.10)`) and `strong` is
7
+ * numerically identical to `accent.base` (both `rgba(255, 255, 255, 0.15)`). That is the design
8
+ * system's own overlap (one opacity ladder, reused across semantic roles), not a coincidence this
9
+ * module invents — `strong`/`default` are exported here under their OWN name because a border and an
10
+ * accent fill are different roles that happen to share a value today; a consumer asking for "the
11
+ * strong border colour" should not have to know it is spelled `accent.base` this season.
12
+ */
13
+ export const border = {
14
+ /** The faintest separation. */
15
+ subtle: 'rgba(255, 255, 255, 0.05)',
16
+ /** Around containers, between panels. Byte-identical to `PANEL_COLORS.border` (`./panel.ts`). */
17
+ default: 'rgba(255, 255, 255, 0.08)',
18
+ /** Glassmorphism borders. Byte-identical to `accent.secondary` (`./interactive.ts`). */
19
+ medium: 'rgba(255, 255, 255, 0.10)',
20
+ /** Focus states, active selections, strong dividers. Byte-identical to `accent.base`. */
21
+ strong: 'rgba(255, 255, 255, 0.15)',
22
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * CHART palette — the monochrome SERIES ramp (six steps of white at falling opacity) and the FILL ramp that
3
+ * pairs with it. Lifted 2026-09-18 from `@xenosystem/blocks/data` (the chart block), where they were twelve
4
+ * white-alpha literals lifted in turn from sheets' `ChartModel`. A block may carry no colour literal, so the
5
+ * ramp moved DOWN a rung; the block assigns `var(--xeno-chart-series-<n>)` and a renderer resolves it where
6
+ * a canvas exists. Monochrome by design (`DESIGN_SYSTEM.md`): a series is told apart by weight, not hue.
7
+ */
8
+ export declare const chart: {
9
+ readonly series: readonly ["rgba(255, 255, 255, 0.9)", "rgba(255, 255, 255, 0.65)", "rgba(255, 255, 255, 0.45)", "rgba(255, 255, 255, 0.3)", "rgba(255, 255, 255, 0.18)", "rgba(255, 255, 255, 0.1)"];
10
+ readonly fill: readonly ["rgba(255, 255, 255, 0.15)", "rgba(255, 255, 255, 0.1)", "rgba(255, 255, 255, 0.07)", "rgba(255, 255, 255, 0.05)", "rgba(255, 255, 255, 0.035)", "rgba(255, 255, 255, 0.02)"];
11
+ };
12
+ /** `--xeno-chart-series-1` … `-6`, `--xeno-chart-fill-1` … `-6`. */
13
+ export declare function chartVar(ramp: keyof typeof chart, step: number): string;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * CHART palette — the monochrome SERIES ramp (six steps of white at falling opacity) and the FILL ramp that
3
+ * pairs with it. Lifted 2026-09-18 from `@xenosystem/blocks/data` (the chart block), where they were twelve
4
+ * white-alpha literals lifted in turn from sheets' `ChartModel`. A block may carry no colour literal, so the
5
+ * ramp moved DOWN a rung; the block assigns `var(--xeno-chart-series-<n>)` and a renderer resolves it where
6
+ * a canvas exists. Monochrome by design (`DESIGN_SYSTEM.md`): a series is told apart by weight, not hue.
7
+ */
8
+ export const chart = {
9
+ series: ['rgba(255, 255, 255, 0.9)', 'rgba(255, 255, 255, 0.65)', 'rgba(255, 255, 255, 0.45)', 'rgba(255, 255, 255, 0.3)', 'rgba(255, 255, 255, 0.18)', 'rgba(255, 255, 255, 0.1)'],
10
+ fill: ['rgba(255, 255, 255, 0.15)', 'rgba(255, 255, 255, 0.1)', 'rgba(255, 255, 255, 0.07)', 'rgba(255, 255, 255, 0.05)', 'rgba(255, 255, 255, 0.035)', 'rgba(255, 255, 255, 0.02)'],
11
+ };
12
+ /** `--xeno-chart-series-1` … `-6`, `--xeno-chart-fill-1` … `-6`. */
13
+ export function chartVar(ramp, step) {
14
+ return `--xeno-chart-${ramp}-${step}`;
15
+ }
@@ -8,6 +8,14 @@
8
8
  * Scope so far: §2 surfaces + interactive/text/glass, plus the radius scale, control size scale and
9
9
  * status vocabulary (landed for Tier-1 controls, values from the locked chat lab / DESIGN_SYSTEM). Motion
10
10
  * durations and the cursor map are the remaining ROADMAP tokens.
11
+ *
12
+ * Added 2026-09-21 for a downstream consumer (`@xenosystem/workbench`) that had been carrying these
13
+ * exact §2 values as first-authored literals for want of a TS export: `reading` (the reading-text
14
+ * ramp — primary/body/secondary/muted/dim, distinct from `interactive.ts`'s `text` states),
15
+ * `border` (the four-step border scale as its own named group), `scrollbar` (opaque thumb/hover
16
+ * hex from the §2 reference table), and `surface.surface1` (app-chrome raise level). Every value is
17
+ * copied byte-for-byte from `DESIGN_SYSTEM.md §2`'s "Reference Color Tokens" table — none is new or
18
+ * proposed.
11
19
  */
12
20
  export * from './surfaces.js';
13
21
  export * from './interactive.js';
@@ -16,3 +24,6 @@ export * from './size.js';
16
24
  export * from './status.js';
17
25
  export * from './motion.js';
18
26
  export * from './panel.js';
27
+ export * from './reading.js';
28
+ export * from './border.js';
29
+ export * from './scrollbar.js';
@@ -8,6 +8,14 @@
8
8
  * Scope so far: §2 surfaces + interactive/text/glass, plus the radius scale, control size scale and
9
9
  * status vocabulary (landed for Tier-1 controls, values from the locked chat lab / DESIGN_SYSTEM). Motion
10
10
  * durations and the cursor map are the remaining ROADMAP tokens.
11
+ *
12
+ * Added 2026-09-21 for a downstream consumer (`@xenosystem/workbench`) that had been carrying these
13
+ * exact §2 values as first-authored literals for want of a TS export: `reading` (the reading-text
14
+ * ramp — primary/body/secondary/muted/dim, distinct from `interactive.ts`'s `text` states),
15
+ * `border` (the four-step border scale as its own named group), `scrollbar` (opaque thumb/hover
16
+ * hex from the §2 reference table), and `surface.surface1` (app-chrome raise level). Every value is
17
+ * copied byte-for-byte from `DESIGN_SYSTEM.md §2`'s "Reference Color Tokens" table — none is new or
18
+ * proposed.
11
19
  */
12
20
  export * from './surfaces.js';
13
21
  export * from './interactive.js';
@@ -16,3 +24,6 @@ export * from './size.js';
16
24
  export * from './status.js';
17
25
  export * from './motion.js';
18
26
  export * from './panel.js';
27
+ export * from './reading.js';
28
+ export * from './border.js';
29
+ export * from './scrollbar.js';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The reading-text hierarchy — `DESIGN_SYSTEM.md §2 Text Hierarchy` (and the identically-valued
3
+ * "Reference Color Tokens" table: `textPrimary`/`textBody`/`textSecondary`/`textMuted`/`textDim`).
4
+ *
5
+ * Distinct from `./interactive.ts`'s `text` export: that group is INTERACTIVE STATES (idle/hover/
6
+ * active — how a menu item or button label looks as the pointer moves over it). This group is the
7
+ * READING ramp — how much attention a piece of static content earns, independent of interaction.
8
+ * The two happen to share a design vocabulary ("text") but are different axes with different values
9
+ * (compare `text.secondary` `#9a9aa1`, the AA-safe caption tone, with `reading.secondary` `#a8a8b1`
10
+ * below — same rank in each ramp, not the same colour, because they answer different questions).
11
+ * Do not merge them into one export: a consumer needing "the fourth-darkest reading tone" and a
12
+ * consumer needing "this menu item's hover colour" must not be able to typo their way into the
13
+ * other's value.
14
+ *
15
+ * One neutral cool-gray family (R=G, B≈+7) — never the retired slate/blue-tinted ramp.
16
+ */
17
+ export declare const reading: {
18
+ /** Content the user is actively reading — names, values, headings. */
19
+ readonly primary: "#ffffff";
20
+ /** Descriptions, transaction names, supporting content. */
21
+ readonly body: "#e5e5e9";
22
+ /** Labels, section headers, metadata. Most descriptions use this. */
23
+ readonly secondary: "#a8a8b1";
24
+ /** Hints, subtitles, captions. */
25
+ readonly muted: "#79797f";
26
+ /** Timestamps, balance-after values, the faintest text. */
27
+ readonly dim: "#57575e";
28
+ };
29
+ export type ReadingToken = keyof typeof reading;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The reading-text hierarchy — `DESIGN_SYSTEM.md §2 Text Hierarchy` (and the identically-valued
3
+ * "Reference Color Tokens" table: `textPrimary`/`textBody`/`textSecondary`/`textMuted`/`textDim`).
4
+ *
5
+ * Distinct from `./interactive.ts`'s `text` export: that group is INTERACTIVE STATES (idle/hover/
6
+ * active — how a menu item or button label looks as the pointer moves over it). This group is the
7
+ * READING ramp — how much attention a piece of static content earns, independent of interaction.
8
+ * The two happen to share a design vocabulary ("text") but are different axes with different values
9
+ * (compare `text.secondary` `#9a9aa1`, the AA-safe caption tone, with `reading.secondary` `#a8a8b1`
10
+ * below — same rank in each ramp, not the same colour, because they answer different questions).
11
+ * Do not merge them into one export: a consumer needing "the fourth-darkest reading tone" and a
12
+ * consumer needing "this menu item's hover colour" must not be able to typo their way into the
13
+ * other's value.
14
+ *
15
+ * One neutral cool-gray family (R=G, B≈+7) — never the retired slate/blue-tinted ramp.
16
+ */
17
+ export const reading = {
18
+ /** Content the user is actively reading — names, values, headings. */
19
+ primary: '#ffffff',
20
+ /** Descriptions, transaction names, supporting content. */
21
+ body: '#e5e5e9',
22
+ /** Labels, section headers, metadata. Most descriptions use this. */
23
+ secondary: '#a8a8b1',
24
+ /** Hints, subtitles, captions. */
25
+ muted: '#79797f',
26
+ /** Timestamps, balance-after values, the faintest text. */
27
+ dim: '#57575e',
28
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Scrollbar thumb colours — `DESIGN_SYSTEM.md §2` "Reference Color Tokens" (`scrollThumb`/
3
+ * `scrollHover`), opaque hex. Geometry (thin rectangle, transparent track, margin on every side) is
4
+ * described in `DESIGN_SYSTEM.md §3 The Scrollbar`; this module is colour only.
5
+ *
6
+ * `packages/elements-react/src/xeno-theme.css` also ships scrollbar colours
7
+ * (`--xeno-scroll-thumb*`), but as **alpha-over-transparent** (`rgba(255, 255, 255, 0.16)` /
8
+ * `0.28`), not this module's opaque hex. The two are NOT the same token under two names — compositing
9
+ * the CSS alphas over `surface.canvas` (`#111111`) lands close to but not equal to the values below
10
+ * (`rgba(255,255,255,0.16)` over `#111111` ≈ `#373737`, not `#3a3a3d`), so this module does not derive
11
+ * from that file. It derives from `DESIGN_SYSTEM.md`'s own reference table, which is where these exact
12
+ * opaque values (`#3a3a3d` / `#555555`) are locked. The CSS variant is elements-react's own
13
+ * implementation choice for its own scrollable surfaces and is out of scope here.
14
+ */
15
+ export declare const scrollbar: {
16
+ readonly thumb: "#3a3a3d";
17
+ readonly thumbHover: "#555555";
18
+ };
19
+ export type ScrollbarToken = keyof typeof scrollbar;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Scrollbar thumb colours — `DESIGN_SYSTEM.md §2` "Reference Color Tokens" (`scrollThumb`/
3
+ * `scrollHover`), opaque hex. Geometry (thin rectangle, transparent track, margin on every side) is
4
+ * described in `DESIGN_SYSTEM.md §3 The Scrollbar`; this module is colour only.
5
+ *
6
+ * `packages/elements-react/src/xeno-theme.css` also ships scrollbar colours
7
+ * (`--xeno-scroll-thumb*`), but as **alpha-over-transparent** (`rgba(255, 255, 255, 0.16)` /
8
+ * `0.28`), not this module's opaque hex. The two are NOT the same token under two names — compositing
9
+ * the CSS alphas over `surface.canvas` (`#111111`) lands close to but not equal to the values below
10
+ * (`rgba(255,255,255,0.16)` over `#111111` ≈ `#373737`, not `#3a3a3d`), so this module does not derive
11
+ * from that file. It derives from `DESIGN_SYSTEM.md`'s own reference table, which is where these exact
12
+ * opaque values (`#3a3a3d` / `#555555`) are locked. The CSS variant is elements-react's own
13
+ * implementation choice for its own scrollable surfaces and is out of scope here.
14
+ */
15
+ export const scrollbar = {
16
+ thumb: '#3a3a3d',
17
+ thumbHover: '#555555',
18
+ };
@@ -14,5 +14,12 @@ export declare const surface: {
14
14
  readonly input: "#2b2b2b";
15
15
  readonly dialog: "#111115";
16
16
  readonly dropdown: "#101011";
17
+ /**
18
+ * "cards, panels, sidebar" — app CHROME raised one step above `page` (§2 Surface Hierarchy: "app
19
+ * chrome … sits above [the page] (lighter, `surface1 #18181b`)"). Distinct from `panelBody`
20
+ * (`#161618`, a panel's own full-height background): `surface1` is the app-shell level a panel
21
+ * sits ON, not the panel's own fill.
22
+ */
23
+ readonly surface1: "#18181b";
17
24
  };
18
25
  export type SurfaceToken = keyof typeof surface;
@@ -14,4 +14,11 @@ export const surface = {
14
14
  input: '#2b2b2b',
15
15
  dialog: '#111115',
16
16
  dropdown: '#101011',
17
+ /**
18
+ * "cards, panels, sidebar" — app CHROME raised one step above `page` (§2 Surface Hierarchy: "app
19
+ * chrome … sits above [the page] (lighter, `surface1 #18181b`)"). Distinct from `panelBody`
20
+ * (`#161618`, a panel's own full-height background): `surface1` is the app-shell level a panel
21
+ * sits ON, not the panel's own fill.
22
+ */
23
+ surface1: '#18181b',
17
24
  };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * TERMINAL palette — the sixteen ANSI colours plus the surface a terminal sits on.
3
+ *
4
+ * The one place in the design system where hue is CONTENT, not chrome: a program that prints red means
5
+ * red, and a monochrome terminal would destroy information the user's own tools are trying to convey.
6
+ * A complete sixteen, never a partial one — a partial theme lets `ls --color` fall back to xterm's own
7
+ * blues and greens rather than these. Neutrals follow the dark surface tokens. Lifted 2026-09-18 from
8
+ * `@xenosystem/blocks/ops` (the terminal block), where they were hex in a block — a block may carry no
9
+ * literal, so the palette moved DOWN a rung. Emitted as `--xeno-terminal-*` by elements-react's theme.
10
+ */
11
+ export declare const terminal: {
12
+ readonly background: "#0a0a0b";
13
+ readonly foreground: "#e4e4e4";
14
+ readonly cursor: "#e4e4e4";
15
+ readonly cursorAccent: "#0a0a0b";
16
+ readonly selectionBackground: "#33333a";
17
+ readonly black: "#0a0a0b";
18
+ readonly red: "#cd3131";
19
+ readonly green: "#0dbc79";
20
+ readonly yellow: "#e5e510";
21
+ readonly blue: "#2472c8";
22
+ readonly magenta: "#bc3fbc";
23
+ readonly cyan: "#11a8cd";
24
+ readonly white: "#d4d4d4";
25
+ readonly brightBlack: "#5a5a5f";
26
+ readonly brightRed: "#f14c4c";
27
+ readonly brightGreen: "#23d18b";
28
+ readonly brightYellow: "#f5f543";
29
+ readonly brightBlue: "#3b8eea";
30
+ readonly brightMagenta: "#d670d6";
31
+ readonly brightCyan: "#29b8db";
32
+ readonly brightWhite: "#ffffff";
33
+ };
34
+ export type TerminalToken = keyof typeof terminal;
35
+ /** The `--xeno-terminal-<kebab>` custom property for a token — one derivation, used by the theme and its test. */
36
+ export declare function terminalVar(token: TerminalToken): string;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * TERMINAL palette — the sixteen ANSI colours plus the surface a terminal sits on.
3
+ *
4
+ * The one place in the design system where hue is CONTENT, not chrome: a program that prints red means
5
+ * red, and a monochrome terminal would destroy information the user's own tools are trying to convey.
6
+ * A complete sixteen, never a partial one — a partial theme lets `ls --color` fall back to xterm's own
7
+ * blues and greens rather than these. Neutrals follow the dark surface tokens. Lifted 2026-09-18 from
8
+ * `@xenosystem/blocks/ops` (the terminal block), where they were hex in a block — a block may carry no
9
+ * literal, so the palette moved DOWN a rung. Emitted as `--xeno-terminal-*` by elements-react's theme.
10
+ */
11
+ export const terminal = {
12
+ background: '#0a0a0b',
13
+ foreground: '#e4e4e4',
14
+ cursor: '#e4e4e4',
15
+ cursorAccent: '#0a0a0b',
16
+ selectionBackground: '#33333a',
17
+ black: '#0a0a0b',
18
+ red: '#cd3131',
19
+ green: '#0dbc79',
20
+ yellow: '#e5e510',
21
+ blue: '#2472c8',
22
+ magenta: '#bc3fbc',
23
+ cyan: '#11a8cd',
24
+ white: '#d4d4d4',
25
+ brightBlack: '#5a5a5f',
26
+ brightRed: '#f14c4c',
27
+ brightGreen: '#23d18b',
28
+ brightYellow: '#f5f543',
29
+ brightBlue: '#3b8eea',
30
+ brightMagenta: '#d670d6',
31
+ brightCyan: '#29b8db',
32
+ brightWhite: '#ffffff',
33
+ };
34
+ /** The `--xeno-terminal-<kebab>` custom property for a token — one derivation, used by the theme and its test. */
35
+ export function terminalVar(token) {
36
+ return `--xeno-terminal-${token.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase())}`;
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/elements",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "license": "UNLICENSED",
5
5
  "description": "The XENO element contract — declarations, schema, state model. Framework-free, platform-free.",
6
6
  "author": "XENO Corporation <emilian@bnkrsys.com>",
@@ -17,6 +17,10 @@
17
17
  "types": "./dist/schema.d.ts",
18
18
  "default": "./dist/schema.js"
19
19
  },
20
+ "./states": {
21
+ "types": "./dist/states.d.ts",
22
+ "default": "./dist/states.js"
23
+ },
20
24
  "./tokens": {
21
25
  "types": "./dist/tokens/index.d.ts",
22
26
  "default": "./dist/tokens/index.js"
@@ -34,7 +38,10 @@
34
38
  "build": "tsc -p tsconfig.json",
35
39
  "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
36
40
  "test": "vitest run",
37
- "import-glyphs": "node --no-warnings scripts/import-glyphs.mjs"
41
+ "import-glyphs": "node --no-warnings scripts/import-glyphs.mjs",
42
+ "verify:pack": "node --no-warnings scripts/verify-pack.mjs",
43
+ "test:pack-guard": "node --no-warnings scripts/verify-pack.negative.test.mjs",
44
+ "prepack": "node --no-warnings scripts/verify-pack.mjs"
38
45
  },
39
46
  "devDependencies": {
40
47
  "svgpath": "^2.6.0",