@app-studio/web 0.9.39 → 0.9.43

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 (95) 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/docs/components/Accordion.mdx +74 -121
  23. package/docs/components/Alert.mdx +18 -69
  24. package/docs/components/AspectRatio.mdx +11 -9
  25. package/docs/components/AudioInput.mdx +43 -0
  26. package/docs/components/Avatar.mdx +17 -42
  27. package/docs/components/Background.mdx +99 -491
  28. package/docs/components/Badge.mdx +37 -122
  29. package/docs/components/Button.mdx +71 -123
  30. package/docs/components/Calendar.mdx +7 -7
  31. package/docs/components/Card.mdx +238 -281
  32. package/docs/components/Carousel.mdx +88 -315
  33. package/docs/components/Center.mdx +22 -22
  34. package/docs/components/Chart.mdx +171 -26
  35. package/docs/components/ChatInput.mdx +327 -275
  36. package/docs/components/Checkbox.mdx +3 -5
  37. package/docs/components/ColorInput.mdx +10 -10
  38. package/docs/components/ColorPicker.mdx +452 -0
  39. package/docs/components/ComboBox.mdx +14 -14
  40. package/docs/components/Command.mdx +140 -188
  41. package/docs/components/ContextMenu.mdx +47 -171
  42. package/docs/components/CookieConsent.mdx +53 -0
  43. package/docs/components/CountryPicker.mdx +10 -10
  44. package/docs/components/DatePicker.mdx +4 -4
  45. package/docs/components/DragAndDrop.mdx +279 -463
  46. package/docs/components/Drawer.mdx +401 -100
  47. package/docs/components/DropdownMenu.mdx +37 -155
  48. package/docs/components/EmojiPicker.mdx +84 -0
  49. package/docs/components/File.mdx +130 -4
  50. package/docs/components/Flow.mdx +3 -3
  51. package/docs/components/Form.mdx +4 -4
  52. package/docs/components/Formik.mdx +41 -41
  53. package/docs/components/Gradient.mdx +355 -178
  54. package/docs/components/Horizontal.mdx +1 -2
  55. package/docs/components/HoverCard.mdx +57 -125
  56. package/docs/components/Icon.mdx +10 -10
  57. package/docs/components/KanbanBoard.mdx +12 -12
  58. package/docs/components/Label.mdx +8 -8
  59. package/docs/components/Link.mdx +19 -27
  60. package/docs/components/Loader.mdx +224 -407
  61. package/docs/components/Menubar.mdx +71 -67
  62. package/docs/components/Message.mdx +211 -526
  63. package/docs/components/Modal.mdx +351 -475
  64. package/docs/components/NavigationMenu.mdx +8 -8
  65. package/docs/components/OTPInput.mdx +194 -0
  66. package/docs/components/Pagination.mdx +451 -107
  67. package/docs/components/Password.mdx +8 -8
  68. package/docs/components/ProgressBar.mdx +460 -0
  69. package/docs/components/Resizable.mdx +103 -102
  70. package/docs/components/Select.mdx +5 -5
  71. package/docs/components/Separator.mdx +11 -98
  72. package/docs/components/ShareButton.mdx +29 -0
  73. package/docs/components/Sidebar.mdx +70 -131
  74. package/docs/components/Slider.mdx +99 -185
  75. package/docs/components/StatusIndicator.mdx +373 -0
  76. package/docs/components/Switch.mdx +3 -3
  77. package/docs/components/Table.mdx +25 -105
  78. package/docs/components/Tabs.mdx +40 -143
  79. package/docs/components/TagInput.mdx +32 -32
  80. package/docs/components/Text.mdx +3 -3
  81. package/docs/components/TextArea.mdx +9 -9
  82. package/docs/components/TextField.mdx +17 -17
  83. package/docs/components/Title.mdx +267 -525
  84. package/docs/components/Toast.mdx +65 -142
  85. package/docs/components/Toggle.mdx +34 -46
  86. package/docs/components/ToggleGroup.mdx +29 -50
  87. package/docs/components/Tooltip.mdx +500 -137
  88. package/docs/components/Tree.mdx +4 -4
  89. package/docs/components/Uploader.mdx +205 -351
  90. package/docs/components/Vertical.mdx +22 -22
  91. package/package.json +1 -1
  92. package/dist/components/AuthGuard/AuthGuard.d.ts +0 -35
  93. package/dist/components/AuthGuard/index.d.ts +0 -1
  94. package/docs/adk-components.md +0 -319
  95. 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';
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';
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';
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';
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';
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';
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
+ ```