@irozon/design-system-react 0.4.0 → 0.5.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/README.md +5 -0
- package/dist/Dialog.d.ts +3 -1
- package/dist/Dialog.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -82,6 +82,11 @@ both packages because your app imports the CSS package directly.
|
|
|
82
82
|
| `Nav`, `NavGroup`, `NavItem` | `.iz-nav`, `.iz-nav-group`, `.iz-nav-item` |
|
|
83
83
|
| `Tabs`, `TabPanel` | `.iz-tabs`, `.iz-tab`, `.iz-tab-panel` |
|
|
84
84
|
|
|
85
|
+
For side Sheets, pass `variant="sheet"`. The default size keeps the narrow
|
|
86
|
+
panel; `size="large"` uses about 80% of the desktop viewport. Both sizes use
|
|
87
|
+
the available screen width on small viewports. The native `<dialog>` retains
|
|
88
|
+
focus management, Escape handling, and backdrop behavior.
|
|
89
|
+
|
|
85
90
|
### Card
|
|
86
91
|
|
|
87
92
|
`Card` defaults to a static `<div>`. Set `interactive` to opt into the
|
package/dist/Dialog.d.ts
CHANGED
|
@@ -7,12 +7,14 @@ export interface DialogProps extends Omit<HTMLAttributes<HTMLDialogElement>, "on
|
|
|
7
7
|
* semantics rather than re-deriving it per consumer. */
|
|
8
8
|
onClose: () => void;
|
|
9
9
|
variant?: "sheet";
|
|
10
|
+
/** Sheet width preset. Ignored for the centered Dialog variant. */
|
|
11
|
+
size?: "default" | "large";
|
|
10
12
|
children: ReactNode;
|
|
11
13
|
}
|
|
12
14
|
/** Canonical `.iz-dialog` — built on the native `<dialog>` element, so
|
|
13
15
|
* focus trapping, Escape-to-dismiss, and the `::backdrop` come from the
|
|
14
16
|
* browser for free. Compose with DialogHeader/DialogBody/DialogFooter. */
|
|
15
|
-
export declare function Dialog({ open, onClose, variant, className, children, ...rest }: DialogProps): import("react").JSX.Element;
|
|
17
|
+
export declare function Dialog({ open, onClose, variant, size, className, children, ...rest }: DialogProps): import("react").JSX.Element;
|
|
16
18
|
export declare function DialogHeader({ children }: {
|
|
17
19
|
children: ReactNode;
|
|
18
20
|
}): import("react").JSX.Element;
|
package/dist/Dialog.js
CHANGED
|
@@ -4,7 +4,7 @@ import { cx } from "./internal/cx.js";
|
|
|
4
4
|
/** Canonical `.iz-dialog` — built on the native `<dialog>` element, so
|
|
5
5
|
* focus trapping, Escape-to-dismiss, and the `::backdrop` come from the
|
|
6
6
|
* browser for free. Compose with DialogHeader/DialogBody/DialogFooter. */
|
|
7
|
-
export function Dialog({ open, onClose, variant, className, children, ...rest }) {
|
|
7
|
+
export function Dialog({ open, onClose, variant, size, className, children, ...rest }) {
|
|
8
8
|
const ref = useRef(null);
|
|
9
9
|
useEffect(() => {
|
|
10
10
|
const dialog = ref.current;
|
|
@@ -42,7 +42,7 @@ export function Dialog({ open, onClose, variant, className, children, ...rest })
|
|
|
42
42
|
dialog.addEventListener("click", handleClick);
|
|
43
43
|
return () => dialog.removeEventListener("click", handleClick);
|
|
44
44
|
}, [onClose]);
|
|
45
|
-
return (_jsx("dialog", { ref: ref, className: cx("iz-dialog", className), "data-variant": variant, ...rest, children: children }));
|
|
45
|
+
return (_jsx("dialog", { ref: ref, className: cx("iz-dialog", className), "data-variant": variant, "data-size": variant === "sheet" && size === "large" ? "large" : undefined, ...rest, children: children }));
|
|
46
46
|
}
|
|
47
47
|
export function DialogHeader({ children }) {
|
|
48
48
|
return _jsx("header", { className: "iz-dialog__header", children: children });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@irozon/design-system-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Canonical React components for the Irozon Design System — thin, accessible wrappers over @irozon/design-system's framework-neutral iz-* CSS. No independent visual styling of its own; the CSS package stays the single source of truth for how these look.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"react-dom": ">=18.0.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@irozon/design-system": "^0.8.
|
|
45
|
+
"@irozon/design-system": "^0.8.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/react": "^19.2.0",
|