@liftkit-vue/nuxt 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/README.md +149 -0
- package/dist/module.d.mts +5 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +67 -0
- package/dist/runtime/plugin.d.ts +0 -0
- package/dist/runtime/plugin.js +3 -0
- package/dist/types.d.mts +7 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# @liftkit-vue/nuxt
|
|
2
|
+
|
|
3
|
+
Nuxt 4 module for LiftKit Vue — auto-imports all components and injects the CSS design system.
|
|
4
|
+
|
|
5
|
+
**[日本語版はこちら](#日本語)**
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
> **Note**: npm package is not yet published. Install the monorepo from GitHub:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add github:YOUR_USERNAME/liftkit-vue
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
Add the module to `nuxt.config.ts`:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
export default defineNuxtConfig({
|
|
21
|
+
modules: ['@liftkit-vue/nuxt'],
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
All LiftKit components are auto-imported. Wrap your app with `LkTheme` in your layout:
|
|
28
|
+
|
|
29
|
+
```vue
|
|
30
|
+
<!-- layouts/default.vue -->
|
|
31
|
+
<template>
|
|
32
|
+
<LkTheme source-color="#035eff">
|
|
33
|
+
<slot />
|
|
34
|
+
</LkTheme>
|
|
35
|
+
</template>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Then use components directly in any page:
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<template>
|
|
42
|
+
<LkContainer>
|
|
43
|
+
<LkCard material="filled">
|
|
44
|
+
<LkText font-class="heading">Welcome</LkText>
|
|
45
|
+
<LkButton variant="fill" color="primary">Get Started</LkButton>
|
|
46
|
+
</LkCard>
|
|
47
|
+
</LkContainer>
|
|
48
|
+
</template>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## What the Module Does
|
|
52
|
+
|
|
53
|
+
1. **CSS Injection** — Automatically loads the LiftKit core CSS (tokens, reset, component styles)
|
|
54
|
+
2. **Component Registration** — Registers all 35+ components for auto-import
|
|
55
|
+
3. **Runtime Plugin** — Initializes the theme system on app startup
|
|
56
|
+
|
|
57
|
+
## Color Mode
|
|
58
|
+
|
|
59
|
+
The `LkTheme` component supports automatic OS-based color mode detection:
|
|
60
|
+
|
|
61
|
+
```vue
|
|
62
|
+
<!-- Auto (default) — follows OS light/dark setting -->
|
|
63
|
+
<LkTheme color-mode="auto">
|
|
64
|
+
|
|
65
|
+
<!-- Force light or dark -->
|
|
66
|
+
<LkTheme color-mode="light">
|
|
67
|
+
<LkTheme color-mode="dark">
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Requirements
|
|
71
|
+
|
|
72
|
+
- Nuxt >= 4.0
|
|
73
|
+
- Vue >= 3.5
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
<a id="日本語"></a>
|
|
78
|
+
|
|
79
|
+
# @liftkit-vue/nuxt(日本語)
|
|
80
|
+
|
|
81
|
+
LiftKit Vue 用の Nuxt 4 モジュールです。全コンポーネントの自動インポートと CSS デザインシステムの注入を行います。
|
|
82
|
+
|
|
83
|
+
## インストール
|
|
84
|
+
|
|
85
|
+
> **注意**: npm パッケージは未公開です。GitHub からモノレポをインストールしてください:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pnpm add github:YOUR_USERNAME/liftkit-vue
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## セットアップ
|
|
92
|
+
|
|
93
|
+
`nuxt.config.ts` にモジュールを追加:
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
export default defineNuxtConfig({
|
|
97
|
+
modules: ['@liftkit-vue/nuxt'],
|
|
98
|
+
})
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## 使い方
|
|
102
|
+
|
|
103
|
+
全 LiftKit コンポーネントが自動インポートされます。レイアウトで `LkTheme` をラップしてください:
|
|
104
|
+
|
|
105
|
+
```vue
|
|
106
|
+
<!-- layouts/default.vue -->
|
|
107
|
+
<template>
|
|
108
|
+
<LkTheme source-color="#035eff">
|
|
109
|
+
<slot />
|
|
110
|
+
</LkTheme>
|
|
111
|
+
</template>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
ページ内で直接コンポーネントを使用できます:
|
|
115
|
+
|
|
116
|
+
```vue
|
|
117
|
+
<template>
|
|
118
|
+
<LkContainer>
|
|
119
|
+
<LkCard material="filled">
|
|
120
|
+
<LkText font-class="heading">Welcome</LkText>
|
|
121
|
+
<LkButton variant="fill" color="primary">Get Started</LkButton>
|
|
122
|
+
</LkCard>
|
|
123
|
+
</LkContainer>
|
|
124
|
+
</template>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## モジュールの機能
|
|
128
|
+
|
|
129
|
+
1. **CSS 注入** — LiftKit コア CSS(トークン、リセット、コンポーネントスタイル)を自動読み込み
|
|
130
|
+
2. **コンポーネント登録** — 35以上のコンポーネントを自動インポート用に登録
|
|
131
|
+
3. **ランタイムプラグイン** — アプリ起動時にテーマシステムを初期化
|
|
132
|
+
|
|
133
|
+
## カラーモード
|
|
134
|
+
|
|
135
|
+
`LkTheme` コンポーネントは OS ベースのカラーモード自動検出に対応しています:
|
|
136
|
+
|
|
137
|
+
```vue
|
|
138
|
+
<!-- Auto(デフォルト)— OS のライト/ダーク設定に追従 -->
|
|
139
|
+
<LkTheme color-mode="auto">
|
|
140
|
+
|
|
141
|
+
<!-- ライトまたはダークを強制 -->
|
|
142
|
+
<LkTheme color-mode="light">
|
|
143
|
+
<LkTheme color-mode="dark">
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## 要件
|
|
147
|
+
|
|
148
|
+
- Nuxt >= 4.0
|
|
149
|
+
- Vue >= 3.5
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, addPlugin, addComponent } from '@nuxt/kit';
|
|
2
|
+
|
|
3
|
+
const module$1 = defineNuxtModule({
|
|
4
|
+
meta: {
|
|
5
|
+
name: "@liftkit-vue/nuxt",
|
|
6
|
+
configKey: "liftkit"
|
|
7
|
+
},
|
|
8
|
+
defaults: {},
|
|
9
|
+
setup(_options, nuxt) {
|
|
10
|
+
const resolver = createResolver(import.meta.url);
|
|
11
|
+
const coreCssPath = resolver.resolve("../../core/src/css/index.css");
|
|
12
|
+
nuxt.options.css.push(coreCssPath);
|
|
13
|
+
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
14
|
+
const coreComponents = "../../core/src/components";
|
|
15
|
+
const components = [
|
|
16
|
+
// Layout
|
|
17
|
+
"LkContainer",
|
|
18
|
+
"LkColumn",
|
|
19
|
+
"LkRow",
|
|
20
|
+
"LkSection",
|
|
21
|
+
"LkGrid",
|
|
22
|
+
"LkPlaceholderBlock",
|
|
23
|
+
// Typography & Display
|
|
24
|
+
"LkHeading",
|
|
25
|
+
"LkText",
|
|
26
|
+
"LkBadge",
|
|
27
|
+
"LkIcon",
|
|
28
|
+
"LkImage",
|
|
29
|
+
"LkSticker",
|
|
30
|
+
// Material
|
|
31
|
+
"LkStateLayer",
|
|
32
|
+
"LkMaterialLayer",
|
|
33
|
+
// Interactive
|
|
34
|
+
"LkButton",
|
|
35
|
+
"LkIconButton",
|
|
36
|
+
"LkMenuItem",
|
|
37
|
+
"LkSwitch",
|
|
38
|
+
"LkTextInput",
|
|
39
|
+
// Tabs
|
|
40
|
+
"LkTabLink",
|
|
41
|
+
"LkTabMenu",
|
|
42
|
+
"LkTabs",
|
|
43
|
+
"LkTabContent",
|
|
44
|
+
// Complex
|
|
45
|
+
"LkCard",
|
|
46
|
+
"LkSelect",
|
|
47
|
+
"LkSnackbar",
|
|
48
|
+
"LkNavbar",
|
|
49
|
+
// Theme
|
|
50
|
+
"LkTheme",
|
|
51
|
+
"LkThemeController"
|
|
52
|
+
].map((name) => ({ name, path: `${coreComponents}/${name}.vue` }));
|
|
53
|
+
components.push(
|
|
54
|
+
{ name: "LkDropdown", path: `${coreComponents}/LkDropdown/LkDropdown.vue` },
|
|
55
|
+
{ name: "LkDropdownTrigger", path: `${coreComponents}/LkDropdown/LkDropdownTrigger.vue` },
|
|
56
|
+
{ name: "LkDropdownMenu", path: `${coreComponents}/LkDropdown/LkDropdownMenu.vue` }
|
|
57
|
+
);
|
|
58
|
+
for (const { name, path } of components) {
|
|
59
|
+
addComponent({
|
|
60
|
+
name,
|
|
61
|
+
filePath: resolver.resolve(path)
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export { module$1 as default };
|
|
File without changes
|
package/dist/types.d.mts
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@liftkit-vue/nuxt",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Nuxt 4 module for LiftKit Vue - auto-imports components and CSS design tokens",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "annrie",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/annrie/liftkit-vue",
|
|
11
|
+
"directory": "packages/nuxt"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/annrie/liftkit-vue/tree/main/packages/nuxt",
|
|
14
|
+
"bugs": "https://github.com/annrie/liftkit-vue/issues",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"nuxt",
|
|
17
|
+
"nuxt4",
|
|
18
|
+
"nuxt-module",
|
|
19
|
+
"vue",
|
|
20
|
+
"material-design",
|
|
21
|
+
"md3",
|
|
22
|
+
"design-system",
|
|
23
|
+
"liftkit"
|
|
24
|
+
],
|
|
25
|
+
"main": "./dist/module.mjs",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"import": "./dist/module.mjs",
|
|
29
|
+
"types": "./dist/types.d.mts"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": ["dist"],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "nuxt-module-build build",
|
|
35
|
+
"typecheck": "vue-tsc --noEmit"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@liftkit-vue/core": "workspace:*",
|
|
39
|
+
"@nuxt/kit": "^4.3.1"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
43
|
+
"@nuxt/schema": "^4.3.1",
|
|
44
|
+
"nuxt": "^4.3.1",
|
|
45
|
+
"vue": "^3.5.0",
|
|
46
|
+
"vue-tsc": "^2.2.0",
|
|
47
|
+
"typescript": "^5.7.0"
|
|
48
|
+
}
|
|
49
|
+
}
|