@hattisar/design-tokens 0.3.23 → 0.3.24

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 (2) hide show
  1. package/package.json +1 -1
  2. package/tokens.css +96 -59
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hattisar/design-tokens",
3
- "version": "0.3.23",
3
+ "version": "0.3.24",
4
4
  "description": "Shared design tokens (colors, type, radius, spacing, motion) and base primitives (reset, buttons, inputs, cards, modals, auth shell) for every Hattisar frontend.",
5
5
  "main": "tokens.css",
6
6
  "files": [
package/tokens.css CHANGED
@@ -66,7 +66,10 @@
66
66
  --color-border-raised: #d4d4d8;
67
67
  --shadow-popover: 0 4px 6px -2px rgba(9, 9, 11, 0.08), 0 12px 28px -8px rgba(9, 9, 11, 0.18);
68
68
 
69
- --color-hover: var(--color-surface-tint);
69
+ /* The one hover fill for every surface: a faint veil of the ink over
70
+ whatever it sits on, so it never reads as a second grey competing
71
+ with a header band or a card (those use --color-surface-tint). */
72
+ --color-hover: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
70
73
  --color-focus-ring: rgba(233, 235, 239, 0.2);
71
74
  --color-focus-ring-danger: rgba(255, 138, 156, 0.24);
72
75
  /* The ring drawn around a focused control. Ink at low alpha rather
@@ -128,7 +131,7 @@
128
131
  --color-surface-tint/--color-border-strong/--color-text-primary
129
132
  rather than their own literal hex, so the secondary button always
130
133
  tracks the same neutral scale as the rest of the page. */
131
- --color-secondary-fill: var(--color-surface-tint);
134
+ --color-secondary-fill: var(--color-background-card);
132
135
  --color-secondary-border: var(--color-border-strong);
133
136
  --color-secondary-text: var(--color-text-primary);
134
137
  --color-secondary-hover: color-mix(in srgb, var(--color-text-primary) 6%, var(--color-secondary-fill));
@@ -260,6 +263,34 @@
260
263
  and the gray column-header band right below ("search area look very
261
264
  tight"). One token so the tiles and the toolbar can't drift apart. */
262
265
  --toolbar-row-height: 48px;
266
+ /* The pinned page header on a list page (title + actions), and what the
267
+ table's column headers stick beneath. */
268
+ --page-heading-height: 52px;
269
+
270
+ /* Buttons, after Shopify's admin: a fully rounded pill, 28px tall,
271
+ medium-weight small type. One set of numbers for every button the
272
+ app draws (primary, secondary, destructive, the save bar). */
273
+ --button-height: 28px;
274
+ --button-radius: var(--radius-full);
275
+ --button-padding-x: var(--space-3);
276
+ --button-font-size: var(--text-sm);
277
+ --button-font-weight: var(--font-weight-medium);
278
+
279
+ /* The big rounded containers on a list page, after Shopify's Orders
280
+ page: the KPI strip, the search bar and the table card all share it. */
281
+ --list-card-radius: var(--radius-xl);
282
+ /* A table row under the cursor: a faint veil of the ink, deliberately
283
+ lighter than the header band (--color-surface-tint) so the two never
284
+ read as the same grey. */
285
+ --table-row-hover-bg: color-mix(in srgb, var(--color-text-primary) 4%, transparent);
286
+ /* The secondary button's surface, named once so every control that is a
287
+ secondary button in all but markup (More Actions, the dashboard
288
+ filters, the close x) reads the same two tokens as .btn-secondary
289
+ instead of keeping a private copy of the look. A white pill needs a
290
+ hairline of its own to read against the page. Primary is simply the
291
+ bare `button` rule (--color-cta). */
292
+ --button-secondary-bg: var(--color-secondary-fill);
293
+ --button-secondary-shadow: var(--shadow-btn-secondary), 0 0 0 1px var(--color-border);
263
294
 
264
295
  /* The picture picker (ImagePicker.tsx) behind an item image, the org
265
296
  logo and both user photos. Named so those four can't drift apart. */
@@ -411,33 +442,46 @@
411
442
  /* 58px, not 52 — asked for directly, matched against a reference
412
443
  layout's own header height so this app's chrome proportions read
413
444
  the same. */
414
- --header-height: 58px;
445
+ --header-height: 8px;
446
+ /* Height of a title bar inside a panel or drawer (notifications,
447
+ support). Was --header-height before the top bar left the desktop
448
+ shell and that token shrank to the frame's own 4px + 4px margins. */
449
+ --panel-header-height: 58px;
415
450
 
416
451
  /* Exact Hattisar Design match — aside/header sit at the same white
417
452
  --hd-card-bg as every card (bordered, not tonally separate),
418
453
  mirrored by dark theme's own literal Hattisar Design values below. */
419
- --sidebar-bg: var(--color-background-card);
420
- --sidebar-text: var(--color-text-primary);
421
- --sidebar-text-muted: var(--color-text-muted);
422
- --sidebar-active-text: var(--color-text-primary);
423
- --sidebar-hover-bg: var(--color-surface-tint);
424
- /* Accent ink for the row you are on: icon, label and a 3px left bar
425
- all take this, and nothing takes it as a fill. --color-cta-on-
426
- surface rather than --color-cta itself because this sits on a
427
- white rail: measured, 3973d4 lands at 4.59:1 against it and
428
- 4285f4 at 3.56:1, so the unmodified CTA blue would miss AA for
429
- normal text on the one rail it appears on most.
430
-
431
- Was var(--sidebar-active-text), i.e. --color-text-primary, which
432
- made it the same near-black as every other row's hover state and
433
- so no accent at all. The active row had a pill fill to lean on
434
- instead, except that in light theme the fill token and
435
- --sidebar-hover-bg were both --color-surface-tint — so the page
436
- you were on and whatever row the cursor happened to be over were
437
- pixel-identical. That fill token is gone; both secondary rails
438
- already read this one, so all three navs now share one accent. */
439
- --sidebar-active-ink: var(--color-cta-on-surface);
440
- --sidebar-rail-bg: var(--color-background-card);
454
+ /* The sidebar is dark chrome in every theme, built only from the
455
+ palette above: its fill is the theme's own near-black and its ink the
456
+ theme's own near-white, and every other shade is a mix of those two
457
+ (so a theme change re-tints all of them from one pair of tokens). */
458
+ --sidebar-bg: var(--color-text-primary);
459
+ --sidebar-active-text: var(--color-background-card);
460
+ --sidebar-text: color-mix(in srgb, var(--sidebar-active-text) 88%, var(--sidebar-bg));
461
+ --sidebar-text-muted: color-mix(in srgb, var(--sidebar-active-text) 70%, var(--sidebar-bg));
462
+ /* Hover (and the current row's fill), the dividers, and the search /
463
+ input fill: a veil of the ink over the chrome. */
464
+ --sidebar-hover-bg: color-mix(in srgb, var(--sidebar-active-text) 10%, transparent);
465
+ --sidebar-border: color-mix(in srgb, var(--sidebar-active-text) 14%, transparent);
466
+ --sidebar-input-bg: var(--sidebar-hover-bg);
467
+ /* The row you are on: the full ink on the same fill hover uses, the
468
+ weight doing the rest. */
469
+ --sidebar-active-ink: var(--sidebar-active-text);
470
+ --sidebar-rail-bg: var(--sidebar-bg);
471
+ /* The one background every popout shares (account menu, notifications,
472
+ support, the collapsed rail's hover menu, the search popup): the
473
+ sidebar colour one step lighter, so a popout reads as lifted off
474
+ the dark chrome rather than merging into it. */
475
+ --popout-bg: color-mix(in srgb, var(--sidebar-active-text) 12%, var(--sidebar-bg));
476
+
477
+ /* Sidebar and popout dimensions, named once. */
478
+ --sidebar-icon-size: 20px;
479
+ --sidebar-control-height: 36px;
480
+ --sidebar-badge-size: 22px;
481
+ --sidebar-avatar-size: 28px;
482
+ --popout-min-width: 180px;
483
+ --search-popup-width: 640px;
484
+ --mobile-nav-width: 350px;
441
485
 
442
486
  /* Every left-hand nav rail in an app sharing this one width instead
443
487
  of each picking its own. 260px, not 240 — asked for directly,
@@ -445,7 +489,7 @@
445
489
  layout's own sidebar width, the same reason --header-height above
446
490
  moved too. */
447
491
  --sidebar-width: 260px;
448
- --sidebar-width-collapsed: 64px;
492
+ --sidebar-width-collapsed: 56px;
449
493
  --sidebar-height: calc(100vh - var(--header-height));
450
494
 
451
495
  /* Two widths, because a page is one of two things.
@@ -526,7 +570,7 @@
526
570
  --color-surface-raised: #1f1f23;
527
571
  --color-border-raised: #3f3f46;
528
572
  --shadow-popover: 0 4px 6px -2px rgba(0, 0, 0, 0.5), 0 16px 40px -10px rgba(0, 0, 0, 0.75);
529
- --color-hover: var(--color-surface-tint);
573
+ --color-hover: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
530
574
 
531
575
  /* Brighter counterparts of :root's accent set — a dark badge fill
532
576
  needs a light/saturated text color for contrast, the mirror image
@@ -624,16 +668,11 @@
624
668
  surface as a card, which is where shadcn puts a sidebar too.
625
669
  The frame still reads as structurally separate from content, which
626
670
  was the point of the original choice. */
627
- --sidebar-bg: #18181b;
628
- --sidebar-text: var(--color-text-primary);
629
- --sidebar-text-muted: var(--color-text-muted);
671
+ /* Dark theme: a fill one step below the page canvas (so the page frame
672
+ still reads against it) and the theme's own ink; every other sidebar
673
+ shade is the :root mix of the two. */
674
+ --sidebar-bg: color-mix(in srgb, var(--color-background-global) 40%, black);
630
675
  --sidebar-active-text: var(--color-text-primary);
631
- --sidebar-hover-bg: rgba(255, 255, 255, 0.06);
632
- /* --color-cta is brand ink now (see :root's own --color-cta) — this
633
- "current row" marker used to lean on the accent blue clearing AA
634
- on #18181b without the on-surface variant's extra darkening. */
635
- --sidebar-active-ink: var(--color-cta);
636
- --sidebar-rail-bg: #18181b;
637
676
 
638
677
  color-scheme: dark;
639
678
  }
@@ -656,7 +695,7 @@
656
695
  --color-surface-raised: #ffffff;
657
696
  --color-border-raised: #d4d4d8;
658
697
  --shadow-popover: 0 4px 6px -2px rgba(9, 9, 11, 0.08), 0 12px 28px -8px rgba(9, 9, 11, 0.18);
659
- --color-hover: var(--color-surface-tint);
698
+ --color-hover: color-mix(in srgb, var(--color-text-primary) 6%, transparent);
660
699
 
661
700
  --color-brand: var(--color-text-primary);
662
701
  --color-brand-hover: color-mix(in srgb, var(--color-brand) 85%, black);
@@ -673,7 +712,7 @@
673
712
  --shadow-btn-primary: 0 1px 2px rgba(0, 0, 0, 0.4);
674
713
  --shadow-btn-secondary: 0 1px 2px rgba(0, 0, 0, 0.3);
675
714
 
676
- --color-secondary-fill: var(--color-surface-tint);
715
+ --color-secondary-fill: var(--color-background-card);
677
716
  --color-secondary-border: var(--color-border-strong);
678
717
  --color-secondary-text: var(--color-text-primary);
679
718
  --color-secondary-hover: color-mix(in srgb, var(--color-text-primary) 6%, var(--color-secondary-fill));
@@ -728,13 +767,8 @@
728
767
  --shadow-md: none;
729
768
  --shadow-lg: none;
730
769
 
731
- --sidebar-bg: var(--color-background-card);
732
- --sidebar-text: #09090b;
733
- --sidebar-text-muted: var(--color-text-muted);
734
- --sidebar-active-text: var(--color-text-primary);
735
- --sidebar-hover-bg: var(--color-surface-tint);
736
- --sidebar-active-ink: var(--color-cta-on-surface);
737
- --sidebar-rail-bg: var(--color-background-card);
770
+ --sidebar-bg: var(--color-text-primary);
771
+ --sidebar-active-text: var(--color-background-card);
738
772
 
739
773
  color-scheme: light;
740
774
  }
