@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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactNode, type SVGProps } from "react";
|
|
2
|
+
/*! Solid lightbulb by Font Awesome Free 5.15.2 (https://fontawesome.com), CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Adapted to JSX. */
|
|
3
|
+
export declare const SolidLightbulb: (props: SVGProps<SVGSVGElement>) => import("react").JSX.Element;
|
|
4
|
+
export type HintProps = {
|
|
5
|
+
content: string;
|
|
6
|
+
triggerLabel: string;
|
|
7
|
+
children?: (props: {
|
|
8
|
+
descriptionId: string;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
classNames?: Partial<Record<"target" | "aside" | "trigger" | "icon" | "content", string>>;
|
|
13
|
+
};
|
|
14
|
+
/** Inline supplementary guidance, not a substitute for instructions or errors. */
|
|
15
|
+
export declare const Hint: ({ content, triggerLabel, children, icon, className, classNames, }: HintProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// ../../src/components/hint/react.tsx
|
|
2
|
+
import {
|
|
3
|
+
useEffect,
|
|
4
|
+
useId,
|
|
5
|
+
useRef,
|
|
6
|
+
useState
|
|
7
|
+
} from "react";
|
|
8
|
+
|
|
9
|
+
// ../../src/lib/utils.ts
|
|
10
|
+
import { cn } from "cn";
|
|
11
|
+
|
|
12
|
+
// ../../src/components/hint/react.tsx
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
"use client";
|
|
15
|
+
/*! Solid lightbulb by Font Awesome Free 5.15.2 (https://fontawesome.com), CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Adapted to JSX. */
|
|
16
|
+
var SolidLightbulb = (props) => /* @__PURE__ */ jsx("svg", {
|
|
17
|
+
viewBox: "0 0 352 512",
|
|
18
|
+
width: "1em",
|
|
19
|
+
height: "1em",
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
...props,
|
|
23
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
24
|
+
d: "M96.06 454.35c.01 6.29 1.87 12.45 5.36 17.69l17.09 25.69a31.99 31.99 0 0 0 26.64 14.28h61.71a31.99 31.99 0 0 0 26.64-14.28l17.09-25.69a31.989 31.989 0 0 0 5.36-17.69l.04-38.35H96.01l.05 38.35zM0 176c0 44.37 16.45 84.85 43.56 115.78 16.52 18.85 42.36 58.23 52.21 91.45.04.26.07.52.11.78h160.24c.04-.26.07-.51.11-.78 9.85-33.22 35.69-72.6 52.21-91.45C335.55 260.85 352 220.37 352 176 352 78.61 272.91-.3 175.45 0 73.44.31 0 82.97 0 176zm176-80c-44.11 0-80 35.89-80 80 0 8.84-7.16 16-16 16s-16-7.16-16-16c0-61.76 50.24-112 112-112 8.84 0 16 7.16 16 16s-7.16 16-16 16z"
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
var Hint = ({
|
|
28
|
+
content,
|
|
29
|
+
triggerLabel,
|
|
30
|
+
children,
|
|
31
|
+
icon = /* @__PURE__ */ jsx(SolidLightbulb, {}),
|
|
32
|
+
className,
|
|
33
|
+
classNames
|
|
34
|
+
}) => {
|
|
35
|
+
const descriptionId = useId();
|
|
36
|
+
const root = useRef(null);
|
|
37
|
+
const [hovered, setHovered] = useState(false);
|
|
38
|
+
const [focused, setFocused] = useState(false);
|
|
39
|
+
const [pinned, setPinned] = useState(false);
|
|
40
|
+
const [dismissed, setDismissed] = useState(false);
|
|
41
|
+
const open = !dismissed && (hovered || focused || pinned);
|
|
42
|
+
const state = open ? "open" : "closed";
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (!open)
|
|
45
|
+
return;
|
|
46
|
+
const dismiss = () => {
|
|
47
|
+
setPinned(false);
|
|
48
|
+
setDismissed(true);
|
|
49
|
+
};
|
|
50
|
+
const onKeyDown = (event) => {
|
|
51
|
+
if (event.key === "Escape")
|
|
52
|
+
dismiss();
|
|
53
|
+
};
|
|
54
|
+
const onPointerDown = (event) => {
|
|
55
|
+
if (event.target instanceof Node && !root.current?.contains(event.target)) {
|
|
56
|
+
dismiss();
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
document.addEventListener("keydown", onKeyDown);
|
|
60
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
61
|
+
return () => {
|
|
62
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
63
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
64
|
+
};
|
|
65
|
+
}, [open]);
|
|
66
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
67
|
+
ref: root,
|
|
68
|
+
"data-slot": "hint",
|
|
69
|
+
"data-state": state,
|
|
70
|
+
className: cn(children ? "grid items-start gap-3 sm:grid-cols-[minmax(0,1fr)_16rem]" : "inline-flex", className),
|
|
71
|
+
onPointerEnter: (event) => {
|
|
72
|
+
if (event.pointerType === "touch")
|
|
73
|
+
return;
|
|
74
|
+
setHovered(true);
|
|
75
|
+
setDismissed(false);
|
|
76
|
+
},
|
|
77
|
+
onPointerLeave: () => setHovered(false),
|
|
78
|
+
onFocus: () => {
|
|
79
|
+
setFocused(true);
|
|
80
|
+
setDismissed(false);
|
|
81
|
+
},
|
|
82
|
+
onBlur: (event) => {
|
|
83
|
+
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
84
|
+
setFocused(false);
|
|
85
|
+
setPinned(false);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
children: [
|
|
89
|
+
children ? /* @__PURE__ */ jsx("div", {
|
|
90
|
+
"data-slot": "hint-target",
|
|
91
|
+
className: cn("min-w-0", classNames?.target),
|
|
92
|
+
children: children({ descriptionId })
|
|
93
|
+
}) : null,
|
|
94
|
+
/* @__PURE__ */ jsxs("div", {
|
|
95
|
+
"data-slot": "hint-aside",
|
|
96
|
+
className: cn("flex items-start gap-2", classNames?.aside),
|
|
97
|
+
children: [
|
|
98
|
+
/* @__PURE__ */ jsx("button", {
|
|
99
|
+
type: "button",
|
|
100
|
+
"data-slot": "hint-trigger",
|
|
101
|
+
"data-state": state,
|
|
102
|
+
"aria-label": triggerLabel,
|
|
103
|
+
"aria-expanded": open,
|
|
104
|
+
"aria-controls": descriptionId,
|
|
105
|
+
"aria-describedby": descriptionId,
|
|
106
|
+
className: cn("focus-visible:outline-ring inline-flex size-8 shrink-0 items-center justify-center rounded-md focus-visible:outline-2 focus-visible:outline-offset-2", open ? "text-primary" : "text-muted-foreground", classNames?.trigger),
|
|
107
|
+
onClick: () => {
|
|
108
|
+
setPinned(!pinned);
|
|
109
|
+
setDismissed(pinned);
|
|
110
|
+
},
|
|
111
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
112
|
+
"data-slot": "hint-icon",
|
|
113
|
+
"aria-hidden": "true",
|
|
114
|
+
className: cn("inline-flex [&>svg]:size-5", classNames?.icon),
|
|
115
|
+
children: icon
|
|
116
|
+
})
|
|
117
|
+
}),
|
|
118
|
+
/* @__PURE__ */ jsx("p", {
|
|
119
|
+
id: descriptionId,
|
|
120
|
+
"data-slot": "hint-content",
|
|
121
|
+
"data-state": state,
|
|
122
|
+
className: cn("text-muted-foreground m-0 min-w-0 pt-1 text-sm leading-relaxed data-[state=closed]:invisible", classNames?.content),
|
|
123
|
+
children: content
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
export {
|
|
131
|
+
Hint,
|
|
132
|
+
SolidLightbulb
|
|
133
|
+
};
|
|
@@ -3,63 +3,16 @@ import { Schema as Schema5 } from "effect";
|
|
|
3
3
|
import { UiSchema as UiSchema3 } from "effect/ui";
|
|
4
4
|
import { Html } from "effect/ui/html";
|
|
5
5
|
import { Combobox, VirtualList } from "effect/ui/kit";
|
|
6
|
-
|
|
7
|
-
// ../../src/components/effectcn/button.ts
|
|
6
|
+
import { buttonVariants } from "@/components/effectcn/button";
|
|
8
7
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
35
|
-
// ../../src/components/effectcn/combobox.ts
|
|
36
|
-
var icon = (h, path) => h.el("svg").attrs({
|
|
37
|
-
viewBox: "0 0 24 24",
|
|
38
|
-
fill: "none",
|
|
39
|
-
stroke: "currentColor",
|
|
40
|
-
"stroke-width": "2",
|
|
41
|
-
"stroke-linecap": "round",
|
|
42
|
-
"stroke-linejoin": "round",
|
|
43
|
-
"aria-hidden": "true"
|
|
44
|
-
}).children(h.el("path").attr("d", path));
|
|
45
|
-
var ComboboxButton = (h, combobox, options = {}) => combobox.trigger(h.button.class(cn("border-input bg-background text-foreground hover:bg-accent data-[popup-open]:bg-accent inline-flex h-8.5 w-56 items-center justify-between gap-2 rounded-md border pr-2 pl-3 text-start text-[13px] whitespace-nowrap shadow-sm transition-colors duration-150 select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:size-3.5", options.class))).children(options.value === undefined ? combobox.value(h.span.class("min-w-0 truncate data-[placeholder]:text-muted-foreground")) : h.span.class(cn("data-[placeholder]:text-muted-foreground min-w-0 truncate", options.valueClass)).children(options.value), combobox.icon(h.span.class("grid shrink-0 place-items-center text-muted-foreground")).children(icon(h, "M7 15l5 5 5-5M7 9l5-5 5 5")));
|
|
46
|
-
var ComboboxPositioner = (h, combobox, options = {}) => combobox.positioner(h.div.class(cn("outline-none", options.class)));
|
|
47
|
-
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)));
|
|
48
|
-
var ComboboxSearchInput = (h, combobox, options = {}) => h.div.class(cn("text-muted-foreground flex shrink-0 items-center border-b pl-3 [&_svg]:size-3.5", options.class)).children(icon(h, "M21 21l-4.3-4.3M11 18a7 7 0 100-14 7 7 0 000 14z"), combobox.input(h.input.attrs({
|
|
49
|
-
placeholder: options.placeholder,
|
|
50
|
-
"aria-label": options.placeholder
|
|
51
|
-
}).class("h-9 min-w-0 flex-1 bg-transparent px-2 text-[13px] text-foreground outline-none placeholder:text-muted-foreground")));
|
|
52
|
-
var ComboboxEmpty = (h, combobox, options = {}) => combobox.empty(h.div.class(cn("text-muted-foreground px-3 py-5 text-center empty:hidden", options.class)));
|
|
53
|
-
var ComboboxItem = (h, combobox, options) => combobox.item({
|
|
54
|
-
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)),
|
|
55
|
-
value: options.value
|
|
56
|
-
});
|
|
57
|
-
var ComboboxItemIndicator = (h, combobox, options) => combobox.itemIndicator({
|
|
58
|
-
element: h.span.class(cn("border-brand mr-1.5 mb-0.5 ml-2.5 h-[9px] w-[5px] shrink-0 rotate-45 border-r-[1.5px] border-b-[1.5px]", options.class)),
|
|
59
|
-
value: options.value
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// ../../src/components/icon-input/html.ts
|
|
8
|
+
ComboboxButton,
|
|
9
|
+
ComboboxEmpty,
|
|
10
|
+
ComboboxItem,
|
|
11
|
+
ComboboxItemIndicator,
|
|
12
|
+
ComboboxPopup,
|
|
13
|
+
ComboboxPositioner,
|
|
14
|
+
ComboboxSearchInput
|
|
15
|
+
} from "@/components/effectcn/combobox";
|
|
63
16
|
import { krakstackLocaleRead } from "@krak-stack/registry/krakstack-provider/html";
|
|
64
17
|
import {
|
|
65
18
|
ExternalLink as ExternalLinkIcon,
|
|
@@ -2,54 +2,7 @@
|
|
|
2
2
|
import { Component as Component3, View } from "effect/ui";
|
|
3
3
|
import { Icon } from "@iconify/react";
|
|
4
4
|
import { ExternalLink, Search } from "lucide-react";
|
|
5
|
-
|
|
6
|
-
// ../../src/components/ui/button.tsx
|
|
7
|
-
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
8
|
-
import { cva } from "class-variance-authority";
|
|
9
|
-
|
|
10
|
-
// ../../src/lib/utils.ts
|
|
11
|
-
import { cn } from "cn";
|
|
12
|
-
|
|
13
|
-
// ../../src/components/ui/button.tsx
|
|
14
|
-
import { jsx } from "react/jsx-runtime";
|
|
15
|
-
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", {
|
|
16
|
-
variants: {
|
|
17
|
-
variant: {
|
|
18
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
19
|
-
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",
|
|
20
|
-
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",
|
|
21
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
22
|
-
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",
|
|
23
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
24
|
-
},
|
|
25
|
-
size: {
|
|
26
|
-
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",
|
|
27
|
-
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",
|
|
28
|
-
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",
|
|
29
|
-
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
30
|
-
icon: "size-9",
|
|
31
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
32
|
-
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
33
|
-
"icon-lg": "size-10"
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
defaultVariants: {
|
|
37
|
-
variant: "default",
|
|
38
|
-
size: "default"
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
function Button({
|
|
42
|
-
className,
|
|
43
|
-
variant = "default",
|
|
44
|
-
size = "default",
|
|
45
|
-
...props
|
|
46
|
-
}) {
|
|
47
|
-
return /* @__PURE__ */ jsx(ButtonPrimitive, {
|
|
48
|
-
"data-slot": "button",
|
|
49
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
50
|
-
...props
|
|
51
|
-
});
|
|
52
|
-
}
|
|
5
|
+
import { Button as Button2 } from "@/components/ui/button";
|
|
53
6
|
|
|
54
7
|
// ../../src/components/virtualized-combobox/react.tsx
|
|
55
8
|
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
@@ -61,64 +14,11 @@ import {
|
|
|
61
14
|
useImperativeHandle,
|
|
62
15
|
useRef
|
|
63
16
|
} from "react";
|
|
17
|
+
import { Button } from "@/components/ui/button";
|
|
18
|
+
import { InputGroup, InputGroupInput } from "@/components/ui/input-group";
|
|
64
19
|
|
|
65
|
-
// ../../src/
|
|
66
|
-
import {
|
|
67
|
-
|
|
68
|
-
// ../../src/components/ui/input.tsx
|
|
69
|
-
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
70
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
71
|
-
function Input({ className, type, ...props }) {
|
|
72
|
-
return /* @__PURE__ */ jsx2(InputPrimitive, {
|
|
73
|
-
type,
|
|
74
|
-
"data-slot": "input",
|
|
75
|
-
className: cn("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className),
|
|
76
|
-
...props
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// ../../src/components/ui/input-group.tsx
|
|
81
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
82
|
-
function InputGroup({ className, ...props }) {
|
|
83
|
-
return /* @__PURE__ */ jsx3("div", {
|
|
84
|
-
"data-slot": "input-group",
|
|
85
|
-
role: "group",
|
|
86
|
-
className: cn("group/input-group relative flex h-9 w-full min-w-0 items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5", className),
|
|
87
|
-
...props
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
var inputGroupAddonVariants = cva2("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
|
|
91
|
-
variants: {
|
|
92
|
-
align: {
|
|
93
|
-
"inline-start": "order-first pl-2 has-[>button]:-ml-1 has-[>kbd]:ml-[-0.15rem]",
|
|
94
|
-
"inline-end": "order-last pr-2 has-[>button]:-mr-1 has-[>kbd]:mr-[-0.15rem]",
|
|
95
|
-
"block-start": "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
|
|
96
|
-
"block-end": "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
defaultVariants: { align: "inline-start" }
|
|
100
|
-
});
|
|
101
|
-
var inputGroupButtonVariants = cva2("flex items-center gap-2 text-sm shadow-none", {
|
|
102
|
-
variants: {
|
|
103
|
-
size: {
|
|
104
|
-
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
|
|
105
|
-
sm: "",
|
|
106
|
-
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
107
|
-
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
defaultVariants: { size: "xs" }
|
|
111
|
-
});
|
|
112
|
-
function InputGroupInput({
|
|
113
|
-
className,
|
|
114
|
-
...props
|
|
115
|
-
}) {
|
|
116
|
-
return /* @__PURE__ */ jsx3(Input, {
|
|
117
|
-
"data-slot": "input-group-control",
|
|
118
|
-
className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent", className),
|
|
119
|
-
...props
|
|
120
|
-
});
|
|
121
|
-
}
|
|
20
|
+
// ../../src/lib/utils.ts
|
|
21
|
+
import { cn } from "cn";
|
|
122
22
|
|
|
123
23
|
// ../../src/components/virtualized-combobox/react.tsx
|
|
124
24
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
@@ -285,7 +185,7 @@ var update = Component.define(virtualizedComboboxOptions).update({
|
|
|
285
185
|
});
|
|
286
186
|
|
|
287
187
|
// ../../src/components/virtualized-combobox/react.tsx
|
|
288
|
-
import { jsx
|
|
188
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
289
189
|
"use client";
|
|
290
190
|
var optionEquals = (item, selected) => item.value === selected.value;
|
|
291
191
|
var VirtualizedComboboxList = ({
|
|
@@ -325,11 +225,11 @@ var VirtualizedComboboxList = ({
|
|
|
325
225
|
}, [virtualizer]);
|
|
326
226
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
327
227
|
children: [
|
|
328
|
-
filteredItems.length === 0 && /* @__PURE__ */
|
|
228
|
+
filteredItems.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
329
229
|
className: "text-muted-foreground flex min-h-0 flex-1 flex-col items-center justify-center overflow-auto py-6 text-center text-sm",
|
|
330
230
|
children: emptyLabel
|
|
331
231
|
}),
|
|
332
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ jsx(ComboboxPrimitive.List, {
|
|
333
233
|
className: "min-h-0 flex-1 scroll-py-1 overflow-auto overscroll-contain p-1",
|
|
334
234
|
hidden: filteredItems.length === 0,
|
|
335
235
|
ref: handleScrollElementRef,
|
|
@@ -337,7 +237,7 @@ var VirtualizedComboboxList = ({
|
|
|
337
237
|
height: Math.min(virtualizer.getTotalSize() + 8, 288),
|
|
338
238
|
maxHeight: "var(--available-height)"
|
|
339
239
|
},
|
|
340
|
-
children: /* @__PURE__ */
|
|
240
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
341
241
|
className: "relative w-full",
|
|
342
242
|
role: "presentation",
|
|
343
243
|
style: { height: virtualizer.getTotalSize() },
|
|
@@ -350,9 +250,9 @@ var VirtualizedComboboxList = ({
|
|
|
350
250
|
transform: `translateY(${virtualItem.start}px)`
|
|
351
251
|
};
|
|
352
252
|
if (entry.kind === "group") {
|
|
353
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ jsx(ComboboxPrimitive.Group, {
|
|
354
254
|
className: "contents",
|
|
355
|
-
children: /* @__PURE__ */
|
|
255
|
+
children: /* @__PURE__ */ jsx(ComboboxPrimitive.GroupLabel, {
|
|
356
256
|
className: "text-muted-foreground absolute top-0 left-0 w-full px-2 pt-3 pb-1 text-xs",
|
|
357
257
|
"data-index": virtualItem.index,
|
|
358
258
|
ref: virtualizer.measureElement,
|
|
@@ -371,13 +271,13 @@ var VirtualizedComboboxList = ({
|
|
|
371
271
|
style,
|
|
372
272
|
value: entry.item,
|
|
373
273
|
children: [
|
|
374
|
-
renderItem?.(entry.item) ?? /* @__PURE__ */
|
|
274
|
+
renderItem?.(entry.item) ?? /* @__PURE__ */ jsx("span", {
|
|
375
275
|
className: virtualizedComboboxClasses.itemLabel,
|
|
376
276
|
children: entry.item.label
|
|
377
277
|
}),
|
|
378
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ jsx(ComboboxPrimitive.ItemIndicator, {
|
|
379
279
|
className: "absolute right-2 flex size-4 items-center justify-center",
|
|
380
|
-
children: /* @__PURE__ */
|
|
280
|
+
children: /* @__PURE__ */ jsx(Check, {})
|
|
381
281
|
})
|
|
382
282
|
]
|
|
383
283
|
}, entry.item.value);
|
|
@@ -400,8 +300,8 @@ var VirtualizedComboboxContent = ({
|
|
|
400
300
|
virtualizerRef
|
|
401
301
|
}) => {
|
|
402
302
|
const labels = virtualizedComboboxMessages(locale, messageOverrides);
|
|
403
|
-
return /* @__PURE__ */
|
|
404
|
-
children: /* @__PURE__ */
|
|
303
|
+
return /* @__PURE__ */ jsx(ComboboxPrimitive.Portal, {
|
|
304
|
+
children: /* @__PURE__ */ jsx(ComboboxPrimitive.Positioner, {
|
|
405
305
|
align: "start",
|
|
406
306
|
className: "isolate z-50",
|
|
407
307
|
side: "bottom",
|
|
@@ -409,17 +309,17 @@ var VirtualizedComboboxContent = ({
|
|
|
409
309
|
children: /* @__PURE__ */ jsxs(ComboboxPrimitive.Popup, {
|
|
410
310
|
className: cn("bg-popover text-popover-foreground ring-foreground/10 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-in-95 relative flex max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-0 origin-(--transform-origin) flex-col overflow-hidden rounded-md shadow-md ring-1 duration-100", contentClassName),
|
|
411
311
|
children: [
|
|
412
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ jsx("div", {
|
|
413
313
|
className: "min-w-0 shrink-0 p-1 pb-0",
|
|
414
|
-
children: /* @__PURE__ */
|
|
314
|
+
children: /* @__PURE__ */ jsx(InputGroup, {
|
|
415
315
|
className: "border-input/30 bg-input/30 h-8 w-full min-w-0 shadow-none",
|
|
416
|
-
children: /* @__PURE__ */
|
|
316
|
+
children: /* @__PURE__ */ jsx(ComboboxPrimitive.Input, {
|
|
417
317
|
placeholder: labels.search,
|
|
418
|
-
render: /* @__PURE__ */
|
|
318
|
+
render: /* @__PURE__ */ jsx(InputGroupInput, {})
|
|
419
319
|
})
|
|
420
320
|
})
|
|
421
321
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ jsx(VirtualizedComboboxList, {
|
|
423
323
|
classes,
|
|
424
324
|
emptyLabel,
|
|
425
325
|
groupSelections,
|
|
@@ -444,20 +344,20 @@ var defaultTrigger = (ariaLabel, ariaInvalid, disabled, label, triggerId) => /*
|
|
|
444
344
|
type: "button",
|
|
445
345
|
variant: "outline",
|
|
446
346
|
children: [
|
|
447
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ jsx("span", {
|
|
448
348
|
className: "min-w-0 flex-1 truncate pr-7 text-left",
|
|
449
349
|
children: label
|
|
450
350
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ jsx(ChevronsUpDown, {
|
|
452
352
|
className: "text-muted-foreground shrink-0 opacity-70"
|
|
453
353
|
})
|
|
454
354
|
]
|
|
455
355
|
});
|
|
456
|
-
var defaultClear = (label) => /* @__PURE__ */
|
|
356
|
+
var defaultClear = (label) => /* @__PURE__ */ jsx(ComboboxPrimitive.Clear, {
|
|
457
357
|
"aria-label": label,
|
|
458
358
|
className: "text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 absolute top-1/2 right-7 z-10 flex size-6 -translate-y-1/2 items-center justify-center rounded-sm outline-none focus-visible:border focus-visible:ring-3",
|
|
459
359
|
type: "button",
|
|
460
|
-
children: /* @__PURE__ */
|
|
360
|
+
children: /* @__PURE__ */ jsx(X, {
|
|
461
361
|
className: "size-3.5"
|
|
462
362
|
})
|
|
463
363
|
});
|
|
@@ -490,13 +390,13 @@ var VirtualizedComboboxSingle = (props) => {
|
|
|
490
390
|
/* @__PURE__ */ jsxs("div", {
|
|
491
391
|
className: "relative",
|
|
492
392
|
children: [
|
|
493
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ jsx(ComboboxPrimitive.Trigger, {
|
|
494
394
|
render: props.trigger ?? defaultTrigger(props.ariaLabel, props.ariaInvalid, props.disabled, selectedLabel(props.value, props.placeholder), props.triggerId)
|
|
495
395
|
}),
|
|
496
396
|
props.trigger ? null : defaultClear(labels.clear)
|
|
497
397
|
]
|
|
498
398
|
}),
|
|
499
|
-
/* @__PURE__ */
|
|
399
|
+
/* @__PURE__ */ jsx(VirtualizedComboboxContent, {
|
|
500
400
|
...props,
|
|
501
401
|
groupSelections: false,
|
|
502
402
|
itemIndexRef,
|
|
@@ -532,13 +432,13 @@ var VirtualizedComboboxMultiple = (props) => {
|
|
|
532
432
|
/* @__PURE__ */ jsxs("div", {
|
|
533
433
|
className: "relative",
|
|
534
434
|
children: [
|
|
535
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ jsx(ComboboxPrimitive.Trigger, {
|
|
536
436
|
render: props.trigger ?? defaultTrigger(props.ariaLabel, props.ariaInvalid, props.disabled, selectedLabel(props.value, props.placeholder), props.triggerId)
|
|
537
437
|
}),
|
|
538
438
|
props.trigger ? null : defaultClear(labels.clear)
|
|
539
439
|
]
|
|
540
440
|
}),
|
|
541
|
-
/* @__PURE__ */
|
|
441
|
+
/* @__PURE__ */ jsx(VirtualizedComboboxContent, {
|
|
542
442
|
...props,
|
|
543
443
|
groupSelections: true,
|
|
544
444
|
itemIndexRef,
|
|
@@ -550,10 +450,10 @@ var VirtualizedComboboxMultiple = (props) => {
|
|
|
550
450
|
};
|
|
551
451
|
function VirtualizedCombobox(props) {
|
|
552
452
|
const locale = useKrakstackLocale(props.locale);
|
|
553
|
-
return props.multiple ? /* @__PURE__ */
|
|
453
|
+
return props.multiple ? /* @__PURE__ */ jsx(VirtualizedComboboxMultiple, {
|
|
554
454
|
...props,
|
|
555
455
|
locale
|
|
556
|
-
}) : /* @__PURE__ */
|
|
456
|
+
}) : /* @__PURE__ */ jsx(VirtualizedComboboxSingle, {
|
|
557
457
|
...props,
|
|
558
458
|
locale
|
|
559
459
|
});
|
|
@@ -709,7 +609,7 @@ var iconInputBehaviours = {
|
|
|
709
609
|
};
|
|
710
610
|
|
|
711
611
|
// ../../src/components/icon-input/react.tsx
|
|
712
|
-
import { jsx as
|
|
612
|
+
import { jsx as jsx2, jsxs as jsxs2, Fragment as Fragment2 } from "react/jsx-runtime";
|
|
713
613
|
var IconInputModel = Component3.define(iconInputOptions).make({
|
|
714
614
|
...iconInputBehaviours,
|
|
715
615
|
view: () => View.text("")
|
|
@@ -733,20 +633,20 @@ function IconInput({
|
|
|
733
633
|
const isWaiting = query.trim() !== "" && results?.collection !== collection;
|
|
734
634
|
const items = icons.map((icon) => ({ label: icon, value: icon }));
|
|
735
635
|
const selectedItem = value ? { label: value, value } : null;
|
|
736
|
-
return /* @__PURE__ */
|
|
636
|
+
return /* @__PURE__ */ jsx2(VirtualizedCombobox, {
|
|
737
637
|
ariaLabel: copy.select,
|
|
738
638
|
contentClassName: "h-80 w-80",
|
|
739
639
|
emptyLabel: isWaiting ? null : /* @__PURE__ */ jsxs2("div", {
|
|
740
640
|
className: "text-muted-foreground flex flex-col items-center gap-2 px-3",
|
|
741
641
|
children: [
|
|
742
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ jsx2(Search, {
|
|
743
643
|
className: "size-5"
|
|
744
644
|
}),
|
|
745
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ jsx2("p", {
|
|
746
646
|
children: query ? copy.empty : copy.searchPrompt
|
|
747
647
|
}),
|
|
748
|
-
/* @__PURE__ */ jsxs2(
|
|
749
|
-
render: /* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ jsxs2(Button2, {
|
|
649
|
+
render: /* @__PURE__ */ jsx2("a", {
|
|
750
650
|
href: iconifyCollectionUrl(collection),
|
|
751
651
|
rel: "noreferrer",
|
|
752
652
|
target: "_blank"
|
|
@@ -757,7 +657,7 @@ function IconInput({
|
|
|
757
657
|
children: [
|
|
758
658
|
copy.browse,
|
|
759
659
|
" ",
|
|
760
|
-
/* @__PURE__ */
|
|
660
|
+
/* @__PURE__ */ jsx2(ExternalLink, {
|
|
761
661
|
className: "inline size-3"
|
|
762
662
|
})
|
|
763
663
|
]
|
|
@@ -786,22 +686,22 @@ function IconInput({
|
|
|
786
686
|
placeholder: copy.select,
|
|
787
687
|
renderItem: (item) => /* @__PURE__ */ jsxs2(Fragment2, {
|
|
788
688
|
children: [
|
|
789
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ jsx2(Icon, {
|
|
790
690
|
className: "size-5 shrink-0",
|
|
791
691
|
icon: `${collection}:${item.value}`
|
|
792
692
|
}),
|
|
793
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ jsx2("span", {
|
|
794
694
|
className: "truncate",
|
|
795
695
|
children: item.label
|
|
796
696
|
}),
|
|
797
|
-
/* @__PURE__ */
|
|
697
|
+
/* @__PURE__ */ jsx2("span", {
|
|
798
698
|
className: "sr-only",
|
|
799
699
|
children: copy.select
|
|
800
700
|
})
|
|
801
701
|
]
|
|
802
702
|
}),
|
|
803
703
|
searchValue: query,
|
|
804
|
-
trigger: /* @__PURE__ */
|
|
704
|
+
trigger: /* @__PURE__ */ jsx2(Button2, {
|
|
805
705
|
"aria-label": copy.select,
|
|
806
706
|
disabled,
|
|
807
707
|
id,
|
|
@@ -809,7 +709,7 @@ function IconInput({
|
|
|
809
709
|
title: value,
|
|
810
710
|
type: "button",
|
|
811
711
|
variant: "outline",
|
|
812
|
-
children: /* @__PURE__ */
|
|
712
|
+
children: /* @__PURE__ */ jsx2(Icon, {
|
|
813
713
|
className: "size-5",
|
|
814
714
|
icon: `${collection}:${value}`
|
|
815
715
|
})
|
|
@@ -2,41 +2,7 @@
|
|
|
2
2
|
import { Effect as Effect2, Redacted, Schema as Schema5, Stream } from "effect";
|
|
3
3
|
import { Mount } from "effect/ui";
|
|
4
4
|
import { Html } from "effect/ui/html";
|
|
5
|
-
|
|
6
|
-
// ../../src/components/effectcn/button.ts
|
|
7
|
-
import {
|
|
8
|
-
Button as KitButton
|
|
9
|
-
} from "effect/ui/kit";
|
|
10
|
-
|
|
11
|
-
// ../../src/lib/utils.ts
|
|
12
|
-
import { cn } from "cn";
|
|
13
|
-
|
|
14
|
-
// ../../src/components/effectcn/button.ts
|
|
15
|
-
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";
|
|
16
|
-
var variants = {
|
|
17
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/85",
|
|
18
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-accent",
|
|
19
|
-
outline: "border-input bg-background text-foreground shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
20
|
-
ghost: "text-foreground hover:bg-accent hover:text-accent-foreground",
|
|
21
|
-
brand: "bg-brand-soft text-brand-soft-foreground hover:bg-brand-soft/85",
|
|
22
|
-
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85",
|
|
23
|
-
link: "h-auto px-0 text-foreground underline decoration-transparent underline-offset-4 hover:decoration-current"
|
|
24
|
-
};
|
|
25
|
-
var sizes = {
|
|
26
|
-
default: "",
|
|
27
|
-
sm: "h-7 rounded-sm px-2.5 text-xs",
|
|
28
|
-
lg: "h-10 px-5 text-sm",
|
|
29
|
-
icon: "w-8.5 px-0",
|
|
30
|
-
"icon-sm": "h-7 w-7 rounded-sm px-0"
|
|
31
|
-
};
|
|
32
|
-
var buttonVariants = (options = {}) => cn(base, variants[options.variant ?? "default"], sizes[options.size ?? "default"], options.class);
|
|
33
|
-
var Button = (h, options = {}) => KitButton(h, {
|
|
34
|
-
element: options.element,
|
|
35
|
-
onPress: options.onPress,
|
|
36
|
-
props: options.loading ? { ...options.props, disabled: true, focusableWhenDisabled: true } : options.props
|
|
37
|
-
}).class(buttonVariants(options)).attr("data-loading", options.loading ? "" : undefined);
|
|
38
|
-
|
|
39
|
-
// ../../src/components/image-crop-editor/html.ts
|
|
5
|
+
import { Button } from "@/components/effectcn/button";
|
|
40
6
|
import { krakstackLocaleRead } from "@krak-stack/registry/krakstack-provider/html";
|
|
41
7
|
import { Check, LoaderCircle, RotateCcw } from "@krak-stack/registry/lucide-effect";
|
|
42
8
|
|