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.
- package/App.tsx +182 -0
- package/README.md +330 -0
- package/assets/xertica-logo.svg +38 -0
- package/assets/xertica-x-logo.svg +21 -0
- package/bin/cli.ts +193 -0
- package/components/AssistenteXertica.tsx +2003 -0
- package/components/AudioPlayer.tsx +203 -0
- package/components/CodeBlock.tsx +242 -0
- package/components/DocumentEditor.tsx +504 -0
- package/components/ForgotPasswordPage.tsx +170 -0
- package/components/FormattedDocument.tsx +87 -0
- package/components/HomeContent.tsx +123 -0
- package/components/HomePage.tsx +70 -0
- package/components/LanguageSelector.tsx +54 -0
- package/components/LoginPage.tsx +199 -0
- package/components/MarkdownMessage.tsx +62 -0
- package/components/ModernChatInput.tsx +502 -0
- package/components/PodcastPlayer.tsx +409 -0
- package/components/ResetPasswordPage.tsx +234 -0
- package/components/Sidebar.tsx +489 -0
- package/components/TemplateContent.tsx +629 -0
- package/components/TemplatePage.tsx +70 -0
- package/components/ThemeToggle.tsx +65 -0
- package/components/VerifyEmailPage.tsx +187 -0
- package/components/XerticaLogo.tsx +69 -0
- package/components/XerticaOrbe.tsx +1339 -0
- package/components/XerticaXLogo.tsx +53 -0
- package/components/examples/DrawingMapExample.tsx +530 -0
- package/components/examples/FilterableMapExample.tsx +380 -0
- package/components/examples/LocationPickerExample.tsx +330 -0
- package/components/examples/MapExamples.tsx +280 -0
- package/components/examples/MapShowcase.tsx +446 -0
- package/components/examples/RouteMapExamples.tsx +329 -0
- package/components/examples/SimpleFilterableMap.tsx +192 -0
- package/components/examples/index.ts +52 -0
- package/components/figma/ImageWithFallback.tsx +27 -0
- package/components/index.ts +44 -0
- package/components/media/AudioPlayer.tsx +278 -0
- package/components/media/FloatingMediaWrapper.tsx +166 -0
- package/components/media/VideoPlayer.tsx +285 -0
- package/components/ui/accordion.tsx +66 -0
- package/components/ui/alert-dialog.tsx +159 -0
- package/components/ui/alert.tsx +91 -0
- package/components/ui/aspect-ratio.tsx +11 -0
- package/components/ui/avatar.tsx +65 -0
- package/components/ui/badge.tsx +55 -0
- package/components/ui/breadcrumb.tsx +109 -0
- package/components/ui/button.tsx +78 -0
- package/components/ui/calendar.tsx +235 -0
- package/components/ui/card.tsx +92 -0
- package/components/ui/carousel.tsx +241 -0
- package/components/ui/chart.tsx +353 -0
- package/components/ui/checkbox.tsx +32 -0
- package/components/ui/collapsible.tsx +33 -0
- package/components/ui/command.tsx +177 -0
- package/components/ui/context-menu.tsx +252 -0
- package/components/ui/dialog.tsx +138 -0
- package/components/ui/drawer.tsx +134 -0
- package/components/ui/dropdown-menu.tsx +257 -0
- package/components/ui/empty.tsx +90 -0
- package/components/ui/file-upload.tsx +152 -0
- package/components/ui/form.tsx +195 -0
- package/components/ui/google-maps-loader.tsx +379 -0
- package/components/ui/hover-card.tsx +44 -0
- package/components/ui/index.ts +242 -0
- package/components/ui/input-otp.tsx +77 -0
- package/components/ui/input.tsx +38 -0
- package/components/ui/label.tsx +24 -0
- package/components/ui/map-config.ts +12 -0
- package/components/ui/map-layers.tsx +129 -0
- package/components/ui/map.exports.ts +31 -0
- package/components/ui/map.tsx +412 -0
- package/components/ui/menubar.tsx +276 -0
- package/components/ui/navigation-menu.tsx +162 -0
- package/components/ui/notification-badge.tsx +61 -0
- package/components/ui/page-header.tsx +229 -0
- package/components/ui/pagination.tsx +127 -0
- package/components/ui/popover.tsx +48 -0
- package/components/ui/progress.tsx +31 -0
- package/components/ui/radio-group.tsx +56 -0
- package/components/ui/rating.tsx +102 -0
- package/components/ui/resizable.tsx +405 -0
- package/components/ui/route-map.tsx +246 -0
- package/components/ui/scroll-area.tsx +58 -0
- package/components/ui/search.tsx +70 -0
- package/components/ui/select.tsx +176 -0
- package/components/ui/separator.tsx +28 -0
- package/components/ui/sheet.tsx +138 -0
- package/components/ui/sidebar.tsx +726 -0
- package/components/ui/simple-map.tsx +92 -0
- package/components/ui/skeleton.tsx +13 -0
- package/components/ui/slider.tsx +58 -0
- package/components/ui/sonner.tsx +77 -0
- package/components/ui/stats-card.tsx +84 -0
- package/components/ui/stepper.tsx +126 -0
- package/components/ui/switch.tsx +34 -0
- package/components/ui/table.tsx +116 -0
- package/components/ui/tabs.tsx +66 -0
- package/components/ui/textarea.tsx +26 -0
- package/components/ui/timeline.tsx +140 -0
- package/components/ui/toggle-group.tsx +71 -0
- package/components/ui/toggle.tsx +46 -0
- package/components/ui/tooltip.tsx +61 -0
- package/components/ui/tree-view.tsx +123 -0
- package/components/ui/use-mobile.ts +24 -0
- package/components/ui/utils.ts +6 -0
- package/components/ui/xertica-assistant.tsx +1420 -0
- package/contexts/ApiKeyContext.tsx +123 -0
- package/contexts/AssistenteContext.tsx +118 -0
- package/contexts/BrandColorsContext.tsx +551 -0
- package/contexts/LanguageContext.tsx +36 -0
- package/contexts/ThemeContext.tsx +85 -0
- package/dist/cli.js +20922 -0
- package/eslint.config.js +41 -0
- package/guidelines/Guidelines.md +61 -0
- package/hooks/useTheme.ts +4 -0
- package/imports/Podcast.tsx +389 -0
- package/imports/XerticaAi.tsx +46 -0
- package/imports/XerticaX.tsx +20 -0
- package/imports/svg-aueiaqngck.ts +11 -0
- package/imports/svg-v9krss1ozd.ts +16 -0
- package/imports/svg-vhrdofe3qe.ts +5 -0
- package/index.css +4448 -0
- package/index.html +14 -0
- package/main.tsx +10 -0
- package/package.json +119 -0
- package/postcss.config.js +6 -0
- package/routes.tsx +33 -0
- package/styles/globals.css +15 -0
- package/styles/xertica/app-overrides/chat.css +61 -0
- package/styles/xertica/app-overrides/scrollbar.css +33 -0
- package/styles/xertica/base.css +70 -0
- package/styles/xertica/integrations/google-maps.css +76 -0
- package/styles/xertica/integrations/sonner.css +73 -0
- package/styles/xertica/theme-map.css +88 -0
- package/styles/xertica/tokens.css +190 -0
- package/tsconfig.json +31 -0
- package/tsconfig.node.json +10 -0
- package/utils/gemini.ts +140 -0
- package/vite-env.d.ts +12 -0
- 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();
|