@app-studio/web 0.9.44 → 0.9.46

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 (49) hide show
  1. package/dist/components/Icon/Icon.d.ts +2 -1
  2. package/dist/pages/themeTest.page.d.ts +3 -0
  3. package/dist/web.cjs.development.js +7 -2
  4. package/dist/web.cjs.development.js.map +1 -1
  5. package/dist/web.cjs.production.min.js +1 -1
  6. package/dist/web.cjs.production.min.js.map +1 -1
  7. package/dist/web.esm.js +7 -3
  8. package/dist/web.esm.js.map +1 -1
  9. package/dist/web.umd.development.js +7 -2
  10. package/dist/web.umd.development.js.map +1 -1
  11. package/dist/web.umd.production.min.js +1 -1
  12. package/dist/web.umd.production.min.js.map +1 -1
  13. package/docs/components/Badge.mdx +1 -1
  14. package/docs/components/ColorPicker.mdx +16 -16
  15. package/docs/components/DragAndDrop.mdx +11 -11
  16. package/docs/components/Drawer.mdx +3 -3
  17. package/docs/components/Gradient.mdx +40 -40
  18. package/docs/components/Icon.mdx +90 -57
  19. package/docs/components/Loader.mdx +17 -17
  20. package/docs/components/ProgressBar.mdx +14 -14
  21. package/docs/components/StatusIndicator.mdx +5 -5
  22. package/docs/components.md +0 -164
  23. package/package.json +1 -1
  24. package/dist/bot/Bot.d.ts +0 -15
  25. package/dist/bot/Cache.d.ts +0 -13
  26. package/dist/bot/Config.d.ts +0 -13
  27. package/dist/bot/ContentFetcher.d.ts +0 -9
  28. package/dist/bot/DocuCode.d.ts +0 -19
  29. package/dist/bot/FileHandler.d.ts +0 -39
  30. package/dist/bot/ai/AnthropicConnector.d.ts +0 -6
  31. package/dist/bot/ai/GeminiConnector.d.ts +0 -7
  32. package/dist/bot/ai/GroqConnector.d.ts +0 -7
  33. package/dist/bot/ai/HuggingFaceConnector.d.ts +0 -6
  34. package/dist/bot/ai/OpenAIConnector.d.ts +0 -11
  35. package/dist/bot/ai/ReplicateConnector.d.ts +0 -7
  36. package/dist/bot/ai/SambaNovaConnector.d.ts +0 -6
  37. package/dist/bot/ai/ai.config.d.ts +0 -12
  38. package/dist/bot/ai/ai.service.d.ts +0 -36
  39. package/dist/bot/data.d.ts +0 -19
  40. package/dist/bot/extractors.d.ts +0 -8
  41. package/dist/bot/index.d.ts +0 -1
  42. package/dist/bot/prompt/1-project.d.ts +0 -1
  43. package/dist/bot/prompt/2-response.d.ts +0 -1
  44. package/dist/bot/prompt/3-comment.d.ts +0 -1
  45. package/docs/components/Calendar.mdx +0 -189
  46. package/docs/components/Flow.mdx +0 -258
  47. package/docs/components/KanbanBoard.mdx +0 -286
  48. package/docs/components/OKR.mdx +0 -452
  49. package/docs/components/Tree.mdx +0 -341
@@ -70,11 +70,11 @@ import { Vertical } from 'app-studio';
70
70
 
71
71
  export const ColoredProgressBars = () => (
72
72
  <Vertical gap={15}>
73
- <ProgressBar value={60} color="#3b82f6" />
74
- <ProgressBar value={60} color="#10b981" />
75
- <ProgressBar value={60} color="#ef4444" />
76
- <ProgressBar value={60} color="#f59e0b" />
77
- <ProgressBar value={60} color="#8b5cf6" />
73
+ <ProgressBar value={60} color="color.blue.500" />
74
+ <ProgressBar value={60} color="color.emerald.500" />
75
+ <ProgressBar value={60} color="color.red.500" />
76
+ <ProgressBar value={60} color="color.amber.500" />
77
+ <ProgressBar value={60} color="color.violet.500" />
78
78
  </Vertical>
79
79
  );
