@vertz/ui-primitives 0.2.23 → 0.2.24
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-pzx0vpq1.js → chunk-00fqgnq1.js} +6 -11
- package/dist/shared/chunk-1hm0mbke.js +258 -0
- package/dist/shared/{chunk-ww7k2azn.js → chunk-20kwns82.js} +5 -9
- package/dist/shared/chunk-3jack97k.js +509 -0
- package/dist/shared/{chunk-xs6gp369.js → chunk-455p0jbk.js} +3 -7
- package/dist/shared/chunk-4gyg71bn.js +178 -0
- package/dist/shared/chunk-4z006v1j.js +467 -0
- package/dist/shared/{chunk-b25npqer.js → chunk-585ysr70.js} +1 -1
- package/dist/shared/chunk-75pegjs7.js +26 -0
- package/dist/shared/{chunk-mr1tb0dp.js → chunk-7a2nqmeh.js} +1 -1
- package/dist/shared/chunk-7wem1bhb.js +252 -0
- package/dist/shared/{chunk-7cb3z0s8.js → chunk-8evj43jn.js} +5 -8
- package/dist/shared/chunk-8t0nm721.js +152 -0
- package/dist/shared/chunk-94twh4s4.js +28 -0
- package/dist/shared/chunk-98y1sw9y.js +398 -0
- package/dist/shared/chunk-9eedsnnk.js +164 -0
- package/dist/shared/{chunk-8c01c8mb.js → chunk-9hv3vc72.js} +0 -2
- package/dist/shared/chunk-aa3w85hn.js +321 -0
- package/dist/shared/chunk-axpbdpgx.js +177 -0
- package/dist/shared/chunk-b4zzg457.js +410 -0
- package/dist/shared/chunk-brk0drrk.js +202 -0
- package/dist/shared/chunk-czv0kqj4.js +107 -0
- package/dist/shared/chunk-d83ag07h.js +189 -0
- package/dist/shared/{chunk-3kwh27dv.js → chunk-de18ashk.js} +0 -1
- package/dist/shared/{chunk-cgb2j94g.js → chunk-dvk4h36t.js} +0 -1
- package/dist/shared/chunk-e6660g7e.js +179 -0
- package/dist/shared/{chunk-3h1mxp95.js → chunk-eq4d9b0w.js} +0 -1
- package/dist/shared/chunk-ev367pq3.js +102 -0
- package/dist/shared/{chunk-4894pmy6.js → chunk-f0wy7k56.js} +0 -1
- package/dist/shared/chunk-fjykbv0v.js +214 -0
- package/dist/shared/chunk-ghkw5bjq.js +55 -0
- package/dist/shared/chunk-gqb1n1hj.js +60 -0
- package/dist/shared/chunk-hfjtkytb.js +310 -0
- package/dist/shared/chunk-hpvjfj0j.js +31 -0
- package/dist/shared/chunk-hxmxvp56.js +67 -0
- package/dist/shared/chunk-j9m2f0rd.js +162 -0
- package/dist/shared/chunk-jpyjk616.js +52 -0
- package/dist/shared/{chunk-ttb2tt03.js → chunk-jsa3byag.js} +1 -1
- package/dist/shared/{chunk-9gfp3ffv.js → chunk-jzy1bkdk.js} +0 -1
- package/dist/shared/{chunk-f2vx4tpw.js → chunk-knzg86am.js} +5 -5
- package/dist/shared/chunk-kskxxc2q.js +228 -0
- package/dist/shared/chunk-metxdt5x.js +28 -0
- package/dist/shared/chunk-mhn2aazf.js +353 -0
- package/dist/shared/chunk-mtx2cfbx.js +175 -0
- package/dist/shared/chunk-nsmvdxgp.js +213 -0
- package/dist/shared/{chunk-pn6shbcs.js → chunk-pdzmg245.js} +1 -5
- package/dist/shared/chunk-pzknpa1y.js +327 -0
- package/dist/shared/chunk-q1ff3xp3.js +95 -0
- package/dist/shared/chunk-q7xbcj9q.js +7 -0
- package/dist/shared/{chunk-p0x7hgv6.js → chunk-qhnany7w.js} +0 -2
- package/dist/shared/chunk-qrm43tr3.js +357 -0
- package/dist/shared/{chunk-xa1b96mb.js → chunk-qsp7sfhp.js} +2 -2
- package/dist/shared/{chunk-j902w020.js → chunk-qwqnjjg8.js} +1 -1
- package/dist/shared/{chunk-h3v10x04.js → chunk-r0rz7z03.js} +6 -11
- package/dist/shared/chunk-r3ngaa64.js +418 -0
- package/dist/shared/chunk-r3pffzss.js +13 -0
- package/dist/shared/chunk-rrt62bp0.js +353 -0
- package/dist/shared/chunk-s24gkmna.js +131 -0
- package/dist/shared/chunk-s62e7jf4.js +30 -0
- package/dist/shared/chunk-spng4yb9.js +73 -0
- package/dist/shared/chunk-v0b5pkcq.js +30 -0
- package/dist/shared/chunk-v11kd39k.js +162 -0
- package/dist/shared/{chunk-0mcr52hc.js → chunk-vef3sepw.js} +17 -1
- package/dist/shared/chunk-vkscwzpr.js +294 -0
- package/dist/shared/chunk-vv187snj.js +112 -0
- package/dist/shared/chunk-wqsek87j.js +311 -0
- package/dist/shared/chunk-wtkxz2te.js +157 -0
- package/dist/shared/chunk-y1hpsqzy.js +185 -0
- package/dist/shared/chunk-yfzddvxc.js +71 -0
- package/dist/src/accordion/accordion-composed.d.ts +30 -0
- package/dist/src/accordion/accordion-composed.js +6 -0
- package/dist/src/accordion/accordion.js +1 -1
- package/dist/src/alert/alert-composed.d.ts +26 -0
- package/dist/src/alert/alert-composed.js +6 -0
- package/dist/src/alert-dialog/alert-dialog-composed.d.ts +40 -0
- package/dist/src/alert-dialog/alert-dialog-composed.js +6 -0
- package/dist/src/avatar/avatar-composed.d.ts +33 -0
- package/dist/src/avatar/avatar-composed.js +6 -0
- package/dist/src/badge/badge-composed.d.ts +33 -0
- package/dist/src/badge/badge-composed.js +6 -0
- package/dist/src/breadcrumb/breadcrumb-composed.d.ts +34 -0
- package/dist/src/breadcrumb/breadcrumb-composed.js +6 -0
- package/dist/src/button/button-composed.d.ts +34 -0
- package/dist/src/button/button-composed.js +6 -0
- package/dist/src/calendar/calendar-composed.d.ts +42 -0
- package/dist/src/calendar/calendar-composed.js +6 -0
- package/dist/src/calendar/calendar.js +1 -1
- package/dist/src/card/card-composed.d.ts +34 -0
- package/dist/src/card/card-composed.js +6 -0
- package/dist/src/carousel/carousel-composed.d.ts +32 -0
- package/dist/src/carousel/carousel-composed.js +6 -0
- package/dist/src/carousel/carousel.js +1 -1
- package/dist/src/checkbox/checkbox-composed.d.ts +18 -0
- package/dist/src/checkbox/checkbox-composed.js +6 -0
- package/dist/src/collapsible/collapsible-composed.d.ts +26 -0
- package/dist/src/collapsible/collapsible-composed.js +6 -0
- package/dist/src/combobox/combobox-composed.d.ts +30 -0
- package/dist/src/combobox/combobox-composed.js +6 -0
- package/dist/src/combobox/combobox.js +1 -1
- package/dist/src/command/command-composed.d.ts +67 -0
- package/dist/src/command/command-composed.js +6 -0
- package/dist/src/command/command.js +1 -1
- package/dist/src/composed/with-styles.d.ts +38 -0
- package/dist/src/composed/with-styles.js +6 -0
- package/dist/src/context-menu/context-menu-composed.d.ts +51 -0
- package/dist/src/context-menu/context-menu-composed.js +6 -0
- package/dist/src/context-menu/context-menu.js +1 -1
- package/dist/src/date-picker/date-picker-composed.d.ts +77 -0
- package/dist/src/date-picker/date-picker-composed.js +6 -0
- package/dist/src/date-picker/date-picker.js +1 -1
- package/dist/src/dialog/dialog-composed.d.ts +36 -0
- package/dist/src/dialog/dialog-composed.js +6 -0
- package/dist/src/dialog/dialog-stack-parts.d.ts +16 -0
- package/dist/src/dialog/dialog-stack-parts.js +18 -0
- package/dist/src/dropdown-menu/dropdown-menu-composed.d.ts +51 -0
- package/dist/src/dropdown-menu/dropdown-menu-composed.js +6 -0
- package/dist/src/dropdown-menu/dropdown-menu.js +1 -1
- package/dist/src/empty-state/empty-state-composed.d.ts +30 -0
- package/dist/src/empty-state/empty-state-composed.js +6 -0
- package/dist/src/form-group/form-group-composed.d.ts +24 -0
- package/dist/src/form-group/form-group-composed.js +6 -0
- package/dist/src/hover-card/hover-card-composed.d.ts +38 -0
- package/dist/src/hover-card/hover-card-composed.js +6 -0
- package/dist/src/hover-card/hover-card.js +1 -1
- package/dist/src/index.d.ts +1284 -817
- package/dist/src/index.js +78 -6566
- package/dist/src/input/input-composed.d.ts +35 -0
- package/dist/src/input/input-composed.js +6 -0
- package/dist/src/label/label-composed.d.ts +32 -0
- package/dist/src/label/label-composed.js +6 -0
- package/dist/src/menu/menu-composed.d.ts +51 -0
- package/dist/src/menu/menu-composed.js +6 -0
- package/dist/src/menu/menu.js +1 -1
- package/dist/src/menubar/menubar-composed.d.ts +56 -0
- package/dist/src/menubar/menubar-composed.js +6 -0
- package/dist/src/menubar/menubar.js +1 -1
- package/dist/src/navigation-menu/navigation-menu-composed.d.ts +56 -0
- package/dist/src/navigation-menu/navigation-menu-composed.js +6 -0
- package/dist/src/navigation-menu/navigation-menu.js +1 -1
- package/dist/src/pagination/pagination-composed.d.ts +30 -0
- package/dist/src/pagination/pagination-composed.js +6 -0
- package/dist/src/popover/popover-composed.d.ts +36 -0
- package/dist/src/popover/popover-composed.js +6 -0
- package/dist/src/popover/popover.js +1 -1
- package/dist/src/progress/progress-composed.d.ts +17 -0
- package/dist/src/progress/progress-composed.js +6 -0
- package/dist/src/radio/radio-composed.d.ts +24 -0
- package/dist/src/radio/radio-composed.js +6 -0
- package/dist/src/radio/radio.js +1 -1
- package/dist/src/resizable-panel/resizable-panel-composed.d.ts +33 -0
- package/dist/src/resizable-panel/resizable-panel-composed.js +6 -0
- package/dist/src/resizable-panel/resizable-panel.js +1 -1
- package/dist/src/scroll-area/scroll-area-composed.d.ts +17 -0
- package/dist/src/scroll-area/scroll-area-composed.js +6 -0
- package/dist/src/scroll-area/scroll-area.js +1 -1
- package/dist/src/select/select-composed.d.ts +53 -0
- package/dist/src/select/select-composed.js +6 -0
- package/dist/src/select/select.js +1 -1
- package/dist/src/separator/separator-composed.d.ts +32 -0
- package/dist/src/separator/separator-composed.js +6 -0
- package/dist/src/sheet/sheet-composed.d.ts +34 -0
- package/dist/src/sheet/sheet-composed.js +6 -0
- package/dist/src/skeleton/skeleton-composed.d.ts +65 -0
- package/dist/src/skeleton/skeleton-composed.js +6 -0
- package/dist/src/slider/slider-composed.d.ts +22 -0
- package/dist/src/slider/slider-composed.js +6 -0
- package/dist/src/switch/switch-composed.d.ts +17 -0
- package/dist/src/switch/switch-composed.js +6 -0
- package/dist/src/table/table-composed.d.ts +34 -0
- package/dist/src/table/table-composed.js +6 -0
- package/dist/src/tabs/tabs-composed.d.ts +33 -0
- package/dist/src/tabs/tabs-composed.js +6 -0
- package/dist/src/tabs/tabs.js +1 -1
- package/dist/src/textarea/textarea-composed.d.ts +35 -0
- package/dist/src/textarea/textarea-composed.js +6 -0
- package/dist/src/toast/toast.js +1 -1
- package/dist/src/toggle/toggle-composed.d.ts +16 -0
- package/dist/src/toggle/toggle-composed.js +6 -0
- package/dist/src/toggle-group/toggle-group-composed.d.ts +24 -0
- package/dist/src/toggle-group/toggle-group-composed.js +6 -0
- package/dist/src/toggle-group/toggle-group.js +1 -1
- package/dist/src/tooltip/tooltip-composed.d.ts +36 -0
- package/dist/src/tooltip/tooltip-composed.js +6 -0
- package/dist/src/tooltip/tooltip.js +1 -1
- package/dist/src/utils.js +1 -1
- package/package.json +3 -3
- package/dist/shared/chunk-56reyd5r.js +0 -64
- package/dist/shared/chunk-mgr904ap.js +0 -370
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ComposedCalendar
|
|
3
|
+
} from "./chunk-3jack97k.js";
|
|
4
|
+
import {
|
|
5
|
+
cn
|
|
6
|
+
} from "./chunk-q7xbcj9q.js";
|
|
7
|
+
import {
|
|
8
|
+
createDismiss
|
|
9
|
+
} from "./chunk-a6wp8c32.js";
|
|
10
|
+
import {
|
|
11
|
+
createFloatingPosition
|
|
12
|
+
} from "./chunk-vef3sepw.js";
|
|
13
|
+
import {
|
|
14
|
+
linkedIds
|
|
15
|
+
} from "./chunk-8y1jf6xr.js";
|
|
16
|
+
|
|
17
|
+
// src/date-picker/date-picker-composed.tsx
|
|
18
|
+
import { computed, signal } from "@vertz/ui";
|
|
19
|
+
import { __append, __attr, __child, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __on, __pushMountFrame, __styleStr } from "@vertz/ui/internals";
|
|
20
|
+
import { createContext, ref, useContext } from "@vertz/ui";
|
|
21
|
+
var DatePickerContext = createContext(undefined, "@vertz/ui-primitives::DatePickerContext");
|
|
22
|
+
function DatePickerTrigger(__props) {
|
|
23
|
+
const __mfDepth = __pushMountFrame();
|
|
24
|
+
try {
|
|
25
|
+
const ctx = useContext(DatePickerContext);
|
|
26
|
+
if (!ctx) {
|
|
27
|
+
throw new Error("<DatePicker.Trigger> must be used inside <DatePicker>. " + "Ensure it is a direct or nested child of the DatePicker root component.");
|
|
28
|
+
}
|
|
29
|
+
const isOpen = computed(() => ctx.isOpen());
|
|
30
|
+
const hasVal = computed(() => ctx.hasValue());
|
|
31
|
+
const text = computed(() => ctx.displayText());
|
|
32
|
+
const __mfResult0 = (() => {
|
|
33
|
+
const __el0 = __element("button");
|
|
34
|
+
ctx.triggerRef.current = __el0;
|
|
35
|
+
__el0.setAttribute("type", "button");
|
|
36
|
+
__el0.setAttribute("data-datepicker-trigger", "");
|
|
37
|
+
__el0.setAttribute("aria-haspopup", "dialog");
|
|
38
|
+
__attr(__el0, "aria-controls", () => ctx.contentId);
|
|
39
|
+
__attr(__el0, "aria-expanded", () => isOpen.value ? "true" : "false");
|
|
40
|
+
__attr(__el0, "data-state", () => isOpen.value ? "open" : "closed");
|
|
41
|
+
__attr(__el0, "data-placeholder", () => hasVal.value ? undefined : "true");
|
|
42
|
+
__attr(__el0, "class", () => cn(ctx.classes?.trigger, __props.className ?? __props.class));
|
|
43
|
+
__on(__el0, "click", () => ctx.toggle());
|
|
44
|
+
__enterChildren(__el0);
|
|
45
|
+
__append(__el0, __child(() => __props.children ?? text.value));
|
|
46
|
+
__exitChildren();
|
|
47
|
+
return __el0;
|
|
48
|
+
})();
|
|
49
|
+
__flushMountFrame();
|
|
50
|
+
return __mfResult0;
|
|
51
|
+
} catch (__mfErr) {
|
|
52
|
+
__discardMountFrame(__mfDepth);
|
|
53
|
+
throw __mfErr;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function DatePickerContent(__props) {
|
|
57
|
+
const __mfDepth = __pushMountFrame();
|
|
58
|
+
try {
|
|
59
|
+
const ctx = useContext(DatePickerContext);
|
|
60
|
+
if (!ctx) {
|
|
61
|
+
throw new Error("<DatePicker.Content> must be used inside <DatePicker>. " + "Ensure it is a direct or nested child of the DatePicker root component.");
|
|
62
|
+
}
|
|
63
|
+
const isOpen = computed(() => ctx.isOpen());
|
|
64
|
+
const __mfResult0 = (() => {
|
|
65
|
+
const __el0 = __element("div");
|
|
66
|
+
ctx.contentRef.current = __el0;
|
|
67
|
+
__el0.setAttribute("role", "dialog");
|
|
68
|
+
__attr(__el0, "id", () => ctx.contentId);
|
|
69
|
+
__el0.setAttribute("data-datepicker-content", "");
|
|
70
|
+
__attr(__el0, "aria-hidden", () => isOpen.value ? "false" : "true");
|
|
71
|
+
__attr(__el0, "data-state", () => isOpen.value ? "open" : "closed");
|
|
72
|
+
__attr(__el0, "style", () => ({
|
|
73
|
+
display: isOpen.value ? "" : "none",
|
|
74
|
+
zIndex: "50"
|
|
75
|
+
}));
|
|
76
|
+
__attr(__el0, "class", () => cn(ctx.classes?.content, __props.className ?? __props.class));
|
|
77
|
+
__enterChildren(__el0);
|
|
78
|
+
__append(__el0, __child(() => __props.children));
|
|
79
|
+
__exitChildren();
|
|
80
|
+
return __el0;
|
|
81
|
+
})();
|
|
82
|
+
__flushMountFrame();
|
|
83
|
+
return __mfResult0;
|
|
84
|
+
} catch (__mfErr) {
|
|
85
|
+
__discardMountFrame(__mfDepth);
|
|
86
|
+
throw __mfErr;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function _toRealDate(val) {
|
|
90
|
+
if (val instanceof Date)
|
|
91
|
+
return val;
|
|
92
|
+
if (val && typeof val === "object" && typeof val.getTime === "function") {
|
|
93
|
+
return new Date(val.getTime());
|
|
94
|
+
}
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
function _defaultFormatDate(date) {
|
|
98
|
+
return date.toLocaleDateString();
|
|
99
|
+
}
|
|
100
|
+
function _getDisplayText(value, placeholder, formatDate) {
|
|
101
|
+
if (value === null)
|
|
102
|
+
return placeholder;
|
|
103
|
+
if (value instanceof Date)
|
|
104
|
+
return formatDate(value);
|
|
105
|
+
if ("from" in value)
|
|
106
|
+
return `${formatDate(value.from)} – ${formatDate(value.to)}`;
|
|
107
|
+
return placeholder;
|
|
108
|
+
}
|
|
109
|
+
function _buildCalendar(props, onCalendarValueChange) {
|
|
110
|
+
const initValue = props.defaultValue ?? null;
|
|
111
|
+
const calendarMode = (props.mode ?? "single") === "range" ? "range" : "single";
|
|
112
|
+
const calendarDefaultValue = initValue instanceof Date ? initValue : initValue && ("from" in initValue) ? initValue : undefined;
|
|
113
|
+
const defaultMonth = props.defaultMonth ?? (initValue instanceof Date ? initValue : initValue && ("from" in initValue) ? initValue.from : new Date);
|
|
114
|
+
return ComposedCalendar({
|
|
115
|
+
classes: props.classes?.calendar,
|
|
116
|
+
mode: calendarMode,
|
|
117
|
+
defaultValue: calendarDefaultValue,
|
|
118
|
+
defaultMonth,
|
|
119
|
+
minDate: props.minDate,
|
|
120
|
+
maxDate: props.maxDate,
|
|
121
|
+
disabled: props.disabled,
|
|
122
|
+
captionLayout: props.captionLayout,
|
|
123
|
+
onValueChange: onCalendarValueChange
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function ComposedDatePickerRoot(__props) {
|
|
127
|
+
const __mfDepth = __pushMountFrame();
|
|
128
|
+
try {
|
|
129
|
+
let open = function() {
|
|
130
|
+
isOpen.value = true;
|
|
131
|
+
const triggerEl = triggerRef.current;
|
|
132
|
+
const contentEl = contentRef.current;
|
|
133
|
+
if (triggerEl && contentEl) {
|
|
134
|
+
contentEl.style.position = "fixed";
|
|
135
|
+
const result = createFloatingPosition(triggerEl, contentEl, {
|
|
136
|
+
placement: "bottom-start",
|
|
137
|
+
offset: 4
|
|
138
|
+
});
|
|
139
|
+
state.floatingCleanup = result.cleanup;
|
|
140
|
+
state.dismissCleanup = createDismiss({
|
|
141
|
+
onDismiss: close,
|
|
142
|
+
insideElements: [triggerEl, contentEl],
|
|
143
|
+
escapeKey: true
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
__props.onOpenChange?.(true);
|
|
147
|
+
}, close = function() {
|
|
148
|
+
isOpen.value = false;
|
|
149
|
+
state.floatingCleanup?.();
|
|
150
|
+
state.floatingCleanup = null;
|
|
151
|
+
state.dismissCleanup?.();
|
|
152
|
+
state.dismissCleanup = null;
|
|
153
|
+
__props.onOpenChange?.(false);
|
|
154
|
+
}, toggle = function() {
|
|
155
|
+
if (isOpen.value)
|
|
156
|
+
close();
|
|
157
|
+
else
|
|
158
|
+
open();
|
|
159
|
+
}, handleCalendarValueChange = function(calValue) {
|
|
160
|
+
if (calValue === null)
|
|
161
|
+
return;
|
|
162
|
+
if ((__props.mode ?? "single") === "single") {
|
|
163
|
+
const realDate = _toRealDate(calValue);
|
|
164
|
+
if (realDate) {
|
|
165
|
+
state.value = realDate;
|
|
166
|
+
hasValue.value = true;
|
|
167
|
+
displayText.value = _getDisplayText(realDate, __props.placeholder ?? "Pick a date", __props.formatDate ?? _defaultFormatDate);
|
|
168
|
+
__props.onValueChange?.(realDate);
|
|
169
|
+
close();
|
|
170
|
+
}
|
|
171
|
+
} else if ((__props.mode ?? "single") === "range" && calValue && "from" in calValue) {
|
|
172
|
+
const raw = calValue;
|
|
173
|
+
const from = _toRealDate(raw.from);
|
|
174
|
+
const to = _toRealDate(raw.to);
|
|
175
|
+
if (from && to) {
|
|
176
|
+
const range = { from, to };
|
|
177
|
+
state.value = range;
|
|
178
|
+
hasValue.value = true;
|
|
179
|
+
displayText.value = _getDisplayText(range, __props.placeholder ?? "Pick a date", __props.formatDate ?? _defaultFormatDate);
|
|
180
|
+
__props.onValueChange?.(range);
|
|
181
|
+
if (from.getTime() !== to.getTime()) {
|
|
182
|
+
close();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
const ids = linkedIds("datepicker");
|
|
188
|
+
const triggerRef = ref();
|
|
189
|
+
const contentRef = ref();
|
|
190
|
+
const isOpen = signal(false, "isOpen");
|
|
191
|
+
const hasValue = signal((__props.defaultValue ?? undefined) != null, "hasValue");
|
|
192
|
+
const displayText = signal(_getDisplayText(__props.defaultValue ?? undefined ?? null, __props.placeholder ?? "Pick a date", __props.formatDate ?? _defaultFormatDate), "displayText");
|
|
193
|
+
const state = {
|
|
194
|
+
value: __props.defaultValue ?? undefined ?? null,
|
|
195
|
+
dismissCleanup: null,
|
|
196
|
+
floatingCleanup: null
|
|
197
|
+
};
|
|
198
|
+
const calendarEl = computed(() => _buildCalendar({
|
|
199
|
+
mode: __props.mode ?? "single",
|
|
200
|
+
defaultValue: __props.defaultValue ?? undefined,
|
|
201
|
+
defaultMonth: __props.defaultMonth,
|
|
202
|
+
minDate: __props.minDate,
|
|
203
|
+
maxDate: __props.maxDate,
|
|
204
|
+
disabled: __props.disabled,
|
|
205
|
+
classes: __props.classes,
|
|
206
|
+
captionLayout: __props.captionLayout
|
|
207
|
+
}, handleCalendarValueChange));
|
|
208
|
+
const ctx = {
|
|
209
|
+
isOpen: () => isOpen.value,
|
|
210
|
+
hasValue: () => hasValue.value,
|
|
211
|
+
displayText: () => displayText.value,
|
|
212
|
+
contentId: ids.contentId,
|
|
213
|
+
triggerRef,
|
|
214
|
+
contentRef,
|
|
215
|
+
classes: __props.classes,
|
|
216
|
+
open,
|
|
217
|
+
close,
|
|
218
|
+
toggle
|
|
219
|
+
};
|
|
220
|
+
const __mfResult0 = DatePickerContext.Provider({ get value() {
|
|
221
|
+
return ctx;
|
|
222
|
+
}, children: () => (() => {
|
|
223
|
+
const __el0 = __element("span");
|
|
224
|
+
{
|
|
225
|
+
const __v = { position: "relative", display: "inline-block" };
|
|
226
|
+
if (__v != null && __v !== false)
|
|
227
|
+
__el0.setAttribute("style", typeof __v === "object" ? __styleStr(__v) : __v === true ? "" : String(__v));
|
|
228
|
+
}
|
|
229
|
+
__el0.setAttribute("data-datepicker-root", "");
|
|
230
|
+
__enterChildren(__el0);
|
|
231
|
+
__append(__el0, __child(() => __props.children ?? (() => {
|
|
232
|
+
const __el1 = document.createDocumentFragment();
|
|
233
|
+
__append(__el1, DatePickerTrigger({}));
|
|
234
|
+
__append(__el1, DatePickerContent({ children: () => __child(() => calendarEl.value) }));
|
|
235
|
+
return __el1;
|
|
236
|
+
})()));
|
|
237
|
+
__exitChildren();
|
|
238
|
+
return __el0;
|
|
239
|
+
})() });
|
|
240
|
+
__flushMountFrame();
|
|
241
|
+
return __mfResult0;
|
|
242
|
+
} catch (__mfErr) {
|
|
243
|
+
__discardMountFrame(__mfDepth);
|
|
244
|
+
throw __mfErr;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
var ComposedDatePicker = Object.assign(ComposedDatePickerRoot, {
|
|
248
|
+
Trigger: DatePickerTrigger,
|
|
249
|
+
Content: DatePickerContent
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
export { ComposedDatePicker };
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-a6wp8c32.js";
|
|
4
4
|
import {
|
|
5
5
|
createFloatingPosition
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-vef3sepw.js";
|
|
7
7
|
import {
|
|
8
8
|
Keys,
|
|
9
9
|
handleListNavigation,
|
|
@@ -85,7 +85,7 @@ function SelectRoot(options = {}) {
|
|
|
85
85
|
dismissCleanup?.();
|
|
86
86
|
dismissCleanup = null;
|
|
87
87
|
trigger.focus();
|
|
88
|
-
}, createItem = function(value, label
|
|
88
|
+
}, createItem = function(value, label) {
|
|
89
89
|
const isSelectedItem = value === defaultValue;
|
|
90
90
|
const item = (() => {
|
|
91
91
|
const __el3 = __element("div");
|
|
@@ -116,7 +116,6 @@ function SelectRoot(options = {}) {
|
|
|
116
116
|
triggerText.textContent = item.textContent ?? value;
|
|
117
117
|
}
|
|
118
118
|
items.push(item);
|
|
119
|
-
(parent ?? content).appendChild(item);
|
|
120
119
|
return item;
|
|
121
120
|
}, Item = function(value, label) {
|
|
122
121
|
return createItem(value, label);
|
|
@@ -131,19 +130,17 @@ function SelectRoot(options = {}) {
|
|
|
131
130
|
}
|
|
132
131
|
return __el4;
|
|
133
132
|
})();
|
|
134
|
-
content.appendChild(el);
|
|
135
133
|
return {
|
|
136
134
|
el,
|
|
137
|
-
Item: (value, itemLabel) => createItem(value, itemLabel
|
|
135
|
+
Item: (value, itemLabel) => createItem(value, itemLabel)
|
|
138
136
|
};
|
|
139
137
|
}, Separator = function() {
|
|
140
|
-
|
|
138
|
+
return (() => {
|
|
141
139
|
const __el5 = __element("hr");
|
|
140
|
+
__el5.setAttribute("data-v-id", "SelectRoot");
|
|
142
141
|
__el5.setAttribute("role", "separator");
|
|
143
142
|
return __el5;
|
|
144
143
|
})();
|
|
145
|
-
content.appendChild(hr);
|
|
146
|
-
return hr;
|
|
147
144
|
};
|
|
148
145
|
const { defaultValue = "", placeholder = "", onValueChange, positioning, ...attrs } = options;
|
|
149
146
|
const ids = linkedIds("select");
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-q7xbcj9q.js";
|
|
4
|
+
|
|
5
|
+
// src/card/card-composed.tsx
|
|
6
|
+
import { __append, __attr, __child, __discardMountFrame, __element, __enterChildren, __exitChildren, __flushMountFrame, __pushMountFrame } from "@vertz/ui/internals";
|
|
7
|
+
import { createContext, useContext } from "@vertz/ui";
|
|
8
|
+
var CardContext = createContext(undefined, "@vertz/ui-primitives::CardContext");
|
|
9
|
+
function CardHeader(__props) {
|
|
10
|
+
const __mfDepth = __pushMountFrame();
|
|
11
|
+
try {
|
|
12
|
+
const ctx = useContext(CardContext);
|
|
13
|
+
const __mfResult0 = (() => {
|
|
14
|
+
const __el0 = __element("div");
|
|
15
|
+
__attr(__el0, "class", () => cn(ctx?.classes?.header, __props.className ?? __props.class));
|
|
16
|
+
__enterChildren(__el0);
|
|
17
|
+
__append(__el0, __child(() => __props.children));
|
|
18
|
+
__exitChildren();
|
|
19
|
+
return __el0;
|
|
20
|
+
})();
|
|
21
|
+
__flushMountFrame();
|
|
22
|
+
return __mfResult0;
|
|
23
|
+
} catch (__mfErr) {
|
|
24
|
+
__discardMountFrame(__mfDepth);
|
|
25
|
+
throw __mfErr;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function CardTitle(__props) {
|
|
29
|
+
const __mfDepth = __pushMountFrame();
|
|
30
|
+
try {
|
|
31
|
+
const ctx = useContext(CardContext);
|
|
32
|
+
const __mfResult0 = (() => {
|
|
33
|
+
const __el0 = __element("h3");
|
|
34
|
+
__attr(__el0, "class", () => cn(ctx?.classes?.title, __props.className ?? __props.class));
|
|
35
|
+
__enterChildren(__el0);
|
|
36
|
+
__append(__el0, __child(() => __props.children));
|
|
37
|
+
__exitChildren();
|
|
38
|
+
return __el0;
|
|
39
|
+
})();
|
|
40
|
+
__flushMountFrame();
|
|
41
|
+
return __mfResult0;
|
|
42
|
+
} catch (__mfErr) {
|
|
43
|
+
__discardMountFrame(__mfDepth);
|
|
44
|
+
throw __mfErr;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function CardDescription(__props) {
|
|
48
|
+
const __mfDepth = __pushMountFrame();
|
|
49
|
+
try {
|
|
50
|
+
const ctx = useContext(CardContext);
|
|
51
|
+
const __mfResult0 = (() => {
|
|
52
|
+
const __el0 = __element("p");
|
|
53
|
+
__attr(__el0, "class", () => cn(ctx?.classes?.description, __props.className ?? __props.class));
|
|
54
|
+
__enterChildren(__el0);
|
|
55
|
+
__append(__el0, __child(() => __props.children));
|
|
56
|
+
__exitChildren();
|
|
57
|
+
return __el0;
|
|
58
|
+
})();
|
|
59
|
+
__flushMountFrame();
|
|
60
|
+
return __mfResult0;
|
|
61
|
+
} catch (__mfErr) {
|
|
62
|
+
__discardMountFrame(__mfDepth);
|
|
63
|
+
throw __mfErr;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function CardContent(__props) {
|
|
67
|
+
const __mfDepth = __pushMountFrame();
|
|
68
|
+
try {
|
|
69
|
+
const ctx = useContext(CardContext);
|
|
70
|
+
const __mfResult0 = (() => {
|
|
71
|
+
const __el0 = __element("div");
|
|
72
|
+
__attr(__el0, "class", () => cn(ctx?.classes?.content, __props.className ?? __props.class));
|
|
73
|
+
__enterChildren(__el0);
|
|
74
|
+
__append(__el0, __child(() => __props.children));
|
|
75
|
+
__exitChildren();
|
|
76
|
+
return __el0;
|
|
77
|
+
})();
|
|
78
|
+
__flushMountFrame();
|
|
79
|
+
return __mfResult0;
|
|
80
|
+
} catch (__mfErr) {
|
|
81
|
+
__discardMountFrame(__mfDepth);
|
|
82
|
+
throw __mfErr;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function CardFooter(__props) {
|
|
86
|
+
const __mfDepth = __pushMountFrame();
|
|
87
|
+
try {
|
|
88
|
+
const ctx = useContext(CardContext);
|
|
89
|
+
const __mfResult0 = (() => {
|
|
90
|
+
const __el0 = __element("div");
|
|
91
|
+
__attr(__el0, "class", () => cn(ctx?.classes?.footer, __props.className ?? __props.class));
|
|
92
|
+
__enterChildren(__el0);
|
|
93
|
+
__append(__el0, __child(() => __props.children));
|
|
94
|
+
__exitChildren();
|
|
95
|
+
return __el0;
|
|
96
|
+
})();
|
|
97
|
+
__flushMountFrame();
|
|
98
|
+
return __mfResult0;
|
|
99
|
+
} catch (__mfErr) {
|
|
100
|
+
__discardMountFrame(__mfDepth);
|
|
101
|
+
throw __mfErr;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function CardAction(__props) {
|
|
105
|
+
const __mfDepth = __pushMountFrame();
|
|
106
|
+
try {
|
|
107
|
+
const ctx = useContext(CardContext);
|
|
108
|
+
const __mfResult0 = (() => {
|
|
109
|
+
const __el0 = __element("div");
|
|
110
|
+
__attr(__el0, "class", () => cn(ctx?.classes?.action, __props.className ?? __props.class));
|
|
111
|
+
__enterChildren(__el0);
|
|
112
|
+
__append(__el0, __child(() => __props.children));
|
|
113
|
+
__exitChildren();
|
|
114
|
+
return __el0;
|
|
115
|
+
})();
|
|
116
|
+
__flushMountFrame();
|
|
117
|
+
return __mfResult0;
|
|
118
|
+
} catch (__mfErr) {
|
|
119
|
+
__discardMountFrame(__mfDepth);
|
|
120
|
+
throw __mfErr;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function ComposedCardRoot(__props) {
|
|
124
|
+
const __mfDepth = __pushMountFrame();
|
|
125
|
+
try {
|
|
126
|
+
const __mfResult0 = CardContext.Provider({ get value() {
|
|
127
|
+
return { classes: __props.classes };
|
|
128
|
+
}, children: () => (() => {
|
|
129
|
+
const __el0 = __element("div");
|
|
130
|
+
__attr(__el0, "class", () => cn(__props.classes?.root, __props.className ?? __props.class));
|
|
131
|
+
__enterChildren(__el0);
|
|
132
|
+
__append(__el0, __child(() => __props.children));
|
|
133
|
+
__exitChildren();
|
|
134
|
+
return __el0;
|
|
135
|
+
})() });
|
|
136
|
+
__flushMountFrame();
|
|
137
|
+
return __mfResult0;
|
|
138
|
+
} catch (__mfErr) {
|
|
139
|
+
__discardMountFrame(__mfDepth);
|
|
140
|
+
throw __mfErr;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
var ComposedCard = Object.assign(ComposedCardRoot, {
|
|
144
|
+
Header: CardHeader,
|
|
145
|
+
Title: CardTitle,
|
|
146
|
+
Description: CardDescription,
|
|
147
|
+
Content: CardContent,
|
|
148
|
+
Footer: CardFooter,
|
|
149
|
+
Action: CardAction
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
export { ComposedCard };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-q7xbcj9q.js";
|
|
4
|
+
|
|
5
|
+
// src/separator/separator-composed.tsx
|
|
6
|
+
import { computed } from "@vertz/ui";
|
|
7
|
+
import { __attr, __discardMountFrame, __element, __flushMountFrame, __pushMountFrame } from "@vertz/ui/internals";
|
|
8
|
+
function ComposedSeparatorRoot(__props) {
|
|
9
|
+
const __mfDepth = __pushMountFrame();
|
|
10
|
+
try {
|
|
11
|
+
const orientationClass = computed(() => (__props.orientation ?? "horizontal") === "vertical" ? __props.classes?.vertical : __props.classes?.horizontal);
|
|
12
|
+
const __mfResult0 = (() => {
|
|
13
|
+
const __el0 = __element("hr");
|
|
14
|
+
__attr(__el0, "class", () => cn(__props.classes?.base, orientationClass.value, __props.className ?? __props.class));
|
|
15
|
+
__el0.setAttribute("role", "separator");
|
|
16
|
+
__attr(__el0, "aria-orientation", () => __props.orientation ?? "horizontal");
|
|
17
|
+
return __el0;
|
|
18
|
+
})();
|
|
19
|
+
__flushMountFrame();
|
|
20
|
+
return __mfResult0;
|
|
21
|
+
} catch (__mfErr) {
|
|
22
|
+
__discardMountFrame(__mfDepth);
|
|
23
|
+
throw __mfErr;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
var ComposedSeparator = ComposedSeparatorRoot;
|
|
27
|
+
|
|
28
|
+
export { ComposedSeparator };
|