@nadicodeai/ui 12.1.29 → 12.1.30
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/confirm-dialog.d.ts +2 -1
- package/dist/components/confirm-dialog.d.ts.map +1 -1
- package/dist/components/confirm-dialog.js +3 -2
- package/dist/components/empty.js +1 -1
- package/dist/components/notice-banner.d.ts +5 -2
- package/dist/components/notice-banner.d.ts.map +1 -1
- package/dist/components/notice-banner.js +5 -2
- package/package.json +2 -2
|
@@ -5,6 +5,7 @@ interface ConfirmDialogProps {
|
|
|
5
5
|
onCancel: () => void;
|
|
6
6
|
title: React.ReactNode;
|
|
7
7
|
description?: React.ReactNode;
|
|
8
|
+
error?: React.ReactNode;
|
|
8
9
|
confirmLabel?: React.ReactNode;
|
|
9
10
|
/** The confirm button's own word while the action runs. */
|
|
10
11
|
confirmPendingLabel?: React.ReactNode;
|
|
@@ -12,7 +13,7 @@ interface ConfirmDialogProps {
|
|
|
12
13
|
destructive?: boolean;
|
|
13
14
|
loading?: boolean;
|
|
14
15
|
}
|
|
15
|
-
declare function ConfirmDialog({ open, onConfirm, onCancel, title, description, confirmLabel, confirmPendingLabel, cancelLabel, destructive, loading, }: ConfirmDialogProps): React.JSX.Element;
|
|
16
|
+
declare function ConfirmDialog({ open, onConfirm, onCancel, title, description, error, confirmLabel, confirmPendingLabel, cancelLabel, destructive, loading, }: ConfirmDialogProps): React.JSX.Element;
|
|
16
17
|
export { ConfirmDialog };
|
|
17
18
|
export type { ConfirmDialogProps };
|
|
18
19
|
//# sourceMappingURL=confirm-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confirm-dialog.d.ts","sourceRoot":"","sources":["../../src/components/confirm-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"confirm-dialog.d.ts","sourceRoot":"","sources":["../../src/components/confirm-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAcpC,UAAU,kBAAkB;IAC1B,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,2DAA2D;IAC3D,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACtC,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAOD,iBAAS,aAAa,CAAC,EACrB,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,KAAK,EACL,WAAW,EACX,KAAK,EACL,YAAwB,EACxB,mBAAmB,EACnB,WAAsB,EACtB,WAAmB,EACnB,OAAe,GAChB,EAAE,kBAAkB,qBAkCpB;AAED,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { AlertDialog, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "./alert-dialog.js";
|
|
4
4
|
import { Button } from "./button.js";
|
|
5
|
+
import { FieldError } from "./field.js";
|
|
5
6
|
import { PendingLabel } from "./pending-label.js";
|
|
6
7
|
// Fully controlled confirm dialog over the registry AlertDialog parts. The
|
|
7
8
|
// confirm action is a plain Button (not AlertDialogAction) so a failed confirm
|
|
8
9
|
// can keep the dialog open; the only closing gesture is Escape (alert dialogs
|
|
9
10
|
// take no backdrop dismissal), which routes through onCancel, and loading
|
|
10
11
|
// disables both buttons while the action runs.
|
|
11
|
-
function ConfirmDialog({ open, onConfirm, onCancel, title, description, confirmLabel = "Confirm", confirmPendingLabel, cancelLabel = "Cancel", destructive = false, loading = false, }) {
|
|
12
|
+
function ConfirmDialog({ open, onConfirm, onCancel, title, description, error, confirmLabel = "Confirm", confirmPendingLabel, cancelLabel = "Cancel", destructive = false, loading = false, }) {
|
|
12
13
|
return (_jsx(AlertDialog, { open: open, onOpenChange: (nextOpen) => {
|
|
13
14
|
if (!nextOpen) {
|
|
14
15
|
onCancel();
|
|
15
16
|
}
|
|
16
|
-
}, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: title }), description ? _jsx(AlertDialogDescription, { children: description }) : null] }), _jsxs(AlertDialogFooter, { children: [_jsx(Button, { variant: "outline", onClick: onCancel, disabled: loading, children: cancelLabel }), _jsx(Button, { "aria-busy": loading || undefined, variant: destructive ? "destructive" : "default", onClick: onConfirm, disabled: loading, children: _jsx(PendingLabel, { pending: loading, pendingLabel: confirmPendingLabel ?? confirmLabel, children: confirmLabel }) })] })] }) }));
|
|
17
|
+
}, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: title }), description ? _jsx(AlertDialogDescription, { children: description }) : null, error ? _jsx(FieldError, { children: error }) : null] }), _jsxs(AlertDialogFooter, { children: [_jsx(Button, { variant: "outline", onClick: onCancel, disabled: loading, children: cancelLabel }), _jsx(Button, { "aria-busy": loading || undefined, variant: destructive ? "destructive" : "default", onClick: onConfirm, disabled: loading, children: _jsx(PendingLabel, { pending: loading, pendingLabel: confirmPendingLabel ?? confirmLabel, children: confirmLabel }) })] })] }) }));
|
|
17
18
|
}
|
|
18
19
|
export { ConfirmDialog };
|
package/dist/components/empty.js
CHANGED
|
@@ -11,7 +11,7 @@ const emptyMediaVariants = cva("mb-2 flex shrink-0 items-center justify-center [
|
|
|
11
11
|
variants: {
|
|
12
12
|
variant: {
|
|
13
13
|
default: "bg-transparent",
|
|
14
|
-
icon: "flex size-control-height shrink-0 items-center justify-center rounded-md bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",
|
|
14
|
+
icon: "flex size-control-height shrink-0 items-center justify-center rounded-md border border-border bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
|
-
export type NoticeBannerTone = "neutral" | "info" | "warning";
|
|
2
|
+
export type NoticeBannerTone = "neutral" | "info" | "warning" | "destructive";
|
|
3
3
|
export type NoticeBannerLiveRegion = "off" | "polite";
|
|
4
4
|
export type NoticeBannerProps = {
|
|
5
5
|
action?: ReactElement;
|
|
@@ -10,6 +10,9 @@ export type NoticeBannerProps = {
|
|
|
10
10
|
title: ReactNode;
|
|
11
11
|
tone: NoticeBannerTone;
|
|
12
12
|
} & Omit<ComponentProps<"div">, "children" | "title">;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Non-blocking operational, stale-data, replacement, and read-only guidance, and
|
|
15
|
+
* a section that cannot be shown.
|
|
16
|
+
*/
|
|
14
17
|
export declare function NoticeBanner({ action, className, description, detail, liveRegion, title, tone, ...props }: NoticeBannerProps): import("react").JSX.Element;
|
|
15
18
|
//# sourceMappingURL=notice-banner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice-banner.d.ts","sourceRoot":"","sources":["../../src/components/notice-banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrE,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"notice-banner.d.ts","sourceRoot":"","sources":["../../src/components/notice-banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrE,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC;AAC9E,MAAM,MAAM,sBAAsB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEtD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,EAAE,sBAAsB,CAAC;IACnC,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,gBAAgB,CAAC;CACxB,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,SAAS,EACT,WAAW,EACX,MAAM,EACN,UAAU,EACV,KAAK,EACL,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,iBAAiB,+BAyBnB"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Info, TriangleAlert } from "lucide-react";
|
|
3
3
|
import { Alert, AlertAction, AlertDescription, AlertTitle } from "./alert.js";
|
|
4
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Non-blocking operational, stale-data, replacement, and read-only guidance, and
|
|
6
|
+
* a section that cannot be shown.
|
|
7
|
+
*/
|
|
5
8
|
export function NoticeBanner({ action, className, description, detail, liveRegion, title, tone, ...props }) {
|
|
6
|
-
const Icon = tone === "warning" ? TriangleAlert : Info;
|
|
9
|
+
const Icon = tone === "warning" || tone === "destructive" ? TriangleAlert : Info;
|
|
7
10
|
const isLive = liveRegion === "polite";
|
|
8
11
|
return (_jsxs(Alert, { "aria-atomic": isLive ? "true" : undefined, "aria-live": isLive ? "polite" : undefined, className: className, "data-live-region": liveRegion, "data-notice-banner": true, "data-tone": tone, role: isLive ? "status" : "note", variant: tone === "neutral" ? "default" : tone, ...props, children: [_jsx(Icon, { "aria-hidden": "true" }), _jsx(AlertTitle, { children: title }), _jsxs(AlertDescription, { className: "min-w-0 flex flex-col gap-2", children: [description ? _jsx("div", { "data-notice-description": true, children: description }) : null, detail ? _jsx("div", { "data-notice-detail": true, children: detail }) : null] }), action ? _jsx(AlertAction, { "data-notice-action": true, children: action }) : null] }));
|
|
9
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadicodeai/ui",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@assistant-ui/react": "0.15.21",
|
|
77
77
|
"@assistant-ui/react-markdown": "0.14.16",
|
|
78
78
|
"@base-ui/react": "^1.8.0",
|
|
79
|
-
"@nadicodeai/design-system": "12.1.
|
|
79
|
+
"@nadicodeai/design-system": "12.1.30",
|
|
80
80
|
"class-variance-authority": "^0.7.1",
|
|
81
81
|
"clsx": "^2.1.1",
|
|
82
82
|
"cmdk": "^1.1.1",
|