@middag-io/react 0.32.0 → 0.34.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 +2 -2
- package/dist-lib/base/blocks/ActivityTimelineBlock.d.ts.map +1 -1
- 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.d.ts.map +1 -1
- 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/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/contracts/block-data/data-display.d.ts +8 -0
- package/dist-lib/contracts/block-data/data-display.d.ts.map +1 -1
- 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/dist-lib/middag-react.js +26 -5
- package/package.json +39 -7
- package/dist-lib/_redirects +0 -1
- package/dist-lib/api/example/moodle/get/books.json +0 -209
- package/dist-lib/api/example/moodle/get/dashboard.json +0 -203
- package/dist-lib/api/example/wordpress/get/products.json +0 -165
- package/dist-lib/api/index.json +0 -66
- package/dist-lib/api/inspector/connectors/canvas.json +0 -18
- package/dist-lib/api/inspector/connectors/moodle.json +0 -18
- package/dist-lib/api/inspector/connectors/n8n.json +0 -18
- package/dist-lib/api/inspector/connectors/open-edx.json +0 -18
- package/dist-lib/api/inspector/offerings/off-1.json +0 -18
- package/dist-lib/api/inspector/offerings/off-2.json +0 -18
- package/dist-lib/api/inspector/offerings/off-3.json +0 -18
- package/dist-lib/api/inspector/offerings/off-4.json +0 -18
- package/dist-lib/api/inspector/offerings/off-5.json +0 -18
- package/dist-lib/api/inspector/offerings/off-6.json +0 -17
- package/dist-lib/lottie/calendar/schedule-1.json +0 -1
- package/dist-lib/lottie/calendar/schedule-2.json +0 -1
- package/dist-lib/lottie/celebration/confetti-1.json +0 -1
- package/dist-lib/lottie/celebration/confetti-2.json +0 -1
- package/dist-lib/lottie/celebration/confetti-3.json +0 -1
- package/dist-lib/lottie/cloud/cloud-1.json +0 -1
- package/dist-lib/lottie/cloud/cloud-2.json +0 -1
- package/dist-lib/lottie/connection/network-1.json +0 -1
- package/dist-lib/lottie/connection/network-2.json +0 -1
- package/dist-lib/lottie/connection/network-3.json +0 -1
- package/dist-lib/lottie/dashboard/analytics-1.json +0 -1
- package/dist-lib/lottie/dashboard/analytics-2.json +0 -1
- package/dist-lib/lottie/dashboard/analytics-3.json +0 -1
- package/dist-lib/lottie/email/mail-1.json +0 -1
- package/dist-lib/lottie/email/mail-2.json +0 -1
- package/dist-lib/lottie/email/mail-3.json +0 -1
- package/dist-lib/lottie/empty-state/empty-1.json +0 -1
- package/dist-lib/lottie/empty-state/empty-2.json +0 -1
- package/dist-lib/lottie/empty-state/empty-3.json +0 -1
- package/dist-lib/lottie/error/warning-1.json +0 -1
- package/dist-lib/lottie/error/warning-2.json +0 -1
- package/dist-lib/lottie/error/warning-3.json +0 -1
- package/dist-lib/lottie/index.ts +0 -49
- package/dist-lib/lottie/loading/spinner-1.json +0 -1
- package/dist-lib/lottie/loading/spinner-2.json +0 -1
- package/dist-lib/lottie/loading/spinner-3.json +0 -1
- package/dist-lib/lottie/maintenance/construction-1.json +0 -1
- package/dist-lib/lottie/maintenance/construction-2.json +0 -1
- package/dist-lib/lottie/maintenance/construction-3.json +0 -1
- package/dist-lib/lottie/not-found/404-1.json +0 -1
- package/dist-lib/lottie/not-found/404-2.json +0 -1
- package/dist-lib/lottie/not-found/404-3.json +0 -1
- package/dist-lib/lottie/notification/bell-1.json +0 -1
- package/dist-lib/lottie/notification/bell-2.json +0 -1
- package/dist-lib/lottie/notification/bell-3.json +0 -1
- package/dist-lib/lottie/onboarding/welcome-1.json +0 -1
- package/dist-lib/lottie/onboarding/welcome-2.json +0 -1
- package/dist-lib/lottie/onboarding/welcome-3.json +0 -1
- package/dist-lib/lottie/payment/wallet-1.json +0 -1
- package/dist-lib/lottie/payment/wallet-2.json +0 -1
- package/dist-lib/lottie/payment/wallet-3.json +0 -1
- package/dist-lib/lottie/search/search-1.json +0 -1
- package/dist-lib/lottie/search/search-2.json +0 -1
- package/dist-lib/lottie/search/search-3.json +0 -1
- package/dist-lib/lottie/security/lock-1.json +0 -1
- package/dist-lib/lottie/security/lock-2.json +0 -1
- package/dist-lib/lottie/security/lock-3.json +0 -1
- package/dist-lib/lottie/settings/gear-1.json +0 -1
- package/dist-lib/lottie/settings/gear-2.json +0 -1
- package/dist-lib/lottie/settings/gear-3.json +0 -1
- package/dist-lib/lottie/success/check-1.json +0 -1
- package/dist-lib/lottie/success/check-2.json +0 -1
- package/dist-lib/lottie/success/check-3.json +0 -1
- package/dist-lib/lottie/upload/upload-1.json +0 -1
- package/dist-lib/lottie/upload/upload-2.json +0 -1
- package/dist-lib/lottie/upload/upload-3.json +0 -1
- package/dist-lib/lottie/user/profile-1.json +0 -1
- package/dist-lib/lottie/user/profile-2.json +0 -1
- package/dist-lib/lottie/user/profile-3.json +0 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Label as t } from "./label.js";
|
|
3
|
+
import { createContext as n, useContext as r, useId as i } from "react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { cva as s } from "class-variance-authority";
|
|
6
|
+
import { HugeiconsIcon as c } from "@hugeicons/react";
|
|
7
|
+
import { MinusSignIcon as l, PlusSignIcon as u } from "@hugeicons/core-free-icons";
|
|
8
|
+
import { NumberField as d } from "@base-ui/react/number-field";
|
|
9
|
+
//#region src/components/reui/number-field.tsx
|
|
10
|
+
var f = n(null), p = s("relative flex w-full justify-between border border-input data-disabled:pointer-events-none data-disabled:opacity-50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive focus-within:has-aria-invalid:border-destructive focus-within:has-aria-invalid:ring-destructive/20 dark:focus-within:has-aria-invalid:ring-destructive/40 rounded-4xl bg-input/30 transition-colors focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]", {
|
|
11
|
+
variants: { size: {
|
|
12
|
+
sm: "h-8 text-sm",
|
|
13
|
+
default: "h-9 text-sm",
|
|
14
|
+
lg: "h-10 text-sm"
|
|
15
|
+
} },
|
|
16
|
+
defaultVariants: { size: "default" }
|
|
17
|
+
}), m = s("relative flex shrink-0 cursor-pointer items-center justify-center transition-colors pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 hover:bg-accent", {
|
|
18
|
+
variants: { size: {
|
|
19
|
+
sm: "px-2 [&_svg:not([class*='size-'])]:size-3.5",
|
|
20
|
+
default: "px-2.5 [&_svg:not([class*='size-'])]:size-4",
|
|
21
|
+
lg: "px-3 [&_svg:not([class*='size-'])]:size-4"
|
|
22
|
+
} },
|
|
23
|
+
defaultVariants: { size: "default" }
|
|
24
|
+
}), h = s("w-full min-w-0 flex-1 bg-transparent text-center tabular-nums outline-none", {
|
|
25
|
+
variants: { size: {
|
|
26
|
+
sm: "px-2.5 py-1",
|
|
27
|
+
default: "px-3 py-1.5",
|
|
28
|
+
lg: "px-3.5 py-2"
|
|
29
|
+
} },
|
|
30
|
+
defaultVariants: { size: "default" }
|
|
31
|
+
});
|
|
32
|
+
function g({ id: t, className: n, size: r = "default", ...o }) {
|
|
33
|
+
let s = i(), c = t ?? s, l = r ?? "default";
|
|
34
|
+
return /* @__PURE__ */ a(f.Provider, {
|
|
35
|
+
value: {
|
|
36
|
+
fieldId: c,
|
|
37
|
+
size: l
|
|
38
|
+
},
|
|
39
|
+
children: /* @__PURE__ */ a(d.Root, {
|
|
40
|
+
className: e("flex w-full flex-col items-start gap-2", n),
|
|
41
|
+
"data-size": l,
|
|
42
|
+
"data-slot": "number-field",
|
|
43
|
+
id: c,
|
|
44
|
+
...o
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function _({ className: t, size: n, ...i }) {
|
|
49
|
+
let o = r(f);
|
|
50
|
+
if (!o) throw Error("NumberFieldGroup must be used within a NumberField component.");
|
|
51
|
+
let s = n ?? o.size;
|
|
52
|
+
return /* @__PURE__ */ a(d.Group, {
|
|
53
|
+
className: e(p({ size: s }), t),
|
|
54
|
+
"data-slot": "number-field-group",
|
|
55
|
+
...i
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function v({ className: t, size: n, children: i, ...o }) {
|
|
59
|
+
let s = r(f);
|
|
60
|
+
if (!s) throw Error("NumberFieldDecrement must be used within a NumberField component.");
|
|
61
|
+
let u = n ?? s.size;
|
|
62
|
+
return /* @__PURE__ */ a(d.Decrement, {
|
|
63
|
+
className: e(m({ size: u }), "rounded-s-4xl border-e-0", t),
|
|
64
|
+
"data-slot": "number-field-decrement",
|
|
65
|
+
...o,
|
|
66
|
+
children: i ?? /* @__PURE__ */ a(c, {
|
|
67
|
+
icon: l,
|
|
68
|
+
strokeWidth: 2
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function y({ className: t, size: n, children: i, ...o }) {
|
|
73
|
+
let s = r(f);
|
|
74
|
+
if (!s) throw Error("NumberFieldIncrement must be used within a NumberField component.");
|
|
75
|
+
let l = n ?? s.size;
|
|
76
|
+
return /* @__PURE__ */ a(d.Increment, {
|
|
77
|
+
className: e(m({ size: l }), "rounded-e-4xl border-s-0", t),
|
|
78
|
+
"data-slot": "number-field-increment",
|
|
79
|
+
...o,
|
|
80
|
+
children: i ?? /* @__PURE__ */ a(c, {
|
|
81
|
+
icon: u,
|
|
82
|
+
strokeWidth: 2
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function b({ className: t, size: n, ...i }) {
|
|
87
|
+
let o = r(f);
|
|
88
|
+
if (!o) throw Error("NumberFieldInput must be used within a NumberField component.");
|
|
89
|
+
let s = n ?? o.size;
|
|
90
|
+
return /* @__PURE__ */ a(d.Input, {
|
|
91
|
+
className: e(h({ size: s }), t),
|
|
92
|
+
"data-slot": "number-field-input",
|
|
93
|
+
...i
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function x({ className: n, label: i, ...s }) {
|
|
97
|
+
let c = r(f);
|
|
98
|
+
if (!c) throw Error("NumberFieldScrubArea must be used within a NumberField component for accessibility.");
|
|
99
|
+
return /* @__PURE__ */ o(d.ScrubArea, {
|
|
100
|
+
className: e("flex cursor-ew-resize", n),
|
|
101
|
+
"data-slot": "number-field-scrub-area",
|
|
102
|
+
...s,
|
|
103
|
+
children: [/* @__PURE__ */ a(t, {
|
|
104
|
+
className: "cursor-ew-resize",
|
|
105
|
+
htmlFor: c.fieldId,
|
|
106
|
+
children: i
|
|
107
|
+
}), /* @__PURE__ */ a(d.ScrubAreaCursor, {
|
|
108
|
+
className: "drop-shadow-[0_1px_1px_#0008] filter",
|
|
109
|
+
children: /* @__PURE__ */ a(S, {})
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function S(e) {
|
|
114
|
+
return /* @__PURE__ */ a("svg", {
|
|
115
|
+
fill: "black",
|
|
116
|
+
height: "14",
|
|
117
|
+
stroke: "white",
|
|
118
|
+
viewBox: "0 0 24 14",
|
|
119
|
+
width: "26",
|
|
120
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
121
|
+
...e,
|
|
122
|
+
children: /* @__PURE__ */ a("path", { d: "M19.5 5.5L6.49737 5.51844V2L1 6.9999L6.5 12L6.49737 8.5L19.5 8.5V12L25 6.9999L19.5 2V5.5Z" })
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
//#endregion
|
|
126
|
+
export { g as NumberField, v as NumberFieldDecrement, _ as NumberFieldGroup, y as NumberFieldIncrement, b as NumberFieldInput, x as NumberFieldScrubArea };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { buttonVariants as t } from "./button.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { ChevronLeftIcon as n, ChevronRightIcon as r, MoreHorizontalIcon as i } from "lucide-react";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/reui/pagination.tsx
|
|
7
|
+
function s({ className: t, ...n }) {
|
|
8
|
+
return /* @__PURE__ */ a("nav", {
|
|
9
|
+
role: "navigation",
|
|
10
|
+
"aria-label": "pagination",
|
|
11
|
+
"data-slot": "pagination",
|
|
12
|
+
className: e("mx-auto flex w-full justify-center", t),
|
|
13
|
+
...n
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function c({ className: t, ...n }) {
|
|
17
|
+
return /* @__PURE__ */ a("ul", {
|
|
18
|
+
"data-slot": "pagination-content",
|
|
19
|
+
className: e("flex flex-row items-center gap-1", t),
|
|
20
|
+
...n
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function l({ ...e }) {
|
|
24
|
+
return /* @__PURE__ */ a("li", {
|
|
25
|
+
"data-slot": "pagination-item",
|
|
26
|
+
...e
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function u({ className: n, isActive: r, size: i = "icon", ...o }) {
|
|
30
|
+
return /* @__PURE__ */ a("a", {
|
|
31
|
+
"aria-current": r ? "page" : void 0,
|
|
32
|
+
"data-slot": "pagination-link",
|
|
33
|
+
"data-active": r,
|
|
34
|
+
className: e(t({
|
|
35
|
+
variant: r ? "outline" : "ghost",
|
|
36
|
+
size: i
|
|
37
|
+
}), n),
|
|
38
|
+
...o
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function d({ className: t, ...r }) {
|
|
42
|
+
return /* @__PURE__ */ o(u, {
|
|
43
|
+
"aria-label": "Go to previous page",
|
|
44
|
+
size: "default",
|
|
45
|
+
className: e("gap-1 px-2.5 sm:pl-2.5", t),
|
|
46
|
+
...r,
|
|
47
|
+
children: [/* @__PURE__ */ a(n, {}), /* @__PURE__ */ a("span", {
|
|
48
|
+
className: "hidden sm:block",
|
|
49
|
+
children: "Previous"
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function f({ className: t, ...n }) {
|
|
54
|
+
return /* @__PURE__ */ o(u, {
|
|
55
|
+
"aria-label": "Go to next page",
|
|
56
|
+
size: "default",
|
|
57
|
+
className: e("gap-1 px-2.5 sm:pr-2.5", t),
|
|
58
|
+
...n,
|
|
59
|
+
children: [/* @__PURE__ */ a("span", {
|
|
60
|
+
className: "hidden sm:block",
|
|
61
|
+
children: "Next"
|
|
62
|
+
}), /* @__PURE__ */ a(r, {})]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function p({ className: t, ...n }) {
|
|
66
|
+
return /* @__PURE__ */ o("span", {
|
|
67
|
+
"aria-hidden": !0,
|
|
68
|
+
"data-slot": "pagination-ellipsis",
|
|
69
|
+
className: e("flex size-9 items-center justify-center", t),
|
|
70
|
+
...n,
|
|
71
|
+
children: [/* @__PURE__ */ a(i, { className: "size-4" }), /* @__PURE__ */ a("span", {
|
|
72
|
+
className: "sr-only",
|
|
73
|
+
children: "More pages"
|
|
74
|
+
})]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { s as Pagination, c as PaginationContent, p as PaginationEllipsis, l as PaginationItem, u as PaginationLink, f as PaginationNext, d as PaginationPrevious };
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Button as t } from "./button.js";
|
|
4
|
+
import { ScrollArea as n } from "./scroll-area.js";
|
|
5
|
+
import { Input as r } from "./input.js";
|
|
6
|
+
import { Combobox as i, ComboboxContent as a, ComboboxEmpty as o, ComboboxInput as s, ComboboxItem as c, ComboboxList as l, ComboboxSeparator as u, ComboboxTrigger as d, ComboboxValue as f } from "./combobox.js";
|
|
7
|
+
import { createContext as p, useContext as m, useMemo as h, useState as g } from "react";
|
|
8
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
9
|
+
import { HugeiconsIcon as y } from "@hugeicons/react";
|
|
10
|
+
import { Globe02Icon as b } from "@hugeicons/core-free-icons";
|
|
11
|
+
import * as x from "react-phone-number-input";
|
|
12
|
+
import S from "react-phone-number-input/flags";
|
|
13
|
+
//#region src/components/reui/phone-input.tsx
|
|
14
|
+
var C = p({
|
|
15
|
+
variant: "default",
|
|
16
|
+
popupClassName: void 0,
|
|
17
|
+
scrollAreaClassName: void 0
|
|
18
|
+
});
|
|
19
|
+
function w({ className: t, variant: n, popupClassName: r, scrollAreaClassName: i, onChange: a, value: o, ...s }) {
|
|
20
|
+
let c = n || "default";
|
|
21
|
+
return /* @__PURE__ */ _(C.Provider, {
|
|
22
|
+
value: {
|
|
23
|
+
variant: c,
|
|
24
|
+
popupClassName: r,
|
|
25
|
+
scrollAreaClassName: i
|
|
26
|
+
},
|
|
27
|
+
children: /* @__PURE__ */ _(x.default, {
|
|
28
|
+
className: e("flex", s["aria-invalid"] && "[&_*[data-slot=combobox-trigger]]:border-destructive [&_*[data-slot=combobox-trigger]]:ring-destructive/50", t),
|
|
29
|
+
flagComponent: D,
|
|
30
|
+
countrySelectComponent: E,
|
|
31
|
+
inputComponent: T,
|
|
32
|
+
smartCaret: !1,
|
|
33
|
+
value: o || void 0,
|
|
34
|
+
onChange: (e) => a?.(e || ""),
|
|
35
|
+
...s
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function T({ className: t, ...n }) {
|
|
40
|
+
let { variant: i } = m(C);
|
|
41
|
+
return /* @__PURE__ */ _(r, {
|
|
42
|
+
className: e("rounded-s-none focus:z-1", i === "sm" && "h-8", i === "lg" && "h-10", t),
|
|
43
|
+
...n
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function E({ disabled: r, value: p, options: y, onChange: b }) {
|
|
47
|
+
let { variant: S, popupClassName: w } = m(C), [T, E] = g(""), O = h(() => T ? y.filter(({ label: e }) => e.toLowerCase().includes(T.toLowerCase())) : y, [y, T]);
|
|
48
|
+
return /* @__PURE__ */ v(i, {
|
|
49
|
+
items: O,
|
|
50
|
+
value: p || "",
|
|
51
|
+
onValueChange: (e) => {
|
|
52
|
+
e && b(e);
|
|
53
|
+
},
|
|
54
|
+
children: [/* @__PURE__ */ _(d, { render: /* @__PURE__ */ v(t, {
|
|
55
|
+
variant: "outline",
|
|
56
|
+
size: S,
|
|
57
|
+
className: e("rounded-s-4xl rounded-e-none flex gap-1 border-e-0 px-2.5 py-0 leading-none hover:bg-transparent focus:z-10 data-pressed:bg-transparent", r && "opacity-50"),
|
|
58
|
+
disabled: r,
|
|
59
|
+
children: [/* @__PURE__ */ _("span", {
|
|
60
|
+
className: "sr-only",
|
|
61
|
+
children: /* @__PURE__ */ _(f, {})
|
|
62
|
+
}), /* @__PURE__ */ _(D, {
|
|
63
|
+
country: p,
|
|
64
|
+
countryName: p
|
|
65
|
+
})]
|
|
66
|
+
}) }), /* @__PURE__ */ v(a, {
|
|
67
|
+
className: e("w-xs *:data-[slot=input-group]:bg-transparent", w),
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ _(s, {
|
|
70
|
+
placeholder: "e.g. United States",
|
|
71
|
+
value: T,
|
|
72
|
+
onChange: (e) => E(e.target.value),
|
|
73
|
+
showTrigger: !1,
|
|
74
|
+
className: "border-input focus-visible:border-border rounded-none border-0 px-0 py-2.5 shadow-none ring-0! outline-none! focus-visible:ring-0 focus-visible:ring-offset-0"
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ _(u, {}),
|
|
77
|
+
/* @__PURE__ */ _(o, {
|
|
78
|
+
className: "px-4 py-2.5 text-sm",
|
|
79
|
+
children: "No country found."
|
|
80
|
+
}),
|
|
81
|
+
/* @__PURE__ */ _(l, { children: /* @__PURE__ */ _("div", {
|
|
82
|
+
className: "relative flex max-h-full",
|
|
83
|
+
children: /* @__PURE__ */ _("div", {
|
|
84
|
+
className: "flex max-h-[min(var(--available-height),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain",
|
|
85
|
+
children: /* @__PURE__ */ _(n, {
|
|
86
|
+
className: "size-full min-h-0 **:data-[slot=scroll-area-scrollbar]:m-0 [&_[data-slot=scroll-area-viewport]]:h-full [&_[data-slot=scroll-area-viewport]]:overscroll-contain",
|
|
87
|
+
children: O.map((e) => e.value ? /* @__PURE__ */ v(c, {
|
|
88
|
+
value: e.value,
|
|
89
|
+
className: "flex items-center gap-2",
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ _(D, {
|
|
92
|
+
country: e.value,
|
|
93
|
+
countryName: e.label
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ _("span", {
|
|
96
|
+
className: "flex-1 text-sm",
|
|
97
|
+
children: e.label
|
|
98
|
+
}),
|
|
99
|
+
/* @__PURE__ */ _("span", {
|
|
100
|
+
className: "text-foreground/50 text-sm",
|
|
101
|
+
children: `+${x.getCountryCallingCode(e.value)}`
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
}, e.value) : null)
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
}) })
|
|
108
|
+
]
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function D({ country: e, countryName: t }) {
|
|
113
|
+
let n = S[e];
|
|
114
|
+
return /* @__PURE__ */ _("span", {
|
|
115
|
+
className: "flex h-4 w-4 items-center justify-center [&_svg:not([class*='size-'])]:size-full! [&_svg:not([class*='size-'])]:rounded-[5px]",
|
|
116
|
+
children: n ? /* @__PURE__ */ _(n, { title: t }) : /* @__PURE__ */ _(y, {
|
|
117
|
+
icon: b,
|
|
118
|
+
strokeWidth: 2,
|
|
119
|
+
className: "size-4 opacity-60"
|
|
120
|
+
})
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
export { w as PhoneInput };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Popover as t } from "radix-ui";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/reui/popover.tsx
|
|
6
|
+
function r({ ...e }) {
|
|
7
|
+
return /* @__PURE__ */ n(t.Root, {
|
|
8
|
+
"data-slot": "popover",
|
|
9
|
+
...e
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function i({ ...e }) {
|
|
13
|
+
return /* @__PURE__ */ n(t.Trigger, {
|
|
14
|
+
"data-slot": "popover-trigger",
|
|
15
|
+
...e
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function a({ className: r, align: i = "center", sideOffset: a = 4, ...o }) {
|
|
19
|
+
return /* @__PURE__ */ n(t.Portal, { children: /* @__PURE__ */ n(t.Content, {
|
|
20
|
+
"data-slot": "popover-content",
|
|
21
|
+
align: i,
|
|
22
|
+
sideOffset: a,
|
|
23
|
+
className: e("z-50 w-72 origin-(--radix-popover-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),
|
|
24
|
+
...o
|
|
25
|
+
}) });
|
|
26
|
+
}
|
|
27
|
+
function o({ ...e }) {
|
|
28
|
+
return /* @__PURE__ */ n(t.Anchor, {
|
|
29
|
+
"data-slot": "popover-anchor",
|
|
30
|
+
...e
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function s({ className: t, ...r }) {
|
|
34
|
+
return /* @__PURE__ */ n("div", {
|
|
35
|
+
"data-slot": "popover-header",
|
|
36
|
+
className: e("flex flex-col gap-1 text-sm", t),
|
|
37
|
+
...r
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function c({ className: t, ...r }) {
|
|
41
|
+
return /* @__PURE__ */ n("div", {
|
|
42
|
+
"data-slot": "popover-title",
|
|
43
|
+
className: e("font-medium", t),
|
|
44
|
+
...r
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function l({ className: t, ...r }) {
|
|
48
|
+
return /* @__PURE__ */ n("p", {
|
|
49
|
+
"data-slot": "popover-description",
|
|
50
|
+
className: e("text-muted-foreground", t),
|
|
51
|
+
...r
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { r as Popover, o as PopoverAnchor, a as PopoverContent, l as PopoverDescription, s as PopoverHeader, c as PopoverTitle, i as PopoverTrigger };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Progress as t } from "radix-ui";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/reui/progress.tsx
|
|
7
|
+
function r({ className: r, value: i, ...a }) {
|
|
8
|
+
return /* @__PURE__ */ n(t.Root, {
|
|
9
|
+
"data-slot": "progress",
|
|
10
|
+
className: e("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", r),
|
|
11
|
+
...a,
|
|
12
|
+
children: /* @__PURE__ */ n(t.Indicator, {
|
|
13
|
+
"data-slot": "progress-indicator",
|
|
14
|
+
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
15
|
+
style: { transform: `translateX(-${100 - (i || 0)}%)` }
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { r as Progress };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { CircleIcon as t } from "lucide-react";
|
|
4
|
+
import { RadioGroup as n } from "radix-ui";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/reui/radio-group.tsx
|
|
7
|
+
function i({ className: t, ...i }) {
|
|
8
|
+
return /* @__PURE__ */ r(n.Root, {
|
|
9
|
+
"data-slot": "radio-group",
|
|
10
|
+
className: e("grid gap-3", t),
|
|
11
|
+
...i
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function a({ className: i, ...a }) {
|
|
15
|
+
return /* @__PURE__ */ r(n.Item, {
|
|
16
|
+
"data-slot": "radio-group-item",
|
|
17
|
+
className: e("aspect-square size-4 shrink-0 rounded-full border border-input text-primary 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 dark:bg-input/30 dark:aria-invalid:ring-destructive/40", i),
|
|
18
|
+
...a,
|
|
19
|
+
children: /* @__PURE__ */ r(n.Indicator, {
|
|
20
|
+
"data-slot": "radio-group-indicator",
|
|
21
|
+
className: "relative flex items-center justify-center",
|
|
22
|
+
children: /* @__PURE__ */ r(t, { className: "absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary" })
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { i as RadioGroup, a as RadioGroupItem };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { useState as t } from "react";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { cva as i } from "class-variance-authority";
|
|
6
|
+
import { HugeiconsIcon as a } from "@hugeicons/react";
|
|
7
|
+
import { StarIcon as o } from "@hugeicons/core-free-icons";
|
|
8
|
+
//#region src/components/reui/rating.tsx
|
|
9
|
+
var s = i("flex items-center", {
|
|
10
|
+
variants: { size: {
|
|
11
|
+
sm: "gap-2",
|
|
12
|
+
default: "gap-2.5",
|
|
13
|
+
lg: "gap-3"
|
|
14
|
+
} },
|
|
15
|
+
defaultVariants: { size: "default" }
|
|
16
|
+
}), c = i("", {
|
|
17
|
+
variants: { size: {
|
|
18
|
+
sm: "w-4 h-4",
|
|
19
|
+
default: "w-5 h-5",
|
|
20
|
+
lg: "w-6 h-6"
|
|
21
|
+
} },
|
|
22
|
+
defaultVariants: { size: "default" }
|
|
23
|
+
}), l = i("text-muted-foreground w-5", {
|
|
24
|
+
variants: { size: {
|
|
25
|
+
sm: "text-xs",
|
|
26
|
+
default: "text-sm",
|
|
27
|
+
lg: "text-base"
|
|
28
|
+
} },
|
|
29
|
+
defaultVariants: { size: "default" }
|
|
30
|
+
});
|
|
31
|
+
function u({ rating: i, maxRating: u = 5, size: d, className: f, starClassName: p, showValue: m = !1, editable: h = !1, onRatingChange: g, ..._ }) {
|
|
32
|
+
let [v, y] = t(null), b = h && v !== null ? v : i, x = (e) => {
|
|
33
|
+
h && g && g(e);
|
|
34
|
+
}, S = (e) => {
|
|
35
|
+
h && y(e);
|
|
36
|
+
}, C = () => {
|
|
37
|
+
h && y(null);
|
|
38
|
+
}, w = () => {
|
|
39
|
+
let t = [];
|
|
40
|
+
for (let i = 1; i <= u; i++) {
|
|
41
|
+
let s = b >= i, l = b > i - 1 && b < i ? (b - (i - 1)) * 100 : 0;
|
|
42
|
+
t.push(/* @__PURE__ */ r("div", {
|
|
43
|
+
className: e("relative", h && "cursor-pointer"),
|
|
44
|
+
onClick: () => x(i),
|
|
45
|
+
onMouseEnter: () => S(i),
|
|
46
|
+
onMouseLeave: C,
|
|
47
|
+
children: [/* @__PURE__ */ n(a, {
|
|
48
|
+
icon: o,
|
|
49
|
+
strokeWidth: 2,
|
|
50
|
+
"data-slot": "rating-star-empty",
|
|
51
|
+
className: e(c({ size: d }), "text-muted-foreground/30")
|
|
52
|
+
}), /* @__PURE__ */ n("div", {
|
|
53
|
+
className: "absolute inset-0 overflow-hidden",
|
|
54
|
+
style: { width: s ? "100%" : `${l}%` },
|
|
55
|
+
children: /* @__PURE__ */ n(a, {
|
|
56
|
+
icon: o,
|
|
57
|
+
strokeWidth: 2,
|
|
58
|
+
"data-slot": "rating-star-filled",
|
|
59
|
+
className: e(c({ size: d }), "fill-yellow-400 text-yellow-400")
|
|
60
|
+
})
|
|
61
|
+
})]
|
|
62
|
+
}, i));
|
|
63
|
+
}
|
|
64
|
+
return t;
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ r("div", {
|
|
67
|
+
"data-slot": "rating",
|
|
68
|
+
className: e(s({ size: d }), f),
|
|
69
|
+
..._,
|
|
70
|
+
children: [/* @__PURE__ */ n("div", {
|
|
71
|
+
className: "flex items-center",
|
|
72
|
+
children: w()
|
|
73
|
+
}), m && /* @__PURE__ */ n("span", {
|
|
74
|
+
"data-slot": "rating-value",
|
|
75
|
+
className: e(l({ size: d }), p),
|
|
76
|
+
children: b.toFixed(1)
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { u as Rating };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { GripVerticalIcon as t } from "lucide-react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import * as r from "react-resizable-panels";
|
|
5
|
+
//#region src/components/reui/resizable.tsx
|
|
6
|
+
function i({ className: t, ...i }) {
|
|
7
|
+
return /* @__PURE__ */ n(r.Group, {
|
|
8
|
+
"data-slot": "resizable-panel-group",
|
|
9
|
+
className: e("flex h-full w-full aria-[orientation=vertical]:flex-col", t),
|
|
10
|
+
...i
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function a({ ...e }) {
|
|
14
|
+
return /* @__PURE__ */ n(r.Panel, {
|
|
15
|
+
"data-slot": "resizable-panel",
|
|
16
|
+
...e
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function o({ withHandle: i, className: a, ...o }) {
|
|
20
|
+
return /* @__PURE__ */ n(r.Separator, {
|
|
21
|
+
"data-slot": "resizable-handle",
|
|
22
|
+
className: e("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90", a),
|
|
23
|
+
...o,
|
|
24
|
+
children: i && /* @__PURE__ */ n("div", {
|
|
25
|
+
className: "z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border",
|
|
26
|
+
children: /* @__PURE__ */ n(t, { className: "size-2.5" })
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { o as ResizableHandle, a as ResizablePanel, i as ResizablePanelGroup };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { ScrollArea as t } from "radix-ui";
|
|
5
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/reui/scroll-area.tsx
|
|
7
|
+
function i({ className: i, children: o, ...s }) {
|
|
8
|
+
return /* @__PURE__ */ r(t.Root, {
|
|
9
|
+
"data-slot": "scroll-area",
|
|
10
|
+
className: e("relative", i),
|
|
11
|
+
...s,
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ n(t.Viewport, {
|
|
14
|
+
"data-slot": "scroll-area-viewport",
|
|
15
|
+
className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",
|
|
16
|
+
children: o
|
|
17
|
+
}),
|
|
18
|
+
/* @__PURE__ */ n(a, {}),
|
|
19
|
+
/* @__PURE__ */ n(t.Corner, {})
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function a({ className: r, orientation: i = "vertical", ...a }) {
|
|
24
|
+
return /* @__PURE__ */ n(t.ScrollAreaScrollbar, {
|
|
25
|
+
"data-slot": "scroll-area-scrollbar",
|
|
26
|
+
orientation: i,
|
|
27
|
+
className: e("flex touch-none p-px transition-colors select-none", i === "vertical" && "h-full w-2.5 border-l border-l-transparent", i === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", r),
|
|
28
|
+
...a,
|
|
29
|
+
children: /* @__PURE__ */ n(t.ScrollAreaThumb, {
|
|
30
|
+
"data-slot": "scroll-area-thumb",
|
|
31
|
+
className: "relative flex-1 rounded-full bg-border"
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { i as ScrollArea, a as ScrollBar };
|