@kayord/ui 0.4.5 → 0.5.0
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/alert-dialog/alert-dialog-content.svelte +1 -1
- package/dist/components/ui/calendar/calendar-cell.svelte +1 -1
- package/dist/components/ui/calendar/calendar-day.svelte +3 -3
- package/dist/components/ui/calendar/calendar-head-cell.svelte +1 -1
- package/dist/components/ui/calendar/calendar-header.svelte +1 -1
- package/dist/components/ui/calendar/calendar-months.svelte +1 -1
- package/dist/components/ui/calendar/calendar.svelte +1 -1
- package/dist/components/ui/carousel/carousel-next.svelte +1 -1
- package/dist/components/ui/carousel/carousel-previous.svelte +1 -1
- package/dist/components/ui/checkbox/checkbox.svelte +2 -2
- package/dist/components/ui/command/command-dialog.svelte.d.ts +1 -1
- package/dist/components/ui/context-menu/context-menu-checkbox-item.svelte +1 -1
- package/dist/components/ui/context-menu/context-menu-item.svelte +1 -1
- package/dist/components/ui/context-menu/context-menu-radio-item.svelte +1 -1
- package/dist/components/ui/context-menu/context-menu-sub-trigger.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +1 -1
- package/dist/components/ui/form/form-button.svelte +1 -1
- package/dist/components/ui/form/form-button.svelte.d.ts +3 -1
- package/dist/components/ui/form/form-description.svelte +3 -3
- package/dist/components/ui/form/form-description.svelte.d.ts +7 -1
- package/dist/components/ui/form/form-element-field.svelte +15 -0
- package/dist/components/ui/form/form-element-field.svelte.d.ts +24 -0
- package/dist/components/ui/form/form-field-errors.svelte +20 -0
- package/dist/components/ui/form/form-field-errors.svelte.d.ts +34 -0
- package/dist/components/ui/form/form-field.svelte +15 -0
- package/dist/components/ui/form/form-field.svelte.d.ts +24 -0
- package/dist/components/ui/form/form-fieldset.svelte +21 -0
- package/dist/components/ui/form/form-fieldset.svelte.d.ts +23 -0
- package/dist/components/ui/form/form-label.svelte +4 -4
- package/dist/components/ui/form/form-label.svelte.d.ts +3 -1
- package/dist/components/ui/form/form-legend.svelte +13 -0
- package/dist/components/ui/form/form-legend.svelte.d.ts +22 -0
- package/dist/components/ui/form/index.d.ts +7 -28
- package/dist/components/ui/form/index.js +8 -24
- package/dist/components/ui/hover-card/hover-card-content.svelte +1 -1
- package/dist/components/ui/menubar/menubar-checkbox-item.svelte +1 -1
- package/dist/components/ui/menubar/menubar-item.svelte +1 -1
- package/dist/components/ui/menubar/menubar-radio-item.svelte +1 -1
- package/dist/components/ui/menubar/menubar-sub-trigger.svelte +1 -1
- package/dist/components/ui/menubar/menubar-trigger.svelte +1 -1
- package/dist/components/ui/pagination/pagination.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-cell.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-day.svelte +2 -2
- package/dist/components/ui/range-calendar/range-calendar-head-cell.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-header.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-months.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar.svelte +1 -1
- package/dist/components/ui/select/select-item.svelte +1 -1
- package/dist/components/ui/slider/slider.svelte +7 -3
- package/package.json +23 -23
- package/dist/components/ui/drawer/drawer-description.svelte.d.ts +0 -16
- package/dist/components/ui/drawer/drawer-title.svelte.d.ts +0 -16
- package/dist/components/ui/drawer/index.d.ts +0 -13
- package/dist/components/ui/form/form-checkbox.svelte +0 -19
- package/dist/components/ui/form/form-checkbox.svelte.d.ts +0 -13
- package/dist/components/ui/form/form-input.svelte +0 -22
- package/dist/components/ui/form/form-input.svelte.d.ts +0 -14
- package/dist/components/ui/form/form-item.svelte +0 -8
- package/dist/components/ui/form/form-item.svelte.d.ts +0 -17
- package/dist/components/ui/form/form-native-select.svelte +0 -17
- package/dist/components/ui/form/form-native-select.svelte.d.ts +0 -17
- package/dist/components/ui/form/form-radio-group.svelte +0 -17
- package/dist/components/ui/form/form-radio-group.svelte.d.ts +0 -17
- package/dist/components/ui/form/form-select-trigger.svelte +0 -11
- package/dist/components/ui/form/form-select-trigger.svelte.d.ts +0 -22
- package/dist/components/ui/form/form-select.svelte +0 -16
- package/dist/components/ui/form/form-select.svelte.d.ts +0 -35
- package/dist/components/ui/form/form-switch.svelte +0 -18
- package/dist/components/ui/form/form-switch.svelte.d.ts +0 -13
- package/dist/components/ui/form/form-textarea.svelte +0 -22
- package/dist/components/ui/form/form-textarea.svelte.d.ts +0 -14
- package/dist/components/ui/form/form-validation.svelte +0 -7
- package/dist/components/ui/form/form-validation.svelte.d.ts +0 -15
- package/dist/components/ui/select/select.svelte +0 -8
- package/dist/components/ui/select/select.svelte.d.ts +0 -16
|
@@ -13,7 +13,7 @@ export { className as class };
|
|
|
13
13
|
{transition}
|
|
14
14
|
{transitionConfig}
|
|
15
15
|
class={cn(
|
|
16
|
-
"fixed left-[50%] top-[50%] translate-x-[-50%] translate-y-[-50%]
|
|
16
|
+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:rounded-lg md:w-full",
|
|
17
17
|
className
|
|
18
18
|
)}
|
|
19
19
|
{...$$restProps}
|
|
@@ -8,7 +8,7 @@ export { className as class };
|
|
|
8
8
|
<CalendarPrimitive.Cell
|
|
9
9
|
{date}
|
|
10
10
|
class={cn(
|
|
11
|
-
"h-9 w-9 text-center text-sm
|
|
11
|
+
"relative h-9 w-9 p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:rounded-md [&:has([data-selected])]:bg-accent [&:has([data-selected][data-outside-month])]:bg-accent/50",
|
|
12
12
|
className
|
|
13
13
|
)}
|
|
14
14
|
{...$$restProps}
|
|
@@ -16,13 +16,13 @@ export { className as class };
|
|
|
16
16
|
"h-9 w-9 p-0 font-normal ",
|
|
17
17
|
"[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground",
|
|
18
18
|
// Selected
|
|
19
|
-
"data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground data-[selected]:focus:bg-primary data-[selected]:focus:text-primary-foreground
|
|
19
|
+
"data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:opacity-100 data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground data-[selected]:focus:bg-primary data-[selected]:focus:text-primary-foreground",
|
|
20
20
|
// Disabled
|
|
21
21
|
"data-[disabled]:text-muted-foreground data-[disabled]:opacity-50",
|
|
22
22
|
// Unavailable
|
|
23
|
-
"data-[unavailable]:
|
|
23
|
+
"data-[unavailable]:text-destructive-foreground data-[unavailable]:line-through",
|
|
24
24
|
// Outside months
|
|
25
|
-
"data-[outside-month]:text-muted-foreground data-[outside-month]:opacity-50 [&[data-outside-month][data-selected]]:bg-accent/50 [&[data-outside-month][data-selected]]:text-muted-foreground [&[data-outside-month][data-selected]]:opacity-30
|
|
25
|
+
"data-[outside-month]:pointer-events-none data-[outside-month]:text-muted-foreground data-[outside-month]:opacity-50 [&[data-outside-month][data-selected]]:bg-accent/50 [&[data-outside-month][data-selected]]:text-muted-foreground [&[data-outside-month][data-selected]]:opacity-30",
|
|
26
26
|
className
|
|
27
27
|
)}
|
|
28
28
|
{...$$restProps}
|
|
@@ -5,7 +5,7 @@ export { className as class };
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<CalendarPrimitive.HeadCell
|
|
8
|
-
class={cn("
|
|
8
|
+
class={cn("w-9 rounded-md text-[0.8rem] font-normal text-muted-foreground", className)}
|
|
9
9
|
{...$$restProps}
|
|
10
10
|
>
|
|
11
11
|
<slot />
|
|
@@ -5,7 +5,7 @@ export { className as class };
|
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
7
|
<CalendarPrimitive.Header
|
|
8
|
-
class={cn("flex justify-between pt-1
|
|
8
|
+
class={cn("relative flex w-full items-center justify-between pt-1", className)}
|
|
9
9
|
{...$$restProps}
|
|
10
10
|
>
|
|
11
11
|
<slot />
|
|
@@ -3,6 +3,6 @@ let className = void 0;
|
|
|
3
3
|
export { className as class };
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
|
-
<div class={cn("flex flex-col
|
|
6
|
+
<div class={cn("mt-4 flex flex-col space-y-4 sm:flex-row sm:space-x-4 sm:space-y-0", className)} {...$$restProps}>
|
|
7
7
|
<slot />
|
|
8
8
|
</div>
|
|
@@ -37,7 +37,7 @@ export { className as class };
|
|
|
37
37
|
</Calendar.GridHead>
|
|
38
38
|
<Calendar.GridBody>
|
|
39
39
|
{#each month.weeks as weekDates}
|
|
40
|
-
<Calendar.GridRow class="w-full
|
|
40
|
+
<Calendar.GridRow class="mt-2 w-full">
|
|
41
41
|
{#each weekDates as date}
|
|
42
42
|
<Calendar.Cell {date}>
|
|
43
43
|
<Calendar.Day {date} month={month.value} />
|
|
@@ -13,7 +13,7 @@ const { orientation, canScrollNext, scrollNext, handleKeyDown } = getEmblaContex
|
|
|
13
13
|
{variant}
|
|
14
14
|
{size}
|
|
15
15
|
class={cn(
|
|
16
|
-
"absolute h-8 w-8 rounded-full
|
|
16
|
+
"absolute h-8 w-8 touch-manipulation rounded-full",
|
|
17
17
|
$orientation === "horizontal"
|
|
18
18
|
? "-right-12 top-1/2 -translate-y-1/2"
|
|
19
19
|
: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
@@ -13,7 +13,7 @@ const { orientation, canScrollPrev, scrollPrev, handleKeyDown } = getEmblaContex
|
|
|
13
13
|
{variant}
|
|
14
14
|
{size}
|
|
15
15
|
class={cn(
|
|
16
|
-
"absolute h-8 w-8 rounded-full
|
|
16
|
+
"absolute h-8 w-8 touch-manipulation rounded-full",
|
|
17
17
|
$orientation === "horizontal" ? "-left-12 top-1/2 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
|
|
18
18
|
className
|
|
19
19
|
)}
|
|
@@ -8,7 +8,7 @@ export { className as class };
|
|
|
8
8
|
|
|
9
9
|
<CheckboxPrimitive.Root
|
|
10
10
|
class={cn(
|
|
11
|
-
"box-content
|
|
11
|
+
"peer box-content h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[disabled=true]:cursor-not-allowed data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[disabled=true]:opacity-50",
|
|
12
12
|
className
|
|
13
13
|
)}
|
|
14
14
|
bind:checked
|
|
@@ -16,7 +16,7 @@ export { className as class };
|
|
|
16
16
|
on:click
|
|
17
17
|
>
|
|
18
18
|
<CheckboxPrimitive.Indicator
|
|
19
|
-
class={cn("flex items-center justify-center text-current
|
|
19
|
+
class={cn("flex h-4 w-4 items-center justify-center text-current")}
|
|
20
20
|
let:isChecked
|
|
21
21
|
let:isIndeterminate
|
|
22
22
|
>
|
|
@@ -4,7 +4,7 @@ declare const __propDef: {
|
|
|
4
4
|
preventScroll?: boolean | undefined;
|
|
5
5
|
closeOnEscape?: boolean | undefined;
|
|
6
6
|
closeOnOutsideClick?: boolean | undefined;
|
|
7
|
-
onOutsideClick?: ((event: PointerEvent) => void) | undefined;
|
|
7
|
+
onOutsideClick?: ((event: MouseEvent | TouchEvent | PointerEvent) => void) | undefined;
|
|
8
8
|
portal?: string | HTMLElement | null | undefined;
|
|
9
9
|
open?: boolean | undefined;
|
|
10
10
|
onOpenChange?: import("bits-ui/dist/internal").OnChangeFn<boolean> | undefined;
|
|
@@ -9,7 +9,7 @@ export { className as class };
|
|
|
9
9
|
<ContextMenuPrimitive.CheckboxItem
|
|
10
10
|
bind:checked
|
|
11
11
|
class={cn(
|
|
12
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[
|
|
12
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50",
|
|
13
13
|
className
|
|
14
14
|
)}
|
|
15
15
|
{...$$restProps}
|
|
@@ -7,7 +7,7 @@ export { className as class };
|
|
|
7
7
|
|
|
8
8
|
<ContextMenuPrimitive.Item
|
|
9
9
|
class={cn(
|
|
10
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[
|
|
10
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50",
|
|
11
11
|
inset && "pl-8",
|
|
12
12
|
className
|
|
13
13
|
)}
|
|
@@ -8,7 +8,7 @@ export { className as class };
|
|
|
8
8
|
|
|
9
9
|
<ContextMenuPrimitive.RadioItem
|
|
10
10
|
class={cn(
|
|
11
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[
|
|
11
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50",
|
|
12
12
|
className
|
|
13
13
|
)}
|
|
14
14
|
{value}
|
|
@@ -8,7 +8,7 @@ export { className as class };
|
|
|
8
8
|
|
|
9
9
|
<ContextMenuPrimitive.SubTrigger
|
|
10
10
|
class={cn(
|
|
11
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[
|
|
11
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[highlighted]:bg-accent data-[state=open]:bg-accent data-[highlighted]:text-accent-foreground data-[state=open]:text-accent-foreground",
|
|
12
12
|
inset && "pl-8",
|
|
13
13
|
className
|
|
14
14
|
)}
|
|
@@ -9,7 +9,7 @@ export { className as class };
|
|
|
9
9
|
<DropdownMenuPrimitive.CheckboxItem
|
|
10
10
|
bind:checked
|
|
11
11
|
class={cn(
|
|
12
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[
|
|
12
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50",
|
|
13
13
|
className
|
|
14
14
|
)}
|
|
15
15
|
{...$$restProps}
|
|
@@ -7,7 +7,7 @@ export { className as class };
|
|
|
7
7
|
|
|
8
8
|
<DropdownMenuPrimitive.Item
|
|
9
9
|
class={cn(
|
|
10
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[
|
|
10
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50",
|
|
11
11
|
inset && "pl-8",
|
|
12
12
|
className
|
|
13
13
|
)}
|
|
@@ -8,7 +8,7 @@ export { className as class };
|
|
|
8
8
|
|
|
9
9
|
<DropdownMenuPrimitive.RadioItem
|
|
10
10
|
class={cn(
|
|
11
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[
|
|
11
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50",
|
|
12
12
|
className
|
|
13
13
|
)}
|
|
14
14
|
{value}
|
|
@@ -2,10 +2,12 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
import * as Button from "../button";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: Button.Props;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
5
8
|
slots: {
|
|
6
9
|
default: {};
|
|
7
10
|
};
|
|
8
|
-
events: import("bits-ui/dist/bits/button/types").Events;
|
|
9
11
|
};
|
|
10
12
|
export type FormButtonProps = typeof __propDef.props;
|
|
11
13
|
export type FormButtonEvents = typeof __propDef.events;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import * as FormPrimitive from "formsnap";
|
|
2
2
|
import { cn } from "../../../utils";
|
|
3
3
|
let className = void 0;
|
|
4
4
|
export { className as class };
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
|
-
<FormPrimitive.Description class={cn("text-sm text-muted-foreground", className)} {...$$restProps}>
|
|
8
|
-
<slot />
|
|
7
|
+
<FormPrimitive.Description class={cn("text-sm text-muted-foreground", className)} {...$$restProps} let:descriptionAttrs>
|
|
8
|
+
<slot {descriptionAttrs} />
|
|
9
9
|
</FormPrimitive.Description>
|
|
@@ -6,7 +6,13 @@ declare const __propDef: {
|
|
|
6
6
|
[evt: string]: CustomEvent<any>;
|
|
7
7
|
};
|
|
8
8
|
slots: {
|
|
9
|
-
default: {
|
|
9
|
+
default: {
|
|
10
|
+
descriptionAttrs: {
|
|
11
|
+
id: string;
|
|
12
|
+
'data-fs-error': string | undefined;
|
|
13
|
+
'data-fs-description': string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
10
16
|
};
|
|
11
17
|
};
|
|
12
18
|
export type FormDescriptionProps = typeof __propDef.props;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script generics="T extends Record<string, unknown>, U extends FormPathLeaves<T>">import * as FormPrimitive from "formsnap";
|
|
4
|
+
import { cn } from "../../../utils";
|
|
5
|
+
export let form;
|
|
6
|
+
export let name;
|
|
7
|
+
let className = void 0;
|
|
8
|
+
export { className as class };
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<FormPrimitive.ElementField {form} {name} let:constraints let:errors let:tainted let:value>
|
|
12
|
+
<div class={cn("space-y-2", className)}>
|
|
13
|
+
<slot {constraints} {errors} {tainted} {value} />
|
|
14
|
+
</div>
|
|
15
|
+
</FormPrimitive.ElementField>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FormPathLeaves } from "sveltekit-superforms";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import * as FormPrimitive from "formsnap";
|
|
5
|
+
declare class __sveltets_Render<T extends Record<string, unknown>, U extends FormPathLeaves<T>> {
|
|
6
|
+
props(): FormPrimitive.ElementFieldProps<T, U> & HTMLAttributes<HTMLElement>;
|
|
7
|
+
events(): {} & {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots(): {
|
|
11
|
+
default: {
|
|
12
|
+
constraints: Partial<{}> | undefined;
|
|
13
|
+
errors: string[];
|
|
14
|
+
tainted: boolean;
|
|
15
|
+
value: never;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export type FormElementFieldProps<T extends Record<string, unknown>, U extends FormPathLeaves<T>> = ReturnType<__sveltets_Render<T, U>['props']>;
|
|
20
|
+
export type FormElementFieldEvents<T extends Record<string, unknown>, U extends FormPathLeaves<T>> = ReturnType<__sveltets_Render<T, U>['events']>;
|
|
21
|
+
export type FormElementFieldSlots<T extends Record<string, unknown>, U extends FormPathLeaves<T>> = ReturnType<__sveltets_Render<T, U>['slots']>;
|
|
22
|
+
export default class FormElementField<T extends Record<string, unknown>, U extends FormPathLeaves<T>> extends SvelteComponent<FormElementFieldProps<T, U>, FormElementFieldEvents<T, U>, FormElementFieldSlots<T, U>> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script>import * as FormPrimitive from "formsnap";
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
let className = void 0;
|
|
4
|
+
export { className as class };
|
|
5
|
+
export let errorClasses = void 0;
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<FormPrimitive.FieldErrors
|
|
9
|
+
class={cn("text-sm font-medium text-destructive", className)}
|
|
10
|
+
{...$$restProps}
|
|
11
|
+
let:errors
|
|
12
|
+
let:fieldErrorsAttrs
|
|
13
|
+
let:errorAttrs
|
|
14
|
+
>
|
|
15
|
+
<slot {errors} {fieldErrorsAttrs} {errorAttrs}>
|
|
16
|
+
{#each errors as error}
|
|
17
|
+
<div {...errorAttrs} class={cn(errorClasses)}>{error}</div>
|
|
18
|
+
{/each}
|
|
19
|
+
</slot>
|
|
20
|
+
</FormPrimitive.FieldErrors>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
id?: string | undefined;
|
|
5
|
+
asChild?: boolean | undefined;
|
|
6
|
+
el?: HTMLDivElement | undefined;
|
|
7
|
+
} & import("svelte/elements").HTMLAttributes<HTMLDivElement> & {
|
|
8
|
+
errorClasses?: string | undefined | null;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {
|
|
14
|
+
default: {
|
|
15
|
+
errors: string[];
|
|
16
|
+
fieldErrorsAttrs: {
|
|
17
|
+
id: string;
|
|
18
|
+
'data-fs-error': string | undefined;
|
|
19
|
+
'data-fs-field-errors': string;
|
|
20
|
+
'aria-live': "assertive";
|
|
21
|
+
};
|
|
22
|
+
errorAttrs: {
|
|
23
|
+
'data-fs-field-error': string;
|
|
24
|
+
'data-fs-error': string | undefined;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export type FormFieldErrorsProps = typeof __propDef.props;
|
|
30
|
+
export type FormFieldErrorsEvents = typeof __propDef.events;
|
|
31
|
+
export type FormFieldErrorsSlots = typeof __propDef.slots;
|
|
32
|
+
export default class FormFieldErrors extends SvelteComponent<FormFieldErrorsProps, FormFieldErrorsEvents, FormFieldErrorsSlots> {
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script generics="T extends Record<string, unknown>, U extends FormPath<T>">import * as FormPrimitive from "formsnap";
|
|
4
|
+
import { cn } from "../../../utils";
|
|
5
|
+
export let form;
|
|
6
|
+
export let name;
|
|
7
|
+
let className = void 0;
|
|
8
|
+
export { className as class };
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<FormPrimitive.Field {form} {name} let:constraints let:errors let:tainted let:value>
|
|
12
|
+
<div class={cn("space-y-2", className)}>
|
|
13
|
+
<slot {constraints} {errors} {tainted} {value} />
|
|
14
|
+
</div>
|
|
15
|
+
</FormPrimitive.Field>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FormPath } from "sveltekit-superforms";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
import * as FormPrimitive from "formsnap";
|
|
5
|
+
declare class __sveltets_Render<T extends Record<string, unknown>, U extends FormPath<T>> {
|
|
6
|
+
props(): FormPrimitive.FieldProps<T, U> & HTMLAttributes<HTMLElement>;
|
|
7
|
+
events(): {} & {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots(): {
|
|
11
|
+
default: {
|
|
12
|
+
constraints: Partial<{}> | undefined;
|
|
13
|
+
errors: string[];
|
|
14
|
+
tainted: boolean;
|
|
15
|
+
value: unknown;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export type FormFieldProps<T extends Record<string, unknown>, U extends FormPath<T>> = ReturnType<__sveltets_Render<T, U>['props']>;
|
|
20
|
+
export type FormFieldEvents<T extends Record<string, unknown>, U extends FormPath<T>> = ReturnType<__sveltets_Render<T, U>['events']>;
|
|
21
|
+
export type FormFieldSlots<T extends Record<string, unknown>, U extends FormPath<T>> = ReturnType<__sveltets_Render<T, U>['slots']>;
|
|
22
|
+
export default class FormField<T extends Record<string, unknown>, U extends FormPath<T>> extends SvelteComponent<FormFieldProps<T, U>, FormFieldEvents<T, U>, FormFieldSlots<T, U>> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script context="module"></script>
|
|
2
|
+
|
|
3
|
+
<script generics="T extends Record<string, unknown>, U extends FormPath<T>">import * as FormPrimitive from "formsnap";
|
|
4
|
+
import { cn } from "../../../utils";
|
|
5
|
+
export let form;
|
|
6
|
+
export let name;
|
|
7
|
+
let className = void 0;
|
|
8
|
+
export { className as class };
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<FormPrimitive.Fieldset
|
|
12
|
+
{form}
|
|
13
|
+
{name}
|
|
14
|
+
let:constraints
|
|
15
|
+
let:errors
|
|
16
|
+
let:tainted
|
|
17
|
+
let:value
|
|
18
|
+
class={cn("space-y-2", className)}
|
|
19
|
+
>
|
|
20
|
+
<slot {constraints} {errors} {tainted} {value} />
|
|
21
|
+
</FormPrimitive.Fieldset>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FormPath } from "sveltekit-superforms";
|
|
3
|
+
import * as FormPrimitive from "formsnap";
|
|
4
|
+
declare class __sveltets_Render<T extends Record<string, unknown>, U extends FormPath<T>> {
|
|
5
|
+
props(): FormPrimitive.FieldsetProps<T, U>;
|
|
6
|
+
events(): {} & {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots(): {
|
|
10
|
+
default: {
|
|
11
|
+
constraints: Partial<{}> | undefined;
|
|
12
|
+
errors: string[];
|
|
13
|
+
tainted: boolean;
|
|
14
|
+
value: unknown;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export type FormFieldsetProps<T extends Record<string, unknown>, U extends FormPath<T>> = ReturnType<__sveltets_Render<T, U>['props']>;
|
|
19
|
+
export type FormFieldsetEvents<T extends Record<string, unknown>, U extends FormPath<T>> = ReturnType<__sveltets_Render<T, U>['events']>;
|
|
20
|
+
export type FormFieldsetSlots<T extends Record<string, unknown>, U extends FormPath<T>> = ReturnType<__sveltets_Render<T, U>['slots']>;
|
|
21
|
+
export default class FormFieldset<T extends Record<string, unknown>, U extends FormPath<T>> extends SvelteComponent<FormFieldsetProps<T, U>, FormFieldsetEvents<T, U>, FormFieldsetSlots<T, U>> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { getFormControl } from "formsnap";
|
|
2
2
|
import { cn } from "../../../utils";
|
|
3
3
|
import { Label } from "../label";
|
|
4
4
|
let className = void 0;
|
|
5
5
|
export { className as class };
|
|
6
|
-
const {
|
|
6
|
+
const { labelAttrs } = getFormControl();
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
-
<Label
|
|
10
|
-
<slot />
|
|
9
|
+
<Label {...$labelAttrs} class={cn("data-[fs-error]:text-destructive", className)} {...$$restProps}>
|
|
10
|
+
<slot {labelAttrs} />
|
|
11
11
|
</Label>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script>import * as FormPrimitive from "formsnap";
|
|
2
|
+
import { cn } from "../../../utils";
|
|
3
|
+
let className = void 0;
|
|
4
|
+
export { className as class };
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<FormPrimitive.Legend
|
|
8
|
+
{...$$restProps}
|
|
9
|
+
class={cn("text-sm font-medium leading-none data-[fs-error]:text-destructive", className)}
|
|
10
|
+
let:legendAttrs
|
|
11
|
+
>
|
|
12
|
+
<slot {legendAttrs} />
|
|
13
|
+
</FormPrimitive.Legend>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import * as FormPrimitive from "formsnap";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: FormPrimitive.LegendProps;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {
|
|
10
|
+
legendAttrs: {
|
|
11
|
+
'data-fs-legend': string;
|
|
12
|
+
'data-fs-error': string | undefined;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type FormLegendProps = typeof __propDef.props;
|
|
18
|
+
export type FormLegendEvents = typeof __propDef.events;
|
|
19
|
+
export type FormLegendSlots = typeof __propDef.slots;
|
|
20
|
+
export default class FormLegend extends SvelteComponent<FormLegendProps, FormLegendEvents, FormLegendSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import { Form as FormPrimitive, getFormField } from "formsnap";
|
|
3
|
-
import * as RadioGroupComp from "../radio-group";
|
|
4
|
-
import * as SelectComp from "../select";
|
|
5
|
-
import type { Writable } from "svelte/store";
|
|
6
|
-
import Item from "./form-item.svelte";
|
|
7
|
-
import Input from "./form-input.svelte";
|
|
8
|
-
import Textarea from "./form-textarea.svelte";
|
|
1
|
+
import * as FormPrimitive from "formsnap";
|
|
9
2
|
import Description from "./form-description.svelte";
|
|
10
3
|
import Label from "./form-label.svelte";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import Select from "./form-select.svelte";
|
|
17
|
-
import SelectTrigger from "./form-select-trigger.svelte";
|
|
4
|
+
import FieldErrors from "./form-field-errors.svelte";
|
|
5
|
+
import Field from "./form-field.svelte";
|
|
6
|
+
import Fieldset from "./form-fieldset.svelte";
|
|
7
|
+
import Legend from "./form-legend.svelte";
|
|
8
|
+
import ElementField from "./form-element-field.svelte";
|
|
18
9
|
import Button from "./form-button.svelte";
|
|
19
|
-
declare const Root: typeof FormPrimitive.Root;
|
|
20
|
-
declare const Field: typeof FormPrimitive.Field;
|
|
21
10
|
declare const Control: typeof FormPrimitive.Control;
|
|
22
|
-
|
|
23
|
-
declare const NativeRadio: typeof FormPrimitive.Radio;
|
|
24
|
-
declare const SelectContent: typeof SelectComp.Content;
|
|
25
|
-
declare const SelectLabel: typeof SelectComp.Label;
|
|
26
|
-
declare const SelectGroup: typeof import("bits-ui/dist/bits/select").Group;
|
|
27
|
-
declare const SelectItem: typeof SelectComp.Item;
|
|
28
|
-
declare const SelectSeparator: typeof SelectComp.Separator;
|
|
29
|
-
export type TextareaGetFormField = Omit<ReturnType<typeof getFormField>, "value"> & {
|
|
30
|
-
value: Writable<string>;
|
|
31
|
-
};
|
|
32
|
-
export { Root, Field, Control, Item, Input, Label, Button, Switch, Select, Checkbox, Textarea, Validation, RadioGroup, RadioItem, Description, SelectContent, SelectLabel, SelectGroup, SelectItem, SelectSeparator, SelectTrigger, NativeSelect, NativeRadio, Root as Form, Field as FormField, Control as FormControl, Item as FormItem, Input as FormInput, Textarea as FormTextarea, Description as FormDescription, Label as FormLabel, Validation as FormValidation, NativeSelect as FormNativeSelect, NativeRadio as FormNativeRadio, Checkbox as FormCheckbox, Switch as FormSwitch, RadioGroup as FormRadioGroup, RadioItem as FormRadioItem, Select as FormSelect, SelectContent as FormSelectContent, SelectLabel as FormSelectLabel, SelectGroup as FormSelectGroup, SelectItem as FormSelectItem, SelectSeparator as FormSelectSeparator, SelectTrigger as FormSelectTrigger, Button as FormButton, };
|
|
11
|
+
export { Field, Control, Label, Button, FieldErrors, Description, Fieldset, Legend, ElementField, Field as FormField, Control as FormControl, Description as FormDescription, Label as FormLabel, FieldErrors as FormFieldErrors, Fieldset as FormFieldset, Legend as FormLegend, ElementField as FormElementField, Button as FormButton, };
|
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as RadioGroupComp from "../radio-group";
|
|
3
|
-
import * as SelectComp from "../select";
|
|
4
|
-
import Item from "./form-item.svelte";
|
|
5
|
-
import Input from "./form-input.svelte";
|
|
6
|
-
import Textarea from "./form-textarea.svelte";
|
|
1
|
+
import * as FormPrimitive from "formsnap";
|
|
7
2
|
import Description from "./form-description.svelte";
|
|
8
3
|
import Label from "./form-label.svelte";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import Select from "./form-select.svelte";
|
|
15
|
-
import SelectTrigger from "./form-select-trigger.svelte";
|
|
4
|
+
import FieldErrors from "./form-field-errors.svelte";
|
|
5
|
+
import Field from "./form-field.svelte";
|
|
6
|
+
import Fieldset from "./form-fieldset.svelte";
|
|
7
|
+
import Legend from "./form-legend.svelte";
|
|
8
|
+
import ElementField from "./form-element-field.svelte";
|
|
16
9
|
import Button from "./form-button.svelte";
|
|
17
|
-
const Root = FormPrimitive.Root;
|
|
18
|
-
const Field = FormPrimitive.Field;
|
|
19
10
|
const Control = FormPrimitive.Control;
|
|
20
|
-
|
|
21
|
-
const NativeRadio = FormPrimitive.Radio;
|
|
22
|
-
const SelectContent = SelectComp.Content;
|
|
23
|
-
const SelectLabel = SelectComp.Label;
|
|
24
|
-
const SelectGroup = SelectComp.Group;
|
|
25
|
-
const SelectItem = SelectComp.Item;
|
|
26
|
-
const SelectSeparator = SelectComp.Separator;
|
|
27
|
-
export { Root, Field, Control, Item, Input, Label, Button, Switch, Select, Checkbox, Textarea, Validation, RadioGroup, RadioItem, Description, SelectContent, SelectLabel, SelectGroup, SelectItem, SelectSeparator, SelectTrigger, NativeSelect, NativeRadio,
|
|
11
|
+
export { Field, Control, Label, Button, FieldErrors, Description, Fieldset, Legend, ElementField,
|
|
28
12
|
//
|
|
29
|
-
|
|
13
|
+
Field as FormField, Control as FormControl, Description as FormDescription, Label as FormLabel, FieldErrors as FormFieldErrors, Fieldset as FormFieldset, Legend as FormLegend, ElementField as FormElementField, Button as FormButton, };
|
|
@@ -14,7 +14,7 @@ export { className as class };
|
|
|
14
14
|
{align}
|
|
15
15
|
{sideOffset}
|
|
16
16
|
class={cn(
|
|
17
|
-
"z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none
|
|
17
|
+
"z-50 mt-3 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",
|
|
18
18
|
className
|
|
19
19
|
)}
|
|
20
20
|
{...$$restProps}
|
|
@@ -9,7 +9,7 @@ export { className as class };
|
|
|
9
9
|
<MenubarPrimitive.CheckboxItem
|
|
10
10
|
bind:checked
|
|
11
11
|
class={cn(
|
|
12
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[
|
|
12
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50",
|
|
13
13
|
className
|
|
14
14
|
)}
|
|
15
15
|
on:click
|
|
@@ -7,7 +7,7 @@ export { className as class };
|
|
|
7
7
|
|
|
8
8
|
<MenubarPrimitive.Item
|
|
9
9
|
class={cn(
|
|
10
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[
|
|
10
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50",
|
|
11
11
|
inset && "pl-8",
|
|
12
12
|
className
|
|
13
13
|
)}
|