@kayord/ui 0.20.0 → 1.0.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/accordion/accordion-content.svelte +2 -5
- package/dist/components/ui/accordion/accordion.svelte +7 -0
- package/dist/components/ui/accordion/accordion.svelte.d.ts +4 -0
- package/dist/components/ui/accordion/index.d.ts +1 -1
- package/dist/components/ui/accordion/index.js +1 -1
- package/dist/components/ui/calendar/calendar-caption.svelte +76 -0
- package/dist/components/ui/calendar/calendar-caption.svelte.d.ts +19 -0
- package/dist/components/ui/calendar/calendar-cell.svelte +1 -1
- package/dist/components/ui/calendar/calendar-day.svelte +13 -8
- package/dist/components/ui/calendar/calendar-grid.svelte +5 -1
- 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-heading.svelte +1 -1
- package/dist/components/ui/calendar/calendar-month-select.svelte +42 -0
- package/dist/components/ui/calendar/calendar-month-select.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar-month.svelte +15 -0
- package/dist/components/ui/calendar/calendar-month.svelte.d.ts +5 -0
- package/dist/components/ui/calendar/calendar-months.svelte +1 -5
- package/dist/components/ui/calendar/calendar-nav.svelte +19 -0
- package/dist/components/ui/calendar/calendar-nav.svelte.d.ts +5 -0
- package/dist/components/ui/calendar/calendar-next-button.svelte +12 -4
- package/dist/components/ui/calendar/calendar-next-button.svelte.d.ts +5 -1
- package/dist/components/ui/calendar/calendar-prev-button.svelte +12 -4
- package/dist/components/ui/calendar/calendar-prev-button.svelte.d.ts +5 -1
- package/dist/components/ui/calendar/calendar-year-select.svelte +41 -0
- package/dist/components/ui/calendar/calendar-year-select.svelte.d.ts +4 -0
- package/dist/components/ui/calendar/calendar.svelte +82 -28
- package/dist/components/ui/calendar/calendar.svelte.d.ts +16 -1
- package/dist/components/ui/calendar/index.d.ts +6 -1
- package/dist/components/ui/calendar/index.js +6 -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/carousel/carousel.svelte +10 -17
- package/dist/components/ui/carousel/context.d.ts +1 -2
- package/dist/components/ui/chart/chart-container.svelte +1 -2
- package/dist/components/ui/collapsible/collapsible.svelte +1 -1
- package/dist/components/ui/collapsible/index.d.ts +3 -15
- package/dist/components/ui/collapsible/index.js +3 -4
- package/dist/components/ui/dialog/dialog-content.svelte +10 -6
- package/dist/components/ui/dialog/dialog-content.svelte.d.ts +1 -0
- package/dist/components/ui/drawer/drawer-content.svelte +1 -1
- package/dist/components/ui/drawer/drawer-footer.svelte +1 -1
- package/dist/components/ui/drawer/drawer-header.svelte +1 -1
- package/dist/components/ui/input/input.svelte +1 -1
- package/dist/components/ui/pagination/pagination-link.svelte +1 -1
- package/dist/components/ui/radio-group/radio-group-item.svelte +1 -1
- package/dist/components/ui/range-calendar/index.d.ts +6 -1
- package/dist/components/ui/range-calendar/index.js +6 -1
- package/dist/components/ui/range-calendar/range-calendar-caption.svelte +76 -0
- package/dist/components/ui/range-calendar/range-calendar-caption.svelte.d.ts +19 -0
- package/dist/components/ui/range-calendar/range-calendar-cell.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-day.svelte +16 -11
- package/dist/components/ui/range-calendar/range-calendar-day.svelte.d.ts +1 -3
- package/dist/components/ui/range-calendar/range-calendar-grid.svelte +5 -1
- 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-heading.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-month-select.svelte +42 -0
- package/dist/components/ui/range-calendar/range-calendar-month-select.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/range-calendar-month.svelte +15 -0
- package/dist/components/ui/range-calendar/range-calendar-month.svelte.d.ts +5 -0
- package/dist/components/ui/range-calendar/range-calendar-months.svelte +2 -6
- package/dist/components/ui/range-calendar/range-calendar-months.svelte.d.ts +1 -1
- package/dist/components/ui/range-calendar/range-calendar-nav.svelte +19 -0
- package/dist/components/ui/range-calendar/range-calendar-nav.svelte.d.ts +5 -0
- package/dist/components/ui/range-calendar/range-calendar-next-button.svelte +7 -4
- package/dist/components/ui/range-calendar/range-calendar-next-button.svelte.d.ts +5 -1
- package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte +7 -4
- package/dist/components/ui/range-calendar/range-calendar-prev-button.svelte.d.ts +5 -1
- package/dist/components/ui/range-calendar/range-calendar-year-select.svelte +41 -0
- package/dist/components/ui/range-calendar/range-calendar-year-select.svelte.d.ts +4 -0
- package/dist/components/ui/range-calendar/range-calendar.svelte +83 -28
- package/dist/components/ui/range-calendar/range-calendar.svelte.d.ts +17 -1
- package/dist/components/ui/select/index.d.ts +2 -1
- package/dist/components/ui/select/index.js +3 -2
- package/dist/components/ui/select/select-group-heading.svelte +15 -2
- package/dist/components/ui/select/select-group-heading.svelte.d.ts +8 -2
- package/dist/components/ui/select/select-trigger.svelte +1 -1
- package/dist/components/ui/separator/separator.svelte +1 -1
- package/dist/components/ui/sheet/sheet-overlay.svelte +0 -2
- package/dist/components/ui/sheet/sheet-overlay.svelte.d.ts +1 -3
- package/dist/hooks/is-mobile.svelte.d.ts +1 -1
- package/dist/hooks/is-mobile.svelte.js +3 -3
- package/package.json +15 -15
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
3
|
import ChevronRightIcon from "@lucide/svelte/icons/chevron-right";
|
|
4
|
-
import { buttonVariants } from "../button/index.js";
|
|
4
|
+
import { buttonVariants, type ButtonVariant } from "../button/index.js";
|
|
5
5
|
import { cn } from "../../../utils.js";
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
ref = $bindable(null),
|
|
9
9
|
class: className,
|
|
10
10
|
children,
|
|
11
|
+
variant = "ghost",
|
|
11
12
|
...restProps
|
|
12
|
-
}: RangeCalendarPrimitive.NextButtonProps
|
|
13
|
+
}: RangeCalendarPrimitive.NextButtonProps & {
|
|
14
|
+
variant?: ButtonVariant;
|
|
15
|
+
} = $props();
|
|
13
16
|
</script>
|
|
14
17
|
|
|
15
18
|
{#snippet Fallback()}
|
|
@@ -19,8 +22,8 @@
|
|
|
19
22
|
<RangeCalendarPrimitive.NextButton
|
|
20
23
|
bind:ref
|
|
21
24
|
class={cn(
|
|
22
|
-
buttonVariants({ variant
|
|
23
|
-
"size-
|
|
25
|
+
buttonVariants({ variant }),
|
|
26
|
+
"size-(--cell-size) bg-transparent p-0 select-none disabled:opacity-50 rtl:rotate-180",
|
|
24
27
|
className
|
|
25
28
|
)}
|
|
26
29
|
children={children || Fallback}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
2
|
-
|
|
2
|
+
import { type ButtonVariant } from "../button/index.js";
|
|
3
|
+
type $$ComponentProps = RangeCalendarPrimitive.NextButtonProps & {
|
|
4
|
+
variant?: ButtonVariant;
|
|
5
|
+
};
|
|
6
|
+
declare const RangeCalendarNextButton: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
3
7
|
type RangeCalendarNextButton = ReturnType<typeof RangeCalendarNextButton>;
|
|
4
8
|
export default RangeCalendarNextButton;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
3
|
import ChevronLeftIcon from "@lucide/svelte/icons/chevron-left";
|
|
4
|
-
import { buttonVariants } from "../button/index.js";
|
|
4
|
+
import { buttonVariants, type ButtonVariant } from "../button/index.js";
|
|
5
5
|
import { cn } from "../../../utils.js";
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
8
|
ref = $bindable(null),
|
|
9
9
|
class: className,
|
|
10
10
|
children,
|
|
11
|
+
variant = "ghost",
|
|
11
12
|
...restProps
|
|
12
|
-
}: RangeCalendarPrimitive.PrevButtonProps
|
|
13
|
+
}: RangeCalendarPrimitive.PrevButtonProps & {
|
|
14
|
+
variant?: ButtonVariant;
|
|
15
|
+
} = $props();
|
|
13
16
|
</script>
|
|
14
17
|
|
|
15
18
|
{#snippet Fallback()}
|
|
@@ -19,8 +22,8 @@
|
|
|
19
22
|
<RangeCalendarPrimitive.PrevButton
|
|
20
23
|
bind:ref
|
|
21
24
|
class={cn(
|
|
22
|
-
buttonVariants({ variant
|
|
23
|
-
"size-
|
|
25
|
+
buttonVariants({ variant }),
|
|
26
|
+
"size-(--cell-size) bg-transparent p-0 select-none disabled:opacity-50 rtl:rotate-180",
|
|
24
27
|
className
|
|
25
28
|
)}
|
|
26
29
|
children={children || Fallback}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
2
|
-
|
|
2
|
+
import { type ButtonVariant } from "../button/index.js";
|
|
3
|
+
type $$ComponentProps = RangeCalendarPrimitive.PrevButtonProps & {
|
|
4
|
+
variant?: ButtonVariant;
|
|
5
|
+
};
|
|
6
|
+
declare const RangeCalendarPrevButton: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
3
7
|
type RangeCalendarPrevButton = ReturnType<typeof RangeCalendarPrevButton>;
|
|
4
8
|
export default RangeCalendarPrevButton;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
|
+
import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
|
|
4
|
+
import ChevronDownIcon from "@lucide/svelte/icons/chevron-down";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
value,
|
|
10
|
+
...restProps
|
|
11
|
+
}: WithoutChildrenOrChild<RangeCalendarPrimitive.YearSelectProps> = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<span
|
|
15
|
+
class={cn(
|
|
16
|
+
"has-focus:border-ring border-input has-focus:ring-ring/50 relative flex rounded-md border shadow-xs has-focus:ring-[3px]",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
>
|
|
20
|
+
<RangeCalendarPrimitive.YearSelect bind:ref class="absolute inset-0 opacity-0" {...restProps}>
|
|
21
|
+
{#snippet child({ props, yearItems, selectedYearItem })}
|
|
22
|
+
<select {...props} {value}>
|
|
23
|
+
{#each yearItems as yearItem (yearItem.value)}
|
|
24
|
+
<option
|
|
25
|
+
value={yearItem.value}
|
|
26
|
+
selected={value !== undefined ? yearItem.value === value : yearItem.value === selectedYearItem.value}
|
|
27
|
+
>
|
|
28
|
+
{yearItem.label}
|
|
29
|
+
</option>
|
|
30
|
+
{/each}
|
|
31
|
+
</select>
|
|
32
|
+
<span
|
|
33
|
+
class="[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm font-medium select-none [&>svg]:size-3.5"
|
|
34
|
+
aria-hidden="true"
|
|
35
|
+
>
|
|
36
|
+
{yearItems.find((item) => item.value === value)?.label || selectedYearItem.label}
|
|
37
|
+
<ChevronDownIcon class="size-4" />
|
|
38
|
+
</span>
|
|
39
|
+
{/snippet}
|
|
40
|
+
</RangeCalendarPrimitive.YearSelect>
|
|
41
|
+
</span>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
2
|
+
declare const RangeCalendarYearSelect: import("svelte").Component<Omit<Omit<RangeCalendarPrimitive.YearSelectProps, "child">, "children">, {}, "ref">;
|
|
3
|
+
type RangeCalendarYearSelect = ReturnType<typeof RangeCalendarYearSelect>;
|
|
4
|
+
export default RangeCalendarYearSelect;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
3
3
|
import * as RangeCalendar from "./index.js";
|
|
4
4
|
import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
|
|
5
|
+
import type { ButtonVariant } from "../button/index.js";
|
|
6
|
+
import type { Snippet } from "svelte";
|
|
7
|
+
import { isEqualMonth, type DateValue } from "@internationalized/date";
|
|
5
8
|
|
|
6
9
|
let {
|
|
7
10
|
ref = $bindable(null),
|
|
@@ -9,8 +12,31 @@
|
|
|
9
12
|
placeholder = $bindable(),
|
|
10
13
|
weekdayFormat = "short",
|
|
11
14
|
class: className,
|
|
15
|
+
buttonVariant = "ghost",
|
|
16
|
+
captionLayout = "label",
|
|
17
|
+
locale = "en-US",
|
|
18
|
+
months: monthsProp,
|
|
19
|
+
years,
|
|
20
|
+
monthFormat: monthFormatProp,
|
|
21
|
+
yearFormat = "numeric",
|
|
22
|
+
day,
|
|
23
|
+
disableDaysOutsideMonth = false,
|
|
12
24
|
...restProps
|
|
13
|
-
}: WithoutChildrenOrChild<RangeCalendarPrimitive.RootProps>
|
|
25
|
+
}: WithoutChildrenOrChild<RangeCalendarPrimitive.RootProps> & {
|
|
26
|
+
buttonVariant?: ButtonVariant;
|
|
27
|
+
captionLayout?: "dropdown" | "dropdown-months" | "dropdown-years" | "label";
|
|
28
|
+
months?: RangeCalendarPrimitive.MonthSelectProps["months"];
|
|
29
|
+
years?: RangeCalendarPrimitive.YearSelectProps["years"];
|
|
30
|
+
monthFormat?: RangeCalendarPrimitive.MonthSelectProps["monthFormat"];
|
|
31
|
+
yearFormat?: RangeCalendarPrimitive.YearSelectProps["yearFormat"];
|
|
32
|
+
day?: Snippet<[{ day: DateValue; outsideMonth: boolean }]>;
|
|
33
|
+
} = $props();
|
|
34
|
+
|
|
35
|
+
const monthFormat = $derived.by(() => {
|
|
36
|
+
if (monthFormatProp) return monthFormatProp;
|
|
37
|
+
if (captionLayout.startsWith("dropdown")) return "short";
|
|
38
|
+
return "long";
|
|
39
|
+
});
|
|
14
40
|
</script>
|
|
15
41
|
|
|
16
42
|
<RangeCalendarPrimitive.Root
|
|
@@ -18,39 +44,68 @@
|
|
|
18
44
|
bind:value
|
|
19
45
|
bind:placeholder
|
|
20
46
|
{weekdayFormat}
|
|
21
|
-
|
|
47
|
+
{disableDaysOutsideMonth}
|
|
48
|
+
class={cn(
|
|
49
|
+
"bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
50
|
+
className
|
|
51
|
+
)}
|
|
52
|
+
{locale}
|
|
53
|
+
{monthFormat}
|
|
54
|
+
{yearFormat}
|
|
22
55
|
{...restProps}
|
|
23
56
|
>
|
|
24
57
|
{#snippet children({ months, weekdays })}
|
|
25
|
-
<RangeCalendar.Header>
|
|
26
|
-
<RangeCalendar.PrevButton />
|
|
27
|
-
<RangeCalendar.Heading />
|
|
28
|
-
<RangeCalendar.NextButton />
|
|
29
|
-
</RangeCalendar.Header>
|
|
30
58
|
<RangeCalendar.Months>
|
|
31
|
-
|
|
32
|
-
<RangeCalendar.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
59
|
+
<RangeCalendar.Nav>
|
|
60
|
+
<RangeCalendar.PrevButton variant={buttonVariant} />
|
|
61
|
+
<RangeCalendar.NextButton variant={buttonVariant} />
|
|
62
|
+
</RangeCalendar.Nav>
|
|
63
|
+
{#each months as month, monthIndex (month)}
|
|
64
|
+
<RangeCalendar.Month>
|
|
65
|
+
<RangeCalendar.Header>
|
|
66
|
+
<RangeCalendar.Caption
|
|
67
|
+
{captionLayout}
|
|
68
|
+
months={monthsProp}
|
|
69
|
+
{monthFormat}
|
|
70
|
+
{years}
|
|
71
|
+
{yearFormat}
|
|
72
|
+
month={month.value}
|
|
73
|
+
bind:placeholder
|
|
74
|
+
{locale}
|
|
75
|
+
{monthIndex}
|
|
76
|
+
/>
|
|
77
|
+
</RangeCalendar.Header>
|
|
78
|
+
|
|
79
|
+
<RangeCalendar.Grid>
|
|
80
|
+
<RangeCalendar.GridHead>
|
|
81
|
+
<RangeCalendar.GridRow class="select-none">
|
|
82
|
+
{#each weekdays as weekday (weekday)}
|
|
83
|
+
<RangeCalendar.HeadCell>
|
|
84
|
+
{weekday.slice(0, 2)}
|
|
85
|
+
</RangeCalendar.HeadCell>
|
|
49
86
|
{/each}
|
|
50
87
|
</RangeCalendar.GridRow>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
88
|
+
</RangeCalendar.GridHead>
|
|
89
|
+
<RangeCalendar.GridBody>
|
|
90
|
+
{#each month.weeks as weekDates (weekDates)}
|
|
91
|
+
<RangeCalendar.GridRow class="mt-2 w-full">
|
|
92
|
+
{#each weekDates as date (date)}
|
|
93
|
+
<RangeCalendar.Cell {date} month={month.value}>
|
|
94
|
+
{#if day}
|
|
95
|
+
{@render day({
|
|
96
|
+
day: date,
|
|
97
|
+
outsideMonth: !isEqualMonth(date, month.value),
|
|
98
|
+
})}
|
|
99
|
+
{:else}
|
|
100
|
+
<RangeCalendar.Day />
|
|
101
|
+
{/if}
|
|
102
|
+
</RangeCalendar.Cell>
|
|
103
|
+
{/each}
|
|
104
|
+
</RangeCalendar.GridRow>
|
|
105
|
+
{/each}
|
|
106
|
+
</RangeCalendar.GridBody>
|
|
107
|
+
</RangeCalendar.Grid>
|
|
108
|
+
</RangeCalendar.Month>
|
|
54
109
|
{/each}
|
|
55
110
|
</RangeCalendar.Months>
|
|
56
111
|
{/snippet}
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { RangeCalendar as RangeCalendarPrimitive } from "bits-ui";
|
|
2
2
|
import * as RangeCalendar from "./index.js";
|
|
3
|
-
|
|
3
|
+
import { type WithoutChildrenOrChild } from "../../../utils.js";
|
|
4
|
+
import type { ButtonVariant } from "../button/index.js";
|
|
5
|
+
import type { Snippet } from "svelte";
|
|
6
|
+
import { type DateValue } from "@internationalized/date";
|
|
7
|
+
type $$ComponentProps = WithoutChildrenOrChild<RangeCalendarPrimitive.RootProps> & {
|
|
8
|
+
buttonVariant?: ButtonVariant;
|
|
9
|
+
captionLayout?: "dropdown" | "dropdown-months" | "dropdown-years" | "label";
|
|
10
|
+
months?: RangeCalendarPrimitive.MonthSelectProps["months"];
|
|
11
|
+
years?: RangeCalendarPrimitive.YearSelectProps["years"];
|
|
12
|
+
monthFormat?: RangeCalendarPrimitive.MonthSelectProps["monthFormat"];
|
|
13
|
+
yearFormat?: RangeCalendarPrimitive.YearSelectProps["yearFormat"];
|
|
14
|
+
day?: Snippet<[{
|
|
15
|
+
day: DateValue;
|
|
16
|
+
outsideMonth: boolean;
|
|
17
|
+
}]>;
|
|
18
|
+
};
|
|
19
|
+
declare const RangeCalendar: import("svelte").Component<$$ComponentProps, {}, "value" | "placeholder" | "ref">;
|
|
4
20
|
type RangeCalendar = ReturnType<typeof RangeCalendar>;
|
|
5
21
|
export default RangeCalendar;
|
|
@@ -6,5 +6,6 @@ import Trigger from "./select-trigger.svelte";
|
|
|
6
6
|
import Separator from "./select-separator.svelte";
|
|
7
7
|
import ScrollDownButton from "./select-scroll-down-button.svelte";
|
|
8
8
|
import ScrollUpButton from "./select-scroll-up-button.svelte";
|
|
9
|
+
import GroupHeading from "./select-group-heading.svelte";
|
|
9
10
|
declare const Root: import("svelte").Component<import("bits-ui").SelectRootPropsWithoutHTML, {}, "value" | "open">;
|
|
10
|
-
export { Root, Group, Label, Item, Content, Trigger, Separator, ScrollDownButton, ScrollUpButton, Root as Select, Group as SelectGroup, Label as SelectLabel, Item as SelectItem, Content as SelectContent, Trigger as SelectTrigger, Separator as SelectSeparator, ScrollDownButton as SelectScrollDownButton, ScrollUpButton as SelectScrollUpButton, };
|
|
11
|
+
export { Root, Group, Label, Item, Content, Trigger, Separator, ScrollDownButton, ScrollUpButton, GroupHeading, Root as Select, Group as SelectGroup, Label as SelectLabel, Item as SelectItem, Content as SelectContent, Trigger as SelectTrigger, Separator as SelectSeparator, ScrollDownButton as SelectScrollDownButton, ScrollUpButton as SelectScrollUpButton, GroupHeading as SelectGroupHeading, };
|
|
@@ -7,7 +7,8 @@ import Trigger from "./select-trigger.svelte";
|
|
|
7
7
|
import Separator from "./select-separator.svelte";
|
|
8
8
|
import ScrollDownButton from "./select-scroll-down-button.svelte";
|
|
9
9
|
import ScrollUpButton from "./select-scroll-up-button.svelte";
|
|
10
|
+
import GroupHeading from "./select-group-heading.svelte";
|
|
10
11
|
const Root = SelectPrimitive.Root;
|
|
11
|
-
export { Root, Group, Label, Item, Content, Trigger, Separator, ScrollDownButton, ScrollUpButton,
|
|
12
|
+
export { Root, Group, Label, Item, Content, Trigger, Separator, ScrollDownButton, ScrollUpButton, GroupHeading,
|
|
12
13
|
//
|
|
13
|
-
Root as Select, Group as SelectGroup, Label as SelectLabel, Item as SelectItem, Content as SelectContent, Trigger as SelectTrigger, Separator as SelectSeparator, ScrollDownButton as SelectScrollDownButton, ScrollUpButton as SelectScrollUpButton, };
|
|
14
|
+
Root as Select, Group as SelectGroup, Label as SelectLabel, Item as SelectItem, Content as SelectContent, Trigger as SelectTrigger, Separator as SelectSeparator, ScrollDownButton as SelectScrollDownButton, ScrollUpButton as SelectScrollUpButton, GroupHeading as SelectGroupHeading, };
|
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Select as SelectPrimitive } from "bits-ui";
|
|
3
3
|
import { cn } from "../../../utils.js";
|
|
4
|
+
import type { ComponentProps } from "svelte";
|
|
4
5
|
|
|
5
|
-
let {
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
children,
|
|
10
|
+
...restProps
|
|
11
|
+
}: ComponentProps<typeof SelectPrimitive.GroupHeading> = $props();
|
|
6
12
|
</script>
|
|
7
13
|
|
|
8
|
-
<SelectPrimitive.GroupHeading
|
|
14
|
+
<SelectPrimitive.GroupHeading
|
|
15
|
+
bind:ref
|
|
16
|
+
data-slot="select-group-heading"
|
|
17
|
+
class={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
>
|
|
20
|
+
{@render children?.()}
|
|
21
|
+
</SelectPrimitive.GroupHeading>
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const SelectGroupHeading: import("svelte").Component<Omit<{}, "child" | "children"> & {
|
|
2
|
+
child?: import("svelte").Snippet<[{
|
|
3
|
+
props: Record<string, unknown>;
|
|
4
|
+
}]> | undefined;
|
|
5
|
+
children?: import("svelte").Snippet<[]> | undefined;
|
|
6
|
+
style?: import("bits-ui").StyleProperties | string | null | undefined;
|
|
7
|
+
ref?: HTMLElement | null | undefined;
|
|
8
|
+
} & import("bits-ui").Without<import("bits-ui").BitsPrimitiveDivAttributes, import("bits-ui").ComboboxGroupHeadingPropsWithoutHTML>, {}, "ref">;
|
|
3
9
|
type SelectGroupHeading = ReturnType<typeof SelectGroupHeading>;
|
|
4
10
|
export default SelectGroupHeading;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
data-slot="select-trigger"
|
|
20
20
|
data-size={size}
|
|
21
21
|
class={cn(
|
|
22
|
-
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground 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:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
22
|
+
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground 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:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none select-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
23
23
|
className
|
|
24
24
|
)}
|
|
25
25
|
{...restProps}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<SeparatorPrimitive.Root
|
|
9
9
|
bind:ref
|
|
10
|
-
data-slot="separator
|
|
10
|
+
data-slot="separator"
|
|
11
11
|
class={cn(
|
|
12
12
|
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
13
13
|
className
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { Dialog as SheetPrimitive } from "bits-ui";
|
|
2
|
-
declare const SheetOverlay: import("svelte").Component<SheetPrimitive.OverlayProps, {
|
|
3
|
-
class: import("svelte/elements").ClassValue | null | undefined;
|
|
4
|
-
}, "ref">;
|
|
2
|
+
declare const SheetOverlay: import("svelte").Component<SheetPrimitive.OverlayProps, {}, "ref">;
|
|
5
3
|
type SheetOverlay = ReturnType<typeof SheetOverlay>;
|
|
6
4
|
export default SheetOverlay;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MediaQuery } from "svelte/reactivity";
|
|
2
|
-
const
|
|
2
|
+
const DEFAULT_MOBILE_BREAKPOINT = 768;
|
|
3
3
|
export class IsMobile extends MediaQuery {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(`max-width: ${
|
|
4
|
+
constructor(breakpoint = DEFAULT_MOBILE_BREAKPOINT) {
|
|
5
|
+
super(`max-width: ${breakpoint - 1}px`);
|
|
6
6
|
}
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kayord/ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"zod": "^3.23.8"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@internationalized/date": "^3.8.
|
|
38
|
-
"bits-ui": "2.
|
|
37
|
+
"@internationalized/date": "^3.8.2",
|
|
38
|
+
"bits-ui": "2.5.0",
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"embla-carousel-svelte": "8.6.0",
|
|
41
41
|
"formsnap": "2.0.1",
|
|
@@ -47,38 +47,39 @@
|
|
|
47
47
|
"vaul-svelte": "1.0.0-next.7"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@lucide/svelte": "^0.
|
|
50
|
+
"@lucide/svelte": "^0.513.0",
|
|
51
51
|
"@sveltejs/adapter-auto": "^6.0.1",
|
|
52
|
-
"@sveltejs/kit": "^2.21.
|
|
52
|
+
"@sveltejs/kit": "^2.21.3",
|
|
53
53
|
"@sveltejs/package": "^2.3.11",
|
|
54
|
-
"@sveltejs/vite-plugin-svelte": "^5.0
|
|
54
|
+
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
|
55
55
|
"@tailwindcss/vite": "^4.1.8",
|
|
56
56
|
"@testing-library/jest-dom": "^6.6.3",
|
|
57
57
|
"@testing-library/svelte": "^5.2.8",
|
|
58
|
+
"@testing-library/user-event": "^14.6.1",
|
|
58
59
|
"@types/d3-scale": "^4.0.9",
|
|
59
60
|
"@types/d3-shape": "^3.1.7",
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^8.33.
|
|
61
|
-
"@typescript-eslint/parser": "^8.33.
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^8.33.1",
|
|
62
|
+
"@typescript-eslint/parser": "^8.33.1",
|
|
62
63
|
"d3-scale": "^4.0.2",
|
|
63
64
|
"d3-shape": "^3.2.0",
|
|
64
65
|
"eslint": "^9.28.0",
|
|
65
66
|
"eslint-config-prettier": "^10.1.5",
|
|
66
67
|
"eslint-plugin-svelte": "^3.9.1",
|
|
67
|
-
"happy-dom": "^17.
|
|
68
|
+
"happy-dom": "^17.6.3",
|
|
68
69
|
"layerchart": "2.0.0-next.6",
|
|
69
70
|
"prettier": "^3.5.3",
|
|
70
71
|
"prettier-plugin-svelte": "^3.4.0",
|
|
71
72
|
"prettier-plugin-tailwindcss": "^0.6.12",
|
|
72
73
|
"publint": "^0.3.12",
|
|
73
|
-
"svelte": "5.33.
|
|
74
|
+
"svelte": "5.33.18",
|
|
74
75
|
"svelte-check": "^4.2.1",
|
|
75
76
|
"tailwindcss": "^4.1.8",
|
|
76
77
|
"tslib": "^2.8.1",
|
|
77
|
-
"tw-animate-css": "1.3.
|
|
78
|
+
"tw-animate-css": "1.3.4",
|
|
78
79
|
"typescript": "^5.8.3",
|
|
79
80
|
"vite": "^6.3.5",
|
|
80
|
-
"vitest": "^3.
|
|
81
|
-
"zod": "^3.25.
|
|
81
|
+
"vitest": "^3.2.3",
|
|
82
|
+
"zod": "^3.25.56"
|
|
82
83
|
},
|
|
83
84
|
"svelte": "./dist/index.js",
|
|
84
85
|
"types": "./dist/index.d.ts",
|
|
@@ -95,8 +96,7 @@
|
|
|
95
96
|
"lint": "prettier --check . && eslint .",
|
|
96
97
|
"format": "prettier --write .",
|
|
97
98
|
"test:unit": "vitest",
|
|
98
|
-
"lib": "pnpm dlx shadcn-svelte@
|
|
99
|
-
"libOld": "pnpm dlx shadcn-svelte@next add -a -y -o --no-deps && pnpm format && pnpm version --no-git-tag-version patch && ./tw.sh",
|
|
99
|
+
"lib": "pnpm dlx shadcn-svelte@latest add -a -y -o --no-deps && pnpm format && pnpm version --no-git-tag-version patch",
|
|
100
100
|
"next": "./next.sh"
|
|
101
101
|
}
|
|
102
102
|
}
|