@arqel-dev/ui 0.16.0 → 0.18.0

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.
Files changed (65) hide show
  1. package/dist/ArqelEditPage-7OFWPULE.js +12 -0
  2. package/dist/{ArqelEditPage-RRYFYOTC.js.map → ArqelEditPage-7OFWPULE.js.map} +1 -1
  3. package/dist/ArqelIndexPage-ZAVCCM6V.js +14 -0
  4. package/dist/{ArqelIndexPage-J2EUV2PI.js.map → ArqelIndexPage-ZAVCCM6V.js.map} +1 -1
  5. package/dist/ArqelNotificationsPage-MBJBYFHW.js +6 -0
  6. package/dist/ArqelNotificationsPage-MBJBYFHW.js.map +1 -0
  7. package/dist/{UserMenu-B5XbC_Gy.d.ts → UserMenu-QlwvvZRU.d.ts} +2 -1
  8. package/dist/action.js +2 -1
  9. package/dist/{chunk-SK6H7ARE.js → chunk-3E66JNQO.js} +3 -18
  10. package/dist/chunk-3E66JNQO.js.map +1 -0
  11. package/dist/chunk-53J74IYR.js +22 -0
  12. package/dist/chunk-53J74IYR.js.map +1 -0
  13. package/dist/chunk-6YGRTXEL.js +87 -0
  14. package/dist/chunk-6YGRTXEL.js.map +1 -0
  15. package/dist/{chunk-SLLTFOOS.js → chunk-7NGUPQON.js} +5 -192
  16. package/dist/chunk-7NGUPQON.js.map +1 -0
  17. package/dist/chunk-CH7YLELO.js +137 -0
  18. package/dist/chunk-CH7YLELO.js.map +1 -0
  19. package/dist/{chunk-K7QY56XN.js → chunk-D2MUCHFN.js} +5 -119
  20. package/dist/chunk-D2MUCHFN.js.map +1 -0
  21. package/dist/chunk-DO3PRGVV.js +198 -0
  22. package/dist/chunk-DO3PRGVV.js.map +1 -0
  23. package/dist/{chunk-X4ZFKOPX.js → chunk-DOQUHQND.js} +4 -4
  24. package/dist/{chunk-X4ZFKOPX.js.map → chunk-DOQUHQND.js.map} +1 -1
  25. package/dist/{chunk-X2X6YDOX.js → chunk-EXA6DWLB.js} +11 -3
  26. package/dist/chunk-EXA6DWLB.js.map +1 -0
  27. package/dist/{chunk-S5UNPCMQ.js → chunk-JKD6SE75.js} +3 -269
  28. package/dist/chunk-JKD6SE75.js.map +1 -0
  29. package/dist/{chunk-EG2DASKR.js → chunk-KGAY2AZH.js} +4 -3
  30. package/dist/chunk-KGAY2AZH.js.map +1 -0
  31. package/dist/chunk-U4MPY2XT.js +91 -0
  32. package/dist/chunk-U4MPY2XT.js.map +1 -0
  33. package/dist/chunk-WKIYS2FQ.js +509 -0
  34. package/dist/chunk-WKIYS2FQ.js.map +1 -0
  35. package/dist/chunk-XK2P6CSK.js +8 -0
  36. package/dist/chunk-XK2P6CSK.js.map +1 -0
  37. package/dist/chunk-YEPQWAD6.js +275 -0
  38. package/dist/chunk-YEPQWAD6.js.map +1 -0
  39. package/dist/index.d.ts +1 -1
  40. package/dist/index.js +11 -7
  41. package/dist/pages.d.ts +26 -1
  42. package/dist/pages.js +14 -8
  43. package/dist/pages.js.map +1 -1
  44. package/dist/primitives.js +3 -2
  45. package/dist/resource.js +3 -2
  46. package/dist/shell.d.ts +37 -3
  47. package/dist/shell.js +166 -7
  48. package/dist/shell.js.map +1 -1
  49. package/dist/table.js +2 -1
  50. package/dist/utility.js +2 -1
  51. package/dist/utils.d.ts +16 -1
  52. package/dist/utils.js +1 -0
  53. package/package.json +6 -6
  54. package/dist/ArqelEditPage-RRYFYOTC.js +0 -8
  55. package/dist/ArqelIndexPage-J2EUV2PI.js +0 -12
  56. package/dist/chunk-EG2DASKR.js.map +0 -1
  57. package/dist/chunk-K7QY56XN.js.map +0 -1
  58. package/dist/chunk-R4BOUU6Y.js +0 -55
  59. package/dist/chunk-R4BOUU6Y.js.map +0 -1
  60. package/dist/chunk-S5UNPCMQ.js.map +0 -1
  61. package/dist/chunk-SK6H7ARE.js.map +0 -1
  62. package/dist/chunk-SLLTFOOS.js.map +0 -1
  63. package/dist/chunk-X2X6YDOX.js.map +0 -1
  64. package/dist/chunk-YQ6KXR3U.js +0 -55
  65. package/dist/chunk-YQ6KXR3U.js.map +0 -1
