@1001-digital/layers.base 0.0.10 → 0.0.12
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 +15 -0
- package/app/app.config.ts +20 -0
- package/app/components/Icon.vue +8 -2
- package/package.json +3 -3
- package/app.config.ts +0 -14
- /package/.playground/{app.config.ts → app/app.config.ts} +0 -0
- /package/.playground/{app.vue → app/app.vue} +0 -0
- /package/.playground/{pages → app/pages}/index.vue +0 -0
package/README.md
CHANGED
|
@@ -11,3 +11,18 @@ pnpm install
|
|
|
11
11
|
## Development
|
|
12
12
|
|
|
13
13
|
Running `pnpm dev` will prepare and boot `.playground` directory, which imports the layer itself.
|
|
14
|
+
|
|
15
|
+
## Icons
|
|
16
|
+
|
|
17
|
+
The base `Icon` component includes a default semantic icon map. Extending layers or apps can override or add entries via `app.config`:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
export default defineAppConfig({
|
|
21
|
+
icons: {
|
|
22
|
+
map: {
|
|
23
|
+
check: 'custom:check-circle',
|
|
24
|
+
add: 'heroicons:plus'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default defineAppConfig({
|
|
2
|
+
base: {
|
|
3
|
+
name: 'Hello from Nuxt layer',
|
|
4
|
+
icons: {
|
|
5
|
+
map: {}
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
declare module '@nuxt/schema' {
|
|
11
|
+
interface AppConfigInput {
|
|
12
|
+
base?: {
|
|
13
|
+
/** Project name */
|
|
14
|
+
name?: string,
|
|
15
|
+
icons?: {
|
|
16
|
+
map?: Record<string, string>
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
package/app/components/Icon.vue
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
const props = defineProps<{ type: string }>()
|
|
3
|
+
const appConfig = useAppConfig()
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
+
const DEFAULT_ICON_MAP: Record<string, string> = {
|
|
5
6
|
add: 'lucide:plus',
|
|
6
7
|
check: 'lucide:check',
|
|
7
8
|
'chevron-down': 'lucide:chevron-down',
|
|
@@ -30,7 +31,12 @@ const ICON_MAP: Record<string, string> = {
|
|
|
30
31
|
withdraw: 'lucide:undo',
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
const
|
|
34
|
+
const iconMap = computed(() => ({
|
|
35
|
+
...DEFAULT_ICON_MAP,
|
|
36
|
+
...(appConfig.icons?.map || {})
|
|
37
|
+
}))
|
|
38
|
+
|
|
39
|
+
const iconName = computed(() => iconMap.value[props.type] || props.type)
|
|
34
40
|
</script>
|
|
35
41
|
|
|
36
42
|
<template>
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1001-digital/layers.base",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"main": "./nuxt.config.ts",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@iconify-json/lucide": "^1.2.
|
|
8
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
7
|
+
"@iconify-json/lucide": "^1.2.87",
|
|
8
|
+
"@iconify-json/simple-icons": "^1.2.69",
|
|
9
9
|
"@nuxt/eslint": "latest",
|
|
10
10
|
"@types/node": "^24.10.1",
|
|
11
11
|
"eslint": "^9.39.1",
|
package/app.config.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|