@middag-io/react 0.33.0 → 0.35.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.
- package/README.md +28 -8
- package/dist-lib/base/shell/AuthShell.js +39 -0
- package/dist-lib/base/shell/BasicShell.js +207 -0
- package/dist-lib/base/shell/ImmersiveShell.js +55 -0
- package/dist-lib/base/shell/partials/InspectorContext.js +60 -0
- package/dist-lib/base/shell/partials/InspectorPanel.js +22 -0
- package/dist-lib/base/shell/partials/NavErrorBoundary.js +66 -0
- package/dist-lib/base/shell/partials/OverlayScreen.js +36 -0
- package/dist-lib/base/shell/partials/PageActionButton.js +4 -0
- package/dist-lib/base/theme/appearance.js +39 -0
- package/dist-lib/base/theme/host-layout-detector.js +39 -0
- package/dist-lib/base/theme/host-theme-detector.js +131 -0
- package/dist-lib/base/theme/sidebar-safelist.txt +20 -0
- package/dist-lib/base/theme/tailwind-theme.css +136 -0
- package/dist-lib/base/theme/theme-bridge.css +164 -0
- package/dist-lib/base/theme/theme-context.js +103 -0
- package/dist-lib/base/theme/themes/classic.css +174 -0
- package/dist-lib/base/theme/tokens.css +290 -0
- package/dist-lib/base/theme/useHostTheme.js +34 -0
- package/dist-lib/base/utils/clipboard.js +16 -0
- package/dist-lib/base/utils/conditions.js +13 -0
- package/dist-lib/base/utils/icon-registry.js +16 -0
- package/dist-lib/base/utils/icons.js +11 -0
- package/dist-lib/base/utils/interpolate.js +6 -0
- package/dist-lib/base/utils/register-default-icons.js +9 -0
- package/dist-lib/base/utils/storage.js +30 -0
- package/dist-lib/base/utils/time.js +59 -0
- package/dist-lib/chunks/subpath-BD_PKGUX.js +146 -0
- package/dist-lib/chunks/subpath-DLFO_UGQ.js +604 -0
- package/dist-lib/components/reui/accordion.js +43 -0
- package/dist-lib/components/reui/alert-dialog.js +101 -0
- package/dist-lib/components/reui/alert.js +55 -0
- package/dist-lib/components/reui/aspect-ratio.js +11 -0
- package/dist-lib/components/reui/autocomplete.js +170 -0
- package/dist-lib/components/reui/avatar.js +51 -0
- package/dist-lib/components/reui/badge.js +64 -0
- package/dist-lib/components/reui/breadcrumb.js +69 -0
- package/dist-lib/components/reui/button-group.js +38 -0
- package/dist-lib/components/reui/button.js +47 -0
- package/dist-lib/components/reui/calendar.js +89 -0
- package/dist-lib/components/reui/card.js +55 -0
- package/dist-lib/components/reui/carousel.js +110 -0
- package/dist-lib/components/reui/chart.js +130 -0
- package/dist-lib/components/reui/checkbox.js +20 -0
- package/dist-lib/components/reui/collapsible.js +23 -0
- package/dist-lib/components/reui/combobox.js +166 -0
- package/dist-lib/components/reui/command.js +85 -0
- package/dist-lib/components/reui/context-menu.js +121 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-filter.js +108 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-header.js +217 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-visibility.js +25 -0
- package/dist-lib/components/reui/data-grid/data-grid-pagination.js +132 -0
- package/dist-lib/components/reui/data-grid/data-grid-scroll-area.js +183 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd-rows.js +125 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd.js +130 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-virtual.js +156 -0
- package/dist-lib/components/reui/data-grid/data-grid-table.js +546 -0
- package/dist-lib/components/reui/data-grid/data-grid.js +113 -0
- package/dist-lib/components/reui/data-grid-pagination.js +131 -0
- package/dist-lib/components/reui/date-selector.js +642 -0
- package/dist-lib/components/reui/dialog.js +94 -0
- package/dist-lib/components/reui/drawer.js +77 -0
- package/dist-lib/components/reui/dropdown-menu.js +123 -0
- package/dist-lib/components/reui/empty.js +59 -0
- package/dist-lib/components/reui/field.js +115 -0
- package/dist-lib/components/reui/filters.js +873 -0
- package/dist-lib/components/reui/frame.js +97 -0
- package/dist-lib/components/reui/hover-card.js +31 -0
- package/dist-lib/components/reui/icon-placeholder.js +14 -0
- package/dist-lib/components/reui/index.js +18 -0
- package/dist-lib/components/reui/input-group.js +78 -0
- package/dist-lib/components/reui/input-otp.js +44 -0
- package/dist-lib/components/reui/input.js +14 -0
- package/dist-lib/components/reui/item.js +116 -0
- package/dist-lib/components/reui/kanban.js +316 -0
- package/dist-lib/components/reui/kbd.js +19 -0
- package/dist-lib/components/reui/label.js +14 -0
- package/dist-lib/components/reui/menubar.js +132 -0
- package/dist-lib/components/reui/native-select.js +37 -0
- package/dist-lib/components/reui/navigation-menu.js +80 -0
- package/dist-lib/components/reui/number-field.js +126 -0
- package/dist-lib/components/reui/pagination.js +78 -0
- package/dist-lib/components/reui/phone-input.js +124 -0
- package/dist-lib/components/reui/popover.js +55 -0
- package/dist-lib/components/reui/progress.js +20 -0
- package/dist-lib/components/reui/radio-group.js +27 -0
- package/dist-lib/components/reui/rating.js +81 -0
- package/dist-lib/components/reui/resizable.js +31 -0
- package/dist-lib/components/reui/scroll-area.js +36 -0
- package/dist-lib/components/reui/scrollspy.js +104 -0
- package/dist-lib/components/reui/select.js +97 -0
- package/dist-lib/components/reui/separator.js +17 -0
- package/dist-lib/components/reui/sheet.js +81 -0
- package/dist-lib/components/reui/sidebar.js +350 -0
- package/dist-lib/components/reui/skeleton.js +12 -0
- package/dist-lib/components/reui/slider.js +35 -0
- package/dist-lib/components/reui/sonner.js +28 -0
- package/dist-lib/components/reui/sortable.js +172 -0
- package/dist-lib/components/reui/spinner.js +14 -0
- package/dist-lib/components/reui/stepper.js +193 -0
- package/dist-lib/components/reui/svgs/claudeAiIcon.js +13 -0
- package/dist-lib/components/reui/svgs/gemini.js +257 -0
- package/dist-lib/components/reui/svgs/openai.js +10 -0
- package/dist-lib/components/reui/svgs/openaiDark.js +13 -0
- package/dist-lib/components/reui/switch.js +19 -0
- package/dist-lib/components/reui/table.js +66 -0
- package/dist-lib/components/reui/tabs.js +47 -0
- package/dist-lib/components/reui/textarea.js +13 -0
- package/dist-lib/components/reui/timeline.js +84 -0
- package/dist-lib/components/reui/toggle-group.js +48 -0
- package/dist-lib/components/reui/toggle.js +36 -0
- package/dist-lib/components/reui/tooltip.js +35 -0
- package/dist-lib/components/reui/tree.js +102 -0
- package/dist-lib/i18n/I18nProvider.js +23 -0
- package/dist-lib/i18n/host-resolver.js +10 -0
- package/dist-lib/i18n/instance.js +2 -0
- package/dist-lib/i18n/locales/en/ui.json +266 -0
- package/dist-lib/i18n/locales/en/validators.json +13 -0
- package/dist-lib/i18n/locales/pt-BR/ui.json +266 -0
- package/dist-lib/i18n/locales/pt-BR/validators.json +13 -0
- package/dist-lib/i18n/register-strings.js +7 -0
- package/dist-lib/i18n/render-label.js +13 -0
- package/dist-lib/i18n/resolve-field-error.js +10 -0
- package/dist-lib/i18n/useHostString.js +31 -0
- package/dist-lib/i18n/useTranslation.js +48 -0
- package/dist-lib/lib/actions/resolve-action-target.js +48 -0
- package/dist-lib/lib/hooks/use-copy-to-clipboard.js +18 -0
- package/dist-lib/lib/hooks/use-file-upload.js +171 -0
- package/dist-lib/lib/hooks/use-mobile.js +18 -0
- package/dist-lib/lib/portal-container.js +7 -0
- package/dist-lib/lib/utils.js +8 -0
- package/dist-lib/middag-react.css +1 -1
- package/package.json +41 -8
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { cva as n } from "class-variance-authority";
|
|
4
|
+
//#region src/components/reui/frame.tsx
|
|
5
|
+
var r = n([
|
|
6
|
+
"relative flex flex-col bg-muted/50 gap-0.75 p-0.75 rounded-(--frame-radius)",
|
|
7
|
+
"[--frame-radius:var(--radius-2xl)]",
|
|
8
|
+
"[--frame-panel-bg:var(--color-card)] [--frame-panel-border-color:var(--color-border)] [--frame-border-color:var(--color-border)]"
|
|
9
|
+
], {
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "border border-[var(--frame-border-color)] bg-clip-padding",
|
|
13
|
+
inverse: "[--frame-panel-bg:color-mix(in_oklch,var(--color-muted)_40%,transparent)] border border-[var(--frame-border-color)] bg-background bg-clip-padding",
|
|
14
|
+
ghost: ""
|
|
15
|
+
},
|
|
16
|
+
spacing: {
|
|
17
|
+
xs: "[--frame-panel-p:--spacing(2)] [--frame-panel-header-px:--spacing(2)] [--frame-panel-header-py:--spacing(1)] [--frame-panel-footer-px:--spacing(2)] [--frame-panel-footer-py:--spacing(1)]",
|
|
18
|
+
sm: "[--frame-panel-p:--spacing(3)] [--frame-panel-header-px:--spacing(3)] [--frame-panel-header-py:--spacing(2)] [--frame-panel-footer-px:--spacing(3)] [--frame-panel-footer-py:--spacing(2)]",
|
|
19
|
+
default: "[--frame-panel-p:--spacing(4)] [--frame-panel-header-px:--spacing(4)] [--frame-panel-header-py:--spacing(3)] [--frame-panel-footer-px:--spacing(4)] [--frame-panel-footer-py:--spacing(3)]",
|
|
20
|
+
lg: "[--frame-panel-p:--spacing(5)] [--frame-panel-header-px:--spacing(5)] [--frame-panel-header-py:--spacing(4)] [--frame-panel-footer-px:--spacing(5)] [--frame-panel-footer-py:--spacing(4)]"
|
|
21
|
+
},
|
|
22
|
+
stacked: {
|
|
23
|
+
true: [
|
|
24
|
+
"gap-0 *:has-[+[data-slot=frame-panel]]:rounded-b-none",
|
|
25
|
+
"*:has-[+[data-slot=frame-panel]]:before:hidden",
|
|
26
|
+
"*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:rounded-t-none",
|
|
27
|
+
"*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:border-t-0",
|
|
28
|
+
"[&:not(:has([data-slot=frame-panel-header]))_[data-slot=frame-panel]:is(:first-child)]:border-t-0"
|
|
29
|
+
],
|
|
30
|
+
false: [
|
|
31
|
+
"data-[spacing=sm]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-0.5",
|
|
32
|
+
"data-[spacing=default]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1",
|
|
33
|
+
"data-[spacing=lg]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-2"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
dense: {
|
|
37
|
+
true: "p-0 gap-0 border-[var(--frame-border-color)] [&_[data-slot=frame-panel]]:-mx-px [&_[data-slot=frame-panel]]:before:hidden [&_[data-slot=frame-panel]:last-child]:-mb-px",
|
|
38
|
+
false: ""
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: {
|
|
42
|
+
variant: "default",
|
|
43
|
+
spacing: "default",
|
|
44
|
+
stacked: !1,
|
|
45
|
+
dense: !1
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
function i({ className: n, variant: i, spacing: a, stacked: o, dense: s, ...c }) {
|
|
49
|
+
return /* @__PURE__ */ t("div", {
|
|
50
|
+
className: e(r({
|
|
51
|
+
variant: i,
|
|
52
|
+
spacing: a,
|
|
53
|
+
stacked: o,
|
|
54
|
+
dense: s
|
|
55
|
+
}), n),
|
|
56
|
+
"data-slot": "frame",
|
|
57
|
+
"data-spacing": a,
|
|
58
|
+
...c
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function a({ className: n, fit: r, ...i }) {
|
|
62
|
+
return /* @__PURE__ */ t("div", {
|
|
63
|
+
className: e("relative grow overflow-hidden rounded-(--frame-radius) border border-(--frame-panel-border-color) bg-(--frame-panel-bg) bg-clip-padding shadow-xs", "before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--frame-radius)-1px)] before:shadow-black/5", "dark:bg-clip-border dark:before:shadow-white/5", "p-(--frame-panel-p)", n),
|
|
64
|
+
"data-slot": "frame-panel",
|
|
65
|
+
...i
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function o({ className: n, ...r }) {
|
|
69
|
+
return /* @__PURE__ */ t("header", {
|
|
70
|
+
className: e("flex flex-col px-(--frame-panel-header-px) py-(--frame-panel-header-py)", n),
|
|
71
|
+
"data-slot": "frame-panel-header",
|
|
72
|
+
...r
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function s({ className: n, ...r }) {
|
|
76
|
+
return /* @__PURE__ */ t("div", {
|
|
77
|
+
className: e("text-sm font-semibold", n),
|
|
78
|
+
"data-slot": "frame-panel-title",
|
|
79
|
+
...r
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function c({ className: n, ...r }) {
|
|
83
|
+
return /* @__PURE__ */ t("div", {
|
|
84
|
+
className: e("text-muted-foreground text-sm", n),
|
|
85
|
+
"data-slot": "frame-panel-description",
|
|
86
|
+
...r
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function l({ className: n, ...r }) {
|
|
90
|
+
return /* @__PURE__ */ t("footer", {
|
|
91
|
+
className: e("flex flex-col gap-1 px-(--frame-panel-footer-px) py-(--frame-panel-footer-py)", n),
|
|
92
|
+
"data-slot": "frame-panel-footer",
|
|
93
|
+
...r
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { i as Frame, c as FrameDescription, l as FrameFooter, o as FrameHeader, a as FramePanel, s as FrameTitle, r as frameVariants };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { HoverCard as t } from "radix-ui";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/reui/hover-card.tsx
|
|
6
|
+
function r({ ...e }) {
|
|
7
|
+
return /* @__PURE__ */ n(t.Root, {
|
|
8
|
+
"data-slot": "hover-card",
|
|
9
|
+
...e
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function i({ ...e }) {
|
|
13
|
+
return /* @__PURE__ */ n(t.Trigger, {
|
|
14
|
+
"data-slot": "hover-card-trigger",
|
|
15
|
+
...e
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function a({ className: r, align: i = "center", sideOffset: a = 4, ...o }) {
|
|
19
|
+
return /* @__PURE__ */ n(t.Portal, {
|
|
20
|
+
"data-slot": "hover-card-portal",
|
|
21
|
+
children: /* @__PURE__ */ n(t.Content, {
|
|
22
|
+
"data-slot": "hover-card-content",
|
|
23
|
+
align: i,
|
|
24
|
+
sideOffset: a,
|
|
25
|
+
className: e("z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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", r),
|
|
26
|
+
...o
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { r as HoverCard, a as HoverCardContent, i as HoverCardTrigger };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import * as t from "lucide-react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/reui/icon-placeholder.tsx
|
|
5
|
+
function r({ lucide: r, tabler: i, hugeicons: a, phosphor: o, remixicon: s, className: c, ...l }) {
|
|
6
|
+
if (!r) return null;
|
|
7
|
+
let u = t[r];
|
|
8
|
+
return u ? /* @__PURE__ */ n(u, {
|
|
9
|
+
className: e("size-4", c),
|
|
10
|
+
...l
|
|
11
|
+
}) : null;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as IconPlaceholder };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Button as e, buttonVariants as t } from "./button.js";
|
|
2
|
+
import { AlertDialog as n, AlertDialogAction as r, AlertDialogCancel as i, AlertDialogContent as a, AlertDialogDescription as o, AlertDialogFooter as s, AlertDialogHeader as c, AlertDialogMedia as l, AlertDialogOverlay as u, AlertDialogPortal as d, AlertDialogTitle as f, AlertDialogTrigger as p } from "./alert-dialog.js";
|
|
3
|
+
import { Alert as m, AlertAction as h, AlertDescription as g, AlertTitle as _ } from "./alert.js";
|
|
4
|
+
import { Badge as v, badgeVariants as y } from "./badge.js";
|
|
5
|
+
import { Card as b, CardAction as x, CardContent as S, CardDescription as C, CardFooter as w, CardHeader as T, CardTitle as E } from "./card.js";
|
|
6
|
+
import { Collapsible as D, CollapsibleContent as O, CollapsibleTrigger as k } from "./collapsible.js";
|
|
7
|
+
import { Input as A } from "./input.js";
|
|
8
|
+
import { Textarea as j } from "./textarea.js";
|
|
9
|
+
import { Combobox as M, ComboboxChip as N, ComboboxChips as P, ComboboxChipsInput as F, ComboboxCollection as I, ComboboxContent as L, ComboboxEmpty as R, ComboboxGroup as z, ComboboxInput as B, ComboboxItem as V, ComboboxLabel as H, ComboboxList as U, ComboboxSeparator as W, ComboboxTrigger as G, ComboboxValue as K, useComboboxAnchor as q } from "./combobox.js";
|
|
10
|
+
import { Dialog as J, DialogClose as Y, DialogContent as X, DialogDescription as Z, DialogFooter as Q, DialogHeader as $, DialogOverlay as ee, DialogPortal as te, DialogTitle as ne, DialogTrigger as re } from "./dialog.js";
|
|
11
|
+
import { Select as ie, SelectContent as ae, SelectGroup as oe, SelectItem as se, SelectLabel as ce, SelectScrollDownButton as le, SelectScrollUpButton as ue, SelectSeparator as de, SelectTrigger as fe, SelectValue as pe } from "./select.js";
|
|
12
|
+
import { Skeleton as me } from "./skeleton.js";
|
|
13
|
+
import { Spinner as he } from "./spinner.js";
|
|
14
|
+
import { Empty as ge, EmptyContent as _e, EmptyDescription as ve, EmptyHeader as ye, EmptyMedia as be, EmptyTitle as xe } from "./empty.js";
|
|
15
|
+
import { Label as Se } from "./label.js";
|
|
16
|
+
import { Progress as Ce } from "./progress.js";
|
|
17
|
+
import { Switch as we } from "./switch.js";
|
|
18
|
+
export { m as Alert, h as AlertAction, g as AlertDescription, n as AlertDialog, r as AlertDialogAction, i as AlertDialogCancel, a as AlertDialogContent, o as AlertDialogDescription, s as AlertDialogFooter, c as AlertDialogHeader, l as AlertDialogMedia, u as AlertDialogOverlay, d as AlertDialogPortal, f as AlertDialogTitle, p as AlertDialogTrigger, _ as AlertTitle, v as Badge, e as Button, b as Card, x as CardAction, S as CardContent, C as CardDescription, w as CardFooter, T as CardHeader, E as CardTitle, D as Collapsible, O as CollapsibleContent, k as CollapsibleTrigger, M as Combobox, N as ComboboxChip, P as ComboboxChips, F as ComboboxChipsInput, I as ComboboxCollection, L as ComboboxContent, R as ComboboxEmpty, z as ComboboxGroup, B as ComboboxInput, V as ComboboxItem, H as ComboboxLabel, U as ComboboxList, W as ComboboxSeparator, G as ComboboxTrigger, K as ComboboxValue, J as Dialog, Y as DialogClose, X as DialogContent, Z as DialogDescription, Q as DialogFooter, $ as DialogHeader, ee as DialogOverlay, te as DialogPortal, ne as DialogTitle, re as DialogTrigger, ge as Empty, _e as EmptyContent, ve as EmptyDescription, ye as EmptyHeader, be as EmptyMedia, xe as EmptyTitle, A as Input, Se as Label, Ce as Progress, ie as Select, ae as SelectContent, oe as SelectGroup, se as SelectItem, ce as SelectLabel, le as SelectScrollDownButton, ue as SelectScrollUpButton, de as SelectSeparator, fe as SelectTrigger, pe as SelectValue, me as Skeleton, he as Spinner, we as Switch, j as Textarea, y as badgeVariants, t as buttonVariants, q as useComboboxAnchor };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Button as t } from "./button.js";
|
|
4
|
+
import { Input as n } from "./input.js";
|
|
5
|
+
import { Textarea as r } from "./textarea.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
8
|
+
import { cva as a } from "class-variance-authority";
|
|
9
|
+
//#region src/components/reui/input-group.tsx
|
|
10
|
+
function o({ className: t, ...n }) {
|
|
11
|
+
return /* @__PURE__ */ i("div", {
|
|
12
|
+
"data-slot": "input-group",
|
|
13
|
+
role: "group",
|
|
14
|
+
className: e("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30", "h-9 min-w-0 has-[>textarea]:h-auto", "has-[>[data-align=inline-start]]:[&>input]:pl-2", "has-[>[data-align=inline-end]]:[&>input]:pr-2", "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3", "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3", "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] 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-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40", t),
|
|
15
|
+
...n
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
var s = a("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", {
|
|
19
|
+
variants: { align: {
|
|
20
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
21
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
22
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
|
|
23
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"
|
|
24
|
+
} },
|
|
25
|
+
defaultVariants: { align: "inline-start" }
|
|
26
|
+
});
|
|
27
|
+
function c({ className: t, align: n = "inline-start", ...r }) {
|
|
28
|
+
return /* @__PURE__ */ i("div", {
|
|
29
|
+
role: "group",
|
|
30
|
+
"data-slot": "input-group-addon",
|
|
31
|
+
"data-align": n,
|
|
32
|
+
className: e(s({ align: n }), t),
|
|
33
|
+
onClick: (e) => {
|
|
34
|
+
e.target.closest("button") || e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
35
|
+
},
|
|
36
|
+
...r
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
var l = a("flex items-center gap-2 text-sm shadow-none", {
|
|
40
|
+
variants: { size: {
|
|
41
|
+
xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
|
|
42
|
+
sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
|
|
43
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
44
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
45
|
+
} },
|
|
46
|
+
defaultVariants: { size: "xs" }
|
|
47
|
+
});
|
|
48
|
+
function u({ className: n, type: r = "button", variant: a = "ghost", size: o = "xs", ...s }) {
|
|
49
|
+
return /* @__PURE__ */ i(t, {
|
|
50
|
+
type: r,
|
|
51
|
+
"data-size": o,
|
|
52
|
+
variant: a,
|
|
53
|
+
className: e(l({ size: o }), n),
|
|
54
|
+
...s
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function d({ className: t, ...n }) {
|
|
58
|
+
return /* @__PURE__ */ i("span", {
|
|
59
|
+
className: e("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", t),
|
|
60
|
+
...n
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function f({ className: t, ...r }) {
|
|
64
|
+
return /* @__PURE__ */ i(n, {
|
|
65
|
+
"data-slot": "input-group-control",
|
|
66
|
+
className: e("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent", t),
|
|
67
|
+
...r
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function p({ className: t, ...n }) {
|
|
71
|
+
return /* @__PURE__ */ i(r, {
|
|
72
|
+
"data-slot": "input-group-control",
|
|
73
|
+
className: e("flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent", t),
|
|
74
|
+
...n
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { o as InputGroup, c as InputGroupAddon, u as InputGroupButton, f as InputGroupInput, d as InputGroupText, p as InputGroupTextarea };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { MinusIcon as n } from "lucide-react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import { OTPInput as a, OTPInputContext as o } from "input-otp";
|
|
6
|
+
//#region src/components/reui/input-otp.tsx
|
|
7
|
+
function s({ className: t, containerClassName: n, ...i }) {
|
|
8
|
+
return /* @__PURE__ */ r(a, {
|
|
9
|
+
"data-slot": "input-otp",
|
|
10
|
+
containerClassName: e("flex items-center gap-2 has-disabled:opacity-50", n),
|
|
11
|
+
className: e("disabled:cursor-not-allowed", t),
|
|
12
|
+
...i
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function c({ className: t, ...n }) {
|
|
16
|
+
return /* @__PURE__ */ r("div", {
|
|
17
|
+
"data-slot": "input-otp-group",
|
|
18
|
+
className: e("flex items-center", t),
|
|
19
|
+
...n
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function l({ index: n, className: a, ...s }) {
|
|
23
|
+
let { char: c, hasFakeCaret: l, isActive: u } = t.useContext(o)?.slots[n] ?? {};
|
|
24
|
+
return /* @__PURE__ */ i("div", {
|
|
25
|
+
"data-slot": "input-otp-slot",
|
|
26
|
+
"data-active": u,
|
|
27
|
+
className: e("relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-[3px] data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", a),
|
|
28
|
+
...s,
|
|
29
|
+
children: [c, l && /* @__PURE__ */ r("div", {
|
|
30
|
+
className: "pointer-events-none absolute inset-0 flex items-center justify-center",
|
|
31
|
+
children: /* @__PURE__ */ r("div", { className: "h-4 w-px animate-caret-blink bg-foreground duration-1000" })
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function u({ ...e }) {
|
|
36
|
+
return /* @__PURE__ */ r("div", {
|
|
37
|
+
"data-slot": "input-otp-separator",
|
|
38
|
+
role: "separator",
|
|
39
|
+
...e,
|
|
40
|
+
children: /* @__PURE__ */ r(n, {})
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { s as InputOTP, c as InputOTPGroup, u as InputOTPSeparator, l as InputOTPSlot };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/reui/input.tsx
|
|
5
|
+
function n({ className: n, type: r, ...i }) {
|
|
6
|
+
return /* @__PURE__ */ t("input", {
|
|
7
|
+
type: r,
|
|
8
|
+
"data-slot": "input",
|
|
9
|
+
className: e("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground 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 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "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", n),
|
|
10
|
+
...i
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as Input };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Separator as t } from "./separator.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Slot as n } from "radix-ui";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
import { cva as i } from "class-variance-authority";
|
|
7
|
+
//#region src/components/reui/item.tsx
|
|
8
|
+
function a({ className: t, ...n }) {
|
|
9
|
+
return /* @__PURE__ */ r("div", {
|
|
10
|
+
role: "list",
|
|
11
|
+
"data-slot": "item-group",
|
|
12
|
+
className: e("group/item-group flex flex-col", t),
|
|
13
|
+
...n
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function o({ className: n, ...i }) {
|
|
17
|
+
return /* @__PURE__ */ r(t, {
|
|
18
|
+
"data-slot": "item-separator",
|
|
19
|
+
orientation: "horizontal",
|
|
20
|
+
className: e("my-0", n),
|
|
21
|
+
...i
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
var s = i("group/item flex flex-wrap items-center rounded-md border border-transparent text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-accent/50", {
|
|
25
|
+
variants: {
|
|
26
|
+
variant: {
|
|
27
|
+
default: "bg-transparent",
|
|
28
|
+
outline: "border-border",
|
|
29
|
+
muted: "bg-muted/50"
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
default: "gap-4 p-4",
|
|
33
|
+
sm: "gap-2.5 px-4 py-3"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: {
|
|
37
|
+
variant: "default",
|
|
38
|
+
size: "default"
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
function c({ className: t, variant: i = "default", size: a = "default", asChild: o = !1, ...c }) {
|
|
42
|
+
return /* @__PURE__ */ r(o ? n.Root : "div", {
|
|
43
|
+
"data-slot": "item",
|
|
44
|
+
"data-variant": i,
|
|
45
|
+
"data-size": a,
|
|
46
|
+
className: e(s({
|
|
47
|
+
variant: i,
|
|
48
|
+
size: a,
|
|
49
|
+
className: t
|
|
50
|
+
})),
|
|
51
|
+
...c
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
var l = i("flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none", {
|
|
55
|
+
variants: { variant: {
|
|
56
|
+
default: "bg-transparent",
|
|
57
|
+
icon: "size-8 rounded-sm border bg-muted [&_svg:not([class*='size-'])]:size-4",
|
|
58
|
+
image: "size-10 overflow-hidden rounded-sm [&_img]:size-full [&_img]:object-cover"
|
|
59
|
+
} },
|
|
60
|
+
defaultVariants: { variant: "default" }
|
|
61
|
+
});
|
|
62
|
+
function u({ className: t, variant: n = "default", ...i }) {
|
|
63
|
+
return /* @__PURE__ */ r("div", {
|
|
64
|
+
"data-slot": "item-media",
|
|
65
|
+
"data-variant": n,
|
|
66
|
+
className: e(l({
|
|
67
|
+
variant: n,
|
|
68
|
+
className: t
|
|
69
|
+
})),
|
|
70
|
+
...i
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function d({ className: t, ...n }) {
|
|
74
|
+
return /* @__PURE__ */ r("div", {
|
|
75
|
+
"data-slot": "item-content",
|
|
76
|
+
className: e("flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none", t),
|
|
77
|
+
...n
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function f({ className: t, ...n }) {
|
|
81
|
+
return /* @__PURE__ */ r("div", {
|
|
82
|
+
"data-slot": "item-title",
|
|
83
|
+
className: e("flex w-fit items-center gap-2 text-sm leading-snug font-medium", t),
|
|
84
|
+
...n
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function p({ className: t, ...n }) {
|
|
88
|
+
return /* @__PURE__ */ r("p", {
|
|
89
|
+
"data-slot": "item-description",
|
|
90
|
+
className: e("line-clamp-2 text-sm leading-normal font-normal text-balance text-muted-foreground", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", t),
|
|
91
|
+
...n
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function m({ className: t, ...n }) {
|
|
95
|
+
return /* @__PURE__ */ r("div", {
|
|
96
|
+
"data-slot": "item-actions",
|
|
97
|
+
className: e("flex items-center gap-2", t),
|
|
98
|
+
...n
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
function h({ className: t, ...n }) {
|
|
102
|
+
return /* @__PURE__ */ r("div", {
|
|
103
|
+
"data-slot": "item-header",
|
|
104
|
+
className: e("flex basis-full items-center justify-between gap-2", t),
|
|
105
|
+
...n
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function g({ className: t, ...n }) {
|
|
109
|
+
return /* @__PURE__ */ r("div", {
|
|
110
|
+
"data-slot": "item-footer",
|
|
111
|
+
className: e("flex basis-full items-center justify-between gap-2", t),
|
|
112
|
+
...n
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
export { c as Item, m as ItemActions, d as ItemContent, p as ItemDescription, g as ItemFooter, a as ItemGroup, h as ItemHeader, u as ItemMedia, o as ItemSeparator, f as ItemTitle };
|