@1001-digital/layers.base 0.0.11 → 0.0.13

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.
@@ -0,0 +1,5 @@
1
+ export default defineAppConfig({
2
+ base: {
3
+ name: 'Hello from Nuxt layer'
4
+ },
5
+ })
@@ -230,11 +230,13 @@
230
230
  <div class="component-demo">
231
231
  <h4>Dismissable Tags</h4>
232
232
  <Tags>
233
- <Tag v-for="tag in dismissableTags" :key="tag" dismissable @dismiss="dismissableTags = dismissableTags.filter(t => t !== tag)">
233
+ <Tag v-for="tag in dismissableTags" :key="tag" dismissable
234
+ @dismiss="dismissableTags = dismissableTags.filter(t => t !== tag)">
234
235
  {{ tag }}
235
236
  </Tag>
236
237
  </Tags>
237
- <Button v-if="dismissableTags.length === 0" class="small" @click="dismissableTags = ['Dismissable 1', 'Dismissable 2', 'Dismissable 3']">
238
+ <Button v-if="dismissableTags.length === 0" class="small"
239
+ @click="dismissableTags = ['Dismissable 1', 'Dismissable 2', 'Dismissable 3']">
238
240
  Reset Tags
239
241
  </Button>
240
242
  </div>
@@ -389,10 +391,8 @@ const fontSizes = ['xs', 'sm', 'base', 'lg', 'xl', '2xl', '3xl']
389
391
  const sizes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
390
392
  const spacers = ['xs', 'sm', 'default', 'md', 'lg', 'xl']
391
393
  const iconTypes = [
392
- 'add', 'check', 'chevron-down', 'chevron-left', 'chevron-right',
393
- 'chevron-up', 'close', 'code', 'discord', 'edit', 'email',
394
- 'folder', 'github', 'home', 'image', 'link', 'loader',
395
- 'maximize', 'times', 'trash', 'twitter', 'user', 'website', 'withdraw'
394
+ 'lucide:plus', 'check', 'chevron-down', 'lucide:chevron-left', 'lucide:chevron-right',
395
+ 'close',
396
396
  ]
397
397
 
398
398
  const showDialog = ref(false)
@@ -8,5 +8,10 @@ export default defineNuxtConfig({
8
8
  // Use the generated ESLint config for lint root project as well
9
9
  rootDir: fileURLToPath(new URL('..', import.meta.url))
10
10
  }
11
- }
11
+ },
12
+ icon: {
13
+ aliases: {
14
+ close: 'ic:baseline-close',
15
+ },
16
+ },
12
17
  })
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 relies on Nuxt Icon aliases. Extending layers or apps can override or add aliases via `nuxt.config`:
18
+
19
+ ```ts
20
+ export default defineNuxtConfig({
21
+ icon: {
22
+ aliases: {
23
+ check: 'custom:check-circle',
24
+ add: 'heroicons:plus'
25
+ }
26
+ }
27
+ })
28
+ ```
@@ -1,20 +1,14 @@
1
1
  export default defineAppConfig({
2
- myLayer: {
2
+ base: {
3
3
  name: 'Hello from Nuxt layer'
4
4
  },
5
- icons: {
6
- map: {}
7
- }
8
5
  })
9
6
 
10
7
  declare module '@nuxt/schema' {
11
8
  interface AppConfigInput {
12
- myLayer?: {
9
+ base?: {
13
10
  /** Project name */
14
11
  name?: string
15
12
  }
16
- icons?: {
17
- map?: Record<string, string>
18
- }
19
13
  }
20
14
  }
@@ -1,48 +1,13 @@
1
+ <template>
2
+ <NuxtIcon v-if="iconName" :name="iconName" class="icon" />
3
+ </template>
4
+
1
5
  <script setup lang="ts">
2
6
  const props = defineProps<{ type: string }>()
3
- const appConfig = useAppConfig()
4
-
5
- const DEFAULT_ICON_MAP: Record<string, string> = {
6
- add: 'lucide:plus',
7
- check: 'lucide:check',
8
- 'chevron-down': 'lucide:chevron-down',
9
- 'chevron-left': 'lucide:chevron-left',
10
- 'chevron-right': 'lucide:chevron-right',
11
- 'chevron-up': 'lucide:chevron-up',
12
- close: 'lucide:x',
13
- copy: 'lucide:copy',
14
- code: 'lucide:code',
15
- discord: 'simple-icons:discord',
16
- edit: 'lucide:pencil',
17
- email: 'lucide:mail',
18
- folder: 'lucide:folder',
19
- github: 'simple-icons:github',
20
- home: 'lucide:home',
21
- help: 'lucide:circle-question-mark',
22
- image: 'lucide:image',
23
- link: 'lucide:link',
24
- loader: 'lucide:loader-2',
25
- maximize: 'lucide:maximize',
26
- times: 'lucide:x',
27
- trash: 'lucide:trash-2',
28
- twitter: 'simple-icons:x',
29
- user: 'lucide:user',
30
- website: 'lucide:globe',
31
- withdraw: 'lucide:undo',
32
- }
33
7
 
34
- const iconMap = computed(() => ({
35
- ...DEFAULT_ICON_MAP,
36
- ...(appConfig.icons?.map || {})
37
- }))
38
-
39
- const iconName = computed(() => iconMap.value[props.type] || props.type)
8
+ const iconName = computed(() => props.type)
40
9
  </script>
41
10
 
42
- <template>
43
- <NuxtIcon v-if="iconName" :name="iconName" class="icon" />
44
- </template>
45
-
46
11
  <style scoped>
47
12
  .icon {
48
13
  display: inline-flex;
package/nuxt.config.ts CHANGED
@@ -11,11 +11,19 @@ export default defineNuxtConfig({
11
11
 
12
12
  icon: {
13
13
  componentName: 'NuxtIcon',
14
+ aliases: {
15
+ check: 'lucide:check',
16
+ 'chevron-down': 'lucide:chevron-down',
17
+ close: 'lucide:x',
18
+ copy: 'lucide:copy',
19
+ help: 'lucide:circle-question-mark',
20
+ loader: 'lucide:loader-2',
21
+ }
14
22
  },
15
23
 
16
24
  css: [
17
25
  join(currentDir, './app/assets/styles/index.css'),
18
26
  ],
19
27
 
20
- compatibilityDate: '2026-01-28'
28
+ compatibilityDate: '2026-01-28',
21
29
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@1001-digital/layers.base",
3
3
  "type": "module",
4
- "version": "0.0.11",
4
+ "version": "0.0.13",
5
5
  "main": "./nuxt.config.ts",
6
6
  "devDependencies": {
7
7
  "@iconify-json/lucide": "^1.2.87",
@@ -1,5 +0,0 @@
1
- export default defineAppConfig({
2
- myLayer: {
3
- name: 'My amazing Nuxt layer (overwritten)'
4
- }
5
- })
File without changes