@krak-stack/registry 0.11.3 → 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 +18 -0
- 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/hint/react.d.ts +15 -0
- package/dist/components/hint/react.js +133 -0
- 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 +4 -8
- 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
|
@@ -5,59 +5,13 @@ import { useCallback, useEffect, useRef as useRef2, useState as useState2 } from
|
|
|
5
5
|
import { Check, LoaderCircle, RotateCcw } from "lucide-react";
|
|
6
6
|
import { Component as Component2 } from "effect/ui";
|
|
7
7
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
import { cva } from "class-variance-authority";
|
|
8
|
+
import { Button } from "@/components/ui/button";
|
|
9
|
+
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
10
|
+
import { useModel } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
12
11
|
|
|
13
12
|
// ../../src/lib/utils.ts
|
|
14
13
|
import { cn } from "cn";
|
|
15
14
|
|
|
16
|
-
// ../../src/components/ui/button.tsx
|
|
17
|
-
import { jsx } from "react/jsx-runtime";
|
|
18
|
-
var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
19
|
-
variants: {
|
|
20
|
-
variant: {
|
|
21
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
22
|
-
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",
|
|
23
|
-
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",
|
|
24
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
25
|
-
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",
|
|
26
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
27
|
-
},
|
|
28
|
-
size: {
|
|
29
|
-
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",
|
|
30
|
-
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",
|
|
31
|
-
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",
|
|
32
|
-
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
33
|
-
icon: "size-9",
|
|
34
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
35
|
-
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
36
|
-
"icon-lg": "size-10"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
defaultVariants: {
|
|
40
|
-
variant: "default",
|
|
41
|
-
size: "default"
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
function Button({
|
|
45
|
-
className,
|
|
46
|
-
variant = "default",
|
|
47
|
-
size = "default",
|
|
48
|
-
...props
|
|
49
|
-
}) {
|
|
50
|
-
return /* @__PURE__ */ jsx(ButtonPrimitive, {
|
|
51
|
-
"data-slot": "button",
|
|
52
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
53
|
-
...props
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// ../../src/components/async-action-button/react.tsx
|
|
58
|
-
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
59
|
-
import { useModel } from "@krak-stack/registry/effect-ui-adapter/react";
|
|
60
|
-
|
|
61
15
|
// ../../src/components/async-action-button/classes.ts
|
|
62
16
|
var asyncActionButtonClasses = {
|
|
63
17
|
root: "inline-flex min-w-0 flex-col items-start gap-2",
|
|
@@ -155,7 +109,7 @@ var getAsyncActionButtonFeedback = (status, copy) => ({
|
|
|
155
109
|
});
|
|
156
110
|
|
|
157
111
|
// ../../src/components/async-action-button/react.tsx
|
|
158
|
-
import { jsx
|
|
112
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
159
113
|
"use client";
|
|
160
114
|
var AsyncActionButton = ({
|
|
161
115
|
classes: classOverrides,
|
|
@@ -202,18 +156,18 @@ var AsyncActionButton = ({
|
|
|
202
156
|
"aria-busy": status === "pending",
|
|
203
157
|
onClick: () => send(AsyncActionButtonMessage.Activated()),
|
|
204
158
|
children: [
|
|
205
|
-
status === "pending" ? /* @__PURE__ */
|
|
159
|
+
status === "pending" ? /* @__PURE__ */ jsx(LoaderCircle, {
|
|
206
160
|
"aria-hidden": "true",
|
|
207
161
|
className: asyncActionButtonClasses.pendingIcon
|
|
208
|
-
}) : status === "success" ? /* @__PURE__ */
|
|
162
|
+
}) : status === "success" ? /* @__PURE__ */ jsx(Check, {
|
|
209
163
|
"aria-hidden": "true"
|
|
210
|
-
}) : status === "error" ? /* @__PURE__ */
|
|
164
|
+
}) : status === "error" ? /* @__PURE__ */ jsx(RotateCcw, {
|
|
211
165
|
"aria-hidden": "true"
|
|
212
166
|
}) : null,
|
|
213
167
|
label ?? children
|
|
214
168
|
]
|
|
215
169
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ jsx("span", {
|
|
217
171
|
"data-slot": "async-action-feedback",
|
|
218
172
|
role: "status",
|
|
219
173
|
className: status === "error" ? asyncActionButtonClasses.error : "sr-only",
|
|
@@ -227,6 +181,7 @@ var AsyncActionButton = ({
|
|
|
227
181
|
"use client";
|
|
228
182
|
|
|
229
183
|
// ../../src/components/image-crop-editor/react.tsx
|
|
184
|
+
import { Button as Button2 } from "@/components/ui/button";
|
|
230
185
|
import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider/react";
|
|
231
186
|
|
|
232
187
|
// ../../src/components/image-crop-editor/classes.ts
|
|
@@ -458,8 +413,8 @@ var imageCropEditorBehaviours = {
|
|
|
458
413
|
};
|
|
459
414
|
|
|
460
415
|
// ../../src/components/image-crop-editor/react.tsx
|
|
461
|
-
import { jsx as
|
|
462
|
-
var ImageCropEditor = (props) => /* @__PURE__ */
|
|
416
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
417
|
+
var ImageCropEditor = (props) => /* @__PURE__ */ jsx2(ImageCropSession, {
|
|
463
418
|
...props
|
|
464
419
|
}, props.src);
|
|
465
420
|
var ImageCropSession = ({
|
|
@@ -507,7 +462,7 @@ var ImageCropSession = ({
|
|
|
507
462
|
"data-slot": "image-crop-editor",
|
|
508
463
|
className,
|
|
509
464
|
children: [
|
|
510
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ jsx2("img", {
|
|
511
466
|
ref: attachImage,
|
|
512
467
|
src,
|
|
513
468
|
crossOrigin: "anonymous",
|
|
@@ -525,7 +480,7 @@ var ImageCropSession = ({
|
|
|
525
480
|
/* @__PURE__ */ jsxs2("div", {
|
|
526
481
|
className: imageCropEditorClasses.root,
|
|
527
482
|
children: [
|
|
528
|
-
crop && size ? /* @__PURE__ */
|
|
483
|
+
crop && size ? /* @__PURE__ */ jsx2("svg", {
|
|
529
484
|
"data-slot": "image-crop-preview",
|
|
530
485
|
role: "img",
|
|
531
486
|
"aria-label": label,
|
|
@@ -561,17 +516,17 @@ var ImageCropSession = ({
|
|
|
561
516
|
onLostPointerCapture: () => {
|
|
562
517
|
drag.current = null;
|
|
563
518
|
},
|
|
564
|
-
children: /* @__PURE__ */
|
|
519
|
+
children: /* @__PURE__ */ jsx2("image", {
|
|
565
520
|
href: src,
|
|
566
521
|
width: size.width,
|
|
567
522
|
height: size.height,
|
|
568
523
|
transform
|
|
569
524
|
})
|
|
570
|
-
}) : /* @__PURE__ */
|
|
525
|
+
}) : /* @__PURE__ */ jsx2("p", {
|
|
571
526
|
role: failed ? "alert" : "status",
|
|
572
527
|
children: failed ? copy.loadError : copy.loading
|
|
573
528
|
}),
|
|
574
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ jsx2("p", {
|
|
575
530
|
"data-slot": "image-crop-help",
|
|
576
531
|
className: imageCropEditorClasses.hint,
|
|
577
532
|
children: copy.help
|
|
@@ -584,10 +539,10 @@ var ImageCropSession = ({
|
|
|
584
539
|
["zoom", "x", "y"].map((key) => /* @__PURE__ */ jsxs2("label", {
|
|
585
540
|
className: imageCropEditorClasses.control,
|
|
586
541
|
children: [
|
|
587
|
-
/* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ jsx2("span", {
|
|
588
543
|
children: key === "zoom" ? copy.zoom : key === "x" ? copy.horizontal : copy.vertical
|
|
589
544
|
}),
|
|
590
|
-
/* @__PURE__ */
|
|
545
|
+
/* @__PURE__ */ jsx2("input", {
|
|
591
546
|
"data-slot": "image-crop-slider",
|
|
592
547
|
"data-control": key,
|
|
593
548
|
type: "range",
|
|
@@ -607,13 +562,13 @@ var ImageCropSession = ({
|
|
|
607
562
|
"data-slot": "image-crop-actions",
|
|
608
563
|
className: imageCropEditorClasses.actions,
|
|
609
564
|
children: [
|
|
610
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ jsx2(Button2, {
|
|
611
566
|
type: "button",
|
|
612
567
|
variant: "outline",
|
|
613
568
|
onClick: () => onValueChange(rotateCrop(value)),
|
|
614
569
|
children: copy.rotate
|
|
615
570
|
}),
|
|
616
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ jsx2(Button2, {
|
|
617
572
|
type: "button",
|
|
618
573
|
variant: "outline",
|
|
619
574
|
onClick: () => onValueChange(defaultCrop),
|
|
@@ -623,7 +578,7 @@ var ImageCropSession = ({
|
|
|
623
578
|
})
|
|
624
579
|
]
|
|
625
580
|
}),
|
|
626
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ jsx2(AsyncActionButton, {
|
|
627
582
|
locale,
|
|
628
583
|
disabled: disabled || !crop,
|
|
629
584
|
onPendingChange: setPending,
|
|
@@ -1,62 +1,15 @@
|
|
|
1
1
|
// ../../src/components/locale-switcher/html.ts
|
|
2
2
|
import { Html } from "effect/ui/html";
|
|
3
3
|
import { Menu } from "effect/ui/kit";
|
|
4
|
-
|
|
5
|
-
// ../../src/lib/utils.ts
|
|
6
|
-
import { cn } from "cn";
|
|
7
|
-
|
|
8
|
-
// ../../src/components/effectcn/button.ts
|
|
9
4
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
brand: "bg-brand-soft text-brand-soft-foreground hover:bg-brand-soft/85",
|
|
19
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85",
|
|
20
|
-
link: "h-auto px-0 text-foreground underline decoration-transparent underline-offset-4 hover:decoration-current"
|
|
21
|
-
};
|
|
22
|
-
var sizes = {
|
|
23
|
-
default: "",
|
|
24
|
-
sm: "h-7 rounded-sm px-2.5 text-xs",
|
|
25
|
-
lg: "h-10 px-5 text-sm",
|
|
26
|
-
icon: "w-8.5 px-0",
|
|
27
|
-
"icon-sm": "h-7 w-7 rounded-sm px-0"
|
|
28
|
-
};
|
|
29
|
-
var buttonVariants = (options = {}) => cn(base, variants[options.variant ?? "default"], sizes[options.size ?? "default"], options.class);
|
|
30
|
-
|
|
31
|
-
// ../../src/components/effectcn/menu.ts
|
|
32
|
-
var popup = "max-h-[var(--available-height)] max-w-[min(320px,var(--available-width))] min-w-[200px] origin-[var(--transform-origin)] " + "overflow-y-auto rounded-lg border bg-popover p-1 text-[13px] leading-snug text-foreground shadow-float outline-none " + "transition-[opacity,scale] duration-150 ease-out data-[nested]:min-w-[150px] " + "data-[starting-style]:scale-95 data-[starting-style]:opacity-0 " + "data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-100 " + "data-[instant]:transition-none";
|
|
33
|
-
var item = "relative flex min-h-[30px] cursor-default items-center gap-2 rounded-sm px-2 whitespace-nowrap text-foreground " + "no-underline outline-none select-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground " + "data-[popup-open]:bg-accent data-[disabled]:opacity-45 " + "[&_svg]:size-[15px] [&_svg]:shrink-0 [&_svg]:text-muted-foreground";
|
|
34
|
-
var inset = "pl-[30px]";
|
|
35
|
-
var tick = "before:absolute before:top-1/2 before:left-[10px] before:h-[5px] before:w-[9px] before:-translate-y-[70%] " + "before:-rotate-45 before:border-b-2 before:border-l-2 before:border-brand before:opacity-0 before:content-[''] " + "data-[checked]:before:opacity-100";
|
|
36
|
-
var dot = "before:absolute before:top-1/2 before:left-[12px] before:size-1.5 before:-translate-y-1/2 before:rounded-full " + "before:bg-brand before:opacity-0 before:content-[''] data-[checked]:before:opacity-100";
|
|
37
|
-
var submenuArrow = "after:ml-auto after:size-1.5 after:-translate-x-0.5 after:rotate-45 after:border-t-[1.5px] after:border-r-[1.5px] " + "after:border-muted-foreground after:content-['']";
|
|
38
|
-
var MenuTrigger = (h, menu, options = {}) => {
|
|
39
|
-
const { class: className, size, variant = "outline", ...trigger } = options;
|
|
40
|
-
return menu.trigger({
|
|
41
|
-
...trigger,
|
|
42
|
-
element: h.button.class(buttonVariants({ variant, size, class: cn("group", className) }))
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var MenuPositioner = (h, menu, options = {}) => menu.positioner(h.div.class(cn("overflow-visible border-0 bg-transparent p-0 text-inherit outline-none", options.class)));
|
|
46
|
-
var MenuPopup = (h, menu, options = {}) => menu.popup(h.div.class(cn(popup, options.class)));
|
|
47
|
-
var MenuRadioGroup = (h, menu, options = {}) => menu.radioGroup(h.div.class(cn(options.class)).attr("aria-label", options.label));
|
|
48
|
-
var MenuRadioItem = (h, menu, options) => menu.radioItem({
|
|
49
|
-
element: h.div.class(cn(item, inset, dot, options.class)),
|
|
50
|
-
value: options.value,
|
|
51
|
-
closeOnClick: options.closeOnClick
|
|
52
|
-
});
|
|
53
|
-
var MenuGroup = (h, menu, options) => menu.group({ element: h.div.class(cn(options.class)), group: options.group });
|
|
54
|
-
var MenuLabel = (h, menu, options) => menu.groupLabel({
|
|
55
|
-
element: h.div.class(cn("text-muted-foreground px-2 pt-1.5 pb-1 text-xs font-medium", options.class)),
|
|
56
|
-
group: options.group
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
// ../../src/components/locale-switcher/html.ts
|
|
5
|
+
MenuGroup,
|
|
6
|
+
MenuLabel,
|
|
7
|
+
MenuPopup,
|
|
8
|
+
MenuPositioner,
|
|
9
|
+
MenuRadioItem,
|
|
10
|
+
MenuRadioGroup,
|
|
11
|
+
MenuTrigger
|
|
12
|
+
} from "@/components/effectcn/menu";
|
|
60
13
|
import { krakstackLocaleRead } from "@krak-stack/registry/krakstack-provider/html";
|
|
61
14
|
import { Languages as LanguagesIcon } from "@krak-stack/registry/lucide-effect";
|
|
62
15
|
|
|
@@ -1,139 +1,14 @@
|
|
|
1
|
-
// ../../src/components/ui/button.tsx
|
|
2
|
-
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
3
|
-
import { cva } from "class-variance-authority";
|
|
4
|
-
|
|
5
|
-
// ../../src/lib/utils.ts
|
|
6
|
-
import { cn } from "cn";
|
|
7
|
-
|
|
8
|
-
// ../../src/components/ui/button.tsx
|
|
9
|
-
import { jsx } from "react/jsx-runtime";
|
|
10
|
-
var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
11
|
-
variants: {
|
|
12
|
-
variant: {
|
|
13
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
14
|
-
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",
|
|
15
|
-
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",
|
|
16
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
17
|
-
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",
|
|
18
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
19
|
-
},
|
|
20
|
-
size: {
|
|
21
|
-
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",
|
|
22
|
-
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",
|
|
23
|
-
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",
|
|
24
|
-
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
25
|
-
icon: "size-9",
|
|
26
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
27
|
-
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
28
|
-
"icon-lg": "size-10"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
defaultVariants: {
|
|
32
|
-
variant: "default",
|
|
33
|
-
size: "default"
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
function Button({
|
|
37
|
-
className,
|
|
38
|
-
variant = "default",
|
|
39
|
-
size = "default",
|
|
40
|
-
...props
|
|
41
|
-
}) {
|
|
42
|
-
return /* @__PURE__ */ jsx(ButtonPrimitive, {
|
|
43
|
-
"data-slot": "button",
|
|
44
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
45
|
-
...props
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// ../../src/components/ui/dropdown-menu.tsx
|
|
50
|
-
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
51
|
-
import { ChevronRightIcon, CheckIcon } from "lucide-react";
|
|
52
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
53
|
-
function DropdownMenu({ ...props }) {
|
|
54
|
-
return /* @__PURE__ */ jsx2(MenuPrimitive.Root, {
|
|
55
|
-
"data-slot": "dropdown-menu",
|
|
56
|
-
...props
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
function DropdownMenuTrigger({ ...props }) {
|
|
60
|
-
return /* @__PURE__ */ jsx2(MenuPrimitive.Trigger, {
|
|
61
|
-
"data-slot": "dropdown-menu-trigger",
|
|
62
|
-
...props
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function DropdownMenuContent({
|
|
66
|
-
align = "start",
|
|
67
|
-
alignOffset = 0,
|
|
68
|
-
side = "bottom",
|
|
69
|
-
sideOffset = 4,
|
|
70
|
-
className,
|
|
71
|
-
...props
|
|
72
|
-
}) {
|
|
73
|
-
return /* @__PURE__ */ jsx2(MenuPrimitive.Portal, {
|
|
74
|
-
children: /* @__PURE__ */ jsx2(MenuPrimitive.Positioner, {
|
|
75
|
-
className: "isolate z-50 outline-none",
|
|
76
|
-
align,
|
|
77
|
-
alignOffset,
|
|
78
|
-
side,
|
|
79
|
-
sideOffset,
|
|
80
|
-
children: /* @__PURE__ */ jsx2(MenuPrimitive.Popup, {
|
|
81
|
-
"data-slot": "dropdown-menu-content",
|
|
82
|
-
className: cn("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", className),
|
|
83
|
-
...props
|
|
84
|
-
})
|
|
85
|
-
})
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
function DropdownMenuGroup({ ...props }) {
|
|
89
|
-
return /* @__PURE__ */ jsx2(MenuPrimitive.Group, {
|
|
90
|
-
"data-slot": "dropdown-menu-group",
|
|
91
|
-
...props
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
function DropdownMenuLabel({
|
|
95
|
-
className,
|
|
96
|
-
inset,
|
|
97
|
-
...props
|
|
98
|
-
}) {
|
|
99
|
-
return /* @__PURE__ */ jsx2(MenuPrimitive.GroupLabel, {
|
|
100
|
-
"data-slot": "dropdown-menu-label",
|
|
101
|
-
"data-inset": inset,
|
|
102
|
-
className: cn("px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8", className),
|
|
103
|
-
...props
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
function DropdownMenuRadioGroup({ ...props }) {
|
|
107
|
-
return /* @__PURE__ */ jsx2(MenuPrimitive.RadioGroup, {
|
|
108
|
-
"data-slot": "dropdown-menu-radio-group",
|
|
109
|
-
...props
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
function DropdownMenuRadioItem({
|
|
113
|
-
className,
|
|
114
|
-
children,
|
|
115
|
-
inset,
|
|
116
|
-
...props
|
|
117
|
-
}) {
|
|
118
|
-
return /* @__PURE__ */ jsxs(MenuPrimitive.RadioItem, {
|
|
119
|
-
"data-slot": "dropdown-menu-radio-item",
|
|
120
|
-
"data-inset": inset,
|
|
121
|
-
className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
122
|
-
...props,
|
|
123
|
-
children: [
|
|
124
|
-
/* @__PURE__ */ jsx2("span", {
|
|
125
|
-
className: "pointer-events-none absolute right-2 flex items-center justify-center",
|
|
126
|
-
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
127
|
-
children: /* @__PURE__ */ jsx2(MenuPrimitive.RadioItemIndicator, {
|
|
128
|
-
children: /* @__PURE__ */ jsx2(CheckIcon, {})
|
|
129
|
-
})
|
|
130
|
-
}),
|
|
131
|
-
children
|
|
132
|
-
]
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
1
|
// ../../src/components/locale-switcher/react.tsx
|
|
2
|
+
import { Button } from "@/components/ui/button";
|
|
3
|
+
import {
|
|
4
|
+
DropdownMenu,
|
|
5
|
+
DropdownMenuContent,
|
|
6
|
+
DropdownMenuGroup,
|
|
7
|
+
DropdownMenuLabel,
|
|
8
|
+
DropdownMenuRadioGroup,
|
|
9
|
+
DropdownMenuRadioItem,
|
|
10
|
+
DropdownMenuTrigger
|
|
11
|
+
} from "@/components/ui/dropdown-menu";
|
|
137
12
|
import { Languages } from "lucide-react";
|
|
138
13
|
import { Option, Schema as Schema3 } from "effect";
|
|
139
14
|
import {
|
|
@@ -195,7 +70,7 @@ var update = Component.define(localeSwitcherOptions).update({
|
|
|
195
70
|
});
|
|
196
71
|
|
|
197
72
|
// ../../src/components/locale-switcher/react.tsx
|
|
198
|
-
import { jsx
|
|
73
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
199
74
|
var LocaleSwitcher = ({
|
|
200
75
|
locale: localeOverride,
|
|
201
76
|
locales: localeOverrides,
|
|
@@ -206,32 +81,32 @@ var LocaleSwitcher = ({
|
|
|
206
81
|
const localeOptions = useKrakstackLocales(localeOverrides);
|
|
207
82
|
const labels = localeMessages(locale, messages);
|
|
208
83
|
const LocaleSchema = Schema3.String.check(Schema3.makeFilter((value) => localeOptions.includes(value))).annotate({ identifier: "Locale" });
|
|
209
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, {
|
|
210
85
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
render: /* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
87
|
+
render: /* @__PURE__ */ jsxs(Button, {
|
|
213
88
|
variant: "outline",
|
|
214
89
|
size: "icon",
|
|
215
90
|
"aria-label": labels.title,
|
|
216
91
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ jsx(Languages, {
|
|
218
93
|
className: "size-4"
|
|
219
94
|
}),
|
|
220
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ jsx("span", {
|
|
221
96
|
className: "sr-only",
|
|
222
97
|
children: labels.title
|
|
223
98
|
})
|
|
224
99
|
]
|
|
225
100
|
})
|
|
226
101
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
228
103
|
className: "w-32",
|
|
229
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ jsxs(DropdownMenuGroup, {
|
|
230
105
|
children: [
|
|
231
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, {
|
|
232
107
|
children: labels.title
|
|
233
108
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ jsx(DropdownMenuRadioGroup, {
|
|
235
110
|
"aria-label": labels.title,
|
|
236
111
|
value: locale,
|
|
237
112
|
onValueChange: (value) => Schema3.decodeUnknownOption(LocaleSchema)(value).pipe(Option.match({
|
|
@@ -240,7 +115,7 @@ var LocaleSwitcher = ({
|
|
|
240
115
|
},
|
|
241
116
|
onSome: onLocaleChange
|
|
242
117
|
})),
|
|
243
|
-
children: localeOptions.map((l) => /* @__PURE__ */
|
|
118
|
+
children: localeOptions.map((l) => /* @__PURE__ */ jsx(DropdownMenuRadioItem, {
|
|
244
119
|
value: l,
|
|
245
120
|
children: labels.localeName(l)
|
|
246
121
|
}, l))
|
|
@@ -81,10 +81,10 @@ export declare const makeMapMenu: (viewportHost?: MapViewportHost) => import("ef
|
|
|
81
81
|
readonly revision: number;
|
|
82
82
|
} | null;
|
|
83
83
|
}, {
|
|
84
|
-
readonly _tag: "Cancel";
|
|
85
|
-
} | {
|
|
86
84
|
readonly _tag: "CameraRequested";
|
|
87
85
|
readonly action: "fit" | "in" | "out";
|
|
86
|
+
} | {
|
|
87
|
+
readonly _tag: "Cancel";
|
|
88
88
|
} | {
|
|
89
89
|
readonly _tag: "Confirm";
|
|
90
90
|
} | {
|
|
@@ -112,9 +112,9 @@ export declare const makeMapMenu: (viewportHost?: MapViewportHost) => import("ef
|
|
|
112
112
|
readonly _tag: "ZoomChanged";
|
|
113
113
|
readonly zoom: number;
|
|
114
114
|
}, {
|
|
115
|
-
readonly _tag: "Cancelled";
|
|
116
|
-
} | {
|
|
117
115
|
readonly _tag: "Confirmed";
|
|
116
|
+
} | {
|
|
117
|
+
readonly _tag: "Cancelled";
|
|
118
118
|
} | {
|
|
119
119
|
readonly _tag: "CurrentLocationRequested";
|
|
120
120
|
} | {
|
|
@@ -214,10 +214,10 @@ export declare const MapMenu: import("effect/ui/Component").Component<"MapMenu",
|
|
|
214
214
|
readonly revision: number;
|
|
215
215
|
} | null;
|
|
216
216
|
}, {
|
|
217
|
-
readonly _tag: "Cancel";
|
|
218
|
-
} | {
|
|
219
217
|
readonly _tag: "CameraRequested";
|
|
220
218
|
readonly action: "fit" | "in" | "out";
|
|
219
|
+
} | {
|
|
220
|
+
readonly _tag: "Cancel";
|
|
221
221
|
} | {
|
|
222
222
|
readonly _tag: "Confirm";
|
|
223
223
|
} | {
|
|
@@ -245,9 +245,9 @@ export declare const MapMenu: import("effect/ui/Component").Component<"MapMenu",
|
|
|
245
245
|
readonly _tag: "ZoomChanged";
|
|
246
246
|
readonly zoom: number;
|
|
247
247
|
}, {
|
|
248
|
-
readonly _tag: "Cancelled";
|
|
249
|
-
} | {
|
|
250
248
|
readonly _tag: "Confirmed";
|
|
249
|
+
} | {
|
|
250
|
+
readonly _tag: "Cancelled";
|
|
251
251
|
} | {
|
|
252
252
|
readonly _tag: "CurrentLocationRequested";
|
|
253
253
|
} | {
|
|
@@ -3,80 +3,21 @@ import { Effect as Effect3, Redacted as Redacted2, Schema as Schema3, Stream as
|
|
|
3
3
|
import { Mount } from "effect/ui";
|
|
4
4
|
import { Html } from "effect/ui/html";
|
|
5
5
|
import { Combobox, Dialog } from "effect/ui/kit";
|
|
6
|
-
|
|
7
|
-
// ../../src/components/effectcn/button.ts
|
|
6
|
+
import { Button } from "@/components/effectcn/button";
|
|
8
7
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var base = "inline-flex h-8.5 shrink-0 items-center justify-center gap-1.5 rounded-md border border-transparent px-3.5 text-[13px] leading-none font-medium whitespace-nowrap no-underline select-none transition-[background-color,border-color,color,opacity] duration-150 active:translate-y-px data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:size-[15px] [&_svg]:shrink-0 data-[loading]:before:size-3 data-[loading]:before:animate-spin data-[loading]:before:rounded-full data-[loading]:before:border-2 data-[loading]:before:border-current data-[loading]:before:border-r-transparent";
|
|
17
|
-
var variants = {
|
|
18
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/85",
|
|
19
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-accent",
|
|
20
|
-
outline: "border-input bg-background text-foreground shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
21
|
-
ghost: "text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
22
|
-
brand: "bg-brand-soft text-brand-soft-foreground hover:bg-brand-soft/85",
|
|
23
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85",
|
|
24
|
-
link: "h-auto px-0 text-foreground underline decoration-transparent underline-offset-4 hover:decoration-current"
|
|
25
|
-
};
|
|
26
|
-
var sizes = {
|
|
27
|
-
default: "",
|
|
28
|
-
sm: "h-7 rounded-sm px-2.5 text-xs",
|
|
29
|
-
lg: "h-10 px-5 text-sm",
|
|
30
|
-
icon: "w-8.5 px-0",
|
|
31
|
-
"icon-sm": "h-7 w-7 rounded-sm px-0"
|
|
32
|
-
};
|
|
33
|
-
var buttonVariants = (options = {}) => cn(base, variants[options.variant ?? "default"], sizes[options.size ?? "default"], options.class);
|
|
34
|
-
var Button = (h, options = {}) => KitButton(h, {
|
|
35
|
-
element: options.element,
|
|
36
|
-
onPress: options.onPress,
|
|
37
|
-
props: options.loading ? { ...options.props, disabled: true, focusableWhenDisabled: true } : options.props
|
|
38
|
-
}).class(buttonVariants(options)).attr("data-loading", options.loading ? "" : undefined);
|
|
39
|
-
|
|
40
|
-
// ../../src/components/effectcn/combobox.ts
|
|
41
|
-
var icon = (h, path) => h.el("svg").attrs({
|
|
42
|
-
viewBox: "0 0 24 24",
|
|
43
|
-
fill: "none",
|
|
44
|
-
stroke: "currentColor",
|
|
45
|
-
"stroke-width": "2",
|
|
46
|
-
"stroke-linecap": "round",
|
|
47
|
-
"stroke-linejoin": "round",
|
|
48
|
-
"aria-hidden": "true"
|
|
49
|
-
}).children(h.el("path").attr("d", path));
|
|
50
|
-
var ComboboxClear = (h, combobox, options = {}) => combobox.clear({
|
|
51
|
-
element: h.button.class(cn("text-muted-foreground hover:bg-accent hover:text-foreground grid size-6 shrink-0 place-items-center rounded-sm transition-colors duration-150 data-[disabled]:pointer-events-none [&_svg]:size-3.5", options.class))
|
|
52
|
-
})?.children(icon(h, "M18 6L6 18M6 6l12 12"));
|
|
53
|
-
var ComboboxPositioner = (h, combobox, options = {}) => combobox.positioner(h.div.class(cn("outline-none", options.class)));
|
|
54
|
-
var ComboboxPopup = (h, combobox, options = {}) => combobox.popup(h.div.class(cn("bg-popover text-foreground shadow-float box-border flex max-h-[min(var(--available-height),20rem)] w-[var(--anchor-width)] max-w-[var(--available-width)] min-w-48 origin-[var(--transform-origin)] flex-col overflow-hidden rounded-lg border text-[13px] transition-[opacity,scale] duration-150 outline-none data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0", options.class)));
|
|
55
|
-
var ComboboxEmpty = (h, combobox, options = {}) => combobox.empty(h.div.class(cn("text-muted-foreground px-3 py-5 text-center empty:hidden", options.class)));
|
|
56
|
-
var ComboboxItem = (h, combobox, options) => combobox.item({
|
|
57
|
-
element: h.div.class(cn("data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:text-muted-foreground flex min-h-7.5 cursor-default items-center justify-between gap-2 rounded-sm px-2 py-1 leading-snug select-none data-[disabled]:opacity-60 data-[selected]:font-medium", options.class)),
|
|
58
|
-
value: options.value
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
// ../../src/components/effectcn/input.ts
|
|
8
|
+
ComboboxClear,
|
|
9
|
+
ComboboxEmpty,
|
|
10
|
+
ComboboxItem,
|
|
11
|
+
ComboboxPopup,
|
|
12
|
+
ComboboxPositioner
|
|
13
|
+
} from "@/components/effectcn/combobox";
|
|
14
|
+
import { inputVariants } from "@/components/effectcn/input";
|
|
62
15
|
import {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
sm: "h-7 rounded-sm px-2.5 text-xs",
|
|
69
|
-
lg: "h-10 px-3.5 text-sm"
|
|
70
|
-
};
|
|
71
|
-
var inputVariants = (options = {}) => cn(base2, sizes2[options.size ?? "default"], options.class);
|
|
72
|
-
|
|
73
|
-
// ../../src/components/effectcn/dialog.ts
|
|
74
|
-
var DialogBackdrop = (h, dialog, options = {}) => dialog.backdrop(h.div.class(cn("fixed inset-0 bg-[color-mix(in_oklab,var(--shadow-color,#000)_45%,transparent)] transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0", options.class)));
|
|
75
|
-
var DialogViewport = (h, dialog, options = {}) => dialog.viewport(h.div.class(cn("pointer-events-none fixed inset-0 grid place-items-center p-4", options.class)));
|
|
76
|
-
var DialogPopup = (h, dialog, options = {}) => dialog.popup(h.div.class(cn("bg-popover text-popover-foreground pointer-events-auto relative flex max-h-full w-full max-w-[440px] flex-col gap-4 rounded-lg border p-6 text-sm shadow-lg outline-none", "transition-[opacity,scale,translate,filter] duration-200 ease-out data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[nested-dialog-open]:-translate-y-[calc(14px*var(--nested-dialogs))] data-[nested-dialog-open]:scale-[calc(1-0.05*var(--nested-dialogs))] data-[nested-dialog-open]:brightness-95", options.class)));
|
|
77
|
-
var DialogTitle = (h, dialog, options = {}) => dialog.title(h.h2.class(cn("m-0 border-0 p-0 text-[16px] leading-snug font-semibold tracking-tight", options.class)));
|
|
78
|
-
|
|
79
|
-
// ../../src/components/map-menu/html.ts
|
|
16
|
+
DialogBackdrop,
|
|
17
|
+
DialogPopup,
|
|
18
|
+
DialogTitle,
|
|
19
|
+
DialogViewport
|
|
20
|
+
} from "@/components/effectcn/dialog";
|
|
80
21
|
import { krakstackLocaleRead } from "@krak-stack/registry/krakstack-provider/html";
|
|
81
22
|
import {
|
|
82
23
|
LocateFixed as LocateIcon,
|