@kayord/ui 2.1.9 → 2.1.10
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/dist/components/custom/combobox/Combobox.svelte.d.ts +1 -1
- package/dist/components/ui/accordion/accordion-root.svelte.d.ts +1 -1
- package/dist/components/ui/accordion/accordion.svelte.d.ts +1 -1
- package/dist/components/ui/audio-wave/audio-wave.svelte +58 -0
- package/dist/components/ui/audio-wave/audio-wave.svelte.d.ts +10 -0
- package/dist/components/ui/audio-wave/index.d.ts +2 -0
- package/dist/components/ui/audio-wave/index.js +2 -0
- package/dist/components/ui/calendar/calendar.svelte.d.ts +1 -1
- package/dist/components/ui/chip/chip-group.svelte +10 -0
- package/dist/components/ui/chip/chip-group.svelte.d.ts +8 -0
- package/dist/components/ui/chip/chip.svelte +132 -0
- package/dist/components/ui/chip/chip.svelte.d.ts +18 -0
- package/dist/components/ui/chip/index.d.ts +3 -0
- package/dist/components/ui/chip/index.js +3 -0
- package/dist/components/ui/color-picker/color-picker.svelte +474 -0
- package/dist/components/ui/color-picker/color-picker.svelte.d.ts +11 -0
- package/dist/components/ui/color-picker/index.d.ts +2 -0
- package/dist/components/ui/color-picker/index.js +2 -0
- package/dist/components/ui/command/command-dialog.svelte.d.ts +1 -1
- package/dist/components/ui/command/command-input.svelte.d.ts +1 -1
- package/dist/components/ui/command/command.svelte.d.ts +1 -1
- package/dist/components/ui/context-menu/context-menu-radio-group.svelte.d.ts +1 -1
- package/dist/components/ui/date-strip/ctx.d.ts +10 -0
- package/dist/components/ui/date-strip/ctx.js +8 -0
- package/dist/components/ui/date-strip/date-strip-item.svelte +52 -0
- package/dist/components/ui/date-strip/date-strip-item.svelte.d.ts +8 -0
- package/dist/components/ui/date-strip/date-strip.svelte +65 -0
- package/dist/components/ui/date-strip/date-strip.svelte.d.ts +15 -0
- package/dist/components/ui/date-strip/index.d.ts +3 -0
- package/dist/components/ui/date-strip/index.js +3 -0
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +1 -1
- package/dist/components/ui/dynamic-select/ctx.d.ts +15 -0
- package/dist/components/ui/dynamic-select/ctx.js +8 -0
- package/dist/components/ui/dynamic-select/dynamic-select-content.svelte +42 -0
- package/dist/components/ui/dynamic-select/dynamic-select-content.svelte.d.ts +7 -0
- package/dist/components/ui/dynamic-select/dynamic-select-item.svelte +16 -0
- package/dist/components/ui/dynamic-select/dynamic-select-item.svelte.d.ts +8 -0
- package/dist/components/ui/dynamic-select/dynamic-select-trigger.svelte +20 -0
- package/dist/components/ui/dynamic-select/dynamic-select-trigger.svelte.d.ts +8 -0
- package/dist/components/ui/dynamic-select/dynamic-select.svelte +37 -0
- package/dist/components/ui/dynamic-select/dynamic-select.svelte.d.ts +9 -0
- package/dist/components/ui/dynamic-select/index.d.ts +18 -0
- package/dist/components/ui/dynamic-select/index.js +7 -0
- package/dist/components/ui/index.d.ts +7 -0
- package/dist/components/ui/index.js +8 -0
- package/dist/components/ui/input/input.svelte.d.ts +1 -1
- package/dist/components/ui/input-group/input-group-input.svelte.d.ts +2 -2
- package/dist/components/ui/input-group/input-group-textarea.svelte.d.ts +1 -1
- package/dist/components/ui/input-otp/input-otp.svelte.d.ts +1 -1
- package/dist/components/ui/menubar/menubar-radio-group.svelte.d.ts +1 -1
- package/dist/components/ui/native-select/native-select.svelte.d.ts +1 -1
- package/dist/components/ui/radio-group/radio-group.svelte.d.ts +1 -1
- package/dist/components/ui/range-calendar/range-calendar.svelte.d.ts +1 -1
- package/dist/components/ui/sidebar/sidebar-input.svelte.d.ts +2 -2
- package/dist/components/ui/slider/slider.svelte.d.ts +1 -1
- package/dist/components/ui/status-dot/index.d.ts +2 -0
- package/dist/components/ui/status-dot/index.js +2 -0
- package/dist/components/ui/status-dot/status-dot.svelte +56 -0
- package/dist/components/ui/status-dot/status-dot.svelte.d.ts +9 -0
- package/dist/components/ui/tabs/tabs.svelte.d.ts +1 -1
- package/dist/components/ui/textarea/textarea.svelte.d.ts +1 -1
- package/dist/components/ui/timeline/index.d.ts +8 -0
- package/dist/components/ui/timeline/index.js +8 -0
- package/dist/components/ui/timeline/timeline-content.svelte +16 -0
- package/dist/components/ui/timeline/timeline-content.svelte.d.ts +8 -0
- package/dist/components/ui/timeline/timeline-date.svelte +10 -0
- package/dist/components/ui/timeline/timeline-date.svelte.d.ts +8 -0
- package/dist/components/ui/timeline/timeline-description.svelte +10 -0
- package/dist/components/ui/timeline/timeline-description.svelte.d.ts +8 -0
- package/dist/components/ui/timeline/timeline-item.svelte +16 -0
- package/dist/components/ui/timeline/timeline-item.svelte.d.ts +8 -0
- package/dist/components/ui/timeline/timeline-separator.svelte +25 -0
- package/dist/components/ui/timeline/timeline-separator.svelte.d.ts +8 -0
- package/dist/components/ui/timeline/timeline-title.svelte +10 -0
- package/dist/components/ui/timeline/timeline-title.svelte.d.ts +8 -0
- package/dist/components/ui/timeline/timeline.svelte +17 -0
- package/dist/components/ui/timeline/timeline.svelte.d.ts +8 -0
- package/dist/components/ui/toggle-group/toggle-group-item.svelte.d.ts +1 -1
- package/dist/components/ui/toggle-group/toggle-group.svelte.d.ts +1 -1
- package/package.json +4 -3
|
@@ -12,6 +12,6 @@ interface Props {
|
|
|
12
12
|
shouldFilter?: boolean;
|
|
13
13
|
search?: string;
|
|
14
14
|
}
|
|
15
|
-
declare const Combobox: import("svelte").Component<Props, {}, "
|
|
15
|
+
declare const Combobox: import("svelte").Component<Props, {}, "search" | "value" | "open">;
|
|
16
16
|
type Combobox = ReturnType<typeof Combobox>;
|
|
17
17
|
export default Combobox;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
2
|
-
declare const AccordionRoot: import("svelte").Component<AccordionPrimitive.RootProps, {}, "
|
|
2
|
+
declare const AccordionRoot: import("svelte").Component<AccordionPrimitive.RootProps, {}, "ref" | "value">;
|
|
3
3
|
type AccordionRoot = ReturnType<typeof AccordionRoot>;
|
|
4
4
|
export default AccordionRoot;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
2
|
-
declare const Accordion: import("svelte").Component<AccordionPrimitive.RootProps, {}, "
|
|
2
|
+
declare const Accordion: import("svelte").Component<AccordionPrimitive.RootProps, {}, "ref" | "value">;
|
|
3
3
|
type Accordion = ReturnType<typeof Accordion>;
|
|
4
4
|
export default Accordion;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
playing = true,
|
|
6
|
+
bars = 4,
|
|
7
|
+
class: className,
|
|
8
|
+
barColor = "bg-primary",
|
|
9
|
+
...rest
|
|
10
|
+
}: {
|
|
11
|
+
playing?: boolean;
|
|
12
|
+
bars?: number;
|
|
13
|
+
class?: string;
|
|
14
|
+
barColor?: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
} = $props();
|
|
17
|
+
|
|
18
|
+
let heights = $state(Array(bars).fill(0.25));
|
|
19
|
+
let frame: number;
|
|
20
|
+
|
|
21
|
+
function lerp(start: number, end: number, factor: number) {
|
|
22
|
+
return start + (end - start) * factor;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
$effect(() => {
|
|
26
|
+
if (heights.length !== bars) {
|
|
27
|
+
heights = Array(bars).fill(0.25);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const animate = () => {
|
|
31
|
+
const time = performance.now() / 1000;
|
|
32
|
+
|
|
33
|
+
heights = heights.map((h, i) => {
|
|
34
|
+
let target = 0.25;
|
|
35
|
+
|
|
36
|
+
if (playing) {
|
|
37
|
+
const input = (time - i * 0.15) * (Math.PI * 2);
|
|
38
|
+
const sine = (Math.sin(input) + 1) / 2;
|
|
39
|
+
target = 0.25 + sine * 0.75;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return lerp(h, target, 0.15);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
frame = requestAnimationFrame(animate);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
frame = requestAnimationFrame(animate);
|
|
49
|
+
|
|
50
|
+
return () => cancelAnimationFrame(frame);
|
|
51
|
+
});
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<div class={cn("flex h-8 items-end justify-center gap-0.5", className)} {...rest}>
|
|
55
|
+
{#each heights as height, i}
|
|
56
|
+
<div class={cn("w-1 rounded-sm", barColor)} style="height: {height * 100}%;"></div>
|
|
57
|
+
{/each}
|
|
58
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
playing?: boolean;
|
|
3
|
+
bars?: number;
|
|
4
|
+
class?: string;
|
|
5
|
+
barColor?: string;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
declare const AudioWave: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type AudioWave = ReturnType<typeof AudioWave>;
|
|
10
|
+
export default AudioWave;
|
|
@@ -16,6 +16,6 @@ type $$ComponentProps = WithoutChildrenOrChild<CalendarPrimitive.RootProps> & {
|
|
|
16
16
|
outsideMonth: boolean;
|
|
17
17
|
}]>;
|
|
18
18
|
};
|
|
19
|
-
declare const Calendar: import("svelte").Component<$$ComponentProps, {}, "
|
|
19
|
+
declare const Calendar: import("svelte").Component<$$ComponentProps, {}, "ref" | "value" | "placeholder">;
|
|
20
20
|
type Calendar = ReturnType<typeof Calendar>;
|
|
21
21
|
export default Calendar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
|
|
5
|
+
let { class: className, children }: { class?: string; children: Snippet } = $props();
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div class={cn("flex flex-wrap gap-2", className)}>
|
|
9
|
+
{@render children()}
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
class?: string;
|
|
4
|
+
children: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const ChipGroup: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ChipGroup = ReturnType<typeof ChipGroup>;
|
|
8
|
+
export default ChipGroup;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
import { X } from "lucide-svelte";
|
|
4
|
+
import type { Snippet } from "svelte";
|
|
5
|
+
import { tv, type VariantProps } from "tailwind-variants";
|
|
6
|
+
|
|
7
|
+
const chipVariants = tv({
|
|
8
|
+
base: "inline-flex items-center justify-center rounded-full text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:pointer-events-none disabled:opacity-50",
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
13
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
14
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
sm: "h-6 px-2.5 text-[10px]",
|
|
18
|
+
default: "h-8 px-3 text-xs",
|
|
19
|
+
lg: "h-9 px-4 text-sm",
|
|
20
|
+
},
|
|
21
|
+
active: {
|
|
22
|
+
true: "",
|
|
23
|
+
false: "",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
compoundVariants: [
|
|
27
|
+
{
|
|
28
|
+
variant: "outline",
|
|
29
|
+
active: true,
|
|
30
|
+
class: "bg-primary text-primary-foreground border-primary hover:bg-primary/90 hover:text-primary-foreground",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
variant: "ghost",
|
|
34
|
+
active: true,
|
|
35
|
+
class: "bg-accent text-accent-foreground",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
variant: "default",
|
|
40
|
+
size: "default",
|
|
41
|
+
active: false,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
type Variant = VariantProps<typeof chipVariants>["variant"];
|
|
46
|
+
type Size = VariantProps<typeof chipVariants>["size"];
|
|
47
|
+
|
|
48
|
+
let {
|
|
49
|
+
class: className,
|
|
50
|
+
variant = "default",
|
|
51
|
+
size = "default",
|
|
52
|
+
active = false,
|
|
53
|
+
disabled = false,
|
|
54
|
+
removable = false,
|
|
55
|
+
onclick,
|
|
56
|
+
onremove,
|
|
57
|
+
href,
|
|
58
|
+
children,
|
|
59
|
+
avatar,
|
|
60
|
+
icon,
|
|
61
|
+
...rest
|
|
62
|
+
}: {
|
|
63
|
+
class?: string;
|
|
64
|
+
variant?: Variant;
|
|
65
|
+
size?: Size;
|
|
66
|
+
active?: boolean;
|
|
67
|
+
disabled?: boolean;
|
|
68
|
+
removable?: boolean;
|
|
69
|
+
onclick?: (e: MouseEvent) => void;
|
|
70
|
+
onremove?: (e: MouseEvent) => void;
|
|
71
|
+
href?: string;
|
|
72
|
+
children?: Snippet;
|
|
73
|
+
avatar?: Snippet;
|
|
74
|
+
icon?: Snippet;
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
} = $props();
|
|
77
|
+
|
|
78
|
+
const isInteractive = !!onclick || !!href || active !== undefined;
|
|
79
|
+
const Element = href ? "a" : isInteractive ? "button" : "div";
|
|
80
|
+
|
|
81
|
+
function handleClick(e: MouseEvent) {
|
|
82
|
+
if (disabled) return;
|
|
83
|
+
onclick?.(e);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function handleRemove(e: MouseEvent) {
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
if (disabled) return;
|
|
89
|
+
onremove?.(e);
|
|
90
|
+
}
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<svelte:element
|
|
94
|
+
this={Element}
|
|
95
|
+
class={cn(chipVariants({ variant, size, active }), className)}
|
|
96
|
+
onclick={isInteractive ? handleClick : undefined}
|
|
97
|
+
{href}
|
|
98
|
+
{disabled}
|
|
99
|
+
tabindex={isInteractive ? 0 : -1}
|
|
100
|
+
aria-pressed={isInteractive ? active : undefined}
|
|
101
|
+
{...rest}
|
|
102
|
+
>
|
|
103
|
+
{#if avatar}
|
|
104
|
+
<span class={cn("mr-2 -ml-1 flex shrink-0", size === "sm" && "mr-1.5 -ml-1")}>
|
|
105
|
+
{@render avatar()}
|
|
106
|
+
</span>
|
|
107
|
+
{:else if icon}
|
|
108
|
+
<span class={cn("mr-2 flex shrink-0", size === "sm" && "mr-1.5")}>
|
|
109
|
+
{@render icon()}
|
|
110
|
+
</span>
|
|
111
|
+
{/if}
|
|
112
|
+
|
|
113
|
+
<span>
|
|
114
|
+
{#if children}
|
|
115
|
+
{@render children()}
|
|
116
|
+
{/if}
|
|
117
|
+
</span>
|
|
118
|
+
|
|
119
|
+
{#if removable}
|
|
120
|
+
<button
|
|
121
|
+
type="button"
|
|
122
|
+
class={cn(
|
|
123
|
+
"-mr-1 ml-2 flex items-center justify-center rounded-full hover:bg-black/10 dark:hover:bg-white/20",
|
|
124
|
+
size === "sm" ? "h-3.5 w-3.5" : "h-4 w-4"
|
|
125
|
+
)}
|
|
126
|
+
onclick={handleRemove}
|
|
127
|
+
aria-label="Remove"
|
|
128
|
+
>
|
|
129
|
+
<X class="h-3 w-3" />
|
|
130
|
+
</button>
|
|
131
|
+
{/if}
|
|
132
|
+
</svelte:element>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
declare const Chip: import("svelte").Component<{
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
class?: string;
|
|
5
|
+
variant?: "default" | "outline" | "secondary" | "ghost" | undefined;
|
|
6
|
+
size?: "default" | "sm" | "lg" | undefined;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
removable?: boolean;
|
|
10
|
+
onclick?: (e: MouseEvent) => void;
|
|
11
|
+
onremove?: (e: MouseEvent) => void;
|
|
12
|
+
href?: string;
|
|
13
|
+
children?: Snippet;
|
|
14
|
+
avatar?: Snippet;
|
|
15
|
+
icon?: Snippet;
|
|
16
|
+
}, {}, "">;
|
|
17
|
+
type Chip = ReturnType<typeof Chip>;
|
|
18
|
+
export default Chip;
|