@molecule/app-integration-card-react 1.0.0 → 1.0.2

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.
Files changed (2) hide show
  1. package/README.md +155 -0
  2. package/package.json +16 -9
package/README.md ADDED
@@ -0,0 +1,155 @@
1
+ <!--
2
+ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
+ Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
+ Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
+ To change this document, edit the module-level JSDoc in src/index.ts.
6
+ Generated: 2026-08-04T01:51:08.029Z
7
+ -->
8
+
9
+ # @molecule/app-integration-card-react
10
+
11
+ > **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
12
+ > It is written to be read by coding agents as much as by people, and is generated from this
13
+ > package's source — edit `src/index.ts` JSDoc, not this file.
14
+
15
+ React integration / connection card.
16
+
17
+ Exports:
18
+
19
+ - `<IntegrationCard>` — icon + title + description + status label + action button.
20
+ Props: `icon?`, `title`, `description?`, `status?` (default `'disconnected'`),
21
+ `action?` (`{ label, onClick?, href?, loading?, disabled? }`), `variant?`
22
+ (`'card'` default | `'cta'` gradient promo), `className?`, `dataMolId?`.
23
+ - `IntegrationStatus` type (`'connected' | 'disconnected' | 'pending' | 'error'`).
24
+
25
+ Use for OAuth/API integrations, bank-connect CTAs, webhook setup cards.
26
+
27
+ ## Quick Start
28
+
29
+ ```tsx
30
+ import { IntegrationCard } from '@molecule/app-integration-card-react'
31
+
32
+ ;<IntegrationCard
33
+ title="Slack"
34
+ description="Send notifications to your team channels."
35
+ status="disconnected"
36
+ action={{
37
+ label: 'Connect',
38
+ onClick: () => {
39
+ window.location.href = '/oauth/slack'
40
+ },
41
+ }}
42
+ dataMolId="slack-integration-card"
43
+ />
44
+ ```
45
+
46
+ ## Type
47
+
48
+ `feature`
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ npm install @molecule/app-integration-card-react @molecule/app-react @molecule/app-ui @molecule/app-ui-react react
54
+ npm install -D @types/react
55
+ ```
56
+
57
+ ## API
58
+
59
+ ### Interfaces
60
+
61
+ #### `IntegrationCardProps`
62
+
63
+ Props for {@link IntegrationCard}.
64
+
65
+ ```typescript
66
+ interface IntegrationCardProps {
67
+ /** Leading icon / logo for the integration. */
68
+ icon?: ReactNode
69
+ /** Integration title. */
70
+ title: ReactNode
71
+ /** Supporting description. */
72
+ description?: ReactNode
73
+ /** Current connection status. */
74
+ status?: IntegrationStatus
75
+ /** Action button configuration. */
76
+ action?: {
77
+ label: ReactNode
78
+ onClick?: () => void
79
+ href?: string
80
+ loading?: boolean
81
+ disabled?: boolean
82
+ }
83
+ /** `'card'` default, `'cta'` for premium gradient-tinted promos. */
84
+ variant?: 'card' | 'cta'
85
+ /** Extra classes. */
86
+ className?: string
87
+ /** `data-mol-id` for AI-agent selectors. */
88
+ dataMolId?: string
89
+ }
90
+ ```
91
+
92
+ ### Types
93
+
94
+ #### `IntegrationStatus`
95
+
96
+ Connection status for an integration.
97
+
98
+ ```typescript
99
+ type IntegrationStatus = 'connected' | 'disconnected' | 'pending' | 'error'
100
+ ```
101
+
102
+ ### Functions
103
+
104
+ #### `IntegrationCard(props)`
105
+
106
+ Card for an integration / external connection (Slack, Stripe, Google
107
+ Drive, bank-link CTAs, etc.). Shows icon + title + description +
108
+ status + action.
109
+
110
+ ```typescript
111
+ function IntegrationCard({
112
+ icon,
113
+ title,
114
+ description,
115
+ status = 'disconnected',
116
+ action,
117
+ variant = 'card',
118
+ className,
119
+ dataMolId,
120
+ }: IntegrationCardProps): JSX.Element
121
+ ```
122
+
123
+ - `props` — Component props (see {@link IntegrationCardProps}).
124
+
125
+ ## Injection Notes
126
+
127
+ ### Requirements
128
+
129
+ Peer dependencies:
130
+
131
+ - `@molecule/app-react` ^1.0.1
132
+ - `@molecule/app-ui` ^1.0.1
133
+ - `@molecule/app-ui-react` ^1.0.1
134
+ - `react` ^18.0.0 || ^19.0.0
135
+
136
+ ### Runtime Dependencies
137
+
138
+ - `@molecule/app-react`
139
+ - `@molecule/app-ui`
140
+ - `@molecule/app-ui-react`
141
+ - `react`
142
+
143
+ - The status label text ('Connected', 'Connecting…', 'Error', 'Not connected') is
144
+ hardcoded English — there is no i18n hook and no override prop. In a non-English
145
+ app, render your own translated status next to the card (or hide it via CSS)
146
+ until the package routes these through `t()`.
147
+ - `variant="cta"` paints an inline `linear-gradient` background over the Card using
148
+ `var(--color-primary)` (falls back to a fixed blue when the theme token is
149
+ missing). Inline styles beat ClassMap classes, so this overrides the themed card
150
+ surface; check text contrast against your primary color before using it.
151
+ - `action.href` renders an anchor wrapping the Button and ignores `action.loading`;
152
+ prefer `action.onClick` for anything that needs a loading state. While
153
+ `action.loading` is true the button label is replaced by an ellipsis glyph.
154
+ - Styling resolves through `getClassMap()` — wire a ClassMap bond (e.g.
155
+ `@molecule/app-ui-tailwind`) before rendering.
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@molecule/app-integration-card-react",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Integration / connection card with icon, status, connect/disconnect action",
5
+ "homepage": "https://www.molecule.dev/packages/app-integration-card-react",
5
6
  "type": "module",
6
7
  "main": "dist/index.js",
7
8
  "types": "dist/index.d.ts",
@@ -17,7 +18,8 @@
17
18
  }
18
19
  },
19
20
  "files": [
20
- "dist"
21
+ "dist",
22
+ "README.md"
21
23
  ],
22
24
  "keywords": [
23
25
  "molecule",
@@ -25,22 +27,27 @@
25
27
  "react"
26
28
  ],
27
29
  "license": "Apache-2.0",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/molecule-dev/molecule.git",
33
+ "directory": "packages/app/features/integration-card-react"
34
+ },
28
35
  "peerDependencies": {
29
- "@molecule/app-react": "^1.0.0",
30
- "@molecule/app-ui": "^1.0.0",
31
- "@molecule/app-ui-react": "^1.0.0",
36
+ "@molecule/app-react": "^1.0.1",
37
+ "@molecule/app-ui": "^1.0.1",
38
+ "@molecule/app-ui-react": "^1.0.1",
32
39
  "react": "^18.0.0 || ^19.0.0"
33
40
  },
34
41
  "devDependencies": {
35
- "@molecule/app-react": "1.0.0",
36
- "@molecule/app-ui": "1.0.0",
37
- "@molecule/app-ui-react": "1.0.0",
42
+ "@molecule/app-react": "1.5.1",
43
+ "@molecule/app-ui": "1.1.1",
44
+ "@molecule/app-ui-react": "1.0.2",
38
45
  "@types/node": "26.1.2",
39
46
  "@types/react": "19.2.17",
40
47
  "@types/react-dom": "19.2.3",
41
48
  "react": "19.2.8",
42
49
  "react-dom": "19.2.8",
43
50
  "typescript": "6.0.3",
44
- "vitest": "4.1.10"
51
+ "vitest": "4.1.11"
45
52
  }
46
53
  }