@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
|
@@ -7,187 +7,18 @@ import {
|
|
|
7
7
|
} from "react";
|
|
8
8
|
import { CloudUpload, FileIcon, FileUp, ImageUp, Trash2 } from "lucide-react";
|
|
9
9
|
import { Schema as Schema3 } from "effect";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
import { Button
|
|
21
|
-
import {
|
|
22
|
-
import { jsx } from "react/jsx-runtime";
|
|
23
|
-
var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
24
|
-
variants: {
|
|
25
|
-
variant: {
|
|
26
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
27
|
-
outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
28
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
29
|
-
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
30
|
-
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
31
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
32
|
-
},
|
|
33
|
-
size: {
|
|
34
|
-
default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
35
|
-
xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
36
|
-
sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
37
|
-
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
38
|
-
icon: "size-9",
|
|
39
|
-
"icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
|
|
40
|
-
"icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
|
|
41
|
-
"icon-lg": "size-10"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
defaultVariants: {
|
|
45
|
-
variant: "default",
|
|
46
|
-
size: "default"
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
function Button({
|
|
50
|
-
className,
|
|
51
|
-
variant = "default",
|
|
52
|
-
size = "default",
|
|
53
|
-
...props
|
|
54
|
-
}) {
|
|
55
|
-
return /* @__PURE__ */ jsx(ButtonPrimitive, {
|
|
56
|
-
"data-slot": "button",
|
|
57
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
58
|
-
...props
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// ../../src/components/ui/attachment.tsx
|
|
63
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
64
|
-
var attachmentVariants = cva2("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed", {
|
|
65
|
-
variants: {
|
|
66
|
-
size: {
|
|
67
|
-
default: "gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
|
|
68
|
-
sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
|
|
69
|
-
xs: "gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"
|
|
70
|
-
},
|
|
71
|
-
orientation: {
|
|
72
|
-
horizontal: "min-w-40 items-center",
|
|
73
|
-
vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
function Attachment({
|
|
78
|
-
className,
|
|
79
|
-
state = "done",
|
|
80
|
-
size = "default",
|
|
81
|
-
orientation = "horizontal",
|
|
82
|
-
...props
|
|
83
|
-
}) {
|
|
84
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
85
|
-
"data-slot": "attachment",
|
|
86
|
-
"data-state": state,
|
|
87
|
-
"data-size": size,
|
|
88
|
-
"data-orientation": orientation,
|
|
89
|
-
className: cn(attachmentVariants({ size, orientation }), className),
|
|
90
|
-
...props
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
var attachmentMediaVariants = cva2("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:*:data-[slot=spinner]:size-6! [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5", {
|
|
94
|
-
variants: {
|
|
95
|
-
variant: {
|
|
96
|
-
icon: "",
|
|
97
|
-
image: "opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
defaultVariants: {
|
|
101
|
-
variant: "icon"
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
function AttachmentMedia({
|
|
105
|
-
className,
|
|
106
|
-
variant = "icon",
|
|
107
|
-
...props
|
|
108
|
-
}) {
|
|
109
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
110
|
-
"data-slot": "attachment-media",
|
|
111
|
-
"data-variant": variant,
|
|
112
|
-
className: cn(attachmentMediaVariants({ variant }), className),
|
|
113
|
-
...props
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
function AttachmentContent({
|
|
117
|
-
className,
|
|
118
|
-
...props
|
|
119
|
-
}) {
|
|
120
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
121
|
-
"data-slot": "attachment-content",
|
|
122
|
-
className: cn("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1", className),
|
|
123
|
-
...props
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
function AttachmentTitle({
|
|
127
|
-
className,
|
|
128
|
-
...props
|
|
129
|
-
}) {
|
|
130
|
-
return /* @__PURE__ */ jsx2("span", {
|
|
131
|
-
"data-slot": "attachment-title",
|
|
132
|
-
className: cn("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:shimmer group-data-[state=uploading]/attachment:shimmer", className),
|
|
133
|
-
...props
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
function AttachmentDescription({
|
|
137
|
-
className,
|
|
138
|
-
...props
|
|
139
|
-
}) {
|
|
140
|
-
return /* @__PURE__ */ jsx2("span", {
|
|
141
|
-
"data-slot": "attachment-description",
|
|
142
|
-
className: cn("mt-0.5 block min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80", "max-w-full", className),
|
|
143
|
-
...props
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
function AttachmentActions({
|
|
147
|
-
className,
|
|
148
|
-
...props
|
|
149
|
-
}) {
|
|
150
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
151
|
-
"data-slot": "attachment-actions",
|
|
152
|
-
className: cn("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1", className),
|
|
153
|
-
...props
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
function AttachmentAction({
|
|
157
|
-
className,
|
|
158
|
-
variant,
|
|
159
|
-
size = "icon-xs",
|
|
160
|
-
...props
|
|
161
|
-
}) {
|
|
162
|
-
return /* @__PURE__ */ jsx2(Button, {
|
|
163
|
-
"data-slot": "attachment-action",
|
|
164
|
-
variant: variant ?? "ghost",
|
|
165
|
-
size,
|
|
166
|
-
className: cn(className),
|
|
167
|
-
...props
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
function AttachmentGroup({ className, ...props }) {
|
|
171
|
-
return /* @__PURE__ */ jsx2("div", {
|
|
172
|
-
"data-slot": "attachment-group",
|
|
173
|
-
className: cn("flex min-w-0 scroll-fade-x snap-x snap-mandatory scroll-px-1 scrollbar-none gap-3 overflow-x-auto overscroll-x-contain py-1 *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start", className),
|
|
174
|
-
...props
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// ../../src/components/ui/input.tsx
|
|
179
|
-
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
180
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
181
|
-
function Input({ className, type, ...props }) {
|
|
182
|
-
return /* @__PURE__ */ jsx3(InputPrimitive, {
|
|
183
|
-
type,
|
|
184
|
-
"data-slot": "input",
|
|
185
|
-
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),
|
|
186
|
-
...props
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// ../../src/components/file-input/react.tsx
|
|
10
|
+
import {
|
|
11
|
+
Attachment,
|
|
12
|
+
AttachmentAction,
|
|
13
|
+
AttachmentActions,
|
|
14
|
+
AttachmentContent,
|
|
15
|
+
AttachmentDescription,
|
|
16
|
+
AttachmentGroup,
|
|
17
|
+
AttachmentMedia,
|
|
18
|
+
AttachmentTitle
|
|
19
|
+
} from "@/components/ui/attachment";
|
|
20
|
+
import { Button } from "@/components/ui/button";
|
|
21
|
+
import { Input } from "@/components/ui/input";
|
|
191
22
|
import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
|
|
192
23
|
|
|
193
24
|
// ../../src/components/file-input/classes.ts
|
|
@@ -339,7 +170,7 @@ var filePickerBehaviours = {
|
|
|
339
170
|
};
|
|
340
171
|
|
|
341
172
|
// ../../src/components/file-input/react.tsx
|
|
342
|
-
import { jsx
|
|
173
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
343
174
|
"use client";
|
|
344
175
|
var FileInput = ({
|
|
345
176
|
classes: classOverrides,
|
|
@@ -395,7 +226,7 @@ var FileInput = ({
|
|
|
395
226
|
if (inputRef.current)
|
|
396
227
|
inputRef.current.value = "";
|
|
397
228
|
};
|
|
398
|
-
const input = /* @__PURE__ */
|
|
229
|
+
const input = /* @__PURE__ */ jsx(Input, {
|
|
399
230
|
ref: inputRef,
|
|
400
231
|
className: "sr-only",
|
|
401
232
|
id,
|
|
@@ -436,17 +267,17 @@ var FileInput = ({
|
|
|
436
267
|
onDragOver: (event) => event.preventDefault(),
|
|
437
268
|
onDrop: handleDrop,
|
|
438
269
|
children: [
|
|
439
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ jsx(CloudUpload, {
|
|
440
271
|
className: "text-muted-foreground size-6"
|
|
441
272
|
}),
|
|
442
273
|
/* @__PURE__ */ jsxs("div", {
|
|
443
274
|
className: "max-w-full min-w-0",
|
|
444
275
|
children: [
|
|
445
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ jsx("p", {
|
|
446
277
|
className: "text-sm font-medium",
|
|
447
278
|
children: labels.dropFiles
|
|
448
279
|
}),
|
|
449
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ jsx("p", {
|
|
450
281
|
className: "text-muted-foreground max-w-full text-xs [overflow-wrap:anywhere]",
|
|
451
282
|
children: labels.accepts(accept)
|
|
452
283
|
})
|
|
@@ -457,7 +288,7 @@ var FileInput = ({
|
|
|
457
288
|
variant: "outline",
|
|
458
289
|
onClick: () => inputRef.current?.click(),
|
|
459
290
|
children: [
|
|
460
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ jsx(FileUp, {
|
|
461
292
|
"data-icon": "inline-start"
|
|
462
293
|
}),
|
|
463
294
|
labels.chooseFiles
|
|
@@ -466,29 +297,29 @@ var FileInput = ({
|
|
|
466
297
|
input
|
|
467
298
|
]
|
|
468
299
|
}),
|
|
469
|
-
files.length > 0 ? /* @__PURE__ */
|
|
300
|
+
files.length > 0 ? /* @__PURE__ */ jsx(AttachmentGroup, {
|
|
470
301
|
children: files.map((selectedFile) => /* @__PURE__ */ jsxs(Attachment, {
|
|
471
302
|
state: invalid ? "error" : "idle",
|
|
472
303
|
children: [
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
children: /* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ jsx(AttachmentMedia, {
|
|
305
|
+
children: /* @__PURE__ */ jsx(FileIcon, {})
|
|
475
306
|
}),
|
|
476
307
|
/* @__PURE__ */ jsxs(AttachmentContent, {
|
|
477
308
|
children: [
|
|
478
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ jsx(AttachmentTitle, {
|
|
479
310
|
children: selectedFile.name
|
|
480
311
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ jsx(AttachmentDescription, {
|
|
482
313
|
children: fileDescription(selectedFile, locale)
|
|
483
314
|
})
|
|
484
315
|
]
|
|
485
316
|
}),
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
-
children: /* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ jsx(AttachmentActions, {
|
|
318
|
+
children: /* @__PURE__ */ jsx(AttachmentAction, {
|
|
488
319
|
type: "button",
|
|
489
320
|
"aria-label": `${labels.deleteFile} ${selectedFile.name}`,
|
|
490
321
|
onClick: () => onFilesChange?.(files.filter((candidate) => candidate !== selectedFile)),
|
|
491
|
-
children: /* @__PURE__ */
|
|
322
|
+
children: /* @__PURE__ */ jsx(Trash2, {})
|
|
492
323
|
})
|
|
493
324
|
})
|
|
494
325
|
]
|
|
@@ -517,16 +348,16 @@ var FileInput = ({
|
|
|
517
348
|
onDragOver: (event) => event.preventDefault(),
|
|
518
349
|
onDrop: handleDrop,
|
|
519
350
|
children: [
|
|
520
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ jsx(CloudUpload, {
|
|
521
352
|
className: "text-muted-foreground size-6"
|
|
522
353
|
}),
|
|
523
354
|
/* @__PURE__ */ jsxs("div", {
|
|
524
355
|
children: [
|
|
525
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ jsx("p", {
|
|
526
357
|
className: "text-sm font-medium",
|
|
527
358
|
children: labels.dropFile
|
|
528
359
|
}),
|
|
529
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ jsx("p", {
|
|
530
361
|
className: "text-muted-foreground text-xs",
|
|
531
362
|
children: labels.accepts(accept)
|
|
532
363
|
})
|
|
@@ -537,7 +368,7 @@ var FileInput = ({
|
|
|
537
368
|
variant: "outline",
|
|
538
369
|
onClick: () => inputRef.current?.click(),
|
|
539
370
|
children: [
|
|
540
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ jsx(FileUp, {
|
|
541
372
|
"data-icon": "inline-start"
|
|
542
373
|
}),
|
|
543
374
|
labels.chooseFile
|
|
@@ -554,27 +385,27 @@ var FileInput = ({
|
|
|
554
385
|
orientation: "horizontal",
|
|
555
386
|
state: invalid ? "error" : "done",
|
|
556
387
|
children: [
|
|
557
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ jsx(AttachmentMedia, {
|
|
558
389
|
variant: image ? "image" : "icon",
|
|
559
390
|
className: image ? "aspect-auto max-w-full border [&_img]:aspect-auto! [&_img]:object-contain!" : undefined,
|
|
560
391
|
style: image ? {
|
|
561
392
|
width: image.width,
|
|
562
393
|
aspectRatio: `${image.width} / ${image.height}`
|
|
563
394
|
} : undefined,
|
|
564
|
-
children: image && imageUrl ? /* @__PURE__ */
|
|
395
|
+
children: image && imageUrl ? /* @__PURE__ */ jsx("img", {
|
|
565
396
|
src: imageUrl,
|
|
566
397
|
alt: image.alt,
|
|
567
398
|
width: image.width,
|
|
568
399
|
height: image.height,
|
|
569
400
|
className: "size-full object-contain"
|
|
570
|
-
}) : /* @__PURE__ */
|
|
401
|
+
}) : /* @__PURE__ */ jsx(FileIcon, {})
|
|
571
402
|
}),
|
|
572
403
|
/* @__PURE__ */ jsxs(AttachmentContent, {
|
|
573
404
|
children: [
|
|
574
|
-
/* @__PURE__ */
|
|
405
|
+
/* @__PURE__ */ jsx(AttachmentTitle, {
|
|
575
406
|
children: file?.name ?? title
|
|
576
407
|
}),
|
|
577
|
-
file ? /* @__PURE__ */
|
|
408
|
+
file ? /* @__PURE__ */ jsx(AttachmentDescription, {
|
|
578
409
|
className: "break-words",
|
|
579
410
|
children: fileDescription(file, locale)
|
|
580
411
|
}) : null
|
|
@@ -583,17 +414,17 @@ var FileInput = ({
|
|
|
583
414
|
/* @__PURE__ */ jsxs(AttachmentActions, {
|
|
584
415
|
className: "ml-auto gap-1",
|
|
585
416
|
children: [
|
|
586
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ jsx(AttachmentAction, {
|
|
587
418
|
type: "button",
|
|
588
419
|
"aria-label": labels.replaceFile,
|
|
589
420
|
onClick: () => inputRef.current?.click(),
|
|
590
|
-
children: image ? /* @__PURE__ */
|
|
421
|
+
children: image ? /* @__PURE__ */ jsx(ImageUp, {}) : /* @__PURE__ */ jsx(FileUp, {})
|
|
591
422
|
}),
|
|
592
|
-
canClear ? /* @__PURE__ */
|
|
423
|
+
canClear ? /* @__PURE__ */ jsx(AttachmentAction, {
|
|
593
424
|
type: "button",
|
|
594
425
|
"aria-label": `${labels.deleteFile} ${Schema3.is(Schema3.String)(title) ? title : ""}`,
|
|
595
426
|
onClick: clear,
|
|
596
|
-
children: /* @__PURE__ */
|
|
427
|
+
children: /* @__PURE__ */ jsx(Trash2, {})
|
|
597
428
|
}) : null
|
|
598
429
|
]
|
|
599
430
|
})
|