@evinvest/uikit 0.8.0 → 0.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evinvest/uikit",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Dep-light React UI kit: shadcn-semantics components with zero @radix-ui / cva, mirroring the ev_lib::uikit Rust feature. Ships the shared design tokens.",
5
5
  "license": "BlueOak-1.0.0",
6
6
  "publishConfig": {
@@ -35,7 +35,8 @@
35
35
  "build": "tsup",
36
36
  "test": "vitest run",
37
37
  "typecheck": "tsc --noEmit",
38
- "prepare": "tsup"
38
+ "prepare": "mkdir -p styles && cp ../../tokens.css styles/tokens.css && tsup",
39
+ "prepublishOnly": "node scripts/verify-pack.mjs"
39
40
  },
40
41
  "peerDependencies": {
41
42
  "react": "^18 || ^19",
package/styles/tokens.css CHANGED
@@ -1,8 +1,8 @@
1
1
  /*
2
2
  * Shared design tokens — the theme contract for the `ev_lib::uikit` (Rust) and
3
3
  * `@evinvest/uikit` (TypeScript) components. Import this file from any Tailwind v4
4
- * entrypoint. Kept byte-for-byte in parity with `@evinvest/uikit`'s
5
- * `styles/tokens.css`; change one, change the other.
4
+ * entrypoint. Single source for both ports — `@evinvest/uikit` copies this file
5
+ * into `styles/tokens.css` from its `prepare` script.
6
6
  *
7
7
  * Structure:
8
8
  * @theme inline {} — wires values into Tailwind utilities (processed by
@@ -10,6 +10,12 @@
10
10
  * :root {} — raw CSS custom properties; work everywhere
11
11
  * @keyframes / rules — toast (sonner) enter/exit motion at the tail; shipped
12
12
  * here so the lifecycle is self-contained (see below)
13
+ *
14
+ * Surface ladder — dark UI reads as unfinished when every plane is the same
15
+ * value, so the steps below are deliberate and measured; keep them apart if you
16
+ * retune. background #070d18 → surface #0d1526 (1.07:1) → card #16233c (1.24:1
17
+ * vs background) → popover #1d2c49 (1.13:1 vs card) → muted #26375c. Elevation
18
+ * rides the same ladder via --shadow-card / -elevated / -overlay.
13
19
  */
14
20
 
15
21
  @theme inline {
@@ -17,6 +23,16 @@
17
23
  --radius-md: calc(var(--radius) - 2px);
18
24
  --radius-lg: var(--radius);
19
25
  --radius-xl: calc(var(--radius) + 4px);
26
+ --radius-2xl: calc(var(--radius) + 8px);
27
+
28
+ /* Depth has to be a ladder, not a single drop shadow: on a dark theme the
29
+ * value steps alone are too close to separate a resting card from a menu
30
+ * from a modal, so each tier gets its own spread + opacity. */
31
+ --shadow-card: 0 1px 2px 0 rgb(0 0 0 / 0.30);
32
+ --shadow-elevated:
33
+ 0 4px 12px -2px rgb(0 0 0 / 0.40),
34
+ 0 2px 4px -2px rgb(0 0 0 / 0.30);
35
+ --shadow-overlay: 0 16px 48px -12px rgb(0 0 0 / 0.60);
20
36
 
21
37
  /* The leading var() carries its own fallback: next/font (landing) sets
22
38
  * `--font-inter` / `--font-playfair`; a Rust consumer renders `uikit::Fonts`,
@@ -68,46 +84,70 @@
68
84
  */
69
85
  --color-main-brand: #001e4e;
70
86
  --color-main-black: #070d18;
71
- --color-main-surface: #081020;
72
- --color-main-card: #0c1626;
87
+ /* these two are what consumers reach for (`bg-main-surface`, `bg-main-card`),
88
+ * and they REFERENCE the semantic tokens rather than repeating them. Literal
89
+ * copies drift the moment only one side is retuned, and that is not
90
+ * hypothetical: a client that overrode `--card` alone got its `bg-card`
91
+ * surfaces on the new palette and its `bg-main-card` ones — profile,
92
+ * settings, wallet — left on the old, so half the app changed colour. */
93
+ --color-main-surface: var(--secondary);
94
+ --color-main-card: var(--card);
73
95
  --color-main-mist: #e6e1d3;
74
96
  --color-main-accent-t1: #2a9d8f;
75
97
  --color-main-accent-t2: #2e9e5b;
76
98
  --color-main-accent-t3: #f2c94c;
77
99
  --color-main-accent-t4: #e58aae;
100
+
101
+ /*
102
+ * Tracing levels — the one place a severity gets a hue. Read outside CSS too
103
+ * (gitops mirrors these into Discord embed bars), so: plain hex, no color-mix.
104
+ */
105
+ --color-level-trace: #6b7fa0;
106
+ --color-level-debug: #2a9d8f;
107
+ --color-level-info: #4a90d9;
108
+ --color-level-warn: #f2c94c;
109
+ --color-level-error: #da251d;
78
110
  }
79
111
 
80
112
  :root {
81
113
  /* ── shadcn semantic tokens ──────────────────────────────────── */
82
114
  --background: #070d18;
83
115
  --foreground: white;
84
- --card: #0c1626;
116
+ --card: #16233c;
85
117
  --card-foreground: white;
86
- --popover: #0c1626;
118
+ --popover: #1d2c49;
87
119
  --popover-foreground: white;
88
- --primary: #001e4e;
89
- --primary-foreground: #e6e1d3;
90
- --secondary: #081020;
120
+ /* teal, not the brand navy: navy filled a Button/Switch at ~1.1:1 against
121
+ * these surfaces, i.e. an invisible control, and consumers hardcoded teal to
122
+ * get around it. The brand navy still lives in --color-main-brand. */
123
+ --primary: #2a9d8f;
124
+ --primary-foreground: #070d18;
125
+ --secondary: #0d1526;
91
126
  --secondary-foreground: white;
92
- --muted: #16213a;
93
- --muted-foreground: color-mix(in srgb, #e6e1d3 40%, transparent);
127
+ --muted: #26375c;
128
+ /* the most-used secondary text token, so it has to clear AA on its own */
129
+ --muted-foreground: color-mix(in srgb, #e6e1d3 65%, transparent);
94
130
  --accent: color-mix(in srgb, #e6e1d3 8%, transparent);
95
131
  --accent-foreground: white;
96
- --destructive: #da251d;
97
- --destructive-foreground: #e6e1d3;
98
- --border: color-mix(in srgb, #e6e1d3 10%, transparent);
132
+ /* lifted off the brand red: this is the loss/negative signal in a financial
133
+ * product, and the brand value failed AA on a card */
134
+ --destructive: #ef5b52;
135
+ --destructive-foreground: #070d18;
136
+ --border: color-mix(in srgb, #e6e1d3 14%, transparent);
99
137
  --input: color-mix(in srgb, #e6e1d3 20%, transparent);
100
138
  --ring: #2a9d8f;
101
139
  --radius: 0.375rem; /* 6px on mobile; bumped to 8px ≥ sm (see @media below) */
102
140
 
103
141
  /* ── sidebar (PC nav) ───────────────────────────────────────── */
104
- --sidebar: #0c1626;
142
+ /* the rail sits one step under the cards it frames, so it tracks --secondary
143
+ on the ladder rather than --card */
144
+ --sidebar: #0d1526;
105
145
  --sidebar-foreground: white;
106
- --sidebar-primary: #001e4e;
107
- --sidebar-primary-foreground: #e6e1d3;
146
+ --sidebar-primary: #2a9d8f;
147
+ --sidebar-primary-foreground: #070d18;
108
148
  --sidebar-accent: color-mix(in srgb, #e6e1d3 8%, transparent);
109
149
  --sidebar-accent-foreground: white;
110
- --sidebar-border: color-mix(in srgb, #e6e1d3 10%, transparent);
150
+ --sidebar-border: color-mix(in srgb, #e6e1d3 14%, transparent);
111
151
  --sidebar-ring: #2a9d8f;
112
152
  --sidebar-width: 14rem;
113
153