@invana/styling 0.0.20 → 0.0.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invana/styling",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "Invana TailwindCSS 4 Design System - Reusable styling configuration",
5
5
  "homepage": "https://github.com/invana/design-kit#readme",
6
6
  "type": "module",
@@ -71,6 +71,14 @@
71
71
  "./themes/presets-base.css": {
72
72
  "style": "./src/themes/presets-base.css",
73
73
  "default": "./src/themes/presets-base.css"
74
+ },
75
+ "./themes/data-palette": {
76
+ "style": "./src/themes/data-palette.css",
77
+ "default": "./src/themes/data-palette.css"
78
+ },
79
+ "./themes/data-palette.css": {
80
+ "style": "./src/themes/data-palette.css",
81
+ "default": "./src/themes/data-palette.css"
74
82
  }
75
83
  },
76
84
  "files": [
package/src/index.css CHANGED
@@ -14,18 +14,91 @@
14
14
  --container-padding: 2rem;
15
15
  --container-screens-2xl: 1400px;
16
16
 
17
- /* Font sizes */
18
- --font-size-default: 1rem;
19
- --font-size-xss: 0.6875rem;
20
- --font-size-xs: 0.8125rem;
21
- --font-size-base: 1rem;
22
- --font-size-sm: 1.25rem;
23
- --font-size-lg: 1.5rem;
24
- --font-size-xl: 2rem;
25
- --font-size-2xl: 2.5rem;
26
- --font-size-3xl: 3.75rem;
27
- --font-size-4xl: 4.375rem;
28
- --font-size-5xl: 5.25rem;
17
+ /*
18
+ * The type ladder.
19
+ *
20
+ * TWO content sizes, and a root that is the only dial.
21
+ *
22
+ * base 1rem the size of everything, by default
23
+ * meta 0.923rem the one step under it
24
+ *
25
+ * `html` below is 13px, so that reads 13px / 12px in an application. A
26
+ * marketing page setting a 16px root gets 16px / 14.8px from the same
27
+ * components — which is the point: every step here is a ratio of the root, so
28
+ * the root is what moves, not 49 class names.
29
+ *
30
+ * ── Why `sm` and `xs` are aliases, not rungs ──────────────────────────────
31
+ *
32
+ * A block declaring `--font-size-*` used to live here. Tailwind v4's type
33
+ * namespace is `--text-*`, so none of it generated a utility and `text-xs`,
34
+ * `text-sm` and friends silently resolved to Tailwind's rem defaults against
35
+ * a 13px root: xs 9.75px, sm 11.375px. Nobody chose those. They are what you
36
+ * get when shadcn's ladder — authored for a 16px root, where `text-sm` means
37
+ * "the UI size" — is dropped onto a 13px one.
38
+ *
39
+ * They are re-pointed rather than deleted because 300+ call sites across
40
+ * design-kit, canvas and invana already say `text-sm` meaning "normal UI
41
+ * text" and `text-xs` meaning "a step down". That is exactly `base` and
42
+ * `meta`, so the classes render what their authors meant — but ONLY in a
43
+ * build that has this @theme block in its source graph.
44
+ *
45
+ * That is the catch, and it is not obvious. A consumer importing the
46
+ * PRECOMPILED `@invana/ui/styles.css` gets plain `:root{--text-…}` custom
47
+ * properties, not theme tokens — and Tailwind emits a utility only for a
48
+ * class something uses, so `.text-sm` is not in that file at all now that no
49
+ * kit component writes it. Such a consumer's own Tailwind therefore generates
50
+ * `.text-sm` from ITS default (0.875rem) and lands back on 11.375px.
51
+ *
52
+ * For the aliases to reach a consumer, that consumer must
53
+ * `@import "@invana/styling"` (or `@invana/styling/index.css`) so this block
54
+ * is compiled as part of their build. Studio imports only the prebuilt
55
+ * `@invana/ui/styles.css` today, so it does NOT yet pick these up.
56
+ *
57
+ * New code should not reach for them. Default text declares no size at all
58
+ * and inherits the root; text that is deliberately subordinate — a count, a
59
+ * timing, a row's subtitle — says `text-meta`, which names the job. `sm` and
60
+ * `xs` are here so old code is correct, not so new code has options.
61
+ *
62
+ * `lg`, `xl` and up keep Tailwind's defaults: they are heading steps, nothing
63
+ * complained about them, and moving them would re-baseline every title in the
64
+ * system for no stated reason.
65
+ *
66
+ * When adding any `--text-*` token, register it in the `font-size` class
67
+ * group in `@invana/ui`'s `cn` as well. `text-*` is both the size and the
68
+ * colour scale, so tailwind-merge reads a size it does not recognise as a
69
+ * colour and silently strips the real colour class. (`xs` and `sm` are
70
+ * built-ins and already in that group; `meta` is registered.)
71
+ */
72
+
73
+ /*
74
+ * The meta step — the one size under the base.
75
+ *
76
+ * Stated as a ratio of the root (12/13) rather than the absolute `12px` it
77
+ * used to be. Absolute was the right call while the ladder around it was
78
+ * broken; it is the wrong one now, because a px step cannot follow a root
79
+ * that moves, and following the root is what lets these components render a
80
+ * website as well as an application.
81
+ *
82
+ * `rem`, not `em`: nested subordinate text should not compound down to 11px
83
+ * and then 10px. One step means one step, wherever it sits.
84
+ */
85
+ --text-meta: 0.923rem;
86
+ --text-meta--line-height: 1.5;
87
+
88
+ /*
89
+ * Compatibility aliases — see the ladder note above. Not for new code.
90
+ *
91
+ * The paired `--line-height` matters as much as the size. Tailwind ships one
92
+ * per step (sm 1.4286, xs 1.3333), and re-pointing only the size leaves two
93
+ * classes rendering 12px text in rows of different heights — the same
94
+ * inconsistency one level down. Both aliases take the base ratio, so
95
+ * `text-xs` and `text-meta` are the same line, and `text-sm` and `text-base`
96
+ * are the same line.
97
+ */
98
+ --text-sm: 1rem;
99
+ --text-sm--line-height: 1.5;
100
+ --text-xs: 0.923rem;
101
+ --text-xs--line-height: 1.5;
29
102
 
30
103
  /* Font weights */
31
104
  --font-weight-regular: 400;
@@ -72,6 +145,12 @@
72
145
  --color-card: hsl(0 0% 100%);
73
146
  --color-card-foreground: hsl(210 10% 20%);
74
147
 
148
+ /* The line between two things on a canvas — a graph edge, a dependency
149
+ arrow, a connector. Deliberately NOT --color-border: a border separates
150
+ surfaces and may go invisible against them, while an edge is content and
151
+ has to stay legible on the canvas it is drawn on. */
152
+ --color-edge: hsl(210 6% 78%);
153
+
75
154
  /* ------------------------------------------------------------------------
76
155
  * Border radius — the design language, decided 01-09-2026.
77
156
  *
@@ -163,6 +242,18 @@
163
242
  --glass-blur: none; /* no backdrop blur */
164
243
  }
