@kayord/ui 2.1.13 → 2.1.14
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/ui/index.d.ts +1 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/sheet/sheet-content.svelte +2 -2
- package/dist/components/ui/sidebar/sidebar-trigger.svelte +1 -0
- package/dist/components/ui/stepper/ctx.d.ts +8 -0
- package/dist/components/ui/stepper/ctx.js +8 -0
- package/dist/components/ui/stepper/index.d.ts +8 -0
- package/dist/components/ui/stepper/index.js +8 -0
- package/dist/components/ui/stepper/stepper-description.svelte +7 -0
- package/dist/components/ui/stepper/stepper-description.svelte.d.ts +8 -0
- package/dist/components/ui/stepper/stepper-indicator.svelte +45 -0
- package/dist/components/ui/stepper/stepper-indicator.svelte.d.ts +10 -0
- package/dist/components/ui/stepper/stepper-item.svelte +33 -0
- package/dist/components/ui/stepper/stepper-item.svelte.d.ts +9 -0
- package/dist/components/ui/stepper/stepper-separator.svelte +28 -0
- package/dist/components/ui/stepper/stepper-separator.svelte.d.ts +6 -0
- package/dist/components/ui/stepper/stepper-title.svelte +7 -0
- package/dist/components/ui/stepper/stepper-title.svelte.d.ts +8 -0
- package/dist/components/ui/stepper/stepper-trigger.svelte +35 -0
- package/dist/components/ui/stepper/stepper-trigger.svelte.d.ts +10 -0
- package/dist/components/ui/stepper/stepper.svelte +35 -0
- package/dist/components/ui/stepper/stepper.svelte.d.ts +10 -0
- package/dist/components/ui/switch/switch.svelte +1 -1
- package/package.json +2 -2
|
@@ -38,6 +38,7 @@ export * as Sidebar from "./sidebar/index.js";
|
|
|
38
38
|
export { Skeleton } from "./skeleton/index.js";
|
|
39
39
|
export { Slider } from "./slider/index.js";
|
|
40
40
|
export { Spinner } from "./spinner/index.js";
|
|
41
|
+
export * as Stepper from "./stepper/index.js";
|
|
41
42
|
export { Switch } from "./switch/index.js";
|
|
42
43
|
export * as Table from "./table/index.js";
|
|
43
44
|
export * as Tabs from "./tabs/index.js";
|
|
@@ -38,6 +38,7 @@ export * as Sidebar from "./sidebar/index.js";
|
|
|
38
38
|
export { Skeleton } from "./skeleton/index.js";
|
|
39
39
|
export { Slider } from "./slider/index.js";
|
|
40
40
|
export { Spinner } from "./spinner/index.js";
|
|
41
|
+
export * as Stepper from "./stepper/index.js";
|
|
41
42
|
export { Switch } from "./switch/index.js";
|
|
42
43
|
export * as Table from "./table/index.js";
|
|
43
44
|
export * as Tabs from "./tabs/index.js";
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
top: "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
8
8
|
bottom:
|
|
9
9
|
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
10
|
-
left: "data-[state=closed]:slide-out-to-start data-[state=open]:slide-in-from-start inset-y-0 start-0 h-full w-3/4 border-e sm:max-w-sm",
|
|
10
|
+
left: "data-[state=closed]:slide-out-to-start data-[state=open]:slide-in-from-start rtl:data-[state=closed]:slide-out-to-end rtl:data-[state=open]:slide-in-from-end inset-y-0 start-0 h-full w-3/4 border-e sm:max-w-sm",
|
|
11
11
|
right:
|
|
12
|
-
"data-[state=closed]:slide-out-to-end data-[state=open]:slide-in-from-end inset-y-0 end-0 h-full w-3/4 border-s sm:max-w-sm",
|
|
12
|
+
"data-[state=closed]:slide-out-to-end data-[state=open]:slide-in-from-end rtl:data-[state=closed]:slide-out-to-start rtl:data-[state=open]:slide-in-from-start inset-y-0 end-0 h-full w-3/4 border-s sm:max-w-sm",
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
defaultVariants: {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type StepperContext = {
|
|
2
|
+
activeStep: () => number;
|
|
3
|
+
setStep: (step: number) => void;
|
|
4
|
+
orientation: () => "horizontal" | "vertical";
|
|
5
|
+
};
|
|
6
|
+
export declare function setStepperContext(props: StepperContext): void;
|
|
7
|
+
export declare function getStepperContext(): StepperContext;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Stepper from "./stepper.svelte";
|
|
2
|
+
import StepperItem from "./stepper-item.svelte";
|
|
3
|
+
import StepperTrigger from "./stepper-trigger.svelte";
|
|
4
|
+
import StepperIndicator from "./stepper-indicator.svelte";
|
|
5
|
+
import StepperSeparator from "./stepper-separator.svelte";
|
|
6
|
+
import StepperTitle from "./stepper-title.svelte";
|
|
7
|
+
import StepperDescription from "./stepper-description.svelte";
|
|
8
|
+
export { Stepper as Root, StepperItem as Item, StepperTrigger as Trigger, StepperIndicator as Indicator, StepperSeparator as Separator, StepperTitle as Title, StepperDescription as Description, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Stepper from "./stepper.svelte";
|
|
2
|
+
import StepperItem from "./stepper-item.svelte";
|
|
3
|
+
import StepperTrigger from "./stepper-trigger.svelte";
|
|
4
|
+
import StepperIndicator from "./stepper-indicator.svelte";
|
|
5
|
+
import StepperSeparator from "./stepper-separator.svelte";
|
|
6
|
+
import StepperTitle from "./stepper-title.svelte";
|
|
7
|
+
import StepperDescription from "./stepper-description.svelte";
|
|
8
|
+
export { Stepper as Root, StepperItem as Item, StepperTrigger as Trigger, StepperIndicator as Indicator, StepperSeparator as Separator, StepperTitle as Title, StepperDescription as Description, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
let { class: className, children }: { class?: string; children: Snippet } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<p class={cn("text-muted-foreground text-xs", className)}>{@render children()}</p>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
class?: string;
|
|
4
|
+
children: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const StepperDescription: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type StepperDescription = ReturnType<typeof StepperDescription>;
|
|
8
|
+
export default StepperDescription;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
import { Check } from "@lucide/svelte";
|
|
4
|
+
import { getStepperContext } from "./ctx";
|
|
5
|
+
import type { Snippet } from "svelte";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
step,
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
success,
|
|
12
|
+
}: {
|
|
13
|
+
step: number;
|
|
14
|
+
class?: string;
|
|
15
|
+
children?: Snippet;
|
|
16
|
+
success?: Snippet;
|
|
17
|
+
} = $props();
|
|
18
|
+
|
|
19
|
+
const ctx = getStepperContext();
|
|
20
|
+
|
|
21
|
+
let isCompleted = $derived(step < ctx.activeStep());
|
|
22
|
+
let isActive = $derived(step === ctx.activeStep());
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<div
|
|
26
|
+
class={cn(
|
|
27
|
+
"relative flex h-10 w-10 items-center justify-center rounded-full border-2 text-sm font-semibold transition-colors duration-200",
|
|
28
|
+
isActive && "border-primary text-primary ring-primary/20 ring-2 ring-offset-2",
|
|
29
|
+
isCompleted && "border-primary bg-primary text-primary-foreground",
|
|
30
|
+
!isActive && !isCompleted && "border-muted-foreground/25 text-muted-foreground",
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
>
|
|
34
|
+
{#if isCompleted}
|
|
35
|
+
{#if success}
|
|
36
|
+
{@render success()}
|
|
37
|
+
{:else}
|
|
38
|
+
<Check class="h-5 w-5" />
|
|
39
|
+
{/if}
|
|
40
|
+
{:else if children}
|
|
41
|
+
{@render children()}
|
|
42
|
+
{:else}
|
|
43
|
+
{step + 1}
|
|
44
|
+
{/if}
|
|
45
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
step: number;
|
|
4
|
+
class?: string;
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
success?: Snippet;
|
|
7
|
+
};
|
|
8
|
+
declare const StepperIndicator: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type StepperIndicator = ReturnType<typeof StepperIndicator>;
|
|
10
|
+
export default StepperIndicator;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
import { getStepperContext } from "./ctx";
|
|
4
|
+
import type { Snippet } from "svelte";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
step,
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
}: {
|
|
11
|
+
step: number;
|
|
12
|
+
class?: string;
|
|
13
|
+
children: Snippet;
|
|
14
|
+
} = $props();
|
|
15
|
+
|
|
16
|
+
const ctx = getStepperContext();
|
|
17
|
+
|
|
18
|
+
let isCompleted = $derived(step < ctx.activeStep());
|
|
19
|
+
let isActive = $derived(step === ctx.activeStep());
|
|
20
|
+
let isVertical = $derived(ctx.orientation() === "vertical");
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<div
|
|
24
|
+
data-state={isActive ? "active" : isCompleted ? "completed" : "inactive"}
|
|
25
|
+
class={cn(
|
|
26
|
+
"group flex items-center",
|
|
27
|
+
!isVertical && "flex-1 gap-4 last:flex-none",
|
|
28
|
+
isVertical && "relative flex-col items-start gap-0",
|
|
29
|
+
className
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
32
|
+
{@render children()}
|
|
33
|
+
</div>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
step: number;
|
|
4
|
+
class?: string;
|
|
5
|
+
children: Snippet;
|
|
6
|
+
};
|
|
7
|
+
declare const StepperItem: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
|
+
type StepperItem = ReturnType<typeof StepperItem>;
|
|
9
|
+
export default StepperItem;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
import { getStepperContext } from "./ctx";
|
|
4
|
+
|
|
5
|
+
let { class: className }: { class?: string } = $props();
|
|
6
|
+
const ctx = getStepperContext();
|
|
7
|
+
let isVertical = $derived(ctx.orientation() === "vertical");
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div
|
|
11
|
+
class={cn(
|
|
12
|
+
"bg-muted flex-1",
|
|
13
|
+
|
|
14
|
+
!isVertical && "-mt-8 mr-4 ml-4 h-[2px]",
|
|
15
|
+
|
|
16
|
+
isVertical && "absolute top-14 -bottom-4 left-[27px] w-[2px]",
|
|
17
|
+
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
>
|
|
21
|
+
<div
|
|
22
|
+
class={cn(
|
|
23
|
+
"bg-primary transition-all duration-200 ease-in-out",
|
|
24
|
+
!isVertical && "h-full w-full origin-left scale-x-0 group-data-[state=completed]:scale-x-100",
|
|
25
|
+
isVertical && "h-full w-full origin-top scale-y-0 group-data-[state=completed]:scale-y-100"
|
|
26
|
+
)}
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
let { class: className, children }: { class?: string; children: Snippet } = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<h3 class={cn("text-sm leading-none font-medium", className)}>{@render children()}</h3>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
class?: string;
|
|
4
|
+
children: Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const StepperTitle: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type StepperTitle = ReturnType<typeof StepperTitle>;
|
|
8
|
+
export default StepperTitle;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
import { Button } from "../button";
|
|
4
|
+
import { getStepperContext } from "./ctx";
|
|
5
|
+
import type { Snippet } from "svelte";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
step,
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
...rest
|
|
12
|
+
}: {
|
|
13
|
+
step: number;
|
|
14
|
+
class?: string;
|
|
15
|
+
children: Snippet;
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
} = $props();
|
|
18
|
+
|
|
19
|
+
const ctx = getStepperContext();
|
|
20
|
+
let isVertical = $derived(ctx.orientation() === "vertical");
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<Button
|
|
24
|
+
variant="ghost"
|
|
25
|
+
onclick={() => ctx.setStep(step)}
|
|
26
|
+
class={cn(
|
|
27
|
+
"flex h-auto items-center justify-center gap-3 p-2 hover:bg-transparent",
|
|
28
|
+
!isVertical && "flex-col",
|
|
29
|
+
isVertical && "flex-row justify-start",
|
|
30
|
+
className
|
|
31
|
+
)}
|
|
32
|
+
{...rest}
|
|
33
|
+
>
|
|
34
|
+
{@render children()}
|
|
35
|
+
</Button>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
step: number;
|
|
4
|
+
class?: string;
|
|
5
|
+
children: Snippet;
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
8
|
+
declare const StepperTrigger: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type StepperTrigger = ReturnType<typeof StepperTrigger>;
|
|
10
|
+
export default StepperTrigger;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
import { setStepperContext } from "./ctx";
|
|
4
|
+
import type { Snippet } from "svelte";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
value = $bindable(0),
|
|
8
|
+
orientation = "horizontal",
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
}: {
|
|
12
|
+
value: number;
|
|
13
|
+
orientation?: "horizontal" | "vertical";
|
|
14
|
+
class?: string;
|
|
15
|
+
children: Snippet;
|
|
16
|
+
} = $props();
|
|
17
|
+
|
|
18
|
+
setStepperContext({
|
|
19
|
+
activeStep: () => value,
|
|
20
|
+
setStep: (s: number) => {
|
|
21
|
+
value = s;
|
|
22
|
+
},
|
|
23
|
+
orientation: () => orientation,
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div
|
|
28
|
+
class={cn(
|
|
29
|
+
"flex w-full gap-4",
|
|
30
|
+
orientation === "vertical" ? "flex-col" : "flex-row items-start justify-between",
|
|
31
|
+
className
|
|
32
|
+
)}
|
|
33
|
+
>
|
|
34
|
+
{@render children()}
|
|
35
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from "svelte";
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
value: number;
|
|
4
|
+
orientation?: "horizontal" | "vertical";
|
|
5
|
+
class?: string;
|
|
6
|
+
children: Snippet;
|
|
7
|
+
};
|
|
8
|
+
declare const Stepper: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
9
|
+
type Stepper = ReturnType<typeof Stepper>;
|
|
10
|
+
export default Stepper;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<SwitchPrimitive.Thumb
|
|
24
24
|
data-slot="switch-thumb"
|
|
25
25
|
class={cn(
|
|
26
|
-
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
|
|
26
|
+
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 rtl:data-[state=checked]:translate-x-[calc(-100%)]"
|
|
27
27
|
)}
|
|
28
28
|
/>
|
|
29
29
|
</SwitchPrimitive.Root>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kayord/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.14",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/kayordDX/ui"
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"tslib": "^2.8.1",
|
|
149
149
|
"tw-animate-css": "1.4.0",
|
|
150
150
|
"typescript": "^5.9.3",
|
|
151
|
-
"typescript-eslint": "^8.57.
|
|
151
|
+
"typescript-eslint": "^8.57.1",
|
|
152
152
|
"vaul-svelte": "1.0.0-next.7",
|
|
153
153
|
"vite": "^8.0.0",
|
|
154
154
|
"vitest": "^4.1.0",
|