@app-studio/web 0.9.41 → 0.9.44

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 (101) hide show
  1. package/dist/bot/Bot.d.ts +15 -0
  2. package/dist/bot/Cache.d.ts +13 -0
  3. package/dist/bot/Config.d.ts +13 -0
  4. package/dist/bot/ContentFetcher.d.ts +9 -0
  5. package/dist/bot/DocuCode.d.ts +19 -0
  6. package/dist/bot/FileHandler.d.ts +39 -0
  7. package/dist/bot/ai/AnthropicConnector.d.ts +6 -0
  8. package/dist/bot/ai/GeminiConnector.d.ts +7 -0
  9. package/dist/bot/ai/GroqConnector.d.ts +7 -0
  10. package/dist/bot/ai/HuggingFaceConnector.d.ts +6 -0
  11. package/dist/bot/ai/OpenAIConnector.d.ts +11 -0
  12. package/dist/bot/ai/ReplicateConnector.d.ts +7 -0
  13. package/dist/bot/ai/SambaNovaConnector.d.ts +6 -0
  14. package/dist/bot/ai/ai.config.d.ts +12 -0
  15. package/dist/bot/ai/ai.service.d.ts +36 -0
  16. package/dist/bot/data.d.ts +19 -0
  17. package/dist/bot/extractors.d.ts +8 -0
  18. package/dist/bot/index.d.ts +1 -0
  19. package/dist/bot/prompt/1-project.d.ts +1 -0
  20. package/dist/bot/prompt/2-response.d.ts +1 -0
  21. package/dist/bot/prompt/3-comment.d.ts +1 -0
  22. package/dist/components/Title/Title/SlideEffect.d.ts +14 -0
  23. package/dist/components/Title/Title/Title.props.d.ts +20 -0
  24. package/dist/components/Title/Title/Title.state.d.ts +4 -0
  25. package/dist/web.cjs.development.js +265 -78
  26. package/dist/web.cjs.development.js.map +1 -1
  27. package/dist/web.cjs.production.min.js +1 -1
  28. package/dist/web.cjs.production.min.js.map +1 -1
  29. package/dist/web.esm.js +265 -78
  30. package/dist/web.esm.js.map +1 -1
  31. package/dist/web.umd.development.js +265 -78
  32. package/dist/web.umd.development.js.map +1 -1
  33. package/dist/web.umd.production.min.js +1 -1
  34. package/dist/web.umd.production.min.js.map +1 -1
  35. package/docs/components/Accordion.mdx +74 -121
  36. package/docs/components/Alert.mdx +19 -70
  37. package/docs/components/AspectRatio.mdx +13 -11
  38. package/docs/components/AudioInput.mdx +43 -0
  39. package/docs/components/Avatar.mdx +18 -43
  40. package/docs/components/Background.mdx +100 -492
  41. package/docs/components/Badge.mdx +45 -130
  42. package/docs/components/Button.mdx +76 -128
  43. package/docs/components/Calendar.mdx +7 -7
  44. package/docs/components/Card.mdx +247 -290
  45. package/docs/components/Carousel.mdx +94 -321
  46. package/docs/components/Chart.mdx +171 -26
  47. package/docs/components/ChatInput.mdx +327 -275
  48. package/docs/components/Checkbox.mdx +3 -5
  49. package/docs/components/ColorInput.mdx +6 -6
  50. package/docs/components/ColorPicker.mdx +452 -0
  51. package/docs/components/ComboBox.mdx +13 -13
  52. package/docs/components/Command.mdx +140 -188
  53. package/docs/components/ContextMenu.mdx +47 -171
  54. package/docs/components/CookieConsent.mdx +53 -0
  55. package/docs/components/CountryPicker.mdx +8 -8
  56. package/docs/components/DatePicker.mdx +3 -3
  57. package/docs/components/DragAndDrop.mdx +279 -463
  58. package/docs/components/Drawer.mdx +392 -231
  59. package/docs/components/DropdownMenu.mdx +37 -155
  60. package/docs/components/EmojiPicker.mdx +84 -0
  61. package/docs/components/File.mdx +130 -4
  62. package/docs/components/Formik.mdx +39 -39
  63. package/docs/components/Gradient.mdx +359 -182
  64. package/docs/components/Horizontal.mdx +1 -2
  65. package/docs/components/HoverCard.mdx +57 -125
  66. package/docs/components/KanbanBoard.mdx +9 -9
  67. package/docs/components/Link.mdx +22 -30
  68. package/docs/components/Loader.mdx +230 -413
  69. package/docs/components/Menubar.mdx +73 -69
  70. package/docs/components/Message.mdx +210 -525
  71. package/docs/components/Modal.mdx +351 -475
  72. package/docs/components/NavigationMenu.mdx +8 -8
  73. package/docs/components/OTPInput.mdx +194 -0
  74. package/docs/components/Pagination.mdx +451 -107
  75. package/docs/components/Password.mdx +8 -8
  76. package/docs/components/ProgressBar.mdx +460 -0
  77. package/docs/components/Resizable.mdx +103 -102
  78. package/docs/components/Select.mdx +5 -5
  79. package/docs/components/Separator.mdx +11 -98
  80. package/docs/components/ShareButton.mdx +29 -0
  81. package/docs/components/Sidebar.mdx +70 -131
  82. package/docs/components/Slider.mdx +99 -185
  83. package/docs/components/StatusIndicator.mdx +373 -0
  84. package/docs/components/Switch.mdx +3 -3
  85. package/docs/components/Table.mdx +25 -105
  86. package/docs/components/Tabs.mdx +40 -143
  87. package/docs/components/TagInput.mdx +17 -17
  88. package/docs/components/Text.mdx +3 -3
  89. package/docs/components/TextArea.mdx +6 -6
  90. package/docs/components/TextField.mdx +12 -12
  91. package/docs/components/Title.mdx +267 -525
  92. package/docs/components/Toast.mdx +65 -142
  93. package/docs/components/Toggle.mdx +37 -49
  94. package/docs/components/ToggleGroup.mdx +36 -57
  95. package/docs/components/Tooltip.mdx +501 -138
  96. package/docs/components/Uploader.mdx +205 -351
  97. package/package.json +1 -1
  98. package/dist/components/AuthGuard/AuthGuard.d.ts +0 -35
  99. package/dist/components/AuthGuard/index.d.ts +0 -1
  100. package/docs/adk-components.md +0 -319
  101. package/docs/adk-quick-start.md +0 -268
