@eodparks/ui 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/dist/accordion.d.ts +36 -0
- package/dist/accordion.js +57 -0
- package/dist/alert-dialog.d.ts +50 -0
- package/dist/alert-dialog.js +149 -0
- package/dist/alert.d.ts +23 -0
- package/dist/alert.js +87 -0
- package/dist/avatar.d.ts +35 -0
- package/dist/avatar.js +118 -0
- package/dist/badge.d.ts +27 -0
- package/dist/badge.js +148 -0
- package/dist/button-C2CCxHu1.d.ts +15 -0
- package/dist/button-DEsRlveL.js +86 -0
- package/dist/button.d.ts +2 -0
- package/dist/button.js +1 -0
- package/dist/calendar-DhsRPq2D.d.ts +23 -0
- package/dist/calendar-kbn4gZ1a.js +110 -0
- package/dist/calendar.d.ts +2 -0
- package/dist/calendar.js +1 -0
- package/dist/card-tkP52GwZ.js +77 -0
- package/dist/card.d.ts +18 -0
- package/dist/card.js +1 -0
- package/dist/chart.d.ts +52 -0
- package/dist/chart.js +163 -0
- package/dist/checkbox.d.ts +7 -0
- package/dist/checkbox.js +26 -0
- package/dist/cn-B-fHM4Ov.js +12 -0
- package/dist/collapsible.d.ts +10 -0
- package/dist/collapsible.js +23 -0
- package/dist/command.d.ts +38 -0
- package/dist/command.js +124 -0
- package/dist/date-picker.d.ts +46 -0
- package/dist/date-picker.js +159 -0
- package/dist/dialog-JjpMFEDR.js +117 -0
- package/dist/dialog.d.ts +2 -0
- package/dist/dialog.js +3 -0
- package/dist/dropdown-menu-B_VG1VXX.js +116 -0
- package/dist/dropdown-menu-CZ8xcq1d.d.ts +38 -0
- package/dist/dropdown-menu.d.ts +2 -0
- package/dist/dropdown-menu.js +1 -0
- package/dist/empty-state-B11Uq0U_.js +66 -0
- package/dist/empty-state.d.ts +15 -0
- package/dist/empty-state.js +1 -0
- package/dist/error-state.d.ts +48 -0
- package/dist/error-state.js +139 -0
- package/dist/field-Cwhz73-_.d.ts +15 -0
- package/dist/field-D-n7O1n6.js +63 -0
- package/dist/field.d.ts +2 -0
- package/dist/field.js +1 -0
- package/dist/focus-ring-BpxMbGAn.js +3 -0
- package/dist/form-actions.d.ts +21 -0
- package/dist/form-actions.js +41 -0
- package/dist/forms/formik.d.ts +20 -0
- package/dist/forms/formik.js +50 -0
- package/dist/forms/rhf.d.ts +32 -0
- package/dist/forms/rhf.js +114 -0
- package/dist/icon-button-XAjcFsZ2.js +14 -0
- package/dist/icon-button.d.ts +9 -0
- package/dist/icon-button.js +1 -0
- package/dist/icon.d.ts +15 -0
- package/dist/icon.js +21 -0
- package/dist/index-Ct4mPvuB.d.ts +29 -0
- package/dist/input-BxjcqQS1.js +49 -0
- package/dist/input-group.d.ts +12 -0
- package/dist/input-group.js +26 -0
- package/dist/input.d.ts +15 -0
- package/dist/input.js +1 -0
- package/dist/label-BrOAJU1p.js +31 -0
- package/dist/label-CUAiaBbm.d.ts +13 -0
- package/dist/label.d.ts +2 -0
- package/dist/label.js +1 -0
- package/dist/native-select.d.ts +8 -0
- package/dist/native-select.js +41 -0
- package/dist/page-header.d.ts +19 -0
- package/dist/page-header.js +51 -0
- package/dist/pagination.d.ts +47 -0
- package/dist/pagination.js +131 -0
- package/dist/password-input.d.ts +14 -0
- package/dist/password-input.js +41 -0
- package/dist/popover.d.ts +19 -0
- package/dist/popover.js +54 -0
- package/dist/popup-CLsuJ-AA.js +6 -0
- package/dist/progress.d.ts +8 -0
- package/dist/progress.js +36 -0
- package/dist/radio-group.d.ts +14 -0
- package/dist/radio-group.js +25 -0
- package/dist/scroll-area.d.ts +16 -0
- package/dist/scroll-area.js +52 -0
- package/dist/select-Cq_JDuYO.js +266 -0
- package/dist/select.d.ts +40 -0
- package/dist/select.js +1 -0
- package/dist/separator.d.ts +8 -0
- package/dist/separator.js +38 -0
- package/dist/sheet.d.ts +27 -0
- package/dist/sheet.js +95 -0
- package/dist/skeleton.d.ts +19 -0
- package/dist/skeleton.js +45 -0
- package/dist/spinner.d.ts +13 -0
- package/dist/spinner.js +44 -0
- package/dist/switch.d.ts +7 -0
- package/dist/switch.js +19 -0
- package/dist/table.d.ts +24 -0
- package/dist/table.js +75 -0
- package/dist/tabs.d.ts +24 -0
- package/dist/tabs.js +74 -0
- package/dist/textarea.d.ts +5 -0
- package/dist/textarea.js +15 -0
- package/dist/theme-toggle.d.ts +11 -0
- package/dist/theme-toggle.js +50 -0
- package/dist/toast.d.ts +12 -0
- package/dist/toast.js +105 -0
- package/dist/tooltip-BsVKZDXs.js +47 -0
- package/dist/tooltip.d.ts +18 -0
- package/dist/tooltip.js +1 -0
- package/dist/typography-Dy3PCTrL.js +34 -0
- package/dist/typography.d.ts +11 -0
- package/dist/typography.js +1 -0
- package/dist/visually-hidden-BrCs6ZEy.js +11 -0
- package/dist/visually-hidden.d.ts +3 -0
- package/dist/visually-hidden.js +1 -0
- package/docs/accessibility.md +95 -0
- package/docs/accordion.md +89 -0
- package/docs/alert-dialog.md +157 -0
- package/docs/alert.md +70 -0
- package/docs/avatar.md +57 -0
- package/docs/badge.md +51 -0
- package/docs/button.md +121 -0
- package/docs/calendar.md +116 -0
- package/docs/card.md +74 -0
- package/docs/chart.md +93 -0
- package/docs/checkbox.md +119 -0
- package/docs/collapsible.md +76 -0
- package/docs/command.md +114 -0
- package/docs/date-picker.md +177 -0
- package/docs/dialog.md +110 -0
- package/docs/dropdown-menu.md +126 -0
- package/docs/empty-state.md +65 -0
- package/docs/error-state.md +59 -0
- package/docs/field.md +54 -0
- package/docs/form-actions.md +55 -0
- package/docs/forms/formik.md +42 -0
- package/docs/forms/rhf.md +64 -0
- package/docs/icon-button.md +84 -0
- package/docs/icon.md +77 -0
- package/docs/input-group.md +47 -0
- package/docs/input.md +46 -0
- package/docs/label.md +33 -0
- package/docs/layout.md +102 -0
- package/docs/llms.txt +72 -0
- package/docs/native-select.md +87 -0
- package/docs/page-header.md +61 -0
- package/docs/pagination.md +107 -0
- package/docs/password-input.md +30 -0
- package/docs/popover.md +103 -0
- package/docs/progress.md +53 -0
- package/docs/radio-group.md +119 -0
- package/docs/scroll-area.md +85 -0
- package/docs/select.md +106 -0
- package/docs/separator.md +38 -0
- package/docs/sheet.md +118 -0
- package/docs/skeleton.md +50 -0
- package/docs/spinner.md +46 -0
- package/docs/switch.md +92 -0
- package/docs/table.md +87 -0
- package/docs/tabs.md +96 -0
- package/docs/textarea.md +38 -0
- package/docs/theme-toggle.md +76 -0
- package/docs/toast.md +95 -0
- package/docs/tooltip.md +101 -0
- package/docs/typography.md +96 -0
- package/docs/visually-hidden.md +44 -0
- package/layer.css +22 -0
- package/package.json +275 -3
- package/skills/eod-ui/SKILL.md +37 -0
- package/styles.css +2 -0
- package/README.md +0 -3
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { renderElement } from "@ui-sdk/react/primitive";
|
|
2
|
+
import { ArrowLeftIcon } from "lucide-react";
|
|
3
|
+
import { n as withBase } from "./cn-B-fHM4Ov.js";
|
|
4
|
+
import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
|
|
5
|
+
import { n as textVariants } from "./typography-Dy3PCTrL.js";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// src/patterns/page-header/page-header.tsx
|
|
8
|
+
function PageHeader({ title, description, breadcrumb, back, actions, tabs, render, className, ...props }) {
|
|
9
|
+
return renderElement("header", {
|
|
10
|
+
...props,
|
|
11
|
+
"data-slot": "page-header",
|
|
12
|
+
className: withBase("flex min-w-0 flex-col gap-4", className),
|
|
13
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14
|
+
breadcrumb,
|
|
15
|
+
back,
|
|
16
|
+
/* @__PURE__ */ jsxs("div", {
|
|
17
|
+
className: "flex flex-wrap items-start justify-between gap-x-6 gap-y-4",
|
|
18
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
19
|
+
className: "flex min-w-0 grow basis-64 flex-col gap-1",
|
|
20
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
21
|
+
"data-slot": "page-header-title",
|
|
22
|
+
className: `wrap-anywhere ${textVariants({ variant: "page-title" })}`,
|
|
23
|
+
children: title
|
|
24
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
25
|
+
"data-slot": "page-header-description",
|
|
26
|
+
className: `wrap-anywhere text-muted-foreground ${textVariants({ variant: "small" })}`,
|
|
27
|
+
children: description
|
|
28
|
+
})]
|
|
29
|
+
}), actions && /* @__PURE__ */ jsx("div", {
|
|
30
|
+
"data-slot": "page-header-actions",
|
|
31
|
+
className: "flex flex-wrap items-center gap-2",
|
|
32
|
+
children: actions
|
|
33
|
+
})]
|
|
34
|
+
}),
|
|
35
|
+
tabs
|
|
36
|
+
] })
|
|
37
|
+
}, render);
|
|
38
|
+
}
|
|
39
|
+
/** A link to the parent page. Pass the destination's name as children and the route link with `render`. */
|
|
40
|
+
function PageHeaderBack({ children, render, className, ...props }) {
|
|
41
|
+
return renderElement("a", {
|
|
42
|
+
...props,
|
|
43
|
+
"data-slot": "page-header-back",
|
|
44
|
+
className: withBase(`inline-flex min-h-6 w-fit items-center gap-1.5 rounded-control text-muted-foreground transition-colors hover:text-foreground ${textVariants({ variant: "small" })} ${focusRing}`, className),
|
|
45
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ArrowLeftIcon, {
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
className: "size-4 shrink-0 rtl:-scale-x-100"
|
|
48
|
+
}), children] })
|
|
49
|
+
}, render);
|
|
50
|
+
}
|
|
51
|
+
export { PageHeader, PageHeaderBack };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Pagination as Pagination$1, PaginationEllipsis as PaginationEllipsis$1, PaginationItem as PaginationItem$1, PaginationLink as PaginationLink$1, PaginationList, PaginationPrevious as PaginationPrevious$1 } from "@ui-sdk/react/pagination";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
type UIPaginationProps = ComponentProps<typeof Pagination$1>;
|
|
4
|
+
type PaginationProps = UIPaginationProps;
|
|
5
|
+
/** Names the landmark "Pagination" unless `aria-label` says otherwise. */
|
|
6
|
+
declare function Pagination({ "aria-label": label, total, pageSize, children, className, ...props }: PaginationProps): import("react").JSX.Element;
|
|
7
|
+
type PaginationItemProps = ComponentProps<typeof PaginationItem$1>;
|
|
8
|
+
declare function PaginationItem(props: PaginationItemProps): import("react").JSX.Element;
|
|
9
|
+
type PaginationLinkProps = ComponentProps<typeof PaginationLink$1> & {
|
|
10
|
+
/** The accessible name; defaults to `Page <n>`. */
|
|
11
|
+
label?: string;
|
|
12
|
+
};
|
|
13
|
+
declare function PaginationLink({ page, label, className, ...props }: PaginationLinkProps): import("react").JSX.Element;
|
|
14
|
+
type StepProps = ComponentProps<typeof PaginationPrevious$1> & {
|
|
15
|
+
label?: string;
|
|
16
|
+
};
|
|
17
|
+
declare function PaginationPrevious({ label, className, children, ...props }: StepProps): import("react").JSX.Element;
|
|
18
|
+
declare function PaginationNext({ label, className, children, ...props }: StepProps): import("react").JSX.Element;
|
|
19
|
+
type PaginationEllipsisProps = ComponentProps<typeof PaginationEllipsis$1>;
|
|
20
|
+
declare function PaginationEllipsis({ className, children, ...props }: PaginationEllipsisProps): import("react").JSX.Element;
|
|
21
|
+
type PaginationContentProps = ComponentProps<typeof PaginationList> & {
|
|
22
|
+
previousLabel?: string;
|
|
23
|
+
nextLabel?: string;
|
|
24
|
+
};
|
|
25
|
+
/** Without children: Previous, the numbered range with ellipses, and Next. */
|
|
26
|
+
declare function PaginationContent({ previousLabel, nextLabel, children, className, ...props }: PaginationContentProps): import("react").JSX.Element;
|
|
27
|
+
type PaginationSummaryProps = Omit<ComponentProps<"p">, "children"> & {
|
|
28
|
+
/** Builds the text from the range on this page; the default reads `11-20 of 95`. */
|
|
29
|
+
format?: (range: {
|
|
30
|
+
from: number;
|
|
31
|
+
to: number;
|
|
32
|
+
total: number;
|
|
33
|
+
}) => ReactNode;
|
|
34
|
+
};
|
|
35
|
+
/** The range on this page and the total. Needs `total` and `pageSize` on `Pagination`. */
|
|
36
|
+
declare function PaginationSummary({ format, className, ...props }: PaginationSummaryProps): import("react").JSX.Element | null;
|
|
37
|
+
type PaginationPageSizeProps = {
|
|
38
|
+
value: number;
|
|
39
|
+
onValueChange: (size: number) => void;
|
|
40
|
+
sizes?: number[];
|
|
41
|
+
/** The visible name of the control. */
|
|
42
|
+
label?: string;
|
|
43
|
+
className?: string;
|
|
44
|
+
};
|
|
45
|
+
/** A select for how many rows show per page. Reset the page in `onValueChange`. */
|
|
46
|
+
declare function PaginationPageSize({ value, onValueChange, sizes, label, className }: PaginationPageSizeProps): import("react").JSX.Element;
|
|
47
|
+
export { Pagination, PaginationContent, type PaginationContentProps, PaginationEllipsis, PaginationItem, PaginationLink, type PaginationLinkProps, PaginationNext, PaginationPageSize, type PaginationPageSizeProps, PaginationPrevious, type PaginationProps, PaginationSummary, type PaginationSummaryProps };
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Pagination as Pagination$1, PaginationEllipsis as PaginationEllipsis$1, PaginationItem as PaginationItem$1, PaginationLink as PaginationLink$1, PaginationList, PaginationNext as PaginationNext$1, PaginationPrevious as PaginationPrevious$1 } from "@ui-sdk/react/pagination";
|
|
2
|
+
import { ChevronLeftIcon, ChevronRightIcon, EllipsisIcon } from "lucide-react";
|
|
3
|
+
import { createContext, use, useId } from "react";
|
|
4
|
+
import { n as buttonVariants } from "./button-DEsRlveL.js";
|
|
5
|
+
import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
|
|
6
|
+
import { d as SelectTrigger, o as SelectItem, r as SelectContent, t as Select } from "./select-Cq_JDuYO.js";
|
|
7
|
+
import { n as textVariants } from "./typography-Dy3PCTrL.js";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
// src/pagination/pagination.tsx
|
|
10
|
+
const CountsContext = createContext(null);
|
|
11
|
+
/** Names the landmark "Pagination" unless `aria-label` says otherwise. */
|
|
12
|
+
function Pagination({ "aria-label": label = "Pagination", total, pageSize, children, className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(Pagination$1, {
|
|
14
|
+
...props,
|
|
15
|
+
"aria-label": label,
|
|
16
|
+
total,
|
|
17
|
+
pageSize,
|
|
18
|
+
className: withBase("flex flex-wrap items-center justify-center gap-x-6 gap-y-2", className),
|
|
19
|
+
children: (state) => /* @__PURE__ */ jsx(CountsContext, {
|
|
20
|
+
value: {
|
|
21
|
+
page: state.page,
|
|
22
|
+
pageCount: state.pageCount,
|
|
23
|
+
total,
|
|
24
|
+
pageSize
|
|
25
|
+
},
|
|
26
|
+
children: typeof children === "function" ? children(state) : children
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function PaginationItem(props) {
|
|
31
|
+
return /* @__PURE__ */ jsx(PaginationItem$1, { ...props });
|
|
32
|
+
}
|
|
33
|
+
const stepClass = "min-w-(--control-h) px-3 tabular-nums";
|
|
34
|
+
function PaginationLink({ page, label, className, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(PaginationLink$1, {
|
|
36
|
+
"aria-label": label ?? `Page ${page}`,
|
|
37
|
+
...props,
|
|
38
|
+
page,
|
|
39
|
+
className: (state) => cn(buttonVariants({ variant: state.current ? "outline" : "ghost" }), stepClass, typeof className === "function" ? className(state) : className)
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function PaginationPrevious({ label = "Previous", className, children, ...props }) {
|
|
43
|
+
return /* @__PURE__ */ jsx(PaginationPrevious$1, {
|
|
44
|
+
...props,
|
|
45
|
+
className: withBase(cn(buttonVariants({ variant: "ghost" }), "gap-1 ps-2.5 pe-3"), className),
|
|
46
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ChevronLeftIcon, {
|
|
47
|
+
"aria-hidden": true,
|
|
48
|
+
className: "rtl:rotate-180"
|
|
49
|
+
}), /* @__PURE__ */ jsx("span", { children: label })] })
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function PaginationNext({ label = "Next", className, children, ...props }) {
|
|
53
|
+
return /* @__PURE__ */ jsx(PaginationNext$1, {
|
|
54
|
+
...props,
|
|
55
|
+
className: withBase(cn(buttonVariants({ variant: "ghost" }), "gap-1 ps-3 pe-2.5"), className),
|
|
56
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", { children: label }), /* @__PURE__ */ jsx(ChevronRightIcon, {
|
|
57
|
+
"aria-hidden": true,
|
|
58
|
+
className: "rtl:rotate-180"
|
|
59
|
+
})] })
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function PaginationEllipsis({ className, children, ...props }) {
|
|
63
|
+
return /* @__PURE__ */ jsx(PaginationEllipsis$1, {
|
|
64
|
+
...props,
|
|
65
|
+
className: withBase("flex size-(--control-h) items-center justify-center text-muted-foreground [&_svg]:size-4", className),
|
|
66
|
+
children: children ?? /* @__PURE__ */ jsx(EllipsisIcon, { "aria-hidden": true })
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/** Without children: Previous, the numbered range with ellipses, and Next. */
|
|
70
|
+
function PaginationContent({ previousLabel, nextLabel, children, className, ...props }) {
|
|
71
|
+
return /* @__PURE__ */ jsx(PaginationList, {
|
|
72
|
+
...props,
|
|
73
|
+
className: withBase("flex flex-row flex-wrap items-center gap-1", className),
|
|
74
|
+
children: (state) => children === void 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
75
|
+
/* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationPrevious, { label: previousLabel }) }),
|
|
76
|
+
state.items.map((item) => /* @__PURE__ */ jsx(PaginationItem, { children: typeof item === "number" ? /* @__PURE__ */ jsx(PaginationLink, { page: item }) : /* @__PURE__ */ jsx(PaginationEllipsis, {}) }, item)),
|
|
77
|
+
/* @__PURE__ */ jsx(PaginationItem, { children: /* @__PURE__ */ jsx(PaginationNext, { label: nextLabel }) })
|
|
78
|
+
] }) : typeof children === "function" ? children(state) : children
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** The range on this page and the total. Needs `total` and `pageSize` on `Pagination`. */
|
|
82
|
+
function PaginationSummary({ format, className, ...props }) {
|
|
83
|
+
const counts = use(CountsContext);
|
|
84
|
+
if (!counts?.total || !counts.pageSize) return null;
|
|
85
|
+
const from = (counts.page - 1) * counts.pageSize + 1;
|
|
86
|
+
const to = Math.min(counts.page * counts.pageSize, counts.total);
|
|
87
|
+
return /* @__PURE__ */ jsx("p", {
|
|
88
|
+
"data-slot": "pagination-summary",
|
|
89
|
+
...props,
|
|
90
|
+
className: cn(textVariants({ variant: "small" }), "text-muted-foreground tabular-nums", className),
|
|
91
|
+
children: format ? format({
|
|
92
|
+
from,
|
|
93
|
+
to,
|
|
94
|
+
total: counts.total
|
|
95
|
+
}) : `${from}-${to} of ${counts.total}`
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/** A select for how many rows show per page. Reset the page in `onValueChange`. */
|
|
99
|
+
function PaginationPageSize({ value, onValueChange, sizes = [
|
|
100
|
+
10,
|
|
101
|
+
20,
|
|
102
|
+
50,
|
|
103
|
+
100
|
|
104
|
+
], label = "Rows per page", className }) {
|
|
105
|
+
const id = useId();
|
|
106
|
+
const items = sizes.map((size) => ({
|
|
107
|
+
value: String(size),
|
|
108
|
+
label: String(size)
|
|
109
|
+
}));
|
|
110
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
111
|
+
"data-slot": "pagination-page-size",
|
|
112
|
+
className: cn("flex items-center gap-2", textVariants({ variant: "small" }), className),
|
|
113
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
114
|
+
id,
|
|
115
|
+
children: label
|
|
116
|
+
}), /* @__PURE__ */ jsxs(Select, {
|
|
117
|
+
items,
|
|
118
|
+
value: String(value),
|
|
119
|
+
onValueChange: (next) => onValueChange(Number(next)),
|
|
120
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
121
|
+
"aria-labelledby": id,
|
|
122
|
+
size: "sm",
|
|
123
|
+
className: "w-20"
|
|
124
|
+
}), /* @__PURE__ */ jsx(SelectContent, { children: items.map((item) => /* @__PURE__ */ jsx(SelectItem, {
|
|
125
|
+
value: item.value,
|
|
126
|
+
children: item.label
|
|
127
|
+
}, item.value)) })]
|
|
128
|
+
})]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPageSize, PaginationPrevious, PaginationSummary };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PasswordInput as PasswordInput$1, PasswordInputControl } from "@ui-sdk/react/password-input";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
declare const variants: (props?: ({
|
|
5
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
type RootProps = Omit<ComponentProps<typeof PasswordInput$1>, "children" | "size">;
|
|
8
|
+
type ControlProps = Pick<ComponentProps<typeof PasswordInputControl>, "id" | "placeholder" | "maxLength" | "minLength" | "pattern" | "autoFocus" | "ref" | "onBlur" | "onFocus" | "aria-label" | "aria-labelledby" | "aria-describedby" | "aria-invalid" | "aria-required">;
|
|
9
|
+
type PasswordInputProps = RootProps & ControlProps & VariantProps<typeof variants> & {
|
|
10
|
+
/** The name of the toggle. It does not change while the password is shown. */
|
|
11
|
+
toggleLabel?: string;
|
|
12
|
+
};
|
|
13
|
+
declare function PasswordInput({ size, toggleLabel, className, id, placeholder, maxLength, minLength, pattern, autoFocus, ref, onBlur, onFocus, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, ...props }: PasswordInputProps): import("react").JSX.Element;
|
|
14
|
+
export { PasswordInput, type PasswordInputProps };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { PasswordInput as PasswordInput$1, PasswordInputControl, PasswordInputToggle } from "@ui-sdk/react/password-input";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { EyeIcon, EyeOffIcon } from "lucide-react";
|
|
4
|
+
import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
|
|
5
|
+
import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
|
|
6
|
+
import { a as groupSize, i as groupBox, o as iconButton } from "./input-BxjcqQS1.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// src/password-input/password-input.tsx
|
|
9
|
+
const variants = cva(groupBox, {
|
|
10
|
+
variants: { size: groupSize },
|
|
11
|
+
defaultVariants: { size: "default" }
|
|
12
|
+
});
|
|
13
|
+
function PasswordInput({ size = "default", toggleLabel = "Show password", className, id, placeholder, maxLength, minLength, pattern, autoFocus, ref, onBlur, onFocus, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, "aria-required": ariaRequired, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsxs(PasswordInput$1, {
|
|
15
|
+
"data-size": size,
|
|
16
|
+
...props,
|
|
17
|
+
className: withBase(variants({ size }), className),
|
|
18
|
+
children: [/* @__PURE__ */ jsx(PasswordInputControl, {
|
|
19
|
+
id,
|
|
20
|
+
placeholder,
|
|
21
|
+
maxLength,
|
|
22
|
+
minLength,
|
|
23
|
+
pattern,
|
|
24
|
+
autoFocus,
|
|
25
|
+
ref,
|
|
26
|
+
onBlur,
|
|
27
|
+
onFocus,
|
|
28
|
+
"aria-label": ariaLabel,
|
|
29
|
+
"aria-labelledby": ariaLabelledby,
|
|
30
|
+
"aria-describedby": ariaDescribedby,
|
|
31
|
+
"aria-invalid": ariaInvalid,
|
|
32
|
+
"aria-required": ariaRequired,
|
|
33
|
+
className: "h-full min-w-0 flex-1 bg-transparent placeholder:text-muted-foreground focus-visible:outline-hidden"
|
|
34
|
+
}), /* @__PURE__ */ jsx(PasswordInputToggle, {
|
|
35
|
+
"aria-label": toggleLabel,
|
|
36
|
+
className: cn(iconButton, focusRing),
|
|
37
|
+
children: (state) => state.visible ? /* @__PURE__ */ jsx(EyeOffIcon, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(EyeIcon, { "aria-hidden": "true" })
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export { PasswordInput };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Popover as Popover$1, PopoverArrow as PopoverArrow$1, PopoverClose as PopoverClose$1, PopoverContent as PopoverContent$1, PopoverDescription as PopoverDescription$1, PopoverTitle as PopoverTitle$1, PopoverTrigger as PopoverTrigger$1 } from "@ui-sdk/react/popover";
|
|
2
|
+
import { PartProps } from "@ui-sdk/react/primitive";
|
|
3
|
+
import { ComponentProps } from "react";
|
|
4
|
+
type PopoverProps = ComponentProps<typeof Popover$1>;
|
|
5
|
+
declare function Popover(props: PopoverProps): import("react").JSX.Element;
|
|
6
|
+
type PopoverTriggerProps = ComponentProps<typeof PopoverTrigger$1>;
|
|
7
|
+
declare function PopoverTrigger(props: PopoverTriggerProps): import("react").JSX.Element;
|
|
8
|
+
type PopoverContentProps = ComponentProps<typeof PopoverContent$1>;
|
|
9
|
+
declare function PopoverContent({ side, align, sideOffset, className, ...props }: PopoverContentProps): import("react").JSX.Element;
|
|
10
|
+
type PopoverArrowProps = ComponentProps<typeof PopoverArrow$1>;
|
|
11
|
+
declare function PopoverArrow({ className, ...props }: PopoverArrowProps): import("react").JSX.Element;
|
|
12
|
+
declare function PopoverHeader({ className, ...props }: PartProps<"div">): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
13
|
+
type PopoverTitleProps = ComponentProps<typeof PopoverTitle$1>;
|
|
14
|
+
declare function PopoverTitle({ className, ...props }: PopoverTitleProps): import("react").JSX.Element;
|
|
15
|
+
type PopoverDescriptionProps = ComponentProps<typeof PopoverDescription$1>;
|
|
16
|
+
declare function PopoverDescription({ className, ...props }: PopoverDescriptionProps): import("react").JSX.Element;
|
|
17
|
+
type PopoverCloseProps = ComponentProps<typeof PopoverClose$1>;
|
|
18
|
+
declare function PopoverClose(props: PopoverCloseProps): import("react").JSX.Element;
|
|
19
|
+
export { Popover, PopoverArrow, type PopoverArrowProps, PopoverClose, type PopoverCloseProps, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, PopoverHeader, type PopoverProps, PopoverTitle, type PopoverTitleProps, PopoverTrigger, type PopoverTriggerProps };
|
package/dist/popover.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Popover as Popover$1, PopoverArrow as PopoverArrow$1, PopoverClose as PopoverClose$1, PopoverContent as PopoverContent$1, PopoverDescription as PopoverDescription$1, PopoverTitle as PopoverTitle$1, PopoverTrigger as PopoverTrigger$1 } from "@ui-sdk/react/popover";
|
|
2
|
+
import { renderElement } from "@ui-sdk/react/primitive";
|
|
3
|
+
import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
|
|
4
|
+
import { n as popupMotion, r as popupSurface } from "./popup-CLsuJ-AA.js";
|
|
5
|
+
import { n as textVariants } from "./typography-Dy3PCTrL.js";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
// src/popover/popover.tsx
|
|
8
|
+
function Popover(props) {
|
|
9
|
+
return /* @__PURE__ */ jsx(Popover$1, { ...props });
|
|
10
|
+
}
|
|
11
|
+
function PopoverTrigger(props) {
|
|
12
|
+
return /* @__PURE__ */ jsx(PopoverTrigger$1, { ...props });
|
|
13
|
+
}
|
|
14
|
+
const contentClass = cn(popupSurface, popupMotion, "w-72 max-w-(--available-width) origin-(--transform-origin) p-4 text-start wrap-anywhere outline-hidden");
|
|
15
|
+
function PopoverContent({ side = "bottom", align = "center", sideOffset = 4, className, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(PopoverContent$1, {
|
|
17
|
+
side,
|
|
18
|
+
align,
|
|
19
|
+
sideOffset,
|
|
20
|
+
className: withBase(contentClass, className),
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const arrowClass = cn("size-2.5 rotate-45 bg-popover", "data-[side=bottom]:top-0 data-[side=bottom]:-translate-y-1/2 data-[side=bottom]:border-t data-[side=bottom]:border-l", "data-[side=top]:bottom-0 data-[side=top]:translate-y-1/2 data-[side=top]:border-r data-[side=top]:border-b", "data-[side=left]:right-0 data-[side=left]:translate-x-1/2 data-[side=left]:border-t data-[side=left]:border-r", "data-[side=right]:left-0 data-[side=right]:-translate-x-1/2 data-[side=right]:border-b data-[side=right]:border-l");
|
|
25
|
+
function PopoverArrow({ className, ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsx(PopoverArrow$1, {
|
|
27
|
+
"aria-hidden": true,
|
|
28
|
+
className: withBase(arrowClass, className),
|
|
29
|
+
...props
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function PopoverHeader({ className, ...props }) {
|
|
33
|
+
return renderElement("div", {
|
|
34
|
+
...props,
|
|
35
|
+
"data-slot": "popover-header",
|
|
36
|
+
className: cn("flex flex-col gap-1", className)
|
|
37
|
+
}, props.render);
|
|
38
|
+
}
|
|
39
|
+
function PopoverTitle({ className, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx(PopoverTitle$1, {
|
|
41
|
+
className: withBase(textVariants({ variant: "label" }), className),
|
|
42
|
+
...props
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function PopoverDescription({ className, ...props }) {
|
|
46
|
+
return /* @__PURE__ */ jsx(PopoverDescription$1, {
|
|
47
|
+
className: withBase(cn(textVariants({ variant: "small" }), "text-muted-foreground"), className),
|
|
48
|
+
...props
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function PopoverClose(props) {
|
|
52
|
+
return /* @__PURE__ */ jsx(PopoverClose$1, { ...props });
|
|
53
|
+
}
|
|
54
|
+
export { Popover, PopoverArrow, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// src/internal/popup.ts
|
|
2
|
+
const popupSurface = "m-0 rounded-popup border bg-popover p-1 text-popover-foreground shadow-md";
|
|
3
|
+
const popupGeometry = "max-h-(--available-height) min-w-(--anchor-width) origin-(--transform-origin)";
|
|
4
|
+
const popupMotion = "transition-[opacity,scale] duration-150 data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0 motion-reduce:data-starting-style:scale-100 motion-reduce:data-ending-style:scale-100";
|
|
5
|
+
const popup = `${popupSurface} ${popupGeometry} ${popupMotion}`;
|
|
6
|
+
export { popupMotion as n, popupSurface as r, popup as t };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Progress as Progress$1, ProgressIndicator as ProgressIndicator$1, ProgressLabel as ProgressLabel$1, ProgressTrack as ProgressTrack$1, ProgressValue as ProgressValue$1 } from "@ui-sdk/react/progress";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
declare function Progress({ className, ...props }: ComponentProps<typeof Progress$1>): import("react").JSX.Element;
|
|
4
|
+
declare function ProgressLabel({ className, ...props }: ComponentProps<typeof ProgressLabel$1>): import("react").JSX.Element;
|
|
5
|
+
declare function ProgressValue({ className, ...props }: ComponentProps<typeof ProgressValue$1>): import("react").JSX.Element;
|
|
6
|
+
declare function ProgressTrack({ className, ...props }: ComponentProps<typeof ProgressTrack$1>): import("react").JSX.Element;
|
|
7
|
+
declare function ProgressIndicator({ className, ...props }: ComponentProps<typeof ProgressIndicator$1>): import("react").JSX.Element;
|
|
8
|
+
export { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue };
|
package/dist/progress.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Progress as Progress$1, ProgressIndicator as ProgressIndicator$1, ProgressLabel as ProgressLabel$1, ProgressTrack as ProgressTrack$1, ProgressValue as ProgressValue$1 } from "@ui-sdk/react/progress";
|
|
2
|
+
import { n as withBase } from "./cn-B-fHM4Ov.js";
|
|
3
|
+
import { n as textVariants } from "./typography-Dy3PCTrL.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/progress/progress.tsx
|
|
6
|
+
function Progress({ className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Progress$1, {
|
|
8
|
+
...props,
|
|
9
|
+
className: withBase("grid w-full grid-cols-[1fr_auto] items-center gap-x-3 gap-y-2", className)
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function ProgressLabel({ className, ...props }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(ProgressLabel$1, {
|
|
14
|
+
...props,
|
|
15
|
+
className: withBase(textVariants({ variant: "label" }), className)
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function ProgressValue({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(ProgressValue$1, {
|
|
20
|
+
...props,
|
|
21
|
+
className: withBase(`${textVariants({ variant: "small" })} text-muted-foreground tabular-nums`, className)
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function ProgressTrack({ className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(ProgressTrack$1, {
|
|
26
|
+
...props,
|
|
27
|
+
className: withBase("col-span-2 h-2 w-full overflow-hidden rounded-full bg-muted", className)
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function ProgressIndicator({ className, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx(ProgressIndicator$1, {
|
|
32
|
+
...props,
|
|
33
|
+
className: withBase("h-full rounded-full bg-primary transition-[width] data-complete:bg-success data-indeterminate:w-full data-indeterminate:animate-pulse motion-reduce:data-indeterminate:animate-none", className)
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export { Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Radio, RadioGroup as RadioGroup$1, RadioGroupOptions } from "@ui-sdk/react/radio";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
type RootProps = ComponentProps<typeof RadioGroup$1>;
|
|
4
|
+
type ValueDetails = Parameters<NonNullable<RadioGroupOptions<string>["onValueChange"]>>[1];
|
|
5
|
+
type RadioGroupProps = Omit<RootProps, "value" | "defaultValue" | "onValueChange"> & {
|
|
6
|
+
value?: string;
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
onValueChange?: (value: string, details: ValueDetails) => void;
|
|
9
|
+
orientation?: "vertical" | "horizontal";
|
|
10
|
+
};
|
|
11
|
+
declare function RadioGroup({ value, defaultValue, onValueChange, orientation, className, ...props }: RadioGroupProps): import("react").JSX.Element;
|
|
12
|
+
type RadioGroupItemProps = Omit<ComponentProps<typeof Radio>, "children">;
|
|
13
|
+
declare function RadioGroupItem({ className, ...props }: RadioGroupItemProps): import("react").JSX.Element;
|
|
14
|
+
export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Radio, RadioGroup as RadioGroup$1, RadioIndicator } from "@ui-sdk/react/radio";
|
|
2
|
+
import { n as withBase, t as cn } from "./cn-B-fHM4Ov.js";
|
|
3
|
+
import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
// src/radio-group/radio-group.tsx
|
|
6
|
+
function RadioGroup({ value, defaultValue, onValueChange, orientation = "vertical", className, ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(RadioGroup$1, {
|
|
8
|
+
...props,
|
|
9
|
+
value: value === void 0 ? void 0 : value || null,
|
|
10
|
+
defaultValue: defaultValue === void 0 ? void 0 : defaultValue || null,
|
|
11
|
+
onValueChange: (next, details) => onValueChange?.(next ?? "", details),
|
|
12
|
+
"data-orientation": orientation,
|
|
13
|
+
className: withBase(orientation === "horizontal" ? "flex flex-wrap gap-x-6 gap-y-3" : "grid gap-3", className)
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const itemClass = cn("relative inline-flex aspect-square size-4 shrink-0 items-center justify-center rounded-full border border-primary bg-background transition-colors", "after:absolute after:top-1/2 after:left-1/2 after:size-6 after:-translate-1/2", "[&:not([data-disabled],[data-readonly]):hover]:bg-accent", "in-aria-invalid:border-destructive in-data-invalid:border-destructive", "data-disabled:cursor-not-allowed data-disabled:opacity-50 data-readonly:cursor-default", focusRing);
|
|
17
|
+
const indicatorClass = cn("size-2 rounded-full bg-primary transition-[opacity,scale] duration-150", "data-starting-style:scale-50 data-starting-style:opacity-0 data-ending-style:scale-50 data-ending-style:opacity-0");
|
|
18
|
+
function RadioGroupItem({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Radio, {
|
|
20
|
+
className: withBase(itemClass, className),
|
|
21
|
+
...props,
|
|
22
|
+
children: /* @__PURE__ */ jsx(RadioIndicator, { className: indicatorClass })
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ScrollArea as ScrollArea$1 } from "@ui-sdk/react/scroll-area";
|
|
2
|
+
import { ComponentProps, ReactNode } from "react";
|
|
3
|
+
type ScrollAreaOrientation = "vertical" | "horizontal" | "both";
|
|
4
|
+
type UIScrollAreaProps = ComponentProps<typeof ScrollArea$1>;
|
|
5
|
+
type ScrollAreaProps = Omit<UIScrollAreaProps, "children"> & {
|
|
6
|
+
/** Which scrollbars it shows; the content still scrolls on any axis it overflows. */
|
|
7
|
+
orientation?: ScrollAreaOrientation;
|
|
8
|
+
/** The accessible name of the scrolling region. Name every region that is worth finding. */
|
|
9
|
+
"aria-label"?: string;
|
|
10
|
+
"aria-labelledby"?: string;
|
|
11
|
+
/** The name of the button that returns to the end; only with `stickToEnd`. */
|
|
12
|
+
scrollToEndLabel?: string;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
declare function ScrollArea({ orientation, type, stickToEnd, scrollToEndLabel, "aria-label": label, "aria-labelledby": labelledBy, className, children, ...props }: ScrollAreaProps): import("react").JSX.Element;
|
|
16
|
+
export { ScrollArea, type ScrollAreaOrientation, type ScrollAreaProps };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ScrollArea as ScrollArea$1, ScrollAreaContent, ScrollAreaCorner, ScrollAreaScrollToEnd, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport } from "@ui-sdk/react/scroll-area";
|
|
2
|
+
import { ArrowDownIcon } from "lucide-react";
|
|
3
|
+
import { t as Button } from "./button-DEsRlveL.js";
|
|
4
|
+
import { n as withBase } from "./cn-B-fHM4Ov.js";
|
|
5
|
+
import { t as focusRing } from "./focus-ring-BpxMbGAn.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// src/scroll-area/scroll-area.tsx
|
|
8
|
+
const edges = "pointer-events-none absolute inset-1 z-10 border border-border in-data-at-x-end:border-e-transparent in-data-at-x-start:border-s-transparent in-data-at-y-end:border-b-transparent in-data-at-y-start:border-t-transparent";
|
|
9
|
+
function ScrollBar({ orientation }) {
|
|
10
|
+
return /* @__PURE__ */ jsx(ScrollAreaScrollbar, {
|
|
11
|
+
orientation,
|
|
12
|
+
className: "touch-none p-px opacity-0 transition-opacity duration-150 select-none data-[orientation=horizontal]:h-2.5 data-[orientation=vertical]:w-2.5 data-visible:opacity-100 motion-reduce:transition-none",
|
|
13
|
+
children: /* @__PURE__ */ jsx(ScrollAreaThumb, { className: "rounded-full bg-border data-dragging:bg-muted-foreground data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full" })
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function ScrollArea({ orientation = "vertical", type = "hover", stickToEnd, scrollToEndLabel = "Scroll to latest", "aria-label": label, "aria-labelledby": labelledBy, className, children, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsxs(ScrollArea$1, {
|
|
18
|
+
...props,
|
|
19
|
+
type,
|
|
20
|
+
stickToEnd,
|
|
21
|
+
className: withBase("relative", className),
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ jsx(ScrollAreaViewport, {
|
|
24
|
+
...label || labelledBy ? {
|
|
25
|
+
role: "region",
|
|
26
|
+
"aria-label": label,
|
|
27
|
+
"aria-labelledby": labelledBy
|
|
28
|
+
} : {},
|
|
29
|
+
className: `size-full rounded-[inherit] ${focusRing}`,
|
|
30
|
+
children: /* @__PURE__ */ jsx(ScrollAreaContent, { children })
|
|
31
|
+
}),
|
|
32
|
+
/* @__PURE__ */ jsx("div", {
|
|
33
|
+
"aria-hidden": true,
|
|
34
|
+
"data-slot": "scroll-area-edges",
|
|
35
|
+
className: edges
|
|
36
|
+
}),
|
|
37
|
+
orientation !== "horizontal" && /* @__PURE__ */ jsx(ScrollBar, { orientation: "vertical" }),
|
|
38
|
+
orientation !== "vertical" && /* @__PURE__ */ jsx(ScrollBar, { orientation: "horizontal" }),
|
|
39
|
+
orientation === "both" && /* @__PURE__ */ jsx(ScrollAreaCorner, {}),
|
|
40
|
+
stickToEnd && /* @__PURE__ */ jsx(ScrollAreaScrollToEnd, {
|
|
41
|
+
"aria-label": scrollToEndLabel,
|
|
42
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
43
|
+
variant: "outline",
|
|
44
|
+
size: "icon-sm"
|
|
45
|
+
}),
|
|
46
|
+
className: "absolute end-3 bottom-3 z-10 opacity-0 transition-opacity data-visible:opacity-100 motion-reduce:transition-none",
|
|
47
|
+
children: /* @__PURE__ */ jsx(ArrowDownIcon, { "aria-hidden": true })
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export { ScrollArea };
|