80
80
  ```
@@ -93,18 +93,18 @@ export const BackgroundColorProgressBars = () => (
93
93
  <Vertical gap={15}>
94
94
  <ProgressBar
95
95
  value={60}
96
- color="#3b82f6"
97
- backgroundColor="#dbeafe"
96
+ color="color.blue.500"
97
+ backgroundColor="color.blue.100"
98
98
  />
99
99
  <ProgressBar
100
100
  value={60}
101
- color="#10b981"
102
- backgroundColor="#d1fae5"
101
+ color="color.emerald.500"
102
+ backgroundColor="color.emerald.100"
103
103
  />
104
104
  <ProgressBar
105
105
  value={60}
106
- color="#ef4444"
107
- backgroundColor="#fee2e2"
106
+ color="color.red.500"
107
+ backgroundColor="color.red.100"
108
108
  />
109
109
  </Vertical>
110
110
  );
@@ -246,7 +246,7 @@ export const FileUploadProgress = () => {
246
246
  <Text fontSize={14}>Uploading... {progress}%</Text>
247
247
  <ProgressBar
248
248
  value={progress}
249
- color="#10b981"
249
+ color="color.emerald.500"
250
250
  height={8}
251
251
  />
252
252
  </Vertical>
@@ -275,7 +275,7 @@ export const MultiStepProgress = () => {
275
275
  <Text>Step {step} of {totalSteps}</Text>
276
276
  <ProgressBar
277
277
  value={progress}
278
- color="#3b82f6"
278
+ color="color.blue.500"
279
279
  height={10}
280
280
  />
281
281
  </Vertical>
@@ -430,7 +430,7 @@ export const CompleteProgressExample = () => {
430
430
  </Horizontal>
431
431
  <ProgressBar
432
432
  value={overallProgress}
433
- color="#3b82f6"
433
+ color="color.blue.500"
434
434
  height={12}
435
435
  radius={6}
436
436
  />
@@ -154,7 +154,7 @@ export const OrderStatus = () => (
154
154
  <Vertical gap={15}>
155
155
  <Text fontSize={18} fontWeight="bold">Order #12345</Text>
156
156
  <StatusIndicator status="success" label="Delivered" />
157
- <Text fontSize={14} color="#6b7280">
157
+ <Text fontSize={14} color="color.coolGray.500">
158
158
  Your order was delivered on March 15, 2024
159
159
  </Text>
160
160
  </Vertical>
@@ -242,12 +242,12 @@ export const PaymentStatus = () => (
242
242
  <Horizontal justifyContent="space-between" alignItems="center">
243
243
  <Vertical gap={5}>
244
244
  <Text fontSize={16} fontWeight="bold">Payment to Acme Corp</Text>
245
- <Text fontSize={14} color="#6b7280">$1,234.56</Text>
245
+ <Text fontSize={14} color="color.coolGray.500">$1,234.56</Text>
246
246
  </Vertical>
247
247
  <StatusIndicator status="success" label="Paid" />
248
248
  </Horizontal>
249
249
 
250
- <Text fontSize={14} color="#6b7280">
250
+ <Text fontSize={14} color="color.coolGray.500">
251
251
  Transaction ID: TXN-2024-03-15-001
252
252
  </Text>
253
253
  </Vertical>
@@ -283,7 +283,7 @@ export const ServerStatusDashboard = () => {
283
283
  <Horizontal justifyContent="space-between" alignItems="center">
284
284
  <Vertical gap={5}>
285
285
  <Text fontWeight="bold">{server.name}</Text>
286
- <Text fontSize={14} color="#6b7280">
286
+ <Text fontSize={14} color="color.coolGray.500">
287
287
  Uptime: {server.uptime}
288
288
  </Text>
289
289
  </Vertical>
@@ -342,7 +342,7 @@ export const NotificationStatus = () => {
342
342
  <StatusIndicator status={notification.status} />
343
343
  <Vertical gap={2}>
344
344
  <Text>{notification.message}</Text>
345
- <Text fontSize={12} color="#6b7280">{notification.time}</Text>
345
+ <Text fontSize={12} color="color.coolGray.500">{notification.time}</Text>
346
346
  </Vertical>
347
347
  </Horizontal>
348
348
  ))}
@@ -297,167 +297,3 @@ const TooltipExample = () => (
297
297
  );
298
298
  ```
