@irozon/design-system-react 0.3.0 → 0.4.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 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,30 @@ 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
+ ### Card
86
+
87
+ `Card` defaults to a static `<div>`. Set `interactive` to opt into the
88
+ canonical hover/focus treatment, and choose an anchor, button, or router link
89
+ with `as` so navigation and actions keep native semantics:
90
+
91
+ ```tsx
92
+ import { Card } from "@irozon/design-system-react";
93
+
94
+ <Card>Grouped details</Card>
95
+
96
+ <Card as="a" href="/services/example" interactive>
97
+ Service details
98
+ </Card>
99
+
100
+ <Card as="button" type="button" interactive>
101
+ Choose this option
102
+ </Card>
103
+ ```
104
+
105
+ The component only maps props to `.iz-card` and `data-*` attributes. Padding,
106
+ variants, colors, focus, hover, theme, and reduced-motion behavior stay in
107
+ `@irozon/design-system` CSS.
108
+
84
109
  ### Signature CTA
85
110
 
86
111
  `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/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
@@ -1,4 +1,5 @@
1
1
  export { Button } from "./Button.js";
2
+ export { Card } from "./Card.js";
2
3
  export { SignatureCTA } from "./SignatureCTA.js";
3
4
  export { Loader } from "./Loader.js";
4
5
  export { Input, Textarea } from "./Input.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@irozon/design-system-react",
3
- "version": "0.3.0",
3
+ "version": "0.4.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.7.0"
45
+ "@irozon/design-system": "^0.8.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/react": "^19.2.0",