@lyeve-labs/ui-kit 0.45.0 → 0.46.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.
@@ -91,6 +91,124 @@
91
91
  --radius-lg: 12px;
92
92
  --radius-xl: 16px;
93
93
  --radius-2xl: 24px;
94
+ /* A role rather than a rung: the card, the table frame, the stat, the empty
95
+ * state and the dialog share it, so the surfaces that sit side by side on a
96
+ * page agree. One step past xl. The 2xl rung read as a toy at console
97
+ * density, where a card holds a 14px table rather than a hero. */
98
+ --radius-card: 20px;
99
+
100
+ /* -- Depth: what lifts a surface off the page ------------------- *
101
+ * Three colors and a short ladder of shadows built from them. The
102
+ * geometry is shared and the colors invert with the theme, so the
103
+ * light palette gets the same layering without a second ladder:
104
+ * in dark a surface is lit from above by a faint white line along
105
+ * its top edge, and in light the white line disappears into the
106
+ * white card and the hairline under it does the separating.
107
+ *
108
+ * highlight the 1px line along a raised surface's top edge
109
+ * shade every drop shadow, and the inner shadow of a well
110
+ * glow the cyan halo around focus and the primary action
111
+ *
112
+ * Each is a shadow or a background image and never a border, so no
113
+ * surface changes size when it gains or loses one, and a forced
114
+ * colors scheme drops all of them without losing a boundary: every
115
+ * surface keeps its 1px border. */
116
+ --color-highlight: rgb(255 255 255 / 0.12);
117
+ --color-shade: rgb(2 6 14 / 0.5);
118
+ --color-glow: rgb(0 212 255 / 0.16);
119
+ /* The pool of light under the primary button, its own fill color. A token
120
+ * of its own so paper and a forced colors scheme can switch it off without
121
+ * touching the brand, which print turns black. */
122
+ --color-halo: var(--color-brand);
123
+ /* The place you are: a table's head row, a hovered row and the current nav
124
+ * row. Brand mixed into the surface rather than laid over it, so it is one
125
+ * opaque color the contrast suite can measure. Five percent, because a
126
+ * violet badge in a hovered row lays its own tint over this one, and at
127
+ * eight its label fell to 4.35:1. */
128
+ --color-tint: color-mix(in srgb, var(--color-brand) 5%, var(--color-surface));
129
+
130
+ /* The ramp, from a control to a dialog. Each rung casts further than the
131
+ * one below it, so a menu reads above the card it opened from and a dialog
132
+ * above both. A raised control sits closest. */
133
+ --shadow-raised: 0 1px 2px 0 var(--color-shade);
134
+ --shadow-card: 0 1px 2px 0 var(--color-shade), 0 8px 24px -12px var(--color-shade);
135
+ --shadow-popover: 0 4px 8px -2px var(--color-shade), 0 16px 32px -8px var(--color-shade);
136
+ --shadow-overlay: 0 12px 24px -6px var(--color-shade), 0 32px 64px -16px var(--color-shade);
137
+ /* A tight ring that fills the 2px gap between a control and its focus
138
+ * outline, and a soft halo past it. On a field it sits outside the border. */
139
+ --shadow-glow: 0 0 0 4px var(--color-glow), 0 0 20px 2px var(--color-glow);
140
+ /* The primary button glows at rest, a pool of its own color under it, and
141
+ * the pool grows under the pointer. Brand at a share small enough that the
142
+ * fill still clears 3:1 against the brightest part of its own halo. */
143
+ --shadow-primary:
144
+ 0 1px 2px 0 var(--color-shade), 0 6px 18px -6px color-mix(in srgb, var(--color-halo) 30%, transparent);
145
+ --shadow-primary-hover:
146
+ 0 1px 2px 0 var(--color-shade), 0 0 0 3px var(--color-glow),
147
+ 0 10px 28px -6px color-mix(in srgb, var(--color-halo) 40%, transparent);
148
+ /* A few pixels of light around a mark, such as the current nav row's bar. */
149
+ --shadow-mark: 0 0 8px 1px var(--color-glow);
150
+
151
+ /* Inner shadows compose with the drop shadows above, because Tailwind keeps
152
+ * them in a variable of their own: a card is shadow-card and
153
+ * inset-shadow-highlight together. highlight is a 1px line with no blur,
154
+ * so it lights the top edge and never sits under a line of text. bevel is
155
+ * the brighter edge a filled
156
+ * button carries on its own color, so it does not change with the theme.
157
+ * well sinks a field into the surface it sits on, at half the shade, so the
158
+ * field's border still clears 3:1 against the darkest band inside it. */
159
+ --inset-shadow-highlight: inset 0 1px 0 0 var(--color-highlight);
160
+ --inset-shadow-bevel: inset 0 1px 0 0 rgb(255 255 255 / 0.22);
161
+ --inset-shadow-well: inset 0 1px 2px 0 color-mix(in srgb, var(--color-shade) 50%, transparent);
162
+
163
+ /* Two gradients and no more. hero is the wash behind a hero or an empty
164
+ * state: a tenth of violet mixed into the page's own ink, lit from the top
165
+ * center and falling off to plain ink, so text on it is measured against
166
+ * both ends. accent is cyan into violet for a mark a few
167
+ * pixels wide: the active tab and nav indicator and a progress fill. It never
168
+ * sits behind text. accent-y is the same mark standing upright. */
169
+ --background-image-hero: radial-gradient(
170
+ ellipse 90% 80% at 50% 0%,
171
+ color-mix(in srgb, var(--color-violet) 10%, var(--color-ink)) 0%,
172
+ var(--color-ink) 100%
173
+ );
174
+ --background-image-accent: linear-gradient(90deg, var(--color-brand), var(--color-violet));
175
+ --background-image-accent-y: linear-gradient(180deg, var(--color-brand), var(--color-violet));
176
+
177
+ /* The surfaces' own light, each redeclared for the light palette.
178
+ *
179
+ * canvas cyan and violet pooled at the top of the app shell's content,
180
+ * gone within 400px, behind the page header
181
+ * sidebar the surface at the top, a step toward ink at the foot
182
+ * card a few percent of light at a card's top, fading to nothing,
183
+ * laid over the card's own background color so a caller's
184
+ * bg-* still shows through it
185
+ * lift white falling off down a filled button, over its own color, so
186
+ * the hover and held colors still show through it
187
+ * rule-y a vertical rule that fades in and out at its ends
188
+ * rule-end a horizontal rule that fades out toward its end edge
189
+ *
190
+ * Every one of them has text on it or beside it, so the contrast suite
191
+ * measures each text token at each end. The canvas pools are as strong as
192
+ * they can be while brand-deep and faint still clear 4.5:1 where the two
193
+ * overlap. */
194
+ --background-image-canvas:
195
+ radial-gradient(70% 400px at 15% 0, color-mix(in srgb, var(--color-brand) 6%, transparent), transparent),
196
+ radial-gradient(60% 400px at 85% 0, color-mix(in srgb, var(--color-violet) 7%, transparent), transparent);
197
+ --background-image-sidebar: linear-gradient(
198
+ 180deg,
199
+ var(--color-surface),
200
+ color-mix(in srgb, var(--color-ink) 60%, var(--color-surface))
201
+ );
202
+ --background-image-card: linear-gradient(180deg, rgb(255 255 255 / 0.04), transparent);
203
+ --background-image-lift: linear-gradient(180deg, rgb(255 255 255 / 0.18), transparent 70%);
204
+ --background-image-rule-y: linear-gradient(
205
+ 180deg,
206
+ transparent,
207
+ var(--color-line) 15%,
208
+ var(--color-line) 85%,
209
+ transparent
210
+ );
211
+ --background-image-rule-end: linear-gradient(90deg, var(--color-line) 50%, transparent);
94
212
 
