@vertz/ui-primitives 0.2.15 → 0.2.17
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/shared/chunk-0mcr52hc.js +78 -0
- package/dist/shared/chunk-18y8gfk0.js +308 -0
- package/dist/shared/chunk-34yfm2b0.js +182 -0
- package/dist/shared/chunk-4085nbdq.js +196 -0
- package/dist/shared/chunk-4da5zksy.js +46 -0
- package/dist/shared/chunk-7ffg0caj.js +265 -0
- package/dist/shared/chunk-7kpsyjd7.js +61 -0
- package/dist/shared/chunk-7krvqrwq.js +177 -0
- package/dist/shared/chunk-8ak7vdk1.js +151 -0
- package/dist/shared/chunk-8nk0ya7a.js +163 -0
- package/dist/shared/chunk-8tvzqry6.js +218 -0
- package/dist/shared/chunk-8y1jf6xr.js +17 -0
- package/dist/shared/chunk-96d9nr7y.js +19 -0
- package/dist/shared/chunk-9hj9p7s2.js +95 -0
- package/dist/shared/chunk-a6wp8c32.js +32 -0
- package/dist/shared/chunk-avxcmmk6.js +178 -0
- package/dist/shared/chunk-bew4bjgf.js +165 -0
- package/dist/shared/chunk-dpsgb1xw.js +18 -0
- package/dist/shared/chunk-e2v1c9ex.js +62 -0
- package/dist/shared/chunk-g9qvd20g.js +133 -0
- package/dist/shared/chunk-gkddsbmh.js +73 -0
- package/dist/shared/chunk-gt0wth9h.js +128 -0
- package/dist/shared/chunk-hr9hx58m.js +71 -0
- package/dist/shared/chunk-j4cm8avr.js +175 -0
- package/dist/shared/chunk-jctqs9m4.js +60 -0
- package/dist/shared/chunk-jz0s6srh.js +161 -0
- package/dist/shared/chunk-kg27s15c.js +282 -0
- package/dist/shared/chunk-m1ptgp1s.js +142 -0
- package/dist/shared/chunk-n9nwx58j.js +60 -0
- package/dist/shared/chunk-ppcv3ehd.js +85 -0
- package/dist/shared/chunk-rnjm61t0.js +34 -0
- package/dist/shared/chunk-sqs8kyb2.js +288 -0
- package/dist/shared/chunk-t1vkvsz2.js +175 -0
- package/dist/shared/chunk-tfyg0qrp.js +117 -0
- package/dist/shared/chunk-ttsyf6ma.js +239 -0
- package/dist/shared/chunk-vvjyx7fe.js +62 -0
- package/dist/shared/chunk-x0we8gcy.js +219 -0
- package/dist/shared/chunk-x2hz98qn.js +108 -0
- package/dist/shared/chunk-yr9yzpvq.js +107 -0
- package/dist/src/accordion/accordion.d.ts +35 -0
- package/dist/src/accordion/accordion.js +10 -0
- package/dist/src/alert-dialog/alert-dialog.d.ts +26 -0
- package/dist/src/alert-dialog/alert-dialog.js +9 -0
- package/dist/src/badge/badge.d.ts +22 -0
- package/dist/src/badge/badge.js +8 -0
- package/dist/src/button/button.d.ts +20 -0
- package/dist/src/button/button.js +8 -0
- package/dist/src/calendar/calendar.d.ts +52 -0
- package/dist/src/calendar/calendar.js +7 -0
- package/dist/src/carousel/carousel.d.ts +39 -0
- package/dist/src/carousel/carousel.js +9 -0
- package/dist/src/checkbox/checkbox.d.ts +22 -0
- package/dist/src/checkbox/checkbox.js +9 -0
- package/dist/src/collapsible/collapsible.d.ts +33 -0
- package/dist/src/collapsible/collapsible.js +9 -0
- package/dist/src/combobox/combobox.d.ts +35 -0
- package/dist/src/combobox/combobox.js +10 -0
- package/dist/src/command/command.d.ts +41 -0
- package/dist/src/command/command.js +10 -0
- package/dist/src/context-menu/context-menu.d.ts +51 -0
- package/dist/src/context-menu/context-menu.js +12 -0
- package/dist/src/date-picker/date-picker.d.ts +47 -0
- package/dist/src/date-picker/date-picker.js +15 -0
- package/dist/src/dialog/dialog.d.ts +36 -0
- package/dist/src/dialog/dialog.js +11 -0
- package/dist/src/dropdown-menu/dropdown-menu.d.ts +54 -0
- package/dist/src/dropdown-menu/dropdown-menu.js +13 -0
- package/dist/src/hover-card/hover-card.d.ts +45 -0
- package/dist/src/hover-card/hover-card.js +11 -0
- package/dist/{index.d.ts → src/index.d.ts} +132 -140
- package/dist/src/index.js +137 -0
- package/dist/src/menu/menu.d.ts +51 -0
- package/dist/src/menu/menu.js +12 -0
- package/dist/src/menubar/menubar.d.ts +52 -0
- package/dist/src/menubar/menubar.js +13 -0
- package/dist/src/navigation-menu/navigation-menu.d.ts +37 -0
- package/dist/src/navigation-menu/navigation-menu.js +11 -0
- package/dist/src/popover/popover.d.ts +44 -0
- package/dist/src/popover/popover.js +13 -0
- package/dist/src/progress/progress.d.ts +32 -0
- package/dist/src/progress/progress.js +9 -0
- package/dist/src/radio/radio.d.ts +30 -0
- package/dist/src/radio/radio.js +11 -0
- package/dist/src/resizable-panel/resizable-panel.d.ts +36 -0
- package/dist/src/resizable-panel/resizable-panel.js +9 -0
- package/dist/src/scroll-area/scroll-area.d.ts +37 -0
- package/dist/src/scroll-area/scroll-area.js +7 -0
- package/dist/src/select/select.d.ts +53 -0
- package/dist/src/select/select.js +12 -0
- package/dist/src/sheet/sheet.d.ts +24 -0
- package/dist/src/sheet/sheet.js +10 -0
- package/dist/src/slider/slider.d.ts +36 -0
- package/dist/src/slider/slider.js +10 -0
- package/dist/src/switch/switch.d.ts +21 -0
- package/dist/src/switch/switch.js +9 -0
- package/dist/src/tabs/tabs.d.ts +35 -0
- package/dist/src/tabs/tabs.js +11 -0
- package/dist/src/toast/toast.d.ts +36 -0
- package/dist/src/toast/toast.js +9 -0
- package/dist/src/toggle/toggle.d.ts +21 -0
- package/dist/src/toggle/toggle.js +9 -0
- package/dist/src/toggle-group/toggle-group.d.ts +34 -0
- package/dist/src/toggle-group/toggle-group.js +10 -0
- package/dist/src/tooltip/tooltip.d.ts +44 -0
- package/dist/src/tooltip/tooltip.js +11 -0
- package/dist/src/utils.d.ts +176 -0
- package/dist/src/utils.js +72 -0
- package/package.json +12 -10
- package/dist/index.js +0 -3675
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
setRovingTabindex
|
|
3
|
+
} from "./chunk-e2v1c9ex.js";
|
|
4
|
+
import {
|
|
5
|
+
handleListNavigation
|
|
6
|
+
} from "./chunk-jctqs9m4.js";
|
|
7
|
+
import {
|
|
8
|
+
setChecked,
|
|
9
|
+
setDataState
|
|
10
|
+
} from "./chunk-vvjyx7fe.js";
|
|
11
|
+
import {
|
|
12
|
+
applyAttrs
|
|
13
|
+
} from "./chunk-dpsgb1xw.js";
|
|
14
|
+
import {
|
|
15
|
+
uniqueId
|
|
16
|
+
} from "./chunk-8y1jf6xr.js";
|
|
17
|
+
|
|
18
|
+
// src/radio/radio.tsx
|
|
19
|
+
import { __element, __enterChildren, __exitChildren, __insert, __on } from "@vertz/ui/internals";
|
|
20
|
+
import { signal } from "@vertz/ui";
|
|
21
|
+
function RadioRoot(options = {}) {
|
|
22
|
+
const { defaultValue = "", onValueChange, ...attrs } = options;
|
|
23
|
+
const state = { value: signal(defaultValue) };
|
|
24
|
+
const items = [];
|
|
25
|
+
const itemValues = [];
|
|
26
|
+
function selectItem(value) {
|
|
27
|
+
state.value.value = value;
|
|
28
|
+
for (let i = 0;i < items.length; i++) {
|
|
29
|
+
const item = items[i];
|
|
30
|
+
if (!item)
|
|
31
|
+
continue;
|
|
32
|
+
const isActive = itemValues[i] === value;
|
|
33
|
+
setChecked(item, isActive);
|
|
34
|
+
setDataState(item, isActive ? "checked" : "unchecked");
|
|
35
|
+
}
|
|
36
|
+
setRovingTabindex(items, itemValues.indexOf(value));
|
|
37
|
+
onValueChange?.(value);
|
|
38
|
+
}
|
|
39
|
+
const root = (() => {
|
|
40
|
+
const __el0 = __element("div");
|
|
41
|
+
__el0.setAttribute("role", "radiogroup");
|
|
42
|
+
{
|
|
43
|
+
const __v = uniqueId("radiogroup");
|
|
44
|
+
if (__v != null && __v !== false)
|
|
45
|
+
__el0.setAttribute("id", __v === true ? "" : __v);
|
|
46
|
+
}
|
|
47
|
+
__on(__el0, "keydown", (event) => {
|
|
48
|
+
const result = handleListNavigation(event, items, { orientation: "vertical" });
|
|
49
|
+
if (result) {
|
|
50
|
+
const idx = items.indexOf(result);
|
|
51
|
+
if (idx >= 0) {
|
|
52
|
+
const val = itemValues[idx];
|
|
53
|
+
if (val !== undefined)
|
|
54
|
+
selectItem(val);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return __el0;
|
|
59
|
+
})();
|
|
60
|
+
function Item(value, label) {
|
|
61
|
+
const isActive = value === state.value.peek();
|
|
62
|
+
const item = (() => {
|
|
63
|
+
const __el1 = __element("div");
|
|
64
|
+
__el1.setAttribute("role", "radio");
|
|
65
|
+
{
|
|
66
|
+
const __v = uniqueId("radio");
|
|
67
|
+
if (__v != null && __v !== false)
|
|
68
|
+
__el1.setAttribute("id", __v === true ? "" : __v);
|
|
69
|
+
}
|
|
70
|
+
{
|
|
71
|
+
const __v = value;
|
|
72
|
+
if (__v != null && __v !== false)
|
|
73
|
+
__el1.setAttribute("data-value", __v === true ? "" : __v);
|
|
74
|
+
}
|
|
75
|
+
{
|
|
76
|
+
const __v = isActive ? "true" : "false";
|
|
77
|
+
if (__v != null && __v !== false)
|
|
78
|
+
__el1.setAttribute("aria-checked", __v === true ? "" : __v);
|
|
79
|
+
}
|
|
80
|
+
{
|
|
81
|
+
const __v = isActive ? "checked" : "unchecked";
|
|
82
|
+
if (__v != null && __v !== false)
|
|
83
|
+
__el1.setAttribute("data-state", __v === true ? "" : __v);
|
|
84
|
+
}
|
|
85
|
+
__on(__el1, "click", () => {
|
|
86
|
+
selectItem(value);
|
|
87
|
+
item.focus();
|
|
88
|
+
});
|
|
89
|
+
__enterChildren(__el1);
|
|
90
|
+
__insert(__el1, label ?? value);
|
|
91
|
+
__exitChildren();
|
|
92
|
+
return __el1;
|
|
93
|
+
})();
|
|
94
|
+
items.push(item);
|
|
95
|
+
itemValues.push(value);
|
|
96
|
+
root.appendChild(item);
|
|
97
|
+
setRovingTabindex(items, itemValues.indexOf(state.value.peek()));
|
|
98
|
+
return item;
|
|
99
|
+
}
|
|
100
|
+
applyAttrs(root, attrs);
|
|
101
|
+
return { root, state, Item };
|
|
102
|
+
}
|
|
103
|
+
var Radio = {
|
|
104
|
+
Root: RadioRoot
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export { Radio };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Signal } from "@vertz/ui";
|
|
2
|
+
interface ElementAttrs {
|
|
3
|
+
class?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
style?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
role?: string;
|
|
8
|
+
tabindex?: number | string;
|
|
9
|
+
hidden?: boolean | string;
|
|
10
|
+
autofocus?: boolean;
|
|
11
|
+
[key: `data-${string}`]: string | undefined;
|
|
12
|
+
[key: `aria-${string}`]: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface AccordionOptions extends ElementAttrs {
|
|
15
|
+
multiple?: boolean;
|
|
16
|
+
defaultValue?: string[];
|
|
17
|
+
onValueChange?: (value: string[]) => void;
|
|
18
|
+
}
|
|
19
|
+
interface AccordionState {
|
|
20
|
+
value: Signal<string[]>;
|
|
21
|
+
}
|
|
22
|
+
interface AccordionElements {
|
|
23
|
+
root: HTMLDivElement;
|
|
24
|
+
}
|
|
25
|
+
declare const Accordion: {
|
|
26
|
+
Root: (options?: AccordionOptions) => AccordionElements & {
|
|
27
|
+
state: AccordionState;
|
|
28
|
+
Item: (value: string) => {
|
|
29
|
+
item: HTMLDivElement;
|
|
30
|
+
trigger: HTMLButtonElement;
|
|
31
|
+
content: HTMLDivElement;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export { AccordionState, AccordionOptions, AccordionElements, Accordion };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Signal } from "@vertz/ui";
|
|
2
|
+
interface AlertDialogOptions {
|
|
3
|
+
defaultOpen?: boolean;
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
onAction?: () => void;
|
|
6
|
+
}
|
|
7
|
+
interface AlertDialogState {
|
|
8
|
+
open: Signal<boolean>;
|
|
9
|
+
}
|
|
10
|
+
interface AlertDialogElements {
|
|
11
|
+
trigger: HTMLButtonElement;
|
|
12
|
+
overlay: HTMLDivElement;
|
|
13
|
+
content: HTMLDivElement;
|
|
14
|
+
title: HTMLHeadingElement;
|
|
15
|
+
description: HTMLParagraphElement;
|
|
16
|
+
cancel: HTMLButtonElement;
|
|
17
|
+
action: HTMLButtonElement;
|
|
18
|
+
show: () => void;
|
|
19
|
+
hide: () => void;
|
|
20
|
+
}
|
|
21
|
+
declare const AlertDialog: {
|
|
22
|
+
Root: (options?: AlertDialogOptions) => AlertDialogElements & {
|
|
23
|
+
state: AlertDialogState;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export { AlertDialogState, AlertDialogOptions, AlertDialogElements, AlertDialog };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface ElementAttrs {
|
|
2
|
+
class?: string;
|
|
3
|
+
id?: string;
|
|
4
|
+
style?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
role?: string;
|
|
7
|
+
tabindex?: number | string;
|
|
8
|
+
hidden?: boolean | string;
|
|
9
|
+
autofocus?: boolean;
|
|
10
|
+
[key: `data-${string}`]: string | undefined;
|
|
11
|
+
[key: `aria-${string}`]: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
interface BadgeOptions extends ElementAttrs {
|
|
14
|
+
variant?: "default" | "secondary" | "outline" | "destructive";
|
|
15
|
+
}
|
|
16
|
+
interface BadgeElements {
|
|
17
|
+
badge: HTMLSpanElement;
|
|
18
|
+
}
|
|
19
|
+
declare const Badge: {
|
|
20
|
+
Root: (options?: BadgeOptions) => BadgeElements;
|
|
21
|
+
};
|
|
22
|
+
export { BadgeOptions, BadgeElements, Badge };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface ElementAttrs {
|
|
2
|
+
class?: string;
|
|
3
|
+
id?: string;
|
|
4
|
+
style?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
role?: string;
|
|
7
|
+
tabindex?: number | string;
|
|
8
|
+
hidden?: boolean | string;
|
|
9
|
+
autofocus?: boolean;
|
|
10
|
+
[key: `data-${string}`]: string | undefined;
|
|
11
|
+
[key: `aria-${string}`]: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
interface ButtonOptions extends ElementAttrs {
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const Button: {
|
|
18
|
+
Root: (options?: ButtonOptions) => HTMLButtonElement;
|
|
19
|
+
};
|
|
20
|
+
export { ButtonOptions, Button };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Signal } from "@vertz/ui";
|
|
2
|
+
interface ElementAttrs {
|
|
3
|
+
class?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
style?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
role?: string;
|
|
8
|
+
tabindex?: number | string;
|
|
9
|
+
hidden?: boolean | string;
|
|
10
|
+
autofocus?: boolean;
|
|
11
|
+
[key: `data-${string}`]: string | undefined;
|
|
12
|
+
[key: `aria-${string}`]: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface CalendarOptions extends ElementAttrs {
|
|
15
|
+
mode?: "single" | "range" | "multiple";
|
|
16
|
+
defaultValue?: Date | Date[] | {
|
|
17
|
+
from: Date;
|
|
18
|
+
to: Date;
|
|
19
|
+
};
|
|
20
|
+
defaultMonth?: Date;
|
|
21
|
+
minDate?: Date;
|
|
22
|
+
maxDate?: Date;
|
|
23
|
+
disabled?: (date: Date) => boolean;
|
|
24
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
25
|
+
onValueChange?: (value: Date | Date[] | {
|
|
26
|
+
from: Date;
|
|
27
|
+
to: Date;
|
|
28
|
+
} | null) => void;
|
|
29
|
+
onMonthChange?: (month: Date) => void;
|
|
30
|
+
}
|
|
31
|
+
interface CalendarState {
|
|
32
|
+
value: Signal<Date | Date[] | {
|
|
33
|
+
from: Date;
|
|
34
|
+
to: Date;
|
|
35
|
+
} | null>;
|
|
36
|
+
focusedDate: Signal<Date>;
|
|
37
|
+
displayMonth: Signal<Date>;
|
|
38
|
+
}
|
|
39
|
+
interface CalendarElements {
|
|
40
|
+
root: HTMLDivElement;
|
|
41
|
+
header: HTMLDivElement;
|
|
42
|
+
title: HTMLDivElement;
|
|
43
|
+
prevButton: HTMLButtonElement;
|
|
44
|
+
nextButton: HTMLButtonElement;
|
|
45
|
+
grid: HTMLTableElement;
|
|
46
|
+
}
|
|
47
|
+
declare const Calendar: {
|
|
48
|
+
Root: (options?: CalendarOptions) => CalendarElements & {
|
|
49
|
+
state: CalendarState;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export { CalendarState, CalendarOptions, CalendarElements, Calendar };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Signal } from "@vertz/ui";
|
|
2
|
+
interface ElementAttrs {
|
|
3
|
+
class?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
style?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
role?: string;
|
|
8
|
+
tabindex?: number | string;
|
|
9
|
+
hidden?: boolean | string;
|
|
10
|
+
autofocus?: boolean;
|
|
11
|
+
[key: `data-${string}`]: string | undefined;
|
|
12
|
+
[key: `aria-${string}`]: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface CarouselOptions extends ElementAttrs {
|
|
15
|
+
orientation?: "horizontal" | "vertical";
|
|
16
|
+
loop?: boolean;
|
|
17
|
+
defaultIndex?: number;
|
|
18
|
+
onSlideChange?: (index: number) => void;
|
|
19
|
+
}
|
|
20
|
+
interface CarouselState {
|
|
21
|
+
currentIndex: Signal<number>;
|
|
22
|
+
slideCount: Signal<number>;
|
|
23
|
+
}
|
|
24
|
+
interface CarouselElements {
|
|
25
|
+
root: HTMLDivElement;
|
|
26
|
+
viewport: HTMLDivElement;
|
|
27
|
+
prevButton: HTMLButtonElement;
|
|
28
|
+
nextButton: HTMLButtonElement;
|
|
29
|
+
}
|
|
30
|
+
declare const Carousel: {
|
|
31
|
+
Root: (options?: CarouselOptions) => CarouselElements & {
|
|
32
|
+
state: CarouselState;
|
|
33
|
+
Slide: () => HTMLDivElement;
|
|
34
|
+
goTo: (index: number) => void;
|
|
35
|
+
goNext: () => void;
|
|
36
|
+
goPrev: () => void;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export { CarouselState, CarouselOptions, CarouselElements, Carousel };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface ElementAttrs {
|
|
2
|
+
class?: string;
|
|
3
|
+
id?: string;
|
|
4
|
+
style?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
role?: string;
|
|
7
|
+
tabindex?: number | string;
|
|
8
|
+
hidden?: boolean | string;
|
|
9
|
+
autofocus?: boolean;
|
|
10
|
+
[key: `data-${string}`]: string | undefined;
|
|
11
|
+
[key: `aria-${string}`]: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
type CheckedState = boolean | "mixed";
|
|
14
|
+
interface CheckboxOptions extends ElementAttrs {
|
|
15
|
+
defaultChecked?: CheckedState;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onCheckedChange?: (checked: CheckedState) => void;
|
|
18
|
+
}
|
|
19
|
+
declare const Checkbox: {
|
|
20
|
+
Root: (options?: CheckboxOptions) => HTMLButtonElement;
|
|
21
|
+
};
|
|
22
|
+
export { CheckedState, CheckboxOptions, Checkbox };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Signal } from "@vertz/ui";
|
|
2
|
+
interface ElementAttrs {
|
|
3
|
+
class?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
style?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
role?: string;
|
|
8
|
+
tabindex?: number | string;
|
|
9
|
+
hidden?: boolean | string;
|
|
10
|
+
autofocus?: boolean;
|
|
11
|
+
[key: `data-${string}`]: string | undefined;
|
|
12
|
+
[key: `aria-${string}`]: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface CollapsibleOptions extends ElementAttrs {
|
|
15
|
+
defaultOpen?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
|
+
}
|
|
19
|
+
interface CollapsibleState {
|
|
20
|
+
open: Signal<boolean>;
|
|
21
|
+
disabled: Signal<boolean>;
|
|
22
|
+
}
|
|
23
|
+
interface CollapsibleElements {
|
|
24
|
+
root: HTMLDivElement;
|
|
25
|
+
trigger: HTMLButtonElement;
|
|
26
|
+
content: HTMLDivElement;
|
|
27
|
+
}
|
|
28
|
+
declare const Collapsible: {
|
|
29
|
+
Root: (options?: CollapsibleOptions) => CollapsibleElements & {
|
|
30
|
+
state: CollapsibleState;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export { CollapsibleState, CollapsibleOptions, CollapsibleElements, Collapsible };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Signal } from "@vertz/ui";
|
|
2
|
+
interface ElementAttrs {
|
|
3
|
+
class?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
style?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
role?: string;
|
|
8
|
+
tabindex?: number | string;
|
|
9
|
+
hidden?: boolean | string;
|
|
10
|
+
autofocus?: boolean;
|
|
11
|
+
[key: `data-${string}`]: string | undefined;
|
|
12
|
+
[key: `aria-${string}`]: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface ComboboxOptions extends ElementAttrs {
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
onValueChange?: (value: string) => void;
|
|
17
|
+
onInputChange?: (input: string) => void;
|
|
18
|
+
}
|
|
19
|
+
interface ComboboxState {
|
|
20
|
+
open: Signal<boolean>;
|
|
21
|
+
value: Signal<string>;
|
|
22
|
+
inputValue: Signal<string>;
|
|
23
|
+
activeIndex: Signal<number>;
|
|
24
|
+
}
|
|
25
|
+
interface ComboboxElements {
|
|
26
|
+
input: HTMLInputElement;
|
|
27
|
+
listbox: HTMLDivElement;
|
|
28
|
+
}
|
|
29
|
+
declare const Combobox: {
|
|
30
|
+
Root: (options?: ComboboxOptions) => ComboboxElements & {
|
|
31
|
+
state: ComboboxState;
|
|
32
|
+
Option: (value: string, label?: string) => HTMLDivElement;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export { ComboboxState, ComboboxOptions, ComboboxElements, Combobox };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Signal } from "@vertz/ui";
|
|
2
|
+
interface ElementAttrs {
|
|
3
|
+
class?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
style?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
role?: string;
|
|
8
|
+
tabindex?: number | string;
|
|
9
|
+
hidden?: boolean | string;
|
|
10
|
+
autofocus?: boolean;
|
|
11
|
+
[key: `data-${string}`]: string | undefined;
|
|
12
|
+
[key: `aria-${string}`]: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface CommandOptions extends ElementAttrs {
|
|
15
|
+
filter?: (value: string, search: string) => boolean;
|
|
16
|
+
onSelect?: (value: string) => void;
|
|
17
|
+
onInputChange?: (value: string) => void;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
}
|
|
20
|
+
interface CommandState {
|
|
21
|
+
inputValue: Signal<string>;
|
|
22
|
+
activeIndex: Signal<number>;
|
|
23
|
+
}
|
|
24
|
+
interface CommandElements {
|
|
25
|
+
root: HTMLDivElement;
|
|
26
|
+
input: HTMLInputElement;
|
|
27
|
+
list: HTMLDivElement;
|
|
28
|
+
empty: HTMLDivElement;
|
|
29
|
+
}
|
|
30
|
+
declare const Command: {
|
|
31
|
+
Root: (options?: CommandOptions) => CommandElements & {
|
|
32
|
+
state: CommandState;
|
|
33
|
+
Item: (value: string, label?: string, keywords?: string[]) => HTMLDivElement;
|
|
34
|
+
Group: (label: string) => {
|
|
35
|
+
el: HTMLDivElement;
|
|
36
|
+
Item: (value: string, label?: string, keywords?: string[]) => HTMLDivElement;
|
|
37
|
+
};
|
|
38
|
+
Separator: () => HTMLHRElement;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export { CommandState, CommandOptions, CommandElements, Command };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Signal } from "@vertz/ui";
|
|
2
|
+
interface ElementAttrs {
|
|
3
|
+
class?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
style?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
role?: string;
|
|
8
|
+
tabindex?: number | string;
|
|
9
|
+
hidden?: boolean | string;
|
|
10
|
+
autofocus?: boolean;
|
|
11
|
+
[key: `data-${string}`]: string | undefined;
|
|
12
|
+
[key: `aria-${string}`]: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
import { Middleware, Placement, Strategy } from "@floating-ui/dom";
|
|
15
|
+
interface FloatingOptions {
|
|
16
|
+
placement?: Placement;
|
|
17
|
+
strategy?: Strategy;
|
|
18
|
+
offset?: number;
|
|
19
|
+
flip?: boolean;
|
|
20
|
+
shift?: boolean;
|
|
21
|
+
middleware?: Middleware[];
|
|
22
|
+
matchReferenceWidth?: boolean;
|
|
23
|
+
portal?: boolean;
|
|
24
|
+
/** Override the reference element used for positioning (e.g., a custom trigger wrapping the primitive trigger). */
|
|
25
|
+
referenceElement?: HTMLElement;
|
|
26
|
+
}
|
|
27
|
+
interface ContextMenuOptions extends ElementAttrs {
|
|
28
|
+
onSelect?: (value: string) => void;
|
|
29
|
+
positioning?: FloatingOptions;
|
|
30
|
+
}
|
|
31
|
+
interface ContextMenuState {
|
|
32
|
+
open: Signal<boolean>;
|
|
33
|
+
activeIndex: Signal<number>;
|
|
34
|
+
}
|
|
35
|
+
interface ContextMenuElements {
|
|
36
|
+
trigger: HTMLDivElement;
|
|
37
|
+
content: HTMLDivElement;
|
|
38
|
+
}
|
|
39
|
+
declare const ContextMenu: {
|
|
40
|
+
Root: (options?: ContextMenuOptions) => ContextMenuElements & {
|
|
41
|
+
state: ContextMenuState;
|
|
42
|
+
Item: (value: string, label?: string) => HTMLDivElement;
|
|
43
|
+
Group: (label: string) => {
|
|
44
|
+
el: HTMLDivElement;
|
|
45
|
+
Item: (value: string, label?: string) => HTMLDivElement;
|
|
46
|
+
};
|
|
47
|
+
Separator: () => HTMLHRElement;
|
|
48
|
+
Label: (text: string) => HTMLDivElement;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export { ContextMenuState, ContextMenuOptions, ContextMenuElements, ContextMenu };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ContextMenu
|
|
3
|
+
} from "../../shared/chunk-x0we8gcy.js";
|
|
4
|
+
import"../../shared/chunk-a6wp8c32.js";
|
|
5
|
+
import"../../shared/chunk-0mcr52hc.js";
|
|
6
|
+
import"../../shared/chunk-jctqs9m4.js";
|
|
7
|
+
import"../../shared/chunk-vvjyx7fe.js";
|
|
8
|
+
import"../../shared/chunk-dpsgb1xw.js";
|
|
9
|
+
import"../../shared/chunk-8y1jf6xr.js";
|
|
10
|
+
export {
|
|
11
|
+
ContextMenu
|
|
12
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Signal } from "@vertz/ui";
|
|
2
|
+
interface DatePickerOptions {
|
|
3
|
+
mode?: "single" | "range";
|
|
4
|
+
defaultValue?: Date | {
|
|
5
|
+
from: Date;
|
|
6
|
+
to: Date;
|
|
7
|
+
};
|
|
8
|
+
defaultMonth?: Date;
|
|
9
|
+
minDate?: Date;
|
|
10
|
+
maxDate?: Date;
|
|
11
|
+
disabled?: (date: Date) => boolean;
|
|
12
|
+
formatDate?: (date: Date) => string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
onValueChange?: (value: Date | {
|
|
15
|
+
from: Date;
|
|
16
|
+
to: Date;
|
|
17
|
+
} | null) => void;
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
19
|
+
}
|
|
20
|
+
interface DatePickerState {
|
|
21
|
+
open: Signal<boolean>;
|
|
22
|
+
value: Signal<Date | {
|
|
23
|
+
from: Date;
|
|
24
|
+
to: Date;
|
|
25
|
+
} | null>;
|
|
26
|
+
displayMonth: Signal<Date>;
|
|
27
|
+
}
|
|
28
|
+
interface DatePickerElements {
|
|
29
|
+
trigger: HTMLButtonElement;
|
|
30
|
+
content: HTMLDivElement;
|
|
31
|
+
calendar: {
|
|
32
|
+
root: HTMLDivElement;
|
|
33
|
+
header: HTMLDivElement;
|
|
34
|
+
title: HTMLDivElement;
|
|
35
|
+
prevButton: HTMLButtonElement;
|
|
36
|
+
nextButton: HTMLButtonElement;
|
|
37
|
+
grid: HTMLTableElement;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
declare const DatePicker: {
|
|
41
|
+
Root(options?: DatePickerOptions): DatePickerElements & {
|
|
42
|
+
state: DatePickerState;
|
|
43
|
+
show: () => void;
|
|
44
|
+
hide: () => void;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export { DatePickerState, DatePickerOptions, DatePickerElements, DatePicker };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DatePicker
|
|
3
|
+
} from "../../shared/chunk-x2hz98qn.js";
|
|
4
|
+
import"../../shared/chunk-18y8gfk0.js";
|
|
5
|
+
import"../../shared/chunk-m1ptgp1s.js";
|
|
6
|
+
import"../../shared/chunk-a6wp8c32.js";
|
|
7
|
+
import"../../shared/chunk-e2v1c9ex.js";
|
|
8
|
+
import"../../shared/chunk-0mcr52hc.js";
|
|
9
|
+
import"../../shared/chunk-jctqs9m4.js";
|
|
10
|
+
import"../../shared/chunk-vvjyx7fe.js";
|
|
11
|
+
import"../../shared/chunk-dpsgb1xw.js";
|
|
12
|
+
import"../../shared/chunk-8y1jf6xr.js";
|
|
13
|
+
export {
|
|
14
|
+
DatePicker
|
|
15
|
+
};
|