@finstack-com-public/design 0.9.1 → 0.10.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.
@@ -71,7 +71,29 @@ export function contrastPairs() {
71
71
  role('text', 'ink-muted', 'gap-wash');
72
72
  for (const mark of ['exact', 'approx', 'none']) {
73
73
  role('text', `mark-${mark}-ink`, `mark-${mark}-wash`);
74
+ // The mark dot (T92): its fill is non-text on surface and chrome.
75
+ role('non-text', `mark-${mark}-fill`, 'bg-surface');
76
+ role('non-text', `mark-${mark}-fill`, 'bg-chrome');
74
77
  }
78
+ // The hollow dot of "not converted" is a ring in the gap ink (T92).
79
+ role('non-text', 'mark-none-ink', 'bg-surface');
80
+ role('non-text', 'mark-none-ink', 'bg-chrome');
81
+ // The data-type badge's icon (T93): muted ink on the sunken fill is a meaningful icon, so 3:1 (it passes 4.5:1 as text too).
82
+ role('non-text', 'ink-2', 'bg-sunken');
83
+ // The diagram's line and emphasis inks, and the end circle's edge, on the plane (T94, spec 06 §2).
84
+ // The inactive line is deliberately faint: its dash is the cue (spec 06 §2), so it has no pair.
85
+ for (const ink of ['diagram-line', 'diagram-line-emphasis'])
86
+ role('non-text', ink, 'diagram-bg');
87
+ role('non-text', 'diagram-end-line', 'diagram-end-bg');
88
+ role('text', 'diagram-end-ink', 'diagram-end-bg');
89
+ // The node frame (T96): the selected outline and the lit edge are the accent, the fail edge the gap ink, on the plane (3:1).
90
+ role('non-text', 'accent', 'diagram-bg');
91
+ role('non-text', 'gap-ink', 'diagram-bg');
92
+ // The accent edge on the lit wash is covered by the 4.5:1 text pair of the parameter badge (T72).
93
+ // Text on a lit header and a lit row (the accent wash), and the gap word on the node's surface.
94
+ for (const fg of ['ink', 'ink-2', 'ink-muted'])
95
+ role('text', fg, 'accent-wash');
96
+ role('text', 'gap-ink', 'bg-surface');
75
97
  for (const tag of Object.keys(sx)) {
76
98
  add('text', `syntax-${tag}`, sx[tag], 'bg-surface', c['bg-surface']);
77
99
  add('text', `syntax-${tag}`, sx[tag], 'bg-sunken', c['bg-sunken']);
@@ -1,15 +1,15 @@
1
1
  import { type ColorRole, type ShadowKey } from './color.ts';
2
2
  import { type Density, type DensityToken } from './density.ts';
3
3
  import { type GridRole } from './grid.ts';
4
- import { chartScale, fonts, gradients, lines, motion, patterns, radii, sizes, sizesEm, space, textSteps, tracking, weights, zLayers } from './scale.ts';
4
+ import { chartScale, diagram, fonts, gradients, lines, motion, patterns, radii, sizes, sizesEm, space, textSteps, tracking, weights, zLayers } from './scale.ts';
5
5
  import { type SyntaxTag } from './syntax.ts';
6
6
  import { type Scheme } from './values.ts';
7
7
  export type { ColorRole, Density, DensityToken, GridRole, Scheme, ShadowKey, SyntaxTag };
8
8
  export type TextStep = keyof typeof textSteps;
9
9
  export declare const tokens: {
10
10
  readonly color: {
11
- light: Record<"bg-surface" | "bg-page" | "bg-plane" | "bg-chrome" | "bg-sunken" | "bg-hover" | "bg-active" | "bg-selected" | "bg-disabled" | "bg-highlight" | "bg-backdrop" | "ink" | "ink-2" | "ink-muted" | "ink-disabled" | "ink-on-accent" | "ink-link" | "line" | "line-strong" | "line-control" | "line-control-strong" | "line-button" | "accent" | "accent-strong" | "accent-wash" | "primary-bg" | "primary-bg-hover" | "primary-ink" | "ring" | "brand-start" | "brand-end" | "brand-wash-start" | "brand-wash-end" | "ring-halo" | "glass-bg" | "glass-bg-end" | "wave-glow" | "neutral-ink" | "neutral-wash" | "neutral-edge" | "neutral-fill" | "info-ink" | "info-wash" | "info-edge" | "info-fill" | "positive-ink" | "positive-wash" | "positive-edge" | "positive-fill" | "caution-ink" | "caution-wash" | "caution-edge" | "caution-fill" | "warning-ink" | "warning-wash" | "warning-edge" | "warning-fill" | "warning-icon" | "danger-ink" | "danger-wash" | "danger-edge" | "danger-fill" | "gap-ink" | "gap-wash" | "gap-edge" | "gap-fill" | "gap-hatch-tint" | "figure-good" | "figure-bad" | "figure-plain" | "mark-exact-ink" | "mark-exact-wash" | "mark-exact-fill" | "mark-approx-ink" | "mark-approx-wash" | "mark-approx-fill" | "mark-none-ink" | "mark-none-wash" | "mark-none-fill" | "type-organise" | "type-view" | "type-input" | "type-model" | "type-access" | "computed-bg" | "computed-line" | "editor-gutter-bg" | "editor-gutter-ink" | "editor-gutter-line" | "editor-selection" | "editor-selection-blur" | "editor-caret" | "editor-active-line" | "editor-match" | "editor-mismatch" | "editor-lint-error" | "editor-lint-warning" | "editor-lint-refusal" | "editor-tooltip-bg" | "editor-tooltip-line" | "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-6" | "chart-7" | "chart-8" | "chart-other" | "chart-comparison" | "chart-axis" | "chart-label" | "chart-grid" | "chart-zero" | "chart-good" | "chart-bad", string>;
12
- dark: Record<"bg-surface" | "bg-page" | "bg-plane" | "bg-chrome" | "bg-sunken" | "bg-hover" | "bg-active" | "bg-selected" | "bg-disabled" | "bg-highlight" | "bg-backdrop" | "ink" | "ink-2" | "ink-muted" | "ink-disabled" | "ink-on-accent" | "ink-link" | "line" | "line-strong" | "line-control" | "line-control-strong" | "line-button" | "accent" | "accent-strong" | "accent-wash" | "primary-bg" | "primary-bg-hover" | "primary-ink" | "ring" | "brand-start" | "brand-end" | "brand-wash-start" | "brand-wash-end" | "ring-halo" | "glass-bg" | "glass-bg-end" | "wave-glow" | "neutral-ink" | "neutral-wash" | "neutral-edge" | "neutral-fill" | "info-ink" | "info-wash" | "info-edge" | "info-fill" | "positive-ink" | "positive-wash" | "positive-edge" | "positive-fill" | "caution-ink" | "caution-wash" | "caution-edge" | "caution-fill" | "warning-ink" | "warning-wash" | "warning-edge" | "warning-fill" | "warning-icon" | "danger-ink" | "danger-wash" | "danger-edge" | "danger-fill" | "gap-ink" | "gap-wash" | "gap-edge" | "gap-fill" | "gap-hatch-tint" | "figure-good" | "figure-bad" | "figure-plain" | "mark-exact-ink" | "mark-exact-wash" | "mark-exact-fill" | "mark-approx-ink" | "mark-approx-wash" | "mark-approx-fill" | "mark-none-ink" | "mark-none-wash" | "mark-none-fill" | "type-organise" | "type-view" | "type-input" | "type-model" | "type-access" | "computed-bg" | "computed-line" | "editor-gutter-bg" | "editor-gutter-ink" | "editor-gutter-line" | "editor-selection" | "editor-selection-blur" | "editor-caret" | "editor-active-line" | "editor-match" | "editor-mismatch" | "editor-lint-error" | "editor-lint-warning" | "editor-lint-refusal" | "editor-tooltip-bg" | "editor-tooltip-line" | "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-6" | "chart-7" | "chart-8" | "chart-other" | "chart-comparison" | "chart-axis" | "chart-label" | "chart-grid" | "chart-zero" | "chart-good" | "chart-bad", string>;
11
+ light: Record<"bg-surface" | "bg-page" | "bg-plane" | "bg-chrome" | "bg-sunken" | "bg-hover" | "bg-active" | "bg-selected" | "bg-disabled" | "bg-highlight" | "bg-backdrop" | "ink" | "ink-2" | "ink-muted" | "ink-disabled" | "ink-on-accent" | "ink-link" | "line" | "line-strong" | "line-control" | "line-control-strong" | "line-button" | "accent" | "accent-strong" | "accent-wash" | "primary-bg" | "primary-bg-hover" | "primary-ink" | "ring" | "brand-start" | "brand-end" | "brand-wash-start" | "brand-wash-end" | "ring-halo" | "glass-bg" | "glass-bg-end" | "wave-glow" | "neutral-ink" | "neutral-wash" | "neutral-edge" | "neutral-fill" | "info-ink" | "info-wash" | "info-edge" | "info-fill" | "positive-ink" | "positive-wash" | "positive-edge" | "positive-fill" | "caution-ink" | "caution-wash" | "caution-edge" | "caution-fill" | "warning-ink" | "warning-wash" | "warning-edge" | "warning-fill" | "warning-icon" | "danger-ink" | "danger-wash" | "danger-edge" | "danger-fill" | "gap-ink" | "gap-wash" | "gap-edge" | "gap-fill" | "gap-hatch-tint" | "figure-good" | "figure-bad" | "figure-plain" | "mark-exact-ink" | "mark-exact-wash" | "mark-exact-fill" | "mark-approx-ink" | "mark-approx-wash" | "mark-approx-fill" | "mark-none-ink" | "mark-none-wash" | "mark-none-fill" | "type-organise" | "type-view" | "type-input" | "type-model" | "type-access" | "diagram-bg" | "diagram-dot" | "diagram-line" | "diagram-line-inactive" | "diagram-line-emphasis" | "diagram-end-bg" | "diagram-end-line" | "diagram-end-ink" | "computed-bg" | "computed-line" | "editor-gutter-bg" | "editor-gutter-ink" | "editor-gutter-line" | "editor-selection" | "editor-selection-blur" | "editor-caret" | "editor-active-line" | "editor-match" | "editor-mismatch" | "editor-lint-error" | "editor-lint-warning" | "editor-lint-refusal" | "editor-tooltip-bg" | "editor-tooltip-line" | "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-6" | "chart-7" | "chart-8" | "chart-other" | "chart-comparison" | "chart-axis" | "chart-label" | "chart-grid" | "chart-zero" | "chart-good" | "chart-bad", string>;
12
+ dark: Record<"bg-surface" | "bg-page" | "bg-plane" | "bg-chrome" | "bg-sunken" | "bg-hover" | "bg-active" | "bg-selected" | "bg-disabled" | "bg-highlight" | "bg-backdrop" | "ink" | "ink-2" | "ink-muted" | "ink-disabled" | "ink-on-accent" | "ink-link" | "line" | "line-strong" | "line-control" | "line-control-strong" | "line-button" | "accent" | "accent-strong" | "accent-wash" | "primary-bg" | "primary-bg-hover" | "primary-ink" | "ring" | "brand-start" | "brand-end" | "brand-wash-start" | "brand-wash-end" | "ring-halo" | "glass-bg" | "glass-bg-end" | "wave-glow" | "neutral-ink" | "neutral-wash" | "neutral-edge" | "neutral-fill" | "info-ink" | "info-wash" | "info-edge" | "info-fill" | "positive-ink" | "positive-wash" | "positive-edge" | "positive-fill" | "caution-ink" | "caution-wash" | "caution-edge" | "caution-fill" | "warning-ink" | "warning-wash" | "warning-edge" | "warning-fill" | "warning-icon" | "danger-ink" | "danger-wash" | "danger-edge" | "danger-fill" | "gap-ink" | "gap-wash" | "gap-edge" | "gap-fill" | "gap-hatch-tint" | "figure-good" | "figure-bad" | "figure-plain" | "mark-exact-ink" | "mark-exact-wash" | "mark-exact-fill" | "mark-approx-ink" | "mark-approx-wash" | "mark-approx-fill" | "mark-none-ink" | "mark-none-wash" | "mark-none-fill" | "type-organise" | "type-view" | "type-input" | "type-model" | "type-access" | "diagram-bg" | "diagram-dot" | "diagram-line" | "diagram-line-inactive" | "diagram-line-emphasis" | "diagram-end-bg" | "diagram-end-line" | "diagram-end-ink" | "computed-bg" | "computed-line" | "editor-gutter-bg" | "editor-gutter-ink" | "editor-gutter-line" | "editor-selection" | "editor-selection-blur" | "editor-caret" | "editor-active-line" | "editor-match" | "editor-mismatch" | "editor-lint-error" | "editor-lint-warning" | "editor-lint-refusal" | "editor-tooltip-bg" | "editor-tooltip-line" | "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | "chart-6" | "chart-7" | "chart-8" | "chart-other" | "chart-comparison" | "chart-axis" | "chart-label" | "chart-grid" | "chart-zero" | "chart-good" | "chart-bad", string>;
13
13
  };
14
14
  readonly shadow: {
15
15
  light: Record<"1" | "2" | "3" | "drawer" | "tooltip" | "lift", string>;
@@ -184,10 +184,24 @@ export declare const tokens: {
184
184
  readonly 'chart-area-alpha': 0.18;
185
185
  readonly 'chart-series-alpha': 0.6;
186
186
  };
187
+ readonly diagram: {
188
+ readonly 'diagram-line-width': "1.5px";
189
+ readonly 'diagram-emphasis-width': "2.25px";
190
+ readonly 'diagram-inactive-dash': "5 4";
191
+ readonly 'diagram-flow-dash': "6 5";
192
+ readonly 'diagram-flow-offset': "-22";
193
+ readonly 'diagram-flow-period': "900ms";
194
+ readonly 'diagram-dim-node': "0.38";
195
+ readonly 'diagram-dim-edge': "0.25";
196
+ readonly 'diagram-end-size': "14px";
197
+ readonly 'diagram-end-line-width': "1.2px";
198
+ readonly 'diagram-dot-size': "1px";
199
+ readonly 'diagram-grid-gap': "20px";
200
+ };
187
201
  };
188
202
  export type Tokens = typeof tokens;
189
203
  /** Every custom property the kit declares, without its `--fs-` prefix. */
190
- export type TokenName = ColorRole | DensityToken | `shadow-${ShadowKey}` | `grid-${GridRole}` | `syntax-${SyntaxTag}` | `font-${keyof typeof fonts}` | `text-${TextStep}-size` | `text-${TextStep}-line` | `weight-${keyof typeof weights}` | `tracking-${keyof typeof tracking}` | `space-${keyof typeof space}` | `radius-${keyof typeof radii}` | `size-${keyof typeof sizes}` | `size-${keyof typeof sizesEm}` | keyof typeof lines | 'icon-stroke' | keyof typeof motion | `z-${keyof typeof zLayers}` | keyof typeof patterns | keyof typeof gradients | keyof typeof chartScale;
204
+ export type TokenName = ColorRole | DensityToken | `shadow-${ShadowKey}` | `grid-${GridRole}` | `syntax-${SyntaxTag}` | `font-${keyof typeof fonts}` | `text-${TextStep}-size` | `text-${TextStep}-line` | `weight-${keyof typeof weights}` | `tracking-${keyof typeof tracking}` | `space-${keyof typeof space}` | `radius-${keyof typeof radii}` | `size-${keyof typeof sizes}` | `size-${keyof typeof sizesEm}` | keyof typeof lines | 'icon-stroke' | keyof typeof motion | `z-${keyof typeof zLayers}` | keyof typeof patterns | keyof typeof gradients | keyof typeof chartScale | keyof typeof diagram;
191
205
  /** `cssVar('accent')` → `'var(--fs-accent)'`. */
192
206
  export declare function cssVar(name: TokenName): string;
193
207
  /**
@@ -3,7 +3,7 @@ import { colorRoles, shadows } from "./color.js";
3
3
  import { densities } from "./density.js";
4
4
  import { gridRoles } from "./grid.js";
5
5
  import { primitives } from "./primitives.js";
6
- import { chartScale, fonts, gradients, iconStroke, lines, motion, motionReduced, patterns, radii, sizes, sizesEm, space, textSteps, tracking, weights, zLayers, } from "./scale.js";
6
+ import { chartScale, diagram, fonts, gradients, iconStroke, lines, motion, motionReduced, patterns, radii, sizes, sizesEm, space, textSteps, tracking, weights, zLayers, } from "./scale.js";
7
7
  import { syntaxTags } from "./syntax.js";
8
8
  import { isPrimitiveRef, isRoleRef } from "./values.js";
9
9
  function resolver(table, scheme) {
@@ -54,6 +54,7 @@ export const tokens = {
54
54
  pattern: patterns,
55
55
  gradient: gradients,
56
56
  chart: chartScale,
57
+ diagram,
57
58
  };
58
59
  /** `cssVar('accent')` → `'var(--fs-accent)'`. */
59
60
  export function cssVar(name) {
@@ -141,6 +141,20 @@ export declare const chartScale: {
141
141
  readonly 'chart-area-alpha': 0.18;
142
142
  readonly 'chart-series-alpha': 0.6;
143
143
  };
144
+ export declare const diagram: {
145
+ readonly 'diagram-line-width': "1.5px";
146
+ readonly 'diagram-emphasis-width': "2.25px";
147
+ readonly 'diagram-inactive-dash': "5 4";
148
+ readonly 'diagram-flow-dash': "6 5";
149
+ readonly 'diagram-flow-offset': "-22";
150
+ readonly 'diagram-flow-period': "900ms";
151
+ readonly 'diagram-dim-node': "0.38";
152
+ readonly 'diagram-dim-edge': "0.25";
153
+ readonly 'diagram-end-size': "14px";
154
+ readonly 'diagram-end-line-width': "1.2px";
155
+ readonly 'diagram-dot-size': "1px";
156
+ readonly 'diagram-grid-gap': "20px";
157
+ };
144
158
  export declare const zLayers: {
145
159
  readonly sticky: 10;
146
160
  readonly dropdown: 100;
@@ -97,6 +97,23 @@ export const motionReduced = {
97
97
  };
98
98
  // Area fills under a line (`chart-area-alpha`) and the series themselves (`chart-series-alpha`, D40), as an alpha on the chart's own shapes (spec 04 §2.4). CSS: `--fs-<key>`.
99
99
  export const chartScale = { 'chart-area-alpha': 0.18, 'chart-series-alpha': 0.6 };
100
+ // The diagram's line weights, dashes, dimming, end circle and plane grid, from core's model-view.css (spec 01 §3.12).
101
+ // Plain CSS values, so a dash is `5 4` and an opacity is a number. CSS: `--fs-<key>`.
102
+ export const diagram = {
103
+ 'diagram-line-width': '1.5px',
104
+ 'diagram-emphasis-width': '2.25px',
105
+ 'diagram-inactive-dash': '5 4',
106
+ 'diagram-flow-dash': '6 5',
107
+ // One dash plus one gap is 11, so two periods per cycle: the flow's keyframe offset.
108
+ 'diagram-flow-offset': '-22',
109
+ 'diagram-flow-period': '900ms',
110
+ 'diagram-dim-node': '0.38',
111
+ 'diagram-dim-edge': '0.25',
112
+ 'diagram-end-size': '14px',
113
+ 'diagram-end-line-width': '1.2px',
114
+ 'diagram-dot-size': '1px',
115
+ 'diagram-grid-gap': '20px',
116
+ };
100
117
  export const zLayers = { sticky: 10, dropdown: 100, overlay: 200, dialog: 300, toast: 400 };
101
118
  // The gap hatch, read at the point of use, so an island's tint recolours it (spec 01 §3.4).
102
119
  export const patterns = {
package/dist/tokens.json CHANGED
@@ -101,6 +101,14 @@
101
101
  "editor-lint-refusal": "#646a72",
102
102
  "editor-tooltip-bg": "#ffffff",
103
103
  "editor-tooltip-line": "#c9d4e6",
104
+ "diagram-bg": "#f7f8fa",
105
+ "diagram-dot": "#c9d4e6",
106
+ "diagram-line": "#5b6785",
107
+ "diagram-line-inactive": "#c9d4e6",
108
+ "diagram-line-emphasis": "#1f4fe0",
109
+ "diagram-end-bg": "#ffffff",
110
+ "diagram-end-line": "#5b6785",
111
+ "diagram-end-ink": "#3b4a6b",
104
112
  "chart-1": "#1f4fe0",
105
113
  "chart-2": "#0891b2",
106
114
  "chart-3": "#6646a8",
@@ -219,6 +227,14 @@
219
227
  "editor-lint-refusal": "#9399a4",
220
228
  "editor-tooltip-bg": "#0e1d45",
221
229
  "editor-tooltip-line": "#30467f",
230
+ "diagram-bg": "#050d26",
231
+ "diagram-dot": "#30467f",
232
+ "diagram-line": "#93a1c2",
233
+ "diagram-line-inactive": "#30467f",
234
+ "diagram-line-emphasis": "#8db8ff",
235
+ "diagram-end-bg": "#0e1d45",
236
+ "diagram-end-line": "#93a1c2",
237
+ "diagram-end-ink": "#b9c6e2",
222
238
  "chart-1": "#2b7cf6",
223
239
  "chart-2": "#14d4e0",
224
240
  "chart-3": "#b49df8",
@@ -554,5 +570,19 @@
554
570
  "chart": {
555
571
  "chart-area-alpha": 0.18,
556
572
  "chart-series-alpha": 0.6
573
+ },
574
+ "diagram": {
575
+ "diagram-line-width": "1.5px",
576
+ "diagram-emphasis-width": "2.25px",
577
+ "diagram-inactive-dash": "5 4",
578
+ "diagram-flow-dash": "6 5",
579
+ "diagram-flow-offset": "-22",
580
+ "diagram-flow-period": "900ms",
581
+ "diagram-dim-node": "0.38",
582
+ "diagram-dim-edge": "0.25",
583
+ "diagram-end-size": "14px",
584
+ "diagram-end-line-width": "1.2px",
585
+ "diagram-dot-size": "1px",
586
+ "diagram-grid-gap": "20px"
557
587
  }
558
588
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finstack-com-public/design",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "description": "Design kit: tokens, icons, components and a chart theme, shared by Grizzbi, BI App and the calculation engine.",
5
5
  "license": "MIT",
6
6
  "author": "Finstack",
@@ -125,10 +125,11 @@
125
125
  "@types/node": "24.19.2",
126
126
  "@types/react": "19.3.0",
127
127
  "@types/react-dom": "19.3.0",
128
+ "@xyflow/react": "12.12.1",
128
129
  "echarts": "6.1.0",
129
- "eslint": "10.13.0",
130
+ "eslint": "10.14.0",
130
131
  "eslint-config-prettier": "10.1.8",
131
- "eslint-plugin-import-x": "4.17.1",
132
+ "eslint-plugin-import-x": "4.18.1",
132
133
  "eslint-plugin-react-hooks": "7.1.1",
133
134
  "eslint-plugin-simple-import-sort": "14.0.0",
134
135
  "happy-dom": "21.0.4",
@@ -138,8 +139,8 @@
138
139
  "react": "19.3.1",
139
140
  "react-dom": "19.3.1",
140
141
  "typescript": "6.0.3",
141
- "typescript-eslint": "8.72.1",
142
- "vite": "8.3.5",
143
- "vitest": "5.0.5"
142
+ "typescript-eslint": "8.72.2",
143
+ "vite": "8.3.7",
144
+ "vitest": "5.1.0"
144
145
  }
145
146
  }