@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
package/dist/lib/docs.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// ../../src/lib/docs.tsx
|
|
2
2
|
import { createIsomorphicFn } from "@tanstack/react-start";
|
|
3
3
|
import { getCookie } from "@tanstack/react-start/server";
|
|
4
|
-
import { Option as Option2, Schema as
|
|
4
|
+
import { Option as Option2, Schema as Schema7 } from "effect";
|
|
5
5
|
import { Cookies as Cookies2 } from "effect/http";
|
|
6
6
|
import {
|
|
7
7
|
forwardRef,
|
|
8
8
|
useDeferredValue,
|
|
9
|
-
useEffect as
|
|
10
|
-
useState as
|
|
9
|
+
useEffect as useEffect2,
|
|
10
|
+
useState as useState3
|
|
11
11
|
} from "react";
|
|
12
12
|
|
|
13
13
|
// ../../src/lib/utils.ts
|
|
@@ -93,88 +93,11 @@ function AppBrand({
|
|
|
93
93
|
]
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
// ../../src/
|
|
97
|
-
import {
|
|
98
|
-
import { useRender } from "@base-ui/react/use-render";
|
|
99
|
-
import { cva } from "class-variance-authority";
|
|
100
|
-
var badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
101
|
-
variants: {
|
|
102
|
-
variant: {
|
|
103
|
-
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
104
|
-
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
105
|
-
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
106
|
-
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
107
|
-
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
108
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
defaultVariants: {
|
|
112
|
-
variant: "default"
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
function Badge({
|
|
116
|
-
className,
|
|
117
|
-
variant = "default",
|
|
118
|
-
render,
|
|
119
|
-
...props
|
|
120
|
-
}) {
|
|
121
|
-
return useRender({
|
|
122
|
-
defaultTagName: "span",
|
|
123
|
-
props: mergeProps({
|
|
124
|
-
className: cn(badgeVariants({ variant }), className)
|
|
125
|
-
}, props),
|
|
126
|
-
render,
|
|
127
|
-
state: {
|
|
128
|
-
slot: "badge",
|
|
129
|
-
variant
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// ../../src/components/ui/button.tsx
|
|
135
|
-
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
136
|
-
import { cva as cva2 } from "class-variance-authority";
|
|
137
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
138
|
-
var buttonVariants = cva2("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", {
|
|
139
|
-
variants: {
|
|
140
|
-
variant: {
|
|
141
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
142
|
-
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",
|
|
143
|
-
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",
|
|
144
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
145
|
-
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",
|
|
146
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
147
|
-
},
|
|
148
|
-
size: {
|
|
149
|
-
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",
|
|
150
|
-
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",
|
|
151
|
-
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",
|
|
152
|
-
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
153
|
-
icon: "size-9",
|
|
154
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
155
|
-
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
156
|
-
"icon-lg": "size-10"
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
defaultVariants: {
|
|
160
|
-
variant: "default",
|
|
161
|
-
size: "default"
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
function Button({
|
|
165
|
-
className,
|
|
166
|
-
variant = "default",
|
|
167
|
-
size = "default",
|
|
168
|
-
...props
|
|
169
|
-
}) {
|
|
170
|
-
return /* @__PURE__ */ jsx2(ButtonPrimitive, {
|
|
171
|
-
"data-slot": "button",
|
|
172
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
173
|
-
...props
|
|
174
|
-
});
|
|
175
|
-
}
|
|
96
|
+
// ../../src/lib/docs.tsx
|
|
97
|
+
import { Badge as Badge2 } from "@/components/ui/badge";
|
|
176
98
|
|
|
177
99
|
// ../../src/components/copy-button/react.tsx
|
|
100
|
+
import { Button } from "@/components/ui/button";
|
|
178
101
|
import { Check, Copy, TriangleAlert } from "lucide-react";
|
|
179
102
|
import { Redacted as Redacted2 } from "effect";
|
|
180
103
|
import { Component as Component2 } from "effect/ui";
|
|
@@ -277,7 +200,7 @@ var copyButtonStatus = (status, copy, description) => {
|
|
|
277
200
|
};
|
|
278
201
|
|
|
279
202
|
// ../../src/components/copy-button/react.tsx
|
|
280
|
-
import { jsx as
|
|
203
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
281
204
|
"use client";
|
|
282
205
|
function CopyButton({
|
|
283
206
|
value,
|
|
@@ -335,22 +258,22 @@ function CopyButton({
|
|
|
335
258
|
size: size ?? defaultSize,
|
|
336
259
|
...props,
|
|
337
260
|
children: [
|
|
338
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ jsx2("span", {
|
|
339
262
|
"aria-live": "polite",
|
|
340
263
|
className: "sr-only",
|
|
341
264
|
role: "status",
|
|
342
265
|
children: copyButtonStatus(status, labels, valueDescription)
|
|
343
266
|
}),
|
|
344
|
-
status === "copied" ? /* @__PURE__ */
|
|
267
|
+
status === "copied" ? /* @__PURE__ */ jsx2(Check, {
|
|
345
268
|
"aria-hidden": "true"
|
|
346
269
|
}) : null,
|
|
347
|
-
status === "failed" ? /* @__PURE__ */
|
|
270
|
+
status === "failed" ? /* @__PURE__ */ jsx2(TriangleAlert, {
|
|
348
271
|
"aria-hidden": "true"
|
|
349
272
|
}) : null,
|
|
350
|
-
status === "idle" ? /* @__PURE__ */
|
|
273
|
+
status === "idle" ? /* @__PURE__ */ jsx2(Copy, {
|
|
351
274
|
"aria-hidden": "true"
|
|
352
275
|
}) : null,
|
|
353
|
-
isLarge ? /* @__PURE__ */
|
|
276
|
+
isLarge ? /* @__PURE__ */ jsx2("span", {
|
|
354
277
|
children: labels.copy
|
|
355
278
|
}) : null
|
|
356
279
|
]
|
|
@@ -418,7 +341,7 @@ var codeBlockMessages = (locale = "en", translations) => ({
|
|
|
418
341
|
var codeLanguage = (language = "text") => language.toLowerCase() || "text";
|
|
419
342
|
|
|
420
343
|
// ../../src/components/code-block/react.tsx
|
|
421
|
-
import { jsx as
|
|
344
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
422
345
|
function CodeBlock({
|
|
423
346
|
classes: classOverrides,
|
|
424
347
|
code,
|
|
@@ -435,17 +358,17 @@ function CodeBlock({
|
|
|
435
358
|
className: codeBlockClasses.root,
|
|
436
359
|
"data-code-theme": true,
|
|
437
360
|
children: [
|
|
438
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ jsx3("style", {
|
|
439
362
|
children: codeThemeCss
|
|
440
363
|
}),
|
|
441
364
|
/* @__PURE__ */ jsxs3("div", {
|
|
442
365
|
className: codeBlockClasses.header,
|
|
443
366
|
children: [
|
|
444
|
-
/* @__PURE__ */
|
|
367
|
+
/* @__PURE__ */ jsx3("span", {
|
|
445
368
|
className: codeBlockClasses.language,
|
|
446
369
|
children: highlighted.lang
|
|
447
370
|
}),
|
|
448
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ jsx3(CopyButton, {
|
|
449
372
|
value: code,
|
|
450
373
|
valueDescription: labels.codeDescription(highlighted.lang),
|
|
451
374
|
variant: "ghost",
|
|
@@ -454,7 +377,7 @@ function CodeBlock({
|
|
|
454
377
|
})
|
|
455
378
|
]
|
|
456
379
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ jsx3("div", {
|
|
458
381
|
className: codeBlockClasses.viewport,
|
|
459
382
|
dangerouslySetInnerHTML: { __html: highlighted.html }
|
|
460
383
|
})
|
|
@@ -484,7 +407,7 @@ var markdownSegments = ({
|
|
|
484
407
|
};
|
|
485
408
|
|
|
486
409
|
// ../../src/components/markdown/react.tsx
|
|
487
|
-
import { jsx as
|
|
410
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
488
411
|
var MarkdownContent = ({
|
|
489
412
|
classes,
|
|
490
413
|
className,
|
|
@@ -496,13 +419,13 @@ var MarkdownContent = ({
|
|
|
496
419
|
const content = [];
|
|
497
420
|
for (const segment of markdownSegments({ html, codeBlocks })) {
|
|
498
421
|
const { block, index } = segment;
|
|
499
|
-
content.push(/* @__PURE__ */
|
|
422
|
+
content.push(/* @__PURE__ */ jsx4("div", {
|
|
500
423
|
dangerouslySetInnerHTML: { __html: segment.html }
|
|
501
424
|
}, `html-${index}`));
|
|
502
425
|
if (block)
|
|
503
|
-
content.push(/* @__PURE__ */
|
|
426
|
+
content.push(/* @__PURE__ */ jsx4("div", {
|
|
504
427
|
className: "my-5",
|
|
505
|
-
children: /* @__PURE__ */
|
|
428
|
+
children: /* @__PURE__ */ jsx4(CodeBlock, {
|
|
506
429
|
code: block.code,
|
|
507
430
|
language: block.language,
|
|
508
431
|
locale,
|
|
@@ -510,247 +433,39 @@ var MarkdownContent = ({
|
|
|
510
433
|
})
|
|
511
434
|
}, `code-${index}`));
|
|
512
435
|
}
|
|
513
|
-
return /* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ jsx4("div", {
|
|
514
437
|
className: cn(classes?.root ?? markdownClass, className),
|
|
515
438
|
children: content
|
|
516
439
|
});
|
|
517
440
|
};
|
|
518
|
-
// ../../src/
|
|
519
|
-
import {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
...props
|
|
525
|
-
});
|
|
526
|
-
}
|
|
527
|
-
function CollapsibleTrigger({ ...props }) {
|
|
528
|
-
return /* @__PURE__ */ jsx6(CollapsiblePrimitive.Trigger, {
|
|
529
|
-
"data-slot": "collapsible-trigger",
|
|
530
|
-
...props
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
function CollapsibleContent({ ...props }) {
|
|
534
|
-
return /* @__PURE__ */ jsx6(CollapsiblePrimitive.Panel, {
|
|
535
|
-
"data-slot": "collapsible-content",
|
|
536
|
-
...props
|
|
537
|
-
});
|
|
538
|
-
}
|
|
441
|
+
// ../../src/lib/docs.tsx
|
|
442
|
+
import {
|
|
443
|
+
Collapsible,
|
|
444
|
+
CollapsibleContent,
|
|
445
|
+
CollapsibleTrigger
|
|
446
|
+
} from "@/components/ui/collapsible";
|
|
539
447
|
|
|
540
448
|
// ../../src/components/search-menu/react.tsx
|
|
541
|
-
import { SearchIcon
|
|
449
|
+
import { SearchIcon, XIcon } from "lucide-react";
|
|
542
450
|
import { useCallback, useEffect, useRef as useRef2, useState as useState2 } from "react";
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
return /* @__PURE__ */ jsx7(DialogPrimitive.Root, {
|
|
555
|
-
"data-slot": "dialog",
|
|
556
|
-
...props
|
|
557
|
-
});
|
|
558
|
-
}
|
|
559
|
-
function DialogPortal({ ...props }) {
|
|
560
|
-
return /* @__PURE__ */ jsx7(DialogPrimitive.Portal, {
|
|
561
|
-
"data-slot": "dialog-portal",
|
|
562
|
-
...props
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
function DialogOverlay({
|
|
566
|
-
className,
|
|
567
|
-
...props
|
|
568
|
-
}) {
|
|
569
|
-
return /* @__PURE__ */ jsx7(DialogPrimitive.Backdrop, {
|
|
570
|
-
"data-slot": "dialog-overlay",
|
|
571
|
-
className: cn2("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs", className),
|
|
572
|
-
...props
|
|
573
|
-
});
|
|
574
|
-
}
|
|
575
|
-
function DialogContent({
|
|
576
|
-
className,
|
|
577
|
-
children,
|
|
578
|
-
showCloseButton = true,
|
|
579
|
-
...props
|
|
580
|
-
}) {
|
|
581
|
-
return /* @__PURE__ */ jsxs4(DialogPortal, {
|
|
582
|
-
children: [
|
|
583
|
-
/* @__PURE__ */ jsx7(DialogOverlay, {}),
|
|
584
|
-
/* @__PURE__ */ jsxs4(DialogPrimitive.Popup, {
|
|
585
|
-
"data-slot": "dialog-content",
|
|
586
|
-
className: cn2("bg-popover text-popover-foreground ring-foreground/10 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 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 text-sm ring-1 duration-100 outline-none sm:max-w-md", className),
|
|
587
|
-
...props,
|
|
588
|
-
children: [
|
|
589
|
-
children,
|
|
590
|
-
showCloseButton && /* @__PURE__ */ jsxs4(DialogPrimitive.Close, {
|
|
591
|
-
"data-slot": "dialog-close",
|
|
592
|
-
render: /* @__PURE__ */ jsx7(Button, {
|
|
593
|
-
variant: "ghost",
|
|
594
|
-
className: "absolute top-4 right-4",
|
|
595
|
-
size: "icon-sm"
|
|
596
|
-
}),
|
|
597
|
-
children: [
|
|
598
|
-
/* @__PURE__ */ jsx7(XIcon, {}),
|
|
599
|
-
/* @__PURE__ */ jsx7("span", {
|
|
600
|
-
className: "sr-only",
|
|
601
|
-
children: "Close"
|
|
602
|
-
})
|
|
603
|
-
]
|
|
604
|
-
})
|
|
605
|
-
]
|
|
606
|
-
})
|
|
607
|
-
]
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
function DialogHeader({ className, ...props }) {
|
|
611
|
-
return /* @__PURE__ */ jsx7("div", {
|
|
612
|
-
"data-slot": "dialog-header",
|
|
613
|
-
className: cn2("flex flex-col gap-2", className),
|
|
614
|
-
...props
|
|
615
|
-
});
|
|
616
|
-
}
|
|
617
|
-
function DialogTitle({ className, ...props }) {
|
|
618
|
-
return /* @__PURE__ */ jsx7(DialogPrimitive.Title, {
|
|
619
|
-
"data-slot": "dialog-title",
|
|
620
|
-
className: cn2("leading-none font-medium", className),
|
|
621
|
-
...props
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
|
-
function DialogDescription({
|
|
625
|
-
className,
|
|
626
|
-
...props
|
|
627
|
-
}) {
|
|
628
|
-
return /* @__PURE__ */ jsx7(DialogPrimitive.Description, {
|
|
629
|
-
"data-slot": "dialog-description",
|
|
630
|
-
className: cn2("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3", className),
|
|
631
|
-
...props
|
|
632
|
-
});
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
// ../../src/components/ui/command.tsx
|
|
636
|
-
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
637
|
-
function Command2({
|
|
638
|
-
className,
|
|
639
|
-
...props
|
|
640
|
-
}) {
|
|
641
|
-
return /* @__PURE__ */ jsx8(CommandPrimitive, {
|
|
642
|
-
"data-slot": "command",
|
|
643
|
-
className: cn("flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground", className),
|
|
644
|
-
...props
|
|
645
|
-
});
|
|
646
|
-
}
|
|
647
|
-
function CommandDialog({
|
|
648
|
-
title,
|
|
649
|
-
description,
|
|
650
|
-
children,
|
|
651
|
-
className,
|
|
652
|
-
...props
|
|
653
|
-
}) {
|
|
654
|
-
return /* @__PURE__ */ jsx8(Dialog, {
|
|
655
|
-
...props,
|
|
656
|
-
children: /* @__PURE__ */ jsxs5(DialogContent, {
|
|
657
|
-
className: cn("top-1/3 translate-y-0 overflow-hidden rounded-xl p-0", className),
|
|
658
|
-
children: [
|
|
659
|
-
/* @__PURE__ */ jsxs5(DialogHeader, {
|
|
660
|
-
className: "sr-only",
|
|
661
|
-
children: [
|
|
662
|
-
/* @__PURE__ */ jsx8(DialogTitle, {
|
|
663
|
-
children: title
|
|
664
|
-
}),
|
|
665
|
-
/* @__PURE__ */ jsx8(DialogDescription, {
|
|
666
|
-
children: description
|
|
667
|
-
})
|
|
668
|
-
]
|
|
669
|
-
}),
|
|
670
|
-
children
|
|
671
|
-
]
|
|
672
|
-
})
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
function CommandInput({
|
|
676
|
-
className,
|
|
677
|
-
...props
|
|
678
|
-
}) {
|
|
679
|
-
return /* @__PURE__ */ jsx8("div", {
|
|
680
|
-
"data-slot": "command-input-wrapper",
|
|
681
|
-
className: "p-1 pb-0",
|
|
682
|
-
children: /* @__PURE__ */ jsxs5("div", {
|
|
683
|
-
className: "border-input/30 bg-input/30 flex h-9 items-center gap-2 rounded-lg border px-2 shadow-none",
|
|
684
|
-
children: [
|
|
685
|
-
/* @__PURE__ */ jsx8(SearchIcon, {
|
|
686
|
-
className: "size-4 shrink-0 opacity-50"
|
|
687
|
-
}),
|
|
688
|
-
/* @__PURE__ */ jsx8(CommandPrimitive.Input, {
|
|
689
|
-
"data-slot": "command-input",
|
|
690
|
-
className: cn("w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
691
|
-
...props
|
|
692
|
-
})
|
|
693
|
-
]
|
|
694
|
-
})
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
|
-
function CommandList({
|
|
698
|
-
className,
|
|
699
|
-
...props
|
|
700
|
-
}) {
|
|
701
|
-
return /* @__PURE__ */ jsx8(CommandPrimitive.List, {
|
|
702
|
-
"data-slot": "command-list",
|
|
703
|
-
className: cn("max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none", className),
|
|
704
|
-
...props
|
|
705
|
-
});
|
|
706
|
-
}
|
|
707
|
-
function CommandEmpty({
|
|
708
|
-
className,
|
|
709
|
-
...props
|
|
710
|
-
}) {
|
|
711
|
-
return /* @__PURE__ */ jsx8(CommandPrimitive.Empty, {
|
|
712
|
-
"data-slot": "command-empty",
|
|
713
|
-
className: cn("py-6 text-center text-sm", className),
|
|
714
|
-
...props
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
function CommandGroup({
|
|
718
|
-
className,
|
|
719
|
-
...props
|
|
720
|
-
}) {
|
|
721
|
-
return /* @__PURE__ */ jsx8(CommandPrimitive.Group, {
|
|
722
|
-
"data-slot": "command-group",
|
|
723
|
-
className: cn("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground", className),
|
|
724
|
-
...props
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
function CommandItem({
|
|
728
|
-
className,
|
|
729
|
-
...props
|
|
730
|
-
}) {
|
|
731
|
-
return /* @__PURE__ */ jsx8(CommandPrimitive.Item, {
|
|
732
|
-
"data-slot": "command-item",
|
|
733
|
-
className: cn("group/command-item relative flex cursor-default items-center gap-2 rounded-lg px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
734
|
-
...props
|
|
735
|
-
});
|
|
736
|
-
}
|
|
737
|
-
function CommandShortcut({
|
|
738
|
-
className,
|
|
739
|
-
...props
|
|
740
|
-
}) {
|
|
741
|
-
return /* @__PURE__ */ jsx8("span", {
|
|
742
|
-
"data-slot": "command-shortcut",
|
|
743
|
-
className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground", className),
|
|
744
|
-
...props
|
|
745
|
-
});
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
// ../../src/components/search-menu/react.tsx
|
|
451
|
+
import { Button as Button2 } from "@/components/ui/button";
|
|
452
|
+
import {
|
|
453
|
+
Command as Command2,
|
|
454
|
+
CommandDialog,
|
|
455
|
+
CommandEmpty,
|
|
456
|
+
CommandGroup,
|
|
457
|
+
CommandInput,
|
|
458
|
+
CommandItem,
|
|
459
|
+
CommandList,
|
|
460
|
+
CommandShortcut
|
|
461
|
+
} from "@/components/ui/command";
|
|
749
462
|
import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider/react";
|
|
750
463
|
import { Component as Component4, View as View2 } from "effect/ui";
|
|
751
464
|
import { useModel as useModel2 } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
752
465
|
|
|
753
466
|
// ../../src/components/search-menu/classes.ts
|
|
467
|
+
var searchMenuDialogPadding = "px-0 pt-0 pb-2";
|
|
468
|
+
var searchMenuShortcutClass = "bg-muted text-muted-foreground pointer-events-none hidden h-5 shrink-0 items-center justify-center rounded border px-1.5 font-mono text-[11px] font-medium leading-none sm:inline-flex";
|
|
754
469
|
var searchMenuClasses = {
|
|
755
470
|
resultTitle: "truncate font-medium",
|
|
756
471
|
resultDescription: "text-muted-foreground truncate text-xs"
|
|
@@ -803,6 +518,7 @@ var SearchMenuPropsSchema = Schema3.Struct({
|
|
|
803
518
|
className: text,
|
|
804
519
|
query: text,
|
|
805
520
|
enableShortcut: Schema3.optional(Schema3.Boolean),
|
|
521
|
+
shortcutScope: Schema3.optional(Schema3.Literals(["document", "trigger"])),
|
|
806
522
|
open: Schema3.optional(Schema3.Boolean),
|
|
807
523
|
shouldFilter: Schema3.optional(Schema3.Boolean)
|
|
808
524
|
}).annotate({ identifier: "SearchMenuProps" });
|
|
@@ -844,6 +560,13 @@ var searchMenuOptions = {
|
|
|
844
560
|
message: SearchMenuMessage,
|
|
845
561
|
restore: false
|
|
846
562
|
};
|
|
563
|
+
var searchMenuStateOptions = {
|
|
564
|
+
...searchMenuOptions,
|
|
565
|
+
props: Schema4.Struct({
|
|
566
|
+
open: SearchMenuPropsSchema.fields.open,
|
|
567
|
+
query: SearchMenuPropsSchema.fields.query
|
|
568
|
+
}).annotate({ identifier: "SearchMenuStateProps" })
|
|
569
|
+
};
|
|
847
570
|
var updateSearchMenu = (model, props, message) => {
|
|
848
571
|
switch (message._tag) {
|
|
849
572
|
case "SetOpen":
|
|
@@ -856,7 +579,7 @@ var updateSearchMenu = (model, props, message) => {
|
|
|
856
579
|
return props.open === undefined ? { open: false, query: "" } : model;
|
|
857
580
|
}
|
|
858
581
|
};
|
|
859
|
-
var update2 = Component3.define(
|
|
582
|
+
var update2 = Component3.define(searchMenuStateOptions).update({
|
|
860
583
|
SetOpen: ($, message) => updateSearchMenu($.model, $.props, message),
|
|
861
584
|
Reset: ($, message) => updateSearchMenu($.model, $.props, message),
|
|
862
585
|
SetQuery: ($, message) => updateSearchMenu($.model, $.props, message),
|
|
@@ -868,8 +591,8 @@ var searchMenuBehaviours = {
|
|
|
868
591
|
};
|
|
869
592
|
|
|
870
593
|
// ../../src/components/search-menu/react.tsx
|
|
871
|
-
import { jsx as
|
|
872
|
-
var SearchModel = Component4.define(
|
|
594
|
+
import { jsx as jsx5, jsxs as jsxs4, Fragment } from "react/jsx-runtime";
|
|
595
|
+
var SearchModel = Component4.define(searchMenuStateOptions).make({
|
|
873
596
|
...searchMenuBehaviours,
|
|
874
597
|
view: () => View2.text("")
|
|
875
598
|
});
|
|
@@ -885,6 +608,7 @@ function SearchMenu({
|
|
|
885
608
|
messages,
|
|
886
609
|
shortcutLabel = "⌘K",
|
|
887
610
|
enableShortcut = true,
|
|
611
|
+
shortcutScope = "document",
|
|
888
612
|
className,
|
|
889
613
|
open,
|
|
890
614
|
onOpenChange,
|
|
@@ -901,7 +625,7 @@ function SearchMenu({
|
|
|
901
625
|
const resolvedPlaceholder = placeholder ?? labels.placeholder;
|
|
902
626
|
const resolvedInputPlaceholder = inputPlaceholder ?? labels.inputPlaceholder;
|
|
903
627
|
const resolvedEmptyMessage = emptyMessage ?? labels.emptyMessage;
|
|
904
|
-
const { model, send } = useModel2(SearchModel, {
|
|
628
|
+
const { model, send } = useModel2(SearchModel, { open, query });
|
|
905
629
|
const isOpen = open ?? model.open;
|
|
906
630
|
const searchQuery = query ?? model.query;
|
|
907
631
|
const externalGroups = shouldFilter === false ? groups : undefined;
|
|
@@ -936,10 +660,10 @@ function SearchMenu({
|
|
|
936
660
|
onOpenChange?.(value);
|
|
937
661
|
}, [open, onOpenChange, send]);
|
|
938
662
|
useEffect(() => {
|
|
939
|
-
if (!enableShortcut)
|
|
663
|
+
if (!enableShortcut || shortcutScope !== "document")
|
|
940
664
|
return;
|
|
941
665
|
const onKeyDown = (event) => {
|
|
942
|
-
if (event.key.toLowerCase() !== "k")
|
|
666
|
+
if (event.defaultPrevented || event.key.toLowerCase() !== "k")
|
|
943
667
|
return;
|
|
944
668
|
if (!event.metaKey && !event.ctrlKey)
|
|
945
669
|
return;
|
|
@@ -948,37 +672,43 @@ function SearchMenu({
|
|
|
948
672
|
};
|
|
949
673
|
document.addEventListener("keydown", onKeyDown);
|
|
950
674
|
return () => document.removeEventListener("keydown", onKeyDown);
|
|
951
|
-
}, [enableShortcut, isOpen, setOpen]);
|
|
952
|
-
return /* @__PURE__ */
|
|
675
|
+
}, [enableShortcut, shortcutScope, isOpen, setOpen]);
|
|
676
|
+
return /* @__PURE__ */ jsxs4(Fragment, {
|
|
953
677
|
children: [
|
|
954
|
-
/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ jsxs4(Button2, {
|
|
955
679
|
"aria-label": resolvedPlaceholder,
|
|
956
680
|
type: "button",
|
|
957
681
|
variant: "outline",
|
|
958
682
|
size: "icon",
|
|
959
683
|
className: cn("sm:h-9 sm:w-64 sm:justify-start sm:gap-2.5 sm:px-2.5 sm:font-normal", className),
|
|
960
684
|
onClick: () => setOpen(true),
|
|
685
|
+
onKeyDown: enableShortcut && shortcutScope === "trigger" ? (event) => {
|
|
686
|
+
if (event.key.toLowerCase() !== "k" || !(event.metaKey || event.ctrlKey))
|
|
687
|
+
return;
|
|
688
|
+
event.preventDefault();
|
|
689
|
+
setOpen(!isOpen);
|
|
690
|
+
} : undefined,
|
|
961
691
|
children: [
|
|
962
|
-
/* @__PURE__ */
|
|
692
|
+
/* @__PURE__ */ jsx5(SearchIcon, {
|
|
963
693
|
className: "size-4 shrink-0"
|
|
964
694
|
}),
|
|
965
|
-
/* @__PURE__ */
|
|
695
|
+
/* @__PURE__ */ jsx5("span", {
|
|
966
696
|
className: "text-muted-foreground hidden min-w-0 flex-1 truncate text-left font-normal sm:block",
|
|
967
697
|
children: resolvedPlaceholder
|
|
968
698
|
}),
|
|
969
|
-
enableShortcut ? /* @__PURE__ */
|
|
970
|
-
className:
|
|
699
|
+
enableShortcut ? /* @__PURE__ */ jsx5("kbd", {
|
|
700
|
+
className: searchMenuShortcutClass,
|
|
971
701
|
children: shortcutLabel
|
|
972
702
|
}) : null
|
|
973
703
|
]
|
|
974
704
|
}),
|
|
975
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ jsx5(CommandDialog, {
|
|
976
706
|
open: isOpen,
|
|
977
707
|
onOpenChange: setOpen,
|
|
978
708
|
title: resolvedTitle,
|
|
979
709
|
description: resolvedDescription,
|
|
980
|
-
className:
|
|
981
|
-
children: /* @__PURE__ */
|
|
710
|
+
className: `${searchMenuDialogPadding} [&>[data-slot=dialog-close]]:hidden`,
|
|
711
|
+
children: /* @__PURE__ */ jsxs4(Command2, {
|
|
982
712
|
...shouldFilter === undefined ? {} : { shouldFilter },
|
|
983
713
|
...externalGroups && {
|
|
984
714
|
value: selectedValue,
|
|
@@ -989,21 +719,21 @@ function SearchMenu({
|
|
|
989
719
|
})
|
|
990
720
|
},
|
|
991
721
|
children: [
|
|
992
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ jsxs4("div", {
|
|
993
723
|
className: cn("relative", searchQuery && "[&_[data-slot=command-input-wrapper]>div]:pr-10"),
|
|
994
724
|
children: [
|
|
995
|
-
/* @__PURE__ */
|
|
725
|
+
/* @__PURE__ */ jsx5(CommandInput, {
|
|
996
726
|
ref: inputRef,
|
|
997
727
|
placeholder: resolvedInputPlaceholder,
|
|
998
728
|
value: searchQuery,
|
|
999
729
|
onValueChange: setQuery
|
|
1000
730
|
}),
|
|
1001
|
-
searchQuery && /* @__PURE__ */
|
|
731
|
+
searchQuery && /* @__PURE__ */ jsx5(Button2, {
|
|
1002
732
|
type: "button",
|
|
1003
733
|
variant: "ghost",
|
|
1004
734
|
size: "icon-sm",
|
|
1005
735
|
"aria-label": labels.clearSearch,
|
|
1006
|
-
className: "absolute top-
|
|
736
|
+
className: "absolute end-2 top-[calc(50%+2px)] -translate-y-1/2",
|
|
1007
737
|
onKeyDown: (event) => {
|
|
1008
738
|
if (event.key === "Enter")
|
|
1009
739
|
event.stopPropagation();
|
|
@@ -1012,19 +742,19 @@ function SearchMenu({
|
|
|
1012
742
|
setQuery("");
|
|
1013
743
|
inputRef.current?.focus();
|
|
1014
744
|
},
|
|
1015
|
-
children: /* @__PURE__ */
|
|
745
|
+
children: /* @__PURE__ */ jsx5(XIcon, {})
|
|
1016
746
|
})
|
|
1017
747
|
]
|
|
1018
748
|
}),
|
|
1019
|
-
/* @__PURE__ */
|
|
749
|
+
/* @__PURE__ */ jsxs4(CommandList, {
|
|
1020
750
|
ref: listRef,
|
|
1021
751
|
children: [
|
|
1022
|
-
/* @__PURE__ */
|
|
752
|
+
/* @__PURE__ */ jsx5(CommandEmpty, {
|
|
1023
753
|
children: resolvedEmptyMessage
|
|
1024
754
|
}),
|
|
1025
|
-
groups.map((group) => /* @__PURE__ */
|
|
755
|
+
groups.map((group) => /* @__PURE__ */ jsx5(CommandGroup, {
|
|
1026
756
|
heading: group.heading,
|
|
1027
|
-
children: group.items.map((item) => /* @__PURE__ */
|
|
757
|
+
children: group.items.map((item) => /* @__PURE__ */ jsxs4(CommandItem, {
|
|
1028
758
|
className: "data-[selected=false]:!text-foreground data-[selected=true]:bg-muted data-[selected=true]:text-foreground gap-3 py-2 data-[selected=false]:!bg-transparent",
|
|
1029
759
|
value: item.label,
|
|
1030
760
|
...item.keywords ? { keywords: item.keywords } : {},
|
|
@@ -1035,24 +765,24 @@ function SearchMenu({
|
|
|
1035
765
|
},
|
|
1036
766
|
...item.disabled === undefined ? {} : { disabled: item.disabled },
|
|
1037
767
|
children: [
|
|
1038
|
-
item.icon ? /* @__PURE__ */
|
|
768
|
+
item.icon ? /* @__PURE__ */ jsx5("div", {
|
|
1039
769
|
className: "text-muted-foreground bg-background group-data-[selected=true]/command-item:bg-background flex size-8 shrink-0 items-center justify-center rounded-md border",
|
|
1040
770
|
children: item.icon
|
|
1041
771
|
}) : null,
|
|
1042
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ jsxs4("div", {
|
|
1043
773
|
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
1044
774
|
children: [
|
|
1045
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ jsx5("span", {
|
|
1046
776
|
className: searchMenuClasses.resultTitle,
|
|
1047
777
|
children: item.label
|
|
1048
778
|
}),
|
|
1049
|
-
item.description ? /* @__PURE__ */
|
|
779
|
+
item.description ? /* @__PURE__ */ jsx5("span", {
|
|
1050
780
|
className: searchMenuClasses.resultDescription,
|
|
1051
781
|
children: item.description
|
|
1052
782
|
}) : null
|
|
1053
783
|
]
|
|
1054
784
|
}),
|
|
1055
|
-
item.shortcut ? /* @__PURE__ */
|
|
785
|
+
item.shortcut ? /* @__PURE__ */ jsx5(CommandShortcut, {
|
|
1056
786
|
children: item.shortcut
|
|
1057
787
|
}) : null
|
|
1058
788
|
]
|
|
@@ -1070,545 +800,27 @@ function SearchMenu({
|
|
|
1070
800
|
import { Link, Outlet } from "@tanstack/react-router";
|
|
1071
801
|
import { Component as Component6, View as View3 } from "effect/ui";
|
|
1072
802
|
import { useModel as useModel3 } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
// ../../src/components/ui/input.tsx
|
|
1095
|
-
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
1096
|
-
|
|
1097
|
-
// ../../src/components/ui/separator.tsx
|
|
1098
|
-
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
|
|
1099
|
-
|
|
1100
|
-
// ../../src/components/ui/sheet.tsx
|
|
1101
|
-
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog";
|
|
1102
|
-
import { XIcon as XIcon3 } from "lucide-react";
|
|
1103
|
-
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1104
|
-
"use client";
|
|
1105
|
-
function Sheet({ ...props }) {
|
|
1106
|
-
return /* @__PURE__ */ jsx10(SheetPrimitive.Root, {
|
|
1107
|
-
"data-slot": "sheet",
|
|
1108
|
-
...props
|
|
1109
|
-
});
|
|
1110
|
-
}
|
|
1111
|
-
function SheetPortal({ ...props }) {
|
|
1112
|
-
return /* @__PURE__ */ jsx10(SheetPrimitive.Portal, {
|
|
1113
|
-
"data-slot": "sheet-portal",
|
|
1114
|
-
...props
|
|
1115
|
-
});
|
|
1116
|
-
}
|
|
1117
|
-
function SheetOverlay({ className, ...props }) {
|
|
1118
|
-
return /* @__PURE__ */ jsx10(SheetPrimitive.Backdrop, {
|
|
1119
|
-
"data-slot": "sheet-overlay",
|
|
1120
|
-
className: cn("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs", className),
|
|
1121
|
-
...props
|
|
1122
|
-
});
|
|
1123
|
-
}
|
|
1124
|
-
function SheetContent({
|
|
1125
|
-
className,
|
|
1126
|
-
children,
|
|
1127
|
-
side = "right",
|
|
1128
|
-
showCloseButton = true,
|
|
1129
|
-
...props
|
|
1130
|
-
}) {
|
|
1131
|
-
return /* @__PURE__ */ jsxs7(SheetPortal, {
|
|
1132
|
-
children: [
|
|
1133
|
-
/* @__PURE__ */ jsx10(SheetOverlay, {}),
|
|
1134
|
-
/* @__PURE__ */ jsxs7(SheetPrimitive.Popup, {
|
|
1135
|
-
"data-slot": "sheet-content",
|
|
1136
|
-
"data-side": side,
|
|
1137
|
-
className: cn("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className),
|
|
1138
|
-
...props,
|
|
1139
|
-
children: [
|
|
1140
|
-
children,
|
|
1141
|
-
showCloseButton && /* @__PURE__ */ jsxs7(SheetPrimitive.Close, {
|
|
1142
|
-
"data-slot": "sheet-close",
|
|
1143
|
-
render: /* @__PURE__ */ jsx10(Button, {
|
|
1144
|
-
variant: "ghost",
|
|
1145
|
-
className: "absolute top-4 right-4",
|
|
1146
|
-
size: "icon-sm"
|
|
1147
|
-
}),
|
|
1148
|
-
children: [
|
|
1149
|
-
/* @__PURE__ */ jsx10(XIcon3, {}),
|
|
1150
|
-
/* @__PURE__ */ jsx10("span", {
|
|
1151
|
-
className: "sr-only",
|
|
1152
|
-
children: "Close"
|
|
1153
|
-
})
|
|
1154
|
-
]
|
|
1155
|
-
})
|
|
1156
|
-
]
|
|
1157
|
-
})
|
|
1158
|
-
]
|
|
1159
|
-
});
|
|
1160
|
-
}
|
|
1161
|
-
function SheetHeader({ className, ...props }) {
|
|
1162
|
-
return /* @__PURE__ */ jsx10("div", {
|
|
1163
|
-
"data-slot": "sheet-header",
|
|
1164
|
-
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
1165
|
-
...props
|
|
1166
|
-
});
|
|
1167
|
-
}
|
|
1168
|
-
function SheetTitle({ className, ...props }) {
|
|
1169
|
-
return /* @__PURE__ */ jsx10(SheetPrimitive.Title, {
|
|
1170
|
-
"data-slot": "sheet-title",
|
|
1171
|
-
className: cn("font-medium text-foreground", className),
|
|
1172
|
-
...props
|
|
1173
|
-
});
|
|
1174
|
-
}
|
|
1175
|
-
function SheetDescription({
|
|
1176
|
-
className,
|
|
1177
|
-
...props
|
|
1178
|
-
}) {
|
|
1179
|
-
return /* @__PURE__ */ jsx10(SheetPrimitive.Description, {
|
|
1180
|
-
"data-slot": "sheet-description",
|
|
1181
|
-
className: cn("text-sm text-muted-foreground", className),
|
|
1182
|
-
...props
|
|
1183
|
-
});
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
// ../../src/components/ui/tooltip.tsx
|
|
1187
|
-
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";
|
|
1188
|
-
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1189
|
-
"use client";
|
|
1190
|
-
function Tooltip({ ...props }) {
|
|
1191
|
-
return /* @__PURE__ */ jsx11(TooltipPrimitive.Root, {
|
|
1192
|
-
"data-slot": "tooltip",
|
|
1193
|
-
...props
|
|
1194
|
-
});
|
|
1195
|
-
}
|
|
1196
|
-
function TooltipTrigger({ ...props }) {
|
|
1197
|
-
return /* @__PURE__ */ jsx11(TooltipPrimitive.Trigger, {
|
|
1198
|
-
"data-slot": "tooltip-trigger",
|
|
1199
|
-
...props
|
|
1200
|
-
});
|
|
1201
|
-
}
|
|
1202
|
-
function TooltipContent({
|
|
1203
|
-
className,
|
|
1204
|
-
side = "top",
|
|
1205
|
-
sideOffset = 4,
|
|
1206
|
-
align = "center",
|
|
1207
|
-
alignOffset = 0,
|
|
1208
|
-
children,
|
|
1209
|
-
...props
|
|
1210
|
-
}) {
|
|
1211
|
-
return /* @__PURE__ */ jsx11(TooltipPrimitive.Portal, {
|
|
1212
|
-
children: /* @__PURE__ */ jsx11(TooltipPrimitive.Positioner, {
|
|
1213
|
-
align,
|
|
1214
|
-
alignOffset,
|
|
1215
|
-
side,
|
|
1216
|
-
sideOffset,
|
|
1217
|
-
className: "isolate z-50",
|
|
1218
|
-
children: /* @__PURE__ */ jsxs8(TooltipPrimitive.Popup, {
|
|
1219
|
-
"data-slot": "tooltip-content",
|
|
1220
|
-
className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 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-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 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),
|
|
1221
|
-
...props,
|
|
1222
|
-
children: [
|
|
1223
|
-
children,
|
|
1224
|
-
/* @__PURE__ */ jsx11(TooltipPrimitive.Arrow, {
|
|
1225
|
-
className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"
|
|
1226
|
-
})
|
|
1227
|
-
]
|
|
1228
|
-
})
|
|
1229
|
-
})
|
|
1230
|
-
});
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
// ../../src/components/ui/sidebar.tsx
|
|
1234
|
-
import { PanelLeftIcon } from "lucide-react";
|
|
1235
|
-
import { Schema as Schema5 } from "effect";
|
|
1236
|
-
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1237
|
-
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
1238
|
-
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
1239
|
-
var SIDEBAR_WIDTH = "16rem";
|
|
1240
|
-
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
1241
|
-
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
1242
|
-
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
1243
|
-
var SidebarContext = React2.createContext(null);
|
|
1244
|
-
function useSidebar() {
|
|
1245
|
-
const context = React2.useContext(SidebarContext);
|
|
1246
|
-
if (!context) {
|
|
1247
|
-
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
1248
|
-
}
|
|
1249
|
-
return context;
|
|
1250
|
-
}
|
|
1251
|
-
function SidebarProvider({
|
|
1252
|
-
defaultOpen = true,
|
|
1253
|
-
open: openProp,
|
|
1254
|
-
onOpenChange: setOpenProp,
|
|
1255
|
-
className,
|
|
1256
|
-
style,
|
|
1257
|
-
children,
|
|
1258
|
-
...props
|
|
1259
|
-
}) {
|
|
1260
|
-
const isMobile = useIsMobile();
|
|
1261
|
-
const [openMobile, setOpenMobile] = React2.useState(false);
|
|
1262
|
-
const [_open, _setOpen] = React2.useState(defaultOpen);
|
|
1263
|
-
const open = openProp ?? _open;
|
|
1264
|
-
const setOpen = React2.useCallback((openState) => {
|
|
1265
|
-
if (setOpenProp) {
|
|
1266
|
-
setOpenProp(openState);
|
|
1267
|
-
} else {
|
|
1268
|
-
_setOpen(openState);
|
|
1269
|
-
}
|
|
1270
|
-
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
1271
|
-
}, [setOpenProp]);
|
|
1272
|
-
const toggleSidebar = React2.useCallback(() => {
|
|
1273
|
-
return isMobile ? setOpenMobile((open) => !open) : setOpen(!open);
|
|
1274
|
-
}, [isMobile, open, setOpen, setOpenMobile]);
|
|
1275
|
-
React2.useEffect(() => {
|
|
1276
|
-
const handleKeyDown = (event) => {
|
|
1277
|
-
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
1278
|
-
event.preventDefault();
|
|
1279
|
-
toggleSidebar();
|
|
1280
|
-
}
|
|
1281
|
-
};
|
|
1282
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
1283
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
1284
|
-
}, [toggleSidebar]);
|
|
1285
|
-
const state = open ? "expanded" : "collapsed";
|
|
1286
|
-
const contextValue = React2.useMemo(() => ({
|
|
1287
|
-
state,
|
|
1288
|
-
open,
|
|
1289
|
-
setOpen,
|
|
1290
|
-
isMobile,
|
|
1291
|
-
openMobile,
|
|
1292
|
-
setOpenMobile,
|
|
1293
|
-
toggleSidebar
|
|
1294
|
-
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]);
|
|
1295
|
-
const wrapperStyle = {
|
|
1296
|
-
"--sidebar-width": SIDEBAR_WIDTH,
|
|
1297
|
-
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
1298
|
-
...style
|
|
1299
|
-
};
|
|
1300
|
-
return /* @__PURE__ */ jsx12(SidebarContext.Provider, {
|
|
1301
|
-
value: contextValue,
|
|
1302
|
-
children: /* @__PURE__ */ jsx12("div", {
|
|
1303
|
-
"data-slot": "sidebar-wrapper",
|
|
1304
|
-
style: wrapperStyle,
|
|
1305
|
-
className: cn("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", className),
|
|
1306
|
-
...props,
|
|
1307
|
-
children
|
|
1308
|
-
})
|
|
1309
|
-
});
|
|
1310
|
-
}
|
|
1311
|
-
function Sidebar({
|
|
1312
|
-
side = "left",
|
|
1313
|
-
variant = "sidebar",
|
|
1314
|
-
collapsible = "offcanvas",
|
|
1315
|
-
className,
|
|
1316
|
-
children,
|
|
1317
|
-
dir,
|
|
1318
|
-
...props
|
|
1319
|
-
}) {
|
|
1320
|
-
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
1321
|
-
if (collapsible === "none") {
|
|
1322
|
-
return /* @__PURE__ */ jsx12("div", {
|
|
1323
|
-
"data-slot": "sidebar",
|
|
1324
|
-
className: cn("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", className),
|
|
1325
|
-
...props,
|
|
1326
|
-
children
|
|
1327
|
-
});
|
|
1328
|
-
}
|
|
1329
|
-
if (isMobile) {
|
|
1330
|
-
const mobileStyle = {
|
|
1331
|
-
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
1332
|
-
};
|
|
1333
|
-
return /* @__PURE__ */ jsx12(Sheet, {
|
|
1334
|
-
open: openMobile,
|
|
1335
|
-
onOpenChange: setOpenMobile,
|
|
1336
|
-
...props,
|
|
1337
|
-
children: /* @__PURE__ */ jsxs9(SheetContent, {
|
|
1338
|
-
dir,
|
|
1339
|
-
"data-sidebar": "sidebar",
|
|
1340
|
-
"data-slot": "sidebar",
|
|
1341
|
-
"data-mobile": "true",
|
|
1342
|
-
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
1343
|
-
style: mobileStyle,
|
|
1344
|
-
side,
|
|
1345
|
-
children: [
|
|
1346
|
-
/* @__PURE__ */ jsxs9(SheetHeader, {
|
|
1347
|
-
className: "sr-only",
|
|
1348
|
-
children: [
|
|
1349
|
-
/* @__PURE__ */ jsx12(SheetTitle, {
|
|
1350
|
-
children: "Sidebar"
|
|
1351
|
-
}),
|
|
1352
|
-
/* @__PURE__ */ jsx12(SheetDescription, {
|
|
1353
|
-
children: "Displays the mobile sidebar."
|
|
1354
|
-
})
|
|
1355
|
-
]
|
|
1356
|
-
}),
|
|
1357
|
-
/* @__PURE__ */ jsx12("div", {
|
|
1358
|
-
className: "flex h-full w-full flex-col",
|
|
1359
|
-
children
|
|
1360
|
-
})
|
|
1361
|
-
]
|
|
1362
|
-
})
|
|
1363
|
-
});
|
|
1364
|
-
}
|
|
1365
|
-
return /* @__PURE__ */ jsxs9("div", {
|
|
1366
|
-
className: "group peer text-sidebar-foreground hidden md:block",
|
|
1367
|
-
"data-state": state,
|
|
1368
|
-
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
1369
|
-
"data-variant": variant,
|
|
1370
|
-
"data-side": side,
|
|
1371
|
-
"data-slot": "sidebar",
|
|
1372
|
-
children: [
|
|
1373
|
-
/* @__PURE__ */ jsx12("div", {
|
|
1374
|
-
"data-slot": "sidebar-gap",
|
|
1375
|
-
className: cn("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
|
|
1376
|
-
}),
|
|
1377
|
-
/* @__PURE__ */ jsx12("div", {
|
|
1378
|
-
"data-slot": "sidebar-container",
|
|
1379
|
-
"data-side": side,
|
|
1380
|
-
className: cn("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex", variant === "floating" || variant === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", className),
|
|
1381
|
-
...props,
|
|
1382
|
-
children: /* @__PURE__ */ jsx12("div", {
|
|
1383
|
-
"data-sidebar": "sidebar",
|
|
1384
|
-
"data-slot": "sidebar-inner",
|
|
1385
|
-
className: "bg-sidebar group-data-[variant=floating]:ring-sidebar-border flex size-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1",
|
|
1386
|
-
children
|
|
1387
|
-
})
|
|
1388
|
-
})
|
|
1389
|
-
]
|
|
1390
|
-
});
|
|
1391
|
-
}
|
|
1392
|
-
function SidebarTrigger({
|
|
1393
|
-
className,
|
|
1394
|
-
onClick,
|
|
1395
|
-
...props
|
|
1396
|
-
}) {
|
|
1397
|
-
const { toggleSidebar } = useSidebar();
|
|
1398
|
-
return /* @__PURE__ */ jsxs9(Button, {
|
|
1399
|
-
"data-sidebar": "trigger",
|
|
1400
|
-
"data-slot": "sidebar-trigger",
|
|
1401
|
-
variant: "ghost",
|
|
1402
|
-
size: "icon-sm",
|
|
1403
|
-
className: cn(className),
|
|
1404
|
-
onClick: (event) => {
|
|
1405
|
-
onClick?.(event);
|
|
1406
|
-
toggleSidebar();
|
|
1407
|
-
},
|
|
1408
|
-
...props,
|
|
1409
|
-
children: [
|
|
1410
|
-
/* @__PURE__ */ jsx12(PanelLeftIcon, {}),
|
|
1411
|
-
/* @__PURE__ */ jsx12("span", {
|
|
1412
|
-
className: "sr-only",
|
|
1413
|
-
children: "Toggle Sidebar"
|
|
1414
|
-
})
|
|
1415
|
-
]
|
|
1416
|
-
});
|
|
1417
|
-
}
|
|
1418
|
-
function SidebarRail({ className, ...props }) {
|
|
1419
|
-
const { toggleSidebar } = useSidebar();
|
|
1420
|
-
return /* @__PURE__ */ jsx12("button", {
|
|
1421
|
-
"data-sidebar": "rail",
|
|
1422
|
-
"data-slot": "sidebar-rail",
|
|
1423
|
-
"aria-label": "Toggle Sidebar",
|
|
1424
|
-
tabIndex: -1,
|
|
1425
|
-
onClick: toggleSidebar,
|
|
1426
|
-
title: "Toggle Sidebar",
|
|
1427
|
-
className: cn("absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", className),
|
|
1428
|
-
...props
|
|
1429
|
-
});
|
|
1430
|
-
}
|
|
1431
|
-
function SidebarInset({ className, ...props }) {
|
|
1432
|
-
return /* @__PURE__ */ jsx12("main", {
|
|
1433
|
-
"data-slot": "sidebar-inset",
|
|
1434
|
-
className: cn("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", className),
|
|
1435
|
-
...props
|
|
1436
|
-
});
|
|
1437
|
-
}
|
|
1438
|
-
function SidebarHeader({ className, ...props }) {
|
|
1439
|
-
return /* @__PURE__ */ jsx12("div", {
|
|
1440
|
-
"data-slot": "sidebar-header",
|
|
1441
|
-
"data-sidebar": "header",
|
|
1442
|
-
className: cn("flex flex-col gap-2 p-2", className),
|
|
1443
|
-
...props
|
|
1444
|
-
});
|
|
1445
|
-
}
|
|
1446
|
-
function SidebarFooter({ className, ...props }) {
|
|
1447
|
-
return /* @__PURE__ */ jsx12("div", {
|
|
1448
|
-
"data-slot": "sidebar-footer",
|
|
1449
|
-
"data-sidebar": "footer",
|
|
1450
|
-
className: cn("flex flex-col gap-2 p-2", className),
|
|
1451
|
-
...props
|
|
1452
|
-
});
|
|
1453
|
-
}
|
|
1454
|
-
function SidebarContent({ className, ...props }) {
|
|
1455
|
-
return /* @__PURE__ */ jsx12("div", {
|
|
1456
|
-
"data-slot": "sidebar-content",
|
|
1457
|
-
"data-sidebar": "content",
|
|
1458
|
-
className: cn("no-scrollbar flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden", className),
|
|
1459
|
-
...props
|
|
1460
|
-
});
|
|
1461
|
-
}
|
|
1462
|
-
function SidebarGroup({ className, ...props }) {
|
|
1463
|
-
return /* @__PURE__ */ jsx12("div", {
|
|
1464
|
-
"data-slot": "sidebar-group",
|
|
1465
|
-
"data-sidebar": "group",
|
|
1466
|
-
className: cn("relative flex w-full min-w-0 flex-col p-2", className),
|
|
1467
|
-
...props
|
|
1468
|
-
});
|
|
1469
|
-
}
|
|
1470
|
-
function SidebarGroupLabel({
|
|
1471
|
-
className,
|
|
1472
|
-
render,
|
|
1473
|
-
...props
|
|
1474
|
-
}) {
|
|
1475
|
-
return useRender2({
|
|
1476
|
-
defaultTagName: "div",
|
|
1477
|
-
props: mergeProps2({
|
|
1478
|
-
className: cn("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", className)
|
|
1479
|
-
}, props),
|
|
1480
|
-
render,
|
|
1481
|
-
state: {
|
|
1482
|
-
slot: "sidebar-group-label",
|
|
1483
|
-
sidebar: "group-label"
|
|
1484
|
-
}
|
|
1485
|
-
});
|
|
1486
|
-
}
|
|
1487
|
-
function SidebarGroupContent({
|
|
1488
|
-
className,
|
|
1489
|
-
...props
|
|
1490
|
-
}) {
|
|
1491
|
-
return /* @__PURE__ */ jsx12("div", {
|
|
1492
|
-
"data-slot": "sidebar-group-content",
|
|
1493
|
-
"data-sidebar": "group-content",
|
|
1494
|
-
className: cn("w-full text-sm", className),
|
|
1495
|
-
...props
|
|
1496
|
-
});
|
|
1497
|
-
}
|
|
1498
|
-
function SidebarMenu({ className, ...props }) {
|
|
1499
|
-
return /* @__PURE__ */ jsx12("ul", {
|
|
1500
|
-
"data-slot": "sidebar-menu",
|
|
1501
|
-
"data-sidebar": "menu",
|
|
1502
|
-
className: cn("flex w-full min-w-0 flex-col gap-1", className),
|
|
1503
|
-
...props
|
|
1504
|
-
});
|
|
1505
|
-
}
|
|
1506
|
-
function SidebarMenuItem({ className, ...props }) {
|
|
1507
|
-
return /* @__PURE__ */ jsx12("li", {
|
|
1508
|
-
"data-slot": "sidebar-menu-item",
|
|
1509
|
-
"data-sidebar": "menu-item",
|
|
1510
|
-
className: cn("group/menu-item relative", className),
|
|
1511
|
-
...props
|
|
1512
|
-
});
|
|
1513
|
-
}
|
|
1514
|
-
var sidebarMenuButtonVariants = cva3("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate", {
|
|
1515
|
-
variants: {
|
|
1516
|
-
variant: {
|
|
1517
|
-
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
1518
|
-
outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
1519
|
-
},
|
|
1520
|
-
size: {
|
|
1521
|
-
default: "h-8 text-sm",
|
|
1522
|
-
sm: "h-7 text-xs",
|
|
1523
|
-
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
1524
|
-
}
|
|
1525
|
-
},
|
|
1526
|
-
defaultVariants: {
|
|
1527
|
-
variant: "default",
|
|
1528
|
-
size: "default"
|
|
1529
|
-
}
|
|
1530
|
-
});
|
|
1531
|
-
function SidebarMenuButton({
|
|
1532
|
-
render,
|
|
1533
|
-
isActive = false,
|
|
1534
|
-
variant = "default",
|
|
1535
|
-
size = "default",
|
|
1536
|
-
tooltip,
|
|
1537
|
-
className,
|
|
1538
|
-
...props
|
|
1539
|
-
}) {
|
|
1540
|
-
const { isMobile, state } = useSidebar();
|
|
1541
|
-
const comp = useRender2({
|
|
1542
|
-
defaultTagName: "button",
|
|
1543
|
-
props: mergeProps2({
|
|
1544
|
-
className: cn(sidebarMenuButtonVariants({ variant, size }), className)
|
|
1545
|
-
}, props),
|
|
1546
|
-
render: !tooltip ? render : /* @__PURE__ */ jsx12(TooltipTrigger, {
|
|
1547
|
-
render
|
|
1548
|
-
}),
|
|
1549
|
-
state: {
|
|
1550
|
-
slot: "sidebar-menu-button",
|
|
1551
|
-
sidebar: "menu-button",
|
|
1552
|
-
size,
|
|
1553
|
-
active: isActive
|
|
1554
|
-
}
|
|
1555
|
-
});
|
|
1556
|
-
if (!tooltip) {
|
|
1557
|
-
return comp;
|
|
1558
|
-
}
|
|
1559
|
-
const tooltipProps = Schema5.is(Schema5.String)(tooltip) ? { children: tooltip } : tooltip;
|
|
1560
|
-
return /* @__PURE__ */ jsxs9(Tooltip, {
|
|
1561
|
-
children: [
|
|
1562
|
-
comp,
|
|
1563
|
-
/* @__PURE__ */ jsx12(TooltipContent, {
|
|
1564
|
-
side: "right",
|
|
1565
|
-
align: "center",
|
|
1566
|
-
hidden: state !== "collapsed" || isMobile,
|
|
1567
|
-
...tooltipProps
|
|
1568
|
-
})
|
|
1569
|
-
]
|
|
1570
|
-
});
|
|
1571
|
-
}
|
|
1572
|
-
function SidebarMenuSub({ className, ...props }) {
|
|
1573
|
-
return /* @__PURE__ */ jsx12("ul", {
|
|
1574
|
-
"data-slot": "sidebar-menu-sub",
|
|
1575
|
-
"data-sidebar": "menu-sub",
|
|
1576
|
-
className: cn("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden", className),
|
|
1577
|
-
...props
|
|
1578
|
-
});
|
|
1579
|
-
}
|
|
1580
|
-
function SidebarMenuSubItem({
|
|
1581
|
-
className,
|
|
1582
|
-
...props
|
|
1583
|
-
}) {
|
|
1584
|
-
return /* @__PURE__ */ jsx12("li", {
|
|
1585
|
-
"data-slot": "sidebar-menu-sub-item",
|
|
1586
|
-
"data-sidebar": "menu-sub-item",
|
|
1587
|
-
className: cn("group/menu-sub-item relative", className),
|
|
1588
|
-
...props
|
|
1589
|
-
});
|
|
1590
|
-
}
|
|
1591
|
-
function SidebarMenuSubButton({
|
|
1592
|
-
render,
|
|
1593
|
-
size = "md",
|
|
1594
|
-
isActive = false,
|
|
1595
|
-
className,
|
|
1596
|
-
...props
|
|
1597
|
-
}) {
|
|
1598
|
-
return useRender2({
|
|
1599
|
-
defaultTagName: "a",
|
|
1600
|
-
props: mergeProps2({
|
|
1601
|
-
className: cn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", className)
|
|
1602
|
-
}, props),
|
|
1603
|
-
render,
|
|
1604
|
-
state: {
|
|
1605
|
-
slot: "sidebar-menu-sub-button",
|
|
1606
|
-
sidebar: "menu-sub-button",
|
|
1607
|
-
size,
|
|
1608
|
-
active: isActive
|
|
1609
|
-
}
|
|
1610
|
-
});
|
|
1611
|
-
}
|
|
803
|
+
import { Badge } from "@/components/ui/badge";
|
|
804
|
+
import {
|
|
805
|
+
Sidebar,
|
|
806
|
+
SidebarContent,
|
|
807
|
+
SidebarFooter,
|
|
808
|
+
SidebarGroup,
|
|
809
|
+
SidebarGroupContent,
|
|
810
|
+
SidebarGroupLabel,
|
|
811
|
+
SidebarHeader,
|
|
812
|
+
SidebarMenu,
|
|
813
|
+
SidebarMenuButton,
|
|
814
|
+
SidebarMenuItem,
|
|
815
|
+
SidebarMenuSub,
|
|
816
|
+
SidebarMenuSubButton,
|
|
817
|
+
SidebarMenuSubItem,
|
|
818
|
+
SidebarRail,
|
|
819
|
+
SidebarInset,
|
|
820
|
+
SidebarProvider,
|
|
821
|
+
SidebarTrigger,
|
|
822
|
+
useSidebar
|
|
823
|
+
} from "@/components/ui/sidebar";
|
|
1612
824
|
|
|
1613
825
|
// ../../src/components/sidebar-layout/classes.ts
|
|
1614
826
|
var sidebarLayoutClasses = {
|
|
@@ -1627,83 +839,91 @@ var resolveSidebarLayoutClasses = (overrides) => ({
|
|
|
1627
839
|
});
|
|
1628
840
|
|
|
1629
841
|
// ../../src/components/sidebar-layout/index.ts
|
|
1630
|
-
import { Option, Schema as
|
|
842
|
+
import { Option, Schema as Schema6 } from "effect";
|
|
1631
843
|
import { Cookies } from "effect/http";
|
|
1632
844
|
import { Component as Component5, UiSchema as UiSchema3 } from "effect/ui";
|
|
1633
845
|
|
|
1634
846
|
// ../../src/components/sidebar-layout/schema.ts
|
|
1635
|
-
import { Schema as
|
|
1636
|
-
var SidebarCollapsibleSchema =
|
|
847
|
+
import { Schema as Schema5, Struct as Struct2 } from "effect";
|
|
848
|
+
var SidebarCollapsibleSchema = Schema5.Literals([
|
|
1637
849
|
"icon",
|
|
1638
850
|
"offcanvas",
|
|
1639
851
|
"none"
|
|
1640
852
|
]);
|
|
1641
|
-
var NavItemSchema =
|
|
1642
|
-
label:
|
|
1643
|
-
href:
|
|
1644
|
-
exact:
|
|
1645
|
-
badge:
|
|
1646
|
-
external:
|
|
853
|
+
var NavItemSchema = Schema5.Struct({
|
|
854
|
+
label: Schema5.String,
|
|
855
|
+
href: Schema5.String,
|
|
856
|
+
exact: Schema5.optional(Schema5.Boolean),
|
|
857
|
+
badge: Schema5.optional(Schema5.String),
|
|
858
|
+
external: Schema5.optional(Schema5.Boolean)
|
|
1647
859
|
}).annotate({ identifier: "SidebarNavItem" });
|
|
1648
|
-
var NavGroupSchema =
|
|
1649
|
-
label:
|
|
1650
|
-
items:
|
|
860
|
+
var NavGroupSchema = Schema5.Struct({
|
|
861
|
+
label: Schema5.String,
|
|
862
|
+
items: Schema5.Array(NavItemSchema)
|
|
1651
863
|
}).annotate({ identifier: "SidebarNavGroup" });
|
|
1652
864
|
var layoutSlots = ["toolbar", "content", "desktopViewport"];
|
|
1653
|
-
var SidebarLayoutClassesOverridesSchema =
|
|
1654
|
-
var SidebarPageHeaderClassesOverridesSchema =
|
|
1655
|
-
var SidebarLayoutPropsSchema =
|
|
1656
|
-
classes:
|
|
1657
|
-
groups:
|
|
1658
|
-
contentClassName:
|
|
1659
|
-
fullPage:
|
|
1660
|
-
sidebarCollapsible:
|
|
1661
|
-
defaultOpen:
|
|
865
|
+
var SidebarLayoutClassesOverridesSchema = Schema5.Record(Schema5.Literals(Struct2.keys(Struct2.pick(sidebarLayoutClasses, layoutSlots))), Schema5.optionalKey(Schema5.String)).annotate({ identifier: "SidebarLayoutClassesOverrides" });
|
|
866
|
+
var SidebarPageHeaderClassesOverridesSchema = Schema5.Record(Schema5.Literals(Struct2.keys(Struct2.omit(sidebarLayoutClasses, layoutSlots))), Schema5.optionalKey(Schema5.String)).annotate({ identifier: "SidebarPageHeaderClassesOverrides" });
|
|
867
|
+
var SidebarLayoutPropsSchema = Schema5.Struct({
|
|
868
|
+
classes: Schema5.optional(SidebarLayoutClassesOverridesSchema),
|
|
869
|
+
groups: Schema5.Array(NavGroupSchema),
|
|
870
|
+
contentClassName: Schema5.optional(Schema5.String),
|
|
871
|
+
fullPage: Schema5.optional(Schema5.Boolean),
|
|
872
|
+
sidebarCollapsible: Schema5.optional(SidebarCollapsibleSchema),
|
|
873
|
+
defaultOpen: Schema5.optional(Schema5.Boolean)
|
|
1662
874
|
}).annotate({ identifier: "SidebarLayoutProps" });
|
|
1663
|
-
var SidebarPageHeaderPropsSchema =
|
|
1664
|
-
classes:
|
|
1665
|
-
title:
|
|
1666
|
-
description:
|
|
1667
|
-
badge:
|
|
1668
|
-
label:
|
|
1669
|
-
variant:
|
|
875
|
+
var SidebarPageHeaderPropsSchema = Schema5.Struct({
|
|
876
|
+
classes: Schema5.optional(SidebarPageHeaderClassesOverridesSchema),
|
|
877
|
+
title: Schema5.String,
|
|
878
|
+
description: Schema5.optional(Schema5.String),
|
|
879
|
+
badge: Schema5.optional(Schema5.Struct({
|
|
880
|
+
label: Schema5.String,
|
|
881
|
+
variant: Schema5.optional(Schema5.Literals(["default", "secondary", "outline", "destructive"]))
|
|
1670
882
|
}))
|
|
1671
883
|
}).annotate({ identifier: "SidebarPageHeaderProps" });
|
|
1672
884
|
|
|
1673
885
|
// ../../src/components/sidebar-layout/index.ts
|
|
1674
886
|
var cookieName = "sidebar_state";
|
|
1675
|
-
var SidebarOpenCookie =
|
|
887
|
+
var SidebarOpenCookie = Schema6.Literals(["true", "false"]).annotate({
|
|
1676
888
|
identifier: "SidebarOpenCookie"
|
|
1677
889
|
});
|
|
1678
|
-
var getSidebarDefaultOpen = (defaultOpen) =>
|
|
890
|
+
var getSidebarDefaultOpen = (defaultOpen) => Schema6.decodeUnknownOption(SidebarOpenCookie)(Cookies.parseHeader(globalThis.document?.cookie ?? "")[cookieName]).pipe(Option.map((value) => value === "true"), Option.getOrElse(() => defaultOpen));
|
|
1679
891
|
var SidebarLayoutMessage = UiSchema3.TaggedEnum({
|
|
1680
|
-
SetOpen: { open:
|
|
1681
|
-
SetMobileOpen: { open:
|
|
892
|
+
SetOpen: { open: Schema6.Boolean },
|
|
893
|
+
SetMobileOpen: { open: Schema6.Boolean },
|
|
894
|
+
SetMobileViewport: { mobile: Schema6.Boolean },
|
|
895
|
+
SetItemTooltip: { href: Schema6.String, open: Schema6.Boolean }
|
|
1682
896
|
}).annotate({ identifier: "SidebarLayoutMessage" });
|
|
1683
897
|
var sidebarLayoutOptions = {
|
|
1684
898
|
name: "SidebarLayout",
|
|
1685
899
|
props: SidebarLayoutPropsSchema,
|
|
1686
|
-
model:
|
|
1687
|
-
open:
|
|
1688
|
-
mobileOpen:
|
|
900
|
+
model: Schema6.Struct({
|
|
901
|
+
open: Schema6.Boolean,
|
|
902
|
+
mobileOpen: Schema6.Boolean,
|
|
903
|
+
mobile: Schema6.Boolean,
|
|
904
|
+
tooltipHref: Schema6.NullOr(Schema6.String)
|
|
1689
905
|
}).annotate({ identifier: "SidebarLayoutModel" }),
|
|
1690
906
|
message: SidebarLayoutMessage,
|
|
1691
907
|
restore: false
|
|
1692
908
|
};
|
|
1693
909
|
var update3 = Component5.define(sidebarLayoutOptions).update({
|
|
1694
|
-
SetOpen: ($, { open }) => ({ ...$.model, open }),
|
|
1695
|
-
SetMobileOpen: ($, { open }) => ({ ...$.model, mobileOpen: open })
|
|
910
|
+
SetOpen: ($, { open }) => ({ ...$.model, open, tooltipHref: null }),
|
|
911
|
+
SetMobileOpen: ($, { open }) => ({ ...$.model, mobileOpen: open }),
|
|
912
|
+
SetMobileViewport: ($, { mobile }) => $.model.mobile === mobile ? $.model : { ...$.model, mobile, mobileOpen: false, tooltipHref: null },
|
|
913
|
+
SetItemTooltip: ($, { href, open }) => open && !$.model.open && !$.model.mobile ? { ...$.model, tooltipHref: href } : $.model.tooltipHref === href ? { ...$.model, tooltipHref: null } : $.model
|
|
1696
914
|
});
|
|
1697
915
|
var sidebarLayoutBehaviours = {
|
|
1698
916
|
init: ({ props }) => ({
|
|
1699
917
|
open: getSidebarDefaultOpen(props.defaultOpen ?? true),
|
|
1700
|
-
mobileOpen: false
|
|
918
|
+
mobileOpen: false,
|
|
919
|
+
mobile: false,
|
|
920
|
+
tooltipHref: null
|
|
1701
921
|
}),
|
|
1702
922
|
update: update3
|
|
1703
923
|
};
|
|
1704
924
|
|
|
1705
925
|
// ../../src/components/sidebar-layout/react.tsx
|
|
1706
|
-
import { jsx as
|
|
926
|
+
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1707
927
|
var SidebarModel = Component6.define(sidebarLayoutOptions).make({
|
|
1708
928
|
...sidebarLayoutBehaviours,
|
|
1709
929
|
view: () => View3.text("")
|
|
@@ -1714,28 +934,28 @@ function AppSidebar({ collapsible, footer, groups, header }) {
|
|
|
1714
934
|
if (isMobile)
|
|
1715
935
|
setOpenMobile(false);
|
|
1716
936
|
};
|
|
1717
|
-
return /* @__PURE__ */
|
|
937
|
+
return /* @__PURE__ */ jsxs5(Sidebar, {
|
|
1718
938
|
collapsible,
|
|
1719
939
|
children: [
|
|
1720
|
-
header && /* @__PURE__ */
|
|
940
|
+
header && /* @__PURE__ */ jsx6(SidebarHeader, {
|
|
1721
941
|
children: header
|
|
1722
942
|
}),
|
|
1723
|
-
/* @__PURE__ */
|
|
943
|
+
/* @__PURE__ */ jsx6(SidebarContent, {
|
|
1724
944
|
className: "group-data-[collapsible=icon]:overflow-x-hidden group-data-[collapsible=icon]:overflow-y-auto",
|
|
1725
|
-
children: groups.map((group) => /* @__PURE__ */
|
|
945
|
+
children: groups.map((group) => /* @__PURE__ */ jsxs5(SidebarGroup, {
|
|
1726
946
|
children: [
|
|
1727
|
-
/* @__PURE__ */
|
|
947
|
+
/* @__PURE__ */ jsx6(SidebarGroupLabel, {
|
|
1728
948
|
children: group.label()
|
|
1729
949
|
}),
|
|
1730
|
-
/* @__PURE__ */
|
|
1731
|
-
children: /* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ jsx6(SidebarGroupContent, {
|
|
951
|
+
children: /* @__PURE__ */ jsx6(SidebarMenu, {
|
|
1732
952
|
"aria-label": group.label(),
|
|
1733
953
|
children: group.items.map((item) => {
|
|
1734
|
-
const render = item.external ? /* @__PURE__ */
|
|
954
|
+
const render = item.external ? /* @__PURE__ */ jsx6("a", {
|
|
1735
955
|
href: item.href,
|
|
1736
956
|
target: "_blank",
|
|
1737
957
|
rel: "noreferrer"
|
|
1738
|
-
}) : /* @__PURE__ */
|
|
958
|
+
}) : /* @__PURE__ */ jsx6(Link, {
|
|
1739
959
|
to: item.href,
|
|
1740
960
|
activeOptions: {
|
|
1741
961
|
exact: item.exact ?? false,
|
|
@@ -1743,31 +963,31 @@ function AppSidebar({ collapsible, footer, groups, header }) {
|
|
|
1743
963
|
},
|
|
1744
964
|
activeProps: { "data-active": "" }
|
|
1745
965
|
});
|
|
1746
|
-
return /* @__PURE__ */
|
|
966
|
+
return /* @__PURE__ */ jsxs5(SidebarMenuItem, {
|
|
1747
967
|
children: [
|
|
1748
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ jsxs5(SidebarMenuButton, {
|
|
1749
969
|
className: "h-auto min-h-8",
|
|
1750
970
|
onClick: closeMobileSidebar,
|
|
1751
971
|
render,
|
|
1752
972
|
tooltip: item.label(),
|
|
1753
973
|
children: [
|
|
1754
|
-
item.icon ? /* @__PURE__ */
|
|
1755
|
-
/* @__PURE__ */
|
|
974
|
+
item.icon ? /* @__PURE__ */ jsx6(item.icon, {}) : null,
|
|
975
|
+
/* @__PURE__ */ jsx6("span", {
|
|
1756
976
|
children: item.label()
|
|
1757
977
|
}),
|
|
1758
|
-
item.badge ? /* @__PURE__ */
|
|
978
|
+
item.badge ? /* @__PURE__ */ jsx6(Badge, {
|
|
1759
979
|
className: "ml-auto",
|
|
1760
980
|
variant: "secondary",
|
|
1761
981
|
children: item.badge()
|
|
1762
982
|
}) : null
|
|
1763
983
|
]
|
|
1764
984
|
}),
|
|
1765
|
-
item.children?.length ? /* @__PURE__ */
|
|
985
|
+
item.children?.length ? /* @__PURE__ */ jsx6(SidebarMenuSub, {
|
|
1766
986
|
"aria-label": item.label(),
|
|
1767
|
-
children: item.children.map((child) => /* @__PURE__ */
|
|
1768
|
-
children: /* @__PURE__ */
|
|
987
|
+
children: item.children.map((child) => /* @__PURE__ */ jsx6(SidebarMenuSubItem, {
|
|
988
|
+
children: /* @__PURE__ */ jsx6(SidebarMenuSubButton, {
|
|
1769
989
|
onClick: closeMobileSidebar,
|
|
1770
|
-
render: /* @__PURE__ */
|
|
990
|
+
render: /* @__PURE__ */ jsx6(Link, {
|
|
1771
991
|
to: child.href,
|
|
1772
992
|
activeOptions: {
|
|
1773
993
|
exact: true,
|
|
@@ -1775,7 +995,7 @@ function AppSidebar({ collapsible, footer, groups, header }) {
|
|
|
1775
995
|
},
|
|
1776
996
|
activeProps: { "data-active": "" }
|
|
1777
997
|
}),
|
|
1778
|
-
children: /* @__PURE__ */
|
|
998
|
+
children: /* @__PURE__ */ jsx6("span", {
|
|
1779
999
|
children: child.label()
|
|
1780
1000
|
})
|
|
1781
1001
|
})
|
|
@@ -1789,10 +1009,10 @@ function AppSidebar({ collapsible, footer, groups, header }) {
|
|
|
1789
1009
|
]
|
|
1790
1010
|
}, group.label()))
|
|
1791
1011
|
}),
|
|
1792
|
-
footer ? /* @__PURE__ */
|
|
1012
|
+
footer ? /* @__PURE__ */ jsx6(SidebarFooter, {
|
|
1793
1013
|
children: footer
|
|
1794
1014
|
}) : null,
|
|
1795
|
-
/* @__PURE__ */
|
|
1015
|
+
/* @__PURE__ */ jsx6(SidebarRail, {})
|
|
1796
1016
|
]
|
|
1797
1017
|
});
|
|
1798
1018
|
}
|
|
@@ -1816,36 +1036,36 @@ function SidebarLayout({
|
|
|
1816
1036
|
groups: [],
|
|
1817
1037
|
defaultOpen
|
|
1818
1038
|
});
|
|
1819
|
-
return /* @__PURE__ */
|
|
1039
|
+
return /* @__PURE__ */ jsxs5(SidebarProvider, {
|
|
1820
1040
|
open: sidebarOpen,
|
|
1821
1041
|
onOpenChange: (open) => send(SidebarLayoutMessage.SetOpen({ open })),
|
|
1822
1042
|
className: cn(fullPage && sidebarLayoutClasses.desktopViewport),
|
|
1823
1043
|
children: [
|
|
1824
|
-
/* @__PURE__ */
|
|
1044
|
+
/* @__PURE__ */ jsx6(AppSidebar, {
|
|
1825
1045
|
collapsible: sidebarCollapsible,
|
|
1826
1046
|
footer: sidebarFooter,
|
|
1827
1047
|
groups,
|
|
1828
1048
|
header: sidebarHeader
|
|
1829
1049
|
}),
|
|
1830
|
-
/* @__PURE__ */
|
|
1050
|
+
/* @__PURE__ */ jsxs5(SidebarInset, {
|
|
1831
1051
|
className: cn("min-w-0 overflow-x-clip", fullPage && sidebarLayoutClasses.desktopViewport),
|
|
1832
1052
|
children: [
|
|
1833
|
-
/* @__PURE__ */
|
|
1053
|
+
/* @__PURE__ */ jsx6("div", {
|
|
1834
1054
|
className: "h-14 shrink-0",
|
|
1835
|
-
children: /* @__PURE__ */
|
|
1055
|
+
children: /* @__PURE__ */ jsxs5("header", {
|
|
1836
1056
|
className: cn("bg-background/95 supports-[backdrop-filter]:bg-background/60 fixed inset-x-0 top-0 z-10 flex h-14 items-center gap-2 border-b px-4 backdrop-blur transition-[left] duration-200 ease-linear", sidebarCollapsible === "none" ? "left-(--sidebar-width)" : sidebarOpen ? "md:left-(--sidebar-width)" : sidebarCollapsible === "icon" ? "md:left-(--sidebar-width-icon)" : "md:left-0", fullPage && "xl:static"),
|
|
1837
1057
|
children: [
|
|
1838
|
-
/* @__PURE__ */
|
|
1839
|
-
/* @__PURE__ */
|
|
1058
|
+
/* @__PURE__ */ jsx6(SidebarTrigger, {}),
|
|
1059
|
+
/* @__PURE__ */ jsx6("div", {
|
|
1840
1060
|
className: sidebarLayoutClasses.toolbar,
|
|
1841
1061
|
children: headerActions
|
|
1842
1062
|
})
|
|
1843
1063
|
]
|
|
1844
1064
|
})
|
|
1845
1065
|
}),
|
|
1846
|
-
/* @__PURE__ */
|
|
1066
|
+
/* @__PURE__ */ jsx6("div", {
|
|
1847
1067
|
className: cn(sidebarLayoutClasses.content, contentClassName ?? "flex flex-col gap-6 px-5 py-6 md:px-8"),
|
|
1848
|
-
children: children ?? /* @__PURE__ */
|
|
1068
|
+
children: children ?? /* @__PURE__ */ jsx6(Outlet, {})
|
|
1849
1069
|
})
|
|
1850
1070
|
]
|
|
1851
1071
|
})
|
|
@@ -1966,15 +1186,15 @@ var createSeo = (defaults) => (options) => seo({
|
|
|
1966
1186
|
});
|
|
1967
1187
|
|
|
1968
1188
|
// ../../src/lib/docs.tsx
|
|
1969
|
-
import { jsx as
|
|
1970
|
-
var
|
|
1971
|
-
var SidebarOpenCookie2 =
|
|
1189
|
+
import { jsx as jsx7, jsxs as jsxs6, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
1190
|
+
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
1191
|
+
var SidebarOpenCookie2 = Schema7.Literals(["true", "false"]).annotate({
|
|
1972
1192
|
identifier: "SidebarOpenCookie"
|
|
1973
1193
|
});
|
|
1974
|
-
var getSidebarOpenCookie = createIsomorphicFn().server(() => getCookie(
|
|
1975
|
-
var getSidebarDefaultOpen2 = () =>
|
|
1194
|
+
var getSidebarOpenCookie = createIsomorphicFn().server(() => getCookie(SIDEBAR_COOKIE_NAME)).client(() => Cookies2.parseHeader(globalThis.document?.cookie ?? "")[SIDEBAR_COOKIE_NAME]);
|
|
1195
|
+
var getSidebarDefaultOpen2 = () => Schema7.decodeUnknownOption(SidebarOpenCookie2)(getSidebarOpenCookie()).pipe(Option2.map((value) => value === "true"), Option2.getOrElse(() => true));
|
|
1976
1196
|
var makeIcon = (name, paths) => {
|
|
1977
|
-
const Icon = forwardRef(({ absoluteStrokeWidth: _absoluteStrokeWidth, size = 24, ...props }, ref) => /* @__PURE__ */
|
|
1197
|
+
const Icon = forwardRef(({ absoluteStrokeWidth: _absoluteStrokeWidth, size = 24, ...props }, ref) => /* @__PURE__ */ jsx7("svg", {
|
|
1978
1198
|
"aria-hidden": "true",
|
|
1979
1199
|
fill: "none",
|
|
1980
1200
|
height: size,
|
|
@@ -1991,63 +1211,63 @@ var makeIcon = (name, paths) => {
|
|
|
1991
1211
|
Icon.displayName = name;
|
|
1992
1212
|
return Icon;
|
|
1993
1213
|
};
|
|
1994
|
-
var ArrowLeft = makeIcon("ArrowLeft", /* @__PURE__ */
|
|
1214
|
+
var ArrowLeft = makeIcon("ArrowLeft", /* @__PURE__ */ jsxs6(Fragment2, {
|
|
1995
1215
|
children: [
|
|
1996
|
-
/* @__PURE__ */
|
|
1216
|
+
/* @__PURE__ */ jsx7("path", {
|
|
1997
1217
|
d: "m12 19-7-7 7-7"
|
|
1998
1218
|
}),
|
|
1999
|
-
/* @__PURE__ */
|
|
1219
|
+
/* @__PURE__ */ jsx7("path", {
|
|
2000
1220
|
d: "M19 12H5"
|
|
2001
1221
|
})
|
|
2002
1222
|
]
|
|
2003
1223
|
}));
|
|
2004
|
-
var ArrowRight = makeIcon("ArrowRight", /* @__PURE__ */
|
|
1224
|
+
var ArrowRight = makeIcon("ArrowRight", /* @__PURE__ */ jsxs6(Fragment2, {
|
|
2005
1225
|
children: [
|
|
2006
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ jsx7("path", {
|
|
2007
1227
|
d: "M5 12h14"
|
|
2008
1228
|
}),
|
|
2009
|
-
/* @__PURE__ */
|
|
1229
|
+
/* @__PURE__ */ jsx7("path", {
|
|
2010
1230
|
d: "m12 5 7 7-7 7"
|
|
2011
1231
|
})
|
|
2012
1232
|
]
|
|
2013
1233
|
}));
|
|
2014
|
-
var BookOpen = makeIcon("BookOpen", /* @__PURE__ */
|
|
1234
|
+
var BookOpen = makeIcon("BookOpen", /* @__PURE__ */ jsxs6(Fragment2, {
|
|
2015
1235
|
children: [
|
|
2016
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ jsx7("path", {
|
|
2017
1237
|
d: "M12 7v14"
|
|
2018
1238
|
}),
|
|
2019
|
-
/* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ jsx7("path", {
|
|
2020
1240
|
d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4Z"
|
|
2021
1241
|
})
|
|
2022
1242
|
]
|
|
2023
1243
|
}));
|
|
2024
|
-
var ChevronDown = makeIcon("ChevronDown", /* @__PURE__ */
|
|
1244
|
+
var ChevronDown = makeIcon("ChevronDown", /* @__PURE__ */ jsx7("path", {
|
|
2025
1245
|
d: "m6 9 6 6 6-6"
|
|
2026
1246
|
}));
|
|
2027
|
-
var ExternalLink = makeIcon("ExternalLink", /* @__PURE__ */
|
|
1247
|
+
var ExternalLink = makeIcon("ExternalLink", /* @__PURE__ */ jsxs6(Fragment2, {
|
|
2028
1248
|
children: [
|
|
2029
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ jsx7("path", {
|
|
2030
1250
|
d: "M15 3h6v6"
|
|
2031
1251
|
}),
|
|
2032
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ jsx7("path", {
|
|
2033
1253
|
d: "M10 14 21 3"
|
|
2034
1254
|
}),
|
|
2035
|
-
/* @__PURE__ */
|
|
1255
|
+
/* @__PURE__ */ jsx7("path", {
|
|
2036
1256
|
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"
|
|
2037
1257
|
})
|
|
2038
1258
|
]
|
|
2039
1259
|
}));
|
|
2040
|
-
var DocsSection =
|
|
1260
|
+
var DocsSection = Schema7.String.annotate({
|
|
2041
1261
|
identifier: "DocsSection"
|
|
2042
1262
|
});
|
|
2043
|
-
var DocsPageType =
|
|
1263
|
+
var DocsPageType = Schema7.Literals([
|
|
2044
1264
|
"concept",
|
|
2045
1265
|
"tutorial",
|
|
2046
1266
|
"how-to",
|
|
2047
1267
|
"reference",
|
|
2048
1268
|
"runbook"
|
|
2049
1269
|
]).annotate({ identifier: "DocsPageType" });
|
|
2050
|
-
var DocsDate =
|
|
1270
|
+
var DocsDate = Schema7.String.pipe(Schema7.check(Schema7.makeFilter((date) => Number.isNaN(new Date(date).getTime()) ? "Expected a valid date" : undefined)));
|
|
2051
1271
|
var NEW_DOCS_PAGE_DAYS = 14;
|
|
2052
1272
|
var isDocsPageNew = (createdAt, now = new Date) => {
|
|
2053
1273
|
if (!createdAt)
|
|
@@ -2055,38 +1275,38 @@ var isDocsPageNew = (createdAt, now = new Date) => {
|
|
|
2055
1275
|
const age = now.getTime() - new Date(createdAt).getTime();
|
|
2056
1276
|
return age >= 0 && age < NEW_DOCS_PAGE_DAYS * 24 * 60 * 60 * 1000;
|
|
2057
1277
|
};
|
|
2058
|
-
var DocsFrontmatter =
|
|
2059
|
-
slug:
|
|
2060
|
-
path:
|
|
2061
|
-
title:
|
|
2062
|
-
description:
|
|
2063
|
-
icon:
|
|
2064
|
-
order:
|
|
2065
|
-
locale:
|
|
1278
|
+
var DocsFrontmatter = Schema7.Struct({
|
|
1279
|
+
slug: Schema7.String,
|
|
1280
|
+
path: Schema7.String,
|
|
1281
|
+
title: Schema7.String,
|
|
1282
|
+
description: Schema7.String,
|
|
1283
|
+
icon: Schema7.optional(Schema7.String),
|
|
1284
|
+
order: Schema7.Finite,
|
|
1285
|
+
locale: Schema7.String,
|
|
2066
1286
|
section: DocsSection,
|
|
2067
1287
|
type: DocsPageType,
|
|
2068
|
-
createdAt:
|
|
2069
|
-
updatedAt:
|
|
2070
|
-
legacySlugs:
|
|
2071
|
-
tags:
|
|
1288
|
+
createdAt: Schema7.optional(DocsDate),
|
|
1289
|
+
updatedAt: Schema7.optional(DocsDate),
|
|
1290
|
+
legacySlugs: Schema7.optional(Schema7.Array(Schema7.String)),
|
|
1291
|
+
tags: Schema7.optional(Schema7.Array(Schema7.NonEmptyString))
|
|
2072
1292
|
}).annotate({ identifier: "DocsFrontmatter" });
|
|
2073
|
-
var DocsHeadingSchema =
|
|
2074
|
-
depth:
|
|
2075
|
-
id:
|
|
2076
|
-
title:
|
|
1293
|
+
var DocsHeadingSchema = Schema7.Struct({
|
|
1294
|
+
depth: Schema7.Literals([2, 3]),
|
|
1295
|
+
id: Schema7.String,
|
|
1296
|
+
title: Schema7.String
|
|
2077
1297
|
}).annotate({ identifier: "DocsHeading" });
|
|
2078
|
-
var DocsCodeBlockSchema =
|
|
2079
|
-
code:
|
|
2080
|
-
language:
|
|
1298
|
+
var DocsCodeBlockSchema = Schema7.Struct({
|
|
1299
|
+
code: Schema7.String,
|
|
1300
|
+
language: Schema7.String
|
|
2081
1301
|
}).annotate({ identifier: "DocsCodeBlock" });
|
|
2082
|
-
var DocsPageSchema =
|
|
1302
|
+
var DocsPageSchema = Schema7.Struct({
|
|
2083
1303
|
...DocsFrontmatter.fields,
|
|
2084
|
-
codeBlocks:
|
|
2085
|
-
headings:
|
|
2086
|
-
html:
|
|
2087
|
-
searchText:
|
|
2088
|
-
sourceFile:
|
|
2089
|
-
source:
|
|
1304
|
+
codeBlocks: Schema7.Array(DocsCodeBlockSchema),
|
|
1305
|
+
headings: Schema7.Array(DocsHeadingSchema),
|
|
1306
|
+
html: Schema7.String,
|
|
1307
|
+
searchText: Schema7.String,
|
|
1308
|
+
sourceFile: Schema7.String,
|
|
1309
|
+
source: Schema7.String
|
|
2090
1310
|
}).annotate({ identifier: "DocsPage" });
|
|
2091
1311
|
var slugifyDocsHeading = (value) => value.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[`*_~]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
2092
1312
|
var validateDocsPages = (pages, config) => {
|
|
@@ -2157,7 +1377,7 @@ var createDocsSource = (config) => {
|
|
|
2157
1377
|
if (new Set(config.locales).size !== config.locales.length) {
|
|
2158
1378
|
throw new Error("Documentation source locales must be unique");
|
|
2159
1379
|
}
|
|
2160
|
-
const pages = validateDocsPages(config.pages.map((page) =>
|
|
1380
|
+
const pages = validateDocsPages(config.pages.map((page) => Schema7.decodeUnknownSync(DocsPageSchema)(page)), config);
|
|
2161
1381
|
const getPage = (slug, locale) => pages.find((page) => page.slug === slug && page.locale === locale);
|
|
2162
1382
|
const resolvePage = (slug, locale) => pages.find((page) => page.locale === locale && (page.slug === slug || page.legacySlugs?.includes(slug)));
|
|
2163
1383
|
const getPages = (locale) => pages.filter((page) => page.locale === locale).sort((left, right) => left.order - right.order);
|
|
@@ -2423,7 +1643,7 @@ var DocsArticle = ({
|
|
|
2423
1643
|
messages,
|
|
2424
1644
|
page
|
|
2425
1645
|
}) => {
|
|
2426
|
-
return /* @__PURE__ */
|
|
1646
|
+
return /* @__PURE__ */ jsx7(MarkdownContent, {
|
|
2427
1647
|
codeBlocks: page.codeBlocks,
|
|
2428
1648
|
html: page.html,
|
|
2429
1649
|
locale,
|
|
@@ -2438,8 +1658,8 @@ var DocsArticle = ({
|
|
|
2438
1658
|
});
|
|
2439
1659
|
};
|
|
2440
1660
|
var useActiveDocsHeading = (headings) => {
|
|
2441
|
-
const [activeHeadingId, setActiveHeadingId] =
|
|
2442
|
-
|
|
1661
|
+
const [activeHeadingId, setActiveHeadingId] = useState3();
|
|
1662
|
+
useEffect2(() => {
|
|
2443
1663
|
const elements = headings.flatMap((heading) => {
|
|
2444
1664
|
const element = document.getElementById(heading.id);
|
|
2445
1665
|
return element ? [element] : [];
|
|
@@ -2478,12 +1698,12 @@ var DocsTableOfContentsItems = ({
|
|
|
2478
1698
|
headings
|
|
2479
1699
|
}) => {
|
|
2480
1700
|
const activeHeadingId = useActiveDocsHeading(headings);
|
|
2481
|
-
return /* @__PURE__ */
|
|
1701
|
+
return /* @__PURE__ */ jsx7("ol", {
|
|
2482
1702
|
className: "border-l",
|
|
2483
1703
|
children: headings.map((heading) => {
|
|
2484
1704
|
const isActive = heading.id === activeHeadingId;
|
|
2485
|
-
return /* @__PURE__ */
|
|
2486
|
-
children: /* @__PURE__ */
|
|
1705
|
+
return /* @__PURE__ */ jsx7("li", {
|
|
1706
|
+
children: /* @__PURE__ */ jsx7("a", {
|
|
2487
1707
|
"aria-current": isActive ? "location" : undefined,
|
|
2488
1708
|
className: `hover:text-foreground -ml-px block border-l py-1.5 text-sm leading-5 transition-colors ${isActive ? "border-primary text-foreground font-medium" : "text-muted-foreground border-transparent"} ${heading.depth === 3 ? "pl-6" : "pl-4"}`,
|
|
2489
1709
|
href: `#${heading.id}`,
|
|
@@ -2499,15 +1719,15 @@ var DocsTableOfContents = ({
|
|
|
2499
1719
|
}) => {
|
|
2500
1720
|
if (headings.length === 0)
|
|
2501
1721
|
return null;
|
|
2502
|
-
return /* @__PURE__ */
|
|
1722
|
+
return /* @__PURE__ */ jsxs6("nav", {
|
|
2503
1723
|
"aria-label": label,
|
|
2504
1724
|
className: "fixed top-20 max-h-[calc(100svh-6rem)] w-56 overflow-y-auto",
|
|
2505
1725
|
children: [
|
|
2506
|
-
/* @__PURE__ */
|
|
1726
|
+
/* @__PURE__ */ jsx7("p", {
|
|
2507
1727
|
className: "text-foreground mb-3 text-sm font-semibold",
|
|
2508
1728
|
children: label
|
|
2509
1729
|
}),
|
|
2510
|
-
/* @__PURE__ */
|
|
1730
|
+
/* @__PURE__ */ jsx7(DocsTableOfContentsItems, {
|
|
2511
1731
|
headings
|
|
2512
1732
|
})
|
|
2513
1733
|
]
|
|
@@ -2519,25 +1739,25 @@ var DocsMobileTableOfContents = ({
|
|
|
2519
1739
|
}) => {
|
|
2520
1740
|
if (headings.length === 0)
|
|
2521
1741
|
return null;
|
|
2522
|
-
return /* @__PURE__ */
|
|
1742
|
+
return /* @__PURE__ */ jsxs6(Collapsible, {
|
|
2523
1743
|
className: "mb-8 overflow-hidden rounded-lg border xl:hidden",
|
|
2524
1744
|
children: [
|
|
2525
|
-
/* @__PURE__ */
|
|
1745
|
+
/* @__PURE__ */ jsxs6(CollapsibleTrigger, {
|
|
2526
1746
|
className: "group flex w-full cursor-pointer items-center justify-between p-4 text-left text-sm font-semibold",
|
|
2527
1747
|
children: [
|
|
2528
|
-
/* @__PURE__ */
|
|
1748
|
+
/* @__PURE__ */ jsx7("span", {
|
|
2529
1749
|
children: label
|
|
2530
1750
|
}),
|
|
2531
|
-
/* @__PURE__ */
|
|
1751
|
+
/* @__PURE__ */ jsx7(ChevronDown, {
|
|
2532
1752
|
className: "text-muted-foreground size-4 transition-transform group-data-[panel-open]:rotate-180"
|
|
2533
1753
|
})
|
|
2534
1754
|
]
|
|
2535
1755
|
}),
|
|
2536
|
-
/* @__PURE__ */
|
|
1756
|
+
/* @__PURE__ */ jsx7(CollapsibleContent, {
|
|
2537
1757
|
className: "px-4 pt-1 pb-4",
|
|
2538
|
-
children: /* @__PURE__ */
|
|
1758
|
+
children: /* @__PURE__ */ jsx7("nav", {
|
|
2539
1759
|
"aria-label": label,
|
|
2540
|
-
children: /* @__PURE__ */
|
|
1760
|
+
children: /* @__PURE__ */ jsx7(DocsTableOfContentsItems, {
|
|
2541
1761
|
headings
|
|
2542
1762
|
})
|
|
2543
1763
|
})
|
|
@@ -2550,7 +1770,7 @@ var DocsSearch = ({
|
|
|
2550
1770
|
locale,
|
|
2551
1771
|
messages
|
|
2552
1772
|
}) => {
|
|
2553
|
-
const [query, setQuery] =
|
|
1773
|
+
const [query, setQuery] = useState3("");
|
|
2554
1774
|
const deferredQuery = useDeferredValue(query);
|
|
2555
1775
|
const results = docs.search(deferredQuery, locale);
|
|
2556
1776
|
const isSearching = deferredQuery.trim().length > 0;
|
|
@@ -2572,7 +1792,7 @@ var DocsSearch = ({
|
|
|
2572
1792
|
if (page.icon) {
|
|
2573
1793
|
const PageIcon = iconFor(docs.icons, page.icon);
|
|
2574
1794
|
if (PageIcon)
|
|
2575
|
-
item.icon = /* @__PURE__ */
|
|
1795
|
+
item.icon = /* @__PURE__ */ jsx7(PageIcon, {
|
|
2576
1796
|
className: "size-4"
|
|
2577
1797
|
});
|
|
2578
1798
|
}
|
|
@@ -2580,7 +1800,7 @@ var DocsSearch = ({
|
|
|
2580
1800
|
})
|
|
2581
1801
|
};
|
|
2582
1802
|
});
|
|
2583
|
-
return /* @__PURE__ */
|
|
1803
|
+
return /* @__PURE__ */ jsx7(SearchMenu, {
|
|
2584
1804
|
groups,
|
|
2585
1805
|
locale,
|
|
2586
1806
|
messages: {
|
|
@@ -2658,34 +1878,34 @@ var DocsLayout = ({
|
|
|
2658
1878
|
]
|
|
2659
1879
|
});
|
|
2660
1880
|
}
|
|
2661
|
-
return /* @__PURE__ */
|
|
1881
|
+
return /* @__PURE__ */ jsx7(SidebarLayout, {
|
|
2662
1882
|
defaultOpen: getSidebarDefaultOpen2(),
|
|
2663
1883
|
groups,
|
|
2664
1884
|
sidebarCollapsible,
|
|
2665
|
-
sidebarHeader: /* @__PURE__ */
|
|
1885
|
+
sidebarHeader: /* @__PURE__ */ jsx7("a", {
|
|
2666
1886
|
href: brand.href,
|
|
2667
|
-
children: /* @__PURE__ */
|
|
1887
|
+
children: /* @__PURE__ */ jsx7(AppBrand, {
|
|
2668
1888
|
label: brand.label,
|
|
2669
1889
|
subtitle: brand.subtitle(),
|
|
2670
1890
|
icon: brand.icon,
|
|
2671
1891
|
variant: "sidebar"
|
|
2672
1892
|
})
|
|
2673
1893
|
}),
|
|
2674
|
-
headerActions: /* @__PURE__ */
|
|
1894
|
+
headerActions: /* @__PURE__ */ jsxs6(Fragment2, {
|
|
2675
1895
|
children: [
|
|
2676
|
-
docs.githubUrl ? /* @__PURE__ */
|
|
1896
|
+
docs.githubUrl ? /* @__PURE__ */ jsxs6("a", {
|
|
2677
1897
|
className: "text-muted-foreground hover:text-foreground hidden items-center gap-1.5 text-sm lg:flex",
|
|
2678
1898
|
href: docs.githubUrl,
|
|
2679
1899
|
target: "_blank",
|
|
2680
1900
|
rel: "noreferrer",
|
|
2681
1901
|
children: [
|
|
2682
1902
|
docs.githubLabel,
|
|
2683
|
-
/* @__PURE__ */
|
|
1903
|
+
/* @__PURE__ */ jsx7(ExternalLink, {
|
|
2684
1904
|
className: "size-3.5"
|
|
2685
1905
|
})
|
|
2686
1906
|
]
|
|
2687
1907
|
}) : null,
|
|
2688
|
-
/* @__PURE__ */
|
|
1908
|
+
/* @__PURE__ */ jsx7(DocsSearch, {
|
|
2689
1909
|
docs,
|
|
2690
1910
|
locale,
|
|
2691
1911
|
messages: resolvedMessages
|
|
@@ -2699,10 +1919,10 @@ var DocsLayout = ({
|
|
|
2699
1919
|
var DocsHeader = ({ docs, resolution }) => {
|
|
2700
1920
|
const { page } = resolution;
|
|
2701
1921
|
const resolvedMessages = docs.getMessages(page.locale);
|
|
2702
|
-
return /* @__PURE__ */
|
|
1922
|
+
return /* @__PURE__ */ jsxs6("header", {
|
|
2703
1923
|
className: "mb-8 border-b pb-8",
|
|
2704
1924
|
children: [
|
|
2705
|
-
/* @__PURE__ */
|
|
1925
|
+
/* @__PURE__ */ jsxs6("p", {
|
|
2706
1926
|
className: "text-primary mb-3 font-mono text-xs font-semibold tracking-[0.18em] uppercase",
|
|
2707
1927
|
children: [
|
|
2708
1928
|
resolvedMessages.sectionLabel(page.section),
|
|
@@ -2711,24 +1931,24 @@ var DocsHeader = ({ docs, resolution }) => {
|
|
|
2711
1931
|
resolvedMessages.pageTypeLabel(page.type)
|
|
2712
1932
|
]
|
|
2713
1933
|
}),
|
|
2714
|
-
/* @__PURE__ */
|
|
1934
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
2715
1935
|
className: "flex flex-wrap items-center gap-3",
|
|
2716
1936
|
children: [
|
|
2717
|
-
/* @__PURE__ */
|
|
1937
|
+
/* @__PURE__ */ jsx7("h1", {
|
|
2718
1938
|
className: "text-3xl font-bold tracking-tight sm:text-4xl",
|
|
2719
1939
|
children: page.title
|
|
2720
1940
|
}),
|
|
2721
|
-
page.tags?.map((tag) => /* @__PURE__ */
|
|
1941
|
+
page.tags?.map((tag) => /* @__PURE__ */ jsx7(Badge2, {
|
|
2722
1942
|
variant: "secondary",
|
|
2723
1943
|
children: tag
|
|
2724
1944
|
}, tag))
|
|
2725
1945
|
]
|
|
2726
1946
|
}),
|
|
2727
|
-
/* @__PURE__ */
|
|
1947
|
+
/* @__PURE__ */ jsx7("p", {
|
|
2728
1948
|
className: "text-muted-foreground mt-3 max-w-2xl text-base leading-7",
|
|
2729
1949
|
children: page.description
|
|
2730
1950
|
}),
|
|
2731
|
-
page.updatedAt ? /* @__PURE__ */
|
|
1951
|
+
page.updatedAt ? /* @__PURE__ */ jsx7("p", {
|
|
2732
1952
|
className: "text-muted-foreground mt-3 text-sm",
|
|
2733
1953
|
children: resolvedMessages.lastUpdated(new Date(page.updatedAt))
|
|
2734
1954
|
}) : null
|
|
@@ -2742,14 +1962,14 @@ var DocsContent = ({
|
|
|
2742
1962
|
}) => {
|
|
2743
1963
|
const { page } = resolution;
|
|
2744
1964
|
const resolvedMessages = docs.getMessages(page.locale);
|
|
2745
|
-
return /* @__PURE__ */
|
|
1965
|
+
return /* @__PURE__ */ jsxs6(Fragment2, {
|
|
2746
1966
|
children: [
|
|
2747
|
-
/* @__PURE__ */
|
|
1967
|
+
/* @__PURE__ */ jsx7(DocsMobileTableOfContents, {
|
|
2748
1968
|
headings: page.headings,
|
|
2749
1969
|
label: resolvedMessages.onThisPage
|
|
2750
1970
|
}),
|
|
2751
1971
|
children,
|
|
2752
|
-
/* @__PURE__ */
|
|
1972
|
+
/* @__PURE__ */ jsx7(DocsArticle, {
|
|
2753
1973
|
locale: page.locale,
|
|
2754
1974
|
messages: resolvedMessages,
|
|
2755
1975
|
page
|
|
@@ -2761,67 +1981,67 @@ var DocsFooter = ({ docs, resolution }) => {
|
|
|
2761
1981
|
const { page, neighbors } = resolution;
|
|
2762
1982
|
const resolvedMessages = docs.getMessages(page.locale);
|
|
2763
1983
|
const editUrl = docs.editUrl(page);
|
|
2764
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ jsxs6("footer", {
|
|
2765
1985
|
className: "mt-14 border-t pt-8",
|
|
2766
1986
|
children: [
|
|
2767
|
-
/* @__PURE__ */
|
|
1987
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
2768
1988
|
className: "mb-8 flex flex-wrap items-center justify-between gap-4 text-sm",
|
|
2769
1989
|
children: [
|
|
2770
|
-
editUrl ? /* @__PURE__ */
|
|
1990
|
+
editUrl ? /* @__PURE__ */ jsxs6("a", {
|
|
2771
1991
|
className: "text-muted-foreground hover:text-foreground inline-flex items-center gap-1.5",
|
|
2772
1992
|
href: editUrl,
|
|
2773
1993
|
target: "_blank",
|
|
2774
1994
|
rel: "noreferrer",
|
|
2775
1995
|
children: [
|
|
2776
1996
|
resolvedMessages.editPage,
|
|
2777
|
-
/* @__PURE__ */
|
|
1997
|
+
/* @__PURE__ */ jsx7(ExternalLink, {
|
|
2778
1998
|
className: "size-3.5"
|
|
2779
1999
|
})
|
|
2780
2000
|
]
|
|
2781
2001
|
}) : null,
|
|
2782
|
-
/* @__PURE__ */
|
|
2002
|
+
/* @__PURE__ */ jsx7("span", {
|
|
2783
2003
|
className: "text-muted-foreground",
|
|
2784
2004
|
children: resolvedMessages.latestVersionNotice
|
|
2785
2005
|
})
|
|
2786
2006
|
]
|
|
2787
2007
|
}),
|
|
2788
|
-
/* @__PURE__ */
|
|
2008
|
+
/* @__PURE__ */ jsxs6("nav", {
|
|
2789
2009
|
"aria-label": resolvedMessages.pageNavigation,
|
|
2790
2010
|
className: "grid gap-3 sm:grid-cols-2",
|
|
2791
2011
|
children: [
|
|
2792
|
-
neighbors.previous ? /* @__PURE__ */
|
|
2012
|
+
neighbors.previous ? /* @__PURE__ */ jsxs6("a", {
|
|
2793
2013
|
className: "hover:bg-muted/50 rounded-lg border p-4 transition-colors",
|
|
2794
2014
|
href: neighbors.previous.path,
|
|
2795
2015
|
children: [
|
|
2796
|
-
/* @__PURE__ */
|
|
2016
|
+
/* @__PURE__ */ jsxs6("span", {
|
|
2797
2017
|
className: "text-muted-foreground flex items-center gap-1 text-xs font-medium uppercase",
|
|
2798
2018
|
children: [
|
|
2799
|
-
/* @__PURE__ */
|
|
2019
|
+
/* @__PURE__ */ jsx7(ArrowLeft, {
|
|
2800
2020
|
className: "size-3.5"
|
|
2801
2021
|
}),
|
|
2802
2022
|
resolvedMessages.previous
|
|
2803
2023
|
]
|
|
2804
2024
|
}),
|
|
2805
|
-
/* @__PURE__ */
|
|
2025
|
+
/* @__PURE__ */ jsx7("span", {
|
|
2806
2026
|
className: "mt-1 block font-semibold",
|
|
2807
2027
|
children: neighbors.previous.title
|
|
2808
2028
|
})
|
|
2809
2029
|
]
|
|
2810
|
-
}) : /* @__PURE__ */
|
|
2811
|
-
neighbors.next ? /* @__PURE__ */
|
|
2030
|
+
}) : /* @__PURE__ */ jsx7("span", {}),
|
|
2031
|
+
neighbors.next ? /* @__PURE__ */ jsxs6("a", {
|
|
2812
2032
|
className: "hover:bg-muted/50 rounded-lg border p-4 text-right transition-colors",
|
|
2813
2033
|
href: neighbors.next.path,
|
|
2814
2034
|
children: [
|
|
2815
|
-
/* @__PURE__ */
|
|
2035
|
+
/* @__PURE__ */ jsxs6("span", {
|
|
2816
2036
|
className: "text-muted-foreground flex items-center justify-end gap-1 text-xs font-medium uppercase",
|
|
2817
2037
|
children: [
|
|
2818
2038
|
resolvedMessages.next,
|
|
2819
|
-
/* @__PURE__ */
|
|
2039
|
+
/* @__PURE__ */ jsx7(ArrowRight, {
|
|
2820
2040
|
className: "size-3.5"
|
|
2821
2041
|
})
|
|
2822
2042
|
]
|
|
2823
2043
|
}),
|
|
2824
|
-
/* @__PURE__ */
|
|
2044
|
+
/* @__PURE__ */ jsx7("span", {
|
|
2825
2045
|
className: "mt-1 block font-semibold",
|
|
2826
2046
|
children: neighbors.next.title
|
|
2827
2047
|
})
|
|
@@ -2859,15 +2079,15 @@ var ComponentDocsPage = ({
|
|
|
2859
2079
|
]
|
|
2860
2080
|
}
|
|
2861
2081
|
};
|
|
2862
|
-
return /* @__PURE__ */
|
|
2082
|
+
return /* @__PURE__ */ jsxs6(DocsPage, {
|
|
2863
2083
|
docs,
|
|
2864
2084
|
resolution: withHeadings,
|
|
2865
2085
|
children: [
|
|
2866
|
-
/* @__PURE__ */
|
|
2086
|
+
/* @__PURE__ */ jsx7(DocsHeader, {
|
|
2867
2087
|
docs,
|
|
2868
2088
|
resolution
|
|
2869
2089
|
}),
|
|
2870
|
-
/* @__PURE__ */
|
|
2090
|
+
/* @__PURE__ */ jsxs6(DocsContent, {
|
|
2871
2091
|
docs,
|
|
2872
2092
|
resolution: withHeadings,
|
|
2873
2093
|
children: [
|
|
@@ -2876,7 +2096,7 @@ var ComponentDocsPage = ({
|
|
|
2876
2096
|
]
|
|
2877
2097
|
}),
|
|
2878
2098
|
dependencies,
|
|
2879
|
-
/* @__PURE__ */
|
|
2099
|
+
/* @__PURE__ */ jsx7(DocsFooter, {
|
|
2880
2100
|
docs,
|
|
2881
2101
|
resolution
|
|
2882
2102
|
}),
|
|
@@ -2887,41 +2107,41 @@ var ComponentDocsPage = ({
|
|
|
2887
2107
|
var DocsPage = ({ children, docs, resolution }) => {
|
|
2888
2108
|
const { page } = resolution;
|
|
2889
2109
|
const resolvedMessages = docs.getMessages(page.locale);
|
|
2890
|
-
const content = children ?? /* @__PURE__ */
|
|
2110
|
+
const content = children ?? /* @__PURE__ */ jsxs6(Fragment2, {
|
|
2891
2111
|
children: [
|
|
2892
|
-
/* @__PURE__ */
|
|
2112
|
+
/* @__PURE__ */ jsx7(DocsHeader, {
|
|
2893
2113
|
docs,
|
|
2894
2114
|
resolution
|
|
2895
2115
|
}),
|
|
2896
|
-
/* @__PURE__ */
|
|
2116
|
+
/* @__PURE__ */ jsx7(DocsContent, {
|
|
2897
2117
|
docs,
|
|
2898
2118
|
resolution
|
|
2899
2119
|
}),
|
|
2900
|
-
/* @__PURE__ */
|
|
2120
|
+
/* @__PURE__ */ jsx7(DocsFooter, {
|
|
2901
2121
|
docs,
|
|
2902
2122
|
resolution
|
|
2903
2123
|
})
|
|
2904
2124
|
]
|
|
2905
2125
|
});
|
|
2906
|
-
return /* @__PURE__ */
|
|
2126
|
+
return /* @__PURE__ */ jsxs6(Fragment2, {
|
|
2907
2127
|
children: [
|
|
2908
|
-
/* @__PURE__ */
|
|
2128
|
+
/* @__PURE__ */ jsx7("a", {
|
|
2909
2129
|
className: "bg-background focus:ring-ring fixed top-2 left-2 z-50 -translate-y-20 rounded-md border px-3 py-2 text-sm shadow-sm focus:translate-y-0 focus:ring-2",
|
|
2910
2130
|
href: "#docs-content",
|
|
2911
2131
|
children: resolvedMessages.skipToContent
|
|
2912
2132
|
}),
|
|
2913
|
-
/* @__PURE__ */
|
|
2133
|
+
/* @__PURE__ */ jsxs6("div", {
|
|
2914
2134
|
className: "mx-auto grid w-full max-w-6xl gap-10 xl:grid-cols-[minmax(0,48rem)_14rem]",
|
|
2915
2135
|
children: [
|
|
2916
|
-
/* @__PURE__ */
|
|
2136
|
+
/* @__PURE__ */ jsx7("article", {
|
|
2917
2137
|
id: "docs-content",
|
|
2918
2138
|
className: "min-w-0 pb-16",
|
|
2919
2139
|
tabIndex: -1,
|
|
2920
2140
|
children: content
|
|
2921
2141
|
}),
|
|
2922
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ jsx7("aside", {
|
|
2923
2143
|
className: "hidden xl:block",
|
|
2924
|
-
children: /* @__PURE__ */
|
|
2144
|
+
children: /* @__PURE__ */ jsx7(DocsTableOfContents, {
|
|
2925
2145
|
headings: page.headings,
|
|
2926
2146
|
label: resolvedMessages.onThisPage
|
|
2927
2147
|
})
|
|
@@ -2937,21 +2157,21 @@ var DocsNotFound = ({
|
|
|
2937
2157
|
}) => {
|
|
2938
2158
|
const resolvedMessages = docs.getMessages(locale);
|
|
2939
2159
|
const BrandIcon = docs.brand.icon;
|
|
2940
|
-
return /* @__PURE__ */
|
|
2160
|
+
return /* @__PURE__ */ jsxs6("main", {
|
|
2941
2161
|
className: "mx-auto flex min-h-screen max-w-lg flex-col justify-center px-6 text-center",
|
|
2942
2162
|
children: [
|
|
2943
|
-
/* @__PURE__ */
|
|
2163
|
+
/* @__PURE__ */ jsx7(BrandIcon, {
|
|
2944
2164
|
className: "text-primary mx-auto size-10"
|
|
2945
2165
|
}),
|
|
2946
|
-
/* @__PURE__ */
|
|
2166
|
+
/* @__PURE__ */ jsx7("h1", {
|
|
2947
2167
|
className: "mt-6 text-3xl font-bold tracking-tight",
|
|
2948
2168
|
children: resolvedMessages.notFoundTitle
|
|
2949
2169
|
}),
|
|
2950
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ jsx7("p", {
|
|
2951
2171
|
className: "text-muted-foreground mt-3 leading-7",
|
|
2952
2172
|
children: resolvedMessages.notFoundDescription
|
|
2953
2173
|
}),
|
|
2954
|
-
/* @__PURE__ */
|
|
2174
|
+
/* @__PURE__ */ jsx7("a", {
|
|
2955
2175
|
className: "text-primary mt-6 font-semibold underline underline-offset-4",
|
|
2956
2176
|
href: docs.basePath,
|
|
2957
2177
|
children: resolvedMessages.notFoundAction
|