@@ -4,14 +4,13 @@ A component for visualizing data in various chart formats.
4
4
 
5
5
  ### **Import**
6
6
  ```tsx
7
- import { Chart } from '@app-studio/web';
7
+ import { Chart, CHART_COLORS } from '@app-studio/web';
8
8
  ```
9
9
 
10
10
  ### **Bar Chart**
11
11
  ```tsx
12
12
  import React from 'react';
13
- import { Chart } from '../Chart';
14
- import { View } from '@app-studio/web';
13
+ import { Chart, CHART_COLORS, View } from '@app-studio/web';
15
14
 
16
15
  export const BarChartDemo = () => {
17
16
  const data = {
@@ -20,12 +19,17 @@ export const BarChartDemo = () => {
20
19
  {
21
20
  name: 'Revenue',
22
21
  data: [30, 40, 35, 50, 49, 60],
23
- color: 'color.blue.500',
22
+ color: CHART_COLORS.blue,
24
23
  },
25
24
  {
26
25
  name: 'Expenses',
27
26
  data: [20, 25, 30, 35, 30, 40],
28
- color: 'color.red.500',
27
+ color: CHART_COLORS.green,
28
+ },
29
+ {
30
+ name: 'Profit',
31
+ data: [10, 15, 5, 15, 19, 20],
32
+ color: CHART_COLORS.purple,
29
33
  },
30
34
  ],
31
35
  };
@@ -38,6 +42,9 @@ export const BarChartDemo = () => {
38
42
  title="Monthly Revenue vs Expenses"
39
43
  showGrid
40
44
  animated
45
+ onSeriesClick={(seriesName, index) => {
46
+ console.log(`Clicked on ${seriesName} at index ${index}`);
47
+ }}
41
48
  />
42
49
  </View>
43
50
  );
@@ -47,8 +54,7 @@ export const BarChartDemo = () => {
47
54
  ### **Line Chart**
48
55
  ```tsx
