@s3pweb/shell-ui 0.1.0 → 0.1.2

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.
@@ -14,7 +14,7 @@
14
14
  * Per-module icon chip colours: set `slug` on NavGroup (shell-ui) or
15
15
  * `basePath` on SidebarNavGroup (shared-layouts). Recognised values:
16
16
  * 'ecodriving' | 'maintenance' | 'incidents' | 'pre-shift' | 'social' |
17
- * 'mileages-fuel'. Other slugs fall back to a neutral grey chip.
17
+ * 'mileages-fuel' | 'settings'. Other slugs fall back to a neutral grey chip.
18
18
  */
19
19
 
20
20
  [data-shell-theme='s3pweb'] {
@@ -125,60 +125,131 @@
125
125
  }
126
126
 
127
127
  /* ============================================================================
128
- Per-module palettes — currently EMPTY.
128
+ Per-module palettes — coloured icon chip per slug.
129
129
 
130
- Every module inherits the neutral chip styling above (`--shell-chip-bg` /
131
- `--shell-chip-fg`) so the sidebar reads as one calm grey palette. Re-introduce
132
- per-slug rules below when a brighter, module-specific palette is wanted.
133
-
134
- Adding a palette for a slug requires THREE selectors (they share the same
135
- declarations, so list them in one rule). Sample for slug='foo':
136
-
137
- [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='foo'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
138
- [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='foo']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon],
139
- [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='foo'] {
140
- background: var(--color-emerald-100);
141
- color: var(--color-emerald-700);
142
- }
143
- .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='foo'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
144
- .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='foo']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon],
145
- .dark [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='foo'] {
146
- background: color-mix(in oklab, var(--color-emerald-700) 28%, transparent);
147
- color: var(--color-emerald-300);
148
- }
149
-
150
- Selector roles:
151
- - 1st = sidebar group icon chip (slug lives on the wrapping `nav-group`).
152
- - 2nd = sidebar flat (top-level) leaf chip; the `:not(…)` excludes
153
- sub-items rendered inside an expanded group so only the top-level
154
- item gets painted.
155
- - 3rd = horizontal top-bar button.
130
+ Each slug needs two selectors for the sidebar (grouped: slug on the wrapping
131
+ `nav-group`; flat leaf: slug on the `nav-item`, `:not(…)` excludes sub-items)
132
+ plus one for the top-bar button. `nav-slug` defaults to the nav `id` with the
133
+ leading `/` stripped (e.g. basePath '/social' -> slug 'social').
134
+ ============================================================================ */
135
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='ecodriving'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
136
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='ecodriving']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
137
+ background: #d6efe2;
138
+ color: #10876a;
139
+ }
140
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='maintenance'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
141
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='maintenance']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
142
+ background: #f5e2b7;
143
+ color: #8a5806;
144
+ }
145
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='incidents'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
146
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='incidents']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
147
+ background: #f7cdd0;
148
+ color: #b5364b;
149
+ }
150
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='pre-shift'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
151
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='social'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
152
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='pre-shift']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon],
153
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='social']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
154
+ background: #ddd1f3;
155
+ color: #6a47bd;
156
+ }
157
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='mileages-fuel'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
158
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='mileages-fuel']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
159
+ background: #c5dbf0;
160
+ color: #2e6fb5;
161
+ }
162
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='settings'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
163
+ [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='settings']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
164
+ background: #dde3ec;
165
+ color: #4b5d76;
166
+ }
156
167
 
157
- Slug source:
158
- `nav-slug` defaults to `id` when omitted on a NavItem / NavGroup. Set it
159
- explicitly only when `id` isn't a CSS-friendly string (e.g. it's a route
160
- path like `/incidents` or a UUID).
168
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='ecodriving'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
169
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='ecodriving']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
170
+ background: rgba(16, 135, 106, 0.22);
171
+ color: #6ed3ad;
172
+ }
173
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='maintenance'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
174
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='maintenance']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
175
+ background: rgba(247, 190, 40, 0.22);
176
+ color: #f7be28;
177
+ }
178
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='incidents'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
179
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='incidents']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
180
+ background: rgba(181, 54, 75, 0.28);
181
+ color: #f7a5af;
182
+ }
183
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='pre-shift'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
184
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='social'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
185
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='pre-shift']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon],
186
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='social']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
187
+ background: rgba(106, 71, 189, 0.32);
188
+ color: #bfa9f0;
189
+ }
190
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='mileages-fuel'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
191
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='mileages-fuel']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
192
+ background: rgba(46, 111, 181, 0.32);
193
+ color: #9bc1e6;
194
+ }
195
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-slug='settings'] [data-shell-ui-nav-group-button] [data-shell-ui-nav-icon],
196
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-nav-item][data-shell-ui-nav-slug='settings']:not([data-shell-ui-nav-children] *) [data-shell-ui-nav-icon] {
197
+ background: rgba(75, 93, 118, 0.32);
198
+ color: #a9b8cc;
199
+ }
161
200
 