95
213
  /* -- Elevation: the stacking order of everything that floats --- *
96
214
  * Every floating surface in the kit carried a bare z-50, so which
@@ -217,6 +335,10 @@
217
335
  --leading-body: 1.55;
218
336
  --leading-caption: 1.5;
219
337
  --leading-mono: 1.5;
338
+ /* The console's page title: 32px on a 38px line. H2's 1.15 is drawn for a
339
+ * marketing headline set in a column, and at 32px over a 14px page it sat
340
+ * the description too close under the title. */
341
+ --leading-title: 1.1875;
220
342
 
221
343
  --tracking-display: -0.04em;
222
344
  --tracking-h1: -0.025em;
@@ -424,6 +546,28 @@ html[data-theme='light'] {
424
546
  --color-success: #126c34;
425
547
  --color-warn: #904207;
426
548
  --color-danger: #ab1a1a;
549
+
550
+ /* Depth translated rather than copied. A white top line is invisible on a
551
+ * white card, so the highlight only brightens surface-2, and the shade is a
552
+ * cool gray at a sixth of the dark one's weight: in light a shadow
553
+ * separates, it does not darken. The glow is the mark's #0099c4 face, since
554
+ * the deep brand reads as a gray halo on white. */
555
+ --color-highlight: rgb(255 255 255 / 0.8);
556
+ --color-shade: rgb(16 24 40 / 0.08);
557
+ --color-glow: rgb(0 153 196 / 0.22);
558
+
559
+ /* A cool tint at the top of the page rather than a glow: on white, light
560
+ * cannot be added, so the wash darkens a little toward the brand. The card's
561
+ * layer darkens toward the page's ink at the foot, the same lit top,
562
+ * reached from the other side. */
563
+ --background-image-canvas:
564
+ radial-gradient(70% 400px at 15% 0, color-mix(in srgb, var(--color-brand) 6%, transparent), transparent),
565
+ radial-gradient(60% 400px at 85% 0, color-mix(in srgb, var(--color-violet) 5%, transparent), transparent);
566
+ --background-image-card: linear-gradient(
567
+ 180deg,
568
+ transparent,
569
+ color-mix(in srgb, var(--color-ink) 70%, transparent)
570
+ );
427
571
  }
