@indielayer/ui 1.17.0 → 1.18.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.
Files changed (47) hide show
  1. package/README.md +2 -2
  2. package/docs/assets/css/tailwind.css +6 -0
  3. package/docs/components/common/CodePreview.vue +14 -9
  4. package/docs/components/common/DocsFeatures.vue +41 -0
  5. package/docs/components/common/DocsHero.vue +216 -0
  6. package/docs/components/common/DocumentPage.vue +99 -112
  7. package/docs/components/common/ExampleBlocks.vue +157 -0
  8. package/docs/components/toolbar/Toolbar.vue +11 -2
  9. package/docs/components/toolbar/ToolbarColorToggle.vue +4 -4
  10. package/docs/components/toolbar/ToolbarSearch.vue +59 -62
  11. package/docs/composables/useDocMeta.ts +47 -0
  12. package/docs/icons.ts +28 -0
  13. package/docs/layouts/default.vue +1 -3
  14. package/docs/layouts/simple.vue +3 -1
  15. package/docs/main.ts +5 -0
  16. package/docs/pages/colors.vue +56 -47
  17. package/docs/pages/component/select/size.vue +1 -1
  18. package/docs/pages/component/select/usage.vue +14 -7
  19. package/docs/pages/error.vue +5 -3
  20. package/docs/pages/icons.vue +64 -54
  21. package/docs/pages/index.vue +93 -82
  22. package/docs/pages/typography.vue +38 -28
  23. package/docs/router/index.ts +31 -3
  24. package/docs/search/components.json +1 -1
  25. package/docs/search/index.json +1 -0
  26. package/lib/components/container/theme/Container.base.theme.js +1 -1
  27. package/lib/components/divider/theme/Divider.base.theme.js +1 -1
  28. package/lib/components/input/Input.vue.js +23 -24
  29. package/lib/components/select/Select.vue.d.ts +16 -27
  30. package/lib/components/select/Select.vue.js +451 -344
  31. package/lib/index.js +1 -1
  32. package/lib/index.umd.js +4 -4
  33. package/lib/version.d.ts +1 -1
  34. package/lib/version.js +1 -1
  35. package/lib/virtual/components/virtualList/VirtualList.vue.js +33 -31
  36. package/lib/virtual/components/virtualList/useDynamicRowHeight.js +18 -19
  37. package/package.json +8 -3
  38. package/src/components/container/theme/Container.base.theme.ts +1 -1
  39. package/src/components/divider/theme/Divider.base.theme.ts +1 -1
  40. package/src/components/input/Input.vue +1 -2
  41. package/src/components/select/Select.vue +94 -18
  42. package/src/version.ts +1 -1
  43. package/src/virtual/components/virtualList/VirtualList.test.ts +143 -26
  44. package/src/virtual/components/virtualList/VirtualList.vue +12 -18
  45. package/src/virtual/components/virtualList/useDynamicRowHeight.test.ts +22 -8
  46. package/src/virtual/components/virtualList/useDynamicRowHeight.ts +4 -2
  47. package/src/virtual/utils/parseNumericStyleValue.ts +2 -0
@@ -1,6 +1,13 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref } from 'vue'
3
3
  import { useColors, useNotifications, colors as TailwindColors } from '@indielayer/ui'
4
+ import { useDocMeta } from '../composables/useDocMeta'
5
+
6
+ useDocMeta({
7
+ title: 'Colors',
8
+ description: 'Color palette, semantic tokens, and color props on Indielayer UI components.',
9
+ path: '/colors',
10
+ })
4
11
 
5
12
  const notifications = useNotifications()
6
13
  const { getPalette } = useColors()
