@aortl/admin-react 0.20.0 → 0.21.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/CHANGELOG.md +32 -1
- package/dist/AdminRoot.d.ts +2 -2
- package/dist/AdminRoot.d.ts.map +1 -1
- package/dist/AppShell.d.ts +1 -1
- package/dist/BrandTile.d.ts +7 -1
- package/dist/BrandTile.d.ts.map +1 -1
- package/dist/Button.d.ts +4 -0
- package/dist/Button.d.ts.map +1 -1
- package/dist/Container.d.ts +3 -1
- package/dist/Container.d.ts.map +1 -1
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Drawer.d.ts.map +1 -1
- package/dist/Field.d.ts +9 -2
- package/dist/Field.d.ts.map +1 -1
- package/dist/Menu.d.ts +8 -2
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Navbar.d.ts +9 -2
- package/dist/Navbar.d.ts.map +1 -1
- package/dist/Select.d.ts.map +1 -1
- package/dist/Sidebar.d.ts.map +1 -1
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/admin.scoped.css +31 -161
- package/dist/index.cjs +587 -464
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +588 -466
- package/dist/index.mjs.map +1 -1
- package/dist/useConfirm.d.ts +32 -0
- package/dist/useConfirm.d.ts.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ConfirmOptions {
|
|
3
|
+
/** Dialog heading. */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** Supporting text under the heading. */
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
/** Confirm button label. Default: `"Confirm"`. */
|
|
8
|
+
confirmLabel?: ReactNode;
|
|
9
|
+
/** Cancel button label. Default: `"Cancel"`. */
|
|
10
|
+
cancelLabel?: ReactNode;
|
|
11
|
+
/** `"danger"` renders a danger confirm button and focuses Cancel instead of Confirm. Default: `"default"`. */
|
|
12
|
+
variant?: "default" | "danger";
|
|
13
|
+
}
|
|
14
|
+
type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Returns `confirm(options)`, an async `window.confirm`: it opens a confirmation
|
|
17
|
+
* dialog and resolves `true` on Confirm, `false` on Cancel, Esc, or when the
|
|
18
|
+
* hosting `<AdminRoot>` unmounts. Calls made while a dialog is open queue and
|
|
19
|
+
* open in call order. The function identity is stable.
|
|
20
|
+
*
|
|
21
|
+
* @throws When called outside `<AdminRoot>`, which hosts the dialog.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useConfirm(): ConfirmFn;
|
|
24
|
+
/**
|
|
25
|
+
* Hosts `useConfirm()` for its subtree: queues requests FIFO and renders the
|
|
26
|
+
* head of the queue as a dialog, nothing while idle. Rendered by `<AdminRoot>`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ConfirmHost({ children }: {
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=useConfirm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConfirm.d.ts","sourceRoot":"","sources":["../src/useConfirm.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,MAAM,WAAW,cAAc;IAC7B,sBAAsB;IACtB,KAAK,EAAE,SAAS,CAAC;IACjB,yCAAyC;IACzC,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,kDAAkD;IAClD,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,gDAAgD;IAChD,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,8GAA8G;IAC9G,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAChC;AAED,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAU/D;;;;;;;GAOG;AACH,wBAAgB,UAAU,IAAI,SAAS,CAMtC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,2CA6CjE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aortl/admin-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "React component library for the admin design system. Pairs with @aortl/admin-css.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"components",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@base-ui/react": "1.4.1",
|
|
45
45
|
"clsx": "2.1.1",
|
|
46
|
-
"@aortl/admin-css": "0.
|
|
46
|
+
"@aortl/admin-css": "0.21.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@testing-library/dom": "10.4.1",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"react": "19.2.6",
|
|
59
59
|
"react-dom": "19.2.6",
|
|
60
60
|
"typescript": "5.8.3",
|
|
61
|
-
"vite": "8.
|
|
61
|
+
"vite": "8.3.1",
|
|
62
62
|
"vite-plugin-dts": "5.0.0",
|
|
63
63
|
"vitest": "4.1.6"
|
|
64
64
|
},
|