@aganzefelicite/responsekit-react 0.1.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 +87 -0
- package/dist/ChartRenderer-UJNU2VNH.cjs +153 -0
- package/dist/ChartRenderer-UJNU2VNH.cjs.map +1 -0
- package/dist/ChartRenderer-URPZESVN.js +151 -0
- package/dist/ChartRenderer-URPZESVN.js.map +1 -0
- package/dist/chunk-3FSZRQQU.js +33 -0
- package/dist/chunk-3FSZRQQU.js.map +1 -0
- package/dist/chunk-D4WIPDH3.cjs +38 -0
- package/dist/chunk-D4WIPDH3.cjs.map +1 -0
- package/dist/index.cjs +5053 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +313 -0
- package/dist/index.d.ts +313 -0
- package/dist/index.js +4980 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +108 -0
- package/package.json +53 -0
package/dist/styles.css
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional default styles for @responsekit/react. Import once in your app:
|
|
3
|
+
* import "@responsekit/react/styles.css";
|
|
4
|
+
* All selectors are namespaced under `.rk-*` and use CSS variables you can override.
|
|
5
|
+
*/
|
|
6
|
+
.rk-response {
|
|
7
|
+
--rk-fg: #1a1a1a;
|
|
8
|
+
--rk-muted: #6b7280;
|
|
9
|
+
--rk-border: #e5e7eb;
|
|
10
|
+
--rk-bg: #ffffff;
|
|
11
|
+
--rk-accent: #2563eb;
|
|
12
|
+
--rk-radius: 10px;
|
|
13
|
+
--rk-info: #2563eb;
|
|
14
|
+
--rk-success: #16a34a;
|
|
15
|
+
--rk-warning: #d97706;
|
|
16
|
+
--rk-critical: #dc2626;
|
|
17
|
+
color: var(--rk-fg);
|
|
18
|
+
font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
|
|
19
|
+
line-height: 1.5;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: 16px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.rk-response-title { font-size: 1.25rem; font-weight: 650; margin: 0; }
|
|
26
|
+
.rk-blocks { display: flex; flex-direction: column; gap: 16px; }
|
|
27
|
+
.rk-block-title { font-size: 1rem; font-weight: 600; margin: 0 0 8px; }
|
|
28
|
+
|
|
29
|
+
.rk-block {
|
|
30
|
+
border: 1px solid var(--rk-border);
|
|
31
|
+
border-radius: var(--rk-radius);
|
|
32
|
+
padding: 16px;
|
|
33
|
+
background: var(--rk-bg);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* KPI */
|
|
37
|
+
.rk-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
|
|
38
|
+
.rk-kpi-item { border: 1px solid var(--rk-border); border-radius: 8px; padding: 12px; }
|
|
39
|
+
.rk-kpi-label { color: var(--rk-muted); font-size: 0.8rem; }
|
|
40
|
+
.rk-kpi-value { font-size: 1.5rem; font-weight: 700; }
|
|
41
|
+
.rk-kpi-trend { font-size: 0.8rem; display: flex; gap: 4px; align-items: center; }
|
|
42
|
+
.rk-kpi-trend-up { color: var(--rk-success); }
|
|
43
|
+
.rk-kpi-trend-down { color: var(--rk-critical); }
|
|
44
|
+
.rk-kpi-trend-stable { color: var(--rk-muted); }
|
|
45
|
+
|
|
46
|
+
/* Table */
|
|
47
|
+
.rk-block-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
|
|
48
|
+
.rk-table-scroll { overflow-x: auto; }
|
|
49
|
+
.rk-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
|
|
50
|
+
.rk-table th, .rk-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rk-border); }
|
|
51
|
+
.rk-table th { color: var(--rk-muted); font-weight: 600; }
|
|
52
|
+
|
|
53
|
+
/* Insight */
|
|
54
|
+
.rk-block-insight { display: flex; gap: 12px; border-left-width: 4px; }
|
|
55
|
+
.rk-severity-info { border-left-color: var(--rk-info); }
|
|
56
|
+
.rk-severity-success { border-left-color: var(--rk-success); }
|
|
57
|
+
.rk-severity-warning { border-left-color: var(--rk-warning); }
|
|
58
|
+
.rk-severity-critical { border-left-color: var(--rk-critical); }
|
|
59
|
+
.rk-insight-icon { font-weight: 700; }
|
|
60
|
+
.rk-insight-title { font-weight: 600; }
|
|
61
|
+
.rk-insight-desc { color: var(--rk-muted); }
|
|
62
|
+
|
|
63
|
+
/* Recommendation */
|
|
64
|
+
.rk-recommendation-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
|
|
65
|
+
.rk-recommendation-title { font-weight: 600; }
|
|
66
|
+
.rk-recommendation-desc { color: var(--rk-muted); }
|
|
67
|
+
|
|
68
|
+
/* Filter */
|
|
69
|
+
.rk-filter-row { display: flex; flex-wrap: wrap; gap: 12px; }
|
|
70
|
+
.rk-filter { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
|
|
71
|
+
.rk-filter-label { color: var(--rk-muted); }
|
|
72
|
+
.rk-filter-range { display: flex; gap: 6px; }
|
|
73
|
+
|
|
74
|
+
/* Chart */
|
|
75
|
+
.rk-chart { width: 100%; }
|
|
76
|
+
.rk-chart-placeholder, .rk-chart-fallback { border: 1px dashed var(--rk-border); border-radius: 8px; padding: 12px; }
|
|
77
|
+
.rk-chart-badge { font-size: 0.8rem; color: var(--rk-muted); margin-bottom: 8px; }
|
|
78
|
+
.rk-chart-note { opacity: 0.7; }
|
|
79
|
+
.rk-chart-more { color: var(--rk-muted); font-size: 0.8rem; margin: 6px 0 0; }
|
|
80
|
+
|
|
81
|
+
/* Fallback / error */
|
|
82
|
+
.rk-block-fallback { border-style: dashed; color: var(--rk-muted); }
|
|
83
|
+
.rk-fallback-raw pre { overflow: auto; font-size: 0.8rem; }
|
|
84
|
+
.rk-error { display: flex; gap: 8px; align-items: center; color: var(--rk-critical); border-color: var(--rk-critical); }
|
|
85
|
+
|
|
86
|
+
/* Actions */
|
|
87
|
+
.rk-action {
|
|
88
|
+
border: 1px solid var(--rk-border);
|
|
89
|
+
background: var(--rk-bg);
|
|
90
|
+
border-radius: 6px;
|
|
91
|
+
padding: 4px 10px;
|
|
92
|
+
font-size: 0.8rem;
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
}
|
|
95
|
+
.rk-action:hover { border-color: var(--rk-accent); color: var(--rk-accent); }
|
|
96
|
+
|
|
97
|
+
/* Meta footer */
|
|
98
|
+
.rk-meta { display: flex; gap: 12px; align-items: center; color: var(--rk-muted); font-size: 0.8rem; }
|
|
99
|
+
|
|
100
|
+
/* Loading */
|
|
101
|
+
.rk-loading { display: flex; gap: 8px; align-items: center; color: var(--rk-muted); padding: 8px 0; }
|
|
102
|
+
.rk-spinner {
|
|
103
|
+
width: 14px; height: 14px; border-radius: 50%;
|
|
104
|
+
border: 2px solid var(--rk-border); border-top-color: var(--rk-accent);
|
|
105
|
+
animation: rk-spin 0.8s linear infinite;
|
|
106
|
+
}
|
|
107
|
+
@keyframes rk-spin { to { transform: rotate(360deg); } }
|
|
108
|
+
.rk-empty { color: var(--rk-muted); font-size: 0.85rem; }
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aganzefelicite/responsekit-react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Render your AI backend's responses as interactive React UI: AiRenderer, AiStream, useChat.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "aganzefelicite",
|
|
7
|
+
"keywords": ["react", "ai", "sse", "streaming", "renderer", "analytics", "charts"],
|
|
8
|
+
"type": "module",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"files": ["dist"],
|
|
14
|
+
"main": "./dist/index.cjs",
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"require": "./dist/index.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./styles.css": "./dist/styles.css"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup",
|
|
27
|
+
"dev": "tsup --watch",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"test": "vitest run"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"react-markdown": "^9.0.1",
|
|
33
|
+
"recharts": "^2.12.7",
|
|
34
|
+
"remark-gfm": "^4.0.0"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": ">=18",
|
|
38
|
+
"react-dom": ">=18"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@responsekit/schema": "workspace:*",
|
|
42
|
+
"@testing-library/react": "^16.0.1",
|
|
43
|
+
"@testing-library/jest-dom": "^6.5.0",
|
|
44
|
+
"@types/react": "^18.3.5",
|
|
45
|
+
"@types/react-dom": "^18.3.0",
|
|
46
|
+
"jsdom": "^25.0.0",
|
|
47
|
+
"react": "^18.3.1",
|
|
48
|
+
"react-dom": "^18.3.1",
|
|
49
|
+
"tsup": "^8.2.4",
|
|
50
|
+
"typescript": "^5.5.4",
|
|
51
|
+
"vitest": "^2.0.5"
|
|
52
|
+
}
|
|
53
|
+
}
|