165
244
 
245
+ /*
246
+ * Dark: the edge lifts, because the surface it is drawn on went dark. One rule
247
+ * for every dark theme, whatever its brand accent — an edge is content, and
248
+ * content does not change colour when the shell does (same reasoning as
249
+ * themes/data-palette.css). The suffix selector also catches a theme added
250
+ * after this was written.
251
+ */
252
+ [data-theme$="-dark"],
253
+ .dark {
254
+ --color-edge: hsl(210 6% 30%);
255
+ }
256
+
166
257
  [data-glass="true"] {
167
258
  --surface-alpha: 0.6;
168
259
  --glass-blur: blur(12px);
@@ -174,6 +265,53 @@
174
265
  -webkit-backdrop-filter: var(--glass-blur, none);
175
266
  }
176
267
 
268
+ /*
269
+ * Corner-bracket hover/focus affordance — drop `corner-hint` on a button,
270
+ * anchor, or list item directly (no wrapper element needed). Brackets float
271
+ * just outside the box and fade in on hover/focus, standing in for a solid
272
+ * highlight background.
273
+ */
274
+ @utility corner-hint {
275
+ position: relative;
276
+
277
+ &::before,
278
+ &::after {
279
+ content: "";
280
+ position: absolute;
281
+ inset: -6px;
282
+ pointer-events: none;
283
+ opacity: 0;
284
+ transform: scale(0.9);
285
+ transition: opacity 150ms ease-out, transform 150ms ease-out;
286
+ background-repeat: no-repeat;
287
+ background-image:
288
+ linear-gradient(hsl(var(--foreground) / 0.7), hsl(var(--foreground) / 0.7)),
289
+ linear-gradient(hsl(var(--foreground) / 0.7), hsl(var(--foreground) / 0.7)),
290
+ linear-gradient(hsl(var(--foreground) / 0.7), hsl(var(--foreground) / 0.7)),
291
+ linear-gradient(hsl(var(--foreground) / 0.7), hsl(var(--foreground) / 0.7));
292
+ }
293
+
294
+ &::before {
295
+ background-size: 10px 2px, 2px 10px, 10px 2px, 2px 10px;
296
+ background-position: top left, top left, top right, top right;
297
+ }
298
+
299
+ &::after {
300
+ background-size: 10px 2px, 2px 10px, 10px 2px, 2px 10px;
301
+ background-position: bottom left, bottom left, bottom right, bottom right;
302
+ }
303
+
304
+ &:hover::before,
305
+ &:hover::after,
306
+ &:focus-visible::before,
307
+ &:focus-visible::after,
308
+ &:focus-within::before,
309
+ &:focus-within::after {
310
+ opacity: 1;
311
+ transform: scale(1);
312
+ }
313
+ }
314
+
177
315
  @keyframes accordion-down {
178
316
  from {
179
317
  height: 0;
@@ -0,0 +1,72 @@
1
+ /*
2
+ * The categorical data palette.
3
+ *
4
+ * Node and edge types, chart series, legends and list dots all read this one
5
+ * scale, so a colour means the same thing wherever it appears — the dot beside
6
+ * `Observation` in a panel is the colour the canvas paints that node
7
+ * (design-kit-coverage.md D2).
8
+ *
9
+ * **Both modes are selected, not flipped.** The dark column is the same eight
10
+ * hues re-stepped for a dark surface. Validated with the dataviz validator
11
+ * against the kit's own card surfaces (`#fffdf7` light, `#1a1a1a` dark): the
12
+ * lightness band, chroma floor, adjacent-pair CVD separation and normal-vision
13
+ * floor all pass in both modes.
14
+ *
15
+ * Light mode carries a contrast WARN on aqua, yellow and magenta (below 3:1 on
16
+ * a near-white card). That is admissible **only** because every use in this
17
+ * system names the thing beside its swatch — a legend row has its type name, a
18
+ * chart series has a legend, a canvas node has its label. Colour is never the
19
+ * only carrier of identity here. Do not use these as a lone status colour, and
20
+ * do not put a value on a chart in series colour: text wears text tokens.
21
+ *
22
+ * Deliberately eight, in a fixed order. Slot 1 is the first series on every
23
+ * chart, not "whichever came back first from the query" — colour follows the
24
+ * entity, never its rank.
25
+ */
26
+
27
+ @theme {
28
+ /* Light — the default, matching the base tokens in index.css. */
29
+ --color-data-1: #2a78d6; /* blue */
30
+ --color-data-2: #eb6834; /* orange */
31
+ --color-data-3: #1baf7a; /* aqua */
32
+ --color-data-4: #eda100; /* yellow */
33
+ --color-data-5: #e87ba4; /* magenta */
34
+ --color-data-6: #008300; /* green */
35
+ --color-data-7: #4a3aa7; /* violet */
36
+ --color-data-8: #e34948; /* red */
37
+ }
38
+
39
+ /*
40
+ * Dark — every dark theme, whatever its brand accent. The data palette is not a
41
+ * brand palette: a chart series does not change hue because the shell went from
42
+ * Gold to Ocean, or the same data would look like different data.
43
+ */
44
+ [data-theme="default-dark"],
45
+ [data-theme="tailwind-dark"],
46
+ [data-theme="vite-dark"],
47
+ [data-theme="gold-dark"],
48
+ [data-theme="ocean-dark"],
49
+ [data-theme="forest-dark"],
50
+ [data-theme="rose-dark"],
51
+ [data-theme="minimal-dark"],
52
+ /* The generic hook every dark theme also stamps — this is what catches a theme
53
+ added after this file was written. The explicit ids above stay so the palette
54
+ works even where the class is not applied. */
55
+ .dark,
56
+ .theme-default-dark,
57
+ .theme-tailwind-dark,
58
+ .theme-vite-dark,
59
+ .theme-gold-dark,
60
+ .theme-ocean-dark,
61
+ .theme-forest-dark,
62
+ .theme-rose-dark,
63
+ .theme-minimal-dark {
64
+ --color-data-1: #3987e5;
65
+ --color-data-2: #d95926;
66
+ --color-data-3: #199e70;
67
+ --color-data-4: #c98500;
68
+ --color-data-5: #d55181;
69
+ --color-data-6: #008300;
70
+ --color-data-7: #9085e9;
71
+ --color-data-8: #e66767;
72
+ }