@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.
- package/README.md +2 -2
- package/docs/assets/css/tailwind.css +6 -0
- package/docs/components/common/CodePreview.vue +14 -9
- package/docs/components/common/DocsFeatures.vue +41 -0
- package/docs/components/common/DocsHero.vue +216 -0
- package/docs/components/common/DocumentPage.vue +99 -112
- package/docs/components/common/ExampleBlocks.vue +157 -0
- package/docs/components/toolbar/Toolbar.vue +11 -2
- package/docs/components/toolbar/ToolbarColorToggle.vue +4 -4
- package/docs/components/toolbar/ToolbarSearch.vue +59 -62
- package/docs/composables/useDocMeta.ts +47 -0
- package/docs/icons.ts +28 -0
- package/docs/layouts/default.vue +1 -3
- package/docs/layouts/simple.vue +3 -1
- package/docs/main.ts +5 -0
- package/docs/pages/colors.vue +56 -47
- package/docs/pages/component/select/size.vue +1 -1
- package/docs/pages/component/select/usage.vue +14 -7
- package/docs/pages/error.vue +5 -3
- package/docs/pages/icons.vue +64 -54
- package/docs/pages/index.vue +93 -82
- package/docs/pages/typography.vue +38 -28
- package/docs/router/index.ts +31 -3
- package/docs/search/components.json +1 -1
- package/docs/search/index.json +1 -0
- package/lib/components/container/theme/Container.base.theme.js +1 -1
- package/lib/components/divider/theme/Divider.base.theme.js +1 -1
- package/lib/components/input/Input.vue.js +23 -24
- package/lib/components/select/Select.vue.d.ts +16 -27
- package/lib/components/select/Select.vue.js +451 -344
- package/lib/index.js +1 -1
- package/lib/index.umd.js +4 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/virtual/components/virtualList/VirtualList.vue.js +33 -31
- package/lib/virtual/components/virtualList/useDynamicRowHeight.js +18 -19
- package/package.json +8 -3
- package/src/components/container/theme/Container.base.theme.ts +1 -1
- package/src/components/divider/theme/Divider.base.theme.ts +1 -1
- package/src/components/input/Input.vue +1 -2
- package/src/components/select/Select.vue +94 -18
- package/src/version.ts +1 -1
- package/src/virtual/components/virtualList/VirtualList.test.ts +143 -26
- package/src/virtual/components/virtualList/VirtualList.vue +12 -18
- package/src/virtual/components/virtualList/useDynamicRowHeight.test.ts +22 -8
- package/src/virtual/components/virtualList/useDynamicRowHeight.ts +4 -2
- package/src/virtual/utils/parseNumericStyleValue.ts +2 -0
package/docs/pages/colors.vue
CHANGED
|
@@ -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
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<div
|
|
38
|
-
|
|
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
|
-
|
|
48
|
+
<x-button icon-left="copy" :color="color500" block @click="copyPalette(palette)">Copy Palette</x-button>
|
|
41
49
|
|
|
42
|
-
|
|
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 <x-button <b>color="#10B981"</b>>Hello</x-button></p>
|
|
43
51
|
|
|
44
|
-
|
|
52
|
+
<x-divider class="mt-4 mb-8"/>
|
|
45
53
|
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
66
|
+
<p class="my-4"></p>
|
|
59
67
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
106
114
|
|
|
107
|
-
|
|
115
|
+
<x-divider class="mt-4 mb-8"/>
|
|
108
116
|
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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,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<
|
|
5
|
-
const selected2 = ref<
|
|
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
|
|
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()"
|
package/docs/pages/error.vue
CHANGED
|
@@ -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
|
-
<
|
|
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>
|
package/docs/pages/icons.vue
CHANGED
|
@@ -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
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check"><strong><polyline points="20 6 9 17 4 12"></polyline></strong></svg></p>
|
|
101
|
+
<code-snippet lang="js" :code="iconExample1"/>
|
|
93
102
|
|
|
94
|
-
|
|
95
|
-
|
|
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>
|
package/docs/pages/index.vue
CHANGED
|
@@ -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
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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>
|