@dasidev/dasi-ui 1.0.2 → 1.0.6

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.
@@ -0,0 +1,191 @@
1
+ #!/usr/bin/env node
2
+ const { program } = require('commander');
3
+ const inquirer = require('inquirer');
4
+ const fs = require('fs-extra');
5
+ const path = require('path');
6
+ const chalk = require('chalk');
7
+ const ora = require('ora');
8
+
9
+ program
10
+ .name('dasi-ui')
11
+ .description('DASI UI - Complete Admin Template Setup')
12
+ .version('1.0.6');
13
+
14
+ program
15
+ .command('init')
16
+ .description('Initialize DASI UI admin template')
17
+ .action(async () => {
18
+ console.log(chalk.blue.bold('🚀 Welcome to DASI UI Admin Template Setup'));
19
+ console.log(chalk.gray('This will set up a complete admin dashboard in your current directory\n'));
20
+
21
+ const questions = [
22
+ {
23
+ type: 'input',
24
+ name: 'projectName',
25
+ message: '📦 Project name:',
26
+ default: 'my-admin-app',
27
+ validate: (input) => input.length > 0 || 'Project name is required'
28
+ },
29
+ {
30
+ type: 'input',
31
+ name: 'appTitle',
32
+ message: '📱 App title:',
33
+ default: 'DASI Admin Dashboard'
34
+ },
35
+ {
36
+ type: 'input',
37
+ name: 'appDescription',
38
+ message: '📝 App description:',
39
+ default: 'Complete admin dashboard built with DASI UI'
40
+ },
41
+ {
42
+ type: 'input',
43
+ name: 'author',
44
+ message: '👤 Author name:',
45
+ default: 'DASI Developer'
46
+ },
47
+ {
48
+ type: 'list',
49
+ name: 'packageManager',
50
+ message: '📦 Choose package manager:',
51
+ choices: ['npm', 'yarn', 'pnpm'],
52
+ default: 'npm'
53
+ },
54
+ {
55
+ type: 'input',
56
+ name: 'apiUrl',
57
+ message: '🔗 API base URL:',
58
+ default: 'http://localhost:8080/api'
59
+ },
60
+ {
61
+ type: 'confirm',
62
+ name: 'darkMode',
63
+ message: '🌙 Enable dark mode?',
64
+ default: true
65
+ },
66
+ {
67
+ type: 'confirm',
68
+ name: 'includeAuth',
69
+ message: '🔐 Include authentication module?',
70
+ default: true
71
+ },
72
+ {
73
+ type: 'confirm',
74
+ name: 'includeCharts',
75
+ message: '📊 Include chart components?',
76
+ default: true
77
+ },
78
+ {
79
+ type: 'confirm',
80
+ name: 'includeMaps',
81
+ message: '🗺️ Include map components?',
82
+ default: false
83
+ },
84
+ {
85
+ type: 'confirm',
86
+ name: 'gitInit',
87
+ message: '📚 Initialize git repository?',
88
+ default: true
89
+ },
90
+ {
91
+ type: 'confirm',
92
+ name: 'installDeps',
93
+ message: '📥 Install dependencies now?',
94
+ default: true
95
+ }
96
+ ];
97
+
98
+ const answers = await inquirer.prompt(questions);
99
+ const spinner = ora('Setting up DASI UI Admin Template...').start();
100
+
101
+ try {
102
+ const currentPath = process.cwd();
103
+ const templatePath = path.join(__dirname, '../');
104
+
105
+ await fs.copy(templatePath, currentPath, {
106
+ filter: (src) => {
107
+ return !src.includes('node_modules') &&
108
+ !src.includes('dist') &&
109
+ !src.includes('.git') &&
110
+ !src.includes('package-lock.json') &&
111
+ !src.includes('yarn.lock');
112
+ }
113
+ });
114
+
115
+ spinner.text = '⚙️ Updating configuration...';
116
+ const packageJsonPath = path.join(currentPath, 'package.json');
117
+ let packageJson = await fs.readJson(packageJsonPath);
118
+
119
+ packageJson.name = answers.projectName;
120
+ packageJson.description = answers.appDescription;
121
+ packageJson.author = answers.author;
122
+ packageJson.version = '0.1.0';
123
+
124
+ const envContent = `VITE_APP_TITLE=${answers.appTitle}
125
+ VITE_APP_DESCRIPTION=${answers.appDescription}
126
+ VITE_APP_AUTHOR=${answers.author}
127
+ VITE_API_URL=${answers.apiUrl}
128
+ VITE_DARK_MODE=${answers.darkMode}
129
+ VITE_INCLUDE_AUTH=${answers.includeAuth}
130
+ VITE_INCLUDE_CHARTS=${answers.includeCharts}
131
+ VITE_INCLUDE_MAPS=${answers.includeMaps}`;
132
+
133
+ await fs.writeFile(path.join(currentPath, '.env.example'), envContent);
134
+ await fs.copyFile(path.join(currentPath, '.env.example'), path.join(currentPath, '.env'));
135
+
136
+ await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 });
137
+
138
+ if (answers.gitInit) {
139
+ spinner.text = '📚 Initializing git repository...';
140
+ try {
141
+ const { execSync } = require('child_process');
142
+ execSync('git init', { stdio: 'ignore' });
143
+ execSync('git add .', { stdio: 'ignore' });
144
+ execSync('git commit -m "Initial commit: DASI UI Admin Template"', { stdio: 'ignore' });
145
+ } catch (error) {
146
+ console.log(chalk.yellow('⚠️ Git initialization failed, continuing...'));
147
+ }
148
+ }
149
+
150
+ if (answers.installDeps) {
151
+ spinner.text = '📦 Installing dependencies...';
152
+ try {
153
+ const { execSync } = require('child_process');
154
+ execSync(`${answers.packageManager} install`, { stdio: 'pipe' });
155
+ } catch (error) {
156
+ spinner.warn('⚠️ Dependencies installation failed');
157
+ console.log(chalk.yellow(`Please run manually: ${answers.packageManager} install`));
158
+ }
159
+ }
160
+
161
+ spinner.succeed('✅ DASI UI Admin Template setup completed!');
162
+
163
+ console.log(chalk.green('\n🎉 Setup Complete! Your admin dashboard is ready.'));
164
+ console.log(chalk.green('\n📋 What you get:'));
165
+ console.log(chalk.white(' • Complete admin dashboard'));
166
+ console.log(chalk.white(' • Authentication system' + (answers.includeAuth ? ' ✅' : ' ❌')));
167
+ console.log(chalk.white(' • Chart components' + (answers.includeCharts ? ' ✅' : ' ❌')));
168
+ console.log(chalk.white(' • Map components' + (answers.includeMaps ? ' ✅' : ' ❌')));
169
+ console.log(chalk.white(' • Dark mode' + (answers.darkMode ? ' ✅' : ' ❌')));
170
+ console.log(chalk.white(' • TypeScript support'));
171
+ console.log(chalk.white(' • Tailwind CSS styling'));
172
+ console.log(chalk.white(' • Vue 3 + Pinia + Vue Router'));
173
+
174
+ console.log(chalk.green('\n🚀 Next steps:'));
175
+ console.log(chalk.white(` ${answers.packageManager} run dev`));
176
+ console.log(chalk.gray(' Open http://localhost:3000 to view your admin dashboard'));
177
+
178
+ console.log(chalk.green('\n📚 Documentation:'));
179
+ console.log(chalk.white(' • README.md for detailed setup'));
180
+ console.log(chalk.white(' • src/ folder for all components'));
181
+ console.log(chalk.white(' • .env file for configuration'));
182
+
183
+ } catch (error) {
184
+ spinner.fail('❌ Setup failed!');
185
+ console.error(chalk.red('Error Details:'));
186
+ console.error(chalk.red(error.message));
187
+ process.exit(1);
188
+ }
189
+ });
190
+
191
+ program.parse();
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  const { program } = require('commander');
2
3
  const inquirer = require('inquirer');