@@ -23,44 +30,45 @@ function copyPalette(val: any) {
23
30
  </script>
24
31
 
25
32
  <template>
26
- <h1 class="text-4xl font-semibold">Colors</h1>
27
- <h2 class="text-lg my-2 text-gray-500 dark:text-gray-400">Generate your own palettes, use Tailwind's or use color prop to generate at runtime</h2>
28
- <x-divider class="mt-4 mb-8"/>
29
-
30
- <h2 class="text-2xl mb-2">Generate your own palettes</h2>
31
- <p class="mb-8 text-gray-500 dark:text-gray-400">Generate your own color palette like Tailwind. With the same properties as Tailwind color palettes.</p>
32
- <p class="font-medium"></p>
33
- <div class="mt-4">
34
- <x-input v-model="color500" label="Change here the middle value (500) to generate a new palette"/>
35
- </div>
36
- <div class="grid grid-cols-11 my-4 text-sm">
37
- <div v-for="shade in Object.keys(palette)" :key="shade" class="h-32 flex items-center justify-center" :style="`background-color: ${palette[shade]}`">{{ shade }}</div>
38
- </div>
33
+ <div class="docs-container">
34
+ <h1 class="text-4xl font-semibold">Colors</h1>
35
+ <h2 class="text-lg my-2 text-gray-500 dark:text-gray-400">Generate your own palettes, use Tailwind's or use color prop to generate at runtime</h2>
36
+ <x-divider class="mt-4 mb-8"/>
37
+
38
+ <h2 class="text-2xl mb-2">Generate your own palettes</h2>
39
+ <p class="mb-8 text-gray-500 dark:text-gray-400">Generate your own color palette like Tailwind. With the same properties as Tailwind color palettes.</p>
40
+ <p class="font-medium"></p>
41
+ <div class="mt-4">
42
+ <x-input v-model="color500" label="Change here the middle value (500) to generate a new palette"/>
43
+ </div>
44
+ <div class="grid grid-cols-11 my-4 text-sm">
45
+ <div v-for="shade in Object.keys(palette)" :key="shade" class="h-32 flex items-center justify-center" :style="`background-color: ${palette[shade]}`">{{ shade }}</div>
46
+ </div>
39
47
 
40
- <x-button icon-left="copy" :color="color500" block @click="copyPalette(palette)">Copy Palette</x-button>
48
+ <x-button icon-left="copy" :color="color500" block @click="copyPalette(palette)">Copy Palette</x-button>
41
49
 
42
- <p class="text-gray-500 dark:text-gray-400 mt-4">This is the generated palette when you use the color directly on the color prop like &#x3C;x-button <b>color="#10B981"</b>&#x3E;Hello&#x3C;/x-button&#x3E;</p>
50
+ <p class="text-gray-500 dark:text-gray-400 mt-4">This is the generated palette when you use the color directly on the color prop like &#x3C;x-button <b>color="#10B981"</b>&#x3E;Hello&#x3C;/x-button&#x3E;</p>
43
51
 
44
- <x-divider class="mt-4 mb-8"/>
52
+ <x-divider class="mt-4 mb-8"/>
45
53
 
46
- <h2 class="text-2xl mb-2">Theme colors</h2>
47
- <p class="mb-8 text-gray-500 dark:text-gray-400">Default theme color names and how to customize them.</p>
54
+ <h2 class="text-2xl mb-2">Theme colors</h2>
55
+ <p class="mb-8 text-gray-500 dark:text-gray-400">Default theme color names and how to customize them.</p>
48
56
 
49
- <p>The default theme color names are
50
- <b class="text-primary-500">primary</b>,
51
- <b class="text-secondary-500">secondary</b>,
52
- <b class="text-success-500">success</b>,
53
- <b class="text-warning-500">warning</b> and
54
- <b class="text-error-500">error</b>.
55
- You can customize them or even add your own.
56
- </p>
57
+ <p>The default theme color names are
58
+ <b class="text-primary-500">primary</b>,
59
+ <b class="text-secondary-500">secondary</b>,
60
+ <b class="text-success-500">success</b>,
61
+ <b class="text-warning-500">warning</b> and
62
+ <b class="text-error-500">error</b>.
63
+ You can customize them or even add your own.
64
+ </p>
57
65
 
58
- <p class="my-4"></p>
66
+ <p class="my-4"></p>
59
67
 
60
- <p class="my-2">Customize the color prop, e.g. <b>color="primary"</b> on the UI initialization.</p>
61
- <code-snippet
62
- lang="js"
63
- :code="`import { createApp } from 'vue'
68
+ <p class="my-2">Customize the color prop, e.g. <b>color="primary"</b> on the UI initialization.</p>
69
+ <code-snippet
70
+ lang="js"
71
+ :code="`import { createApp } from 'vue'
64
72
  import UI, { colors } from '@indielayer/ui'
65
73
 
66
74
  const app = createApp(App)
@@ -76,14 +84,14 @@ app.use(UI, {
76
84
  },
77
85
  }
78
86
  })`"
79
- />
87
+ />
80
88
 
81
- <p class="my-4">Allow you to use the Tailwind classes like <b>text-primary-500</b>, <b>bg-primary-500</b>, etc:</p>
89
+ <p class="my-4">Allow you to use the Tailwind classes like <b>text-primary-500</b>, <b>bg-primary-500</b>, etc:</p>
82
90
 
83
- <div>
84
- <code-snippet
85
- lang="js"
86
- :code="`// tailwind.config.js
91
+ <div>
92
+ <code-snippet
93
+ lang="js"
94
+ :code="`// tailwind.config.js
87
95
  //...
