@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 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
+ }
@@ -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 ICON_MAP: Record<string, string> = {
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 iconName = computed(() => ICON_MAP[props.type] || props.type)
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.10",
4
+ "version": "0.0.12",
5
5
  "main": "./nuxt.config.ts",
6
6
  "devDependencies": {
7
- "@iconify-json/lucide": "^1.2.81",
8
- "@iconify-json/simple-icons": "^1.2.63",
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
@@ -1,14 +0,0 @@
1
- export default defineAppConfig({
2
- myLayer: {
3
- name: 'Hello from Nuxt layer'
4
- }
5
- })
6
-
7
- declare module '@nuxt/schema' {
8
- interface AppConfigInput {
9
- myLayer?: {
10
- /** Project name */
11
- name?: string
12
- }
13
- }
14
- }
File without changes
File without changes