@@ -0,0 +1,137 @@
1
+ import { Card } from './chunk-6YGRTXEL.js';
2
+ import { Button } from './chunk-H23VX3RR.js';
3
+ import { cn } from './chunk-B7ULUJVO.js';
4
+ import { useArqelTranslations } from '@arqel-dev/react/utils';
5
+ import { usePage, Link, router } from '@inertiajs/react';
6
+ import { jsxs, jsx } from 'react/jsx-runtime';
7
+
8
+ function readTitle(item) {
9
+ const title = item.data["title"];
10
+ if (typeof title === "string" && title.trim()) return title;
11
+ return item.type;
12
+ }
13
+ function readBody(item) {
14
+ const body = item.data["body"] ?? item.data["message"];
15
+ return typeof body === "string" && body.trim() ? body : void 0;
16
+ }
17
+ function markRead(id) {
18
+ router.post(
19
+ `/admin/notifications/${id}/read`,
20
+ {},
21
+ { preserveScroll: true, only: ["history", "notifications"] }
22
+ );
23
+ }
24
+ function markAllRead() {
25
+ router.post(
26
+ "/admin/notifications/read-all",
27
+ {},
28
+ { preserveScroll: true, only: ["history", "notifications"] }
29
+ );
30
+ }
31
+ function destroy(id) {
32
+ router.delete(`/admin/notifications/${id}`, { preserveScroll: true });
33
+ }
34
+ function decodePaginationLabel(label) {
35
+ return label.replace(/«/g, "\xAB").replace(/»/g, "\xBB");
36
+ }
37
+ function ArqelNotificationsPage() {
38
+ const t = useArqelTranslations();
39
+ const { history, filter } = usePage().props;
40
+ const items = history.data;
41
+ const hasUnread = items.some((item) => item.read_at === null);
42
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4 p-4", children: [
43
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [
44
+ /* @__PURE__ */ jsx("h1", { className: "text-lg font-semibold", children: t("arqel.notifications.title", "Notifications") }),
45
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
46
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm", children: [
47
+ /* @__PURE__ */ jsx(
48
+ Link,
49
+ {
50
+ href: "/admin/notifications?filter=all",
51
+ className: cn(
52
+ "rounded-sm px-2 py-1",
53
+ filter === "all" ? "bg-accent font-medium text-accent-foreground" : "text-muted-foreground hover:text-foreground"
54
+ ),
55
+ children: t("arqel.notifications.filter_all", "All")
56
+ }
57
+ ),
58
+ /* @__PURE__ */ jsx(
59
+ Link,
60
+ {
61
+ href: "/admin/notifications?filter=unread",
62
+ className: cn(
63
+ "rounded-sm px-2 py-1",
64
+ filter === "unread" ? "bg-accent font-medium text-accent-foreground" : "text-muted-foreground hover:text-foreground"
65
+ ),
66
+ children: t("arqel.notifications.filter_unread", "Unread")
67
+ }
68
+ )
69
+ ] }),
70
+ hasUnread && /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: markAllRead, children: t("arqel.notifications.mark_all_read", "Mark all as read") })
71
+ ] })
72
+ ] }),
73
+ items.length === 0 ? /* @__PURE__ */ jsx(Card, { className: "p-6 text-center text-sm text-muted-foreground", children: t("arqel.notifications.empty", "No notifications") }) : /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: items.map((item) => {
74
+ const title = readTitle(item);
75
+ const body = readBody(item);
76
+ const unread = item.read_at === null;
77
+ return /* @__PURE__ */ jsxs(
78
+ Card,
79
+ {
80
+ className: cn(
81
+ "flex flex-row items-start justify-between gap-4 p-4",
82
+ unread && "bg-accent/50"
83
+ ),
84
+ children: [
85
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-start gap-2", children: [
86
+ /* @__PURE__ */ jsx(
87
+ "span",
88
+ {
89
+ "aria-hidden": "true",
90
+ className: cn(
91
+ "mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full",
92
+ unread ? "bg-primary" : "bg-transparent"
93
+ )
94
+ }
95
+ ),
96
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
97
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: title }),
98
+ body && /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: body }),
99
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: item.created_at })
100
+ ] })
101
+ ] }),
102
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
103
+ unread && /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", onClick: () => markRead(item.id), children: t("arqel.notifications.mark_read", "Mark as read") }),
104
+ /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: () => destroy(item.id), children: t("arqel.notifications.delete", "Delete") })
105
+ ] })
106
+ ]
107
+ },
108
+ item.id
109
+ );
110
+ }) }),
111
+ history.links.length > 0 && /* @__PURE__ */ jsx(
112
+ "nav",
113
+ {
114
+ className: "flex flex-wrap items-center gap-1 text-sm",
115
+ "aria-label": t("table.pagination.label", "Pagination"),
116
+ children: history.links.map(
117
+ (link) => link.url ? /* @__PURE__ */ jsx(
118
+ Link,
119
+ {
120
+ href: link.url,
121
+ className: cn(
122
+ "rounded-sm px-2 py-1",
123
+ link.active ? "bg-accent font-medium text-accent-foreground" : "text-muted-foreground hover:text-foreground"
124
+ ),
125
+ children: decodePaginationLabel(link.label)
126
+ },
127
+ link.url
128
+ ) : /* @__PURE__ */ jsx("span", { className: "rounded-sm px-2 py-1 text-muted-foreground/50", children: decodePaginationLabel(link.label) }, link.label)
129
+ )
130
+ }
131
+ )
132
+ ] });
133
+ }
134
+
135
+ export { ArqelNotificationsPage };
136
+ //# sourceMappingURL=chunk-CH7YLELO.js.map
137
+ //# sourceMappingURL=chunk-CH7YLELO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/pages/ArqelNotificationsPage.tsx"],"names":[],"mappings":";;;;;;;AAiDA,SAAS,UAAU,IAAA,EAAgC;AACjD,EAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,IAAA,CAAK,OAAO,CAAA;AAC/B,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,CAAM,IAAA,IAAQ,OAAO,KAAA;AACtD,EA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AEJ;AAAA;AACF,GAAA,EAEJ,CAAA;AAEJ","file":"chunk-CH7YLELO.js","sourcesContent":["/**\n * Default Inertia page for `arqel::notifications`.\n *\n * Renders the paginated notification history emitted by\n * `Arqel\\Core\\Http\\Controllers\\NotificationController::index`\n * (`{ history: paginator, filter: 'all' | 'unread' }`). The page-prop\n * is named `history` — *not* `notifications` — because `notifications`\n * is already a shared Inertia prop (`{unread_count, recent}`, see\n * `HandleArqelInertiaRequests`) consumed by the `<NotificationBell>`\n * mounted on every page's topbar. Reusing that key here would let this\n * page's paginator silently overwrite the shared prop and break the\n * bell (see branch review, milestone 0.19).\n *\n * The paginator serializes each item as `{id, type, data, read_at,\n * created_at}` — same shape as the `notifications.recent` array the\n * `<NotificationBell>` dropdown consumes, so titles/bodies follow the\n * same `data.title` / `data.body` convention.\n *\n * Per-item actions do scoped Inertia visits (`only: ['history']` for\n * mark-as-read, a plain reload for delete) so the list refreshes\n * without a full page navigation.\n */\n\nimport { useArqelTranslations } from '@arqel-dev/react/utils';\nimport type { NotificationItem } from '@arqel-dev/types/inertia';\nimport { Link, router, usePage } from '@inertiajs/react';\nimport type { JSX } from 'react';\nimport { Button } from '../action/Button.js';\nimport { Card } from '../shadcn/ui/card.js';\nimport { cn } from '../utils/cn.js';\n\ninterface LaravelPaginationLink {\n url: string | null;\n label: string;\n active: boolean;\n}\n\ninterface NotificationsPaginator {\n data: NotificationItem[];\n links: LaravelPaginationLink[];\n meta: Record<string, unknown>;\n}\n\ninterface ArqelNotificationsPageProps {\n history: NotificationsPaginator;\n filter: 'all' | 'unread';\n [key: string]: unknown;\n}\n\nfunction readTitle(item: NotificationItem): string {\n const title = item.data['title'];\n if (typeof title === 'string' && title.trim()) return title;\n return item.type;\n}\n\nfunction readBody(item: NotificationItem): string | undefined {\n const body = item.data['body'] ?? item.data['message'];\n return typeof body === 'string' && body.trim() ? body : undefined;\n}\n\nfunction markRead(id: string): void {\n router.post(\n `/admin/notifications/${id}/read`,\n {},\n { preserveScroll: true, only: ['history', 'notifications'] },\n );\n}\n\nfunction markAllRead(): void {\n router.post(\n '/admin/notifications/read-all',\n {},\n { preserveScroll: true, only: ['history', 'notifications'] },\n );\n}\n\nfunction destroy(id: string): void {\n router.delete(`/admin/notifications/${id}`, { preserveScroll: true });\n}\n\n/**\n * Laravel's paginator emits prev/next labels as HTML entities\n * (`&laquo; Previous`, `Next &raquo;`). Decode the small, known set we\n * expect rather than reaching for `dangerouslySetInnerHTML` — the\n * labels are server-controlled but there is no reason to accept\n * arbitrary markup here.\n */\nfunction decodePaginationLabel(label: string): string {\n return label.replace(/&laquo;/g, '«').replace(/&raquo;/g, '»');\n}\n\nexport default function ArqelNotificationsPage(): JSX.Element {\n const t = useArqelTranslations();\n const { history, filter } = usePage<ArqelNotificationsPageProps>().props;\n\n const items = history.data;\n const hasUnread = items.some((item) => item.read_at === null);\n\n return (\n <div className=\"flex flex-col gap-4 p-4\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <h1 className=\"text-lg font-semibold\">{t('arqel.notifications.title', 'Notifications')}</h1>\n <div className=\"flex items-center gap-2\">\n <div className=\"flex items-center gap-1 text-sm\">\n <Link\n href=\"/admin/notifications?filter=all\"\n className={cn(\n 'rounded-sm px-2 py-1',\n filter === 'all'\n ? 'bg-accent font-medium text-accent-foreground'\n : 'text-muted-foreground hover:text-foreground',\n )}\n >\n {t('arqel.notifications.filter_all', 'All')}\n </Link>\n <Link\n href=\"/admin/notifications?filter=unread\"\n className={cn(\n 'rounded-sm px-2 py-1',\n filter === 'unread'\n ? 'bg-accent font-medium text-accent-foreground'\n : 'text-muted-foreground hover:text-foreground',\n )}\n >\n {t('arqel.notifications.filter_unread', 'Unread')}\n </Link>\n </div>\n {hasUnread && (\n <Button variant=\"outline\" size=\"sm\" onClick={markAllRead}>\n {t('arqel.notifications.mark_all_read', 'Mark all as read')}\n </Button>\n )}\n </div>\n </div>\n\n {items.length === 0 ? (\n <Card className=\"p-6 text-center text-sm text-muted-foreground\">\n {t('arqel.notifications.empty', 'No notifications')}\n </Card>\n ) : (\n <div className=\"flex flex-col gap-2\">\n {items.map((item) => {\n const title = readTitle(item);\n const body = readBody(item);\n const unread = item.read_at === null;\n\n return (\n <Card\n key={item.id}\n className={cn(\n 'flex flex-row items-start justify-between gap-4 p-4',\n unread && 'bg-accent/50',\n )}\n >\n <div className=\"flex min-w-0 flex-1 items-start gap-2\">\n <span\n aria-hidden=\"true\"\n className={cn(\n 'mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full',\n unread ? 'bg-primary' : 'bg-transparent',\n )}\n />\n <div className=\"flex min-w-0 flex-col\">\n <span className=\"font-medium\">{title}</span>\n {body && <span className=\"text-sm text-muted-foreground\">{body}</span>}\n <span className=\"text-xs text-muted-foreground\">{item.created_at}</span>\n </div>\n </div>\n <div className=\"flex shrink-0 items-center gap-2\">\n {unread && (\n <Button variant=\"outline\" size=\"sm\" onClick={() => markRead(item.id)}>\n {t('arqel.notifications.mark_read', 'Mark as read')}\n </Button>\n )}\n <Button variant=\"ghost\" size=\"sm\" onClick={() => destroy(item.id)}>\n {t('arqel.notifications.delete', 'Delete')}\n </Button>\n </div>\n </Card>\n );\n })}\n </div>\n )}\n\n {history.links.length > 0 && (\n <nav\n className=\"flex flex-wrap items-center gap-1 text-sm\"\n aria-label={t('table.pagination.label', 'Pagination')}\n >\n {history.links.map((link) =>\n link.url ? (\n <Link\n key={link.url}\n href={link.url}\n className={cn(\n 'rounded-sm px-2 py-1',\n link.active\n ? 'bg-accent font-medium text-accent-foreground'\n : 'text-muted-foreground hover:text-foreground',\n )}\n >\n {decodePaginationLabel(link.label)}\n </Link>\n ) : (\n <span key={link.label} className=\"rounded-sm px-2 py-1 text-muted-foreground/50\">\n {decodePaginationLabel(link.label)}\n </span>\n ),\n )}\n </nav>\n )}\n </div>\n );\n}\n"]}
@@ -1,10 +1,10 @@
1
- import { Separator } from './chunk-R4BOUU6Y.js';
1
+ import { Separator } from './chunk-U4MPY2XT.js';
2
2
  import { cn } from './chunk-B7ULUJVO.js';