299
299
 
300
- ## V. Data Display Components
301
-
302
- ### Calendar
303
-
304
- A component for displaying dates and allowing users to select a single date or a date range.
305
-
306
- **Example:**
307
- ```tsx
308
- import { Calendar } from '@app-studio';
309
- import { useState } from 'react';
310
-
311
- const CalendarExample = () => {
312
- const [selectedDate, setSelectedDate] = useState(new Date());
313
-
314
- return (
315
- <Calendar
316
- value={selectedDate}
317
- onChange={setSelectedDate}
318
- />
319
- );
320
- };
321
- ```
322
-
323
- ### Kanban Card
324
-
325
- A draggable card component designed for use within a Kanban board. It displays key information and can be customized.
326
-
327
- **Example:**
328
- ```tsx
329
- import { KanbanCard } from '@app-studio';
330
-
331
- const KanbanCardExample = () => (
332
- <KanbanCard
333
- id="task-1"
334
- title="Design the new dashboard"
335
- description="Create mockups in Figma for the v2 dashboard."
336
- tags={[{ label: 'UI/UX', color: 'blue' }, { label: 'High Priority', color: 'red' }]}
337
- assignee={{ name: 'Jane Doe', avatarUrl: '/avatars/jane.png' }}
338
- />
339
- );
340
- ```
341
-
342
- ### Tree
343
-
344
- A component for displaying hierarchical data with expandable/collapsible nodes. Supports both a compound component pattern and a data-driven approach.
345
-
346
- **Example:**
347
- ```tsx
348
- import { Tree } from '@app-studio/web';
349
- import { FolderIcon, FileIcon } from '@app-studio/web';
350
-
351
- const FileTreeExample = () => {
352
- const treeData = [
353
- {
354
- id: 'root',
355
- label: 'Project',
356
- icon: <FolderIcon size={16} />,
357
- children: [
358
- {
359
- id: 'src',
360
- label: 'src',
361
- icon: <FolderIcon size={16} />,
362
- children: [
363
- { id: 'components', label: 'components', icon: <FileIcon size={16} /> },
364
- { id: 'utils', label: 'utils', icon: <FileIcon size={16} /> },
365
- ],
366
- },
367
- ],
368
- },
369
- ];
370
-
371
- return (
372
- <Tree
373
- items={treeData}
374
- defaultExpandedItems={['root', 'src']}
375
- onItemSelect={(itemId) => console.log(`Selected: ${itemId}`)}
376
- />
377
- );
378
- };
379
- ```
380
-
381
- For detailed documentation, see [Tree Component](./components/Tree.mdx).
382
-
383
- ### Flow
384
-
385
- A component for creating interactive workflow diagrams and flowcharts with support for node connections, drag-and-drop functionality, and viewport controls.
386
-
387
- **Example:**
388
- ```tsx
389
- import { Flow } from '@app-studio/web';
390
- import { useState } from 'react';
391
-
392
- const FlowExample = () => {
393
- const [nodes, setNodes] = useState([
394
- {
395
- id: 'node-1',
396
- position: { x: 50, y: 50 },
397
- data: { label: 'Start Node', subtitle: 'Begin here' },
398
- },
399
- {
400
- id: 'node-2',
401
- position: { x: 50, y: 200 },
402
- data: { label: 'Process Node', subtitle: 'Do something' },
403
- },
404
- ]);
405
-
406
- const [edges, setEdges] = useState([
407
- { id: 'edge-1-2', source: 'node-1', target: 'node-2' },
408
- ]);
409
-
410
- return (
411
- <Flow
412
- nodes={nodes}
413
- edges={edges}
414
- onNodesChange={setNodes}
415
- onEdgesChange={setEdges}
416
- />
417
- );
418
- };
419
- ```
420
-
421
- For detailed documentation, see [Flow Component](./components/Flow.mdx).
422
-
423
- ### OKR
424
-
425
- A component for displaying and tracking Objectives and Key Results (OKRs). Provides a comprehensive view of progress, status, and ownership for strategic goals.
426
-
427
- **Example:**
428
- ```tsx
429
- import { OKR } from '@app-studio/web';
430
-
431
- const OKRExample = () => {
432
- const objectives = [
433
- {
434
- id: '1',
435
- title: 'Launch New Feature',
436
- description: 'Successfully launch the new feature to all users.',
437
- owner: 'John Doe',
438
- timeframe: 'Q4 2025',
439
- tags: ['new-feature', 'launch'],
440
- progress: 50,
441
- status: 'onTrack',
442
- keyResults: [
443
- {
444
- id: '1.1',
445
- title: 'Complete development',
446
- progress: 80,
447
- status: 'onTrack',
448
- },
449
- {
450
- id: '1.2',
451
- title: 'Complete QA testing',
452
- progress: 40,
453
- status: 'atRisk',
454
- },
455
- ],
456
- },
457
- ];
458
-
459
- return <OKR objectives={objectives} />;
460
- };
461
- ```
462
-
463
- For detailed documentation, see [OKR Component](./components/OKR.mdx).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-studio/web",
3
- "version": "0.9.44",
3
+ "version": "0.9.46",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/components/index.d.ts",
6
6
  "files": [
package/dist/bot/Bot.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { AiService } from './ai/ai.service';
2
- import { ProviderType } from './ai/ai.config';
3
- import { FileHandler } from './FileHandler';
4
- export declare class Bot {
5
- readonly aiService: AiService;
6
- readonly fileHandler: FileHandler;
7
- private readonly cache;
8
- private readonly cacheKey;
9
- constructor(cacheKey: string);
10
- generatePropsData(componentFolder: string, componentName: string, model?: string, provider?: ProviderType): Promise<any>;
11
- isValidPropsStructure(data: any): boolean;
12
- isObject(value: any): boolean;
13
- generateMarkdown(componentFolder: string, componentName: string, propsData: any, // Accept generated props data
14
- outputFilePath: string): Promise<void>;
15
- }
@@ -1,13 +0,0 @@
1
- export declare class Cache {
2
- private readonly cacheDirectory;
3
- constructor(cacheDirectory?: string);
4
- generateCacheKey(prompt: string): string;
5
- getFromCache(cacheKey: string): any | null;
6
- getJsonFromCache(cacheKey: string): any;
7
- saveJsonToCache(cacheKey: string, content: any): void;
8
- saveToCache(cacheKey: string, content: string): void;
9
- saveEachJsonToCache(cacheKey: string, content: any, fileNameKey: string): void;
10
- cacheExist(cacheKey: string): boolean;
11
- cacheFolderExist(cacheKey: string): boolean;
12
- createFile(cacheKey: string, fileContent?: string, fileName?: string): Promise<string>;
13
- }
@@ -1,13 +0,0 @@
1
- /**
2
- API_CONFIG : Un objet contenant les paramètres de configuration pour l'API OpenAI, tels que la clé API et l'organisation. Ces valeurs peuvent être définies directement ou récupérées à partir de variables d'environnement.
3
- APPLICATION_SETTINGS : Un objet pour les paramètres généraux de l'application. Vous pouvez inclure ici des configurations telles que le mode de débogage, les paramètres de journalisation, etc.
4
- */
5
- export declare const API_CONFIG: {
6
- openaiApiKey: string;
7
- openaiOrganization: string;
8
- defaultModel: string;
9
- };
10
- export declare const APPLICATION_SETTINGS: {
11
- debugMode: boolean;
12
- cacheDirectory: string;
13
- };
@@ -1,9 +0,0 @@
1
- export declare class ContentFetcher {
2
- private readonly cache;
3
- private readonly cacheKey;
4
- constructor(cacheKey: string);
5
- private static isLinkValid;
6
- private fetchAndProcessContent;
7
- processAllLinks(links: string[]): Promise<void>;
8
- private urlToMarkdown;
9
- }
@@ -1,19 +0,0 @@
1
- export declare class DocuCode {
2
- private readonly fileHandler;
3
- private readonly cache;
4
- private readonly cacheKey;
5
- private readonly aiService;
6
- private selectedModel;
7
- private selectedProvider;
8
- constructor(cacheKey: string, model?: string, provider?: string);
9
- commentCodeFile(filePath: string): Promise<void>;
10
- processComments(filePath: string, code: string, commentsJson: any): Promise<void>;
11
- removeCommentsAndCleanFile(filePath: string): Promise<void>;
12
- processDirectory(dirPath: string): Promise<any>;
13
- splitArrayToJSON(code: string): {
14
- line: number;
15
- code: string;
16
- }[];
17
- insertComments(code: string, comments: any[]): string;
18
- compareStrings(line: string, codeSnippet: string): boolean;
19
- }
@@ -1,39 +0,0 @@
1
- export declare class FileHandler {
2
- /**
3
- * Reads the content of a file as a string.
4
- * @param filePath Path to the file
5
- * @returns File content as a string
6
- */
7
- readFile(filePath: string): string;
8
- /**
9
- * Reads all filenames in a directory, creating the directory if it doesn't exist.
10
- * @param directory Directory path
11
- * @returns Array of filenames
12
- */
13
- readFiles(directory: string): string[];
14
- /**
15
- * Writes content to a file, creating the parent directory if it doesn't exist.
16
- * @param filePath Path to the file
17
- * @param content Content to write
18
- */
19
- writeFile(filePath: string, content: string): void;
20
- /**
21
- * Writes content to a file directly without checking or creating directories.
22
- * @param filePath Path to the file
23
- * @param content Content to write
24
- */
25
- writeFileDirect(filePath: string, content: string): void;
26
- /**
27
- * Checks if a file or directory exists.
28
- * @param filePath Path to check
29
- * @returns True if the path exists, false otherwise
30
- */
31
- pathExists(filePath: string): boolean;
32
- /**
33
- * Reads and parses a JSON file.
34
- * @param filePath Path to the JSON file
35
- * @returns Parsed JSON object
36
- * @throws Error if the file doesn't exist or contains invalid JSON
37
- */
38
- readJsonFile(filePath: string): any;
39
- }
@@ -1,6 +0,0 @@
1
- export declare class AnthropicConnector {
2
- private readonly apiKey;
3
- private readonly anthropic;
4
- constructor(apiKey: string);
5
- sendChatMessage(model: string, messages: any[], props?: {}): Promise<any>;
6
- }
@@ -1,7 +0,0 @@
1
- export declare class GeminiConnector {
2
- private readonly apiKey;
3
- private readonly googleAI;
4
- constructor(apiKey: string);
5
- sendChatMessage(GeminiModel: string, messages: any[], props?: {}, json?: boolean): Promise<string>;
6
- token(GeminiModel: string, prompt: string, props?: {}): Promise<number>;
7
- }
@@ -1,7 +0,0 @@
1
- export declare class GroqConnector {
2
- private readonly apiKey;
3
- private readonly groq;
4
- constructor(apiKey: string);
5
- sendChatMessage(model: string, messages: any[], props?: {}, json?: boolean): Promise<any>;
6
- token(messages: any[]): Promise<number>;
7
- }
@@ -1,6 +0,0 @@
1
- export declare class HuggingFaceConnector {
2
- private readonly apiKey;
3
- private readonly hf;
4
- constructor(apiKey: string);
5
- sendChatMessage(model: string, messages: any[], props?: {}): Promise<string | undefined>;
6
- }
@@ -1,11 +0,0 @@
1
- import { TiktokenModel } from 'tiktoken';
2
- export declare class OpenAIConnector {
3
- private readonly openai;
4
- constructor({ apiKey, baseURL, organization, }: {
5
- apiKey: string;
6
- organization?: string;
7
- baseURL?: string;
8
- });
9
- sendChatMessage(model: string, messages: any[], props?: {}, json?: boolean): Promise<any>;
10
- token(model: TiktokenModel, messages: any[]): Promise<any>;
11
- }
@@ -1,7 +0,0 @@
1
- export declare class ReplicateConnector {
2
- private readonly apiKey;
3
- private readonly replicate;
4
- constructor(apiKey: string);
5
- sendChatMessage(model: string, messages: any[], props?: {}): Promise<any>;
6
- removeBackground(image: string): Promise<any>;
7
- }
@@ -1,6 +0,0 @@
1
- export declare class SambaNovaConnector {
2
- private readonly apiKey;
3
- private readonly openai;
4
- constructor(apiKey: string);
5
- sendChatMessage(model: string, messages: any[], props?: {}, json?: boolean): Promise<any>;
6
- }
@@ -1,12 +0,0 @@
1
- export declare type ModelInfos = {
2
- creditCost: number;
3
- tokenLimit: number;
4
- cost?: {
5
- prompt_token: number;
6
- completion_token: number;
7
- };
8
- provider: string;
9
- };
10
- export declare type ProviderType = 'groq' | 'google' | 'openai' | 'huggingFace' | 'replicate' | 'openrouter' | 'anthropic' | 'deepseek' | 'mistralai' | 'sambaNova';
11
- export declare const Providers: ProviderType[];
12
- export declare const MODEL_INFO: Record<string, ModelInfos>;
@@ -1,36 +0,0 @@
1
- import { ProviderType } from './ai.config';
2
- import { OpenAIConnector } from './OpenAIConnector';
3
- import 'dotenv/config';
4
- export declare const DEFAULT_IMAGE_MODEL = "black-forest-labs/flux-schnell";
5
- export declare const MODEL_IMAGE_CREDIT_COST = 2;
6
- export declare class AiService {
7
- private models;
8
- private config;
9
- private readonly MAX_RETRIES;
10
- private readonly RETRY_DELAY;
11
- openRouter: OpenAIConnector;
12
- constructor();
13
- private addLanguageInstruction;
14
- getProvider(provider: ProviderType, useOpenRouter?: boolean): any;
15
- /**
16
- * Simple delay utility function.
17
- */
18
- private delay;
19
- /**
20
- * Enhanced send method with improved error handling and account verification.
21
- */
22
- send({ model, provider, temperature, messages, props, options, json, }: {
23
- model: string;
24
- provider: ProviderType;
25
- temperature?: Number;
26
- messages: any[];
27
- props?: {};
28
- options?: {
29
- retries?: number;
30
- language?: string;
31
- };
32
- json?: boolean;
33
- }): Promise<string>;
34
- token(model: string, provider: ProviderType, messages: any[] | string, props?: {}): Promise<string>;
35
- handleTokenLimitError(error: any): boolean;
36
- }
@@ -1,19 +0,0 @@
1
- export interface Sections {
2
- [sectionTitle: string]: Chapter[];
3
- }
4
- export interface Chapter {
5
- title: string;
6
- subchapters: Subchapter[];
7
- }
8
- export interface Subchapter {
9
- subtitle: string;
10
- minWordCount: number;
11
- maxWordCount: number;
12
- summary: string;
13
- points: string[];
14
- }
15
- export interface NewsletterSettings {
16
- language: string;
17
- tone: string;
18
- style: string;
19
- }
@@ -1,8 +0,0 @@
1
- /**
2
- extractJsonCode : Extrait un bloc de code JSON d'une réponse. Utile si la réponse contient des blocs de code formatés.
3
- extractTextResponse : Nettoie une réponse pour ne garder que le texte, en supprimant les blocs de code et les formattages spéciaux.
4
- extractKeyValuePairs : Extrait des paires clé-valeur d'une réponse. Cette fonction peut être utile pour traiter des réponses formatées comme des listes de propriétés.
5
- */
6
- export declare function extractJsonCode(response: string): any;
7
- export declare const extractTextResponse: (response: string) => string;
8
- export declare const extractKeyValuePairs: (response: string) => Record<string, string>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare const ProjectPrompt: () => string;
@@ -1 +0,0 @@
1
- export declare const RespondPrompt: (props: string, view: string, type?: string | undefined) => string;
@@ -1 +0,0 @@
1
- export declare const CommentPrompt: (componentName: string, fileName: string, codeContent: string) => string;