@lyeve-labs/ui-kit 0.23.1 → 0.23.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.
@@ -26,12 +26,13 @@
26
26
  <script lang="ts">
27
27
  import {
28
28
  CHOICE_GROUP,
29
+ CHOICE_LEGEND,
29
30
  choiceGroupList,
30
31
  type ChoiceOrientation,
31
32
  type ChoiceSize,
32
33
  type ChoiceVariant,
33
34
  } from '../internal/choice.js';
34
- import { FIELD_ERROR, FIELD_HINT, FIELD_LABEL, describedBy } from '../internal/field.js';
35
+ import { FIELD_ERROR, FIELD_HINT, describedBy } from '../internal/field.js';
35
36
  import Checkbox from './Checkbox.svelte';
36
37
 
37
38
  interface Props {
@@ -123,7 +124,7 @@
123
124
  so a reader moving through the page would meet the options with nothing
124
125
  ahead of them saying what the set is for.
125
126
  -->
126
- <legend class="{FIELD_LABEL} {labelHidden ? 'sr-only' : ''}">
127
+ <legend class="{CHOICE_LEGEND} {labelHidden ? 'sr-only' : ''}">
127
128
  {label}{#if required}<span class="text-danger ms-0.5" aria-hidden="true">*</span><span
128
129
  class="sr-only"
129
130
  >
@@ -27,12 +27,13 @@
27
27
  <script lang="ts">
28
28
  import {
29
29
  CHOICE_GROUP,
30
+ CHOICE_LEGEND,
30
31
  choiceGroupList,
31
32
  type ChoiceOrientation,
32
33
  type ChoiceSize,
33
34
  type ChoiceVariant,
34
35
  } from '../internal/choice.js';
35
- import { FIELD_ERROR, FIELD_HINT, FIELD_LABEL, describedBy } from '../internal/field.js';
36
+ import { FIELD_ERROR, FIELD_HINT, describedBy } from '../internal/field.js';
36
37
  import Radio from './Radio.svelte';
37
38
 
38
39
  interface Props {
@@ -108,7 +109,7 @@
108
109
  so a reader moving through the page would meet the options with nothing
109
110
  ahead of them saying what the set is for.
110
111
  -->
111
- <legend class="{FIELD_LABEL} {labelHidden ? 'sr-only' : ''}">
112
+ <legend class="{CHOICE_LEGEND} {labelHidden ? 'sr-only' : ''}">
112
113
  {label}{#if required}<span class="text-danger ms-0.5" aria-hidden="true">*</span>{/if}
113
114
  </legend>
114
115
 
@@ -56,6 +56,23 @@
56
56
  children: Snippet;
57
57
  }
58
58
 
59
+ /**
60
+ * The hover ring, as inset shadows on the cells of the hovered row: top
61
+ * and bottom on every cell, the start edge on the first, the end edge on
62
+ * the last, so the four lines meet as one rectangle and the two outer
63
+ * cells of the last row carry it round the frame's corner. The shadow
64
+ * offsets are physical, which is what a shadow is; the first cell is the
65
+ * start cell in either direction and the two agree in left-to-right text.
66
+ */
67
+ const HOVER_RING = [
68
+ '[&_tbody_tr:hover]:bg-surface-2/60',
69
+ '[&_tbody_tr:hover>td]:shadow-[inset_0_1px_var(--color-brand),inset_0_-1px_var(--color-brand)]',
70
+ '[&_tbody_tr:hover>td:first-child]:shadow-[inset_1px_1px_var(--color-brand),inset_1px_-1px_var(--color-brand)]',
71
+ '[&_tbody_tr:hover>td:last-child]:shadow-[inset_-1px_1px_var(--color-brand),inset_-1px_-1px_var(--color-brand)]',
72
+ '[&_tbody_tr:hover>td:first-child:last-child]:shadow-[inset_1px_1px_var(--color-brand),inset_-1px_-1px_var(--color-brand)]',
73
+ '[&_tbody_tr]:transition-colors [&_tbody_tr]:duration-150',
74
+ ].join(' ');
75
+
59
76
  let {
60
77
  striped = false,
61
78
  hoverable = true,
@@ -231,6 +248,11 @@
231
248
  <!--
232
249
  border-separate with no spacing, and the row separators on the cells.
233
250
 
251
+ The last row's outer cells are rounded to the frame's inner radius. A
252
+ row takes no radius, so a ring drawn on it was a square inset in a
253
+ rounded frame and the frame's bottom arcs sat outside it; the ring is
254
+ drawn on the cells now (see HOVER_RING) and follows the corner.
255
+
234
256
  The hovered row draws a ring, and a ring is a box-shadow: a browser paints
235
257
  no box-shadow on a table row while the table collapses its borders, so the
236
258
  same row treatment the panels use would have rendered nothing at all here.
@@ -251,9 +273,9 @@
251
273
  [&_tbody_td]:px-4 [&_tbody_td]:py-3 [&_tbody_td]:text-fg [&_tbody_td]:align-middle
252
274
  [&_tbody_td]:border-b [&_tbody_td]:border-line [&_tbody_tr:last-child_td]:border-0
253
275
  {striped ? '[&_tbody_tr:nth-child(even)]:bg-surface-2/40' : ''}
254
- {hoverable
255
- ? '[&_tbody_tr:hover]:bg-surface-2/60 [&_tbody_tr:hover]:ring-1 [&_tbody_tr:hover]:ring-inset [&_tbody_tr:hover]:ring-brand [&_tbody_tr]:transition-colors [&_tbody_tr]:duration-150'
256
- : ''}"
276
+ [&_tbody_tr:last-child>td:first-child]:rounded-es-[calc(var(--radius-xl)-1px)]
277
+ [&_tbody_tr:last-child>td:last-child]:rounded-ee-[calc(var(--radius-xl)-1px)]
278
+ {hoverable ? HOVER_RING : ''}"
257
279
  >
258
280
  {@render children()}
259
281
  </table>
package/dist/index.d.ts CHANGED
@@ -89,4 +89,4 @@ export type { ConfirmOptions } from './components/dialog/dialog-manager.svelte.j
89
89
  export type { DialogOptions, DialogEntry, DialogSize } from './components/dialog/types.js';
90
90
  export { cn, type ClassValue } from './utils/cn.js';
91
91
  export { getTheme, getThemePreference, nextThemePreference, resolveTheme, setTheme, setThemePreference, systemTheme, themeBootScript, toggleTheme, watchSystemTheme, THEME_PREFERENCES, type Theme, type ThemePreference, } from './utils/theme.js';
92
- export declare const VERSION = "0.23.1";
92
+ export declare const VERSION = "0.23.2";
package/dist/index.js CHANGED
@@ -96,4 +96,4 @@ export { getTheme, getThemePreference, nextThemePreference, resolveTheme, setThe
96
96
  // ── Version ────────────────────────────────────────────────────────────────
97
97
  // Generated from package.json by `pnpm version:sync`. Bump package.json, never
98
98
  // this line; the build and the test suite fail when the two disagree.
99
- export const VERSION = '0.23.1';
99
+ export const VERSION = '0.23.2';
@@ -112,6 +112,15 @@ export declare const CHOICE_ICON_PX: Record<ChoiceSize, number>;
112
112
  * wrapping.
113
113
  */
114
114
  export declare const CHOICE_GROUP = "flex min-w-0 flex-col gap-2";
115
+ /**
116
+ * The group's heading. A rendered legend is not a flex item: the browser lays
117
+ * it out as the fieldset's legend, outside the flex formatting context, so
118
+ * the group's gap applies between the list and the hint and never between
119
+ * the legend and the list. The legend carries the distance itself, the same
120
+ * 6px a Field puts between its label and its control. A hidden legend is
121
+ * absolutely positioned and the margin does nothing there.
122
+ */
123
+ export declare const CHOICE_LEGEND = "text-sm font-medium text-fg mb-1.5";
115
124
  /**
116
125
  * The row or column the options sit in.
117
126
  *
@@ -14,7 +14,7 @@
14
14
  *
15
15
  * Not exported from the package entry point - this is an implementation detail.
16
16
  */
17
- import { FIELD_HINT } from './field.js';
17
+ import { FIELD_HINT, FIELD_LABEL } from './field.js';
18
18
  /**
19
19
  * The box and the icon slot share one size map, so the label text starts at the
20
20
  * same x whether or not an option carries an icon. 3.5 is 14px, 4 is 16px and 5
@@ -151,6 +151,15 @@ export const CHOICE_ICON_PX = {
151
151
  * wrapping.
152
152
  */
153
153
  export const CHOICE_GROUP = 'flex min-w-0 flex-col gap-2';
154
+ /**
155
+ * The group's heading. A rendered legend is not a flex item: the browser lays
156
+ * it out as the fieldset's legend, outside the flex formatting context, so
157
+ * the group's gap applies between the list and the hint and never between
158
+ * the legend and the list. The legend carries the distance itself, the same
159
+ * 6px a Field puts between its label and its control. A hidden legend is
160
+ * absolutely positioned and the margin does nothing there.
161
+ */
162
+ export const CHOICE_LEGEND = `${FIELD_LABEL} mb-1.5`;
154
163
  /**
155
164
  * The row or column the options sit in.
156
165
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyeve-labs/ui-kit",
3
- "version": "0.23.1",
3
+ "version": "0.23.2",
4
4
  "description": "A clean, accessible, palette-aware Svelte 5 component library. The design system behind LyEve.",
5
5
  "license": "MIT",
6
6
  "author": "LyEve Labs <hello@lyeve.com>",