49
56
  import React from 'react';
50
- import { Chart } from '../Chart';
51
- import { View } from '@app-studio/web';
57
+ import { Chart, CHART_COLORS, View } from '@app-studio/web';
52
58
 
53
59
  export const LineChartDemo = () => {
54
60
  const data = {
@@ -57,12 +63,12 @@ export const LineChartDemo = () => {
57
63
  {
58
64
  name: 'Users',
59
65
  data: [500, 800, 1200, 1800, 2500, 3000],
60
- color: 'color.purple.500',
66
+ color: CHART_COLORS.purple,
61
67
  },
62
68
  {
63
69
  name: 'Sessions',
64
70
  data: [1000, 1600, 2400, 3600, 5000, 6000],
65
- color: 'color.teal.500',
71
+ color: CHART_COLORS.teal,
66
72
  },
67
73
  ],
68
74
  };
@@ -85,8 +91,7 @@ export const LineChartDemo = () => {
85
91
  ### **Area Chart**
86
92
  ```tsx
87
93
  import React from 'react';
88
- import { Chart } from '../Chart';
89
- import { View } from '@app-studio/web';
94
+ import { Chart, CHART_COLORS, View } from '@app-studio/web';
90
95
 
91
96
  export const AreaChartDemo = () => {
92
97
  const data = {
@@ -95,12 +100,12 @@ export const AreaChartDemo = () => {
95
100
  {
96
101
  name: 'This Week',
97
102
  data: [10, 15, 12, 20, 18, 25, 22],
98
- color: 'color.green.500',
103
+ color: CHART_COLORS.green,
99
104
  },
100
105
  {
101
106
  name: 'Last Week',
102
107
  data: [8, 12, 10, 15, 14, 20, 17],
103
- color: 'color.blue.500',
108
+ color: CHART_COLORS.blue,
104
109
  },
105
110
  ],
106
111
  };
@@ -122,15 +127,14 @@ export const AreaChartDemo = () => {
122
127
  ### **Pie Chart**
123
128
  ```tsx
124
129
  import React from 'react';
125
- import { Chart } from '../Chart';
126
- import { View } from '@app-studio/web';
130
+ import { Chart, CHART_COLORS, View } from '@app-studio/web';
127
131
 
128
132
  export const PieChartDemo = () => {
129
133
  const dataPoints = [
130
- { label: 'Mobile', value: 45, color: 'color.blue.500' },
131
- { label: 'Desktop', value: 30, color: 'color.green.500' },
132
- { label: 'Tablet', value: 15, color: 'color.purple.500' },
133
- { label: 'Other', value: 10, color: 'color.orange.500' },
134
+ { label: 'Mobile', value: 45, color: CHART_COLORS.blue },
135
+ { label: 'Desktop', value: 30, color: CHART_COLORS.green },
136
+ { label: 'Tablet', value: 15, color: CHART_COLORS.purple },
137
+ { label: 'Other', value: 10, color: CHART_COLORS.orange },
134
138
  ];
135
139
 
136
140
  return (
@@ -140,6 +144,9 @@ export const PieChartDemo = () => {
140
144
  dataPoints={dataPoints}
141
145
  title="Device Distribution"
142
146
  animated
147
+ onDataPointClick={(dataPoint, index) => {
148
+ console.log(`Clicked on ${dataPoint?.label} at index ${index}`);
149
+ }}
143
150
  />
144
151
  </View>
145
152
  );
@@ -149,14 +156,13 @@ export const PieChartDemo = () => {
149
156
  ### **Donut Chart**
150
157
  ```tsx
151
158
  import React from 'react';
152
- import { Chart } from '../Chart';
153
- import { View } from '@app-studio/web';
159
+ import { Chart, CHART_COLORS, View } from '@app-studio/web';
154
160
 
155
161
  export const DonutChartDemo = () => {
156
162
  const dataPoints = [
157
- { label: 'Completed', value: 65, color: 'color.green.500' },
158
- { label: 'In Progress', value: 25, color: 'color.blue.500' },
159
- { label: 'Pending', value: 10, color: 'color.orange.500' },
163
+ { label: 'Completed', value: 65, color: CHART_COLORS.green },
164
+ { label: 'In Progress', value: 25, color: CHART_COLORS.blue },
165
+ { label: 'Pending', value: 10, color: CHART_COLORS.orange },
160
166
  ];
161
167
 
162
168
  return (
@@ -175,8 +181,7 @@ export const DonutChartDemo = () => {
175
181
  ### **Custom Styling**
176
182
  ```tsx
177
183
  import React from 'react';
178
- import { Chart } from '../Chart';
179
- import { View } from '@app-studio/web';
184
+ import { Chart, CHART_COLORS, View } from '@app-studio/web';
180
185
 
181
186
  export const CustomChartDemo = () => {
182
187
  const data = {
@@ -185,6 +190,7 @@ export const CustomChartDemo = () => {
185
190
  {
186
191
  name: 'Sales',
187
192
  data: [120, 180, 150, 210],
193
+ color: CHART_COLORS.blue,
188
194
  },
189
195
  ],
190
196
  };
@@ -230,3 +236,142 @@ export const CustomChartDemo = () => {
230
236
  );
231
237
  };
232
238
  ```
239
+
240
+ ### **Chart States**
241
+
242
+ The Chart component supports loading, error, and no data states:
243
+
244
+ ```tsx
245
+ import React, { useState } from 'react';
246
+ import { Chart, CHART_COLORS, View, Button, Horizontal } from '@app-studio/web';
247
+
248
+ export const ChartStatesDemo = () => {
249
+ const [state, setState] = useState<'normal' | 'loading' | 'error' | 'noData'>('normal');
250
+
251
+ const data = {
252
+ labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
253
+ series: [
254
+ {
255
+ name: 'Revenue',
256
+ data: [30, 40, 35, 50, 49, 60],
257
+ color: CHART_COLORS.blue,
258
+ },
259
+ ],
260
+ };
261
+
262
+ return (
263
+ <View>
264
+ <Horizontal gap="8px" marginBottom="16px">
265
+ <Button onClick={() => setState('normal')}>Normal</Button>
266
+ <Button onClick={() => setState('loading')}>Loading</Button>
267
+ <Button onClick={() => setState('error')}>Error</Button>
268
+ <Button onClick={() => setState('noData')}>No Data</Button>
269
+ </Horizontal>
270
+
271
+ <View height="300px" width="100%">
272
+ <Chart
273
+ type="bar"
274
+ data={data}
275
+ title="Revenue Chart"
276
+ showGrid
277
+ animated
278
+ isLoading={state === 'loading'}
279
+ error={state === 'error' ? 'Failed to load chart data' : undefined}
280
+ noData={state === 'noData'}
281
+ />
282
+ </View>
283
+ </View>
284
+ );
285
+ };
286
+ ```
287
+
288
+ ### **Available Colors**
289
+
290
+ The Chart component provides a set of predefined colors through `CHART_COLORS`:
291
+
292
+ ```tsx
293
+ import { CHART_COLORS } from '@app-studio/web';
294
+
295
+ // Available colors:
296
+ CHART_COLORS.blue // 'color.blue.500'
297
+ CHART_COLORS.green // 'color.green.500'
298
+ CHART_COLORS.purple // 'color.purple.500'
299
+ CHART_COLORS.orange // 'color.orange.500'
300
+ CHART_COLORS.red // 'color.red.500'
301
+ CHART_COLORS.teal // 'color.teal.500'
302
+ CHART_COLORS.pink // 'color.pink.500'
303
+ CHART_COLORS.indigo // 'color.indigo.500'
304
+ CHART_COLORS.yellow // 'color.yellow.500'
305
+ CHART_COLORS.cyan // 'color.cyan.500'
306
+ ```
307
+
308
+ ### **Props Reference**
309
+
310
+ | Prop | Type | Default | Description |
311
+ |------|------|---------|-------------|
312
+ | `type` | `'bar' \| 'line' \| 'area' \| 'pie' \| 'donut'` | **Required** | The type of chart to render |
313
+ | `data` | `ChartData` | - | Data for multi-series charts (bar, line, area) |
314
+ | `dataPoints` | `ChartDataPoint[]` | - | Data points for single series charts (pie, donut) |
315
+ | `title` | `string` | - | The title of the chart |
316
+ | `showLegend` | `boolean` | `true` | Whether to show the legend |
317
+ | `legendPosition` | `'top' \| 'right' \| 'bottom' \| 'left'` | `'bottom'` | Position of the legend |
318
+ | `showGrid` | `boolean` | `true` | Whether to show grid lines |
319
+ | `showTooltips` | `boolean` | `true` | Whether to show tooltips on hover |
320
+ | `animated` | `boolean` | `true` | Whether the chart is animated |
321
+ | `animationDuration` | `number` | `500` | Duration of the animation in milliseconds |
322
+ | `responsive` | `boolean` | `true` | Whether the chart is responsive |
323
+ | `aspectRatio` | `number` | `16/9` | The aspect ratio of the chart (width/height) |
324
+ | `width` | `number \| string` | `200` | The width of the chart |
325
+ | `height` | `number \| string` | `200` | The height of the chart |
326
+ | `views` | `ChartStyles` | - | Custom styles for different parts of the chart |
327
+ | `onDataPointClick` | `(dataPoint, index) => void` | - | Callback when a data point is clicked (pie/donut) |
328
+ | `onSeriesClick` | `(seriesName, index) => void` | - | Callback when a series is clicked (bar/line/area) |
329
+ | `isLoading` | `boolean` | `false` | If true, displays a loading indicator overlay |
330
+ | `error` | `React.ReactNode` | - | If provided, displays an error message overlay |
331
+ | `noData` | `boolean \| React.ReactNode` | - | If true, displays a "no data" message |
332
+ | `loadingIndicator` | `React.ReactNode` | - | Custom placeholder for the loading state |
333
+ | `errorIndicator` | `React.ReactNode` | - | Custom placeholder for the error state |
334
+ | `noDataIndicator` | `React.ReactNode` | - | Custom placeholder for the no data state |
335
+ | `aria-label` | `string` | - | Aria-label for the chart region (defaults to title) |
336
+
337
+ ### **Type Definitions**
338
+
339
+ ```tsx
340
+ interface ChartData {
341
+ labels: string[];
342
+ series: ChartSeries[];
343
+ }
344
+
345
+ interface ChartSeries {
346
+ name: string;
347
+ data: number[];
348
+ color?: string;
349
+ }
350
+
351
+ interface ChartDataPoint {
352
+ label: string;
353
+ value: number;
354
+ color?: string;
355
+ }
356
+
357
+ interface ChartStyles {
358
+ container?: ViewProps;
359
+ chart?: ViewProps;
360
+ legend?: ViewProps;
361
+ legendItem?: ViewProps;
362
+ tooltip?: ViewProps;
363
+ axis?: ViewProps;
364
+ grid?: ViewProps;
365
+ bar?: ViewProps;
366
+ line?: ViewProps;
367
+ point?: ViewProps;
368
+ pie?: ViewProps;
369
+ area?: ViewProps;
370
+ axisLabel?: ViewProps;
371
+ axisLine?: ViewProps;
372
+ axisTick?: ViewProps;
373
+ loadingOverlay?: ViewProps;
374
+ errorOverlay?: ViewProps;
375
+ noDataOverlay?: ViewProps;
376
+ }
377
+ ```