lapikit 0.0.0-insiders.e06d168 → 0.0.0-insiders.e221561

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 (38) hide show
  1. package/README.md +117 -1
  2. package/bin/helper.js +0 -38
  3. package/bin/prompts.js +1 -1
  4. package/dist/components/app/app.css +12 -1
  5. package/dist/components/app/app.svelte +48 -13
  6. package/dist/components/app/app.svelte.d.ts +2 -7
  7. package/dist/components/app/types.d.ts +7 -1
  8. package/dist/components/card/card.css +2 -2
  9. package/dist/components/card/card.svelte +4 -0
  10. package/dist/components/card/types.d.ts +2 -0
  11. package/dist/components/icon/icon.css +6 -6
  12. package/dist/components/separator/separator.css +17 -17
  13. package/dist/components/separator/separator.svelte +1 -1
  14. package/dist/components/separator/types.d.ts +5 -1
  15. package/dist/components/textfield/textfield.svelte.d.ts +1 -1
  16. package/dist/components/toolbar/toolbar.css +0 -11
  17. package/dist/entry-bundler.d.ts +12 -0
  18. package/dist/entry-bundler.js +106 -0
  19. package/dist/internal/core/animations/ripple.js +1 -1
  20. package/dist/internal/helpers/scroll.js +1 -2
  21. package/dist/labs/components/button/button.svelte +24 -0
  22. package/dist/labs/components/button/button.svelte.d.ts +5 -0
  23. package/dist/labs/components/index.d.ts +1 -0
  24. package/dist/labs/components/index.js +2 -0
  25. package/dist/stores/index.d.ts +1 -0
  26. package/dist/stores/index.js +1 -0
  27. package/dist/stores/viewport.d.ts +7 -0
  28. package/dist/stores/viewport.js +7 -0
  29. package/dist/styles.css.d.ts +4 -0
  30. package/dist/themes.css.d.ts +4 -0
  31. package/package.json +135 -99
  32. package/bin/lapikit.js +0 -86
  33. package/bin/legacy.js +0 -34
  34. package/bin/modules/adapter.js +0 -52
  35. package/bin/modules/plugin.js +0 -223
  36. package/bin/modules/preset.js +0 -11
  37. package/dist/app.d.ts +0 -13
  38. package/dist/app.html +0 -12
@@ -0,0 +1 @@
1
+ export { default as KitBtn } from './button/button.svelte';
@@ -0,0 +1,2 @@
1
+ // components
2
+ export { default as KitBtn } from './button/button.svelte';
@@ -2,3 +2,4 @@ export * from './breakpoints.js';
2
2
  export * from './devices.js';
3
3
  export * from './themes.js';
4
4
  export * from './components.js';
5
+ export * from './viewport.js';
@@ -2,3 +2,4 @@ export * from './breakpoints.js';
2
2
  export * from './devices.js';
3
3
  export * from './themes.js';
4
4
  export * from './components.js';
