@irozon/design-system-react 0.2.4 → 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,8 @@ 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` |
73
+ | `SignatureCTA` | `.iz-signature-cta` |
72
74
  | `Loader` | `.iz-loader` |
73
75
  | `Input`, `Textarea` | `.iz-input`, `.iz-textarea` |
74
76
  | `Select` | `.iz-select-wrap` / `.iz-select` |
@@ -80,6 +82,56 @@ both packages because your app imports the CSS package directly.
80
82
  | `Nav`, `NavGroup`, `NavItem` | `.iz-nav`, `.iz-nav-group`, `.iz-nav-item` |
81
83
  | `Tabs`, `TabPanel` | `.iz-tabs`, `.iz-tab`, `.iz-tab-panel` |
82
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
+
109
+ ### Signature CTA
110
+
111
+ `SignatureCTA` renders the canonical `.iz-signature-cta` structure and uses
112
+ the same framework-neutral CSS as standalone HTML. It renders an anchor by
113
+ default; choose a button for an action, or pass a router link component through
114
+ `as` to retain client-side navigation:
115
+
116
+ ```tsx
117
+ import { Link } from "react-router-dom";
118
+ import { SignatureCTA } from "@irozon/design-system-react";
119
+
120
+ <SignatureCTA href="/contact">Get in touch</SignatureCTA>
121
+
122
+ <SignatureCTA as="button" type="submit" onClick={submitForm}>
123
+ Send message
124
+ </SignatureCTA>
125
+
126
+ <SignatureCTA as={Link} to="/contact">
127
+ Get in touch
128
+ </SignatureCTA>
129
+ ```
130
+
131
+ Props for the rendered element are inferred from `as`, including its
132
+ accessibility, event, and navigation props. The CTA owns its decorative
133
+ three-dot motif in CSS; consumers provide the semantic label only.
134
+
83
135
  `Tabs`/`TabPanel` implement the full WAI-ARIA Tabs pattern (automatic
84
136
  activation): a roving tabindex so only the selected tab sits in the page's Tab
85
137
  order, ArrowLeft/ArrowRight to move between tabs, Home/End to jump to the
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
+ }
@@ -0,0 +1,18 @@
1
+ import type { ComponentPropsWithoutRef, ElementType, ReactNode } from "react";
2
+ interface SignatureCTAOwnProps {
3
+ children: ReactNode;
4
+ className?: string;
5
+ }
6
+ /**
7
+ * Props for the canonical Signature CTA. Native element props are inferred
8
+ * from `as`, so router links can receive their own navigation props.
9
+ */
10
+ export type SignatureCTAProps<T extends ElementType = "a"> = SignatureCTAOwnProps & {
11
+ as?: T;
12
+ } & Omit<ComponentPropsWithoutRef<T>, keyof SignatureCTAOwnProps | "as">;
13
+ /**
14
+ * Canonical `.iz-signature-cta` markup. Import `@irozon/design-system/irozon.css`
15
+ * once in the app to get its shared Ink-to-Lime animation and decorative mark.
16
+ */
17
+ export declare function SignatureCTA<T extends ElementType = "a">({ as, children, className, ...rest }: SignatureCTAProps<T>): import("react").JSX.Element;
18
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cx } from "./internal/cx.js";
3
+ /**
4
+ * Canonical `.iz-signature-cta` markup. Import `@irozon/design-system/irozon.css`
5
+ * once in the app to get its shared Ink-to-Lime animation and decorative mark.
6
+ */
7
+ export function SignatureCTA({ as, children, className, ...rest }) {
8
+ const Component = as ?? "a";
9
+ return (_jsxs(Component, { className: cx("iz-signature-cta", className), ...rest, children: [_jsx("span", { className: "iz-signature-cta__sizer", "aria-hidden": "true", children: children }), _jsx("span", { className: "iz-signature-cta__base", children: _jsx("span", { className: "iz-signature-cta__label", children: children }) }), _jsx("span", { className: "iz-signature-cta__panel", "aria-hidden": "true" })] }));
10
+ }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,9 @@
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";
5
+ export { SignatureCTA } from "./SignatureCTA.js";
6
+ export type { SignatureCTAProps } from "./SignatureCTA.js";
3
7
  export { Loader } from "./Loader.js";
4
8
  export type { LoaderProps } from "./Loader.js";
5
9
  export { Input, Textarea } from "./Input.js";
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  export { Button } from "./Button.js";
2
+ export { Card } from "./Card.js";
3
+ export { SignatureCTA } from "./SignatureCTA.js";
2
4
  export { Loader } from "./Loader.js";
3
5
  export { Input, Textarea } from "./Input.js";
4
6
  export { Select } from "./Select.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@irozon/design-system-react",
3
- "version": "0.2.4",
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": [
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "scripts": {
36
36
  "build": "tsc",
37
- "typecheck": "tsc --noEmit",
37
+ "typecheck": "tsc --noEmit && tsc --project test/tsconfig.json",
38
38
  "test": "npm run build && node --experimental-strip-types --test test/smoke.test.ts"
39
39
  },
40
40
  "peerDependencies": {
@@ -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",