@kayord/ui 3.0.2 → 3.0.4
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.
- package/README.md +24 -0
- package/dist/components/ui/alert-dialog/alert-dialog-content.svelte +1 -1
- package/dist/components/ui/button/button.svelte +2 -2
- package/dist/components/ui/button/button.svelte.d.ts +2 -2
- package/dist/components/ui/chart/chart-tooltip.svelte +37 -20
- package/dist/components/ui/chart/chart-utils.d.ts +3 -3
- package/dist/components/ui/chart/chart-utils.js +13 -10
- package/dist/components/ui/dialog/dialog-content.svelte +1 -1
- package/dist/components/ui/drawer/drawer-content.svelte +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu-trigger.svelte +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu-trigger.svelte.d.ts +1 -1
- package/dist/components/ui/sheet/sheet-content.svelte +1 -1
- package/dist/components/ui/spinner/spinner.svelte +5 -2
- package/dist/components/ui/tabs/tabs-trigger.svelte +1 -1
- package/dist/components/ui/toggle/toggle.svelte +3 -3
- package/dist/components/ui/toggle-group/toggle-group-item.svelte +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -220,6 +220,10 @@ pnpm add -D svelte-sonner
|
|
|
220
220
|
&:where([data-open]:not([data-open="false"])) {
|
|
221
221
|
@slot;
|
|
222
222
|
}
|
|
223
|
+
&:where([data-state="open"]),
|
|
224
|
+
&:where([data-open]:not([data-open="false"])) {
|
|
225
|
+
@slot;
|
|
226
|
+
}
|
|
223
227
|
}
|
|
224
228
|
|
|
225
229
|
@custom-variant data-closed {
|
|
@@ -227,6 +231,10 @@ pnpm add -D svelte-sonner
|
|
|
227
231
|
&:where([data-closed]:not([data-closed="false"])) {
|
|
228
232
|
@slot;
|
|
229
233
|
}
|
|
234
|
+
&:where([data-state="closed"]),
|
|
235
|
+
&:where([data-closed]:not([data-closed="false"])) {
|
|
236
|
+
@slot;
|
|
237
|
+
}
|
|
230
238
|
}
|
|
231
239
|
|
|
232
240
|
@custom-variant data-checked {
|
|
@@ -234,6 +242,10 @@ pnpm add -D svelte-sonner
|
|
|
234
242
|
&:where([data-checked]:not([data-checked="false"])) {
|
|
235
243
|
@slot;
|
|
236
244
|
}
|
|
245
|
+
&:where([data-state="checked"]),
|
|
246
|
+
&:where([data-checked]:not([data-checked="false"])) {
|
|
247
|
+
@slot;
|
|
248
|
+
}
|
|
237
249
|
}
|
|
238
250
|
|
|
239
251
|
@custom-variant data-unchecked {
|
|
@@ -241,6 +253,10 @@ pnpm add -D svelte-sonner
|
|
|
241
253
|
&:where([data-unchecked]:not([data-unchecked="false"])) {
|
|
242
254
|
@slot;
|
|
243
255
|
}
|
|
256
|
+
&:where([data-state="unchecked"]),
|
|
257
|
+
&:where([data-unchecked]:not([data-unchecked="false"])) {
|
|
258
|
+
@slot;
|
|
259
|
+
}
|
|
244
260
|
}
|
|
245
261
|
|
|
246
262
|
@custom-variant data-selected {
|
|
@@ -254,6 +270,10 @@ pnpm add -D svelte-sonner
|
|
|
254
270
|
&:where([data-disabled]:not([data-disabled="false"])) {
|
|
255
271
|
@slot;
|
|
256
272
|
}
|
|
273
|
+
&:where([data-disabled="true"]),
|
|
274
|
+
&:where([data-disabled]:not([data-disabled="false"])) {
|
|
275
|
+
@slot;
|
|
276
|
+
}
|
|
257
277
|
}
|
|
258
278
|
|
|
259
279
|
@custom-variant data-active {
|
|
@@ -261,6 +281,10 @@ pnpm add -D svelte-sonner
|
|
|
261
281
|
&:where([data-active]:not([data-active="false"])) {
|
|
262
282
|
@slot;
|
|
263
283
|
}
|
|
284
|
+
&:where([data-state="active"]),
|
|
285
|
+
&:where([data-active]:not([data-active="false"])) {
|
|
286
|
+
@slot;
|
|
287
|
+
}
|
|
264
288
|
}
|
|
265
289
|
|
|
266
290
|
@custom-variant data-horizontal {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
data-slot="alert-dialog-content"
|
|
25
25
|
data-size={size}
|
|
26
26
|
class={cn(
|
|
27
|
-
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-
|
|
27
|
+
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-popover text-popover-foreground ring-foreground/10 group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl p-4 ring-1 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm",
|
|
28
28
|
className
|
|
29
29
|
)}
|
|
30
30
|
{...restProps}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { type VariantProps, tv } from "tailwind-variants";
|
|
5
5
|
|
|
6
6
|
export const buttonVariants = tv({
|
|
7
|
-
base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
7
|
+
base: "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
23
23
|
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
24
24
|
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
25
|
-
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-
|
|
25
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
26
26
|
icon: "size-8",
|
|
27
27
|
"icon-xs":
|
|
28
28
|
"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
@@ -20,7 +20,7 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
20
20
|
"icon-sm": string;
|
|
21
21
|
"icon-lg": string;
|
|
22
22
|
};
|
|
23
|
-
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
23
|
+
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", {
|
|
24
24
|
variant: {
|
|
25
25
|
default: string;
|
|
26
26
|
outline: string;
|
|
@@ -58,7 +58,7 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
|
|
|
58
58
|
"icon-sm": string;
|
|
59
59
|
"icon-lg": string;
|
|
60
60
|
};
|
|
61
|
-
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", unknown, unknown, undefined>>;
|
|
61
|
+
}, undefined, "focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 active:not-aria-[haspopup]:translate-y-px aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 group/button inline-flex shrink-0 items-center justify-center whitespace-nowrap transition-all outline-none select-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", unknown, unknown, undefined>>;
|
|
62
62
|
export type ButtonVariant = VariantProps<typeof buttonVariants>["variant"];
|
|
63
63
|
export type ButtonSize = VariantProps<typeof buttonVariants>["size"];
|
|
64
64
|
export type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { cn, type WithElementRef, type WithoutChildren } from "../../../utils.js";
|
|
3
3
|
import type { HTMLAttributes } from "svelte/elements";
|
|
4
4
|
import { getPayloadConfigFromPayload, useChart, type TooltipPayload } from "./chart-utils.js";
|
|
5
|
-
import {
|
|
5
|
+
import { getChartContext, Tooltip as TooltipPrimitive } from "layerchart";
|
|
6
6
|
import type { Snippet } from "svelte";
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -48,27 +48,44 @@
|
|
|
48
48
|
} = $props();
|
|
49
49
|
|
|
50
50
|
const chart = useChart();
|
|
51
|
-
const
|
|
51
|
+
const chartCtx = getChartContext();
|
|
52
|
+
|
|
53
|
+
// Filter to series with defined values (important for item-based charts like Pie/Arc
|
|
54
|
+
// where only the hovered item has a value)
|
|
55
|
+
const visibleSeries = $derived(chartCtx.tooltip.series.filter((s: TooltipPayload) => s.value !== undefined));
|
|
52
56
|
|
|
53
57
|
const formattedLabel = $derived.by(() => {
|
|
54
|
-
if (hideLabel || !
|
|
58
|
+
if (hideLabel || !visibleSeries?.length) return null;
|
|
59
|
+
|
|
60
|
+
const [item] = visibleSeries;
|
|
61
|
+
const tooltipData = chartCtx.tooltip.data;
|
|
55
62
|
|
|
56
|
-
|
|
57
|
-
const
|
|
63
|
+
// Get the x-axis label value from the raw tooltip data (e.g. a Date or month string)
|
|
64
|
+
const dataLabel = tooltipData != null ? chartCtx.x(tooltipData) : undefined;
|
|
58
65
|
|
|
59
|
-
const
|
|
66
|
+
const key = labelKey ?? item?.label ?? item?.key ?? "value";
|
|
67
|
+
const itemConfig = getPayloadConfigFromPayload(
|
|
68
|
+
chart.config,
|
|
69
|
+
item,
|
|
70
|
+
key,
|
|
71
|
+
tooltipData as Record<string, unknown> | null
|
|
72
|
+
);
|
|
60
73
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
let value: unknown;
|
|
75
|
+
if (!labelKey && typeof label === "string") {
|
|
76
|
+
value = chart.config[label as keyof typeof chart.config]?.label ?? label;
|
|
77
|
+
} else if (labelKey) {
|
|
78
|
+
value = itemConfig?.label ?? dataLabel;
|
|
79
|
+
} else {
|
|
80
|
+
value = dataLabel;
|
|
81
|
+
}
|
|
65
82
|
|
|
66
83
|
if (value === undefined) return null;
|
|
67
84
|
if (!labelFormatter) return value;
|
|
68
|
-
return labelFormatter(value,
|
|
85
|
+
return labelFormatter(value, visibleSeries);
|
|
69
86
|
});
|
|
70
87
|
|
|
71
|
-
const nestLabel = $derived(
|
|
88
|
+
const nestLabel = $derived(visibleSeries.length === 1 && indicator !== "dot");
|
|
72
89
|
</script>
|
|
73
90
|
|
|
74
91
|
{#snippet TooltipLabel()}
|
|
@@ -96,23 +113,23 @@
|
|
|
96
113
|
{@render TooltipLabel()}
|
|
97
114
|
{/if}
|
|
98
115
|
<div class="grid gap-1.5">
|
|
99
|
-
{#each
|
|
100
|
-
{@const key = `${nameKey || item.key || item.
|
|
101
|
-
{@const itemConfig = getPayloadConfigFromPayload(chart.config, item, key)}
|
|
102
|
-
{@const indicatorColor = color || item.
|
|
116
|
+
{#each visibleSeries as item, i (item.key + i)}
|
|
117
|
+
{@const key = `${nameKey || item.key || item.label || "value"}`}
|
|
118
|
+
{@const itemConfig = getPayloadConfigFromPayload(chart.config, item, key, chartCtx.tooltip.data)}
|
|
119
|
+
{@const indicatorColor = color || item.config?.color || item.color}
|
|
103
120
|
<div
|
|
104
121
|
class={cn(
|
|
105
122
|
"[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:size-2.5",
|
|
106
123
|
indicator === "dot" && "items-center"
|
|
107
124
|
)}
|
|
108
125
|
>
|
|
109
|
-
{#if formatter && item.value !== undefined && item.
|
|
126
|
+
{#if formatter && item.value !== undefined && item.label}
|
|
110
127
|
{@render formatter({
|
|
111
128
|
value: item.value,
|
|
112
|
-
name: item.
|
|
129
|
+
name: item.label,
|
|
113
130
|
item,
|
|
114
131
|
index: i,
|
|
115
|
-
payload:
|
|
132
|
+
payload: visibleSeries,
|
|
116
133
|
})}
|
|
117
134
|
{:else}
|
|
118
135
|
{#if itemConfig?.icon}
|
|
@@ -136,7 +153,7 @@
|
|
|
136
153
|
{@render TooltipLabel()}
|
|
137
154
|
{/if}
|
|
138
155
|
<span class="text-muted-foreground">
|
|
139
|
-
{itemConfig?.label || item.
|
|
156
|
+
{itemConfig?.label || item.label}
|
|
140
157
|
</span>
|
|
141
158
|
</div>
|
|
142
159
|
{#if item.value !== undefined}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Tooltip } from "layerchart";
|
|
2
|
-
import { type Component, type
|
|
2
|
+
import { type Component, type Snippet } from "svelte";
|
|
3
3
|
export declare const THEMES: {
|
|
4
4
|
readonly light: "";
|
|
5
5
|
readonly dark: ".dark";
|
|
@@ -17,8 +17,8 @@ export type ChartConfig = {
|
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
export type ExtractSnippetParams<T> = T extends Snippet<[infer P]> ? P : never;
|
|
20
|
-
export type TooltipPayload =
|
|
21
|
-
export declare function getPayloadConfigFromPayload(config: ChartConfig, payload: TooltipPayload, key: string): ({
|
|
20
|
+
export type TooltipPayload = Tooltip.TooltipSeries;
|
|
21
|
+
export declare function getPayloadConfigFromPayload(config: ChartConfig, payload: TooltipPayload, key: string, data?: Record<string, any> | null): ({
|
|
22
22
|
label?: string;
|
|
23
23
|
icon?: Component;
|
|
24
24
|
} & ({
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
import { getContext, setContext } from "svelte";
|
|
2
2
|
export const THEMES = { light: "", dark: ".dark" };
|
|
3
3
|
// Helper to extract item config from a payload.
|
|
4
|
-
export function getPayloadConfigFromPayload(config, payload, key
|
|
4
|
+
export function getPayloadConfigFromPayload(config, payload, key,
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
+
data) {
|
|
5
7
|
if (typeof payload !== "object" || payload === null)
|
|
6
8
|
return undefined;
|
|
7
|
-
const
|
|
8
|
-
? payload.payload
|
|
9
|
-
: undefined;
|
|
9
|
+
const payloadConfig = "config" in payload && typeof payload.config === "object" && payload.config !== null ? payload.config : undefined;
|
|
10
10
|
let configLabelKey = key;
|
|
11
11
|
if (payload.key === key) {
|
|
12
12
|
configLabelKey = payload.key;
|
|
13
13
|
}
|
|
14
|
-
else if (payload.
|
|
15
|
-
configLabelKey = payload.
|
|
14
|
+
else if (payload.label === key) {
|
|
15
|
+
configLabelKey = payload.label;
|
|
16
16
|
}
|
|
17
17
|
else if (key in payload && typeof payload[key] === "string") {
|
|
18
18
|
configLabelKey = payload[key];
|
|
19
19
|
}
|
|
20
|
-
else if (
|
|
21
|
-
key in
|
|
22
|
-
typeof
|
|
23
|
-
configLabelKey =
|
|
20
|
+
else if (payloadConfig !== undefined &&
|
|
21
|
+
key in payloadConfig &&
|
|
22
|
+
typeof payloadConfig[key] === "string") {
|
|
23
|
+
configLabelKey = payloadConfig[key];
|
|
24
|
+
}
|
|
25
|
+
else if (data != null && key in data && typeof data[key] === "string") {
|
|
26
|
+
configLabelKey = data[key];
|
|
24
27
|
}
|
|
25
28
|
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
26
29
|
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
bind:ref
|
|
29
29
|
data-slot="dialog-content"
|
|
30
30
|
class={cn(
|
|
31
|
-
"bg-
|
|
31
|
+
"bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl p-4 text-sm ring-1 duration-100 outline-none sm:max-w-sm",
|
|
32
32
|
className
|
|
33
33
|
)}
|
|
34
34
|
{...restProps}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
bind:ref
|
|
24
24
|
data-slot="drawer-content"
|
|
25
25
|
class={cn(
|
|
26
|
-
"bg-
|
|
26
|
+
"bg-popover text-popover-foreground group/drawer-content fixed z-50 flex h-auto flex-col text-sm data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
27
27
|
className
|
|
28
28
|
)}
|
|
29
29
|
{...restProps}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { tv } from "tailwind-variants";
|
|
4
4
|
|
|
5
5
|
export const navigationMenuTriggerStyle = tv({
|
|
6
|
-
base: "
|
|
6
|
+
base: "hover:bg-muted focus:bg-muted data-open:hover:bg-muted data-open:focus:bg-muted data-open:bg-muted/50 focus-visible:ring-ring/50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted rounded-lg px-2.5 py-1.5 text-sm font-medium transition-all focus-visible:ring-3 focus-visible:outline-1 disabled:opacity-50 group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center outline-none disabled:pointer-events-none",
|
|
7
7
|
});
|
|
8
8
|
</script>
|
|
9
9
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const navigationMenuTriggerStyle: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "
|
|
1
|
+
export declare const navigationMenuTriggerStyle: import("tailwind-variants").TVReturnType<{} | {} | {}, undefined, "hover:bg-muted focus:bg-muted data-open:hover:bg-muted data-open:focus:bg-muted data-open:bg-muted/50 focus-visible:ring-ring/50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted rounded-lg px-2.5 py-1.5 text-sm font-medium transition-all focus-visible:ring-3 focus-visible:outline-1 disabled:opacity-50 group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center outline-none disabled:pointer-events-none", {} | {}, undefined, import("tailwind-variants").TVReturnType<unknown, undefined, "hover:bg-muted focus:bg-muted data-open:hover:bg-muted data-open:focus:bg-muted data-open:bg-muted/50 focus-visible:ring-ring/50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted rounded-lg px-2.5 py-1.5 text-sm font-medium transition-all focus-visible:ring-3 focus-visible:outline-1 disabled:opacity-50 group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center outline-none disabled:pointer-events-none", unknown, unknown, undefined>>;
|
|
2
2
|
import { NavigationMenu as NavigationMenuPrimitive } from "bits-ui";
|
|
3
3
|
declare const NavigationMenuTrigger: import("svelte").Component<NavigationMenuPrimitive.TriggerProps, {}, "ref">;
|
|
4
4
|
type NavigationMenuTrigger = ReturnType<typeof NavigationMenuTrigger>;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
data-slot="sheet-content"
|
|
36
36
|
data-side={side}
|
|
37
37
|
class={cn(
|
|
38
|
-
"bg-
|
|
38
|
+
"bg-popover text-popover-foreground data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
|
|
39
39
|
className
|
|
40
40
|
)}
|
|
41
41
|
{...restProps}
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { cn } from "../../../utils.js";
|
|
3
3
|
import Loader2Icon from "@lucide/svelte/icons/loader-2";
|
|
4
4
|
import type { SVGAttributes } from "svelte/elements";
|
|
5
|
+
|
|
5
6
|
let {
|
|
6
7
|
class: className,
|
|
7
8
|
role = "status",
|
|
8
|
-
// we add color and stroke for compatibility with different icon libraries props
|
|
9
|
+
// we add name, color, and stroke for compatibility with different icon libraries props
|
|
10
|
+
name,
|
|
9
11
|
color,
|
|
10
12
|
stroke,
|
|
11
13
|
"aria-label": ariaLabel = "Loading",
|
|
@@ -15,9 +17,10 @@
|
|
|
15
17
|
|
|
16
18
|
<Loader2Icon
|
|
17
19
|
{role}
|
|
20
|
+
name={name === null ? undefined : name}
|
|
18
21
|
color={color === null ? undefined : color}
|
|
19
22
|
stroke={stroke === null ? undefined : stroke}
|
|
20
23
|
aria-label={ariaLabel}
|
|
21
24
|
class={cn("size-4 animate-spin", className)}
|
|
22
|
-
{...restProps
|
|
25
|
+
{...restProps}
|
|
23
26
|
/>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
bind:ref
|
|
10
10
|
data-slot="tabs-trigger"
|
|
11
11
|
class={cn(
|
|
12
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
12
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
13
13
|
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
|
|
14
14
|
"data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground",
|
|
15
15
|
"after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
outline: "border-input hover:bg-muted border bg-transparent",
|
|
10
10
|
},
|
|
11
11
|
size: {
|
|
12
|
-
default: "h-8 min-w-8 px-2",
|
|
13
|
-
sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-
|
|
14
|
-
lg: "h-9 min-w-9 px-2.5",
|
|
12
|
+
default: "h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
13
|
+
sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
14
|
+
lg: "h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
data-size={ctx.size || size}
|
|
24
24
|
data-spacing={ctx.spacing}
|
|
25
25
|
class={cn(
|
|
26
|
-
"shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",
|
|
26
|
+
"shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",
|
|
27
27
|
toggleVariants({
|
|
28
28
|
variant: ctx.variant || variant,
|
|
29
29
|
size: ctx.size || size,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kayord/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.4",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/kayordDX/ui"
|
|
@@ -105,31 +105,31 @@
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
"dependencies": {
|
|
108
|
-
"bits-ui": "2.
|
|
108
|
+
"bits-ui": "2.17.2",
|
|
109
109
|
"clsx": "^2.1.1",
|
|
110
110
|
"tailwind-merge": "^3.5.0",
|
|
111
111
|
"tailwind-variants": "^3.2.2"
|
|
112
112
|
},
|
|
113
113
|
"devDependencies": {
|
|
114
|
-
"@eslint/compat": "^2.0.
|
|
114
|
+
"@eslint/compat": "^2.0.4",
|
|
115
115
|
"@eslint/js": "^10.0.1",
|
|
116
116
|
"@internationalized/date": "^3.12.0",
|
|
117
117
|
"@lucide/svelte": "^1.7.0",
|
|
118
118
|
"@sveltejs/adapter-auto": "^7.0.1",
|
|
119
|
-
"@sveltejs/kit": "^2.
|
|
119
|
+
"@sveltejs/kit": "^2.56.1",
|
|
120
120
|
"@sveltejs/package": "^2.5.7",
|
|
121
121
|
"@sveltejs/vite-plugin-svelte": "^7.0.0",
|
|
122
122
|
"@tailwindcss/vite": "^4.2.2",
|
|
123
123
|
"@types/d3-scale": "^4.0.9",
|
|
124
124
|
"@types/d3-shape": "^3.1.8",
|
|
125
|
-
"@vitest/browser": "^4.1.
|
|
126
|
-
"@vitest/browser-playwright": "^4.1.
|
|
125
|
+
"@vitest/browser": "^4.1.3",
|
|
126
|
+
"@vitest/browser-playwright": "^4.1.3",
|
|
127
127
|
"d3-scale": "^4.0.2",
|
|
128
128
|
"d3-shape": "^3.2.0",
|
|
129
129
|
"embla-carousel-svelte": "^8.6.0",
|
|
130
|
-
"eslint": "^10.
|
|
130
|
+
"eslint": "^10.2.0",
|
|
131
131
|
"eslint-config-prettier": "^10.1.8",
|
|
132
|
-
"eslint-plugin-svelte": "^3.
|
|
132
|
+
"eslint-plugin-svelte": "^3.17.0",
|
|
133
133
|
"formsnap": "^2.0.1",
|
|
134
134
|
"globals": "^17.4.0",
|
|
135
135
|
"layerchart": "2.0.0-next.40",
|
|
@@ -141,17 +141,17 @@
|
|
|
141
141
|
"publint": "^0.3.18",
|
|
142
142
|
"runed": "^0.37.1",
|
|
143
143
|
"svelte": "5.55.1",
|
|
144
|
-
"svelte-check": "^4.4.
|
|
144
|
+
"svelte-check": "^4.4.6",
|
|
145
145
|
"svelte-sonner": "^1.1.0",
|
|
146
146
|
"sveltekit-superforms": "^2.30.1",
|
|
147
147
|
"tailwindcss": "^4.2.2",
|
|
148
148
|
"tslib": "^2.8.1",
|
|
149
149
|
"tw-animate-css": "1.4.0",
|
|
150
150
|
"typescript": "^6.0.2",
|
|
151
|
-
"typescript-eslint": "^8.
|
|
151
|
+
"typescript-eslint": "^8.58.0",
|
|
152
152
|
"vaul-svelte": "1.0.0-next.7",
|
|
153
|
-
"vite": "^8.0.
|
|
154
|
-
"vitest": "^4.1.
|
|
153
|
+
"vite": "^8.0.7",
|
|
154
|
+
"vitest": "^4.1.3",
|
|
155
155
|
"vitest-browser-svelte": "^2.1.0",
|
|
156
156
|
"zod": "4.3.6"
|
|
157
157
|
},
|