5
+ export * from './viewport.js';
@@ -0,0 +1,7 @@
1
+ export type Viewport = {
2
+ innerWidth: number;
3
+ outerWidth: number;
4
+ innerHeight: number;
5
+ outerHeight: number;
6
+ };
7
+ export declare const viewport: import("svelte/store").Writable<Viewport>;
@@ -0,0 +1,7 @@
1
+ import { writable } from 'svelte/store';
2
+ export const viewport = writable({
3
+ innerWidth: 0,
4
+ outerWidth: 0,
5
+ innerHeight: 0,
6
+ outerHeight: 0
7
+ });
@@ -0,0 +1,4 @@
1
+ declare module 'lapikit/styles' {
2
+ const styles: string;
3
+ export default styles;
4
+ }
@@ -0,0 +1,4 @@
1
+ declare module 'lapikit/themes' {
2
+ const themes: string;
3
+ export default themes;
4
+ }
package/package.json CHANGED
@@ -1,101 +1,137 @@
1
1
  {
2
- "name": "lapikit",
3
- "version": "0.0.0-insiders.e06d168",
4
- "license": "MIT",
5
- "publishConfig": {
6
- "access": "public"
7
- },
8
- "homepage": "https://lapikit.dev",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/Nycolaide/lapikit.git",
12
- "directory": "packages/lapikit"
13
- },
14
- "scripts": {
15
- "dev": "vite dev",
16
- "build": "vite build && npm run prepack",
17
- "preview": "vite preview",
18
- "prepare": "svelte-kit sync || echo ''",
19
- "prepack": "svelte-kit sync && svelte-package && publint",
20
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
21
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
22
- "format": "prettier --write .",
23
- "lint": "prettier --check . && eslint .",
24
- "test:unit": "vitest",
25
- "test": "npm run test:unit -- --run"
26
- },
27
- "files": [
28
- "bin",
29
- "dist",
30
- "README.md",
31
- "LICENSE",
32
- "!dist/**/*.test.*",
33
- "!dist/**/*.spec.*"
34
- ],
35
- "sideEffects": [
36
- "**/*.css"
37
- ],
38
- "bin": {
39
- "lapikit": "bin/index.js"
40
- },
41
- "svelte": "./dist/index.js",
42
- "types": "./dist/index.d.ts",
43
- "type": "module",
44
- "exports": {
45
- ".": {
46
- "types": "./dist/index.d.ts",
47
- "svelte": "./dist/index.js"
48
- },
49
- "./components": {
50
- "svelte": "./dist/components/index.js",
51
- "default": "./dist/components/index.js"
52
- },
53
- "./vite": {
54
- "default": "./dist/internal/plugins/vite.js"
55
- },
56
- "./stores": {
57
- "default": "./dist/stores/index.js"
58
- },
59
- "./actions": {
60
- "default": "./dist/actions/index.js"
61
- },
62
- "./core/colors": {
63
- "default": "./dist/internal/core/standard-colors.js"
64
- },
65
- "./styles": "./dist/styles.css",
66
- "./themes": "./dist/themes.css"
67
- },
68
- "peerDependencies": {
69
- "svelte": "^5.0.0"
70
- },
71
- "devDependencies": {
72
- "@eslint/compat": "^1.2.5",
73
- "@eslint/js": "^9.18.0",
74
- "@sveltejs/adapter-auto": "^4.0.0",
75
- "@sveltejs/kit": "^2.16.0",
76
- "@sveltejs/package": "^2.0.0",
77
- "@sveltejs/vite-plugin-svelte": "^5.0.0",
78
- "@testing-library/jest-dom": "^6.6.3",
79
- "@testing-library/svelte": "^5.2.4",
80
- "eslint": "^9.18.0",
81
- "eslint-config-prettier": "^10.0.1",
82
- "eslint-plugin-svelte": "^3.0.0",
83
- "globals": "^16.0.0",
84
- "jsdom": "^26.0.0",
85
- "prettier": "^3.4.2",
86
- "prettier-plugin-svelte": "^3.3.3",
87
- "publint": "^0.3.2",
88
- "svelte": "^5.0.0",
89
- "svelte-check": "^4.0.0",
90
- "typescript": "^5.0.0",
91
- "typescript-eslint": "^8.20.0",
92
- "vite": "^6.2.5",
93
- "vitest": "^3.0.0"
94
- },
95
- "keywords": [
96
- "svelte"
97
- ],
98
- "dependencies": {
99
- "prompts": "^2.4.2"
100
- }
2
+ "name": "lapikit",
3
+ "version": "0.0.0-insiders.e221561",
4
+ "license": "MIT",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "homepage": "https://lapikit.dev",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/Nycolaide/lapikit.git",
12
+ "directory": "packages/lapikit"
13
+ },
14
+ "author": {
15
+ "name": "Nycolaide",
16
+ "email": "contact@lapikit.dev"
17
+ },
18
+ "funding": "https://buymeacoffee.com/nycolaide",
19
+ "bugs": "https://github.com/Nycolaide/lapikit/issues",
20
+ "scripts": {
21
+ "dev": "vite dev",
22
+ "build": "vite build && npm run prepack",
23
+ "preview": "vite preview",
24
+ "prepare": "svelte-kit sync || echo ''",
25
+ "prepack": "svelte-kit sync && svelte-package && publint",
26
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
27
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
28
+ "format": "prettier --write .",
29
+ "lint": "prettier --check . && eslint .",
30
+ "test:unit": "vitest",
31
+ "test": "npm run test:unit -- --run"
32
+ },
33
+ "files": [
34
+ "bin",
35
+ "dist",
36
+ "README.md",
37
+ "LICENSE",
38
+ "!dist/**/*.test.*",
39
+ "!dist/**/*.spec.*"
40
+ ],
41
+ "sideEffects": [
42
+ "**/*.css"
43
+ ],
44
+ "bin": {
45
+ "lapikit": "bin/index.js"
46
+ },
47
+ "svelte": "./dist/index.js",
48
+ "types": "./dist/index.d.ts",
49
+ "type": "module",
50
+ "exports": {
51
+ ".": {
52
+ "types": "./dist/index.d.ts",
53
+ "svelte": "./dist/index.js"
54
+ },
55
+ "./components": {
56
+ "svelte": "./dist/components/index.js",
57
+ "default": "./dist/components/index.js"
58
+ },
59
+ "./vite": {
60
+ "default": "./dist/internal/plugins/vite.js"
61
+ },
62
+ "./stores": {
63
+ "default": "./dist/stores/index.js"
64
+ },
65
+ "./actions": {
66
+ "default": "./dist/actions/index.js"
67
+ },
68
+ "./core/colors": {
69
+ "default": "./dist/internal/core/standard-colors.js"
70
+ },
71
+ "./styles": {
72
+ "types": "./dist/styles.css.d.ts",
73
+ "default": "./dist/styles.css"
74
+ },
75
+ "./themes": {
76
+ "types": "./dist/themes.css.d.ts",
77
+ "default": "./dist/themes.css"
78
+ },
79
+ "./labs/preprocess": {
80
+ "default": "./dist/entry-bundler.js"
81
+ },
82
+ "./labs/components": {
83
+ "svelte": "./dist/labs/components/index.js",
84
+ "default": "./dist/labs/components/index.js"
85
+ }
86
+ },
87
+ "peerDependencies": {
88
+ "svelte": "^5.0.0"
89
+ },
90
+ "devDependencies": {
91
+ "@eslint/compat": "^1.2.5",
92
+ "@eslint/js": "^9.18.0",
93
+ "@sveltejs/adapter-auto": "^4.0.0",
94
+ "@sveltejs/kit": "^2.16.0",
95
+ "@sveltejs/package": "^2.0.0",
96
+ "@sveltejs/vite-plugin-svelte": "^6.2.1",
97
+ "@testing-library/jest-dom": "^6.6.3",
98
+ "@testing-library/svelte": "^5.2.4",
99
+ "eslint": "^9.18.0",
100
+ "eslint-config-prettier": "^10.0.1",
101
+ "eslint-plugin-svelte": "^3.0.0",
102
+ "globals": "^16.0.0",
103
+ "jsdom": "^26.0.0",
104
+ "prettier": "^3.4.2",
105
+ "prettier-plugin-svelte": "^3.3.3",
106
+ "publint": "^0.3.2",
107
+ "svelte": "^5.0.0",
108
+ "svelte-check": "^4.0.0",
109
+ "typescript": "^5.0.0",
110
+ "typescript-eslint": "^8.20.0",
111
+ "vite": "^7.2.2",
112
+ "vitest": "^3.0.0"
113
+ },
114
+ "keywords": [
115
+ "svelte",
116
+ "sveltekit",
117
+ "components",
118
+ "ui",
119
+ "library",
120
+ "ui-library",
121
+ "design system",
122
+ "lapikit",
123
+ "material components",
124
+ "component library",
125
+ "frontend",
126
+ "svelte library",
127
+ "tailwindcss",
128
+ "unocss",
129
+ "component",
130
+ "theme",
131
+ "css",
132
+ "typescript"
133
+ ],
134
+ "dependencies": {
135
+ "prompts": "^2.4.2"
136
+ }
101
137
  }
