@krak-stack/registry 0.11.4 → 0.11.5
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/CHANGELOG.md +13 -1
- package/README.md +23 -9
- package/dist/components/agent/react.js +226 -1072
- package/dist/components/app-switcher/html.js +10 -53
- package/dist/components/app-switcher/react.js +29 -139
- package/dist/components/async-action-button/html.js +3 -34
- package/dist/components/async-action-button/react.d.ts +1 -1
- package/dist/components/async-action-button/react.js +8 -54
- package/dist/components/audit-log-table/react.js +555 -1265
- package/dist/components/bulk-list-input/html.js +3 -40
- package/dist/components/bulk-list-input/react.d.ts +1 -1
- package/dist/components/bulk-list-input/react.js +6 -59
- package/dist/components/code-block/html.js +1 -35
- package/dist/components/code-block/react.js +12 -59
- package/dist/components/color-input/html.js +2 -19
- package/dist/components/color-input/react.js +6 -97
- package/dist/components/copy-button/html.js +1 -35
- package/dist/components/copy-button/react.d.ts +1 -1
- package/dist/components/copy-button/react.js +7 -54
- package/dist/components/copy-value/html.js +11 -52
- package/dist/components/copy-value/react.js +25 -165
- package/dist/components/cron-input/html.js +2 -18
- package/dist/components/cron-input/react.js +15 -30
- package/dist/components/danger-confirmation/html.js +11 -57
- package/dist/components/danger-confirmation/react.js +26 -187
- package/dist/components/data-table/html.d.ts +12 -12
- package/dist/components/data-table/html.js +200 -174
- package/dist/components/data-table/react.js +549 -1259
- package/dist/components/date-input/html.js +19 -74
- package/dist/components/date-input/react.d.ts +1 -1
- package/dist/components/date-input/react.js +28 -313
- package/dist/components/docs/classes.d.ts +15 -0
- package/dist/components/docs/html.d.ts +55 -0
- package/dist/components/docs/html.js +837 -0
- package/dist/components/docs/index.d.ts +49 -0
- package/dist/components/docs/react.d.ts +10 -0
- package/dist/components/docs/react.js +949 -0
- package/dist/components/docs/schema.d.ts +49 -0
- package/dist/components/editable-text/html.js +6 -52
- package/dist/components/editable-text/react.js +13 -83
- package/dist/components/editing-locale-switcher/html.d.ts +2 -2
- package/dist/components/editing-locale-switcher/html.js +13 -43
- package/dist/components/editing-locale-switcher/react.js +17 -141
- package/dist/components/effect-form/react.js +249 -812
- package/dist/components/email-composer/react.js +62 -279
- package/dist/components/email-editor/html.js +13 -58
- package/dist/components/email-editor/react.js +187 -483
- package/dist/components/error-component/html.js +2 -47
- package/dist/components/error-component/react.js +33 -137
- package/dist/components/file-input/html.js +9 -40
- package/dist/components/file-input/react.js +39 -208
- package/dist/components/form/react.js +212 -777
- package/dist/components/icon-input/html.js +9 -56
- package/dist/components/icon-input/react.js +43 -143
- package/dist/components/image-crop-editor/html.js +1 -35
- package/dist/components/image-crop-editor/react.js +21 -66
- package/dist/components/locale-switcher/html.js +8 -55
- package/dist/components/locale-switcher/react.js +21 -146
- package/dist/components/map-menu/html.d.ts +8 -8
- package/dist/components/map-menu/html.js +13 -72
- package/dist/components/map-menu/react.js +92 -309
- package/dist/components/markdown/html.js +1 -35
- package/dist/components/markdown/react.js +20 -64
- package/dist/components/notification-menu/html.js +14 -50
- package/dist/components/notification-menu/react.js +73 -343
- package/dist/components/pagination/html.js +17 -73
- package/dist/components/pagination/react.js +37 -200
- package/dist/components/phone-number-input/html.js +19 -57
- package/dist/components/phone-number-input/react.d.ts +1 -1
- package/dist/components/phone-number-input/react.js +43 -142
- package/dist/components/presence-transition/index.d.ts +2 -2
- package/dist/components/registry-previews/component-example.js +26 -126
- package/dist/components/rich-text-editor/html.d.ts +12 -12
- package/dist/components/rich-text-editor/html.js +12 -85
- package/dist/components/rich-text-editor/react.js +55 -272
- package/dist/components/search-menu/classes.d.ts +2 -0
- package/dist/components/search-menu/html.d.ts +2 -0
- package/dist/components/search-menu/html.js +40 -73
- package/dist/components/search-menu/index.d.ts +27 -2
- package/dist/components/search-menu/react.d.ts +1 -1
- package/dist/components/search-menu/react.js +59 -280
- package/dist/components/search-menu/schema.d.ts +1 -0
- package/dist/components/select-with-custom-input/html.d.ts +2 -2
- package/dist/components/select-with-custom-input/html.js +13 -48
- package/dist/components/select-with-custom-input/react.js +22 -146
- package/dist/components/sidebar-layout/html.d.ts +16 -6
- package/dist/components/sidebar-layout/html.js +83 -69
- package/dist/components/sidebar-layout/index.d.ts +16 -0
- package/dist/components/sidebar-layout/react.js +105 -698
- package/dist/components/stats-card/react.js +13 -58
- package/dist/components/support/html.js +14 -69
- package/dist/components/support/react.js +74 -320
- package/dist/components/theme-switcher/html.js +11 -55
- package/dist/components/theme-switcher/react.js +28 -152
- package/dist/components/time-input/html.d.ts +2 -2
- package/dist/components/time-input/html.js +8 -53
- package/dist/components/time-input/react.js +34 -188
- package/dist/components/timezone-input/html.js +11 -67
- package/dist/components/timezone-input/react.js +41 -143
- package/dist/components/toast/html.d.ts +6 -6
- package/dist/components/toast/html.js +13 -46
- package/dist/components/tracking-notice/react.js +39 -188
- package/dist/components/unsaved-changes-guard/html.js +9 -43
- package/dist/components/unsaved-changes-guard/react.js +19 -169
- package/dist/components/upload-attachment/html.d.ts +4 -4
- package/dist/components/upload-attachment/html.js +4 -35
- package/dist/components/upload-attachment/react.js +25 -164
- package/dist/components/virtualized-combobox/html.js +10 -35
- package/dist/components/virtualized-combobox/react.js +28 -129
- package/dist/components/webhook-delivery-table/html.js +211 -184
- package/dist/components/webhook-delivery-table/react.js +585 -1362
- package/dist/lib/docs.integrations.server.js +150 -202
- package/dist/lib/docs.js +305 -1085
- package/dist/lib/docs.server.js +134 -186
- package/dist/lib/documentation-toolkit.js +144 -196
- package/dist/services/agent/client/index.js +226 -1072
- package/dist/services/notification/client/index.js +73 -343
- package/dist/services/notification/public.js +73 -343
- package/package.json +5 -13
- package/dist/components/effectcn/alert-dialog.d.ts +0 -13
- package/dist/components/effectcn/button.d.ts +0 -31
- package/dist/components/effectcn/calendar.d.ts +0 -12
- package/dist/components/effectcn/checkbox.d.ts +0 -10
- package/dist/components/effectcn/combobox.d.ts +0 -25
- package/dist/components/effectcn/dialog.d.ts +0 -19
- package/dist/components/effectcn/field.d.ts +0 -11
- package/dist/components/effectcn/file-drop.d.ts +0 -8
- package/dist/components/effectcn/input.d.ts +0 -26
- package/dist/components/effectcn/menu.d.ts +0 -85
- package/dist/components/effectcn/menubar.d.ts +0 -8
- package/dist/components/effectcn/popover.d.ts +0 -18
- package/dist/components/effectcn/scroll-area.d.ts +0 -12
- package/dist/components/effectcn/select.d.ts +0 -68
- package/dist/components/effectcn/toast.d.ts +0 -29
- package/dist/components/ui/alert-dialog.d.ts +0 -18
- package/dist/components/ui/alert.d.ts +0 -10
- package/dist/components/ui/attachment.d.ts +0 -23
- package/dist/components/ui/badge.d.ts +0 -7
- package/dist/components/ui/bubble.d.ts +0 -16
- package/dist/components/ui/button.d.ts +0 -8
- package/dist/components/ui/calendar.d.ts +0 -10
- package/dist/components/ui/card.d.ts +0 -11
- package/dist/components/ui/checkbox.d.ts +0 -3
- package/dist/components/ui/collapsible.d.ts +0 -5
- package/dist/components/ui/command.d.ts +0 -18
- package/dist/components/ui/dialog.d.ts +0 -17
- package/dist/components/ui/dropdown-menu.d.ts +0 -29
- package/dist/components/ui/empty.d.ts +0 -11
- package/dist/components/ui/field.d.ts +0 -24
- package/dist/components/ui/input-group.d.ts +0 -17
- package/dist/components/ui/input.d.ts +0 -3
- package/dist/components/ui/item.d.ts +0 -22
- package/dist/components/ui/label.d.ts +0 -3
- package/dist/components/ui/menubar.d.ts +0 -29
- package/dist/components/ui/message-scroller.d.ts +0 -10
- package/dist/components/ui/message.d.ts +0 -10
- package/dist/components/ui/popover.d.ts +0 -9
- package/dist/components/ui/scroll-area.d.ts +0 -4
- package/dist/components/ui/select.d.ts +0 -15
- package/dist/components/ui/select.js +0 -159
- package/dist/components/ui/separator.d.ts +0 -3
- package/dist/components/ui/sheet.d.ts +0 -14
- package/dist/components/ui/sidebar.d.ts +0 -63
- package/dist/components/ui/skeleton.d.ts +0 -2
- package/dist/components/ui/table.d.ts +0 -10
- package/dist/components/ui/tabs.d.ts +0 -10
- package/dist/components/ui/textarea.d.ts +0 -3
- package/dist/components/ui/tooltip.d.ts +0 -6
- package/dist/components/ui/trace.d.ts +0 -18
- package/dist/lib/effectcn-form.d.ts +0 -3
- package/dist/lib/effectcn-form.js +0 -54
|
@@ -1,81 +1,26 @@
|
|
|
1
1
|
// ../../src/components/date-input/html.ts
|
|
2
|
-
import { DateTime as
|
|
2
|
+
import { DateTime as DateTime2, Effect, Schema as Schema3, Stream } from "effect";
|
|
3
3
|
import { Component as Component2, Mount } from "effect/ui";
|
|
4
4
|
import { Html } from "effect/ui/html";
|
|
5
5
|
import { Calendar, Popover } from "effect/ui/kit";
|
|
6
|
-
|
|
7
|
-
// ../../src/components/effectcn/button.ts
|
|
6
|
+
import { Button, buttonVariants } from "@/components/effectcn/button";
|
|
8
7
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
// ../../src/components/effectcn/button.ts
|
|
16
|
-
var base = "inline-flex h-8.5 shrink-0 items-center justify-center gap-1.5 rounded-md border border-transparent px-3.5 text-[13px] leading-none font-medium whitespace-nowrap no-underline select-none transition-[background-color,border-color,color,opacity] duration-150 active:translate-y-px data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:size-[15px] [&_svg]:shrink-0 data-[loading]:before:size-3 data-[loading]:before:animate-spin data-[loading]:before:rounded-full data-[loading]:before:border-2 data-[loading]:before:border-current data-[loading]:before:border-r-transparent";
|
|
17
|
-
var variants = {
|
|
18
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/85",
|
|
19
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-accent",
|
|
20
|
-
outline: "border-input bg-background text-foreground shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
21
|
-
ghost: "text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
22
|
-
brand: "bg-brand-soft text-brand-soft-foreground hover:bg-brand-soft/85",
|
|
23
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85",
|
|
24
|
-
link: "h-auto px-0 text-foreground underline decoration-transparent underline-offset-4 hover:decoration-current"
|
|
25
|
-
};
|
|
26
|
-
var sizes = {
|
|
27
|
-
default: "",
|
|
28
|
-
sm: "h-7 rounded-sm px-2.5 text-xs",
|
|
29
|
-
lg: "h-10 px-5 text-sm",
|
|
30
|
-
icon: "w-8.5 px-0",
|
|
31
|
-
"icon-sm": "h-7 w-7 rounded-sm px-0"
|
|
32
|
-
};
|
|
33
|
-
var buttonVariants = (options = {}) => cn(base, variants[options.variant ?? "default"], sizes[options.size ?? "default"], options.class);
|
|
34
|
-
var Button = (h, options = {}) => KitButton(h, {
|
|
35
|
-
element: options.element,
|
|
36
|
-
onPress: options.onPress,
|
|
37
|
-
props: options.loading ? { ...options.props, disabled: true, focusableWhenDisabled: true } : options.props
|
|
38
|
-
}).class(buttonVariants(options)).attr("data-loading", options.loading ? "" : undefined);
|
|
39
|
-
|
|
40
|
-
// ../../src/components/effectcn/calendar.ts
|
|
41
|
-
import { DateTime } from "effect";
|
|
42
|
-
import { ChevronLeft, ChevronRight } from "@krak-stack/registry/lucide-effect";
|
|
43
|
-
var navClass = "inline-grid size-7 shrink-0 place-items-center rounded-sm border border-input bg-background " + "text-foreground transition-colors duration-150 hover:bg-accent data-[disabled]:cursor-not-allowed " + "data-[disabled]:opacity-40 data-[disabled]:hover:bg-background [&_svg]:size-3.5 rtl:[&_svg]:rotate-180";
|
|
44
|
-
var dayClass = "inline-grid size-8 place-items-center rounded-sm p-0 text-[13px] text-foreground tabular-nums " + "transition-colors duration-150 hover:bg-accent focus-visible:relative focus-visible:outline-offset-1 " + "not-data-[selected]:data-[today]:bg-accent data-[today]:font-semibold " + "not-data-[selected]:data-[outside-month]:text-muted-foreground not-data-[selected]:data-[outside-month]:opacity-55 " + "data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:hover:bg-primary " + "data-[unavailable]:cursor-not-allowed data-[unavailable]:text-muted-foreground data-[unavailable]:line-through " + "data-[unavailable]:hover:bg-transparent " + "data-[disabled]:cursor-not-allowed data-[disabled]:text-muted-foreground data-[disabled]:opacity-35! " + "data-[disabled]:hover:bg-transparent";
|
|
45
|
-
var CalendarRoot = (h, calendar, options = {}) => calendar.root(h.div.class(cn("inline-flex w-fit flex-col gap-2.5 text-[13px] outline-none data-[disabled]:opacity-60", options.variant !== "ghost" && "bg-card rounded-lg border p-3 shadow-sm", options.class)));
|
|
46
|
-
var CalendarHeader = (h, calendar, month) => h.div.class("flex min-h-7 items-center gap-1").children(calendar.previous(h.button.class(navClass)).children(ChevronLeft(h)), month.heading(h.h3.class("flex-1 text-center text-[13px] font-medium")).children(month.title), calendar.next(h.button.class(navClass)).children(ChevronRight(h)));
|
|
47
|
-
var CalendarGrid = (h, calendar, month) => month.grid(h.table.class("border-separate border-spacing-x-0 border-spacing-y-0.5")).children(h.thead(h.tr.children(calendar.weekdays.map((weekday, index) => calendar.weekday({
|
|
48
|
-
element: h.th.key(weekday.long).class("h-6 w-8 p-0 text-xs font-normal text-muted-foreground"),
|
|
49
|
-
index
|
|
50
|
-
}).children(weekday.short)))), h.tbody(month.weeks.map((week) => h.tr.key(String(week[0]?.epochMilliseconds)).children(week.map((date) => month.cell({
|
|
51
|
-
element: h.td.key(String(date.epochMilliseconds)).class("p-0 text-center"),
|
|
52
|
-
date
|
|
53
|
-
}).children(month.day({ element: h.button.class(dayClass), date }).children(String(DateTime.getPartUtc(date, "day")))))))));
|
|
54
|
-
|
|
55
|
-
// ../../src/components/effectcn/input.ts
|
|
8
|
+
CalendarGrid,
|
|
9
|
+
CalendarHeader,
|
|
10
|
+
CalendarRoot
|
|
11
|
+
} from "@/components/effectcn/calendar";
|
|
12
|
+
import { Input, InputGroup } from "@/components/effectcn/input";
|
|
56
13
|
import {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
default: "",
|
|
62
|
-
sm: "h-7 rounded-sm px-2.5 text-xs",
|
|
63
|
-
lg: "h-10 px-3.5 text-sm"
|
|
64
|
-
};
|
|
65
|
-
var inputVariants = (options = {}) => cn(base2, sizes2[options.size ?? "default"], options.class);
|
|
66
|
-
var Input = (h, options) => KitInput(h, options).class(inputVariants(options));
|
|
67
|
-
var InputGroup = (h, options = {}) => h.div.class(cn("border-input bg-background flex h-8.5 w-full items-center rounded-md border shadow-sm", "focus-within:border-ring focus-within:ring-ring/20 transition-[border-color,box-shadow] duration-150 focus-within:ring-3", "has-[input[aria-invalid=true]]:border-destructive has-[input[data-disabled]]:opacity-50", "[&>input]:h-full [&>input]:flex-1 [&>input]:border-0 [&>input]:bg-transparent [&>input]:shadow-none [&>input]:focus-visible:ring-0", options.class));
|
|
68
|
-
|
|
69
|
-
// ../../src/components/effectcn/popover.ts
|
|
70
|
-
var sizes3 = { sm: "w-56", default: "w-72", auto: "w-auto" };
|
|
71
|
-
var PopoverPositioner = (h, popover, options = {}) => popover.positioner(h.div.class(cn("z-50 outline-none", options.class)));
|
|
72
|
-
var PopoverPopup = (h, popover, options = {}) => popover.popup(h.div.class(cn("bg-popover relative flex origin-[var(--transform-origin)] flex-col gap-2 rounded-lg border p-4 text-[13px]", "text-popover-foreground shadow-md outline-none", "h-[var(--popup-height,auto)] transition-[opacity,scale,height] duration-150 ease-out", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[instant]:duration-0", sizes3[options.size ?? "default"], options.class)));
|
|
73
|
-
var PopoverTitle = (h, popover, options = {}) => popover.title(h.h2.class(cn("m-0 border-0 p-0 text-sm leading-snug font-semibold", options.class)));
|
|
74
|
-
|
|
75
|
-
// ../../src/components/date-input/html.ts
|
|
14
|
+
PopoverPopup,
|
|
15
|
+
PopoverPositioner,
|
|
16
|
+
PopoverTitle
|
|
17
|
+
} from "@/components/effectcn/popover";
|
|
76
18
|
import { krakstackLocaleRead } from "@krak-stack/registry/krakstack-provider/html";
|
|
77
19
|
import { CalendarDays as CalendarIcon, X } from "@krak-stack/registry/lucide-effect";
|
|
78
20
|
|
|
21
|
+
// ../../src/lib/utils.ts
|
|
22
|
+
import { cn } from "cn";
|
|
23
|
+
|
|
79
24
|
// ../../src/components/date-input/classes.ts
|
|
80
25
|
var dateInputClasses = {
|
|
81
26
|
actions: "size-6 bg-clip-padding hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent",
|
|
@@ -91,7 +36,7 @@ var resolveDateInputClasses = (overrides) => ({
|
|
|
91
36
|
});
|
|
92
37
|
|
|
93
38
|
// ../../src/components/date-input/index.ts
|
|
94
|
-
import { DateTime
|
|
39
|
+
import { DateTime, Schema as Schema2 } from "effect";
|
|
95
40
|
import { Component, UiSchema } from "effect/ui";
|
|
96
41
|
|
|
97
42
|
// ../../src/components/date-input/schema.ts
|
|
@@ -206,7 +151,7 @@ var dateInputBehaviours = {
|
|
|
206
151
|
const fallback = new Date;
|
|
207
152
|
fallback.setUTCHours(0, 0, 0, 0);
|
|
208
153
|
const date = (getDateInputState($.props) === "valid" ? parseDateOnly(value) : undefined) ?? parseDateOnly(min ?? "") ?? parseDateOnly(max ?? "") ?? fallback;
|
|
209
|
-
return { open: true, month:
|
|
154
|
+
return { open: true, month: DateTime.makeUnsafe(date) };
|
|
210
155
|
},
|
|
211
156
|
Closed: () => ({ open: false, month: null }),
|
|
212
157
|
Edited: ($, { value }) => change($, value, false),
|
|
@@ -219,7 +164,7 @@ var dateInputBehaviours = {
|
|
|
219
164
|
var ApplyDateValidity = Mount.make("ApplyDateValidity", { args: { error: Schema3.String } }, (input, _, changes) => changes.pipe(Stream.runForEach(({ error }) => Effect.sync(() => input.setCustomValidity(error))), Effect.as(Component2.noop)));
|
|
220
165
|
var toUtc = (value) => {
|
|
221
166
|
const date = parseDateOnly(value ?? "");
|
|
222
|
-
return date ?
|
|
167
|
+
return date ? DateTime2.makeUnsafe(date) : undefined;
|
|
223
168
|
};
|
|
224
169
|
var DateInput = Html.component({
|
|
225
170
|
...dateInputOptions,
|
|
@@ -290,11 +235,11 @@ var DateInput = Html.component({
|
|
|
290
235
|
min: toUtc(p.min),
|
|
291
236
|
max: toUtc(p.max),
|
|
292
237
|
locale,
|
|
293
|
-
today:
|
|
238
|
+
today: DateTime2.makeUnsafe(new Date)
|
|
294
239
|
},
|
|
295
240
|
onEmit: {
|
|
296
241
|
Picked: ({ date }) => DateInputMessage.Picked({
|
|
297
|
-
value:
|
|
242
|
+
value: DateTime2.formatIso(date).slice(0, 10)
|
|
298
243
|
}),
|
|
299
244
|
RequestedMonth: ({ month }) => DateInputMessage.MonthChanged({ month })
|
|
300
245
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps } from "react";
|
|
2
|
-
import { Calendar } from "
|
|
2
|
+
import { Calendar } from "@/components/ui/calendar";
|
|
3
3
|
import { type DateInputSharedProps } from "./schema.js";
|
|
4
4
|
export { DateOnlySchema, getDateInputState, parseDateOnly } from "./schema.js";
|
|
5
5
|
export type { DateInputMessages } from "./schema.js";
|
|
@@ -1,309 +1,24 @@
|
|
|
1
1
|
// ../../src/components/date-input/react.tsx
|
|
2
|
-
import { useEffect
|
|
2
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
3
3
|
import { CalendarDays, X } from "lucide-react";
|
|
4
4
|
import { enUS, fr } from "react-day-picker/locale";
|
|
5
|
-
|
|
6
|
-
// ../../src/components/ui/calendar.tsx
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import { cn as cn2 } from "cn";
|
|
5
|
+
import { Calendar, CalendarDayButton } from "@/components/ui/calendar";
|
|
9
6
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
InputGroup,
|
|
8
|
+
InputGroupButton,
|
|
9
|
+
InputGroupInput
|
|
10
|
+
} from "@/components/ui/input-group";
|
|
11
|
+
import {
|
|
12
|
+
Popover,
|
|
13
|
+
PopoverContent,
|
|
14
|
+
PopoverTitle,
|
|
15
|
+
PopoverTrigger
|
|
16
|
+
} from "@/components/ui/popover";
|
|
17
|
+
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
17
18
|
|
|
18
19
|
// ../../src/lib/utils.ts
|
|
19
20
|
import { cn } from "cn";
|
|
20
21
|
|
|
21
|
-
// ../../src/components/ui/button.tsx
|
|
22
|
-
import { jsx } from "react/jsx-runtime";
|
|
23
|
-
var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
24
|
-
variants: {
|
|
25
|
-
variant: {
|
|
26
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
27
|
-
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
28
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
29
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
30
|
-
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
31
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
32
|
-
},
|
|
33
|
-
size: {
|
|
34
|
-
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
35
|
-
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
36
|
-
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
37
|
-
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
38
|
-
icon: "size-9",
|
|
39
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
40
|
-
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
41
|
-
"icon-lg": "size-10"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
defaultVariants: {
|
|
45
|
-
variant: "default",
|
|
46
|
-
size: "default"
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
function Button({
|
|
50
|
-
className,
|
|
51
|
-
variant = "default",
|
|
52
|
-
size = "default",
|
|
53
|
-
...props
|
|
54
|
-
}) {
|
|
55
|
-
return /* @__PURE__ */ jsx(ButtonPrimitive, {
|
|
56
|
-
"data-slot": "button",
|
|
57
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
58
|
-
...props
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// ../../src/components/ui/calendar.tsx
|
|
63
|
-
import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from "lucide-react";
|
|
64
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
65
|
-
function Calendar({
|
|
66
|
-
className,
|
|
67
|
-
classNames,
|
|
68
|
-
showOutsideDays = true,
|
|
69
|
-
captionLayout = "label",
|
|
70
|
-
buttonVariant = "ghost",
|
|
71
|
-
locale,
|
|
72
|
-
formatters,
|
|
73
|
-
components,
|
|
74
|
-
...props
|
|
75
|
-
}) {
|
|
76
|
-
const defaultClassNames = getDefaultClassNames();
|
|
77
|
-
return /* @__PURE__ */ jsx2(DayPicker, {
|
|
78
|
-
showOutsideDays,
|
|
79
|
-
className: cn2("group/calendar bg-background p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
|
|
80
|
-
captionLayout,
|
|
81
|
-
locale,
|
|
82
|
-
formatters: {
|
|
83
|
-
formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: "short" }),
|
|
84
|
-
...formatters
|
|
85
|
-
},
|
|
86
|
-
classNames: {
|
|
87
|
-
root: cn2("w-fit", defaultClassNames.root),
|
|
88
|
-
months: cn2("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
89
|
-
month: cn2("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
90
|
-
nav: cn2("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
|
|
91
|
-
button_previous: cn2(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
|
|
92
|
-
button_next: cn2(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
93
|
-
month_caption: cn2("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
94
|
-
dropdowns: cn2("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
95
|
-
dropdown_root: cn2("relative rounded-(--cell-radius)", defaultClassNames.dropdown_root),
|
|
96
|
-
dropdown: cn2("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
97
|
-
caption_label: cn2("font-medium select-none", captionLayout === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
|
|
98
|
-
month_grid: cn2("w-full border-collapse", defaultClassNames.month_grid),
|
|
99
|
-
weekdays: cn2("flex", defaultClassNames.weekdays),
|
|
100
|
-
weekday: cn2("flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
|
|
101
|
-
week: cn2("mt-2 flex w-full", defaultClassNames.week),
|
|
102
|
-
week_number_header: cn2("w-(--cell-size) select-none", defaultClassNames.week_number_header),
|
|
103
|
-
week_number: cn2("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
|
|
104
|
-
day: cn2("group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", defaultClassNames.day),
|
|
105
|
-
range_start: cn2("relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted", defaultClassNames.range_start),
|
|
106
|
-
range_middle: cn2("rounded-none", defaultClassNames.range_middle),
|
|
107
|
-
range_end: cn2("relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted", defaultClassNames.range_end),
|
|
108
|
-
today: cn2("rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
109
|
-
outside: cn2("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
110
|
-
disabled: cn2("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
111
|
-
hidden: cn2("invisible", defaultClassNames.hidden),
|
|
112
|
-
...classNames
|
|
113
|
-
},
|
|
114
|
-
components: {
|
|
115
|
-
Root: ({ className, rootRef, ...props }) => {
|
|
116
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
117
|
-
"data-slot": "calendar",
|
|
118
|
-
ref: rootRef,
|
|
119
|
-
className: cn2(className),
|
|
120
|
-
...props
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
|
-
Chevron: ({ className, orientation, ...props }) => {
|
|
124
|
-
if (orientation === "left") {
|
|
125
|
-
return /* @__PURE__ */ jsx2(ChevronLeftIcon, {
|
|
126
|
-
className: cn2("size-4", className),
|
|
127
|
-
...props
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
if (orientation === "right") {
|
|
131
|
-
return /* @__PURE__ */ jsx2(ChevronRightIcon, {
|
|
132
|
-
className: cn2("size-4", className),
|
|
133
|
-
...props
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
return /* @__PURE__ */ jsx2(ChevronDownIcon, {
|
|
137
|
-
className: cn2("size-4", className),
|
|
138
|
-
...props
|
|
139
|
-
});
|
|
140
|
-
},
|
|
141
|
-
DayButton: ({ ...props }) => /* @__PURE__ */ jsx2(CalendarDayButton, {
|
|
142
|
-
locale,
|
|
143
|
-
...props
|
|
144
|
-
}),
|
|
145
|
-
WeekNumber: ({ children, ...props }) => {
|
|
146
|
-
return /* @__PURE__ */ jsx2("td", {
|
|
147
|
-
...props,
|
|
148
|
-
children: /* @__PURE__ */ jsx2("div", {
|
|
149
|
-
className: "flex size-(--cell-size) items-center justify-center text-center",
|
|
150
|
-
children
|
|
151
|
-
})
|
|
152
|
-
});
|
|
153
|
-
},
|
|
154
|
-
...components
|
|
155
|
-
},
|
|
156
|
-
...props
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
function CalendarDayButton({
|
|
160
|
-
className,
|
|
161
|
-
day,
|
|
162
|
-
modifiers,
|
|
163
|
-
locale,
|
|
164
|
-
...props
|
|
165
|
-
}) {
|
|
166
|
-
const defaultClassNames = getDefaultClassNames();
|
|
167
|
-
const ref = React.useRef(null);
|
|
168
|
-
React.useEffect(() => {
|
|
169
|
-
if (modifiers.focused)
|
|
170
|
-
ref.current?.focus();
|
|
171
|
-
}, [modifiers.focused]);
|
|
172
|
-
return /* @__PURE__ */ jsx2(Button, {
|
|
173
|
-
variant: "ghost",
|
|
174
|
-
size: "icon",
|
|
175
|
-
"data-day": day.date.toLocaleDateString(locale?.code),
|
|
176
|
-
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
177
|
-
"data-range-start": modifiers.range_start,
|
|
178
|
-
"data-range-end": modifiers.range_end,
|
|
179
|
-
"data-range-middle": modifiers.range_middle,
|
|
180
|
-
className: cn2("relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className),
|
|
181
|
-
...props
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// ../../src/components/ui/input-group.tsx
|
|
186
|
-
import { cva as cva2 } from "class-variance-authority";
|
|
187
|
-
|
|
188
|
-
// ../../src/components/ui/input.tsx
|
|
189
|
-
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
190
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
191
|
-
function Input({ className, type, ...props }) {
|
|
192
|
-
return /* @__PURE__ */ jsx3(InputPrimitive, {
|
|
193
|
-
type,
|
|
194
|
-
"data-slot": "input",
|
|
195
|
-
className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
196
|
-
...props
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// ../../src/components/ui/input-group.tsx
|
|
201
|
-
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
202
|
-
function InputGroup({ className, ...props }) {
|
|
203
|
-
return /* @__PURE__ */ jsx4("div", {
|
|
204
|
-
"data-slot": "input-group",
|
|
205
|
-
role: "group",
|
|
206
|
-
className: cn("group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className),
|
|
207
|
-
...props
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
var inputGroupAddonVariants = cva2("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
211
|
-
variants: {
|
|
212
|
-
align: {
|
|
213
|
-
"inline-start": "order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]",
|
|
214
|
-
"inline-end": "order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]",
|
|
215
|
-
"block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
216
|
-
"block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
defaultVariants: { align: "inline-start" }
|
|
220
|
-
});
|
|
221
|
-
var inputGroupButtonVariants = cva2("flex items-center gap-2 text-sm shadow-none", {
|
|
222
|
-
variants: {
|
|
223
|
-
size: {
|
|
224
|
-
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
225
|
-
sm: "",
|
|
226
|
-
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
227
|
-
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
228
|
-
}
|
|
229
|
-
},
|
|
230
|
-
defaultVariants: { size: "xs" }
|
|
231
|
-
});
|
|
232
|
-
function InputGroupButton({
|
|
233
|
-
className,
|
|
234
|
-
type = "button",
|
|
235
|
-
variant = "ghost",
|
|
236
|
-
size = "xs",
|
|
237
|
-
...props
|
|
238
|
-
}) {
|
|
239
|
-
return /* @__PURE__ */ jsx4(Button, {
|
|
240
|
-
type,
|
|
241
|
-
"data-size": size,
|
|
242
|
-
variant,
|
|
243
|
-
className: cn(inputGroupButtonVariants({ size }), className),
|
|
244
|
-
...props
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
function InputGroupInput({
|
|
248
|
-
className,
|
|
249
|
-
...props
|
|
250
|
-
}) {
|
|
251
|
-
return /* @__PURE__ */ jsx4(Input, {
|
|
252
|
-
"data-slot": "input-group-control",
|
|
253
|
-
className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent", className),
|
|
254
|
-
...props
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// ../../src/components/ui/popover.tsx
|
|
259
|
-
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
260
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
261
|
-
function Popover({ ...props }) {
|
|
262
|
-
return /* @__PURE__ */ jsx5(PopoverPrimitive.Root, {
|
|
263
|
-
"data-slot": "popover",
|
|
264
|
-
...props
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
function PopoverTrigger({ ...props }) {
|
|
268
|
-
return /* @__PURE__ */ jsx5(PopoverPrimitive.Trigger, {
|
|
269
|
-
"data-slot": "popover-trigger",
|
|
270
|
-
...props
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
function PopoverContent({
|
|
274
|
-
className,
|
|
275
|
-
align = "center",
|
|
276
|
-
alignOffset = 0,
|
|
277
|
-
side = "bottom",
|
|
278
|
-
sideOffset = 4,
|
|
279
|
-
...props
|
|
280
|
-
}) {
|
|
281
|
-
return /* @__PURE__ */ jsx5(PopoverPrimitive.Portal, {
|
|
282
|
-
children: /* @__PURE__ */ jsx5(PopoverPrimitive.Positioner, {
|
|
283
|
-
align,
|
|
284
|
-
alignOffset,
|
|
285
|
-
side,
|
|
286
|
-
sideOffset,
|
|
287
|
-
className: "isolate z-50",
|
|
288
|
-
children: /* @__PURE__ */ jsx5(PopoverPrimitive.Popup, {
|
|
289
|
-
"data-slot": "popover-content",
|
|
290
|
-
className: cn("z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-md bg-popover p-4 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
291
|
-
...props
|
|
292
|
-
})
|
|
293
|
-
})
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
function PopoverTitle({ className, ...props }) {
|
|
297
|
-
return /* @__PURE__ */ jsx5(PopoverPrimitive.Title, {
|
|
298
|
-
"data-slot": "popover-title",
|
|
299
|
-
className: cn("font-medium", className),
|
|
300
|
-
...props
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
// ../../src/components/date-input/react.tsx
|
|
305
|
-
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
306
|
-
|
|
307
22
|
// ../../src/components/date-input/classes.ts
|
|
308
23
|
var dateInputClasses = {
|
|
309
24
|
actions: "size-6 bg-clip-padding hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent",
|
|
@@ -442,16 +157,16 @@ var dateInputBehaviours = {
|
|
|
442
157
|
};
|
|
443
158
|
|
|
444
159
|
// ../../src/components/date-input/react.tsx
|
|
445
|
-
import { jsx
|
|
160
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
446
161
|
"use client";
|
|
447
162
|
var DateInputDayButton = (props) => {
|
|
448
|
-
const ref =
|
|
449
|
-
|
|
163
|
+
const ref = useRef(null);
|
|
164
|
+
useEffect(() => {
|
|
450
165
|
if (props.modifiers.focused)
|
|
451
166
|
ref.current?.focus();
|
|
452
167
|
}, [props.modifiers.focused]);
|
|
453
168
|
const buttonProps = { ...props, ref };
|
|
454
|
-
return /* @__PURE__ */
|
|
169
|
+
return /* @__PURE__ */ jsx(CalendarDayButton, {
|
|
455
170
|
...buttonProps
|
|
456
171
|
});
|
|
457
172
|
};
|
|
@@ -495,7 +210,7 @@ var DateInput = ({
|
|
|
495
210
|
"data-state": status,
|
|
496
211
|
className: cn(dateInputClasses.root, className),
|
|
497
212
|
children: [
|
|
498
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ jsx("label", {
|
|
499
214
|
htmlFor: id,
|
|
500
215
|
"data-slot": "date-input-label",
|
|
501
216
|
className: dateInputClasses.label,
|
|
@@ -506,7 +221,7 @@ var DateInput = ({
|
|
|
506
221
|
className: "min-w-0 gap-1 pe-1 data-[disabled]:opacity-50 [&>input:disabled]:opacity-100",
|
|
507
222
|
"data-disabled": disabled || undefined,
|
|
508
223
|
children: [
|
|
509
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ jsx(InputGroupInput, {
|
|
510
225
|
ref: (element) => {
|
|
511
226
|
element?.setCustomValidity(error ?? "");
|
|
512
227
|
},
|
|
@@ -528,7 +243,7 @@ var DateInput = ({
|
|
|
528
243
|
onValueChange(event.target.value);
|
|
529
244
|
}
|
|
530
245
|
}),
|
|
531
|
-
clearable && value ? /* @__PURE__ */
|
|
246
|
+
clearable && value ? /* @__PURE__ */ jsx(InputGroupButton, {
|
|
532
247
|
type: "button",
|
|
533
248
|
size: "icon-xs",
|
|
534
249
|
className: actionsClass,
|
|
@@ -536,7 +251,7 @@ var DateInput = ({
|
|
|
536
251
|
disabled: locked,
|
|
537
252
|
"aria-label": copy.clear,
|
|
538
253
|
onClick: () => onValueChange(""),
|
|
539
|
-
children: /* @__PURE__ */
|
|
254
|
+
children: /* @__PURE__ */ jsx(X, {
|
|
540
255
|
"aria-hidden": "true"
|
|
541
256
|
})
|
|
542
257
|
}) : null,
|
|
@@ -544,8 +259,8 @@ var DateInput = ({
|
|
|
544
259
|
open: open && !locked && status !== "invalid-range",
|
|
545
260
|
onOpenChange: setOpen,
|
|
546
261
|
children: [
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
render: /* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
263
|
+
render: /* @__PURE__ */ jsx(InputGroupButton, {
|
|
549
264
|
type: "button",
|
|
550
265
|
size: "icon-xs",
|
|
551
266
|
className: actionsClass,
|
|
@@ -553,7 +268,7 @@ var DateInput = ({
|
|
|
553
268
|
"aria-label": copy.open,
|
|
554
269
|
"data-component": "date-input-trigger"
|
|
555
270
|
}),
|
|
556
|
-
children: /* @__PURE__ */
|
|
271
|
+
children: /* @__PURE__ */ jsx(CalendarDays, {
|
|
557
272
|
"aria-hidden": "true"
|
|
558
273
|
})
|
|
559
274
|
}),
|
|
@@ -563,11 +278,11 @@ var DateInput = ({
|
|
|
563
278
|
"data-component": "date-input-content",
|
|
564
279
|
className: cn("w-auto max-w-[calc(100vw-2rem)] gap-0 p-0", contentClassName),
|
|
565
280
|
children: [
|
|
566
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ jsx(PopoverTitle, {
|
|
567
282
|
className: "sr-only",
|
|
568
283
|
children: label ?? copy.label
|
|
569
284
|
}),
|
|
570
|
-
open ? /* @__PURE__ */
|
|
285
|
+
open ? /* @__PURE__ */ jsx(Calendar, {
|
|
571
286
|
components: { DayButton: DateInputDayButton },
|
|
572
287
|
mode: "single",
|
|
573
288
|
required: true,
|
|
@@ -600,13 +315,13 @@ var DateInput = ({
|
|
|
600
315
|
})
|
|
601
316
|
]
|
|
602
317
|
}),
|
|
603
|
-
description ? /* @__PURE__ */
|
|
318
|
+
description ? /* @__PURE__ */ jsx("p", {
|
|
604
319
|
id: `${id}-description`,
|
|
605
320
|
"data-slot": "date-input-description",
|
|
606
321
|
className: dateInputClasses.hint,
|
|
607
322
|
children: description
|
|
608
323
|
}) : null,
|
|
609
|
-
error ? /* @__PURE__ */
|
|
324
|
+
error ? /* @__PURE__ */ jsx("p", {
|
|
610
325
|
id: `${id}-error`,
|
|
611
326
|
"data-slot": "date-input-error",
|
|
612
327
|
role: "status",
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const docsArticleClasses: {
|
|
2
|
+
readonly container: "@container/docs-article mx-auto w-full max-w-6xl";
|
|
3
|
+
readonly grid: "grid min-w-0 gap-x-10 @3xl/docs-article:grid-cols-[minmax(0,1fr)_13rem]";
|
|
4
|
+
readonly inlineToc: "group mb-8 overflow-hidden rounded-lg border @3xl/docs-article:hidden";
|
|
5
|
+
readonly tocTrigger: "flex w-full cursor-pointer list-none items-center justify-between gap-3 p-4 text-left text-sm font-semibold [&::-webkit-details-marker]:hidden";
|
|
6
|
+
readonly tocChevron: "text-muted-foreground shrink-0 transition-transform group-open:rotate-180 motion-reduce:transition-none";
|
|
7
|
+
readonly tocPanel: "px-4 pt-1 pb-4";
|
|
8
|
+
readonly tocList: "border-border border-l";
|
|
9
|
+
readonly tocLink: "text-muted-foreground hover:text-foreground block py-1.5 pr-2 text-sm leading-5 wrap-break-word transition-colors";
|
|
10
|
+
readonly tocLinkLevel: {
|
|
11
|
+
readonly 2: "pl-4";
|
|
12
|
+
readonly 3: "pl-6";
|
|
13
|
+
};
|
|
14
|
+
readonly sidebarToc: "sticky top-20 hidden max-h-[calc(100svh-5rem)] self-start overflow-y-auto @3xl/docs-article:block";
|
|
15
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Html } from "effect/ui/html";
|
|
2
|
+
export { matchesDocsSearch, normalizeDocsSearch } from "./index.js";
|
|
3
|
+
export declare const DocsLayout: import("effect/ui/Component").Component<"DocsLayout", {
|
|
4
|
+
readonly locale: string;
|
|
5
|
+
readonly currentPath: string;
|
|
6
|
+
readonly brand: {
|
|
7
|
+
readonly href: string;
|
|
8
|
+
readonly label: string;
|
|
9
|
+
readonly subtitle?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
readonly repository?: {
|
|
12
|
+
readonly href: string;
|
|
13
|
+
readonly label: string;
|
|
14
|
+
} | undefined;
|
|
15
|
+
readonly searchLabel: string;
|
|
16
|
+
readonly searchEmpty?: string | undefined;
|
|
17
|
+
readonly skipLabel: string;
|
|
18
|
+
readonly enableShortcut?: boolean | undefined;
|
|
19
|
+
readonly groups: readonly {
|
|
20
|
+
readonly label: string;
|
|
21
|
+
readonly items: readonly {
|
|
22
|
+
readonly label: string;
|
|
23
|
+
readonly href: string;
|
|
24
|
+
readonly exact?: boolean | undefined;
|
|
25
|
+
readonly badge?: string | undefined;
|
|
26
|
+
readonly external?: boolean | undefined;
|
|
27
|
+
readonly description?: string | undefined;
|
|
28
|
+
readonly searchText?: string | undefined;
|
|
29
|
+
readonly icon?: [string, {
|
|
30
|
+
readonly [x: string]: string | number | undefined;
|
|
31
|
+
}][] | (<Msg>(h: Html.H<Msg>, { size, color, strokeWidth, className, }?: import("../../lib/lucide-effect.js").LucideIconProps) => Html.SvgElement<Msg, never, SVGSVGElement, "svg">) | undefined;
|
|
32
|
+
}[];
|
|
33
|
+
}[];
|
|
34
|
+
}, string, {
|
|
35
|
+
readonly _tag: "Closed";
|
|
36
|
+
} | {
|
|
37
|
+
readonly _tag: "QueryChanged";
|
|
38
|
+
readonly query: string;
|
|
39
|
+
} | {
|
|
40
|
+
readonly _tag: "Selected";
|
|
41
|
+
readonly href: string;
|
|
42
|
+
}, {
|
|
43
|
+
readonly _tag: "Selected";
|
|
44
|
+
readonly href: string;
|
|
45
|
+
}, never, Html.Elements, {}, "brandIcon" | "content" | "headerActions">;
|
|
46
|
+
export declare const DocsArticle: import("effect/ui/Component").Component<"DocsArticle", {
|
|
47
|
+
readonly title: string;
|
|
48
|
+
readonly description?: string | undefined;
|
|
49
|
+
readonly tocLabel: string;
|
|
50
|
+
readonly headings: readonly {
|
|
51
|
+
readonly id: string;
|
|
52
|
+
readonly title: string;
|
|
53
|
+
readonly depth: 2 | 3;
|
|
54
|
+
}[];
|
|
55
|
+
}, null, never, never, never, Html.Elements, {}, "body">;
|