3
4
  const fs = require('fs-extra');
@@ -9,7 +10,7 @@ const { execSync } = require('child_process');
9
10
  program
10
11
  .name('dasi-ui')
11
12
  .description('DASI UI - Create admin dashboard projects')
12
- .version('1.0.0')
13
+ .version('1.0.4')
13
14
 
14
15
  program
15
16
  .command('create <project-name>')
@@ -76,12 +77,6 @@ program
76
77
  message: 'Include chart components?',
77
78
  default: true
78
79
  },
79
- {
80
- type: 'confirm',
81
- name: 'includeMaps',
82
- message: 'Include map components?',
83
- default: false
84
- },
85
80
  {
86
81
  type: 'confirm',
87
82
  name: 'includeForms',
@@ -127,8 +122,8 @@ program
127
122
 
128
123
  await fs.ensureDir(path.join(projectPath, 'src'));
129
124
  await fs.ensureDir(path.join(projectPath, 'public'));
130
- // const templatePath = path.join(__dirname, '../templates', answers.template);
131
- // await fs.copy(templatePath, projectPath);
125
+ const templatePath = path.join(__dirname, '../templates', answers.template);
126
+ await fs.copy(templatePath, projectPath);
132
127
 
133
128
  const packagejson = {
134
129
  name: projectName,
@@ -143,7 +138,7 @@ program
143
138
  preview: "vite preview"
144
139
  },
145
140
  dependencies: {
146
- "@dasidev/dasi-ui": "^1.0.1",
141
+ "@dasidev/dasi-ui": "^1.0.4",
147
142
  "vue": "^3.4.0",
148
143
  "vue-router": "^4.2.0",
149
144
  "pinia": "^2.1.0"
@@ -230,7 +225,15 @@ program
230
225
 
231
226
  if (options.install) {
232
227
  spinner.text = 'Installing dependencies...';
233
- execSync(`${answers.packageManager} install`, { cwd: projectPath, stdio: 'ignore' });
228
+ try {
229
+ execSync(`${answers.packageManager} install`, { cwd: projectPath, stdio: 'ignore' });
230
+ } catch (error) {
231
+ spinner.fail('Dependencies installation failed. Please install manually.');
232
+ console.error(chalk.red('Error Details:'));
233
+ console.error(chalk.red(error.message));
234
+ console.error(chalk.red(error.stack));
235
+ process.exit(1);
236
+ }
234
237
  }
235
238
 
236
239
  spinner.succeed(`Project ${projectName} created successfully!`);
@@ -253,3 +256,5 @@ program
253
256
  }
254
257
 
255
258
  })