package/bin/lapikit.js DELETED
@@ -1,86 +0,0 @@
1
- #!/usr/bin/env node
2
- import { promises as fs } from 'fs';
3
- import path from 'path';
4
- import {
5
- ansi,
6
- terminal,
7
- envTypescript,
8
- getLapikitPathFromArgs,
9
- validatePluginPath
10
- } from './helper.js';
11
- import { preset } from './modules/preset.js';
12
- import { adapterCSSConfig, adapterViteConfig } from './modules/adapter.js';
13
- import { createPluginStructure, setupSvelteKitIntegration } from './modules/plugin.js';
14
-
15
- const [, , command] = process.argv;
16
- const typescriptEnabled = envTypescript();
17
-
18
- if (process.argv.includes('--help') || process.argv.includes('-h')) {
19
- terminal(
20
- 'info',
21
- `usage: ${ansi.color.yellow('npx lapikit init {cssPath} [--plugin-path {pluginPath}]')}\n\n ${ansi.variant.bold('options:')}\n
22
- - {cssPath}: (${ansi.color.cyan('src/app.css')}) customize path on your origin css file.
23
- - --plugin-path, -p: (${ansi.color.cyan('src/plugin')}) customize path for the plugin directory.\n\n`
24
- );
25
- process.exit(0);
26
- } else if (command === 'init') {
27
- console.log(' _ _ _ _ _ ');
28
- console.log(' | | (_) | (_) | ');
29
- console.log(' | | __ _ _ __ _| | ___| |_ ');
30
- console.log(" | | / _` | '_ \\| | |/ / | __|");
31
- console.log(' | |___| (_| | |_) | | <| | |_ ');
32
- console.log(' |______\\__,_| .__/|_|_|\\_\\_|\\__|');
33
- console.log(' | | ');
34
- console.log(' |_| \n');
35
-
36
- terminal('none', `${ansi.bold.blue('LAPIKIT')} - Component Library for Svelte\n\n`);
37
-
38
- // Get Path
39
- const pluginPath = getLapikitPathFromArgs();
40
- const pathValidation = validatePluginPath(pluginPath);
41
-
42
- if (!pathValidation.valid) {
43
- terminal('error', `Invalid path: ${pathValidation.error}`);
44
- process.exit(1);
45
- }
46
-
47
- const configPath = path.resolve(process.cwd(), 'lapikit.config.js');
48
- try {
49
- await fs.writeFile(configPath, preset.trim() + '\n', 'utf8');
50
- terminal('success', `has create lapikit.config.js on your project.`);
51
- } catch (error) {
52
- terminal('error', `failed to create configuration file:\n\n ${error}`);
53
- terminal(
54
- 'warn',
55
- `you can create lapikit.config.js manually, please visite https://lapikit.dev/docs/getting-started for more information`
56
- );
57
- }
58
-
59
- // Create plugin structure
60
- try {
61
- await createPluginStructure(pluginPath, typescriptEnabled);
62
- } catch (error) {
63
- terminal('error', `Create plugin structure not working : ${error.message}`);
64
- }
65
-
66
- // Setup SvelteKit integration
67
- try {
68
- await setupSvelteKitIntegration(pluginPath, typescriptEnabled);
69
- } catch (error) {
70
- terminal('error', `SvelteKit integration setup failed: ${error.message}`);
71
- }
72
-
73
- await adapterViteConfig(typescriptEnabled);
74
- await adapterCSSConfig();
75
-
76
- terminal(
77
- 'info',
78
- `${ansi.bold.blue('Thank to use lapikit, discover all posibility with lapikit on https://lapikit.dev')}\n\n`
79
- );
80
-
81
- console.log('Website: https://lapikit.dev');
82
- console.log('Github: https://github.com/nycolaide/lapikit');
83
- console.log('Support the developement: https://buymeacoffee.com/nycolaide');
84
- } else {
85
- terminal('error', `Command not recognized. Try 'npx lapikit -h'`);
86
- }
package/bin/legacy.js DELETED
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
- import { promises as fs } from 'fs';
3
- import path from 'path';
4
- import { preset } from './modules/preset.js';
5
- import { ansi, terminal, envTypescript } from './helper.js';
6
- import { adapterCSSConfig, adapterViteConfig } from './modules/adapter.js';
7
-
8
- export async function legacyConfiguration(options) {
9
- const typescriptEnabled = envTypescript();
10
- const configPath = path.resolve(process.cwd(), 'lapikit.config.js');
11
-
12
- try {
13
- await fs.writeFile(configPath, preset.trim() + '\n', 'utf8');
14
- terminal('success', `has create lapikit.config.js on your project.`);
15
- } catch (error) {
16
- terminal('error', `failed to create configuration file:\n\n ${error}`);
17
- terminal(
18
- 'warn',
19
- `you can create lapikit.config.js manually, please visite https://lapikit.dev/docs/getting-started for more information`
20
- );
21
- }
22
-
23
- await adapterViteConfig(typescriptEnabled);
24
- await adapterCSSConfig(options);
25
-
26
- terminal(
27
- 'info',
28
- `${ansi.bold.blue('Thank to use lapikit, discover all posibility with lapikit on https://lapikit.dev')}\n\n`
29
- );
30
-
31
- console.log('Website: https://lapikit.dev');
32
- console.log('Github: https://github.com/nycolaide/lapikit');
33
- console.log('Support the developement: https://buymeacoffee.com/nycolaide');
34
- }
@@ -1,52 +0,0 @@
1
- import { promises as fs } from 'fs';
2
- import path from 'path';
3
- import { terminal } from '../helper.js';
4
-
5
- const importLapikitVite = `import { lapikit } from 'lapikit/vite';`;
6
- const importLapikitCss = `@import 'lapikit/css';`;
7
-
8
- export async function adapterViteConfig(typescript) {
9
- const viteConfigPath = path.resolve(process.cwd(), `vite.config.${typescript ? 'ts' : 'js'}`);
10
- try {
11
- let viteConfig = await fs.readFile(viteConfigPath, 'utf8');
12
-
13
- if (!viteConfig.includes(`${importLapikitVite}`))
14
- viteConfig = `${importLapikitVite}\n` + viteConfig;
15
-
16
- const pluginsRegex = /plugins:\s*\[([^\]]*)\]/;
17
- const match = viteConfig.match(pluginsRegex);
18
-
19
- if (match && !match[1].includes('lapikit()')) {
20
- const updatedPlugins = match[1].trim() ? `${match[1].trim()}, lapikit()` : `lapikit()`;
21
-
22
- viteConfig = viteConfig.replace(pluginsRegex, `plugins: [${updatedPlugins}]`);
23
- }
24
-
25
- await fs.writeFile(viteConfigPath, viteConfig, 'utf8');
26
-
27
- terminal('success', 'lapikit() has added on vite.config.(js|ts) successfully');
28
- } catch (error) {
29
- terminal(
30
- 'error',
31
- `lapikit() encountered a problem while editing vite.config.(js|ts):\n ${error}.\n\n`
32
- );
33
- }
34
- }
35
-
36
- export async function adapterCSSConfig(options) {
37
- const cssPath = options?.pathCSS || 'src/app.css';
38
- const resolvedPath = path.resolve(process.cwd(), cssPath);
39
- try {
40
- await fs.access(resolvedPath);
41
- let appCssContent = await fs.readFile(resolvedPath, 'utf8');
42
- appCssContent = `${importLapikitCss}\n\n` + appCssContent;
43
- await fs.writeFile(resolvedPath, appCssContent, 'utf8');
44
-
45
- terminal('success', `lapikit/css has added on ${cssPath}.`);
46
- } catch (error) {
47
- terminal(
48
- 'error',
49
- `lapikit/css encountered a problem while editing ${cssPath}:\n ${error.message}.\n\n`
50
- );
51
- }
52
- }