xertica-ui 1.0.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.
Files changed (141) hide show
  1. package/App.tsx +182 -0
  2. package/README.md +330 -0
  3. package/assets/xertica-logo.svg +38 -0
  4. package/assets/xertica-x-logo.svg +21 -0
  5. package/bin/cli.ts +193 -0
  6. package/components/AssistenteXertica.tsx +2003 -0
  7. package/components/AudioPlayer.tsx +203 -0
  8. package/components/CodeBlock.tsx +242 -0
  9. package/components/DocumentEditor.tsx +504 -0
  10. package/components/ForgotPasswordPage.tsx +170 -0
  11. package/components/FormattedDocument.tsx +87 -0
  12. package/components/HomeContent.tsx +123 -0
  13. package/components/HomePage.tsx +70 -0
  14. package/components/LanguageSelector.tsx +54 -0
  15. package/components/LoginPage.tsx +199 -0
  16. package/components/MarkdownMessage.tsx +62 -0
  17. package/components/ModernChatInput.tsx +502 -0
  18. package/components/PodcastPlayer.tsx +409 -0
  19. package/components/ResetPasswordPage.tsx +234 -0
  20. package/components/Sidebar.tsx +489 -0
  21. package/components/TemplateContent.tsx +629 -0
  22. package/components/TemplatePage.tsx +70 -0
  23. package/components/ThemeToggle.tsx +65 -0
  24. package/components/VerifyEmailPage.tsx +187 -0
  25. package/components/XerticaLogo.tsx +69 -0
  26. package/components/XerticaOrbe.tsx +1339 -0
  27. package/components/XerticaXLogo.tsx +53 -0
  28. package/components/examples/DrawingMapExample.tsx +530 -0
  29. package/components/examples/FilterableMapExample.tsx +380 -0
  30. package/components/examples/LocationPickerExample.tsx +330 -0
  31. package/components/examples/MapExamples.tsx +280 -0
  32. package/components/examples/MapShowcase.tsx +446 -0
  33. package/components/examples/RouteMapExamples.tsx +329 -0
  34. package/components/examples/SimpleFilterableMap.tsx +192 -0
  35. package/components/examples/index.ts +52 -0
  36. package/components/figma/ImageWithFallback.tsx +27 -0
  37. package/components/index.ts +44 -0
  38. package/components/media/AudioPlayer.tsx +278 -0
  39. package/components/media/FloatingMediaWrapper.tsx +166 -0
  40. package/components/media/VideoPlayer.tsx +285 -0
  41. package/components/ui/accordion.tsx +66 -0
  42. package/components/ui/alert-dialog.tsx +159 -0
  43. package/components/ui/alert.tsx +91 -0
  44. package/components/ui/aspect-ratio.tsx +11 -0
  45. package/components/ui/avatar.tsx +65 -0
  46. package/components/ui/badge.tsx +55 -0
  47. package/components/ui/breadcrumb.tsx +109 -0
  48. package/components/ui/button.tsx +78 -0
  49. package/components/ui/calendar.tsx +235 -0
  50. package/components/ui/card.tsx +92 -0
  51. package/components/ui/carousel.tsx +241 -0
  52. package/components/ui/chart.tsx +353 -0
  53. package/components/ui/checkbox.tsx +32 -0
  54. package/components/ui/collapsible.tsx +33 -0
  55. package/components/ui/command.tsx +177 -0
  56. package/components/ui/context-menu.tsx +252 -0
  57. package/components/ui/dialog.tsx +138 -0
  58. package/components/ui/drawer.tsx +134 -0
  59. package/components/ui/dropdown-menu.tsx +257 -0
  60. package/components/ui/empty.tsx +90 -0
  61. package/components/ui/file-upload.tsx +152 -0
  62. package/components/ui/form.tsx +195 -0
  63. package/components/ui/google-maps-loader.tsx +379 -0
  64. package/components/ui/hover-card.tsx +44 -0
  65. package/components/ui/index.ts +242 -0
  66. package/components/ui/input-otp.tsx +77 -0
  67. package/components/ui/input.tsx +38 -0
  68. package/components/ui/label.tsx +24 -0
  69. package/components/ui/map-config.ts +12 -0
  70. package/components/ui/map-layers.tsx +129 -0
  71. package/components/ui/map.exports.ts +31 -0
  72. package/components/ui/map.tsx +412 -0
  73. package/components/ui/menubar.tsx +276 -0
  74. package/components/ui/navigation-menu.tsx +162 -0
  75. package/components/ui/notification-badge.tsx +61 -0
  76. package/components/ui/page-header.tsx +229 -0
  77. package/components/ui/pagination.tsx +127 -0
  78. package/components/ui/popover.tsx +48 -0
  79. package/components/ui/progress.tsx +31 -0
  80. package/components/ui/radio-group.tsx +56 -0
  81. package/components/ui/rating.tsx +102 -0
  82. package/components/ui/resizable.tsx +405 -0
  83. package/components/ui/route-map.tsx +246 -0
  84. package/components/ui/scroll-area.tsx +58 -0
  85. package/components/ui/search.tsx +70 -0
  86. package/components/ui/select.tsx +176 -0
  87. package/components/ui/separator.tsx +28 -0
  88. package/components/ui/sheet.tsx +138 -0
  89. package/components/ui/sidebar.tsx +726 -0
  90. package/components/ui/simple-map.tsx +92 -0
  91. package/components/ui/skeleton.tsx +13 -0
  92. package/components/ui/slider.tsx +58 -0
  93. package/components/ui/sonner.tsx +77 -0
  94. package/components/ui/stats-card.tsx +84 -0
  95. package/components/ui/stepper.tsx +126 -0
  96. package/components/ui/switch.tsx +34 -0
  97. package/components/ui/table.tsx +116 -0
  98. package/components/ui/tabs.tsx +66 -0
  99. package/components/ui/textarea.tsx +26 -0
  100. package/components/ui/timeline.tsx +140 -0
  101. package/components/ui/toggle-group.tsx +71 -0
  102. package/components/ui/toggle.tsx +46 -0
  103. package/components/ui/tooltip.tsx +61 -0
  104. package/components/ui/tree-view.tsx +123 -0
  105. package/components/ui/use-mobile.ts +24 -0
  106. package/components/ui/utils.ts +6 -0
  107. package/components/ui/xertica-assistant.tsx +1420 -0
  108. package/contexts/ApiKeyContext.tsx +123 -0
  109. package/contexts/AssistenteContext.tsx +118 -0
  110. package/contexts/BrandColorsContext.tsx +551 -0
  111. package/contexts/LanguageContext.tsx +36 -0
  112. package/contexts/ThemeContext.tsx +85 -0
  113. package/dist/cli.js +20922 -0
  114. package/eslint.config.js +41 -0
  115. package/guidelines/Guidelines.md +61 -0
  116. package/hooks/useTheme.ts +4 -0
  117. package/imports/Podcast.tsx +389 -0
  118. package/imports/XerticaAi.tsx +46 -0
  119. package/imports/XerticaX.tsx +20 -0
  120. package/imports/svg-aueiaqngck.ts +11 -0
  121. package/imports/svg-v9krss1ozd.ts +16 -0
  122. package/imports/svg-vhrdofe3qe.ts +5 -0
  123. package/index.css +4448 -0
  124. package/index.html +14 -0
  125. package/main.tsx +10 -0
  126. package/package.json +119 -0
  127. package/postcss.config.js +6 -0
  128. package/routes.tsx +33 -0
  129. package/styles/globals.css +15 -0
  130. package/styles/xertica/app-overrides/chat.css +61 -0
  131. package/styles/xertica/app-overrides/scrollbar.css +33 -0
  132. package/styles/xertica/base.css +70 -0
  133. package/styles/xertica/integrations/google-maps.css +76 -0
  134. package/styles/xertica/integrations/sonner.css +73 -0
  135. package/styles/xertica/theme-map.css +88 -0
  136. package/styles/xertica/tokens.css +190 -0
  137. package/tsconfig.json +31 -0
  138. package/tsconfig.node.json +10 -0
  139. package/utils/gemini.ts +140 -0
  140. package/vite-env.d.ts +12 -0
  141. package/vite.config.ts +36 -0