88
96
  const colors = require('tailwindcss/colors')
89
97
 
@@ -101,19 +109,20 @@ module.exports = {
101
109
  },
102
110
  },
103
111
  }`"
104
- />
105
- </div>
112
+ />
113
+ </div>
106
114
 
107
- <x-divider class="mt-4 mb-8"/>
115
+ <x-divider class="mt-4 mb-8"/>
108
116
 
109
- <h2 class="text-2xl mb-2">Tailwind Colors</h2>
110
- <p class="mb-8 text-gray-500 dark:text-gray-400">Default tailwind color palettes.</p>
117
+ <h2 class="text-2xl mb-2">Tailwind Colors</h2>
118
+ <p class="mb-8 text-gray-500 dark:text-gray-400">Default tailwind color palettes.</p>
111
119
 
112
- <div class="grid gap-6 grid-cols-1 md:grid-cols-2 text-xs">
113
- <div v-for="(pal, key) in TailwindColors" :key="key">
114
- <div class="text-overline mb-2">{{ key }}</div>
115
- <div class="grid grid-cols-11">
116
- <div v-for="(color, palKey) in pal" :key="palKey" class="h-32 flex items-center justify-center" :style="`background-color: ${color}`">{{ palKey }}</div>
120
+ <div class="grid gap-6 grid-cols-1 md:grid-cols-2 text-xs">
121
+ <div v-for="(pal, key) in TailwindColors" :key="key">
122
+ <div class="text-overline mb-2">{{ key }}</div>
123
+ <div class="grid grid-cols-11">
124
+ <div v-for="(color, palKey) in pal" :key="palKey" class="h-32 flex items-center justify-center" :style="`background-color: ${color}`">{{ palKey }}</div>
125
+ </div>
117
126
  </div>
118
127
  </div>
119
128
  </div>
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { ref } from 'vue'
3
3
 
4
- const selected = ref<undefined | string>()
4
+ const selected = ref<string>()
5
5
  const options = ref([
6
6
  { value: 'A', label: 'Option A' },
7
7
  { value: 'B', label: 'Option B' },
@@ -1,9 +1,10 @@
1
1
  <script setup lang="ts">
2
2
  import { ref } from 'vue'
3
+ import type { SelectOption } from '@indielayer/ui'
3
4
 
4
- const selected = ref<undefined | string>()
5
- const selected2 = ref<undefined | string>()
6
- const options = ref([
5
+ const selected = ref<string>()
6
+ const selected2 = ref<string>()
7
+ const options = ref<SelectOption[]>([
7
8
  { value: 'A', label: 'Option A' },
8
9
  { value: 'B', label: 'Option B' },
9
10
  { value: 'C', label: 'Option C' },
@@ -11,16 +12,16 @@ const options = ref([
11
12
 
12
13
  // function to generate
13
14
  function genOptions(x: number) {
14
- const options = []
15
+ const options: SelectOption[] = []
15
16
 
16
17
  for (let i = 0; i < x; i++) {
17
- options.push({ value: i.toString(), label: 'Option ' + i, suffix: i })
18
+ options.push({ value: i.toString(), label: 'Option ' + i, prefix: 'bg-green-500', suffix: 'dude' + i.toString() })
18
19
  }
19
20
 
20
21
  return options
21
22
  }
22
23
 
23
- const options2 = ref(genOptions(1000))
24
+ const options2 = ref<SelectOption[]>(genOptions(1000))
24
25
  </script>
25
26
 
26
27
  <template>
@@ -39,13 +40,18 @@ const options2 = ref(genOptions(1000))
39
40
  label="Filterable - virtual list"
40
41
  placeholder="Placeholder"
41
42
  filterable
43
+ filterable-prefix
44
+ filterable-suffix
42
45
  clearable
43
46
  virtual-list
44
47
  :virtual-list-item-height="33"
45
48
  :options="options2"
46
49
  >
50
+ <template #prefix="{ item }">
51
+ <div class="w-2 h-2 shrink-0 rounded-full text-xs" :class="item.prefix"></div>
52
+ </template>
47
53
  <template #suffix="{ item }">
48
- <span class="text-secondary-400 text-xs font-mono w-2">#{{ item.suffix }}</span>
54
+ <span class="text-secondary-400 text-xs font-mono">#{{ item.suffix }}</span>
49
55
  </template>
50
56
  </x-select>
51
57
  <x-select
@@ -57,6 +63,7 @@ const options2 = ref(genOptions(1000))
57
63
  >
58
64
  <template #input="{ popover, label, disabled }">
59
65
  <button
66
+ type="button"
60
67
  class="w-full text-left border rounded-md px-3 py-2"
61
68
  :disabled="disabled"
62
69
  @click="popover?.show()"
@@ -1,6 +1,8 @@
1
1
  <template>
2
- <div class="text-center px-8 py-20">
3
- <img class="mb-5 mx-auto max-w-80 max-h-80" src="../assets/images/error.svg" />
4
- <h2 class="text-h3">Page not found</h2>
2
+ <div class="docs-container text-center px-8 py-20">
3
+ <img class="mb-5 mx-auto max-w-80 max-h-80" src="../assets/images/error.svg" alt="" />
4
+ <h1 class="text-h2 mb-2">Page not found</h1>
5
+ <p class="text-gray-500 dark:text-gray-400 mb-8">The page you are looking for does not exist.</p>
6
+ <x-button to="/getting-started" color="primary">Back to docs</x-button>
5
7
  </div>
6
8
  </template>
@@ -1,4 +1,12 @@
1
1
  <script setup lang="ts">
2
+ import { useDocMeta } from '../composables/useDocMeta'
3
+
4
+ useDocMeta({
5
+ title: 'Icons',
6
+ description: 'Custom icon set integration for Indielayer UI components.',
7
+ path: '/icons',
8
+ })
9
+
2
10
  const iconExample = `// icons.js
