@irozon/design-system-react 0.3.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 +30 -0
- package/dist/Card.d.ts +17 -0
- package/dist/Card.js +8 -0
- package/dist/Dialog.d.ts +3 -1
- package/dist/Dialog.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -69,6 +69,7 @@ both packages because your app imports the CSS package directly.
|
|
|
69
69
|
| Component | Wraps |
|
|
70
70
|
| --- | --- |
|
|
71
71
|
| `Button` | `.iz-button` |
|
|
72
|
+
| `Card` | `.iz-card` |
|
|
72
73
|
| `SignatureCTA` | `.iz-signature-cta` |
|
|
73
74
|
| `Loader` | `.iz-loader` |
|
|
74
75
|
| `Input`, `Textarea` | `.iz-input`, `.iz-textarea` |
|
|
@@ -81,6 +82,35 @@ both packages because your app imports the CSS package directly.
|
|
|
81
82
|
| `Nav`, `NavGroup`, `NavItem` | `.iz-nav`, `.iz-nav-group`, `.iz-nav-item` |
|
|
82
83
|
| `Tabs`, `TabPanel` | `.iz-tabs`, `.iz-tab`, `.iz-tab-panel` |
|
|
83
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
|
+
|
|
90
|
+
### Card
|
|
91
|
+
|
|
92
|
+
`Card` defaults to a static `<div>`. Set `interactive` to opt into the
|
|
93
|
+
canonical hover/focus treatment, and choose an anchor, button, or router link
|
|
94
|
+
with `as` so navigation and actions keep native semantics:
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import { Card } from "@irozon/design-system-react";
|
|
98
|
+
|
|
99
|
+
<Card>Grouped details</Card>
|
|
100
|
+
|
|
101
|
+
<Card as="a" href="/services/example" interactive>
|
|
102
|
+
Service details
|
|
103
|
+
</Card>
|
|
104
|
+
|
|
105
|
+
<Card as="button" type="button" interactive>
|
|
106
|
+
Choose this option
|
|
107
|
+
</Card>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The component only maps props to `.iz-card` and `data-*` attributes. Padding,
|
|
111
|
+
variants, colors, focus, hover, theme, and reduced-motion behavior stay in
|
|
112
|
+
`@irozon/design-system` CSS.
|
|
113
|
+
|
|
84
114
|
### Signature CTA
|
|
85
115
|
|
|
86
116
|
`SignatureCTA` renders the canonical `.iz-signature-cta` structure and uses
|
package/dist/Card.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ElementType, ReactNode } from "react";
|
|
2
|
+
export type CardVariant = "subtle" | "outlined" | "elevated";
|
|
3
|
+
interface CardOwnProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
interactive?: boolean;
|
|
7
|
+
variant?: CardVariant;
|
|
8
|
+
}
|
|
9
|
+
/** Native props follow `as`; the card remains a div unless a semantic
|
|
10
|
+
* element or router component is explicitly selected. */
|
|
11
|
+
export type CardProps<T extends ElementType = "div"> = CardOwnProps & {
|
|
12
|
+
as?: T;
|
|
13
|
+
} & Omit<ComponentPropsWithoutRef<T>, keyof CardOwnProps | "as" | "data-interactive" | "data-variant">;
|
|
14
|
+
/** Thin React wrapper around the canonical `.iz-card` CSS. Interactive
|
|
15
|
+
* links/buttons retain native keyboard behavior; this component adds none. */
|
|
16
|
+
export declare function Card<T extends ElementType = "div">({ as, children, className, interactive, variant, ...rest }: CardProps<T>): import("react").JSX.Element;
|
|
17
|
+
export {};
|
package/dist/Card.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cx } from "./internal/cx.js";
|
|
3
|
+
/** Thin React wrapper around the canonical `.iz-card` CSS. Interactive
|
|
4
|
+
* links/buttons retain native keyboard behavior; this component adds none. */
|
|
5
|
+
export function Card({ as, children, className, interactive, variant, ...rest }) {
|
|
6
|
+
const Component = as ?? "div";
|
|
7
|
+
return (_jsx(Component, { ...rest, className: cx("iz-card", className), "data-variant": variant, "data-interactive": interactive || undefined, children: children }));
|
|
8
|
+
}
|
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/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { Button } from "./Button.js";
|
|
2
2
|
export type { ButtonProps, ButtonVariant, ButtonSize } from "./Button.js";
|
|
3
|
+
export { Card } from "./Card.js";
|
|
4
|
+
export type { CardProps, CardVariant } from "./Card.js";
|
|
3
5
|
export { SignatureCTA } from "./SignatureCTA.js";
|
|
4
6
|
export type { SignatureCTAProps } from "./SignatureCTA.js";
|
|
5
7
|
export { Loader } from "./Loader.js";
|
package/dist/index.js
CHANGED
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.
|
|
45
|
+
"@irozon/design-system": "^0.8.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/react": "^19.2.0",
|