package/bin/cli.ts ADDED
@@ -0,0 +1,193 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ import prompts from 'prompts';
4
+ import chalk from 'chalk';
5
+ import ora from 'ora';
6
+ import fs from 'fs-extra';
7
+ import path from 'path';
8
+ import { fileURLToPath } from 'url';
9
+ import { execa } from 'execa';
10
+
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
13
+
14
+ const program = new Command();
15
+
16
+ program
17
+ .name('xertica-ui')
18
+ .description('CLI to initialize Xertica UI projects')
19
+ .version('1.0.0');
20
+
21
+ program
22
+ .command('init')
23
+ .description('Initialize a new Xertica UI project')
24
+ .argument('[directory]', 'Directory to initialize in', '.')
25
+ .action(async (directory) => {
26
+ const targetDir = path.resolve(process.cwd(), directory);
27
+ const sourceRoot = path.resolve(__dirname, '../');
28
+
29
+ // Scan for components
30
+ const uiComponentsDir = path.join(sourceRoot, 'components/ui');
31
+ let componentChoices = [{ title: 'All Components', value: 'all', selected: true }];
32
+
33
+ if (await fs.pathExists(uiComponentsDir)) {
34
+ const files = await fs.readdir(uiComponentsDir);
35
+ const components = files
36
+ .filter(f => f.endsWith('.tsx') && !f.startsWith('index'))
37
+ .map(f => ({ title: f.replace('.tsx', ''), value: f }));
38
+
39
+ componentChoices = [
40
+ { title: 'All Components', value: 'all', selected: true },
41
+ ...components
42
+ ];
43
+ }
44
+
45
+ console.log(chalk.blue('🚀 Welcome to Xertica UI CLI!'));
46
+
47
+ const response = await prompts([
48
+ {
49
+ type: 'multiselect',
50
+ name: 'components',
51
+ message: 'Which components would you like to include?',
52
+ choices: componentChoices,
53
+ hint: '- Space to select. Return to submit',
54
+ min: 1
55
+ },
56
+ {
57
+ type: 'multiselect',
58
+ name: 'pages',
59
+ message: 'Which pages/templates to include?',
60
+ choices: [
61
+ { title: 'Login Page', value: 'login', selected: true },
62
+ { title: 'Home Page', value: 'home', selected: true },
63
+ { title: 'Template Page', value: 'template', selected: true },
64
+ ]
65
+ },
66
+ {
67
+ type: 'confirm',
68
+ name: 'install',
69
+ message: 'Install dependencies automatically?',
70
+ initial: true
71
+ }
72
+ ]);
73
+
74
+ if (!response.components) return;
75
+
76
+ const spinner = ora('Initializing project...').start();
77
+
78
+ try {
79
+ // 1. Create Target Directory
80
+ await fs.ensureDir(targetDir);
81
+
82
+ // 2. Copy Base Files
83
+ const foldersToCopy = ['components', 'contexts', 'styles', 'hooks', 'assets', 'imports', 'utils', 'guidelines'];
84
+ const filesToCopy = [
85
+ 'package.json', 'tsconfig.json', 'tsconfig.node.json', 'vite.config.ts',
86
+ 'index.html', 'routes.tsx', 'main.tsx', 'postcss.config.js',
87
+ 'vite-env.d.ts', 'index.css', 'eslint.config.js'
88
+ ];
89
+ // Note: App.tsx is handled separately
90
+
91
+ for (const file of filesToCopy) {
92
+ const srcPath = path.join(sourceRoot, file);
93
+ const destPath = path.join(targetDir, file);
94
+ if (await fs.pathExists(srcPath)) {
95
+ await fs.copy(srcPath, destPath);
96
+ }
97
+ }
98
+
99
+ // Handle App.tsx specifically
100
+ const pages = response.pages || [];
101
+ const hasLogin = pages.includes('login');
102
+ const hasHome = pages.includes('home');
103
+ const hasTemplate = pages.includes('template');
104
+ const hasAllPages = hasLogin && hasHome && hasTemplate;
105
+
106
+ if (hasAllPages) {
107
+ if (await fs.pathExists(path.join(sourceRoot, 'App.tsx'))) {
108
+ await fs.copy(path.join(sourceRoot, 'App.tsx'), path.join(targetDir, 'App.tsx'));
109
+ }
110
+ } else {
111
+ // Minimal App.tsx
112
+ const minimalApp = `import React from 'react';
113
+ import { Toaster } from './components/ui/sonner';
114
+
115
+ export default function App() {
116
+ return (
117
+ <div className="min-h-screen bg-white p-8">
118
+ <h1 className="text-3xl font-bold mb-4">Welcome to Xertica UI</h1>
119
+ <p>Start building your app by editing App.tsx</p>
120
+ <Toaster />
121
+ </div>
122
+ );
123
+ }
124
+ `;
125
+ await fs.writeFile(path.join(targetDir, 'App.tsx'), minimalApp);
126
+ }
127
+
128
+ // Copy folders with filter
129
+ const selectedComponents = response.components;
130
+ const copyAllComponents = selectedComponents.includes('all');
131
+
132
+ for (const folder of foldersToCopy) {
133
+ const srcPath = path.join(sourceRoot, folder);
134
+ if (await fs.pathExists(srcPath)) {
135
+ await fs.copy(srcPath, path.join(targetDir, folder), {
136
+ filter: (src) => {
137
+ const basename = path.basename(src);
138
+ if (basename === 'node_modules') return false;
139
+
140
+ // Component filtering
141
+ // src is absolute. We need relative validation.
142
+ // Or just check if basename is in the list.
143
+ // Warning: 'button.tsx' might be in other places? Unlikely in flat structure components/ui
144
+ // Ideally we check if it is inside components/ui
145
+ const isUI = src.includes(path.join('components', 'ui')); // Simple check
146
+
147
+ if (isUI && folder === 'components') {
148
+ if (basename === 'index.ts') return true;
149
+ if (copyAllComponents) return true;
150
+
151
+ // If it's a file
152
+ if (path.extname(basename) === '.tsx') {
153
+ if (!selectedComponents.includes(basename)) return false;
154
+ }
155
+ }
156
+
157
+ // Page filtering (in components root)
158
+ const isComponentsRoot = src.endsWith('components') || path.dirname(src).endsWith('components');
159
+ if (isComponentsRoot && folder === 'components') {
160
+ if (!hasLogin && basename === 'LoginPage.tsx') return false;
161
+ if (!hasLogin && basename === 'ForgotPasswordPage.tsx') return false;
162
+ if (!hasLogin && basename === 'VerifyEmailPage.tsx') return false;
163
+ if (!hasLogin && basename === 'ResetPasswordPage.tsx') return false;
164
+
165
+ if (!hasHome && basename === 'HomePage.tsx') return false;
166
+ if (!hasTemplate && basename === 'TemplatePage.tsx') return false;
167
+ }
168
+
169
+ return true;
170
+ }
171
+ });
172
+ }
173
+ }
174
+
175
+ spinner.succeed('Project initialized successfully!');
176
+
177
+ if (response.install) {
178
+ const installSpinner = ora('Installing dependencies...').start();
179
+ await execa('npm', ['install'], { cwd: targetDir });
180
+ installSpinner.succeed('Dependencies installed!');
181
+ }
182
+
183
+ console.log(chalk.green('\nDone! Now run:'));
184
+ console.log(chalk.cyan(` cd ${directory}`));
185
+ console.log(chalk.cyan(' npm run dev'));
186
+
187
+ } catch (error) {
188
+ spinner.fail('Failed to initialize project');
189
+ console.error(error);
190
+ }
191
+ });
192
+
193
+ program.parse();