@handamade/psi-react 0.11.0 → 0.12.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/Dialog/Dialog.d.ts +18 -3
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/index.js +435 -426
- package/dist/manifest.json +9 -2
- package/dist/patterns.json +9 -11
- package/dist/styles.css +1 -1
- package/docs/Dialog.md +4 -3
- package/llms.txt +5 -0
- package/package.json +2 -2
package/dist/Dialog/Dialog.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { DialogHTMLAttributes, ReactNode, Ref } from "react";
|
|
2
2
|
type Width = 400 | 560 | 720;
|
|
3
|
+
/** Where the panel sits. `inline-*` pin it full-height to that edge — that is
|
|
4
|
+
* a drawer / side sheet, and D66 is the decision that it is a placement rather
|
|
5
|
+
* than a sibling component. Logical, not `left`/`right`, so RTL flips without a
|
|
6
|
+
* second code path. */
|
|
7
|
+
export type DialogPlacement = "center" | "inline-start" | "inline-end";
|
|
3
8
|
export interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement>, "title" | "onClose" | "open"> {
|
|
4
9
|
/** Controlled open state; syncs to showModal()/close(). */
|
|
5
10
|
open: boolean;
|
|
@@ -9,8 +14,12 @@ export interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement
|
|
|
9
14
|
title?: ReactNode;
|
|
10
15
|
/** Action row (Buttons — one accent per group, danger for destructive). */
|
|
11
16
|
footer?: ReactNode;
|
|
12
|
-
/** Panel width in px (400 | 560 | 720).
|
|
17
|
+
/** Panel width in px (400 | 560 | 720). For an `inline-*` placement this is
|
|
18
|
+
* the drawer's width; the height is always the full viewport. @default 560 */
|
|
13
19
|
width?: Width;
|
|
20
|
+
/** Where the panel sits. `inline-start` / `inline-end` pin it full-height to
|
|
21
|
+
* that edge, making it a drawer (D66). @default "center" */
|
|
22
|
+
placement?: DialogPlacement;
|
|
14
23
|
/** false = no close button, Esc and backdrop swallowed — footer is the only exit. @default true */
|
|
15
24
|
dismissible?: boolean;
|
|
16
25
|
/** Forwarded ref to the underlying <dialog> element. */
|
|
@@ -18,7 +27,13 @@ export interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialogElement
|
|
|
18
27
|
}
|
|
19
28
|
/** Modal dialog on the native <dialog> top layer: focus trap, aria-modal and
|
|
20
29
|
* focus restore come from the platform; title/footer slots, Esc/backdrop/
|
|
21
|
-
* close-button dismissal via onClose(reason) (D50).
|
|
22
|
-
|
|
30
|
+
* close-button dismissal via onClose(reason) (D50).
|
|
31
|
+
*
|
|
32
|
+
* `placement` moves the panel and nothing else (D66): an `inline-start` /
|
|
33
|
+
* `inline-end` Dialog is a drawer, pinned full-height to that edge, with the
|
|
34
|
+
* same modality, focus trap, focus restore and dismissal reasons as a centered
|
|
35
|
+
* one. There is deliberately no separate Drawer component — a sibling would
|
|
36
|
+
* have to duplicate or wrap all of that. */
|
|
37
|
+
export declare function Dialog({ open, onClose, title, footer, width, placement, dismissible, className, children, ref, ...rest }: DialogProps): import("react").JSX.Element;
|
|
23
38
|
export {};
|
|
24
39
|
//# sourceMappingURL=Dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAc,SAAS,EAAE,GAAG,EAAkB,MAAM,OAAO,CAAC;AAK9F,KAAK,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE7B,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IACnF,2DAA2D;IAC3D,IAAI,EAAE,OAAO,CAAC;IACd,oFAAoF;IACpF,OAAO,EAAE,CAAC,MAAM,EAAE,KAAK,GAAG,UAAU,GAAG,cAAc,KAA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