259
+
260
+ program.parse();
package/index.html ADDED
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <link rel="icon" href="/favicon.ico">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+
8
+ <link rel="preconnect" href="https://fonts.googleapis.com">
9
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
+ <link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
11
+
12
+ <title>Framework Web</title>
13
+ </head>
14
+ <body>
15
+ <div id="app"></div>
16
+ <script type="module" src="/src/main.ts"></script>
17
+ </body>
18
+ </html>
package/package.json CHANGED
@@ -1,16 +1,21 @@
1
1
  {
2
2
  "name": "@dasidev/dasi-ui",
3
- "version": "1.0.2",
3
+ "version": "1.0.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.es.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "files": [
10
- "dist",
11
- "src",
12
- "README.md",
10
+ "src/**/*",
11
+ "public/**/*",
12
+ "index.html",
13
+ "vite.config.ts",
14
+ "tailwind.config.js",
15
+ "postcss.config.js",
16
+ "tsconfig.json",
13
17
  "package.json",
18
+ "README.md",
14
19
  "bin"
15
20
  ],
16
21
  "exports": {
@@ -54,9 +59,10 @@
54
59
  },
55
60
  "scripts": {
56
61
  "dev": "vite",
57
- "build": "run-p type-check \"build-only {@}\" --",
62
+ "build": "vite build",
58
63
  "build-lib": "vite build --config vite.lib.config.ts",
59
64
  "build-docs": "vite build --config vite.docs.config.ts",
65
+ "release": "npm version patch && npm publish --access public",
60
66
  "preview": "vite preview",
61
67
  "test": "vitest",
62
68
  "test:unit": "vitest",
@@ -70,7 +76,6 @@
70
76
  "format": "prettier --write \"src/**/*.{vue,js,ts,jsx,tsx,json,md}\"",
71
77
  "cli": "node bin/dasi-cli.cjs",
72
78
  "prepublishOnly": "npm run build-lib && npm run test:run",
73
- "release": "npm version patch && npm publish",
74
79
  "release:minor": "npm version minor && npm publish",
75
80
  "release:major": "npm version major && npm publish"
76
81
  },
