@la-batcave/ui 3.1.2
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 +95 -0
- package/dist/Alert.d.ts +27 -0
- package/dist/Alert.js +56 -0
- package/dist/Avatar.d.ts +20 -0
- package/dist/Avatar.js +40 -0
- package/dist/Badge.d.ts +56 -0
- package/dist/Badge.js +74 -0
- package/dist/Button.d.ts +53 -0
- package/dist/Button.js +66 -0
- package/dist/Card.d.ts +18 -0
- package/dist/Card.js +98 -0
- package/dist/CodeBlock.d.ts +45 -0
- package/dist/CodeBlock.js +306 -0
- package/dist/Collapse.d.ts +58 -0
- package/dist/Collapse.js +89 -0
- package/dist/Combobox.d.ts +44 -0
- package/dist/Combobox.js +409 -0
- package/dist/DarkMode.d.ts +59 -0
- package/dist/DarkMode.js +56 -0
- package/dist/DatePicker.d.ts +48 -0
- package/dist/DatePicker.js +2954 -0
- package/dist/Dialog.d.ts +119 -0
- package/dist/Dialog.js +337 -0
- package/dist/Drawer.d.ts +28 -0
- package/dist/Drawer.js +1126 -0
- package/dist/Dropdown.d.ts +23 -0
- package/dist/Dropdown.js +247 -0
- package/dist/EasyForm.d.ts +138 -0
- package/dist/EasyForm.js +286 -0
- package/dist/HoverCard.d.ts +10 -0
- package/dist/HoverCard.js +195 -0
- package/dist/Input.d.ts +230 -0
- package/dist/Input.js +2216 -0
- package/dist/LogViewer.d.ts +57 -0
- package/dist/LogViewer.js +120 -0
- package/dist/Menubar.d.ts +32 -0
- package/dist/Menubar.js +398 -0
- package/dist/Navbar.d.ts +20 -0
- package/dist/Navbar.js +31 -0
- package/dist/Pagination.d.ts +78 -0
- package/dist/Pagination.js +106 -0
- package/dist/Popover.d.ts +11 -0
- package/dist/Popover.js +28 -0
- package/dist/ProgressBar.d.ts +35 -0
- package/dist/ProgressBar.js +210 -0
- package/dist/Resizable.d.ts +23 -0
- package/dist/Resizable.js +1532 -0
- package/dist/Separator.d.ts +4 -0
- package/dist/Separator.js +46 -0
- package/dist/Sheet.d.ts +29 -0
- package/dist/Sheet.js +104 -0
- package/dist/Sidebar.d.ts +117 -0
- package/dist/Sidebar.js +237 -0
- package/dist/Skeleton.d.ts +57 -0
- package/dist/Skeleton.js +47 -0
- package/dist/Table.d.ts +71 -0
- package/dist/Table.js +94 -0
- package/dist/Tabs.d.ts +76 -0
- package/dist/Tabs.js +202 -0
- package/dist/Toast.d.ts +54 -0
- package/dist/Toast.js +827 -0
- package/dist/Tooltip.d.ts +29 -0
- package/dist/Tooltip.js +352 -0
- package/dist/Typography.d.ts +101 -0
- package/dist/Typography.js +123 -0
- package/dist/Widget.d.ts +133 -0
- package/dist/Widget.js +207 -0
- package/dist/_shared/Combination-D_l4PLF_.js +676 -0
- package/dist/_shared/index-B03TCNO5.js +142 -0
- package/dist/_shared/index-B1f-hyuh.js +31 -0
- package/dist/_shared/index-BC7vfx-u.js +13 -0
- package/dist/_shared/index-BrLJJgkl.js +67 -0
- package/dist/_shared/index-C0gNQvxa.js +269 -0
- package/dist/_shared/index-C3aZemLI.js +268 -0
- package/dist/_shared/index-CXeb1OMI.js +198 -0
- package/dist/_shared/index-CukUn3R0.js +626 -0
- package/dist/_shared/index-DLcqcWxM.js +29 -0
- package/dist/_shared/index-DlSuDb9N.js +283 -0
- package/dist/_shared/index-V-Ajw7Ac.js +79 -0
- package/dist/_shared/index-uPOYJZpG.js +34 -0
- package/dist/_shared/index-uu9PT5Nu.js +1588 -0
- package/dist/_shared/utils-eGXXUFl7.js +2935 -0
- package/dist/backgrounds/Aurora.d.ts +7 -0
- package/dist/backgrounds/Aurora.js +126 -0
- package/dist/backgrounds/Iridescence.d.ts +7 -0
- package/dist/backgrounds/Iridescence.js +77 -0
- package/dist/backgrounds/Lightning.d.ts +8 -0
- package/dist/backgrounds/Lightning.js +75 -0
- package/dist/backgrounds/LiquidChrome.d.ts +9 -0
- package/dist/backgrounds/LiquidChrome.js +89 -0
- package/dist/backgrounds/Particles.d.ts +15 -0
- package/dist/backgrounds/Particles.js +137 -0
- package/dist/backgrounds/PixelSnow.d.ts +9 -0
- package/dist/backgrounds/PixelSnow.js +52 -0
- package/dist/backgrounds/Silk.d.ts +8 -0
- package/dist/backgrounds/Silk.js +92 -0
- package/dist/backgrounds/Squares.d.ts +9 -0
- package/dist/backgrounds/Squares.js +75 -0
- package/dist/backgrounds/Threads.d.ts +7 -0
- package/dist/backgrounds/Threads.js +110 -0
- package/dist/backgrounds/Waves.d.ts +14 -0
- package/dist/backgrounds/Waves.js +139 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/package.json +318 -0
package/dist/Table.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Column definition for EasyTable. */
|
|
3
|
+
export interface EasyTableColumn<T = Record<string, unknown>> {
|
|
4
|
+
/** Property key used to access the cell value from each row object. */
|
|
5
|
+
key: string;
|
|
6
|
+
/** Header label displayed in the column header. */
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
/** Optional fixed column width (CSS value, e.g. "200px"). */
|
|
9
|
+
width?: string;
|
|
10
|
+
/** Custom render function for cell content. Receives the cell value and the full row. */
|
|
11
|
+
render?: (value: unknown, row: T) => React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export interface EasyTableProps<T = Record<string, unknown>> extends React.TableHTMLAttributes<HTMLTableElement> {
|
|
14
|
+
/** Array of column definitions describing headers and cell rendering. */
|
|
15
|
+
columns: EasyTableColumn<T>[];
|
|
16
|
+
/** Array of row data objects. Each object is keyed by column `key`. */
|
|
17
|
+
data: T[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Scrollable table wrapper with rounded border.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <Table>
|
|
24
|
+
* <TableHeader>
|
|
25
|
+
* <TableRow>
|
|
26
|
+
* <TableHead>Name</TableHead>
|
|
27
|
+
* <TableHead>Status</TableHead>
|
|
28
|
+
* </TableRow>
|
|
29
|
+
* </TableHeader>
|
|
30
|
+
* <TableBody>
|
|
31
|
+
* <TableRow>
|
|
32
|
+
* <TableCell>Alice</TableCell>
|
|
33
|
+
* <TableCell><Badge>Active</Badge></TableCell>
|
|
34
|
+
* </TableRow>
|
|
35
|
+
* </TableBody>
|
|
36
|
+
* </Table>
|
|
37
|
+
*/
|
|
38
|
+
declare function Table({ className, ...props }: React.TableHTMLAttributes<HTMLTableElement>): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
/** Container for table header rows. Renders `<thead>`. */
|
|
40
|
+
declare function TableHeader({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
/** Container for table body rows. Renders `<tbody>`. */
|
|
42
|
+
declare function TableBody({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
/**
|
|
44
|
+
* Table row with hover highlight. Renders `<tr>`.
|
|
45
|
+
* @description Hover effect uses primary/8 opacity.
|
|
46
|
+
*/
|
|
47
|
+
declare function TableRow({ className, ...props }: React.HTMLAttributes<HTMLTableRowElement>): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
/**
|
|
49
|
+
* Table header cell. Renders `<th>`.
|
|
50
|
+
* @description Uppercase, muted foreground, bg-muted background.
|
|
51
|
+
*/
|
|
52
|
+
declare function TableHead({ className, ...props }: React.ThHTMLAttributes<HTMLTableCellElement>): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
/** Table data cell. Renders `<td>`. */
|
|
54
|
+
declare function TableCell({ className, ...props }: React.TdHTMLAttributes<HTMLTableCellElement>): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
/** Table caption. Renders `<caption>`. */
|
|
56
|
+
declare function TableCaption({ className, ...props }: React.HTMLAttributes<HTMLTableCaptionElement>): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
/**
|
|
58
|
+
* Declarative table with columns + data API. Built on top of the shadcn-style
|
|
59
|
+
* Table primitives. Supports custom cell renderers and fixed column widths.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* <EasyTable
|
|
63
|
+
* columns={[
|
|
64
|
+
* { key: "name", label: "Name" },
|
|
65
|
+
* { key: "status", label: "Status", render: (v) => <Badge>{v}</Badge> },
|
|
66
|
+
* ]}
|
|
67
|
+
* data={[{ name: "Alice", status: "Active" }]}
|
|
68
|
+
* />
|
|
69
|
+
*/
|
|
70
|
+
declare function EasyTable<T extends Record<string, unknown> = Record<string, unknown>>({ columns, data, className, ...props }: EasyTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
export { Table, TableHeader, TableBody, TableRow, TableHead, TableCell, TableCaption, EasyTable };
|
package/dist/Table.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as d } from "./_shared/utils-eGXXUFl7.js";
|
|
3
|
+
function c({ className: e, ...t }) {
|
|
4
|
+
return /* @__PURE__ */ r("div", { className: "overflow-x-auto rounded-lg border border-border blurred-bg", children: /* @__PURE__ */ r(
|
|
5
|
+
"table",
|
|
6
|
+
{
|
|
7
|
+
"data-slot": "table",
|
|
8
|
+
className: d("w-full border-collapse text-sm", e),
|
|
9
|
+
...t
|
|
10
|
+
}
|
|
11
|
+
) });
|
|
12
|
+
}
|
|
13
|
+
function u({ className: e, ...t }) {
|
|
14
|
+
return /* @__PURE__ */ r(
|
|
15
|
+
"thead",
|
|
16
|
+
{
|
|
17
|
+
"data-slot": "table-header",
|
|
18
|
+
className: d("border-b border-border", e),
|
|
19
|
+
...t
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
function m({ className: e, ...t }) {
|
|
24
|
+
return /* @__PURE__ */ r(
|
|
25
|
+
"tbody",
|
|
26
|
+
{
|
|
27
|
+
"data-slot": "table-body",
|
|
28
|
+
className: d("[&_tr:last-child]:border-0", e),
|
|
29
|
+
...t
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function o({ className: e, ...t }) {
|
|
34
|
+
return /* @__PURE__ */ r(
|
|
35
|
+
"tr",
|
|
36
|
+
{
|
|
37
|
+
"data-slot": "table-row",
|
|
38
|
+
className: d(
|
|
39
|
+
"border-b border-border transition-colors hover:bg-primary/8",
|
|
40
|
+
e
|
|
41
|
+
),
|
|
42
|
+
...t
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function f({ className: e, ...t }) {
|
|
47
|
+
return /* @__PURE__ */ r(
|
|
48
|
+
"th",
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "table-head",
|
|
51
|
+
className: d(
|
|
52
|
+
"text-left text-xs font-semibold uppercase tracking-wider text-muted-foreground px-4 py-3 bg-muted",
|
|
53
|
+
e
|
|
54
|
+
),
|
|
55
|
+
...t
|
|
56
|
+
}
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
function h({ className: e, ...t }) {
|
|
60
|
+
return /* @__PURE__ */ r(
|
|
61
|
+
"td",
|
|
62
|
+
{
|
|
63
|
+
"data-slot": "table-cell",
|
|
64
|
+
className: d("px-4 py-3 text-foreground", e),
|
|
65
|
+
...t
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
function y({ className: e, ...t }) {
|
|
70
|
+
return /* @__PURE__ */ r(
|
|
71
|
+
"caption",
|
|
72
|
+
{
|
|
73
|
+
"data-slot": "table-caption",
|
|
74
|
+
className: d("mt-4 text-sm text-muted-foreground", e),
|
|
75
|
+
...t
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
function g({ columns: e, data: t, className: n, ...b }) {
|
|
80
|
+
return /* @__PURE__ */ i(c, { className: n, ...b, children: [
|
|
81
|
+
/* @__PURE__ */ r(u, { children: /* @__PURE__ */ r(o, { children: e.map((a) => /* @__PURE__ */ r(f, { style: a.width ? { width: a.width } : void 0, children: a.label }, a.key)) }) }),
|
|
82
|
+
/* @__PURE__ */ r(m, { children: t.map((a, s) => /* @__PURE__ */ r(o, { children: e.map((l) => /* @__PURE__ */ r(h, { children: l.render ? l.render(a[l.key], a) : a[l.key] }, l.key)) }, s)) })
|
|
83
|
+
] });
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
g as EasyTable,
|
|
87
|
+
c as Table,
|
|
88
|
+
m as TableBody,
|
|
89
|
+
y as TableCaption,
|
|
90
|
+
h as TableCell,
|
|
91
|
+
f as TableHead,
|
|
92
|
+
u as TableHeader,
|
|
93
|
+
o as TableRow
|
|
94
|
+
};
|
package/dist/Tabs.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/** Definition for a single tab item. */
|
|
3
|
+
export interface TabItem {
|
|
4
|
+
/** Unique identifier used as the tab value. */
|
|
5
|
+
key: string;
|
|
6
|
+
/** Display label for the tab. */
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
/** Optional icon rendered before the label. */
|
|
9
|
+
icon?: React.ComponentType<{
|
|
10
|
+
size?: number;
|
|
11
|
+
className?: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
export interface TabsProps {
|
|
15
|
+
/** Array of tab definitions. */
|
|
16
|
+
tabs: TabItem[];
|
|
17
|
+
/** Key of the currently active tab. */
|
|
18
|
+
active: string;
|
|
19
|
+
/** Callback fired when a tab is selected, receives the tab key. */
|
|
20
|
+
onChange: (key: string) => void;
|
|
21
|
+
/** Additional CSS classes for the tab list container. */
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Underline-style tab navigation built on Radix UI Tabs.
|
|
26
|
+
* The active tab is highlighted with a primary-colored bottom border.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* <Tabs
|
|
30
|
+
* tabs={[
|
|
31
|
+
* { key: "overview", label: "Overview", icon: LayoutDashboard },
|
|
32
|
+
* { key: "settings", label: "Settings", icon: Settings },
|
|
33
|
+
* ]}
|
|
34
|
+
* active={tab}
|
|
35
|
+
* onChange={setTab}
|
|
36
|
+
* />
|
|
37
|
+
*/
|
|
38
|
+
declare function Tabs({ tabs, active, onChange, className }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
/** Definition for a single navigation pill item. */
|
|
40
|
+
export interface NavPillItem {
|
|
41
|
+
/** Unique identifier for the pill. */
|
|
42
|
+
key: string;
|
|
43
|
+
/** Display label for the pill. */
|
|
44
|
+
label: React.ReactNode;
|
|
45
|
+
/** Optional icon rendered before the label. */
|
|
46
|
+
icon?: React.ComponentType<{
|
|
47
|
+
size?: number;
|
|
48
|
+
className?: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
export interface NavPillsProps {
|
|
52
|
+
/** Array of pill item definitions. */
|
|
53
|
+
items: NavPillItem[];
|
|
54
|
+
/** Key of the currently active pill. */
|
|
55
|
+
active: string;
|
|
56
|
+
/** Callback fired when a pill is clicked, receives the item key. */
|
|
57
|
+
onChange: (key: string) => void;
|
|
58
|
+
/** Additional CSS classes for the nav container. */
|
|
59
|
+
className?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Pill-style navigation with rounded active indicator. Alternative to Tabs
|
|
63
|
+
* for horizontal navigation where a softer visual style is preferred.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* <NavPills
|
|
67
|
+
* items={[
|
|
68
|
+
* { key: "all", label: "All" },
|
|
69
|
+
* { key: "active", label: "Active" },
|
|
70
|
+
* ]}
|
|
71
|
+
* active={filter}
|
|
72
|
+
* onChange={setFilter}
|
|
73
|
+
* />
|
|
74
|
+
*/
|
|
75
|
+
declare function NavPills({ items, active, onChange, className }: NavPillsProps): import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
export { Tabs, NavPills };
|
package/dist/Tabs.js
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as i, jsxs as x } from "react/jsx-runtime";
|
|
3
|
+
import * as f from "react";
|
|
4
|
+
import { u as k, c as T, a as E, P as F } from "./_shared/index-CXeb1OMI.js";
|
|
5
|
+
import { u as w, R as V, I as D, c as y } from "./_shared/index-C0gNQvxa.js";
|
|
6
|
+
import { P as p } from "./_shared/index-V-Ajw7Ac.js";
|
|
7
|
+
import { u as G } from "./_shared/index-BC7vfx-u.js";
|
|
8
|
+
import { c as m } from "./_shared/utils-eGXXUFl7.js";
|
|
9
|
+
var g = "Tabs", [$] = E(g, [
|
|
10
|
+
y
|
|
11
|
+
]), C = y(), [L, h] = $(g), I = f.forwardRef(
|
|
12
|
+
(t, o) => {
|
|
13
|
+
const {
|
|
14
|
+
__scopeTabs: n,
|
|
15
|
+
value: r,
|
|
16
|
+
onValueChange: e,
|
|
17
|
+
defaultValue: l,
|
|
18
|
+
orientation: a = "horizontal",
|
|
19
|
+
dir: u,
|
|
20
|
+
activationMode: v = "automatic",
|
|
21
|
+
...b
|
|
22
|
+
} = t, c = w(u), [s, d] = k({
|
|
23
|
+
prop: r,
|
|
24
|
+
onChange: e,
|
|
25
|
+
defaultProp: l ?? "",
|
|
26
|
+
caller: g
|
|
27
|
+
});
|
|
28
|
+
return /* @__PURE__ */ i(
|
|
29
|
+
L,
|
|
30
|
+
{
|
|
31
|
+
scope: n,
|
|
32
|
+
baseId: G(),
|
|
33
|
+
value: s,
|
|
34
|
+
onValueChange: d,
|
|
35
|
+
orientation: a,
|
|
36
|
+
dir: c,
|
|
37
|
+
activationMode: v,
|
|
38
|
+
children: /* @__PURE__ */ i(
|
|
39
|
+
p.div,
|
|
40
|
+
{
|
|
41
|
+
dir: c,
|
|
42
|
+
"data-orientation": a,
|
|
43
|
+
...b,
|
|
44
|
+
ref: o
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
I.displayName = g;
|
|
52
|
+
var N = "TabsList", R = f.forwardRef(
|
|
53
|
+
(t, o) => {
|
|
54
|
+
const { __scopeTabs: n, loop: r = !0, ...e } = t, l = h(N, n), a = C(n);
|
|
55
|
+
return /* @__PURE__ */ i(
|
|
56
|
+
V,
|
|
57
|
+
{
|
|
58
|
+
asChild: !0,
|
|
59
|
+
...a,
|
|
60
|
+
orientation: l.orientation,
|
|
61
|
+
dir: l.dir,
|
|
62
|
+
loop: r,
|
|
63
|
+
children: /* @__PURE__ */ i(
|
|
64
|
+
p.div,
|
|
65
|
+
{
|
|
66
|
+
role: "tablist",
|
|
67
|
+
"aria-orientation": l.orientation,
|
|
68
|
+
...e,
|
|
69
|
+
ref: o
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
R.displayName = N;
|
|
77
|
+
var P = "TabsTrigger", _ = f.forwardRef(
|
|
78
|
+
(t, o) => {
|
|
79
|
+
const { __scopeTabs: n, value: r, disabled: e = !1, ...l } = t, a = h(P, n), u = C(n), v = M(a.baseId, r), b = S(a.baseId, r), c = r === a.value;
|
|
80
|
+
return /* @__PURE__ */ i(
|
|
81
|
+
D,
|
|
82
|
+
{
|
|
83
|
+
asChild: !0,
|
|
84
|
+
...u,
|
|
85
|
+
focusable: !e,
|
|
86
|
+
active: c,
|
|
87
|
+
children: /* @__PURE__ */ i(
|
|
88
|
+
p.button,
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
role: "tab",
|
|
92
|
+
"aria-selected": c,
|
|
93
|
+
"aria-controls": b,
|
|
94
|
+
"data-state": c ? "active" : "inactive",
|
|
95
|
+
"data-disabled": e ? "" : void 0,
|
|
96
|
+
disabled: e,
|
|
97
|
+
id: v,
|
|
98
|
+
...l,
|
|
99
|
+
ref: o,
|
|
100
|
+
onMouseDown: T(t.onMouseDown, (s) => {
|
|
101
|
+
!e && s.button === 0 && s.ctrlKey === !1 ? a.onValueChange(r) : s.preventDefault();
|
|
102
|
+
}),
|
|
103
|
+
onKeyDown: T(t.onKeyDown, (s) => {
|
|
104
|
+
[" ", "Enter"].includes(s.key) && a.onValueChange(r);
|
|
105
|
+
}),
|
|
106
|
+
onFocus: T(t.onFocus, () => {
|
|
107
|
+
const s = a.activationMode !== "manual";
|
|
108
|
+
!c && !e && s && a.onValueChange(r);
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
_.displayName = P;
|
|
117
|
+
var A = "TabsContent", z = f.forwardRef(
|
|
118
|
+
(t, o) => {
|
|
119
|
+
const { __scopeTabs: n, value: r, forceMount: e, children: l, ...a } = t, u = h(A, n), v = M(u.baseId, r), b = S(u.baseId, r), c = r === u.value, s = f.useRef(c);
|
|
120
|
+
return f.useEffect(() => {
|
|
121
|
+
const d = requestAnimationFrame(() => s.current = !1);
|
|
122
|
+
return () => cancelAnimationFrame(d);
|
|
123
|
+
}, []), /* @__PURE__ */ i(F, { present: e || c, children: ({ present: d }) => /* @__PURE__ */ i(
|
|
124
|
+
p.div,
|
|
125
|
+
{
|
|
126
|
+
"data-state": c ? "active" : "inactive",
|
|
127
|
+
"data-orientation": u.orientation,
|
|
128
|
+
role: "tabpanel",
|
|
129
|
+
"aria-labelledby": v,
|
|
130
|
+
hidden: !d,
|
|
131
|
+
id: b,
|
|
132
|
+
tabIndex: 0,
|
|
133
|
+
...a,
|
|
134
|
+
ref: o,
|
|
135
|
+
style: {
|
|
136
|
+
...t.style,
|
|
137
|
+
animationDuration: s.current ? "0s" : void 0
|
|
138
|
+
},
|
|
139
|
+
children: d && l
|
|
140
|
+
}
|
|
141
|
+
) });
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
z.displayName = A;
|
|
145
|
+
function M(t, o) {
|
|
146
|
+
return `${t}-trigger-${o}`;
|
|
147
|
+
}
|
|
148
|
+
function S(t, o) {
|
|
149
|
+
return `${t}-content-${o}`;
|
|
150
|
+
}
|
|
151
|
+
var K = I, j = R, B = _;
|
|
152
|
+
function W({ tabs: t, active: o, onChange: n, className: r }) {
|
|
153
|
+
return /* @__PURE__ */ i(K, { value: o, onValueChange: n, children: /* @__PURE__ */ i(
|
|
154
|
+
j,
|
|
155
|
+
{
|
|
156
|
+
className: m(
|
|
157
|
+
"inline-flex items-center gap-1 border-b border-border",
|
|
158
|
+
r
|
|
159
|
+
),
|
|
160
|
+
children: t.map((e) => /* @__PURE__ */ x(
|
|
161
|
+
B,
|
|
162
|
+
{
|
|
163
|
+
value: e.key,
|
|
164
|
+
className: m(
|
|
165
|
+
"inline-flex items-center gap-2 px-3 py-2 text-sm font-medium transition-all outline-none cursor-pointer",
|
|
166
|
+
"text-muted-foreground border-b-2 border-transparent -mb-px",
|
|
167
|
+
"hover:text-foreground",
|
|
168
|
+
"data-[state=active]:text-primary data-[state=active]:border-b-primary",
|
|
169
|
+
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:rounded-sm"
|
|
170
|
+
),
|
|
171
|
+
children: [
|
|
172
|
+
e.icon && /* @__PURE__ */ i(e.icon, { size: 15 }),
|
|
173
|
+
e.label
|
|
174
|
+
]
|
|
175
|
+
},
|
|
176
|
+
e.key
|
|
177
|
+
))
|
|
178
|
+
}
|
|
179
|
+
) });
|
|
180
|
+
}
|
|
181
|
+
function X({ items: t, active: o, onChange: n, className: r }) {
|
|
182
|
+
return /* @__PURE__ */ i("nav", { className: m("flex items-center gap-2", r), children: t.map((e) => /* @__PURE__ */ x(
|
|
183
|
+
"button",
|
|
184
|
+
{
|
|
185
|
+
onClick: () => n(e.key),
|
|
186
|
+
className: m(
|
|
187
|
+
"flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-full border border-transparent transition-all outline-none cursor-pointer",
|
|
188
|
+
o === e.key ? "bg-accent text-accent-foreground border-primary/40" : "text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
189
|
+
"focus-visible:ring-2 focus-visible:ring-ring"
|
|
190
|
+
),
|
|
191
|
+
children: [
|
|
192
|
+
e.icon && /* @__PURE__ */ i(e.icon, { size: 15 }),
|
|
193
|
+
e.label
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
e.key
|
|
197
|
+
)) });
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
X as NavPills,
|
|
201
|
+
W as Tabs
|
|
202
|
+
};
|
package/dist/Toast.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ToastProviderProps {
|
|
3
|
+
/** Screen position for toast notifications. @default "bottom-right" */
|
|
4
|
+
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';
|
|
5
|
+
/** Additional CSS classes. */
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ToastOptions {
|
|
9
|
+
/** Toast body text. Required when using object form. */
|
|
10
|
+
message: React.ReactNode;
|
|
11
|
+
/** Optional bold title displayed above the message. */
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
/** Override the default variant icon. */
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
/** Auto-dismiss delay in milliseconds. @default 4000 */
|
|
16
|
+
duration?: number;
|
|
17
|
+
}
|
|
18
|
+
export type ToastInput = React.ReactNode | ToastOptions;
|
|
19
|
+
/**
|
|
20
|
+
* Toast notification container built on Sonner. Mount once at the app root
|
|
21
|
+
* to enable toast notifications via `btcvToast`.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // In your app root:
|
|
25
|
+
* <ToastProvider position="bottom-right" />
|
|
26
|
+
*/
|
|
27
|
+
declare function ToastProvider({ position, className, ...props }: ToastProviderProps & Record<string, unknown>): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* Pre-styled toast trigger functions. Each method shows a toast with the
|
|
30
|
+
* appropriate icon and left border color (success, error, warning, info).
|
|
31
|
+
*
|
|
32
|
+
* Accepts a simple string or an options object with `message`, `title`, and `icon`.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* import { toast } from '@la-batcave/ui/Toast';
|
|
36
|
+
*
|
|
37
|
+
* // Simple string
|
|
38
|
+
* toast.success("Changes saved");
|
|
39
|
+
* toast.error("Something went wrong");
|
|
40
|
+
*
|
|
41
|
+
* // Object with title
|
|
42
|
+
* toast.success({ title: "Build #42", message: "Completed in 1m32s" });
|
|
43
|
+
*
|
|
44
|
+
* // Object with custom icon
|
|
45
|
+
* toast.info({ message: "Syncing...", icon: <Loader2 className="animate-spin" /> });
|
|
46
|
+
*/
|
|
47
|
+
declare const btcvToast: {
|
|
48
|
+
success: (msgOrOptions: ToastInput) => string | number;
|
|
49
|
+
error: (msgOrOptions: ToastInput) => string | number;
|
|
50
|
+
warning: (msgOrOptions: ToastInput) => string | number;
|
|
51
|
+
info: (msgOrOptions: ToastInput) => string | number;
|
|
52
|
+
};
|
|
53
|
+
/** @deprecated Use `toast` instead. */
|
|
54
|
+
export { ToastProvider, btcvToast as toast, btcvToast };
|