162
- Shade-tier guidance (pick ONE per slug, then reuse the pair for dark mode):
163
- - SATURATED families (red, orange, amber, yellow, lime, green, emerald,
164
- teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose):
165
- light: bg=*-100 fg=*-700
166
- dark: bg=color-mix(in oklab, *-700 28%, transparent) fg=*-300
167
- - DESATURATED families (slate, gray, zinc, neutral, stone, olive):
168
- light: bg=*-200 fg=*-500
169
- dark: bg=color-mix(in oklab, *-500 30%, transparent) fg=*-300
170
- (the *-700 of these families reads almost black; *-500 keeps contrast
171
- with the *-200 bg without darkening the icon to mud.)
172
- - One-step DARKER variant (e.g. when two slugs share a hue family and
173
- you want them distinct, like social=violet vs pre-shift=purple-darker):
174
- light: bg=*-300 fg=*-800
175
- dark: bg=color-mix(in oklab, *-800 36%, transparent) fg=*-300
201
+ /* Top-bar per-module coloured chip (baseline neutral styling is above). */
202
+ [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='ecodriving'] {
203
+ background: #d6efe2;
204
+ color: #10876a;
205
+ }
206
+ [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='maintenance'] {
207
+ background: #f5e2b7;
208
+ color: #8a5806;
209
+ }
210
+ [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='incidents'] {
211
+ background: #f7cdd0;
212
+ color: #b5364b;
213
+ }
214
+ [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='pre-shift'],
215
+ [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='social'] {
216
+ background: #ddd1f3;
217
+ color: #6a47bd;
218
+ }
219
+ [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='mileages-fuel'] {
220
+ background: #c5dbf0;
221
+ color: #2e6fb5;
222
+ }
223
+ [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='settings'] {
224
+ background: #dde3ec;
225
+ color: #4b5d76;
226
+ }
176
227
 
177
- Tailwind 4.2.1 ships every family above as `--color-{family}-{shade}` so
178
- `var(--color-emerald-700)` etc. resolves without any extra setup. Skip the
179
- shell-ui preset's @theme block when picking — these are global Tailwind
180
- tokens, not s3pweb-specific.
181
- ============================================================================ */
228
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='ecodriving'] {
229
+ background: rgba(16, 135, 106, 0.22);
230
+ color: #6ed3ad;
231
+ }
232
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='maintenance'] {
233
+ background: rgba(247, 190, 40, 0.22);
234
+ color: #f7be28;
235
+ }
236
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='incidents'] {
237
+ background: rgba(181, 54, 75, 0.28);
238
+ color: #f7a5af;
239
+ }
240
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='pre-shift'],
241
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='social'] {
242
+ background: rgba(106, 71, 189, 0.32);
243
+ color: #bfa9f0;
244
+ }
245
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='mileages-fuel'] {
246
+ background: rgba(46, 111, 181, 0.32);
247
+ color: #9bc1e6;
248
+ }
249
+ .dark [data-shell-theme='s3pweb'] [data-shell-ui-top-bar-button][data-shell-ui-nav-slug='settings'] {
250
+ background: rgba(75, 93, 118, 0.32);
251
+ color: #a9b8cc;
252
+ }
182
253
 
183
254
  /* ============================================================================
184
255
  Sub-item hover — light yellow tint. Mirrors the original SaaS shell rule
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s3pweb/shell-ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Stateless sidebar / top-nav components for the s3pweb white-label shell. Consumer owns router, i18n, and active state.",
5
5
  "license": "ISC",
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  "dependencies": {
28
28
  "class-variance-authority": "0.7.1",
29
29
  "clsx": "2.1.1",
30
- "lucide-react": "0.487.0",
30
+ "lucide-react": "1.17.0",
31
31
  "radix-ui": "1.4.3",
32
32
  "tailwind-merge": "3.5.0",
33
33
  "tw-animate-css": "1.4.0"
@@ -37,18 +37,21 @@
37
37
  "react-dom": "^19.0.0"
38
38
  },
39
39
  "devDependencies": {
40
+ "@babel/core": "7.29.7",
41
+ "@rolldown/plugin-babel": "0.2.3",
40
42
  "@storybook/react-vite": "10.4.1",
41
- "@tailwindcss/vite": "4.2.1",
43
+ "@tailwindcss/vite": "4.3.0",
44
+ "@types/babel__core": "7.20.5",
42
45
  "@types/react": "19.2.14",
43
46
  "@types/react-dom": "19.2.3",
44
- "@vitejs/plugin-react": "5.1.4",
47
+ "@vitejs/plugin-react": "6.0.2",
45
48
  "babel-plugin-react-compiler": "1.0.0",
46
49
  "react": "19.2.4",
47
50
  "react-dom": "19.2.4",
48
51
  "storybook": "10.4.1",
49
52
  "tailwindcss": "4.2.1",
50
53
  "typescript": "5.9.3",
51
- "vite": "7.3.3",
54
+ "vite": "8.0.16",
52
55
  "vite-plugin-dts": "5.0.1"
53
56
  },
54
57
  "publishConfig": {