@exakt/ui 0.0.1
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/README.md +93 -0
- package/dist/module.cjs +5 -0
- package/dist/module.d.ts +21 -0
- package/dist/module.json +5 -0
- package/dist/module.mjs +64 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.mjs +22 -0
- package/dist/types.d.ts +10 -0
- package/package.json +66 -0
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Get your module up and running quickly.
|
|
3
|
+
|
|
4
|
+
Find and replace all on all files (CMD+SHIFT+F):
|
|
5
|
+
- Name: exakt
|
|
6
|
+
- Package name: exakt-ui
|
|
7
|
+
- Description: My new Nuxt module
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
# exakt
|
|
11
|
+
|
|
12
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
13
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
14
|
+
[![License][license-src]][license-href]
|
|
15
|
+
[![Nuxt][nuxt-src]][nuxt-href]
|
|
16
|
+
|
|
17
|
+
a simple nuxt ui library focused on doing as much as possible with css
|
|
18
|
+
|
|
19
|
+
- [✨ Release Notes](/CHANGELOG.md)
|
|
20
|
+
<!-- - [📖 Documentation](https://example.com) -->
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
<!-- Highlight some of the features your module provide here -->
|
|
25
|
+
- 💇♀️ mostly uses css to do things
|
|
26
|
+
- 👜 relatively lightweight
|
|
27
|
+
- 👁️🗨️ customizable
|
|
28
|
+
|
|
29
|
+
## Quick Setup
|
|
30
|
+
|
|
31
|
+
1. Add `exakt-ui` dependency to your project
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Using pnpm
|
|
35
|
+
pnpm add -D exakt-ui
|
|
36
|
+
|
|
37
|
+
# Using yarn
|
|
38
|
+
yarn add --dev exakt-ui
|
|
39
|
+
|
|
40
|
+
# Using npm
|
|
41
|
+
npm install --save-dev exakt-ui
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
2. Add `exakt-ui` to the `modules` section of `nuxt.config.ts`
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
export default defineNuxtConfig({
|
|
48
|
+
modules: [
|
|
49
|
+
'exakt-ui'
|
|
50
|
+
]
|
|
51
|
+
})
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
That's it! You can now use exakt in your Nuxt app ✨
|
|
55
|
+
|
|
56
|
+
## Development
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Install dependencies
|
|
60
|
+
npm install
|
|
61
|
+
|
|
62
|
+
# Generate type stubs
|
|
63
|
+
npm run dev:prepare
|
|
64
|
+
|
|
65
|
+
# Develop with the playground
|
|
66
|
+
npm run dev
|
|
67
|
+
|
|
68
|
+
# Build the playground
|
|
69
|
+
npm run dev:build
|
|
70
|
+
|
|
71
|
+
# Run ESLint
|
|
72
|
+
npm run lint
|
|
73
|
+
|
|
74
|
+
# Run Vitest
|
|
75
|
+
npm run test
|
|
76
|
+
npm run test:watch
|
|
77
|
+
|
|
78
|
+
# Release new version
|
|
79
|
+
npm run release
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
<!-- Badges -->
|
|
83
|
+
[npm-version-src]: https://img.shields.io/npm/v/exakt-ui/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
84
|
+
[npm-version-href]: https://npmjs.com/package/exakt-ui
|
|
85
|
+
|
|
86
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/exakt-ui.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
87
|
+
[npm-downloads-href]: https://npmjs.com/package/exakt-ui
|
|
88
|
+
|
|
89
|
+
[license-src]: https://img.shields.io/npm/l/exakt-ui.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
90
|
+
[license-href]: https://npmjs.com/package/exakt-ui
|
|
91
|
+
|
|
92
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
|
|
93
|
+
[nuxt-href]: https://nuxt.com
|
package/dist/module.cjs
ADDED
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
|
|
3
|
+
interface ModuleOptions {
|
|
4
|
+
colors: {
|
|
5
|
+
primary?: string;
|
|
6
|
+
dark?: string;
|
|
7
|
+
light?: string;
|
|
8
|
+
red?: string;
|
|
9
|
+
blue?: string;
|
|
10
|
+
};
|
|
11
|
+
breakpoints: {
|
|
12
|
+
md?: string;
|
|
13
|
+
l?: string;
|
|
14
|
+
xl?: string;
|
|
15
|
+
};
|
|
16
|
+
borderRadius: string;
|
|
17
|
+
font: string;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
20
|
+
|
|
21
|
+
export { ModuleOptions, _default as default };
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, addPlugin, extendViteConfig, addComponentsDir } from '@nuxt/kit';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
|
|
4
|
+
const defaults = {
|
|
5
|
+
colors: {
|
|
6
|
+
primary: "#008dff",
|
|
7
|
+
dark: "#212121",
|
|
8
|
+
light: "#f5f5f5",
|
|
9
|
+
red: "#f44336",
|
|
10
|
+
blue: "#2196f3"
|
|
11
|
+
},
|
|
12
|
+
breakpoints: {
|
|
13
|
+
md: "33em",
|
|
14
|
+
l: "48em",
|
|
15
|
+
xl: "60em"
|
|
16
|
+
},
|
|
17
|
+
borderRadius: "8px",
|
|
18
|
+
font: "Roboto, sans-serif"
|
|
19
|
+
};
|
|
20
|
+
const module = defineNuxtModule({
|
|
21
|
+
meta: {
|
|
22
|
+
name: "exakt-ui",
|
|
23
|
+
configKey: "exakt"
|
|
24
|
+
},
|
|
25
|
+
// Default configuration options of the Nuxt module
|
|
26
|
+
defaults,
|
|
27
|
+
async setup(options, nuxt) {
|
|
28
|
+
const resolver = createResolver(import.meta.url);
|
|
29
|
+
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
30
|
+
await fs.promises.mkdir("node_modules/.cache/exakt-ui", {
|
|
31
|
+
recursive: true
|
|
32
|
+
});
|
|
33
|
+
let variables = "";
|
|
34
|
+
for (const [key, value] of Object.entries(options.colors)) {
|
|
35
|
+
variables += `$root-${key}: ${value}; `;
|
|
36
|
+
}
|
|
37
|
+
for (const [key, value] of Object.entries(options.breakpoints)) {
|
|
38
|
+
variables += `$${key}-screen-breakpoint: ${value}; `;
|
|
39
|
+
}
|
|
40
|
+
variables += `$font-family: ${options.font}; `;
|
|
41
|
+
variables += `$rounded-border-radius: ${options.borderRadius}; `;
|
|
42
|
+
await fs.promises.writeFile(
|
|
43
|
+
"node_modules/.cache/exakt-ui/variables.scss",
|
|
44
|
+
new Uint8Array(Buffer.from(variables))
|
|
45
|
+
);
|
|
46
|
+
extendViteConfig((config) => {
|
|
47
|
+
Object.assign(config, {
|
|
48
|
+
css: {
|
|
49
|
+
preprocessorOptions: {
|
|
50
|
+
scss: {
|
|
51
|
+
additionalData: `@use "sass:color"; @import "${resolver.resolve(
|
|
52
|
+
"../node_modules/.cache/exakt-ui/variables.scss"
|
|
53
|
+
)}"; `
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
nuxt.options.css.push(resolver.resolve("./css/main.scss"));
|
|
60
|
+
addComponentsDir({ path: resolver.resolve("./components") });
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export { module as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from "#app";
|
|
2
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
3
|
+
console.log("Plugin injected by exakt-ui!");
|
|
4
|
+
return {
|
|
5
|
+
provide: {
|
|
6
|
+
exakt: {
|
|
7
|
+
parseColor: (p, suffix = "") => {
|
|
8
|
+
let result = null;
|
|
9
|
+
if (p === "primary") {
|
|
10
|
+
result = "var(--e-color-primary";
|
|
11
|
+
} else if (p === "elev") {
|
|
12
|
+
result = "var(--e-color-elev";
|
|
13
|
+
}
|
|
14
|
+
if (result) {
|
|
15
|
+
return result.concat(suffix ? "-".concat(suffix) : "", ")");
|
|
16
|
+
}
|
|
17
|
+
return p;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
});
|
package/dist/types.d.ts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@exakt/ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A UI library for Nuxt.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/types.d.ts",
|
|
10
|
+
"import": "./dist/module.mjs",
|
|
11
|
+
"require": "./dist/module.cjs"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/module.cjs",
|
|
15
|
+
"types": "./dist/types.d.ts",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"prepack": "nuxt-module-build",
|
|
21
|
+
"dev": "nuxi dev playground",
|
|
22
|
+
"dev:build": "nuxi build playground",
|
|
23
|
+
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
|
|
24
|
+
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
|
|
25
|
+
"lint": "eslint .",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest watch"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@mdi/js": "^7.1.96",
|
|
31
|
+
"@nuxt/kit": "^3.2.3",
|
|
32
|
+
"blurhash": "^2.0.5",
|
|
33
|
+
"lodash": "^4.17.21",
|
|
34
|
+
"sass": "^1.58.3"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@nuxt/eslint-config": "^0.1.1",
|
|
38
|
+
"@nuxt/module-builder": "^0.2.1",
|
|
39
|
+
"@nuxt/schema": "^3.2.3",
|
|
40
|
+
"@nuxt/test-utils": "^3.2.3",
|
|
41
|
+
"@types/lodash": "^4.14.191",
|
|
42
|
+
"changelogen": "^0.5.1",
|
|
43
|
+
"eslint": "^8.35.0",
|
|
44
|
+
"nuxt": "^3.2.3",
|
|
45
|
+
"vitest": "^0.29.2"
|
|
46
|
+
},
|
|
47
|
+
"directories": {
|
|
48
|
+
"test": "test"
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/wd-4000/exakt.git"
|
|
53
|
+
},
|
|
54
|
+
"keywords": [
|
|
55
|
+
"UI",
|
|
56
|
+
"components",
|
|
57
|
+
"Nuxt",
|
|
58
|
+
"CSS",
|
|
59
|
+
"epic"
|
|
60
|
+
],
|
|
61
|
+
"author": "wd-4000",
|
|
62
|
+
"bugs": {
|
|
63
|
+
"url": "https://github.com/wd-4000/exakt/issues"
|
|
64
|
+
},
|
|
65
|
+
"homepage": "https://github.com/wd-4000/exakt#readme"
|
|
66
|
+
}
|