3
11
  export default {
4
12
  check: '<polyline points="20 6 9 17 4 12"></polyline>'
@@ -35,64 +43,66 @@ const iconExample2 = `<template>
35
43
  </script>
36
44
 
37
45
  <template>
38
- <h2 class="text-4xl font-semibold">Icons</h2>
39
- <h1 class="text-lg my-2 text-gray-500 dark:text-gray-400">Building your own SVG icon library from multiple open source libraries</h1>
40
- <x-divider class="mt-4 mb-8"/>
46
+ <div class="docs-container">
47
+ <h2 class="text-4xl font-semibold">Icons</h2>
48
+ <h1 class="text-lg my-2 text-gray-500 dark:text-gray-400">Building your own SVG icon library from multiple open source libraries</h1>
49
+ <x-divider class="mt-4 mb-8"/>
41
50
 
42
- <p class="text-xl mt-8 my-4">SVG Icon Libraries</p>
43
- <div class="font-bold text-lg">
44
- <ul>
45
- <li><x-link
46
- external
47
- color="sky"
48
- underline
49
- href="https://icones.js.org/"
50
- target="_blank"
51
- >Icônes - All the libraries</x-link></li>
52
- <li><x-link
53
- external
54
- color="sky"
55
- underline
56
- href="https://heroicons.com/"
57
- target="_blank"
58
- >Hero Icons (MIT)</x-link></li>
59
- <li><x-link
60
- external
61
- color="sky"
62
- underline
63
- href="https://tabler-icons.io/"
64
- target="_blank"
65
- >Tabler Icons (MIT)</x-link></li>
66
- <li><x-link
67
- external
68
- color="sky"
69
- underline
70
- href="https://feathericons.com/"
71
- target="_blank"
72
- >Feather Icons (MIT)</x-link></li>
73
- </ul>
74
- </div>
51
+ <p class="text-xl mt-8 my-4">SVG Icon Libraries</p>
52
+ <div class="font-bold text-lg">
53
+ <ul>
54
+ <li><x-link
55
+ external
56
+ color="sky"
57
+ underline
58
+ href="https://icones.js.org/"
59
+ target="_blank"
60
+ >Icônes - All the libraries</x-link></li>
61
+ <li><x-link
62
+ external
63
+ color="sky"
64
+ underline
65
+ href="https://heroicons.com/"
66
+ target="_blank"
67
+ >Hero Icons (MIT)</x-link></li>
68
+ <li><x-link
69
+ external
70
+ color="sky"
71
+ underline
72
+ href="https://tabler-icons.io/"
73
+ target="_blank"
74
+ >Tabler Icons (MIT)</x-link></li>
75
+ <li><x-link
76
+ external
77
+ color="sky"
78
+ underline
79
+ href="https://feathericons.com/"
80
+ target="_blank"
81
+ >Feather Icons (MIT)</x-link></li>
82
+ </ul>
83
+ </div>
75
84
 
76
- <h3 class="text-2xl mt-8 mb-4">1. Create the icons file -> <strong>icons.js</strong></h3>
77
- <code-snippet
78
- lang="js"
79
- :code="iconExample"
80
- />
85
+ <h3 class="text-2xl mt-8 mb-4">1. Create the icons file -> <strong>icons.js</strong></h3>
86
+ <code-snippet
87
+ lang="js"
88
+ :code="iconExample"
89
+ />
81
90
 
82
- <h3 class="text-2xl mt-8 mb-4">2. Add icons on UI install options -> <strong>main.js</strong></h3>
83
- <code-snippet
84
- lang="js"
85
- :code="installExample"
86
- />
91
+ <h3 class="text-2xl mt-8 mb-4">2. Add icons on UI install options -> <strong>main.js</strong></h3>
92
+ <code-snippet
93
+ lang="js"
94
+ :code="installExample"
95
+ />
87
96
 
88
- <h3 class="text-2xl mt-8 mb-4">3. Add icons from open source libraries</h3>
89
- <p class="mb-2 text-xl">Start adding the icons you need.</p>
90
- <p class="mb-2">SVG wrapper optional, copy only the content part of the SVG:</p>
91
- <p class="mb-4 border dark:border-gray-600 rounded-md p-4">&#x3C;svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; width=&#x22;24&#x22; height=&#x22;24&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22; stroke=&#x22;currentColor&#x22; stroke-width=&#x22;2&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; class=&#x22;feather feather-check&#x22;&#x3E;<strong>&#x3C;polyline points=&#x22;20 6 9 17 4 12&#x22;&#x3E;&#x3C;/polyline&#x3E;</strong>&#x3C;/svg&#x3E;</p>
92
- <code-snippet lang="js" :code="iconExample1"/>
97
+ <h3 class="text-2xl mt-8 mb-4">3. Add icons from open source libraries</h3>
98
+ <p class="mb-2 text-xl">Start adding the icons you need.</p>
99
+ <p class="mb-2">SVG wrapper optional, copy only the content part of the SVG:</p>
100
+ <p class="mb-4 border dark:border-gray-600 rounded-md p-4">&#x3C;svg xmlns=&#x22;http://www.w3.org/2000/svg&#x22; width=&#x22;24&#x22; height=&#x22;24&#x22; viewBox=&#x22;0 0 24 24&#x22; fill=&#x22;none&#x22; stroke=&#x22;currentColor&#x22; stroke-width=&#x22;2&#x22; stroke-linecap=&#x22;round&#x22; stroke-linejoin=&#x22;round&#x22; class=&#x22;feather feather-check&#x22;&#x3E;<strong>&#x3C;polyline points=&#x22;20 6 9 17 4 12&#x22;&#x3E;&#x3C;/polyline&#x3E;</strong>&#x3C;/svg&#x3E;</p>
101
+ <code-snippet lang="js" :code="iconExample1"/>
93
102
 
94
- <div class="my-4">
95
- Icon "check" <x-icon icon="check"/>
103
+ <div class="my-4">
104
+ Icon "check" <x-icon icon="check"/>
105
+ </div>
106
+ <code-snippet lang="js" :code="iconExample2"/>
96
107
  </div>
97
- <code-snippet lang="js" :code="iconExample2"/>
98
108
  </template>
@@ -1,57 +1,73 @@
1
+ <script setup lang="ts">
2
+ import DocsHero from '../components/common/DocsHero.vue'
3
+ import DocsFeatures from '../components/common/DocsFeatures.vue'
4
+ import { useDocMeta } from '../composables/useDocMeta'
5
+
6
+ useDocMeta({
7
+ title: 'Indielayer UI',
8
+ description: 'Tailwind CSS UI components for Vue.js 3 and Nuxt.js 3. Build and prototype fast web applications.',
9
+ path: '/getting-started',
10
+ })
11
+ </script>
12
+
1
13
  <template>
2
- <h2 class="text-4xl font-semibold">Getting Started</h2>
3
- <h1 class="text-lg my-2 text-gray-500 dark:text-gray-400">Tailwind CSS UI components for Vue.js 3 / Nuxt.js 3. Build and prototype fast web applications.</h1>
4
- <x-divider class="mt-4 mb-8"/>
14
+ <docs-hero />
15
+ <docs-features />
16
+
17
+ <div class="docs-container">
18
+ <section id="installation">
19
+ <h2 class="text-h3 mb-2">Getting started</h2>
20
+ <p class="text-gray-500 dark:text-gray-400 mb-8">
21
+ Tailwind CSS UI components for Vue.js 3 / Nuxt.js 3. Build and prototype fast web applications.
22
+ </p>
5
23
 
6
- <h3 class="text-2xl mb-4">Quickstart a new Vue 3 or Nuxt 3 project</h3>
7
- <p class="my-4">
8
- This following command will install and execute <x-link
9
- external
10
- href="https://github.com/indielayer/ui/tree/main/packages/create-ui"
11
- target="_blank"
12
- shadow
13
- color="primary"
14
- >@indielayer/create-ui</x-link>, the official Indielayer UI project scaffolding tool. You will be presented with prompts for a number of optional features such as TypeScript.
15
- </p>
16
- <code-snippet :code="`npm init @indielayer/ui`" lang="bash"/>
17
- <pre class="bg-slate-600 text-slate-50 text-xs mt-4 px-4 py-2 rounded-md">? Project type: › - Use arrow-keys. Return to submit.
24
+ <h3 class="text-2xl mb-4">Quickstart a new Vue 3 or Nuxt 3 project</h3>
25
+ <p class="my-4">
26
+ This following command will install and execute <x-link
27
+ external
28
+ href="https://github.com/indielayer/ui/tree/main/packages/create-ui"
29
+ target="_blank"
30
+ shadow
31
+ color="primary"
32
+ >@indielayer/create-ui</x-link>, the official Indielayer UI project scaffolding tool. You will be presented with prompts for a number of optional features such as TypeScript.
33
+ </p>
34
+ <code-snippet :code="`pnpm create @indielayer/ui`" lang="bash"/>
35
+ <pre class="bg-slate-600 text-slate-50 text-xs mt-4 px-4 py-2 rounded-md">? Project type: › - Use arrow-keys. Return to submit.
18
36
  ❯ Vue 3
19
37
  Nuxt 3</pre>
20
38
 
21
- <h3 class="text-2xl mt-16 mb-4 text-gray-500">Manual guide</h3>
22
- <h3 class="text-2xl mb-4">1. Install via package manager</h3>
23
- <multi-snippet
24
- :snippets="[{
25
- label: 'npm',
26
- lang: 'bash',
27
- code: 'npm install @indielayer/ui'
28
- }, {
29
- label: 'yarn',
30
- lang: 'bash',
31
- code: 'yarn add @indielayer/ui'
32
- }, {
33
- label: 'pnpm',
34
- lang: 'bash',
35
- code: 'pnpm add @indielayer/ui'
36
- }]"
37
- />
39
+ <h3 class="text-2xl mt-16 mb-4 text-gray-500">Manual guide</h3>
40
+ <h3 class="text-2xl mb-4">1. Install via package manager</h3>
41
+ <multi-snippet
42
+ :snippets="[{
43
+ label: 'npm',
44
+ lang: 'bash',
45
+ code: 'npm install @indielayer/ui'
46
+ }, {
47
+ label: 'yarn',
48
+ lang: 'bash',
49
+ code: 'yarn add @indielayer/ui'
50
+ }, {
51
+ label: 'pnpm',
52
+ lang: 'bash',
53
+ code: 'pnpm add @indielayer/ui'
54
+ }]"
55
+ />
38
56
 
39
- <h3 class="text-2xl mt-8 mb-4">2. Setup TailwindCSS</h3>
40
- <p>If you do not have Tailwind CSS 3 installed in your project, please see the <x-link href="https://tailwindcss.com/docs/guides/vite" external shadow color="primary">Tailwind 3 Vite install guide here</x-link> before proceeding.</p>
41
- <p class="my-4">
42
- Add Indielayer Tailwind CSS preset <b>tailwind.preset.js</b> to your Tailwind CSS configuration file tailwind.config.js and <b>purge css configurations.</b>
43
- </p>
44
- <code-snippet
45
- lang="js"
46
- :code="`// tailwind.config.js
57
+ <h3 class="text-2xl mt-8 mb-4">2. Setup TailwindCSS</h3>
58
+ <p>If you do not have Tailwind CSS 3 installed in your project, please see the <x-link href="https://tailwindcss.com/docs/guides/vite" external shadow color="primary">Tailwind 3 Vite install guide here</x-link> before proceeding.</p>
59
+ <p class="my-4">
60
+ Add Indielayer Tailwind CSS preset <b>tailwind.preset.js</b> to your Tailwind CSS configuration file tailwind.config.js and <b>purge css configurations.</b>
61
+ </p>
62
+ <code-snippet
63
+ lang="js"
64
+ :code="`// tailwind.config.js
47
65
  const colors = require('tailwindcss/colors')
48
66
  const indielayer = require('@indielayer/ui/tailwind.preset')
49
67
 
50
68
  module.exports = {
51
69
  darkMode: 'class',
52
- // load indielayer ui presets
53
70
  presets: [indielayer()],
54
- // allow PurgeCSS to analyze components
55
71
  content: [
56
72
  './index.html',
57
73
  './**/*.vue',
@@ -71,12 +87,12 @@ module.exports = {
71
87
  },
72
88
  plugins: [],
73
89
  }`"
74
- />
75
- <h3 class="text-2xl mt-8 mb-4">3. Load the UI in your project</h3>
76
- <h4 class="text-xl mt-8 mb-4">Load on a Vue 3 project</h4>
77
- <code-snippet
78
- lang="js"
79
- :code="`import { createApp } from 'vue'
90
+ />
91
+ <h3 class="text-2xl mt-8 mb-4">3. Load the UI in your project</h3>
92
+ <h4 class="text-xl mt-8 mb-4">Load on a Vue 3 project</h4>
93
+ <code-snippet
94
+ lang="js"
95
+ :code="`import { createApp } from 'vue'
80
96
  import UI, { BaseTheme } from '@indielayer/ui'
81
97
 
82
98
  const app = createApp(App)
@@ -84,38 +100,31 @@ const app = createApp(App)
84
100
  app.use(UI, {
85
101
  theme: BaseTheme,
86
102
  })`"
87
- />
88
- <h4 class="text-xl mt-8 mb-4">Load on a Nuxt 3 project</h4>
89
- <multi-snippet
90
- class="my-4"
91
- :snippets="[{
92
- label: 'npm',
93
- lang: 'bash',
94
- code: 'npm install @indielayer/ui @vueuse/core floating-vue @vuepic/vue-datepicker -D'
95
- }, {
96
- label: 'yarn',
97
- lang: 'bash',
98
- code: 'yarn add @indielayer/ui @vueuse/core floating-vue @vuepic/vue-datepicker -D'
99
- }, {
100
- label: 'pnpm',
101
- lang: 'bash',
102
- code: 'pnpm add @indielayer/ui @vueuse/core floating-vue @vuepic/vue-datepicker -D'
103
- }]"
104
- />
105
- <code-snippet
106
- lang="js"
107
- :code="`
108
- // https://nuxt.com/docs/api/configuration/nuxt-config
109
- export default defineNuxtConfig({
103
+ />
104
+ <h4 class="text-xl mt-8 mb-4">Load on a Nuxt 3 project</h4>
105
+ <multi-snippet
106
+ class="my-4"
107
+ :snippets="[{
108
+ label: 'npm',
109
+ lang: 'bash',
110
+ code: 'npm install @indielayer/ui @vueuse/core floating-vue @vuepic/vue-datepicker -D'
111
+ }, {
112
+ label: 'yarn',
113
+ lang: 'bash',
114
+ code: 'yarn add @indielayer/ui @vueuse/core floating-vue @vuepic/vue-datepicker -D'
115
+ }, {
116
+ label: 'pnpm',
117
+ lang: 'bash',
118
+ code: 'pnpm add @indielayer/ui @vueuse/core floating-vue @vuepic/vue-datepicker -D'
119
+ }]"
120
+ />
121
+ <code-snippet
122
+ lang="js"
123
+ :code="`export default defineNuxtConfig({
110
124
  modules: [
111
125
  ['@indielayer/ui/nuxt'],
112
126
  ],
113
127
  css: ['~/assets/tailwind.css'],
114
- /**
115
- * @tailwind base;
116
- * @tailwind components;
117
- * @tailwind utilities;
118
- */
119
128
  postcss: {
120
129
  plugins: {
121
130
  'tailwindcss/nesting': {},
@@ -124,11 +133,11 @@ export default defineNuxtConfig({
124
133
  },
125
134
  },
126
135
  })`"
127
- />
128
- <h3 class="text-2xl mt-8 mb-4">4. (optional) Load only the components you want</h3>
129
- <code-snippet
130
- lang="js"
131
- :code="`import { createApp } from 'vue'
136
+ />
137
+ <h3 class="text-2xl mt-8 mb-4">4. (optional) Load only the components you want</h3>
138
+ <code-snippet
139
+ lang="js"
140
+ :code="`import { createApp } from 'vue'
132
141
  import { createUI, BaseTheme, XButton, XAlert } from '@indielayer/ui'
133
142
 
134
143
  const app = createApp(App)
@@ -139,5 +148,7 @@ const UI = createUI({
139
148
  })
140
149
 
141
150
  app.use(UI)`"
142
- />
151
+ />
152
+ </section>
153
+ </div>
143
154
  </template>