@gram-ai/elements 1.25.2 → 1.26.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/dist/components/Chat/stories/Charts.stories.d.ts +37 -0
- package/dist/components/Chat/stories/GenerativeUI.stories.d.ts +17 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/buttonVariants.d.ts +1 -1
- package/dist/components/ui/charts.stories.d.ts +43 -0
- package/dist/components/ui/generative-ui.stories.d.ts +53 -0
- package/dist/elements.cjs +1 -1
- package/dist/elements.css +1 -1
- package/dist/elements.js +6 -6
- package/dist/index-BJnv49-A.js +37057 -0
- package/dist/index-BJnv49-A.js.map +1 -0
- package/dist/index-BpJstUh1.cjs +280 -0
- package/dist/index-BpJstUh1.cjs.map +1 -0
- package/dist/index-CUitXazZ.js +30426 -0
- package/dist/index-CUitXazZ.js.map +1 -0
- package/dist/index-ChW-CSuu.cjs +147 -0
- package/dist/index-ChW-CSuu.cjs.map +1 -0
- package/dist/plugins/chart/catalog.d.ts +123 -0
- package/dist/plugins/chart/index.d.ts +1 -1
- package/dist/plugins/chart/ui/area-chart.d.ts +16 -0
- package/dist/plugins/chart/ui/bar-chart.d.ts +16 -0
- package/dist/plugins/chart/ui/donut-chart.d.ts +17 -0
- package/dist/plugins/chart/ui/index.d.ts +7 -0
- package/dist/plugins/chart/ui/line-chart.d.ts +17 -0
- package/dist/plugins/chart/ui/pie-chart.d.ts +15 -0
- package/dist/plugins/chart/ui/radar-chart.d.ts +14 -0
- package/dist/plugins/chart/ui/scatter-chart.d.ts +18 -0
- package/dist/plugins/components/MacOSWindowFrame.d.ts +13 -0
- package/dist/plugins/components/PluginLoadingState.d.ts +1 -1
- package/dist/plugins/generative-ui/catalog.d.ts +293 -0
- package/dist/plugins/generative-ui/ui/accordion-wrapper.d.ts +18 -0
- package/dist/plugins/generative-ui/ui/accordion.d.ts +7 -0
- package/dist/plugins/generative-ui/ui/action-button.d.ts +10 -0
- package/dist/plugins/generative-ui/ui/alert-wrapper.d.ts +9 -0
- package/dist/plugins/generative-ui/ui/alert.d.ts +9 -0
- package/dist/plugins/generative-ui/ui/avatar-wrapper.d.ts +9 -0
- package/dist/plugins/generative-ui/ui/avatar.d.ts +11 -0
- package/dist/plugins/generative-ui/ui/badge.d.ts +12 -0
- package/dist/plugins/generative-ui/ui/button-wrapper.d.ts +15 -0
- package/dist/plugins/generative-ui/ui/button.d.ts +10 -0
- package/dist/plugins/generative-ui/ui/card-wrapper.d.ts +10 -0
- package/dist/plugins/generative-ui/ui/card.d.ts +9 -0
- package/dist/plugins/generative-ui/ui/checkbox-wrapper.d.ts +10 -0
- package/dist/plugins/generative-ui/ui/checkbox.d.ts +4 -0
- package/dist/plugins/generative-ui/ui/data-table.d.ts +10 -0
- package/dist/plugins/generative-ui/ui/dialog.d.ts +17 -0
- package/dist/plugins/generative-ui/ui/dropdown-menu.d.ts +25 -0
- package/dist/plugins/generative-ui/ui/grid.d.ts +6 -0
- package/dist/plugins/generative-ui/ui/index.d.ts +40 -0
- package/dist/plugins/generative-ui/ui/input-wrapper.d.ts +11 -0
- package/dist/plugins/generative-ui/ui/input.d.ts +3 -0
- package/dist/plugins/generative-ui/ui/label.d.ts +4 -0
- package/dist/plugins/generative-ui/ui/list.d.ts +6 -0
- package/dist/plugins/generative-ui/ui/metric.d.ts +7 -0
- package/dist/plugins/generative-ui/ui/pagination.d.ts +13 -0
- package/dist/plugins/generative-ui/ui/popover.d.ts +10 -0
- package/dist/plugins/generative-ui/ui/progress.d.ts +10 -0
- package/dist/plugins/generative-ui/ui/radio-group.d.ts +5 -0
- package/dist/plugins/generative-ui/ui/select-wrapper.d.ts +13 -0
- package/dist/plugins/generative-ui/ui/select.d.ts +15 -0
- package/dist/plugins/generative-ui/ui/separator.d.ts +4 -0
- package/dist/plugins/generative-ui/ui/skeleton-wrapper.d.ts +9 -0
- package/dist/plugins/generative-ui/ui/skeleton.d.ts +2 -0
- package/dist/plugins/generative-ui/ui/stack.d.ts +8 -0
- package/dist/plugins/generative-ui/ui/switch.d.ts +6 -0
- package/dist/plugins/generative-ui/ui/table.d.ts +10 -0
- package/dist/plugins/generative-ui/ui/tabs-wrapper.d.ts +21 -0
- package/dist/plugins/generative-ui/ui/tabs.d.ts +11 -0
- package/dist/plugins/generative-ui/ui/text.d.ts +7 -0
- package/dist/plugins/generative-ui/ui/textarea.d.ts +3 -0
- package/dist/plugins/generative-ui/ui/tooltip.d.ts +7 -0
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.js +1 -1
- package/dist/{profiler-BaG0scxd.js → profiler-D4Tw5ecI.js} +2 -2
- package/dist/{profiler-BaG0scxd.js.map → profiler-D4Tw5ecI.js.map} +1 -1
- package/dist/{profiler-CuqENACf.cjs → profiler-DCWYDZ1F.cjs} +2 -2
- package/dist/{profiler-CuqENACf.cjs.map → profiler-DCWYDZ1F.cjs.map} +1 -1
- package/dist/{startRecording-BiLmoqZa.cjs → startRecording-3sTskM3H.cjs} +2 -2
- package/dist/{startRecording-BiLmoqZa.cjs.map → startRecording-3sTskM3H.cjs.map} +1 -1
- package/dist/{startRecording-86bHmd-l.js → startRecording-BHhcCWQE.js} +2 -2
- package/dist/{startRecording-86bHmd-l.js.map → startRecording-BHhcCWQE.js.map} +1 -1
- package/package.json +4 -1
- package/src/components/Chat/stories/Charts.stories.tsx +260 -0
- package/src/components/Chat/stories/ConnectionConfiguration.stories.tsx +6 -6
- package/src/components/Chat/stories/GenerativeUI.stories.tsx +113 -0
- package/src/components/Replay.stories.tsx +1 -1
- package/src/components/Replay.tsx +18 -13
- package/src/components/ui/charts.stories.tsx +246 -0
- package/src/components/ui/generative-ui.stories.tsx +557 -0
- package/src/components/ui/generative-ui.tsx +60 -360
- package/src/components/ui/tool-ui.stories.tsx +6 -3
- package/src/hooks/useAuth.ts +17 -1
- package/src/hooks/useFollowOnSuggestions.ts +6 -1
- package/src/plugins/chart/catalog.ts +141 -0
- package/src/plugins/chart/component.tsx +79 -125
- package/src/plugins/chart/index.ts +141 -89
- package/src/plugins/chart/ui/area-chart.tsx +133 -0
- package/src/plugins/chart/ui/bar-chart.tsx +137 -0
- package/src/plugins/chart/ui/donut-chart.tsx +167 -0
- package/src/plugins/chart/ui/index.ts +7 -0
- package/src/plugins/chart/ui/line-chart.tsx +135 -0
- package/src/plugins/chart/ui/pie-chart.tsx +148 -0
- package/src/plugins/chart/ui/radar-chart.tsx +105 -0
- package/src/plugins/chart/ui/scatter-chart.tsx +132 -0
- package/src/plugins/components/MacOSWindowFrame.tsx +55 -0
- package/src/plugins/components/PluginLoadingState.tsx +9 -13
- package/src/plugins/generative-ui/catalog.ts +277 -0
- package/src/plugins/generative-ui/component.tsx +112 -21
- package/src/plugins/generative-ui/index.ts +20 -141
- package/src/plugins/generative-ui/ui/accordion-wrapper.tsx +57 -0
- package/src/plugins/generative-ui/ui/accordion.tsx +66 -0
- package/src/plugins/generative-ui/ui/action-button.tsx +68 -0
- package/src/plugins/generative-ui/ui/alert-wrapper.tsx +26 -0
- package/src/plugins/generative-ui/ui/alert.tsx +66 -0
- package/src/plugins/generative-ui/ui/avatar-wrapper.tsx +22 -0
- package/src/plugins/generative-ui/ui/avatar.tsx +109 -0
- package/src/plugins/generative-ui/ui/badge.tsx +65 -0
- package/src/plugins/generative-ui/ui/button-wrapper.tsx +32 -0
- package/src/plugins/generative-ui/ui/button.tsx +65 -0
- package/src/plugins/generative-ui/ui/card-wrapper.tsx +36 -0
- package/src/plugins/generative-ui/ui/card.tsx +92 -0
- package/src/plugins/generative-ui/ui/checkbox-wrapper.tsx +39 -0
- package/src/plugins/generative-ui/ui/checkbox.tsx +32 -0
- package/src/plugins/generative-ui/ui/data-table.tsx +53 -0
- package/src/plugins/generative-ui/ui/dialog.tsx +158 -0
- package/src/plugins/generative-ui/ui/dropdown-menu.tsx +257 -0
- package/src/plugins/generative-ui/ui/grid.tsx +29 -0
- package/src/plugins/generative-ui/ui/index.ts +43 -0
- package/src/plugins/generative-ui/ui/input-wrapper.tsx +38 -0
- package/src/plugins/generative-ui/ui/input.tsx +21 -0
- package/src/plugins/generative-ui/ui/label.tsx +24 -0
- package/src/plugins/generative-ui/ui/list.tsx +34 -0
- package/src/plugins/generative-ui/ui/metric.tsx +53 -0
- package/src/plugins/generative-ui/ui/pagination.tsx +127 -0
- package/src/plugins/generative-ui/ui/popover.tsx +89 -0
- package/src/plugins/generative-ui/ui/progress.tsx +57 -0
- package/src/plugins/generative-ui/ui/radio-group.tsx +45 -0
- package/src/plugins/generative-ui/ui/select-wrapper.tsx +41 -0
- package/src/plugins/generative-ui/ui/select.tsx +190 -0
- package/src/plugins/generative-ui/ui/separator.tsx +28 -0
- package/src/plugins/generative-ui/ui/skeleton-wrapper.tsx +30 -0
- package/src/plugins/generative-ui/ui/skeleton.tsx +13 -0
- package/src/plugins/generative-ui/ui/stack.tsx +54 -0
- package/src/plugins/generative-ui/ui/switch.tsx +35 -0
- package/src/plugins/generative-ui/ui/table.tsx +116 -0
- package/src/plugins/generative-ui/ui/tabs-wrapper.tsx +51 -0
- package/src/plugins/generative-ui/ui/tabs.tsx +92 -0
- package/src/plugins/generative-ui/ui/text.tsx +33 -0
- package/src/plugins/generative-ui/ui/textarea.tsx +18 -0
- package/src/plugins/generative-ui/ui/tooltip.tsx +57 -0
- package/dist/components/Chat/stories/Plugins.stories.d.ts +0 -12
- package/dist/index-B8nSCdu4.cjs +0 -251
- package/dist/index-B8nSCdu4.cjs.map +0 -1
- package/dist/index-CAtaLV1E.cjs +0 -187
- package/dist/index-CAtaLV1E.cjs.map +0 -1
- package/dist/index-CJrwma08.js +0 -27232
- package/dist/index-CJrwma08.js.map +0 -1
- package/dist/index-DLWQ91ow.js +0 -40049
- package/dist/index-DLWQ91ow.js.map +0 -1
- package/src/components/Chat/stories/Plugins.stories.tsx +0 -158
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
import { GenerativeUI } from './generative-ui'
|
|
3
|
+
|
|
4
|
+
const meta: Meta<typeof GenerativeUI> = {
|
|
5
|
+
title: 'Components/Generative UI',
|
|
6
|
+
component: GenerativeUI,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'fullscreen',
|
|
9
|
+
},
|
|
10
|
+
decorators: [
|
|
11
|
+
(Story) => (
|
|
12
|
+
<div className="bg-background text-foreground min-h-screen p-6">
|
|
13
|
+
<div className="max-w-2xl">
|
|
14
|
+
<Story />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
),
|
|
18
|
+
],
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default meta
|
|
22
|
+
type Story = StoryObj<typeof GenerativeUI>
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Basic layout with Stack and Text components.
|
|
26
|
+
*/
|
|
27
|
+
export const BasicLayout: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
content: {
|
|
30
|
+
type: 'Stack',
|
|
31
|
+
props: { direction: 'vertical', gap: 'md' },
|
|
32
|
+
children: [
|
|
33
|
+
{ type: 'Text', props: { content: 'Hello World', variant: 'heading' } },
|
|
34
|
+
{
|
|
35
|
+
type: 'Text',
|
|
36
|
+
props: { content: 'This is a body text example.', variant: 'body' },
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: 'Text',
|
|
40
|
+
props: { content: 'Caption text for extra info', variant: 'caption' },
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Card with metrics displaying key statistics.
|
|
49
|
+
*/
|
|
50
|
+
export const MetricsCard: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
content: {
|
|
53
|
+
type: 'Card',
|
|
54
|
+
props: { title: 'Monthly Overview' },
|
|
55
|
+
children: [
|
|
56
|
+
{
|
|
57
|
+
type: 'Grid',
|
|
58
|
+
props: { columns: 3, gap: 'md' },
|
|
59
|
+
children: [
|
|
60
|
+
{
|
|
61
|
+
type: 'Metric',
|
|
62
|
+
props: { label: 'Revenue', value: 12500, format: 'currency' },
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
type: 'Metric',
|
|
66
|
+
props: { label: 'Orders', value: 156, format: 'number' },
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: 'Metric',
|
|
70
|
+
props: { label: 'Conversion', value: 0.032, format: 'percent' },
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Data table with headers and rows.
|
|
81
|
+
*/
|
|
82
|
+
export const DataTable: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
content: {
|
|
85
|
+
type: 'Card',
|
|
86
|
+
props: { title: 'Recent Orders' },
|
|
87
|
+
children: [
|
|
88
|
+
{
|
|
89
|
+
type: 'Table',
|
|
90
|
+
props: {
|
|
91
|
+
headers: ['Order ID', 'Customer', 'Amount', 'Status'],
|
|
92
|
+
rows: [
|
|
93
|
+
['#1001', 'Alice Johnson', '$125.00', 'Shipped'],
|
|
94
|
+
['#1002', 'Bob Smith', '$89.50', 'Processing'],
|
|
95
|
+
['#1003', 'Carol White', '$234.00', 'Delivered'],
|
|
96
|
+
['#1004', 'David Brown', '$56.75', 'Pending'],
|
|
97
|
+
],
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Badges showing different status variants.
|
|
107
|
+
*/
|
|
108
|
+
export const BadgeVariants: Story = {
|
|
109
|
+
args: {
|
|
110
|
+
content: {
|
|
111
|
+
type: 'Stack',
|
|
112
|
+
props: { direction: 'horizontal', gap: 'sm' },
|
|
113
|
+
children: [
|
|
114
|
+
{ type: 'Badge', props: { content: 'Default' } },
|
|
115
|
+
{
|
|
116
|
+
type: 'Badge',
|
|
117
|
+
props: { content: 'Secondary', variant: 'secondary' },
|
|
118
|
+
},
|
|
119
|
+
{ type: 'Badge', props: { content: 'Success', variant: 'success' } },
|
|
120
|
+
{ type: 'Badge', props: { content: 'Warning', variant: 'warning' } },
|
|
121
|
+
{
|
|
122
|
+
type: 'Badge',
|
|
123
|
+
props: { content: 'Destructive', variant: 'destructive' },
|
|
124
|
+
},
|
|
125
|
+
{ type: 'Badge', props: { content: 'Outline', variant: 'outline' } },
|
|
126
|
+
],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Alert messages for different contexts.
|
|
133
|
+
*/
|
|
134
|
+
export const Alerts: Story = {
|
|
135
|
+
args: {
|
|
136
|
+
content: {
|
|
137
|
+
type: 'Stack',
|
|
138
|
+
props: { direction: 'vertical', gap: 'md' },
|
|
139
|
+
children: [
|
|
140
|
+
{
|
|
141
|
+
type: 'Alert',
|
|
142
|
+
props: {
|
|
143
|
+
title: 'Information',
|
|
144
|
+
description: 'This is a default informational alert.',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: 'Alert',
|
|
149
|
+
props: {
|
|
150
|
+
title: 'Error',
|
|
151
|
+
description: 'Something went wrong. Please try again.',
|
|
152
|
+
variant: 'destructive',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Progress bars showing completion.
|
|
162
|
+
*/
|
|
163
|
+
export const ProgressBars: Story = {
|
|
164
|
+
args: {
|
|
165
|
+
content: {
|
|
166
|
+
type: 'Stack',
|
|
167
|
+
props: { direction: 'vertical', gap: 'md' },
|
|
168
|
+
children: [
|
|
169
|
+
{
|
|
170
|
+
type: 'Stack',
|
|
171
|
+
props: { direction: 'vertical', gap: 'sm' },
|
|
172
|
+
children: [
|
|
173
|
+
{
|
|
174
|
+
type: 'Text',
|
|
175
|
+
props: { content: 'Upload Progress', variant: 'body' },
|
|
176
|
+
},
|
|
177
|
+
{ type: 'Progress', props: { value: 75 } },
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
type: 'Stack',
|
|
182
|
+
props: { direction: 'vertical', gap: 'sm' },
|
|
183
|
+
children: [
|
|
184
|
+
{
|
|
185
|
+
type: 'Text',
|
|
186
|
+
props: { content: 'Task Completion', variant: 'body' },
|
|
187
|
+
},
|
|
188
|
+
{ type: 'Progress', props: { value: 45 } },
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
],
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Lists - ordered and unordered.
|
|
198
|
+
*/
|
|
199
|
+
export const Lists: Story = {
|
|
200
|
+
args: {
|
|
201
|
+
content: {
|
|
202
|
+
type: 'Grid',
|
|
203
|
+
props: { columns: 2, gap: 'lg' },
|
|
204
|
+
children: [
|
|
205
|
+
{
|
|
206
|
+
type: 'Card',
|
|
207
|
+
props: { title: 'Unordered List' },
|
|
208
|
+
children: [
|
|
209
|
+
{
|
|
210
|
+
type: 'List',
|
|
211
|
+
props: {
|
|
212
|
+
items: [
|
|
213
|
+
'First item',
|
|
214
|
+
'Second item',
|
|
215
|
+
'Third item',
|
|
216
|
+
'Fourth item',
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
type: 'Card',
|
|
224
|
+
props: { title: 'Ordered List' },
|
|
225
|
+
children: [
|
|
226
|
+
{
|
|
227
|
+
type: 'List',
|
|
228
|
+
props: {
|
|
229
|
+
items: ['Step one', 'Step two', 'Step three', 'Step four'],
|
|
230
|
+
ordered: true,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Accordion with collapsible sections.
|
|
242
|
+
*/
|
|
243
|
+
export const AccordionExample: Story = {
|
|
244
|
+
args: {
|
|
245
|
+
content: {
|
|
246
|
+
type: 'Card',
|
|
247
|
+
props: { title: 'FAQ' },
|
|
248
|
+
children: [
|
|
249
|
+
{
|
|
250
|
+
type: 'Accordion',
|
|
251
|
+
props: { type: 'single' },
|
|
252
|
+
children: [
|
|
253
|
+
{
|
|
254
|
+
type: 'AccordionItem',
|
|
255
|
+
props: { value: 'q1', title: 'What is your return policy?' },
|
|
256
|
+
children: [
|
|
257
|
+
{
|
|
258
|
+
type: 'Text',
|
|
259
|
+
props: {
|
|
260
|
+
content:
|
|
261
|
+
'We offer a 30-day return policy for all unused items in original packaging.',
|
|
262
|
+
variant: 'body',
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
type: 'AccordionItem',
|
|
269
|
+
props: { value: 'q2', title: 'How long does shipping take?' },
|
|
270
|
+
children: [
|
|
271
|
+
{
|
|
272
|
+
type: 'Text',
|
|
273
|
+
props: {
|
|
274
|
+
content:
|
|
275
|
+
'Standard shipping takes 5-7 business days. Express shipping is available for 2-3 day delivery.',
|
|
276
|
+
variant: 'body',
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
type: 'AccordionItem',
|
|
283
|
+
props: { value: 'q3', title: 'Do you ship internationally?' },
|
|
284
|
+
children: [
|
|
285
|
+
{
|
|
286
|
+
type: 'Text',
|
|
287
|
+
props: {
|
|
288
|
+
content:
|
|
289
|
+
'Yes! We ship to over 50 countries worldwide. Shipping costs vary by destination.',
|
|
290
|
+
variant: 'body',
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Tabs with multiple content panels.
|
|
304
|
+
*/
|
|
305
|
+
export const TabsExample: Story = {
|
|
306
|
+
args: {
|
|
307
|
+
content: {
|
|
308
|
+
type: 'Card',
|
|
309
|
+
props: { title: 'Product Details' },
|
|
310
|
+
children: [
|
|
311
|
+
{
|
|
312
|
+
type: 'Tabs',
|
|
313
|
+
props: {
|
|
314
|
+
defaultValue: 'overview',
|
|
315
|
+
tabs: [
|
|
316
|
+
{ value: 'overview', label: 'Overview' },
|
|
317
|
+
{ value: 'specs', label: 'Specifications' },
|
|
318
|
+
{ value: 'reviews', label: 'Reviews' },
|
|
319
|
+
],
|
|
320
|
+
},
|
|
321
|
+
children: [
|
|
322
|
+
{
|
|
323
|
+
type: 'TabContent',
|
|
324
|
+
props: { value: 'overview' },
|
|
325
|
+
children: [
|
|
326
|
+
{
|
|
327
|
+
type: 'Text',
|
|
328
|
+
props: {
|
|
329
|
+
content:
|
|
330
|
+
'This premium product features cutting-edge technology and elegant design.',
|
|
331
|
+
variant: 'body',
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
],
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
type: 'TabContent',
|
|
338
|
+
props: { value: 'specs' },
|
|
339
|
+
children: [
|
|
340
|
+
{
|
|
341
|
+
type: 'List',
|
|
342
|
+
props: {
|
|
343
|
+
items: [
|
|
344
|
+
'Weight: 1.2 kg',
|
|
345
|
+
'Dimensions: 30x20x10 cm',
|
|
346
|
+
'Material: Aluminum',
|
|
347
|
+
'Battery: 10 hours',
|
|
348
|
+
],
|
|
349
|
+
},
|
|
350
|
+
},
|
|
351
|
+
],
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
type: 'TabContent',
|
|
355
|
+
props: { value: 'reviews' },
|
|
356
|
+
children: [
|
|
357
|
+
{
|
|
358
|
+
type: 'Text',
|
|
359
|
+
props: {
|
|
360
|
+
content: '4.8 out of 5 stars based on 256 reviews',
|
|
361
|
+
variant: 'body',
|
|
362
|
+
},
|
|
363
|
+
},
|
|
364
|
+
],
|
|
365
|
+
},
|
|
366
|
+
],
|
|
367
|
+
},
|
|
368
|
+
],
|
|
369
|
+
},
|
|
370
|
+
},
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Form elements - inputs, checkboxes, and selects.
|
|
375
|
+
*/
|
|
376
|
+
export const FormElements: Story = {
|
|
377
|
+
args: {
|
|
378
|
+
content: {
|
|
379
|
+
type: 'Card',
|
|
380
|
+
props: { title: 'Contact Form' },
|
|
381
|
+
children: [
|
|
382
|
+
{
|
|
383
|
+
type: 'Stack',
|
|
384
|
+
props: { direction: 'vertical', gap: 'md' },
|
|
385
|
+
children: [
|
|
386
|
+
{
|
|
387
|
+
type: 'Input',
|
|
388
|
+
props: {
|
|
389
|
+
label: 'Full Name',
|
|
390
|
+
placeholder: 'Enter your name',
|
|
391
|
+
valuePath: 'name',
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
type: 'Input',
|
|
396
|
+
props: {
|
|
397
|
+
label: 'Email',
|
|
398
|
+
placeholder: 'Enter your email',
|
|
399
|
+
type: 'email',
|
|
400
|
+
valuePath: 'email',
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
type: 'Select',
|
|
405
|
+
props: {
|
|
406
|
+
placeholder: 'Select a topic',
|
|
407
|
+
valuePath: 'topic',
|
|
408
|
+
options: [
|
|
409
|
+
{ value: 'general', label: 'General Inquiry' },
|
|
410
|
+
{ value: 'support', label: 'Technical Support' },
|
|
411
|
+
{ value: 'sales', label: 'Sales Question' },
|
|
412
|
+
{ value: 'feedback', label: 'Feedback' },
|
|
413
|
+
],
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
type: 'Checkbox',
|
|
418
|
+
props: {
|
|
419
|
+
label: 'Subscribe to newsletter',
|
|
420
|
+
valuePath: 'subscribe',
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
type: 'Button',
|
|
425
|
+
props: { label: 'Submit', variant: 'default' },
|
|
426
|
+
},
|
|
427
|
+
],
|
|
428
|
+
},
|
|
429
|
+
],
|
|
430
|
+
},
|
|
431
|
+
},
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Avatar and skeleton loading states.
|
|
436
|
+
*/
|
|
437
|
+
export const AvatarsAndSkeletons: Story = {
|
|
438
|
+
args: {
|
|
439
|
+
content: {
|
|
440
|
+
type: 'Stack',
|
|
441
|
+
props: { direction: 'vertical', gap: 'lg' },
|
|
442
|
+
children: [
|
|
443
|
+
{
|
|
444
|
+
type: 'Stack',
|
|
445
|
+
props: { direction: 'horizontal', gap: 'md', align: 'center' },
|
|
446
|
+
children: [
|
|
447
|
+
{ type: 'Avatar', props: { fallback: 'JD' } },
|
|
448
|
+
{ type: 'Avatar', props: { fallback: 'AS' } },
|
|
449
|
+
{ type: 'Avatar', props: { fallback: 'MK' } },
|
|
450
|
+
],
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
type: 'Card',
|
|
454
|
+
props: { title: 'Loading State' },
|
|
455
|
+
children: [
|
|
456
|
+
{
|
|
457
|
+
type: 'Stack',
|
|
458
|
+
props: { direction: 'vertical', gap: 'sm' },
|
|
459
|
+
children: [
|
|
460
|
+
{ type: 'Skeleton', props: { height: '1.5rem', width: '60%' } },
|
|
461
|
+
{ type: 'Skeleton', props: { height: '1rem', width: '100%' } },
|
|
462
|
+
{ type: 'Skeleton', props: { height: '1rem', width: '80%' } },
|
|
463
|
+
],
|
|
464
|
+
},
|
|
465
|
+
],
|
|
466
|
+
},
|
|
467
|
+
],
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Complete dashboard example combining multiple components.
|
|
474
|
+
*/
|
|
475
|
+
export const Dashboard: Story = {
|
|
476
|
+
args: {
|
|
477
|
+
content: {
|
|
478
|
+
type: 'Stack',
|
|
479
|
+
props: { direction: 'vertical', gap: 'lg' },
|
|
480
|
+
children: [
|
|
481
|
+
{
|
|
482
|
+
type: 'Text',
|
|
483
|
+
props: { content: 'Store Dashboard', variant: 'heading' },
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
type: 'Grid',
|
|
487
|
+
props: { columns: 4, gap: 'md' },
|
|
488
|
+
children: [
|
|
489
|
+
{
|
|
490
|
+
type: 'Card',
|
|
491
|
+
children: [
|
|
492
|
+
{
|
|
493
|
+
type: 'Metric',
|
|
494
|
+
props: {
|
|
495
|
+
label: 'Total Revenue',
|
|
496
|
+
value: 45231,
|
|
497
|
+
format: 'currency',
|
|
498
|
+
},
|
|
499
|
+
},
|
|
500
|
+
],
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
type: 'Card',
|
|
504
|
+
children: [
|
|
505
|
+
{
|
|
506
|
+
type: 'Metric',
|
|
507
|
+
props: { label: 'Orders', value: 1234, format: 'number' },
|
|
508
|
+
},
|
|
509
|
+
],
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
type: 'Card',
|
|
513
|
+
children: [
|
|
514
|
+
{
|
|
515
|
+
type: 'Metric',
|
|
516
|
+
props: { label: 'Customers', value: 567, format: 'number' },
|
|
517
|
+
},
|
|
518
|
+
],
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
type: 'Card',
|
|
522
|
+
children: [
|
|
523
|
+
{
|
|
524
|
+
type: 'Metric',
|
|
525
|
+
props: {
|
|
526
|
+
label: 'Conversion',
|
|
527
|
+
value: 0.0312,
|
|
528
|
+
format: 'percent',
|
|
529
|
+
},
|
|
530
|
+
},
|
|
531
|
+
],
|
|
532
|
+
},
|
|
533
|
+
],
|
|
534
|
+
},
|
|
535
|
+
{ type: 'Separator' },
|
|
536
|
+
{
|
|
537
|
+
type: 'Card',
|
|
538
|
+
props: { title: 'Recent Orders' },
|
|
539
|
+
children: [
|
|
540
|
+
{
|
|
541
|
+
type: 'Table',
|
|
542
|
+
props: {
|
|
543
|
+
headers: ['Order', 'Customer', 'Status', 'Amount'],
|
|
544
|
+
rows: [
|
|
545
|
+
['#3210', 'Olivia Martin', 'Shipped', '$42.25'],
|
|
546
|
+
['#3209', 'Ava Johnson', 'Processing', '$74.99'],
|
|
547
|
+
['#3208', 'Michael Chen', 'Delivered', '$124.00'],
|
|
548
|
+
['#3207', 'Lisa Wang', 'Pending', '$64.75'],
|
|
549
|
+
],
|
|
550
|
+
},
|
|
551
|
+
},
|
|
552
|
+
],
|
|
553
|
+
},
|
|
554
|
+
],
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
}
|