@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
|
@@ -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"],"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,EAA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Q,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"}
|
|
@@ -45,7 +45,7 @@ function AccountBalanceCardDeleteButton({ className, ...props }) {
|
|
|
45
45
|
return ((0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { variant: "outline", size: "small", rounded: true, "data-slot": "account-balance-card-delete-button", className: (0, utils_1.cn)('absolute top-3 right-3', className), ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Trash, { className: "text-muted-foreground h-4 w-4" }) }));
|
|
46
46
|
}
|
|
47
47
|
function AccountBalanceCardContent({ className, ...props }) {
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleContent, { "data-slot": "account-balance-card-content", className: (0, utils_1.cn)('data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden', className), ...props }));
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleContent, { "data-slot": "account-balance-card-content", className: (0, utils_1.cn)('motion-safe:data-[state=closed]:animate-accordion-up motion-safe:data-[state=open]:animate-accordion-down overflow-hidden', className), ...props }));
|
|
49
49
|
}
|
|
50
50
|
function AccountBalanceCardLoading({ className, ...props }) {
|
|
51
51
|
return ((0, jsx_runtime_1.jsx)(skeleton_1.Skeleton, { "data-slot": "account-balance-card-loading", className: (0, utils_1.cn)('bg-muted mt-3 h-3 w-full rounded-md', className), ...props }));
|
|
@@ -61,7 +61,7 @@ function AccountBalanceCardUpdateButton({ className: _className, loading, timest
|
|
|
61
61
|
const updated = react_1.default.useMemo(() => {
|
|
62
62
|
return !(0, dayjs_1.default)(timestamp).isBefore((0, dayjs_1.default)().subtract(1, 'minute'));
|
|
63
63
|
}, [_time, timestamp]);
|
|
64
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-3 flex flex-row items-center justify-end gap-2", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-shadcn-500 text-xs font-medium", children: [loading && loadingLabel, !loading && !updated && updatedInLabel, !loading && updated && updatedLabel] }), !loading && updated && ((0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "h-4 w-4
|
|
64
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-3 flex flex-row items-center justify-end gap-2", children: [(0, jsx_runtime_1.jsxs)("p", { className: "text-shadcn-500 text-xs font-medium", children: [loading && loadingLabel, !loading && !updated && updatedInLabel, !loading && updated && updatedLabel] }), !loading && updated && ((0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "text-system-success h-4 w-4" })), (!updated || loading) && ((0, jsx_runtime_1.jsx)(button_1.Button, { ref: ref, variant: "link", "data-slot": "account-balance-card-update-button", className: "h-3 p-0", onClick: onRefresh, disabled: loading, ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)('size-4', { 'motion-safe:animate-spin': loading }) }) }))] }));
|
|
65
65
|
}
|
|
66
66
|
function AccountBalanceCardTrigger({ className, openLabel, closeLabel, children: _children, ...props }) {
|
|
67
67
|
const { open } = react_1.default.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,21 +1,59 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
37
|
exports.ConfirmationDialog = ConfirmationDialog;
|
|
5
38
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
const React = __importStar(require("react"));
|
|
6
40
|
const button_1 = require("../../../components/ui/button");
|
|
7
|
-
const
|
|
41
|
+
const alert_dialog_1 = require("../../../components/ui/alert-dialog");
|
|
8
42
|
const loading_button_1 = require("../../../components/ui/loading-button");
|
|
9
43
|
const lucide_react_1 = require("lucide-react");
|
|
10
44
|
const utils_1 = require("../../../lib/utils");
|
|
11
45
|
const class_variance_authority_1 = require("class-variance-authority");
|
|
12
46
|
const confirmationDialogIconVariants = (0, class_variance_authority_1.cva)('flex size-10 shrink-0 items-center justify-center rounded-lg [&>svg]:size-6', {
|
|
13
47
|
variants: {
|
|
48
|
+
// System tokens, not raw palette steps: a raw 50-step surface has no dark
|
|
49
|
+
// counterpart, so on the dark canvas it rendered a near-white block.
|
|
50
|
+
// `default` is deliberately neutral so `destructive` reads as a distinct,
|
|
51
|
+
// heavier warning instead of an alias of it.
|
|
14
52
|
variant: {
|
|
15
|
-
default: 'bg-
|
|
16
|
-
warning: 'bg-
|
|
17
|
-
destructive: 'bg-
|
|
18
|
-
success: 'bg-
|
|
53
|
+
default: 'bg-muted text-foreground',
|
|
54
|
+
warning: 'bg-system-alert-surface text-system-alert-h1a',
|
|
55
|
+
destructive: 'bg-system-error-surface text-system-error-h1a',
|
|
56
|
+
success: 'bg-system-success-surface text-system-success-h1a'
|
|
19
57
|
}
|
|
20
58
|
},
|
|
21
59
|
defaultVariants: {
|
|
@@ -23,6 +61,33 @@ const confirmationDialogIconVariants = (0, class_variance_authority_1.cva)('flex
|
|
|
23
61
|
}
|
|
24
62
|
});
|
|
25
63
|
const ConfirmationDialogIcon = ({ className, variant, ...props }) => ((0, jsx_runtime_1.jsxs)("span", { className: (0, utils_1.cn)(confirmationDialogIconVariants({ variant }), className), ...props, children: [variant === 'default' && (0, jsx_runtime_1.jsx)(lucide_react_1.Ban, {}), variant === 'warning' && (0, jsx_runtime_1.jsx)(lucide_react_1.TriangleAlert, {}), variant === 'destructive' && (0, jsx_runtime_1.jsx)(lucide_react_1.Ban, {}), variant === 'success' && (0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, {})] }));
|
|
26
|
-
function ConfirmationDialog({ open, onOpenChange, title = '', description = '', variant = 'default', loading, onConfirm = () => { }, onCancel = () => { }, confirmLabel, cancelLabel }) {
|
|
27
|
-
|
|
64
|
+
function ConfirmationDialog({ open, onOpenChange, title = '', description = '', variant = 'default', loading, onConfirm = () => { }, onCancel = () => { }, confirmLabel, cancelLabel, pendingLabel = 'Processing…' }) {
|
|
65
|
+
const [pending, setPending] = React.useState(false);
|
|
66
|
+
const busy = Boolean(loading) || pending;
|
|
67
|
+
const handleConfirm = async () => {
|
|
68
|
+
if (busy) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
setPending(true);
|
|
72
|
+
try {
|
|
73
|
+
await onConfirm();
|
|
74
|
+
onOpenChange(false);
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Deliberately silent: the caller owns error UX. Catching only keeps a
|
|
78
|
+
// rejection from escaping the click handler as an unhandled rejection —
|
|
79
|
+
// the dialog stays open so the caller can render the failure in place.
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
setPending(false);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
return ((0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialog, { open: open, onOpenChange: onOpenChange, children: (0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogContent, { "data-testid": "dialog",
|
|
86
|
+
// Radix already blocks outside interaction on an alert dialog, so
|
|
87
|
+
// Escape is the only remaining way to abandon a mutation mid-flight.
|
|
88
|
+
onEscapeKeyDown: (event) => {
|
|
89
|
+
if (busy) {
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
}
|
|
92
|
+
}, children: [(0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogHeader, { className: "flex-row items-center", children: [(0, jsx_runtime_1.jsx)(ConfirmationDialogIcon, { variant: variant }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-4", children: [(0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogTitle, { children: title }), (0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogDescription, { children: description })] })] }), (0, jsx_runtime_1.jsx)("span", { role: "status", className: "sr-only", children: busy ? pendingLabel : '' }), (0, jsx_runtime_1.jsxs)(alert_dialog_1.AlertDialogFooter, { className: "gap-4", children: [(0, jsx_runtime_1.jsx)(alert_dialog_1.AlertDialogCancel, { asChild: true, children: (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: onCancel, disabled: busy, variant: "secondary", size: "small", className: "enabled:border-button-border hover:border-button-border enabled:shadow-sm", children: cancelLabel ?? 'Cancel' }) }), (0, jsx_runtime_1.jsx)(loading_button_1.LoadingButton, { loading: busy, onClick: handleConfirm, variant: "primary", size: "small", "data-testid": "confirm", children: confirmLabel ?? 'Confirm' })] })] }) }));
|
|
28
93
|
}
|
|
@@ -58,5 +58,5 @@ function AccordionTrigger({ className, children, ...props }) {
|
|
|
58
58
|
return ((0, jsx_runtime_1.jsx)(AccordionPrimitive.Header, { className: "flex", children: (0, jsx_runtime_1.jsxs)(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: (0, utils_1.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, (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })] }) }));
|
|
59
59
|
}
|
|
60
60
|
function AccordionContent({ className, children, ...props }) {
|
|
61
|
-
return ((0, jsx_runtime_1.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: (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('pt-0 pb-4', className), children: children }) }));
|
|
61
|
+
return ((0, jsx_runtime_1.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: (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('pt-0 pb-4', className), children: children }) }));
|
|
62
62
|
}
|
|
@@ -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';
|
|
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';
|
|
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,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert-dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAGvD,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,IAAI,CAAC,qBAExD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC,qBAI3D;AAED,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,oBAAoB,CAAC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O,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"}
|
|
@@ -76,8 +76,8 @@ function AlertDialogTitle({ className, ...props }) {
|
|
|
76
76
|
function AlertDialogDescription({ className, ...props }) {
|
|
77
77
|
return ((0, jsx_runtime_1.jsx)(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", className: (0, utils_1.cn)('dialog-description', className), ...props }));
|
|
78
78
|
}
|
|
79
|
-
function AlertDialogAction({ className, ...props }) {
|
|
80
|
-
return ((0, jsx_runtime_1.jsx)(AlertDialogPrimitive.Action, { "data-slot": "alert-dialog-action", className: (0, utils_1.cn)((0, button_1.buttonVariants)(), className), ...props }));
|
|
79
|
+
function AlertDialogAction({ className, variant = 'default', ...props }) {
|
|
80
|
+
return ((0, jsx_runtime_1.jsx)(AlertDialogPrimitive.Action, { "data-slot": "alert-dialog-action", className: (0, utils_1.cn)((0, button_1.buttonVariants)({ variant }), className), ...props }));
|
|
81
81
|
}
|
|
82
82
|
function AlertDialogCancel({ className, ...props }) {
|
|
83
83
|
return ((0, jsx_runtime_1.jsx)(AlertDialogPrimitive.Cancel, { "data-slot": "alert-dialog-cancel", className: (0, utils_1.cn)((0, button_1.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,GAAG,EAAE,CAAA;IAC7B,aAAa,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,WAAW,EAAE,MAAM,IAAI,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,cAAc,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,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,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"}
|
|
@@ -157,7 +157,7 @@ function AutocompleteEmpty({ className, ...props }) {
|
|
|
157
157
|
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "autocomplete-empty", className: (0, utils_1.cn)('py-6 text-center text-sm', className), "cmdk-empty": "", role: "presentation", ...props }));
|
|
158
158
|
}
|
|
159
159
|
function AutocompleteLoading({ className, ref, ...props }) {
|
|
160
|
-
return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.Loading, { ref: ref, "data-slot": "autocomplete-loading", className: (0, utils_1.cn)('flex items-center justify-center py-6 text-center text-sm', className), ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-muted-foreground h-5 w-5 animate-spin" }) }));
|
|
160
|
+
return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.Loading, { ref: ref, "data-slot": "autocomplete-loading", className: (0, utils_1.cn)('flex items-center justify-center py-6 text-center text-sm', className), ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "text-muted-foreground h-5 w-5 motion-safe:animate-spin" }) }));
|
|
161
161
|
}
|
|
162
162
|
exports.SIDE_OPTIONS = ['top', 'right', 'bottom', 'left'];
|
|
163
163
|
function AutocompleteContent({ className, position = 'popper', side = 'bottom', ref, children, onMouseEnter, onMouseLeave, onPointerDownOutside, ...props }) {
|
|
@@ -165,6 +165,17 @@ function AutocompleteContent({ className, position = 'popper', side = 'bottom',
|
|
|
165
165
|
const { open, addOption, setOpen, onScrollbar, setOnScrollbar, inputRef } = useAutocomplete();
|
|
166
166
|
react_1.default.useImperativeHandle(ref, () => _ref.current);
|
|
167
167
|
(0, use_click_away_1.useClickAway)(_ref, (event) => {
|
|
168
|
+
/**
|
|
169
|
+
* ⛔ THE `open` GUARD IS LOAD-BEARING SINCE THIS LIST STOPPED UNMOUNTING.
|
|
170
|
+
* While the panel returned `null` this handler was inert by accident: its
|
|
171
|
+
* ref pointed at nothing. Now that the list stays in the DOM (see the return
|
|
172
|
+
* below), every click anywhere on the page reaches here — and without this
|
|
173
|
+
* line each one would call `setOpen(false)` and blur the input. A consumer
|
|
174
|
+
* form carrying ten of these would run ten handlers per click.
|
|
175
|
+
*/
|
|
176
|
+
if (!open) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
168
179
|
// Should not close when clicking on the scrollbar
|
|
169
180
|
if (onScrollbar) {
|
|
170
181
|
return;
|
|
@@ -207,17 +218,42 @@ function AutocompleteContent({ className, position = 'popper', side = 'bottom',
|
|
|
207
218
|
react_1.default.useEffect(() => {
|
|
208
219
|
_searchChildren(children);
|
|
209
220
|
}, [children]);
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
221
|
+
/**
|
|
222
|
+
* ⛔ THE LIST STAYS IN THE DOM, THE OPTIONS DO NOT — and the split is the whole
|
|
223
|
+
* fix (#150).
|
|
224
|
+
*
|
|
225
|
+
* cmdk puts `aria-controls={listId}` on the input it renders and `id={listId}`
|
|
226
|
+
* on this list. Returning `null` while closed therefore left the input naming
|
|
227
|
+
* an element that did not exist, which axe-core reports as a CRITICAL
|
|
228
|
+
* `aria-valid-attr-value` violation — measured as 10 failing cases across five
|
|
229
|
+
* forms in a consumer, in both the populated and the empty state. A screen
|
|
230
|
+
* reader following the reference resolved it to nothing.
|
|
231
|
+
*
|
|
232
|
+
* ⛔ AND NOT "KEEP EVERYTHING MOUNTED", which is the obvious reading of the
|
|
233
|
+
* fix and is too expensive. Only the LIST carries the id; the options carry
|
|
234
|
+
* the cost. One consumer form puts up to ten of these on screen, each holding
|
|
235
|
+
* a page of up to a hundred options — roughly a thousand permanently present
|
|
236
|
+
* nodes for an id that is one element. `{open ? children : null}` keeps the
|
|
237
|
+
* reference resolvable and the DOM the size it was.
|
|
238
|
+
*
|
|
239
|
+
* ⚠️ `hidden` AND NOT A CLASS. It removes the subtree from the accessibility
|
|
240
|
+
* tree as well as from view, so a closed panel is not an empty `listbox` that
|
|
241
|
+
* a screen reader can reach into.
|
|
242
|
+
*
|
|
243
|
+
* ⚠️ THE ENTRY ANIMATION IS NOT LOST, because there was none to lose: the
|
|
244
|
+
* className carries `animate-in` with no `fade-in-*` / `zoom-in-*` / `slide-in-*`
|
|
245
|
+
* companion, so every `--tw-enter-*` variable sits at its default and the
|
|
246
|
+
* keyframe is a no-op today. Should a real one be added later, it belongs on a
|
|
247
|
+
* wrapper INSIDE this list — that subtree still mounts with the children.
|
|
248
|
+
*/
|
|
249
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "relative", hidden: !open, children: (0, jsx_runtime_1.jsx)(cmdk_1.Command.List, { ref: _ref, className: (0, utils_1.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' &&
|
|
214
250
|
'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) => {
|
|
215
251
|
onMouseEnter?.(e);
|
|
216
252
|
setOnScrollbar(true);
|
|
217
253
|
}, onMouseLeave: (e) => {
|
|
218
254
|
onMouseLeave?.(e);
|
|
219
255
|
setOnScrollbar(false);
|
|
220
|
-
}, children: children }) }));
|
|
256
|
+
}, children: open ? children : null }) }));
|
|
221
257
|
}
|
|
222
258
|
function AutocompleteGroup({ className, ...props }) {
|
|
223
259
|
return ((0, jsx_runtime_1.jsx)(cmdk_1.Command.Group, { "data-slot": "autocomplete-group", className: (0, utils_1.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?: "default" | "plain" | "hoverLink" | "primary" | "secondary" | "tertiary" | "outline" | "link" | null | undefined;
|
|
4
|
+
variant?: "default" | "plain" | "hoverLink" | "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"}
|
|
@@ -16,7 +16,8 @@ const buttonVariants = (0, class_variance_authority_1.cva)('button-base button-d
|
|
|
16
16
|
secondary: 'button-secondary',
|
|
17
17
|
tertiary: 'button-tertiary',
|
|
18
18
|
outline: 'button-outline',
|
|
19
|
-
link: 'button-link'
|
|
19
|
+
link: 'button-link',
|
|
20
|
+
destructive: 'button-destructive'
|
|
20
21
|
},
|
|
21
22
|
fullWidth: {
|
|
22
23
|
true: 'w-full',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@theme inline {
|
|
2
2
|
/* Button */
|
|
3
|
-
--text-button:
|
|
3
|
+
--text-button-link: 13px;
|
|
4
4
|
--spacing-button-px: calc(var(--spacing) * 4);
|
|
5
5
|
--spacing-button-py: calc(var(--spacing) * 3);
|
|
6
6
|
--spacing-button-px-small: calc(var(--spacing) * 3);
|
|
@@ -19,11 +19,18 @@
|
|
|
19
19
|
--color-button-tertiary: var(--color-accent);
|
|
20
20
|
--color-button-tertiary-foreground: var(--color-accent-foreground);
|
|
21
21
|
--color-button-outline-foreground: var(--color-muted-foreground);
|
|
22
|
+
--color-button-destructive: var(--color-destructive);
|
|
23
|
+
--color-button-destructive-foreground: var(--color-destructive-foreground);
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
@layer components {
|
|
25
27
|
.button-base {
|
|
26
|
-
@apply h-button-h px-button-px py-button-py relative inline-flex cursor-pointer items-center justify-center rounded-lg text-sm font-medium whitespace-nowrap shadow-sm transition-colors;
|
|
28
|
+
@apply h-button-h px-button-px py-button-py ring-offset-background relative inline-flex cursor-pointer items-center justify-center rounded-lg text-sm font-medium whitespace-nowrap shadow-sm transition-colors;
|
|
29
|
+
/* Keyboard focus was unstyled on every kit button, so consumers restated a
|
|
30
|
+
ring by hand. Same idiom as tabs-trigger and textarea. `.button-read-only`
|
|
31
|
+
out-specifies this (class + attribute + pseudo-class), so the read-only
|
|
32
|
+
suppression still wins without depending on source order. */
|
|
33
|
+
@apply focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
.button-plain {
|
|
@@ -46,8 +53,14 @@
|
|
|
46
53
|
@apply text-button-outline-foreground hover:border-shadcn-400 border border-transparent shadow-none;
|
|
47
54
|
}
|
|
48
55
|
|
|
56
|
+
.button-destructive {
|
|
57
|
+
/* Disabled deliberately drops the red and reuses the shared muted pair: a
|
|
58
|
+
disabled danger button must not still read as armed. */
|
|
59
|
+
@apply bg-button-destructive text-button-destructive-foreground hover:bg-button-destructive/80 disabled:bg-button-primary-disabled disabled:text-button-primary-foreground-disabled;
|
|
60
|
+
}
|
|
61
|
+
|
|
49
62
|
.button-link {
|
|
50
|
-
@apply !h-4 !p-0 !px-0 !py-0
|
|
63
|
+
@apply !text-button-link !h-4 !p-0 !px-0 !py-0 underline shadow-none;
|
|
51
64
|
}
|
|
52
65
|
|
|
53
66
|
.button-disabled {
|
|
@@ -55,7 +68,7 @@
|
|
|
55
68
|
}
|
|
56
69
|
|
|
57
70
|
.button-read-only {
|
|
58
|
-
@apply data-[read-only=true]:cursor-default data-[read-only=true]:border-transparent data-[read-only=true]:opacity-50 data-[read-only=true]:shadow-none data-[read-only=true]:focus:ring-0 data-[read-only=true]:focus:outline-hidden;
|
|
71
|
+
@apply data-[read-only=true]:cursor-default data-[read-only=true]:border-transparent data-[read-only=true]:opacity-50 data-[read-only=true]:shadow-none data-[read-only=true]:focus:ring-0 data-[read-only=true]:focus:ring-offset-0 data-[read-only=true]:focus:outline-hidden;
|
|
59
72
|
}
|
|
60
73
|
|
|
61
74
|
.button-small {
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
@layer components {
|
|
7
7
|
.dialog-overlay {
|
|
8
|
-
@apply data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50;
|
|
8
|
+
@apply 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 fixed inset-0 z-50 bg-black/50;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.dialog-content {
|
|
12
|
-
@apply bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-8 border p-7 shadow-lg duration-200 sm:max-w-[425px] sm:rounded-lg;
|
|
12
|
+
@apply bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-8 border p-7 shadow-lg duration-200 sm:max-w-[425px] sm:rounded-lg;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.dialog-close {
|
|
16
|
-
@apply data-[state=open]:bg-
|
|
16
|
+
@apply data-[state=open]:bg-muted data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 disabled:pointer-events-none;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.dialog-header {
|
|
@@ -65,7 +65,7 @@ function DropdownMenuTrigger({ className, ...props }) {
|
|
|
65
65
|
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", className: (0, utils_1.cn)('flex items-center justify-center outline-hidden', className), ...props }));
|
|
66
66
|
}
|
|
67
67
|
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
68
|
-
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Portal, { children: (0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: (0, utils_1.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 }) }));
|
|
68
|
+
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Portal, { children: (0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: (0, utils_1.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 }) }));
|
|
69
69
|
}
|
|
70
70
|
function DropdownMenuGroup({ ...props }) {
|
|
71
71
|
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props }));
|
|
@@ -103,5 +103,5 @@ function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
|
103
103
|
return ((0, jsx_runtime_1.jsxs)(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", "data-inset": inset, className: (0, utils_1.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, (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "ml-auto h-4 w-4" })] }));
|
|
104
104
|
}
|
|
105
105
|
function DropdownMenuSubContent({ className, ...props }) {
|
|
106
|
-
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: (0, utils_1.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 }));
|
|
106
|
+
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: (0, utils_1.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 }));
|
|
107
107
|
}
|
|
@@ -47,5 +47,5 @@ function HoverCardTrigger({ ...props }) {
|
|
|
47
47
|
return ((0, jsx_runtime_1.jsx)(HoverCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props }));
|
|
48
48
|
}
|
|
49
49
|
function HoverCardContent({ className, align = 'center', sideOffset = 4, ...props }) {
|
|
50
|
-
return ((0, jsx_runtime_1.jsx)(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: (0, jsx_runtime_1.jsx)(HoverCardPrimitive.Content, { "data-slot": "hover-card-content", align: align, sideOffset: sideOffset, className: (0, utils_1.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 }) }));
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: (0, jsx_runtime_1.jsx)(HoverCardPrimitive.Content, { "data-slot": "hover-card-content", align: align, sideOffset: sideOffset, className: (0, utils_1.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 }) }));
|
|
51
51
|
}
|
|
@@ -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';
|
|
@@ -5,5 +5,5 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const button_1 = require("../button");
|
|
6
6
|
const lucide_react_1 = require("lucide-react");
|
|
7
7
|
function LoadingButton({ loading, disabled, children, ...props }) {
|
|
8
|
-
return ((0, jsx_runtime_1.jsxs)(button_1.Button, { ...props, disabled: loading || disabled, children: [loading && (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), children] }));
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)(button_1.Button, { ...props, disabled: loading || disabled, children: [loading && (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "mr-2 h-4 w-4 motion-safe:animate-spin" }), children] }));
|
|
9
9
|
}
|
|
@@ -142,7 +142,7 @@ exports.MultipleSelectContent = react_1.default.forwardRef(({ className, positio
|
|
|
142
142
|
if (!open) {
|
|
143
143
|
return null;
|
|
144
144
|
}
|
|
145
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "relative", children: (0, jsx_runtime_1.jsx)(cmdk_1.Command.List, { ref: ref, className: (0, utils_1.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' &&
|
|
145
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "relative", children: (0, jsx_runtime_1.jsx)(cmdk_1.Command.List, { ref: ref, className: (0, utils_1.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' &&
|
|
146
146
|
'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) => {
|
|
147
147
|
onMouseEnter?.(e);
|
|
148
148
|
setOnScrollbar(true);
|
|
@@ -52,7 +52,7 @@ function InputOTPGroup({ className, ...props }) {
|
|
|
52
52
|
function InputOTPSlot({ index, className, ...props }) {
|
|
53
53
|
const inputOTPContext = React.useContext(input_otp_1.OTPInputContext);
|
|
54
54
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
55
|
-
return ((0, jsx_runtime_1.jsxs)("div", { "data-slot": "input-otp-slot", "data-active": isActive, className: (0, utils_1.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 && ((0, jsx_runtime_1.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("div", { className: "animate-caret-blink bg-foreground h-6 w-px duration-1000" }) }))] }));
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)("div", { "data-slot": "input-otp-slot", "data-active": isActive, className: (0, utils_1.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 && ((0, jsx_runtime_1.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)("div", { className: "motion-safe:animate-caret-blink bg-foreground h-6 w-px duration-1000" }) }))] }));
|
|
56
56
|
}
|
|
57
57
|
function InputOTPSeparator({ ...props }) {
|
|
58
58
|
return ((0, jsx_runtime_1.jsx)("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.MinusIcon, {}) }));
|
|
@@ -20,5 +20,5 @@ function PaperCollapsibleTrigger({ className, children: _children, ...props }) {
|
|
|
20
20
|
return ((0, jsx_runtime_1.jsx)(collapsible_1.CollapsibleTrigger, { "data-slot": "paper-collapsible-trigger", className: (0, utils_1.cn)('transition-all hover:underline [&[data-state=open]>svg]:rotate-180', className), ...props, children: (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "text-foreground size-6 shrink-0 cursor-pointer transition-transform duration-200" }) }));
|
|
21
21
|
}
|
|
22
22
|
function PaperCollapsibleContent({ className, children, ...props }) {
|
|
23
|
-
return ((0, jsx_runtime_1.jsxs)(collapsible_1.CollapsibleContent, { "data-slot": "paper-collapsible-content", className: (0, utils_1.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: [(0, jsx_runtime_1.jsx)(separator_1.Separator, {}), children] }));
|
|
23
|
+
return ((0, jsx_runtime_1.jsxs)(collapsible_1.CollapsibleContent, { "data-slot": "paper-collapsible-content", className: (0, utils_1.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: [(0, jsx_runtime_1.jsx)(separator_1.Separator, {}), children] }));
|
|
24
24
|
}
|
|
@@ -48,7 +48,7 @@ function PopoverTrigger({ ...props }) {
|
|
|
48
48
|
return (0, jsx_runtime_1.jsx)(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
49
49
|
}
|
|
50
50
|
function PopoverContent({ className, align = 'center', sideOffset = 4, ...props }) {
|
|
51
|
-
return ((0, jsx_runtime_1.jsx)(PopoverPrimitive.Portal, { children: (0, jsx_runtime_1.jsx)(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: (0, utils_1.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 }) }));
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(PopoverPrimitive.Portal, { children: (0, jsx_runtime_1.jsx)(PopoverPrimitive.Content, { "data-slot": "popover-content", align: align, sideOffset: sideOffset, className: (0, utils_1.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 }) }));
|
|
52
52
|
}
|
|
53
53
|
function PopoverAnchor({ ...props }) {
|
|
54
54
|
return (0, jsx_runtime_1.jsx)(PopoverPrimitive.Anchor, { "data-slot": "popover-anchor", ...props });
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
.select-content {
|
|
34
34
|
@apply bg-popover text-popover-foreground relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md;
|
|
35
|
-
@apply 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;
|
|
35
|
+
@apply 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;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.select-content-popper {
|
|
@@ -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;
|
|
@@ -63,9 +63,9 @@ function SheetPortal({ ...props }) {
|
|
|
63
63
|
return (0, jsx_runtime_1.jsx)(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
64
64
|
}
|
|
65
65
|
function SheetOverlay({ className, ...props }) {
|
|
66
|
-
return ((0, jsx_runtime_1.jsx)(SheetPrimitive.Overlay, { "data-slot": "sheet-overlay", className: (0, utils_1.cn)('data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80', className), ...props }));
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(SheetPrimitive.Overlay, { "data-slot": "sheet-overlay", className: (0, utils_1.cn)('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 fixed inset-0 z-50 bg-black/80', className), ...props }));
|
|
67
67
|
}
|
|
68
|
-
const sheetVariants = (0, class_variance_authority_1.cva)('fixed z-50 gap-4 bg-background p-12 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500', {
|
|
68
|
+
const sheetVariants = (0, class_variance_authority_1.cva)('fixed z-50 gap-4 bg-background p-12 shadow-lg transition ease-in-out motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500', {
|
|
69
69
|
variants: {
|
|
70
70
|
side: {
|
|
71
71
|
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
|