@nonsuch/component-library 0.1.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/LICENSE +21 -0
- package/README.md +105 -0
- package/dist/nonsuch-components.css +1 -0
- package/dist/nonsuch-components.js +35 -0
- package/package.json +78 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nonsuch
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# @nonsuch/component-library
|
|
2
|
+
|
|
3
|
+
A Vue 3 component library built on top of [Quasar](https://quasar.dev), providing customized components with opinionated defaults.
|
|
4
|
+
|
|
5
|
+
**Quasar components you haven't customized are used directly** — this library only adds or overrides the ones with Nonsuch-specific styling and behavior. Tree-shaking is fully preserved.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Install the library and its peer dependencies
|
|
11
|
+
pnpm add @nonsuch/component-library
|
|
12
|
+
pnpm add quasar @quasar/extras @quasar/vite-plugin
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Vite Configuration
|
|
16
|
+
|
|
17
|
+
In your `vite.config.ts`, register the Quasar Vite plugin as usual:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { quasar, transformAssetUrls } from '@quasar/vite-plugin'
|
|
21
|
+
import vue from '@vitejs/plugin-vue'
|
|
22
|
+
|
|
23
|
+
export default defineConfig({
|
|
24
|
+
plugins: [vue({ template: { transformAssetUrls } }), quasar()],
|
|
25
|
+
})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### App Entry
|
|
29
|
+
|
|
30
|
+
Register Quasar in your Vue app:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { createApp } from 'vue'
|
|
34
|
+
import { Quasar } from 'quasar'
|
|
35
|
+
import 'quasar/src/css/index.sass'
|
|
36
|
+
|
|
37
|
+
const app = createApp(App)
|
|
38
|
+
app.use(Quasar, { plugins: {} })
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Then import custom components as needed:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { NsButton } from '@nonsuch/component-library'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Or use Quasar components directly — they aren't re-exported through this library, so you import them from `quasar` as normal:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { QInput, QSelect } from 'quasar'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Development
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Install dependencies
|
|
57
|
+
pnpm install
|
|
58
|
+
|
|
59
|
+
# Run Storybook (dev mode)
|
|
60
|
+
pnpm dev
|
|
61
|
+
|
|
62
|
+
# Run tests
|
|
63
|
+
pnpm test
|
|
64
|
+
pnpm test:watch
|
|
65
|
+
|
|
66
|
+
# Build the library
|
|
67
|
+
pnpm build
|
|
68
|
+
|
|
69
|
+
# Build Storybook for deployment
|
|
70
|
+
pnpm build:storybook
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Project Structure
|
|
74
|
+
|
|
75
|
+
```markdown
|
|
76
|
+
src/
|
|
77
|
+
index.ts # Library entry — exports all custom components
|
|
78
|
+
components/
|
|
79
|
+
NsButton/
|
|
80
|
+
NsButton.vue # Component implementation
|
|
81
|
+
NsButton.stories.ts # Storybook story
|
|
82
|
+
NsButton.test.ts # Vitest unit test
|
|
83
|
+
index.ts # Re-export
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Each custom component lives in its own directory with co-located story and test files. The `Ns` prefix distinguishes library components from Quasar's `Q` prefix.
|
|
87
|
+
|
|
88
|
+
## Adding a New Component
|
|
89
|
+
|
|
90
|
+
1. Create `src/components/NsMyComponent/NsMyComponent.vue`
|
|
91
|
+
2. Add a story: `NsMyComponent.stories.ts`
|
|
92
|
+
3. Add tests: `NsMyComponent.test.ts`
|
|
93
|
+
4. Add a re-export: `index.ts`
|
|
94
|
+
5. Export from `src/index.ts`
|
|
95
|
+
|
|
96
|
+
## Architecture
|
|
97
|
+
|
|
98
|
+
- **Quasar is a peer dependency** — consumers install it normally and get full tree-shaking via `@quasar/vite-plugin`
|
|
99
|
+
- **Custom components compose Quasar** — they wrap or extend Quasar components with opinionated defaults
|
|
100
|
+
- **Vite library mode** — builds to ES modules with externalized `vue` and `quasar`
|
|
101
|
+
- **TypeScript** — strict mode with emitted `.d.ts` declarations
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
MIT — see [LICENSE](./LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ns-button[data-v-5eac18a7]{font-weight:500;letter-spacing:.02em}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import r from "quasar/src/components/btn/QBtn.js";
|
|
2
|
+
import { defineComponent as u, openBlock as d, createBlock as l, mergeProps as s, withCtx as c, renderSlot as f } from "vue";
|
|
3
|
+
const p = /* @__PURE__ */ u({
|
|
4
|
+
__name: "NsButton",
|
|
5
|
+
props: {
|
|
6
|
+
color: { default: "primary" },
|
|
7
|
+
size: { default: "md" },
|
|
8
|
+
unelevated: { type: Boolean, default: !0 },
|
|
9
|
+
noCaps: { type: Boolean, default: !0 },
|
|
10
|
+
rounded: { type: Boolean, default: !0 }
|
|
11
|
+
},
|
|
12
|
+
setup(e) {
|
|
13
|
+
return (t, o) => (d(), l(r, s(t.$attrs, {
|
|
14
|
+
color: e.color,
|
|
15
|
+
size: e.size,
|
|
16
|
+
unelevated: e.unelevated,
|
|
17
|
+
"no-caps": e.noCaps,
|
|
18
|
+
rounded: e.rounded,
|
|
19
|
+
class: "ns-button"
|
|
20
|
+
}), {
|
|
21
|
+
default: c(() => [
|
|
22
|
+
f(t.$slots, "default", {}, void 0, !0)
|
|
23
|
+
]),
|
|
24
|
+
_: 3
|
|
25
|
+
}, 16, ["color", "size", "unelevated", "no-caps", "rounded"]));
|
|
26
|
+
}
|
|
27
|
+
}), i = (e, t) => {
|
|
28
|
+
const o = e.__vccOpts || e;
|
|
29
|
+
for (const [n, a] of t)
|
|
30
|
+
o[n] = a;
|
|
31
|
+
return o;
|
|
32
|
+
}, B = /* @__PURE__ */ i(p, [["__scopeId", "data-v-5eac18a7"]]);
|
|
33
|
+
export {
|
|
34
|
+
B as NsButton
|
|
35
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nonsuch/component-library",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A Vue 3 component library built on Quasar with opinionated defaults and custom components.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/nonsuch/componentLibrary.git"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"main": "./dist/nonsuch-components.js",
|
|
16
|
+
"module": "./dist/nonsuch-components.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/nonsuch-components.js"
|
|
22
|
+
},
|
|
23
|
+
"./style.css": "./dist/style.css"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "storybook dev -p 6006",
|
|
27
|
+
"build": "vite build && vue-tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
28
|
+
"build:storybook": "storybook build",
|
|
29
|
+
"typecheck": "vue-tsc -p tsconfig.app.json --noEmit",
|
|
30
|
+
"lint": "eslint .",
|
|
31
|
+
"lint:fix": "eslint . --fix",
|
|
32
|
+
"format": "prettier --write .",
|
|
33
|
+
"format:check": "prettier --check .",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"test:watch": "vitest",
|
|
36
|
+
"test:coverage": "vitest run --coverage",
|
|
37
|
+
"preview": "vite preview",
|
|
38
|
+
"prepublishOnly": "pnpm lint && pnpm typecheck && pnpm test && pnpm build"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@quasar/vite-plugin": "^1.8.0",
|
|
42
|
+
"quasar": "^2.17.0",
|
|
43
|
+
"vue": "^3.5.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"@quasar/vite-plugin": {
|
|
47
|
+
"optional": true
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"pnpm": {
|
|
51
|
+
"onlyBuiltDependencies": [
|
|
52
|
+
"esbuild"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@eslint/js": "^9.39.2",
|
|
57
|
+
"@quasar/extras": "^1.17.0",
|
|
58
|
+
"@quasar/vite-plugin": "^1.10.0",
|
|
59
|
+
"@storybook/vue3-vite": "^10.2.7",
|
|
60
|
+
"@vitejs/plugin-vue": "^6.0.4",
|
|
61
|
+
"@vue/test-utils": "^2.4.6",
|
|
62
|
+
"eslint": "^9.39.2",
|
|
63
|
+
"eslint-config-prettier": "^10.1.8",
|
|
64
|
+
"eslint-plugin-vue": "^10.7.0",
|
|
65
|
+
"happy-dom": "^20.5.3",
|
|
66
|
+
"prettier": "^3.8.1",
|
|
67
|
+
"quasar": "^2.18.6",
|
|
68
|
+
"sass-embedded": "^1.97.3",
|
|
69
|
+
"storybook": "^10.2.7",
|
|
70
|
+
"typescript": "^5.9.3",
|
|
71
|
+
"typescript-eslint": "^8.54.0",
|
|
72
|
+
"vite": "^7.3.1",
|
|
73
|
+
"vitest": "^4.0.18",
|
|
74
|
+
"vue": "^3.5.27",
|
|
75
|
+
"vue-tsc": "^3.2.4"
|
|
76
|
+
},
|
|
77
|
+
"packageManager": "pnpm@10.29.2"
|
|
78
|
+
}
|