@lerianstudio/sindarian-ui 1.3.0-beta.1 → 1.3.0-beta.3
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/dist/components/card/account-card/index.d.ts.map +1 -1
- package/dist/components/card/account-card/index.js +2 -2
- package/dist/components/dialog/confirmation-dialog/index.d.ts +10 -2
- package/dist/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
- package/dist/components/dialog/confirmation-dialog/index.js +72 -7
- package/dist/components/ui/accordion/index.js +1 -1
- package/dist/components/ui/alert/index.d.ts +1 -1
- package/dist/components/ui/alert-dialog/index.d.ts +5 -1
- package/dist/components/ui/alert-dialog/index.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog/index.js +2 -2
- package/dist/components/ui/autocomplete/index.d.ts +1 -1
- package/dist/components/ui/autocomplete/index.d.ts.map +1 -1
- package/dist/components/ui/autocomplete/index.js +42 -6
- package/dist/components/ui/badge/index.d.ts +1 -1
- package/dist/components/ui/button/index.d.ts +2 -2
- package/dist/components/ui/button/index.d.ts.map +1 -1
- package/dist/components/ui/button/index.js +2 -1
- package/dist/components/ui/button/styles.css +17 -4
- package/dist/components/ui/dialog/styles.css +3 -3
- package/dist/components/ui/dropdown-menu/index.js +2 -2
- package/dist/components/ui/hover-card/index.js +1 -1
- package/dist/components/ui/input/adornment.d.ts +1 -1
- package/dist/components/ui/loading-button/index.js +1 -1
- package/dist/components/ui/multiple-select/index.js +1 -1
- package/dist/components/ui/otp-input/index.js +1 -1
- package/dist/components/ui/paper-collapsible/index.js +1 -1
- package/dist/components/ui/popover/index.js +1 -1
- package/dist/components/ui/select/styles.css +1 -1
- package/dist/components/ui/sheet/index.d.ts +1 -1
- package/dist/components/ui/sheet/index.js +2 -2
- package/dist/components/ui/sidebar/sidebar-item-collapsible.js +1 -1
- package/dist/components/ui/skeleton/index.js +1 -1
- package/dist/components/ui/tooltip/index.js +1 -1
- package/dist/enterprise/data-table/index.d.ts +13 -1
- package/dist/enterprise/data-table/index.d.ts.map +1 -1
- package/dist/enterprise/data-table/index.js +7 -3
- package/dist/esm/components/card/account-card/index.d.ts.map +1 -1
- package/dist/esm/components/card/account-card/index.js +2 -2
- package/dist/esm/components/dialog/confirmation-dialog/index.d.ts +10 -2
- package/dist/esm/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
- package/dist/esm/components/dialog/confirmation-dialog/index.js +39 -7
- package/dist/esm/components/ui/accordion/index.js +1 -1
- package/dist/esm/components/ui/alert/index.d.ts +1 -1
- package/dist/esm/components/ui/alert-dialog/index.d.ts +5 -1
- package/dist/esm/components/ui/alert-dialog/index.d.ts.map +1 -1
- package/dist/esm/components/ui/alert-dialog/index.js +2 -2
- package/dist/esm/components/ui/autocomplete/index.d.ts +1 -1
- package/dist/esm/components/ui/autocomplete/index.d.ts.map +1 -1
- package/dist/esm/components/ui/autocomplete/index.js +42 -6
- package/dist/esm/components/ui/badge/index.d.ts +1 -1
- package/dist/esm/components/ui/button/index.d.ts +2 -2
- package/dist/esm/components/ui/button/index.d.ts.map +1 -1
- package/dist/esm/components/ui/button/index.js +2 -1
- package/dist/esm/components/ui/dropdown-menu/index.js +2 -2
- package/dist/esm/components/ui/hover-card/index.js +1 -1
- package/dist/esm/components/ui/input/adornment.d.ts +1 -1
- package/dist/esm/components/ui/loading-button/index.js +1 -1
- package/dist/esm/components/ui/multiple-select/index.js +1 -1
- package/dist/esm/components/ui/otp-input/index.js +1 -1
- package/dist/esm/components/ui/paper-collapsible/index.js +1 -1
- package/dist/esm/components/ui/popover/index.js +1 -1
- package/dist/esm/components/ui/sheet/index.d.ts +1 -1
- package/dist/esm/components/ui/sheet/index.js +2 -2
- package/dist/esm/components/ui/sidebar/sidebar-item-collapsible.js +1 -1
- package/dist/esm/components/ui/skeleton/index.js +1 -1
- package/dist/esm/components/ui/tooltip/index.js +1 -1
- package/dist/esm/enterprise/data-table/index.d.ts +13 -1
- package/dist/esm/enterprise/data-table/index.d.ts.map +1 -1
- package/dist/esm/enterprise/data-table/index.js +8 -4
- package/dist/esm/lib/utils.d.ts.map +1 -1
- package/dist/esm/lib/utils.js +27 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +27 -1
- package/package.json +1 -1
|
@@ -46,7 +46,7 @@ function SidebarItemCollapsibleTrigger({ className, icon, title, children: _chil
|
|
|
46
46
|
}
|
|
47
47
|
function SidebarItemCollapsibleContent({ className, children, ...props }) {
|
|
48
48
|
const { isCollapsed } = (0, sidebar_provider_1.useSidebar)();
|
|
49
|
-
return ((0, jsx_runtime_1.jsx)(react_collapsible_1.CollapsibleContent, { "data-slot": "sidebar-item-collapsible-content", className: (0, utils_1.cn)('mt-1 flex flex-col gap-1', 'data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down overflow-hidden transition-all duration-200 ease-in-out', {
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(react_collapsible_1.CollapsibleContent, { "data-slot": "sidebar-item-collapsible-content", className: (0, utils_1.cn)('mt-1 flex flex-col gap-1', 'motion-safe:data-[state=closed]:animate-collapsible-up motion-safe:data-[state=open]:animate-collapsible-down overflow-hidden transition-all duration-200 ease-in-out', {
|
|
50
50
|
'items-center': isCollapsed
|
|
51
51
|
}, className), ...props, children: isCollapsed ? (children) : ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-stretch gap-3", children: [(0, jsx_runtime_1.jsx)(separator_1.Separator, { className: "ml-5 h-auto", orientation: "vertical" }), (0, jsx_runtime_1.jsx)("div", { className: "flex w-full flex-col gap-1", children: children })] })) }));
|
|
52
52
|
}
|
|
@@ -4,5 +4,5 @@ exports.Skeleton = Skeleton;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const utils_1 = require("../../../lib/utils");
|
|
6
6
|
function Skeleton({ className, ...props }) {
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "skeleton", className: (0, utils_1.cn)('bg-muted animate-pulse
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "skeleton", className: (0, utils_1.cn)('bg-muted rounded-md motion-safe:animate-pulse', className), ...props }));
|
|
8
8
|
}
|
|
@@ -62,5 +62,5 @@ function TooltipTrigger({ ...props }) {
|
|
|
62
62
|
return (0, jsx_runtime_1.jsx)(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
63
63
|
}
|
|
64
64
|
function TooltipContent({ className, sideOffset = 0, children, ...props }) {
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)(TooltipPrimitive.Portal, { children: (0, jsx_runtime_1.jsxs)(TooltipPrimitive.Content, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: (0, utils_1.cn)('bg-shadcn-600 text-shadcn-400 animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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 z-50 rounded-md px-3 py-1.5 text-sm shadow-md', className), ...props, children: [children, (0, jsx_runtime_1.jsx)(TooltipPrimitive.Arrow, { className: "bg-shadcn-600 fill-shadcn-600 z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })] }) }));
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(TooltipPrimitive.Portal, { children: (0, jsx_runtime_1.jsxs)(TooltipPrimitive.Content, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: (0, utils_1.cn)('bg-shadcn-600 text-shadcn-400 motion-safe:animate-in fade-in-0 zoom-in-95 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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 z-50 rounded-md px-3 py-1.5 text-sm shadow-md', className), ...props, children: [children, (0, jsx_runtime_1.jsx)(TooltipPrimitive.Arrow, { className: "bg-shadcn-600 fill-shadcn-600 z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })] }) }));
|
|
66
66
|
}
|
|
@@ -81,8 +81,20 @@ type DataTableBaseProps<TData> = {
|
|
|
81
81
|
*/
|
|
82
82
|
rowHref?: (row: TData) => string;
|
|
83
83
|
className?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Extra classes merged onto every header cell, after the kit label voice —
|
|
86
|
+
* so a caller can override the voice's size/tracking/color for one table
|
|
87
|
+
* without restating the cluster. Per-column alignment stays `meta.numeric`.
|
|
88
|
+
*/
|
|
89
|
+
headClassName?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Footed-total row(s) rendered inside the kit `TableFooter` after the body.
|
|
92
|
+
* The caller supplies the row markup (`<tr><td>…</td></tr>`) so the footer
|
|
93
|
+
* can span, align and format its own figures. Omitted → no `tfoot`.
|
|
94
|
+
*/
|
|
95
|
+
footer?: React.ReactNode;
|
|
84
96
|
};
|
|
85
97
|
export type DataTableProps<TData> = DataTableBaseProps<TData> & RowSelectionProps<TData>;
|
|
86
|
-
export declare function DataTable<TData>({ columns, data, loading, skeletonRows, loadingLabel, empty, getRowId, flush, density, enableRowSelection, rowSelection, onRowSelectionChange, getRowSelectionLabel, onRowActivate, rowHref, className }: DataTableProps<TData>): import("react").JSX.Element;
|
|
98
|
+
export declare function DataTable<TData>({ columns, data, loading, skeletonRows, loadingLabel, empty, getRowId, flush, density, enableRowSelection, rowSelection, onRowSelectionChange, getRowSelectionLabel, onRowActivate, rowHref, className, headClassName, footer }: DataTableProps<TData>): import("react").JSX.Element;
|
|
87
99
|
export {};
|
|
88
100
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/enterprise/data-table/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sour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,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAChD;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAA;IACnC;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAA;IACpC;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,MAAM,CAAA;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,kBAAkB,CAAC,KAAK,CAAC,GAC3D,iBAAiB,CAAC,KAAK,CAAC,CAAA;AA4E1B,wBAAgB,SAAS,CAAC,KAAK,EAAE,EAC/B,OAAO,EACP,IAAI,EACJ,OAAe,EACf,YAAgB,EAChB,YAAmC,EACnC,KAAK,EACL,QAAQ,EACR,KAAa,EACb,OAAuB,EACvB,kBAA0B,EAC1B,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,OAAO,EACP,SAAS,EACT,aAAa,EACb,MAAM,EACP,EAAE,cAAc,CAAC,KAAK,CAAC,+BAiSvB"}
|
|
@@ -13,6 +13,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
13
13
|
* - empty → EmptyState (data resolved, zero rows)
|
|
14
14
|
* - data → semantic table rows; cells own any links/actions
|
|
15
15
|
*
|
|
16
|
+
* Column heads speak the kit's LABEL_VOICE_CLASS; `headClassName` overrides it
|
|
17
|
+
* per table. An optional `footer` node renders in a `tfoot` for footed totals.
|
|
18
|
+
*
|
|
16
19
|
* Columns are standard TanStack `ColumnDef<T>`; cells receive the row's
|
|
17
20
|
* `original` value, so screens compose money / date / status cells directly in
|
|
18
21
|
* their column `cell` renderers.
|
|
@@ -39,6 +42,7 @@ const react_1 = require("react");
|
|
|
39
42
|
const react_table_1 = require("@tanstack/react-table");
|
|
40
43
|
const table_1 = require("../../components/ui/table");
|
|
41
44
|
const skeleton_1 = require("../../components/ui/skeleton");
|
|
45
|
+
const typography_1 = require("../../lib/typography");
|
|
42
46
|
const utils_1 = require("../../lib/utils");
|
|
43
47
|
const empty_state_1 = require("../empty-state");
|
|
44
48
|
const SELECTION_COLUMN_ID = '__select__';
|
|
@@ -78,7 +82,7 @@ function createSelectionColumn(getLabel) {
|
|
|
78
82
|
cell: ({ row }) => (0, jsx_runtime_1.jsx)(RowSelectionCheckbox, { row: row, getLabel: getLabel })
|
|
79
83
|
};
|
|
80
84
|
}
|
|
81
|
-
function DataTable({ columns, data, loading = false, skeletonRows = 8, loadingLabel = 'Loading table rows', empty, getRowId, flush = false, density = 'comfortable', enableRowSelection = false, rowSelection, onRowSelectionChange, getRowSelectionLabel, onRowActivate, rowHref, className }) {
|
|
85
|
+
function DataTable({ columns, data, loading = false, skeletonRows = 8, loadingLabel = 'Loading table rows', empty, getRowId, flush = false, density = 'comfortable', enableRowSelection = false, rowSelection, onRowSelectionChange, getRowSelectionLabel, onRowActivate, rowHref, className, headClassName, footer }) {
|
|
82
86
|
const tableColumns = (0, react_1.useMemo)(() => enableRowSelection
|
|
83
87
|
? [createSelectionColumn(getRowSelectionLabel), ...columns]
|
|
84
88
|
: columns, [columns, enableRowSelection, getRowSelectionLabel]);
|
|
@@ -216,7 +220,7 @@ function DataTable({ columns, data, loading = false, skeletonRows = 8, loadingLa
|
|
|
216
220
|
? 'No rows'
|
|
217
221
|
: `${rowCount} rows` }), (0, jsx_runtime_1.jsxs)(table_1.Table, { "aria-busy": loading ? 'true' : undefined, children: [(0, jsx_runtime_1.jsx)(table_1.TableHeader, { children: table.getHeaderGroups().map((headerGroup) => ((0, jsx_runtime_1.jsx)(table_1.TableRow, { className: "hover:bg-transparent", children: headerGroup.headers.map((header) => {
|
|
218
222
|
const numeric = header.column.columnDef.meta?.numeric;
|
|
219
|
-
return ((0, jsx_runtime_1.jsx)(table_1.TableHead, { align: numeric ? 'right' : undefined, className: (0, utils_1.cn)(
|
|
223
|
+
return ((0, jsx_runtime_1.jsx)(table_1.TableHead, { align: numeric ? 'right' : undefined, className: (0, utils_1.cn)(typography_1.LABEL_VOICE_CLASS, headDensityClass, header.column.id === SELECTION_COLUMN_ID && 'w-10', headClassName), children: header.isPlaceholder
|
|
220
224
|
? null
|
|
221
225
|
: (0, react_table_1.flexRender)(header.column.columnDef.header, header.getContext()) }, header.id));
|
|
222
226
|
}) }, headerGroup.id))) }), (0, jsx_runtime_1.jsx)(table_1.TableBody, { children: loading ? (Array.from({ length: skeletonRows }).map((_, rowIndex) => ((0, jsx_runtime_1.jsx)(table_1.TableRow, { className: "hover:bg-transparent", children: Array.from({ length: colCount }).map((__, cellIndex) => ((0, jsx_runtime_1.jsx)(table_1.TableCell, { className: cellDensityClass, children: (0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { className: "h-4 w-full max-w-[160px]" }) }, `skeleton-${rowIndex}-${cellIndex}`))) }, `skeleton-${rowIndex}`)))) : rowCount === 0 ? ((0, jsx_runtime_1.jsx)(table_1.TableRow, { className: "hover:bg-transparent", children: (0, jsx_runtime_1.jsx)(table_1.TableCell, { colSpan: colCount, className: "p-0", children: (0, jsx_runtime_1.jsx)(empty_state_1.EmptyState, { title: empty?.title ?? 'Nothing here yet', description: empty?.description, icon: empty?.icon, action: empty?.action,
|
|
@@ -241,5 +245,5 @@ function DataTable({ columns, data, loading = false, skeletonRows = 8, loadingLa
|
|
|
241
245
|
? 'selected'
|
|
242
246
|
: undefined, children: row.getVisibleCells().map((cell) => ((0, jsx_runtime_1.jsx)(table_1.TableCell, { className: (0, utils_1.cn)(cell.column.columnDef.meta?.numeric && NUMERIC_CELL_CLASS, cellDensityClass, cell.column.id === SELECTION_COLUMN_ID && 'w-10'), onClick: cell.column.id === SELECTION_COLUMN_ID
|
|
243
247
|
? stopPropagation
|
|
244
|
-
: undefined, children: (0, react_table_1.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) })] })] }));
|
|
248
|
+
: undefined, children: (0, react_table_1.flexRender)(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) }), footer ? (0, jsx_runtime_1.jsx)(table_1.TableFooter, { children: footer }) : null] })] }));
|
|
245
249
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/card/account-card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAGzD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAgB,WAAW,EAA0B,MAAM,cAAc,CAAA;AAChF,OAAO,EACL,kBAAkB,EAEnB,MAAM,6BAA6B,CAAA;AAUpC,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,qBAc1C;AAED,wBAAgB,sBAAsB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,qBAS1E;AAED,wBAAgB,wBAAwB,CAAC,EACvC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQ7B;AAED,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,qBAQ3B;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,qBAarC;AAED,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,qBAWjD;AAED,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQ7B;AAED,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,qBAW3B;AAED,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IACtE,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,SAAS,EACT,KAAK,EACL,QAAQ,EAAE,SAAS,EACnB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,2BAA2B,qBAe7B;AAED,MAAM,MAAM,mCAAmC,GAAG,KAAK,CAAC,cAAc,CACpE,OAAO,MAAM,CACd,GAAG;IACF,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB,CAAA;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,SAAS,EAAE,UAAU,EACrB,OAAO,EACP,SAAS,EACT,YAA4B,EAC5B,cAA6B,EAC7B,YAAwB,EACxB,SAAS,EACT,QAAQ,EAAE,SAAS,EACnB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,mCAAmC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/card/account-card/index.tsx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cAAc,CAAC,KAAK,CAAC,GAAG;IACtE,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,SAAS,EACT,KAAK,EACL,QAAQ,EAAE,SAAS,EACnB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,2BAA2B,qBAe7B;AAED,MAAM,MAAM,mCAAmC,GAAG,KAAK,CAAC,cAAc,CACpE,OAAO,MAAM,CACd,GAAG;IACF,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB,CAAA;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,SAAS,EAAE,UAAU,EACrB,OAAO,EACP,SAAS,EACT,YAA4B,EAC5B,cAA6B,EAC7B,YAAwB,EACxB,SAAS,EACT,QAAQ,EAAE,SAAS,EACnB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,mCAAmC,qBAkCrC;AAED,wBAAgB,yBAAyB,CAAC,EACxC,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EAAE,SAAS,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IACvC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,qBAeA"}
|
|
@@ -29,7 +29,7 @@ export function AccountBalanceCardDeleteButton({ className, ...props }) {
|
|
|
29
29
|
return (_jsx(IconButton, { variant: "outline", size: "small", rounded: true, "data-slot": "account-balance-card-delete-button", className: cn('absolute top-3 right-3', className), ...props, children: _jsx(Trash, { className: "text-muted-foreground h-4 w-4" }) }));
|
|
30
30
|
}
|
|
31
31
|
export function AccountBalanceCardContent({ className, ...props }) {
|
|
32
|
-
return (_jsx(CollapsibleContent, { "data-slot": "account-balance-card-content", className: cn('data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden', className), ...props }));
|
|
32
|
+
return (_jsx(CollapsibleContent, { "data-slot": "account-balance-card-content", className: cn('motion-safe:data-[state=closed]:animate-accordion-up motion-safe:data-[state=open]:animate-accordion-down overflow-hidden', className), ...props }));
|
|
33
33
|
}
|
|
34
34
|
export function AccountBalanceCardLoading({ className, ...props }) {
|
|
35
35
|
return (_jsx(Skeleton, { "data-slot": "account-balance-card-loading", className: cn('bg-muted mt-3 h-3 w-full rounded-md', className), ...props }));
|
|
@@ -45,7 +45,7 @@ export function AccountBalanceCardUpdateButton({ className: _className, loading,
|
|
|
45
45
|
const updated = React.useMemo(() => {
|
|
46
46
|
return !dayjs(timestamp).isBefore(dayjs().subtract(1, 'minute'));
|
|
47
47
|
}, [_time, timestamp]);
|
|
48
|
-
return (_jsxs("div", { className: "mb-3 flex flex-row items-center justify-end gap-2", children: [_jsxs("p", { className: "text-shadcn-500 text-xs font-medium", children: [loading && loadingLabel, !loading && !updated && updatedInLabel, !loading && updated && updatedLabel] }), !loading && updated && (_jsx(CheckCircle2, { className: "h-4 w-4
|
|
48
|
+
return (_jsxs("div", { className: "mb-3 flex flex-row items-center justify-end gap-2", children: [_jsxs("p", { className: "text-shadcn-500 text-xs font-medium", children: [loading && loadingLabel, !loading && !updated && updatedInLabel, !loading && updated && updatedLabel] }), !loading && updated && (_jsx(CheckCircle2, { className: "text-system-success h-4 w-4" })), (!updated || loading) && (_jsx(Button, { ref: ref, variant: "link", "data-slot": "account-balance-card-update-button", className: "h-3 p-0", onClick: onRefresh, disabled: loading, ...props, children: _jsx(RefreshCw, { className: cn('size-4', { 'motion-safe:animate-spin': loading }) }) }))] }));
|
|
49
49
|
}
|
|
50
50
|
export function AccountBalanceCardTrigger({ className, openLabel, closeLabel, children: _children, ...props }) {
|
|
51
51
|
const { open } = React.useContext(AccountBalanceCardContext);
|
|
@@ -4,13 +4,21 @@ export type ConfirmationDialogProps = {
|
|
|
4
4
|
onOpenChange: (open: boolean) => void;
|
|
5
5
|
title?: string;
|
|
6
6
|
description?: string;
|
|
7
|
+
/** @deprecated dead prop, removed in the next major */
|
|
7
8
|
ledgerName?: string;
|
|
8
9
|
variant?: 'default' | 'warning' | 'destructive' | 'success';
|
|
9
10
|
loading?: boolean;
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Awaited. While it is in flight the dialog reports a pending status, both
|
|
13
|
+
* actions are disabled and dismissal is blocked; it closes on resolve. A
|
|
14
|
+
* rejection leaves the dialog open — error UX belongs to the caller.
|
|
15
|
+
*/
|
|
16
|
+
onConfirm?: () => void | Promise<void>;
|
|
11
17
|
onCancel?: () => void;
|
|
12
18
|
confirmLabel?: string;
|
|
13
19
|
cancelLabel?: string;
|
|
20
|
+
/** Announced to screen readers while a confirm is in flight. */
|
|
21
|
+
pendingLabel?: string;
|
|
14
22
|
};
|
|
15
|
-
export declare function ConfirmationDialog({ open, onOpenChange, title, description, variant, loading, onConfirm, onCancel, confirmLabel, cancelLabel }: ConfirmationDialogProps): React.JSX.Element;
|
|
23
|
+
export declare function ConfirmationDialog({ open, onOpenChange, title, description, variant, loading, onConfirm, onCancel, confirmLabel, cancelLabel, pendingLabel }: ConfirmationDialogProps): React.JSX.Element;
|
|
16
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dialog/confirmation-dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/dialog/confirmation-dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAuD9B,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACtC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,YAAY,EACZ,KAAU,EACV,WAAgB,EAChB,OAAmB,EACnB,OAAO,EACP,SAAoB,EACpB,QAAmB,EACnB,YAAY,EACZ,WAAW,EACX,YAA4B,EAC7B,EAAE,uBAAuB,qBAkFzB"}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
3
4
|
import { Button } from '../../../components/ui/button/index.js';
|
|
4
|
-
import {
|
|
5
|
+
import { AlertDialog, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '../../../components/ui/alert-dialog/index.js';
|
|
5
6
|
import { LoadingButton } from '../../../components/ui/loading-button/index.js';
|
|
6
7
|
import { Ban, CheckCircle2, TriangleAlert } from 'lucide-react';
|
|
7
8
|
import { cn } from '../../../lib/utils.js';
|
|
8
9
|
import { cva } from 'class-variance-authority';
|
|
9
10
|
const confirmationDialogIconVariants = cva('flex size-10 shrink-0 items-center justify-center rounded-lg [&>svg]:size-6', {
|
|
10
11
|
variants: {
|
|
12
|
+
// System tokens, not raw palette steps: a raw 50-step surface has no dark
|
|
13
|
+
// counterpart, so on the dark canvas it rendered a near-white block.
|
|
14
|
+
// `default` is deliberately neutral so `destructive` reads as a distinct,
|
|
15
|
+
// heavier warning instead of an alias of it.
|
|
11
16
|
variant: {
|
|
12
|
-
default: 'bg-
|
|
13
|
-
warning: 'bg-
|
|
14
|
-
destructive: 'bg-
|
|
15
|
-
success: 'bg-
|
|
17
|
+
default: 'bg-muted text-foreground',
|
|
18
|
+
warning: 'bg-system-alert-surface text-system-alert-h1a',
|
|
19
|
+
destructive: 'bg-system-error-surface text-system-error-h1a',
|
|
20
|
+
success: 'bg-system-success-surface text-system-success-h1a'
|
|
16
21
|
}
|
|
17
22
|
},
|
|
18
23
|
defaultVariants: {
|
|
@@ -20,6 +25,33 @@ const confirmationDialogIconVariants = cva('flex size-10 shrink-0 items-center j
|
|
|
20
25
|
}
|
|
21
26
|
});
|
|
22
27
|
const ConfirmationDialogIcon = ({ className, variant, ...props }) => (_jsxs("span", { className: cn(confirmationDialogIconVariants({ variant }), className), ...props, children: [variant === 'default' && _jsx(Ban, {}), variant === 'warning' && _jsx(TriangleAlert, {}), variant === 'destructive' && _jsx(Ban, {}), variant === 'success' && _jsx(CheckCircle2, {})] }));
|
|
23
|
-
export function ConfirmationDialog({ open, onOpenChange, title = '', description = '', variant = 'default', loading, onConfirm = () => { }, onCancel = () => { }, confirmLabel, cancelLabel }) {
|
|
24
|
-
|
|
28
|
+
export function ConfirmationDialog({ open, onOpenChange, title = '', description = '', variant = 'default', loading, onConfirm = () => { }, onCancel = () => { }, confirmLabel, cancelLabel, pendingLabel = 'Processing…' }) {
|
|
29
|
+
const [pending, setPending] = React.useState(false);
|
|
30
|
+
const busy = Boolean(loading) || pending;
|
|
31
|
+
const handleConfirm = async () => {
|
|
32
|
+
if (busy) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
setPending(true);
|
|
36
|
+
try {
|
|
37
|
+
await onConfirm();
|
|
38
|
+
onOpenChange(false);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Deliberately silent: the caller owns error UX. Catching only keeps a
|
|
42
|
+
// rejection from escaping the click handler as an unhandled rejection —
|
|
43
|
+
// the dialog stays open so the caller can render the failure in place.
|
|
44
|
+
}
|
|
45
|
+
finally {
|
|
46
|
+
setPending(false);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return (_jsx(AlertDialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(AlertDialogContent, { "data-testid": "dialog",
|
|
50
|
+
// Radix already blocks outside interaction on an alert dialog, so
|
|
51
|
+
// Escape is the only remaining way to abandon a mutation mid-flight.
|
|
52
|
+
onEscapeKeyDown: (event) => {
|
|
53
|
+
if (busy) {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
}
|
|
56
|
+
}, children: [_jsxs(AlertDialogHeader, { className: "flex-row items-center", children: [_jsx(ConfirmationDialogIcon, { variant: variant }), _jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(AlertDialogTitle, { children: title }), _jsx(AlertDialogDescription, { children: description })] })] }), _jsx("span", { role: "status", className: "sr-only", children: busy ? pendingLabel : '' }), _jsxs(AlertDialogFooter, { className: "gap-4", children: [_jsx(AlertDialogCancel, { asChild: true, children: _jsx(Button, { onClick: onCancel, disabled: busy, variant: "secondary", size: "small", className: "enabled:border-button-border hover:border-button-border enabled:shadow-sm", children: cancelLabel ?? 'Cancel' }) }), _jsx(LoadingButton, { loading: busy, onClick: handleConfirm, variant: "primary", size: "small", "data-testid": "confirm", children: confirmLabel ?? 'Confirm' })] })] }) }));
|
|
25
57
|
}
|
|
@@ -19,6 +19,6 @@ function AccordionTrigger({ className, children, ...props }) {
|
|
|
19
19
|
return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn('focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-colors outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180', className), ...props, children: [children, _jsx(ChevronDown, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })] }) }));
|
|
20
20
|
}
|
|
21
21
|
function AccordionContent({ className, children, ...props }) {
|
|
22
|
-
return (_jsx(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm", ...props, children: _jsx("div", { className: cn('pt-0 pb-4', className), children: children }) }));
|
|
22
|
+
return (_jsx(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "motion-safe:data-[state=closed]:animate-accordion-up motion-safe:data-[state=open]:animate-accordion-down overflow-hidden text-sm", ...props, children: _jsx("div", { className: cn('pt-0 pb-4', className), children: children }) }));
|
|
23
23
|
}
|
|
24
24
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import { IconButton } from '../icon-button/index.js';
|
|
4
4
|
declare const alertVariants: (props?: ({
|
|
5
|
-
variant?: "default" | "
|
|
5
|
+
variant?: "default" | "destructive" | "informative" | "warning" | "success" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type AlertProps = React.ComponentProps<'div'> & VariantProps<typeof alertVariants>;
|
|
8
8
|
declare function Alert({ className, variant, ...props }: AlertProps): React.JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { buttonVariants } from '../../../components/ui/button/index.js';
|
|
3
5
|
declare function AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>): React.JSX.Element;
|
|
4
6
|
declare function AlertDialogTrigger({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): React.JSX.Element;
|
|
5
7
|
declare function AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>): React.JSX.Element;
|
|
@@ -9,7 +11,9 @@ declare function AlertDialogHeader({ className, ...props }: React.ComponentProps
|
|
|
9
11
|
declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
10
12
|
declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
|
|
11
13
|
declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
|
|
12
|
-
declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action>
|
|
14
|
+
declare function AlertDialogAction({ className, variant, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action> & {
|
|
15
|
+
variant?: VariantProps<typeof buttonVariants>['variant'];
|
|
16
|
+
}): React.JSX.Element;
|
|
13
17
|
declare function AlertDialogCancel({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel>): React.JSX.Element;
|
|
14
18
|
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel };
|
|
15
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/alert-dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,K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ED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQ7B;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,qBAQzD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,WAAW,CAAC,qBAQ/D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,GAAG;IAI5D,OAAO,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC,SAAS,CAAC,CAAA;CACzD,qBAQA;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,qBAQ1D;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EAClB,CAAA"}
|
|
@@ -30,8 +30,8 @@ function AlertDialogTitle({ className, ...props }) {
|
|
|
30
30
|
function AlertDialogDescription({ className, ...props }) {
|
|
31
31
|
return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", className: cn('dialog-description', className), ...props }));
|
|
32
32
|
}
|
|
33
|
-
function AlertDialogAction({ className, ...props }) {
|
|
34
|
-
return (_jsx(AlertDialogPrimitive.Action, { "data-slot": "alert-dialog-action", className: cn(buttonVariants(), className), ...props }));
|
|
33
|
+
function AlertDialogAction({ className, variant = 'default', ...props }) {
|
|
34
|
+
return (_jsx(AlertDialogPrimitive.Action, { "data-slot": "alert-dialog-action", className: cn(buttonVariants({ variant }), className), ...props }));
|
|
35
35
|
}
|
|
36
36
|
function AlertDialogCancel({ className, ...props }) {
|
|
37
37
|
return (_jsx(AlertDialogPrimitive.Cancel, { "data-slot": "alert-dialog-cancel", className: cn(buttonVariants({ variant: 'outline' }), className), ...props }));
|
|
@@ -34,7 +34,7 @@ export type AutocompleteContentProps = React.ComponentProps<typeof CommandPrimit
|
|
|
34
34
|
side?: Side;
|
|
35
35
|
onPointerDownOutside?: (event: MouseEvent | TouchEvent) => void;
|
|
36
36
|
};
|
|
37
|
-
export declare function AutocompleteContent({ className, position, side, ref, children, onMouseEnter, onMouseLeave, onPointerDownOutside, ...props }: AutocompleteContentProps): React.JSX.Element
|
|
37
|
+
export declare function AutocompleteContent({ className, position, side, ref, children, onMouseEnter, onMouseLeave, onPointerDownOutside, ...props }: AutocompleteContentProps): React.JSX.Element;
|
|
38
38
|
export declare function AutocompleteGroup({ className, ...props }: React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>): React.JSX.Element;
|
|
39
39
|
export declare function AutocompleteItem({ className, value, onSelect, ...props }: React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>): React.JSX.Element;
|
|
40
40
|
export type AutocompleteProps = React.ComponentProps<typeof CommandPrimitive> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/autocomplete/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAmB,MAAM,MAAM,CAAA;AAInE,MAAM,MAAM,uBAAuB,GACjC,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,GAAG;IAC3C,sCAAsC;IACtC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,G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BAsB9D;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAClD,OAAO,gBAAgB,CACxB,GAAG;IACF,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,CAAA;IAC9B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,CAAA;IACrC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IACnD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAEtC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,KAAK,EACL,YAAY,EACZ,aAAa,EACb,OAAO,EACP,SAAS,EACT,IAAI,EAAE,QAAQ,EACd,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,qBAmInB"}
|
|
@@ -109,7 +109,7 @@ export function AutocompleteEmpty({ className, ...props }) {
|
|
|
109
109
|
return (_jsx("div", { "data-slot": "autocomplete-empty", className: cn('py-6 text-center text-sm', className), "cmdk-empty": "", role: "presentation", ...props }));
|
|
110
110
|
}
|
|
111
111
|
export function AutocompleteLoading({ className, ref, ...props }) {
|
|
112
|
-
return (_jsx(CommandPrimitive.Loading, { ref: ref, "data-slot": "autocomplete-loading", className: cn('flex items-center justify-center py-6 text-center text-sm', className), ...props, children: _jsx(Loader2, { className: "text-muted-foreground h-5 w-5 animate-spin" }) }));
|
|
112
|
+
return (_jsx(CommandPrimitive.Loading, { ref: ref, "data-slot": "autocomplete-loading", className: cn('flex items-center justify-center py-6 text-center text-sm', className), ...props, children: _jsx(Loader2, { className: "text-muted-foreground h-5 w-5 motion-safe:animate-spin" }) }));
|
|
113
113
|
}
|
|
114
114
|
export const SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'];
|
|
115
115
|
export function AutocompleteContent({ className, position = 'popper', side = 'bottom', ref, children, onMouseEnter, onMouseLeave, onPointerDownOutside, ...props }) {
|
|
@@ -117,6 +117,17 @@ export function AutocompleteContent({ className, position = 'popper', side = 'bo
|
|
|
117
117
|
const { open, addOption, setOpen, onScrollbar, setOnScrollbar, inputRef } = useAutocomplete();
|
|
118
118
|
React.useImperativeHandle(ref, () => _ref.current);
|
|
119
119
|
useClickAway(_ref, (event) => {
|
|
120
|
+
/**
|
|
121
|
+
* ⛔ THE `open` GUARD IS LOAD-BEARING SINCE THIS LIST STOPPED UNMOUNTING.
|
|
122
|
+
* While the panel returned `null` this handler was inert by accident: its
|
|
123
|
+
* ref pointed at nothing. Now that the list stays in the DOM (see the return
|
|
124
|
+
* below), every click anywhere on the page reaches here — and without this
|
|
125
|
+
* line each one would call `setOpen(false)` and blur the input. A consumer
|
|
126
|
+
* form carrying ten of these would run ten handlers per click.
|
|
127
|
+
*/
|
|
128
|
+
if (!open) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
120
131
|
// Should not close when clicking on the scrollbar
|
|
121
132
|
if (onScrollbar) {
|
|
122
133
|
return;
|
|
@@ -159,17 +170,42 @@ export function AutocompleteContent({ className, position = 'popper', side = 'bo
|
|
|
159
170
|
React.useEffect(() => {
|
|
160
171
|
_searchChildren(children);
|
|
161
172
|
}, [children]);
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
173
|
+
/**
|
|
174
|
+
* ⛔ THE LIST STAYS IN THE DOM, THE OPTIONS DO NOT — and the split is the whole
|
|
175
|
+
* fix (#150).
|
|
176
|
+
*
|
|
177
|
+
* cmdk puts `aria-controls={listId}` on the input it renders and `id={listId}`
|
|
178
|
+
* on this list. Returning `null` while closed therefore left the input naming
|
|
179
|
+
* an element that did not exist, which axe-core reports as a CRITICAL
|
|
180
|
+
* `aria-valid-attr-value` violation — measured as 10 failing cases across five
|
|
181
|
+
* forms in a consumer, in both the populated and the empty state. A screen
|
|
182
|
+
* reader following the reference resolved it to nothing.
|
|
183
|
+
*
|
|
184
|
+
* ⛔ AND NOT "KEEP EVERYTHING MOUNTED", which is the obvious reading of the
|
|
185
|
+
* fix and is too expensive. Only the LIST carries the id; the options carry
|
|
186
|
+
* the cost. One consumer form puts up to ten of these on screen, each holding
|
|
187
|
+
* a page of up to a hundred options — roughly a thousand permanently present
|
|
188
|
+
* nodes for an id that is one element. `{open ? children : null}` keeps the
|
|
189
|
+
* reference resolvable and the DOM the size it was.
|
|
190
|
+
*
|
|
191
|
+
* ⚠️ `hidden` AND NOT A CLASS. It removes the subtree from the accessibility
|
|
192
|
+
* tree as well as from view, so a closed panel is not an empty `listbox` that
|
|
193
|
+
* a screen reader can reach into.
|
|
194
|
+
*
|
|
195
|
+
* ⚠️ THE ENTRY ANIMATION IS NOT LOST, because there was none to lose: the
|
|
196
|
+
* className carries `animate-in` with no `fade-in-*` / `zoom-in-*` / `slide-in-*`
|
|
197
|
+
* companion, so every `--tw-enter-*` variable sits at its default and the
|
|
198
|
+
* keyframe is a no-op today. Should a real one be added later, it belongs on a
|
|
199
|
+
* wrapper INSIDE this list — that subtree still mounts with the children.
|
|
200
|
+
*/
|
|
201
|
+
return (_jsx("div", { className: "relative", hidden: !open, children: _jsx(CommandPrimitive.List, { ref: _ref, className: cn('bg-popover text-popover-foreground motion-safe:animate-in absolute top-1 z-50 max-h-96 w-full min-w-32 overflow-x-hidden overflow-y-auto rounded-md border shadow-md outline-hidden', position === 'popper' &&
|
|
166
202
|
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), "data-side": side, ...props, onMouseEnter: (e) => {
|
|
167
203
|
onMouseEnter?.(e);
|
|
168
204
|
setOnScrollbar(true);
|
|
169
205
|
}, onMouseLeave: (e) => {
|
|
170
206
|
onMouseLeave?.(e);
|
|
171
207
|
setOnScrollbar(false);
|
|
172
|
-
}, children: children }) }));
|
|
208
|
+
}, children: open ? children : null }) }));
|
|
173
209
|
}
|
|
174
210
|
export function AutocompleteGroup({ className, ...props }) {
|
|
175
211
|
return (_jsx(CommandPrimitive.Group, { "data-slot": "autocomplete-group", className: cn('text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium', className), ...props }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "secondary" | "outline" | "
|
|
4
|
+
variant?: "default" | "secondary" | "outline" | "destructive" | "alert" | "success" | "active" | "inactive" | "error" | "info" | "purple" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export type BadgeProps = React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & {
|
|
7
7
|
asChild?: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "plain" | "hoverLink" | "default" | "primary" | "secondary" | "tertiary" | "outline" | "link" | null | undefined;
|
|
4
|
+
variant?: "plain" | "hoverLink" | "default" | "primary" | "secondary" | "tertiary" | "outline" | "link" | "destructive" | null | undefined;
|
|
5
5
|
fullWidth?: boolean | null | undefined;
|
|
6
6
|
size?: "default" | "small" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare const iconVariants: (props?: ({
|
|
9
|
-
position?: "
|
|
9
|
+
position?: "end" | "start" | "far-end" | null | undefined;
|
|
10
10
|
size?: "default" | "small" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
export type ButtonProps = React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;;8EA2BlB,CAAA;AAEF,QAAA,MAAM,YAAY;;;8EAgBhB,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GACtD,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,GAAG;IACF,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAAA;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAEH,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,EACP,IAAI,EACJ,OAAe,EACf,IAAI,EACJ,aAAuB,EACvB,SAAiB,EACjB,QAAgB,EAChB,OAAO,EACP,GAAG,KAAK,EACT,EAAE,WAAW,qBAqCb;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -12,7 +12,8 @@ const buttonVariants = cva('button-base button-disabled button-read-only', {
|
|
|
12
12
|
secondary: 'button-secondary',
|
|
13
13
|
tertiary: 'button-tertiary',
|
|
14
14
|
outline: 'button-outline',
|
|
15
|
-
link: 'button-link'
|
|
15
|
+
link: 'button-link',
|
|
16
|
+
destructive: 'button-destructive'
|
|
16
17
|
},
|
|
17
18
|
fullWidth: {
|
|
18
19
|
true: 'w-full',
|
|
@@ -14,7 +14,7 @@ function DropdownMenuTrigger({ className, ...props }) {
|
|
|
14
14
|
return (_jsx(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", className: cn('flex items-center justify-center outline-hidden', className), ...props }));
|
|
15
15
|
}
|
|
16
16
|
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
17
|
-
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 z-50 min-w-32 overflow-hidden rounded-lg border shadow-md', className), ...props }) }));
|
|
17
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 z-50 min-w-32 overflow-hidden rounded-lg border shadow-md', className), ...props }) }));
|
|
18
18
|
}
|
|
19
19
|
function DropdownMenuGroup({ ...props }) {
|
|
20
20
|
return (_jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props }));
|
|
@@ -52,6 +52,6 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
52
52
|
return (_jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: cn('focus:bg-shadcn-100 data-[state=open]:bg-accent text-muted-foreground flex cursor-default items-center gap-3 px-3 py-2 text-sm font-medium outline-hidden select-none', className), ...props, children: [children, _jsx(ChevronRight, { className: "ml-auto h-4 w-4" })] }));
|
|
53
53
|
}
|
|
54
54
|
function DropdownMenuSubContent({ className, ...props }) {
|
|
55
|
-
return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 z-50 min-w-32 overflow-hidden rounded-md border p-1 shadow-lg', className), ...props }));
|
|
55
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn('bg-popover text-popover-foreground motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 z-50 min-w-32 overflow-hidden rounded-md border p-1 shadow-lg', className), ...props }));
|
|
56
56
|
}
|
|
57
57
|
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup };
|
|
@@ -9,6 +9,6 @@ function HoverCardTrigger({ ...props }) {
|
|
|
9
9
|
return (_jsx(HoverCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props }));
|
|
10
10
|
}
|
|
11
11
|
function HoverCardContent({ className, align = 'center', sideOffset = 4, ...props }) {
|
|
12
|
-
return (_jsx(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: _jsx(HoverCardPrimitive.Content, { "data-slot": "hover-card-content", align: align, sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 border-border z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden', className), ...props }) }));
|
|
12
|
+
return (_jsx(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: _jsx(HoverCardPrimitive.Content, { "data-slot": "hover-card-content", align: align, sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 border-border z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden', className), ...props }) }));
|
|
13
13
|
}
|
|
14
14
|
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
export declare const inputAdornmentVariants: (props?: ({
|
|
3
|
-
position?: "
|
|
3
|
+
position?: "end" | "start" | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
5
5
|
export type InputAdornmentProps = React.ComponentProps<'span'> & VariantProps<typeof inputAdornmentVariants> & {
|
|
6
6
|
position?: 'start' | 'end';
|
|
@@ -2,6 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Button } from '../button/index.js';
|
|
3
3
|
import { Loader2 } from 'lucide-react';
|
|
4
4
|
function LoadingButton({ loading, disabled, children, ...props }) {
|
|
5
|
-
return (_jsxs(Button, { ...props, disabled: loading || disabled, children: [loading && _jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), children] }));
|
|
5
|
+
return (_jsxs(Button, { ...props, disabled: loading || disabled, children: [loading && _jsx(Loader2, { className: "mr-2 h-4 w-4 motion-safe:animate-spin" }), children] }));
|
|
6
6
|
}
|
|
7
7
|
export { LoadingButton };
|
|
@@ -103,7 +103,7 @@ export const MultipleSelectContent = React.forwardRef(({ className, position = '
|
|
|
103
103
|
if (!open) {
|
|
104
104
|
return null;
|
|
105
105
|
}
|
|
106
|
-
return (_jsx("div", { className: "relative", children: _jsx(CommandPrimitive.List, { ref: ref, className: cn('bg-popover text-popover-foreground animate-in absolute top-1 z-50 max-h-96 w-full min-w-32 overflow-x-hidden overflow-y-auto rounded-md border shadow-md outline-hidden', position === 'popper' &&
|
|
106
|
+
return (_jsx("div", { className: "relative", children: _jsx(CommandPrimitive.List, { ref: ref, className: cn('bg-popover text-popover-foreground motion-safe:animate-in absolute top-1 z-50 max-h-96 w-full min-w-32 overflow-x-hidden overflow-y-auto rounded-md border shadow-md outline-hidden', position === 'popper' &&
|
|
107
107
|
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), ...props, onMouseEnter: (e) => {
|
|
108
108
|
onMouseEnter?.(e);
|
|
109
109
|
setOnScrollbar(true);
|
|
@@ -12,7 +12,7 @@ function InputOTPGroup({ className, ...props }) {
|
|
|
12
12
|
function InputOTPSlot({ index, className, ...props }) {
|
|
13
13
|
const inputOTPContext = React.useContext(OTPInputContext);
|
|
14
14
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
15
|
-
return (_jsxs("div", { "data-slot": "input-otp-slot", "data-active": isActive, className: cn('border-input-border bg-background text-foreground', 'relative flex h-14 w-12 items-center justify-center border-y border-r text-2xl font-semibold shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md', 'data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:z-10 data-[active=true]:ring-2', className), ...props, children: [char, hasFakeCaret && (_jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: _jsx("div", { className: "animate-caret-blink bg-foreground h-6 w-px duration-1000" }) }))] }));
|
|
15
|
+
return (_jsxs("div", { "data-slot": "input-otp-slot", "data-active": isActive, className: cn('border-input-border bg-background text-foreground', 'relative flex h-14 w-12 items-center justify-center border-y border-r text-2xl font-semibold shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md', 'data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:z-10 data-[active=true]:ring-2', className), ...props, children: [char, hasFakeCaret && (_jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: _jsx("div", { className: "motion-safe:animate-caret-blink bg-foreground h-6 w-px duration-1000" }) }))] }));
|
|
16
16
|
}
|
|
17
17
|
function InputOTPSeparator({ ...props }) {
|
|
18
18
|
return (_jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: _jsx(MinusIcon, {}) }));
|
|
@@ -14,6 +14,6 @@ function PaperCollapsibleTrigger({ className, children: _children, ...props }) {
|
|
|
14
14
|
return (_jsx(CollapsibleTrigger, { "data-slot": "paper-collapsible-trigger", className: cn('transition-all hover:underline [&[data-state=open]>svg]:rotate-180', className), ...props, children: _jsx(ChevronDown, { className: "text-foreground size-6 shrink-0 cursor-pointer transition-transform duration-200" }) }));
|
|
15
15
|
}
|
|
16
16
|
function PaperCollapsibleContent({ className, children, ...props }) {
|
|
17
|
-
return (_jsxs(CollapsibleContent, { "data-slot": "paper-collapsible-content", className: cn('data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down overflow-hidden transition-all duration-200 ease-in-out', className), ...props, children: [_jsx(Separator, {}), children] }));
|
|
17
|
+
return (_jsxs(CollapsibleContent, { "data-slot": "paper-collapsible-content", className: cn('motion-safe:data-[state=closed]:animate-collapsible-up motion-safe:data-[state=open]:animate-collapsible-down overflow-hidden transition-all duration-200 ease-in-out', className), ...props, children: [_jsx(Separator, {}), children] }));
|
|
18
18
|
}
|
|
19
19
|
export { PaperCollapsible, PaperCollapsibleBanner, PaperCollapsibleTrigger, PaperCollapsibleContent };
|
|
@@ -9,7 +9,7 @@ function PopoverTrigger({ ...props }) {
|
|
|
9
9
|
return _jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
10
10
|
}
|
|
11
11
|
function PopoverContent({ className, align = 'center', sideOffset = 4, ...props }) {
|
|
12
|
-
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 border-border z-50 w-72 rounded-md border p-4 shadow-md outline-hidden', className), ...props }) }));
|
|
12
|
+
return (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: cn('bg-popover text-popover-foreground motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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 border-border z-50 w-72 rounded-md border p-4 shadow-md outline-hidden', className), ...props }) }));
|
|
13
13
|
}
|
|
14
14
|
function PopoverAnchor({ ...props }) {
|
|
15
15
|
return _jsx(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
@@ -7,7 +7,7 @@ declare function SheetClose({ ...props }: React.ComponentProps<typeof SheetPrimi
|
|
|
7
7
|
declare function SheetPortal({ ...props }: React.ComponentProps<typeof SheetPrimitive.Portal>): React.JSX.Element;
|
|
8
8
|
declare function SheetOverlay({ className, ...props }: React.ComponentProps<typeof SheetPrimitive.Overlay>): React.JSX.Element;
|
|
9
9
|
declare const sheetVariants: (props?: ({
|
|
10
|
-
side?: "
|
|
10
|
+
side?: "bottom" | "left" | "right" | "top" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
type SheetContentProps = React.ComponentProps<typeof SheetPrimitive.Content> & VariantProps<typeof sheetVariants>;
|
|
13
13
|
declare function SheetContent({ side, className, children, onInteractOutside, ...props }: SheetContentProps): React.JSX.Element;
|