428
572
 
429
573
  /*
@@ -437,6 +581,38 @@ html[data-theme='light'] {
437
581
  --color-mark-ink: CanvasText;
438
582
  --color-mark-foot: GrayText;
439
583
  --color-mark-step: GrayText;
584
+ /* The browser drops box shadows and gradients here already. Naming it
585
+ * keeps a browser that does not from painting the cyan halo or a wash
586
+ * that no longer matches the forced canvas. */
587
+ --color-glow: transparent;
588
+ --color-halo: transparent;
589
+ --background-image-hero: none;
590
+ --background-image-accent: none;
591
+ --background-image-accent-y: none;
592
+ --background-image-canvas: none;
593
+ --background-image-sidebar: none;
594
+ --background-image-card: none;
595
+ --background-image-lift: none;
596
+ --background-image-rule-y: none;
597
+ --background-image-rule-end: none;
598
+ }
599
+
600
+ /*
601
+ * A field, a menu row and a nav row show focus with a ring, and a ring is a
602
+ * box shadow, which a forced colors scheme removes. The reader was left with
603
+ * no focus indicator on exactly the controls typed into. An outline in the
604
+ * system highlight takes its place. Unlayered, so it wins over the
605
+ * outline-none those controls carry. A control that draws its ring inset
606
+ * does so because a scrolling box would clip anything outside it, so its
607
+ * outline sits inside too.
608
+ */
609
+ :focus-visible {
610
+ outline: 2px solid Highlight;
611
+ outline-offset: 2px;
612
+ }
613
+
614
+ [class*='focus-visible:ring-inset']:focus-visible {
615
+ outline-offset: -2px;
440
616
  }
441
617
  }
442
618
 
@@ -512,6 +688,18 @@ html[data-theme='light'] {
512
688
  outline-offset: 2px;
513
689
  }
514
690
 
691
+ /*
692
+ * The glow around the ring. It is a shadow, so the ring above stays the
693
+ * indicator that clears 3:1 and the glow only adds to it. Any box shadow a
694
+ * component states wins over this one, which is why a raised button and a
695
+ * field ask for the glow by name as well. A surface focused only from script
696
+ * (tabindex -1: a dialog, the main region after the skip link) is not a
697
+ * control and takes no halo.
698
+ */
699
+ :focus-visible:not([tabindex='-1']) {
700
+ box-shadow: var(--shadow-glow);
701
+ }
702
+
515
703
  :focus:not(:focus-visible) {
516
704
  outline: none;
517
705
  }
@@ -614,6 +802,21 @@ html[data-theme='light'] {
614
802
  --color-success: #000000;
615
803
  --color-warn: #000000;
616
804
  --color-danger: #000000;
805
+ /* Paper has no light source, and a printer renders a soft shadow as a gray
806
+ * smear around every card. */
807
+ --color-highlight: transparent;
808
+ --color-shade: transparent;
809
+ --color-glow: transparent;
810
+ --color-halo: transparent;
811
+ --background-image-hero: none;
812
+ --background-image-accent: none;
813
+ --background-image-accent-y: none;
814
+ --background-image-canvas: none;
815
+ --background-image-sidebar: none;
816
+ --background-image-card: none;
817
+ --background-image-lift: none;
818
+ --background-image-rule-y: none;
819
+ --background-image-rule-end: none;
617
820
  color-scheme: light;
618
821
  }
619
822