3
3
  import { useMemo } from 'react';
4
4
  import { cva } from 'class-variance-authority';
5
5
  import { jsx, jsxs } from 'react/jsx-runtime';
6
- import { Slot, Checkbox as Checkbox$1, Label as Label$1, Select as Select$1 } from 'radix-ui';
7
6
  import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
7
+ import { Checkbox as Checkbox$1, Label as Label$1, Select as Select$1 } from 'radix-ui';
8
8
 
9
9
  var alertVariants = cva(
10
10
  "relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
@@ -64,120 +64,6 @@ function AlertDescription({
64
64
  }
65
65
  );
66
66
  }
67
- var badgeVariants = cva(
68
- "inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
69
- {
70
- variants: {
71
- variant: {
72
- default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
73
- secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
74
- destructive: "bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
75
- outline: "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
76
- ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
77
- link: "text-primary underline-offset-4 [a&]:hover:underline"
78
- }
79
- },
80
- defaultVariants: {
81
- variant: "default"
82
- }
83
- }
84
- );
85
- function Badge({
86
- className,
87
- variant = "default",
88
- asChild = false,
89
- ...props
90
- }) {
91
- const Comp = asChild ? Slot.Root : "span";
92
- return /* @__PURE__ */ jsx(
93
- Comp,
94
- {
95
- "data-slot": "badge",
96
- "data-variant": variant,
97
- className: cn(badgeVariants({ variant }), className),
98
- ...props
99
- }
100
- );
101
- }
102
- function Card({ className, ...props }) {
103
- return /* @__PURE__ */ jsx(
104
- "div",
105
- {
106
- "data-slot": "card",
107
- className: cn(
108
- "flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",
109
- className
110
- ),
111
- ...props
112
- }
113
- );
114
- }
115
- function CardHeader({ className, ...props }) {
116
- return /* @__PURE__ */ jsx(
117
- "div",
118
- {
119
- "data-slot": "card-header",
120
- className: cn(
121
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
122
- className
123
- ),
124
- ...props
125
- }
126
- );
127
- }
128
- function CardTitle({ className, ...props }) {
129
- return /* @__PURE__ */ jsx(
130
- "div",
131
- {
132
- "data-slot": "card-title",
133
- className: cn("leading-none font-semibold", className),
134
- ...props
135
- }
136
- );
137
- }
138
- function CardDescription({ className, ...props }) {
139
- return /* @__PURE__ */ jsx(
140
- "div",
141
- {
142
- "data-slot": "card-description",
143
- className: cn("text-sm text-muted-foreground", className),
144
- ...props
145
- }
146
- );
147
- }
148
- function CardAction({ className, ...props }) {
149
- return /* @__PURE__ */ jsx(
150
- "div",
151
- {
152
- "data-slot": "card-action",
153
- className: cn(
154
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
155
- className
156
- ),
157
- ...props
158
- }
159
- );
160
- }
161
- function CardContent({ className, ...props }) {
162
- return /* @__PURE__ */ jsx(
163
- "div",
164
- {
165
- "data-slot": "card-content",
166
- className: cn("px-6", className),
167
- ...props
168
- }
169
- );
170
- }
171
- function CardFooter({ className, ...props }) {
172
- return /* @__PURE__ */ jsx(
173
- "div",
174
- {
175
- "data-slot": "card-footer",
176
- className: cn("flex items-center px-6 [.border-t]:pt-6", className),
177
- ...props
178
- }
179
- );
180
- }
181
67
  function Checkbox({
182
68
  className,
183
69
  ...props
@@ -605,6 +491,6 @@ function Textarea({ className, ...props }) {
605
491
  );
606
492
  }
607
493
 
608
- export { Alert, AlertDescription, AlertTitle, Badge, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Label, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Textarea, badgeVariants };
609
- //# sourceMappingURL=chunk-K7QY56XN.js.map
610
- //# sourceMappingURL=chunk-K7QY56XN.js.map
494
+ export { Alert, AlertDescription, AlertTitle, Checkbox, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Label, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Textarea };
495
+ //# sourceMappingURL=chunk-D2MUCHFN.js.map
496
+ //# sourceMappingURL=chunk-D2MUCHFN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/shadcn/ui/alert.tsx","../src/shadcn/ui/checkbox.tsx","../src/shadcn/ui/label.tsx","../src/shadcn/ui/field.tsx","../src/shadcn/ui/select.tsx","../src/shadcn/ui/textarea.tsx"],"names":["jsx","CheckboxPrimitive","LabelPrimitive","cva","SelectPrimitive","jsxs","CheckIcon"],"mappings":";;;;;;;;AAKA,IAAM,aAAA,GAAgB,GAAA;AAAA,EACpB,mOAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,8BAAA;AAAA,QACT,WAAA,EACE;AAAA;AACJ,KACF;AAAA,IACA,eAAA,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A,EAAU,QAAA,EAAS;AAAA;AAAA,GACpC;AAEJ;AAEA,SAAS,sBAAA,CAAuB;AAAA,EAC9B,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAkE;AAChE,EAAA,uBACEA,GAAAA;AAAA,IAACI,QAAA,CAAgB,gBAAA;AAAA,IAAhB;AAAA,MACC,WAAA,EAAU,2BAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,sDAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEJ,QAAA,kBAAAJ,GAAAA,CAAC,eAAA,EAAA,EAAgB,SAAA,EAAU,QAAA,EAAS;AAAA;AAAA,GACtC;AAEJ;AC5KA,SAAS,QAAA,CAAS,EAAE,SAAA,EAAW,GAAG,OAAM,EAAqC;AAC3E,EAAA,uBACEA,GAAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,UAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,qcAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-D2MUCHFN.js","sourcesContent":["import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/cn\"\n\nconst alertVariants = cva(\n \"relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current\",\n {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n destructive:\n \"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction Alert({\n className,\n variant,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof alertVariants>) {\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n )\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn(\n \"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction AlertDescription({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n \"col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Alert, AlertTitle, AlertDescription }\n","import * as React from \"react\"\nimport { CheckIcon } from \"lucide-react\"\nimport { Checkbox as CheckboxPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/utils/cn\"\n\nfunction Checkbox({\n className,\n ...props\n}: React.ComponentProps<typeof CheckboxPrimitive.Root>) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none\"\n >\n <CheckIcon className=\"size-3.5\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n","import * as React from \"react\"\nimport { Label as LabelPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/utils/cn\"\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n \"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Label }\n","import { useMemo } from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Label } from \"@/shadcn/ui/label\"\nimport { Separator } from \"@/shadcn/ui/separator\"\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"flex flex-col gap-6\",\n \"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"mb-3 font-medium\",\n \"data-[variant=legend]:text-base\",\n \"data-[variant=label]:text-sm\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4\",\n className\n )}\n {...props}\n />\n )\n}\n\nconst fieldVariants = cva(\n \"group/field flex w-full gap-3 data-[invalid=true]:text-destructive\",\n {\n variants: {\n orientation: {\n vertical: [\"flex-col [&>*]:w-full [&>.sr-only]:w-auto\"],\n horizontal: [\n \"flex-row items-center\",\n \"[&>[data-slot=field-label]]:flex-auto\",\n \"has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n responsive: [\n \"flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto\",\n \"@md/field-group:[&>[data-slot=field-label]]:flex-auto\",\n \"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n ],\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n }\n)\n\nfunction Field({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof fieldVariants>) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n )\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\n \"group/field-content flex flex-1 flex-col gap-1.5 leading-snug\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldLabel({\n className,\n ...props\n}: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n \"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50\",\n \"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4\",\n \"has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance\",\n \"last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5\",\n \"[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n children?: React.ReactNode\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2\",\n className\n )}\n {...props}\n >\n <Separator className=\"absolute inset-0 top-1/2\" />\n {children && (\n <span\n className=\"relative mx-auto block w-fit bg-background px-2 text-muted-foreground\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n )\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n errors?: Array<{ message?: string } | undefined>\n}) {\n const content = useMemo(() => {\n if (children) {\n return children\n }\n\n if (!errors?.length) {\n return null\n }\n\n const uniqueErrors = [\n ...new Map(errors.map((error) => [error?.message, error])).values(),\n ]\n\n if (uniqueErrors?.length == 1) {\n return uniqueErrors[0]?.message\n }\n\n return (\n <ul className=\"ml-4 flex list-disc flex-col gap-1\">\n {uniqueErrors.map(\n (error, index) =>\n error?.message && <li key={index}>{error.message}</li>\n )}\n </ul>\n )\n }, [children, errors])\n\n if (!content) {\n return null\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"text-sm font-normal text-destructive\", className)}\n {...props}\n >\n {content}\n </div>\n )\n}\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\"\nimport { Select as SelectPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/utils/cn\"\n\nfunction Select({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />\n}\n\nfunction SelectGroup({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />\n}\n\nfunction SelectValue({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: \"sm\" | \"default\"\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n )\n}\n\nfunction SelectContent({\n className,\n children,\n position = \"item-aligned\",\n align = \"center\",\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n \"relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n align={align}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn(\"px-2 py-1.5 text-xs text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"relative flex w-full 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 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className\n )}\n {...props}\n >\n <span\n data-slot=\"select-item-indicator\"\n className=\"absolute right-2 flex size-3.5 items-center justify-center\"\n >\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"pointer-events-none -mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n )\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n","import * as React from \"react\"\n\nimport { cn } from \"@/utils/cn\"\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Textarea }\n"]}
@@ -0,0 +1,198 @@
1
+ import { Button } from './chunk-H23VX3RR.js';
2
+ import { cn } from './chunk-B7ULUJVO.js';
3
+ import { useArqelTranslations } from '@arqel-dev/react/utils';
4
+ import { useState, useEffect } from 'react';
5
+ import { XIcon } from 'lucide-react';
6
+ import { Dialog as Dialog$1 } from 'radix-ui';
7
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
+
9
+ function Dialog({
10
+ ...props
11
+ }) {
12
+ return /* @__PURE__ */ jsx(Dialog$1.Root, { "data-slot": "dialog", ...props });
13
+ }
14
+ function DialogPortal({
15
+ ...props
16
+ }) {
17
+ return /* @__PURE__ */ jsx(Dialog$1.Portal, { "data-slot": "dialog-portal", ...props });
18
+ }
19
+ function DialogClose({
20
+ ...props
21
+ }) {
22
+ return /* @__PURE__ */ jsx(Dialog$1.Close, { "data-slot": "dialog-close", ...props });
23
+ }
24
+ function DialogOverlay({
25
+ className,
26
+ ...props
27
+ }) {
28
+ return /* @__PURE__ */ jsx(
29
+ Dialog$1.Overlay,
30
+ {
31
+ "data-slot": "dialog-overlay",
32
+ className: cn(
33
+ "fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
34
+ className
35
+ ),
36
+ ...props
37
+ }
38
+ );
39
+ }
40
+ function DialogContent({
41
+ className,
42
+ children,
43
+ showCloseButton = true,
44
+ ...props
45
+ }) {
46
+ return /* @__PURE__ */ jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
47
+ /* @__PURE__ */ jsx(DialogOverlay, {}),
48
+ /* @__PURE__ */ jsxs(
49
+ Dialog$1.Content,
50
+ {
51
+ "data-slot": "dialog-content",
52
+ className: cn(
53
+ "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",
54
+ className
55
+ ),
56
+ ...props,
57
+ children: [
58
+ children,
59
+ showCloseButton && /* @__PURE__ */ jsxs(
60
+ Dialog$1.Close,
61
+ {
62
+ "data-slot": "dialog-close",
63
+ className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
64
+ children: [
65
+ /* @__PURE__ */ jsx(XIcon, {}),
66
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
67
+ ]
68
+ }
69
+ )
70
+ ]
71
+ }
72
+ )
73
+ ] });
74
+ }
75
+ function DialogHeader({ className, ...props }) {
76
+ return /* @__PURE__ */ jsx(
77
+ "div",
78
+ {
79
+ "data-slot": "dialog-header",
80
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
81
+ ...props
82
+ }
83
+ );
84
+ }
85
+ function DialogFooter({
86
+ className,
87
+ showCloseButton = false,
88
+ children,
89
+ ...props
90
+ }) {
91
+ return /* @__PURE__ */ jsxs(
92
+ "div",
93
+ {
94
+ "data-slot": "dialog-footer",
95
+ className: cn(
96
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
97
+ className
98
+ ),
99
+ ...props,
100
+ children: [
101
+ children,
102
+ showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "outline", children: "Close" }) })
103
+ ]
104
+ }
105
+ );
106
+ }
107
+ function DialogTitle({
108
+ className,
109
+ ...props
110
+ }) {
111
+ return /* @__PURE__ */ jsx(
112
+ Dialog$1.Title,
113
+ {
114
+ "data-slot": "dialog-title",
115
+ className: cn("text-lg leading-none font-semibold", className),
116
+ ...props
117
+ }
118
+ );
119
+ }
120
+ function DialogDescription({
121
+ className,
122
+ ...props
123
+ }) {
124
+ return /* @__PURE__ */ jsx(
125
+ Dialog$1.Description,
126
+ {
127
+ "data-slot": "dialog-description",
128
+ className: cn("text-sm text-muted-foreground", className),
129
+ ...props
130
+ }
131
+ );
132
+ }
133
+ var COLOR_VARIANT = {
134
+ destructive: "destructive",
135
+ warning: "default",
136
+ info: "default"
137
+ };
138
+ function ConfirmDialog({
139
+ open,
140
+ onOpenChange,
141
+ config,
142
+ onConfirm,
143
+ processing = false
144
+ }) {
145
+ const t = useArqelTranslations();
146
+ const [typed, setTyped] = useState("");
147
+ useEffect(() => {
148
+ if (!open) setTyped("");
149
+ }, [open]);
150
+ const requiresText = config?.requiresText;
151
+ const submitDisabled = processing || requiresText !== void 0 && typed !== requiresText;
152
+ const variant = COLOR_VARIANT[config?.color ?? "destructive"];
153
+ const submitLabel = config?.submitLabel ?? (config?.color === "info" ? t("arqel.actions.confirm", "Confirm") : t("arqel.actions.delete", "Delete"));
154
+ const cancelLabel = config?.cancelLabel ?? t("arqel.actions.cancel", "Cancel");
155
+ return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange: (next) => onOpenChange(next), children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-[28rem]", showCloseButton: false, children: [
156
+ /* @__PURE__ */ jsxs(DialogHeader, { children: [
157
+ /* @__PURE__ */ jsx(DialogTitle, { children: config?.heading ?? t("arqel.messages.delete_confirm", "Are you sure?") }),
158
+ config?.description && /* @__PURE__ */ jsx(DialogDescription, { children: config.description })
159
+ ] }),
160
+ requiresText !== void 0 && /* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1 text-xs text-muted-foreground", children: [
161
+ /* @__PURE__ */ jsx("span", { children: (() => {
162
+ const [before, after] = t(
163
+ "arqel.messages.type_to_confirm",
164
+ "Type :value to confirm"
165
+ ).split(":value");
166
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
167
+ before,
168
+ /* @__PURE__ */ jsx("code", { className: "font-mono text-foreground", children: requiresText }),
169
+ after
170
+ ] });
171
+ })() }),
172
+ /* @__PURE__ */ jsx(
173
+ "input",
174
+ {
175
+ type: "text",
176
+ ref: (el) => el?.focus(),
177
+ value: typed,
178
+ onChange: (e) => setTyped(e.target.value),
179
+ onKeyDown: (e) => {
180
+ if (e.key === "Enter" && !submitDisabled) {
181
+ e.preventDefault();
182
+ onConfirm();
183
+ }
184
+ },
185
+ className: "h-9 rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
186
+ }
187
+ )
188
+ ] }),
189
+ /* @__PURE__ */ jsxs(DialogFooter, { children: [
190
+ /* @__PURE__ */ jsx(DialogClose, { asChild: true, children: /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", disabled: processing, children: cancelLabel }) }),
191
+ /* @__PURE__ */ jsx(Button, { type: "button", variant, disabled: submitDisabled, onClick: onConfirm, children: processing ? t("form.saving", "Working\u2026") : submitLabel })
192
+ ] })
193
+ ] }) });
194
+ }
195
+
196
+ export { ConfirmDialog, Dialog, DialogClose, DialogContent, DialogHeader, DialogTitle };
197
+ //# sourceMappingURL=chunk-DO3PRGVV.js.map
198
+ //# sourceMappingURL=chunk-DO3PRGVV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/shadcn/ui/dialog.tsx","../src/action/ConfirmDialog.tsx"],"names":["DialogPrimitive","jsx","jsxs"],"mappings":";;;;;;;;AAOA,SAAS,MAAA,CAAO;AAAA,EACd,GAAG;AACL,CAAA,EAAsD;AACpD,EAAA,2BAAQA,QAAA,CAAgB,IAAA,EAAh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A,GAAAA;AAAA,QAAC,OAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,MAAA;AAAA,UACL,GAAA,EAAK,CAAC,EAAA,KAAO,EAAA,EAAI,KAAA,EAAM;AAAA,UACvB,KAAA,EAAO,KAAA;AAAA,UACP,UAAU,CAAC,CAAA,KAAM,QAAA,CAAS,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,UACxC,SAAA,EAAW,CAAC,CAAA,KAAM;AAChB,YAAA,IAAI,CAAA,CAAE,GAAA,KAAQ,OAAA,IAAW,CAAC,cAAA,EAAgB;AACxC,cAAA,CAAA,CAAE,cAAA,EAAe;AACjB,cAAA,SAAA,EAAU;AAAA,YACZ;AAAA,UACF,CAAA;AAAA,UACA,SAAA,EAAU;AAAA;AAAA;AACZ,KAAA,EACF,CAAA;AAAA,oBAEFC,KAAC,YAAA,EAAA,EACC,QAAA,EAAA;AAAA,sBAAAD,GAAAA,CAAC,WAAA,EAAA,EAAY,OAAA,EAAO,IAAA,EAClB,0BAAAA,GAAAA,CAAC,MAAA,EAAA,EAAO,IAAA,EAAK,QAAA,EAAS,OAAA,EAAQ,OAAA,EAAQ,QAAA,EAAU,UAAA,EAC7C,uBACH,CAAA,EACF,CAAA;AAAA,sBACAA,GAAAA,CAAC,MAAA,EAAA,EAAO,IAAA,EAAK,UAAS,OAAA,EAAkB,QAAA,EAAU,cAAA,EAAgB,OAAA,EAAS,WACxE,QAAA,EAAA,UAAA,GAAa,CAAA,CAAE,aAAA,EAAe,eAAU,IAAI,WAAA,EAC/C;AAAA,KAAA,EACF;AAAA,GAAA,EACF,CAAA,EACF,CAAA;AAEJ","file":"chunk-DO3PRGVV.js","sourcesContent":["import * as React from \"react\"\nimport { XIcon } from \"lucide-react\"\nimport { Dialog as DialogPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/utils/cn\"\nimport { Button } from \"@/shadcn/ui/button\"\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showCloseButton?: boolean\n}) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n","/**\n * `<ConfirmDialog>` — confirmation modal driven by the shadcn (Radix) Dialog.\n *\n * Phase 1 supports the canonical `ConfirmationConfig`:\n * - heading / description\n * - color (destructive | warning | info) — drives submit button variant\n * - submit / cancel labels\n * - \"type to confirm\" via `requiresText` (submit stays disabled until\n * the typed value matches exactly)\n *\n * Keyboard: Escape cancels (Radix built-in dismiss); Enter inside the\n * type-to-confirm input fires confirm when the value matches.\n */\n\nimport { useArqelTranslations } from '@arqel-dev/react/utils';\nimport type { ConfirmationConfig } from '@arqel-dev/types/actions';\nimport { useEffect, useState } from 'react';\nimport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '../shadcn/ui/dialog.js';\nimport { Button, type ButtonProps } from './Button.js';\n\nexport interface ConfirmDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n config?: ConfirmationConfig | undefined;\n onConfirm: () => void;\n processing?: boolean;\n}\n\nconst COLOR_VARIANT: Record<NonNullable<ConfirmationConfig['color']>, ButtonProps['variant']> = {\n destructive: 'destructive',\n warning: 'default',\n info: 'default',\n};\n\nexport function ConfirmDialog({\n open,\n onOpenChange,\n config,\n onConfirm,\n processing = false,\n}: ConfirmDialogProps) {\n const t = useArqelTranslations();\n const [typed, setTyped] = useState('');\n\n useEffect(() => {\n if (!open) setTyped('');\n }, [open]);\n\n const requiresText = config?.requiresText;\n const submitDisabled = processing || (requiresText !== undefined && typed !== requiresText);\n const variant = COLOR_VARIANT[config?.color ?? 'destructive'];\n // Precedence: explicit config > shared translation > English fallback.\n const submitLabel =\n config?.submitLabel ??\n (config?.color === 'info'\n ? t('arqel.actions.confirm', 'Confirm')\n : t('arqel.actions.delete', 'Delete'));\n const cancelLabel = config?.cancelLabel ?? t('arqel.actions.cancel', 'Cancel');\n\n return (\n <Dialog open={open} onOpenChange={(next) => onOpenChange(next)}>\n <DialogContent className=\"sm:max-w-[28rem]\" showCloseButton={false}>\n <DialogHeader>\n <DialogTitle>\n {config?.heading ?? t('arqel.messages.delete_confirm', 'Are you sure?')}\n </DialogTitle>\n {config?.description && <DialogDescription>{config.description}</DialogDescription>}\n </DialogHeader>\n {requiresText !== undefined && (\n <label className=\"flex flex-col gap-1 text-xs text-muted-foreground\">\n <span>\n {(() => {\n // Render the required value as inline <code> while keeping the\n // surrounding prompt translatable: split the localized string on\n // its :value placeholder and splice the <code> element in.\n const [before, after] = t(\n 'arqel.messages.type_to_confirm',\n 'Type :value to confirm',\n ).split(':value');\n return (\n <>\n {before}\n <code className=\"font-mono text-foreground\">{requiresText}</code>\n {after}\n </>\n );\n })()}\n </span>\n <input\n type=\"text\"\n ref={(el) => el?.focus()}\n value={typed}\n onChange={(e) => setTyped(e.target.value)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' && !submitDisabled) {\n e.preventDefault();\n onConfirm();\n }\n }}\n className=\"h-9 rounded-md border border-input bg-background px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n </label>\n )}\n <DialogFooter>\n <DialogClose asChild>\n <Button type=\"button\" variant=\"ghost\" disabled={processing}>\n {cancelLabel}\n </Button>\n </DialogClose>\n <Button type=\"button\" variant={variant} disabled={submitDisabled} onClick={onConfirm}>\n {processing ? t('form.saving', 'Working…') : submitLabel}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n"]}
@@ -1,5 +1,5 @@
1
- import { ResourceIndex } from './chunk-EG2DASKR.js';
2
- import { ActionButton, ActionMenu } from './chunk-SLLTFOOS.js';
1
+ import { ResourceIndex } from './chunk-KGAY2AZH.js';
2
+ import { ActionButton, ActionMenu } from './chunk-7NGUPQON.js';
3
3
  import { usePage, router } from '@inertiajs/react';
4
4
  import { useMemo, useState, useRef, useEffect } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
@@ -201,5 +201,5 @@ function ArqelIndexPage() {
201
201
  }
202
202
 
203
203
  export { ArqelIndexPage };
204
- //# sourceMappingURL=chunk-X4ZFKOPX.js.map
205
- //# sourceMappingURL=chunk-X4ZFKOPX.js.map
204
+ //# sourceMappingURL=chunk-DOQUHQND.js.map
205
+ //# sourceMappingURL=chunk-DOQUHQND.js.map