@@ -92,7 +97,7 @@
92
97
  "@vuepic/vue-datepicker": "^8.8.1",
93
98
  "@vueuse/core": "^10.9.0",
94
99
  "axios": "^1.6.0",
95
- "chalk": "^5.6.2",
100
+ "chalk": "^4.1.2",
96
101
  "chart.js": "^4.4.2",
97
102
  "class-variance-authority": "^0.7.0",
98
103
  "clsx": "^2.1.0",
@@ -107,7 +112,7 @@
107
112
  "fs-extra": "^11.3.3",
108
113
  "go-captcha-vue": "^2.0.6",
109
114
  "highlight.js": "^11.9.0",
110
- "inquirer": "^13.2.1",
115
+ "inquirer": "^8.2.7",
111
116
  "jspdf": "^3.0.2",
112
117
  "jspdf-autotable": "^5.0.2",
113
118
  "lucide-vue-next": "^0.542.0",
@@ -117,7 +122,7 @@
117
122
  "ol": "^9.2.4",
118
123
  "ol-contextmenu": "^5.5.0",
119
124
  "ol-ext": "^4.0.21",
120
- "ora": "^9.1.0",
125
+ "ora": "^5.4.1",
121
126
  "pdfjs-dist": "^5.3.31",
122
127
  "peerjs": "^1.5.2",
123
128
  "pinia": "^2.1.0",