@@ -880,10 +914,11 @@ button {
880
914
  font: inherit;
881
915
  cursor: pointer;
882
916
  border: none;
883
- border-radius: var(--radius-xs);
884
- padding: 4px 10px;
885
- font-size: var(--text-base);
886
- font-weight: 400;
917
+ border-radius: var(--button-radius);
918
+ min-height: var(--button-height);
919
+ padding: var(--space-1) var(--button-padding-x);
920
+ font-size: var(--button-font-size);
921
+ font-weight: var(--button-font-weight);
887
922
  background: var(--color-cta);
888
923
  color: var(--color-cta-text);
889
924
  box-shadow: var(--shadow-btn-primary);
@@ -942,13 +977,14 @@ button:focus-visible {
942
977
  font: inherit;
943
978
  cursor: pointer;
944
979
  border: none;
945
- border-radius: var(--radius-xs);
946
- padding: 4px 10px;
947
- font-size: var(--text-base);
948
- font-weight: 400;
949
- background: var(--color-secondary-fill);
980
+ border-radius: var(--button-radius);
981
+ min-height: var(--button-height);
982
+ padding: var(--space-1) var(--button-padding-x);
983
+ font-size: var(--button-font-size);
984
+ font-weight: var(--button-font-weight);
985
+ background: var(--button-secondary-bg);
950
986
  color: var(--color-secondary-text);
951
- box-shadow: var(--shadow-btn-secondary);
987
+ box-shadow: var(--button-secondary-shadow);
952
988
  text-decoration: none;
953
989
  }
954
990
 
@@ -978,10 +1014,11 @@ button:focus-visible {
978
1014
  font: inherit;
979
1015
  cursor: pointer;
980
1016
  border: none;
981
- border-radius: var(--radius-xs);
982
- padding: 4px 10px;
983
- font-size: var(--text-base);
984
- font-weight: 400;
1017
+ border-radius: var(--button-radius);
1018
+ min-height: var(--button-height);
1019
+ padding: var(--space-1) var(--button-padding-x);
1020
+ font-size: var(--button-font-size);
1021
+ font-weight: var(--button-font-weight);
985
1022
  background: var(--color-destructive-fill);
986
1023
  /* Bare button{} above defaults every <button> to box-shadow:
987
1024
  var(--shadow-btn-primary), a layered bevel built around