@widgetic/design-system 0.5.36 → 0.5.38
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.
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
5
5
|
|
|
6
6
|
export const navRowVariants = tv({
|
|
7
|
-
base: 'group/nav-row flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar active:bg-accent-hover disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2',
|
|
7
|
+
base: 'group/nav-row relative before:absolute before:inset-x-0 before:-inset-y-px flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar active:bg-accent-hover disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2',
|
|
8
8
|
variants: {
|
|
9
9
|
active: {
|
|
10
10
|
true: 'bg-sidebar-accent text-sidebar-accent-foreground text-body-medium active:bg-accent-hover',
|
|
@@ -5,7 +5,7 @@ export declare const navRowVariants: import("tailwind-variants").TVReturnType<{
|
|
|
5
5
|
true: string;
|
|
6
6
|
false: string;
|
|
7
7
|
};
|
|
8
|
-
}, undefined, "group/nav-row flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar active:bg-accent-hover disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2", {
|
|
8
|
+
}, undefined, "group/nav-row relative before:absolute before:inset-x-0 before:-inset-y-px flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar active:bg-accent-hover disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2", {
|
|
9
9
|
responsiveVariants?: boolean | (string | number | symbol)[] | {
|
|
10
10
|
active?: boolean | (string | number | symbol)[] | undefined;
|
|
11
11
|
} | undefined;
|
|
@@ -27,7 +27,7 @@ export declare const navRowVariants: import("tailwind-variants").TVReturnType<{
|
|
|
27
27
|
true: string;
|
|
28
28
|
false: string;
|
|
29
29
|
};
|
|
30
|
-
}, undefined, "group/nav-row flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar active:bg-accent-hover disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
30
|
+
}, undefined, "group/nav-row relative before:absolute before:inset-x-0 before:-inset-y-px flex h-8 w-full min-w-0 items-center gap-2 rounded-lg py-1.5 ps-2 pe-2 text-start transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sidebar-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar active:bg-accent-hover disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2", import("tailwind-variants/dist/config.js").TVConfig<{
|
|
31
31
|
active: {
|
|
32
32
|
true: string;
|
|
33
33
|
false: string;
|
|
@@ -43,6 +43,20 @@
|
|
|
43
43
|
{ id: 'workspace', labelWidth: 'w-16', labelWidths: ['w-24', 'w-28', 'w-20', 'w-24', 'w-16'] },
|
|
44
44
|
{ id: 'account', labelWidth: 'w-14', labelWidths: ['w-20', 'w-28'] }
|
|
45
45
|
];
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The margin above every group after the first. Tailwind reads whole class names from the source, so the class is
|
|
49
|
+
* written here once and used by the real menu and by the skeleton, which must not move when the menu is known.
|
|
50
|
+
*
|
|
51
|
+
* What a person sees between the last row of a group and the label of the next one (Stats, then Account) is 24px, from
|
|
52
|
+
* the bottom of the text of the row to the top of the text of the label:
|
|
53
|
+
* 6px the row under its 20px line (Nav Row: h-8, 14/20)
|
|
54
|
+
* + 2px the gap between the children of the menu (gap-0.5)
|
|
55
|
+
* + 4px this margin (mt-1)
|
|
56
|
+
* + 12px the label above its 16px line (Nav Section Label: pt-3, as in Figma)
|
|
57
|
+
* = 24px. It was mt-3 (12px, 32px in all) up to 14 Nov 2026, when 24px was asked for.
|
|
58
|
+
*/
|
|
59
|
+
const groupGapClass = 'mt-1';
|
|
46
60
|
</script>
|
|
47
61
|
|
|
48
62
|
{#if pending}
|
|
@@ -55,9 +69,10 @@
|
|
|
55
69
|
{...restProps}
|
|
56
70
|
>
|
|
57
71
|
<span class="sr-only" role="status">{pendingLabel}</span>
|
|
58
|
-
{#each pendingGroups as group (group.id)}
|
|
59
|
-
<div class=
|
|
60
|
-
|
|
72
|
+
{#each pendingGroups as group, groupIndex (group.id)}
|
|
73
|
+
<div class={cn('flex flex-col gap-0.5', groupIndex > 0 && groupGapClass)} aria-hidden="true">
|
|
74
|
+
<!-- The label box of the real menu (Nav Section Label: px-2 pt-3 pb-1): the bar sits where its text will. -->
|
|
75
|
+
<div class="flex h-8 w-full min-w-0 items-center px-2 pt-3 pb-1">
|
|
61
76
|
<Skeleton class={cn('h-3', group.labelWidth)} pulse="low" />
|
|
62
77
|
</div>
|
|
63
78
|
{#each group.labelWidths as labelWidth, rowIndex (rowIndex)}
|
|
@@ -78,7 +93,7 @@
|
|
|
78
93
|
>
|
|
79
94
|
{#each groups as group, groupIndex (group.id)}
|
|
80
95
|
<div
|
|
81
|
-
class={cn('flex flex-col gap-0.5', groupIndex > 0 &&
|
|
96
|
+
class={cn('flex flex-col gap-0.5', groupIndex > 0 && groupGapClass)}
|
|
82
97
|
data-testid="settings-nav-group-{group.id}"
|
|
83
98
|
>
|
|
84
99
|
<NavSectionLabel label={group.label} />
|
|
@@ -30,10 +30,13 @@
|
|
|
30
30
|
/** Receives bits-ui trigger props (spread onto IconButton / Button). */
|
|
31
31
|
trigger: Snippet<[{ props: Record<string, unknown> }]>;
|
|
32
32
|
} = $props();
|
|
33
|
+
|
|
34
|
+
/** A tooltip with nothing to say is not shown at all (a blank box on hover reads as a bug). */
|
|
35
|
+
const hasContent = $derived(content.trim().length > 0);
|
|
33
36
|
</script>
|
|
34
37
|
|
|
35
38
|
<Tooltip.Provider {delayDuration}>
|
|
36
|
-
<Tooltip.Root open={open}>
|
|
39
|
+
<Tooltip.Root open={open} disabled={!hasContent}>
|
|
37
40
|
<Tooltip.Trigger class={cn('inline-flex', className)}>
|
|
38
41
|
{#snippet child({ props }: { props: Record<string, unknown> })}
|
|
39
42
|
{@render trigger({ props })}
|