@calliopelabs/ui 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/overlays/AlertDialog.d.ts +22 -0
- package/dist/overlays/AlertDialog.js +41 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export { ErrorState, type ErrorStateProps } from "./states/ErrorState.js";
|
|
|
40
40
|
export { LoadingState, type LoadingStateProps } from "./states/LoadingState.js";
|
|
41
41
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "./overlays/Dialog.js";
|
|
42
42
|
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, } from "./overlays/Drawer.js";
|
|
43
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "./overlays/AlertDialog.js";
|
|
43
44
|
export { ConfirmDialog, type ConfirmDialogProps, type ConfirmReason, } from "./overlays/ConfirmDialog.js";
|
|
44
45
|
export { Button, buttonVariants, type ButtonProps } from "./primitives/Button.js";
|
|
45
46
|
export { Input } from "./primitives/Input.js";
|
package/dist/index.js
CHANGED
|
@@ -50,6 +50,7 @@ export { LoadingState } from "./states/LoadingState.js";
|
|
|
50
50
|
// Overlays
|
|
51
51
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "./overlays/Dialog.js";
|
|
52
52
|
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, } from "./overlays/Drawer.js";
|
|
53
|
+
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "./overlays/AlertDialog.js";
|
|
53
54
|
export { ConfirmDialog, } from "./overlays/ConfirmDialog.js";
|
|
54
55
|
// Primitives
|
|
55
56
|
export { Button, buttonVariants } from "./primitives/Button.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
import { Button } from "../primitives/Button.js";
|
|
4
|
+
/**
|
|
5
|
+
* The parts of a confirmation that needs more than ConfirmDialog holds: a
|
|
6
|
+
* preview of what the action touches, a typed check, a choice. Prefer
|
|
7
|
+
* ConfirmDialog when a title, a description and an optional reason will do;
|
|
8
|
+
* it brings the pending state and the error feedback. The scrim does not
|
|
9
|
+
* close an alert dialog; Escape and Cancel do.
|
|
10
|
+
*/
|
|
11
|
+
export declare function AlertDialog(props: React.ComponentProps<typeof AlertDialogPrimitive.Root>): React.JSX.Element;
|
|
12
|
+
export declare function AlertDialogTrigger(props: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>): React.JSX.Element;
|
|
13
|
+
export declare function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Content>): React.JSX.Element;
|
|
14
|
+
export declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
15
|
+
export declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
16
|
+
export declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
|
|
17
|
+
export declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
|
|
18
|
+
type ButtonLook = Pick<React.ComponentProps<typeof Button>, "variant" | "size">;
|
|
19
|
+
/** Closes the dialog when clicked; call `event.preventDefault()` to hold it open. */
|
|
20
|
+
export declare function AlertDialogAction({ className, variant, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Action> & ButtonLook): React.JSX.Element;
|
|
21
|
+
export declare function AlertDialogCancel({ className, variant, size, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> & ButtonLook): React.JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { Button } from "../primitives/Button.js";
|
|
6
|
+
import { overlayClassName } from "./Dialog.js";
|
|
7
|
+
/**
|
|
8
|
+
* The parts of a confirmation that needs more than ConfirmDialog holds: a
|
|
9
|
+
* preview of what the action touches, a typed check, a choice. Prefer
|
|
10
|
+
* ConfirmDialog when a title, a description and an optional reason will do;
|
|
11
|
+
* it brings the pending state and the error feedback. The scrim does not
|
|
12
|
+
* close an alert dialog; Escape and Cancel do.
|
|
13
|
+
*/
|
|
14
|
+
export function AlertDialog(props) {
|
|
15
|
+
return _jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
|
|
16
|
+
}
|
|
17
|
+
export function AlertDialogTrigger(props) {
|
|
18
|
+
return _jsx(AlertDialogPrimitive.Trigger, { "data-slot": "alert-dialog-trigger", ...props });
|
|
19
|
+
}
|
|
20
|
+
export function AlertDialogContent({ className, ...props }) {
|
|
21
|
+
return (_jsxs(AlertDialogPrimitive.Portal, { children: [_jsx(AlertDialogPrimitive.Overlay, { "data-slot": "alert-dialog-overlay", className: overlayClassName("bg-black/10") }), _jsx(AlertDialogPrimitive.Content, { "data-slot": "alert-dialog-content", className: cn("fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-xs -translate-x-1/2 -translate-y-1/2 grid-cols-[minmax(0,1fr)] gap-4 overflow-y-auto rounded-xl bg-background p-4 text-foreground shadow-lg ring-1 ring-foreground/10 outline-none data-[state=closed]:animate-cui-pop-out data-[state=open]:animate-cui-pop-in sm:max-w-sm", className), ...props })] }));
|
|
22
|
+
}
|
|
23
|
+
export function AlertDialogHeader({ className, ...props }) {
|
|
24
|
+
return (_jsx("div", { "data-slot": "alert-dialog-header", className: cn("grid place-items-center gap-1.5 text-center sm:place-items-start sm:text-left", className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
export function AlertDialogFooter({ className, ...props }) {
|
|
27
|
+
return (_jsx("div", { "data-slot": "alert-dialog-footer", className: cn("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end", className), ...props }));
|
|
28
|
+
}
|
|
29
|
+
export function AlertDialogTitle({ className, ...props }) {
|
|
30
|
+
return (_jsx(AlertDialogPrimitive.Title, { "data-slot": "alert-dialog-title", className: cn("font-head text-base font-semibold [overflow-wrap:anywhere]", className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
export function AlertDialogDescription({ className, ...props }) {
|
|
33
|
+
return (_jsx(AlertDialogPrimitive.Description, { "data-slot": "alert-dialog-description", className: cn("text-sm [overflow-wrap:anywhere] text-muted-foreground", className), ...props }));
|
|
34
|
+
}
|
|
35
|
+
/** Closes the dialog when clicked; call `event.preventDefault()` to hold it open. */
|
|
36
|
+
export function AlertDialogAction({ className, variant = "default", size = "default", ...props }) {
|
|
37
|
+
return (_jsx(Button, { variant: variant, size: size, asChild: true, children: _jsx(AlertDialogPrimitive.Action, { "data-slot": "alert-dialog-action", className: className, ...props }) }));
|
|
38
|
+
}
|
|
39
|
+
export function AlertDialogCancel({ className, variant = "outline", size = "default", ...props }) {
|
|
40
|
+
return (_jsx(Button, { variant: variant, size: size, asChild: true, children: _jsx(AlertDialogPrimitive.Cancel, { "data-slot": "alert-dialog-cancel", className: className, ...props }) }));
|
|
41
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@calliopelabs/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Calliope AI shared operator UI: app shell, navigation, page frame, data table and list patterns, status colours, design tokens and appearance for Astrolift AI and Zentinelle AI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"calliope-ai",
|