File without changes
@@ -0,0 +1,137 @@
1
+ const animate = require("tailwindcss-animate");
2
+
3
+ /** @type {import('tailwindcss').Config} */
4
+ module.exports = {
5
+ darkMode: "class",
6
+ content: [
7
+ "./pages/**/*.{ts,tsx,vue}",
8
+ "./components/**/*.{ts,tsx,vue}",
9
+ "./app/**/*.{ts,tsx,vue}",
10
+ "./src/**/*.{ts,tsx,vue}",
11
+ "./vueform.config.js",
12
+ "./node_modules/@vueform/vueform/themes/tailwind/**/*.vue",
13
+ "./node_modules/@vueform/vueform/themes/tailwind/**/*.js",
14
+ ],
15
+ theme: {
16
+ container: {
17
+ center: true,
18
+ padding: "2rem",
19
+ screens: {
20
+ "2xl": "1400px"
21
+ }
22
+ },
23
+ extend: {
24
+ fontFamily: {
25
+ sans: ["Inter", "sans-serif"]
26
+ },
27
+ ringColor: {
28
+ ring: "#2671D9"
29
+ },
30
+ transitionDuration: {
31
+ DEFAULT: "300ms"
32
+ },
33
+ colors: {
34
+ // Framework primary colors (based on dasi-web-app but generalized)
35
+ primary_main: "#2671D9",
36
+ primary_hover: "#297df0",
37
+ bg_main: "#f6fafd",
38
+ hover_main: "#e8f1fb",
39
+ active_main: "#e8f1fb",
40
+ text_main: "#4D5E80",
41
+
42
+ // Dark mode colors
43
+ dark_bg: '#0a0a0a',
44
+ dark_bg_transparent: '#0a0a0a11',
45
+ dark_bg2: '#111',
46
+ dark_bg3: '#151515',
47
+ dark_bg3a: '#1a1a1a',
48
+ dark_bg4: '#222',
49
+ dark_bg5: '#252525',
50
+ dark_bg6: '#333',
51
+ dark_bg7: '#353535',
52
+ dark_bg8: '#444',
53
+ dark_border: '#151515',
54
+ dark_border2: '#222',
55
+ dark_border3: '#252525',
56
+ dark_border4: '#333',
57
+ dark_border5: '#353535',
58
+ dark_text: '#ccc',
59
+
60
+ // shadcn-vue colors
61
+ border: "hsl(var(--border))",
62
+ input: "hsl(var(--input))",
63
+ ring: "hsl(var(--ring))",
64
+ background: "hsl(var(--background))",
65
+ foreground: "hsl(var(--foreground))",
66
+ primary: {
67
+ DEFAULT: "#2671D9",
68
+ foreground: "hsl(var(--primary-foreground))"
69
+ },
70
+ secondary: {
71
+ DEFAULT: "hsl(var(--secondary))",
72
+ foreground: "hsl(var(--secondary-foreground))"
73
+ },
74
+ destructive: {
75
+ DEFAULT: "hsl(var(--destructive))",
76
+ foreground: "hsl(var(--destructive-foreground))"
77
+ },
78
+ muted: {
79
+ DEFAULT: "hsl(var(--muted))",
80
+ foreground: "hsl(var(--muted-foreground))"
81
+ },
82
+ accent: {
83
+ DEFAULT: "hsl(var(--accent))",
84
+ foreground: "hsl(var(--accent-foreground))"
85
+ },
86
+ popover: {
87
+ DEFAULT: "hsl(var(--popover))",
88
+ foreground: "hsl(var(--popover-foreground))"
89
+ },
90
+ card: {
91
+ DEFAULT: "hsl(var(--card))",
92
+ foreground: "hsl(var(--card-foreground))"
93
+ }
94
+ },
95
+ borderRadius: {
96
+ xl: "calc(var(--radius) + 4px)",
97
+ lg: "var(--radius)",
98
+ md: "calc(var(--radius) - 2px)",
99
+ sm: "calc(var(--radius) - 4px)"
100
+ },
101
+ keyframes: {
102
+ "accordion-down": {
103
+ from: { height: 0 },
104
+ to: { height: "var(--radix-accordion-content-height)" }
105
+ },
106
+ "accordion-up": {
107
+ from: { height: "var(--radix-accordion-content-height)" },
108
+ to: { height: 0 }
109
+ },
110
+ "collapsible-down": {
111
+ from: { height: 0 },
112
+ to: { height: "var(--radix-collapsible-content-height)" }
113
+ },
114
+ "collapsible-up": {
115
+ from: { height: "var(--radix-collapsible-content-height)" },
116
+ to: { height: 0 }
117
+ },
118
+ progress: {
119
+ "0%": { transform: " translateX(0) scaleX(0)" },
120
+ "40%": { transform: "translateX(0) scaleX(0.4)" },
121
+ "100%": { transform: "translateX(100%) scaleX(0.5)" }
122
+ }
123
+ },
124
+ transformOrigin: {
125
+ "left-right": "0% 50%"
126
+ },
127
+ animation: {
128
+ "accordion-down": "accordion-down 0.2s ease-out",
129
+ "accordion-up": "accordion-up 0.2s ease-out",
130
+ "collapsible-down": "collapsible-down 0.2s ease-in-out",
131
+ "collapsible-up": "collapsible-up 0.2s ease-in-out",
132
+ progress: "progress 1s infinite linear"
133
+ }
134
+ }
135
+ },
136
+ plugins: [animate, require("@vueform/vueform/tailwind")]
137
+ };
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.node.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.app.json"
9
+ },
10
+ {
11
+ "path": "./tsconfig.vitest.json"
12
+ }
13
+ ]
14
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { fileURLToPath, URL } from 'node:url'
2
+
3
+ import { defineConfig } from 'vite'
4
+ import vue from '@vitejs/plugin-vue'
5
+ import vueJsx from '@vitejs/plugin-vue-jsx'
6
+ import viteRawPlugin from 'vite-raw-plugin'
7
+
8
+ import tailwind from "tailwindcss"
9
+ import autoprefixer from "autoprefixer"
10
+
11
+ // https://vitejs.dev/config/
12
+ export default defineConfig({
13
+ css: {
14
+ postcss: {
15
+ plugins: [tailwind(), autoprefixer()],
16
+ },
17
+ },
18
+ plugins: [
19
+ vue(),
20
+ vueJsx(),
21
+ viteRawPlugin({
22
+ fileRegex: /\.md$/
23
+ }),
24
+ ],
25
+ resolve: {
26
+ alias: {
27
+ '@': fileURLToPath(new URL('./src', import.meta.url))
28
+ }
29
+ },
30
+ optimizeDeps: {
31
+ exclude: ['highlight.js'],
32
+ }
33
+ })
@@ -1,91 +0,0 @@
1
- const e = {
2
- schema: {
3
- // Test 1: Basic date picker
4
- testDate: {
5
- type: "DateSelectorElement",
6
- label: "Test Date",
7
- placeholder: "Select a date",
8
- pickerType: "date",
9
- rules: ["required"]
10
- },
11
- // Test 2: Date range
12
- testDateRange: {
13
- type: "DateSelectorElement",
14
- label: "Test Date Range",
15
- placeholder: "Select date range",
16
- pickerType: "date",
17
- range: !0
18
- },
19
- // Test 3: DateTime picker
20
- testDateTime: {
21
- type: "DateSelectorElement",
22
- label: "Test DateTime",
23
- placeholder: "Select date and time",
24
- pickerType: "datetime",
25
- timePickerInline: !0
26
- },
27
- // Test 4: DateTime range
28
- testDateTimeRange: {
29
- type: "DateSelectorElement",
30
- label: "Test DateTime Range",
31
- placeholder: "Select date time range",
32
- pickerType: "datetime",
33
- range: !0,
34
- timePickerInline: !0
35
- },
36
- // Test 5: Month picker
37
- testMonth: {
38
- type: "DateSelectorElement",
39
- label: "Test Month",
40
- placeholder: "Select month",
41
- pickerType: "month",
42
- locale: "id"
43
- },
44
- // Test 6: Month range
45
- testMonthRange: {
46
- type: "DateSelectorElement",
47
- label: "Test Month Range",
48
- placeholder: "Select month range",
49
- pickerType: "month",
50
- range: !0,
51
- locale: "id"
52
- },
53
- // Test 7: Year picker (using date picker with year navigation)
54
- testYear: {
55
- type: "DateSelectorElement",
56
- label: "Test Year",
57
- placeholder: "Select year",
58
- pickerType: "year",
59
- yearRange: [2020, 2030]
60
- },
61
- // Test 8: Year range (using date range picker with year navigation)
62
- testYearRange: {
63
- type: "DateSelectorElement",
64
- label: "Test Year Range",
65
- placeholder: "Select year range",
66
- pickerType: "year",
67
- range: !0,
68
- yearRange: [2020, 2030]
69
- },
70
- // Test 9: Custom format
71
- testCustomFormat: {
72
- type: "DateSelectorElement",
73
- label: "Test Custom Format",
74
- placeholder: "Select date",
75
- pickerType: "date",
76
- displayFormat: "DD-MM-YYYY"
77
- },
78
- // Test 10: Disabled
79
- testDisabled: {
80
- type: "DateSelectorElement",
81
- label: "Test Disabled",
82
- placeholder: "This is disabled",
83
- pickerType: "date",
84
- disabled: !0,
85
- default: "2024-01-01"
86
- }
87
- }
88
- };
89
- export {
90
- e as dateSelectorTestSchema
91
- };