@indielayer/ui 1.7.5 → 1.8.1
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 +0 -1
- package/docs/components/common/CodePreview.vue +1 -1
- package/docs/components/common/CopyButton.vue +1 -1
- package/docs/components/toolbar/ToolbarColorToggle.vue +4 -4
- package/docs/components/toolbar/ToolbarSearch.vue +1 -1
- package/docs/layouts/default.vue +2 -2
- package/docs/pages/colors.vue +1 -1
- package/docs/pages/component/alert/usage.vue +1 -1
- package/docs/pages/component/breadcrumbs/usage.vue +1 -1
- package/docs/pages/component/button/button-group.vue +1 -1
- package/docs/pages/component/button/variants.vue +1 -1
- package/docs/pages/component/drawer/usage.vue +1 -1
- package/docs/pages/component/form/usage.vue +2 -1
- package/docs/pages/component/formGroup/usage.vue +1 -1
- package/docs/pages/component/modal/composed.vue +12 -3
- package/docs/pages/component/modal/usage.vue +5 -12
- package/docs/pages/component/notifications/usage.vue +9 -9
- package/docs/pages/component/pagination/usage.vue +2 -1
- package/docs/pages/component/progress/variants.vue +8 -8
- package/docs/pages/component/radio/states.vue +6 -6
- package/docs/pages/component/radio/variants.vue +6 -6
- package/docs/pages/component/select/index.vue +5 -5
- package/docs/pages/component/select/{variants.vue → size.vue} +11 -15
- package/docs/pages/component/select/states.vue +11 -15
- package/docs/pages/component/select/usage.vue +19 -22
- package/docs/pages/component/spinner/variants.vue +1 -1
- package/docs/pages/component/table/usage.vue +1 -1
- package/docs/pages/component/tag/usage.vue +10 -18
- package/docs/pages/component/toggle/states.vue +6 -6
- package/docs/pages/component/toggle/variants.vue +6 -6
- package/docs/pages/icons.vue +36 -39
- package/docs/router/index.ts +1 -5
- package/lib/components/checkbox/Checkbox.vue.d.ts +4 -0
- package/lib/components/datepicker/Datepicker.vue.d.ts +4 -0
- package/lib/components/datepicker/Datepicker.vue.js +3 -3
- package/lib/components/drawer/Drawer.vue.js +1 -1
- package/lib/components/formGroup/FormGroup.vue.d.ts +4 -0
- package/lib/components/input/Input.vue.d.ts +7 -0
- package/lib/components/input/Input.vue.js +26 -24
- package/lib/components/menu/MenuItem.vue2.js +1 -1
- package/lib/components/modal/Modal.vue.js +74 -70
- package/lib/components/popover/Popover.vue.js +1 -1
- package/lib/components/radio/Radio.vue.d.ts +4 -0
- package/lib/components/scroll/Scroll.vue2.js +1 -1
- package/lib/components/select/Select.vue.d.ts +24 -1
- package/lib/components/select/Select.vue.js +302 -264
- package/lib/components/select/theme/Select.base.theme.js +3 -1
- package/lib/components/select/theme/Select.carbon.theme.js +3 -1
- package/lib/components/slider/Slider.vue.d.ts +4 -0
- package/lib/components/tab/Tab.vue.js +1 -1
- package/lib/components/tab/TabGroup.vue.js +2 -2
- package/lib/components/textarea/Textarea.vue.d.ts +4 -0
- package/lib/components/textarea/Textarea.vue.js +1 -1
- package/lib/components/toggle/Toggle.vue.d.ts +4 -0
- package/lib/components/tooltip/Tooltip.vue.js +1 -1
- package/lib/composables/useInputtable.d.ts +1 -0
- package/lib/composables/useInputtable.js +31 -30
- package/lib/index.umd.js +4 -4
- package/lib/node_modules/.pnpm/{@vueuse_core@10.2.0_vue@3.3.9 → @vueuse_core@10.2.0_vue@3.3.9_typescript@5.2.2_}/node_modules/@vueuse/core/index.js +2 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/input/Input.vue +3 -1
- package/src/components/modal/Modal.vue +11 -2
- package/src/components/select/Select.vue +70 -25
- package/src/components/select/theme/Select.base.theme.ts +5 -1
- package/src/components/select/theme/Select.carbon.theme.ts +5 -1
- package/src/composables/useInputtable.ts +6 -3
- package/src/version.ts +1 -1
- /package/lib/node_modules/.pnpm/{@vuepic_vue-datepicker@8.3.2_vue@3.3.9 → @vuepic_vue-datepicker@8.3.2_vue@3.3.9_typescript@5.2.2_}/node_modules/@vuepic/vue-datepicker/dist/main.css.js +0 -0
- /package/lib/node_modules/.pnpm/{@vuepic_vue-datepicker@8.3.2_vue@3.3.9 → @vuepic_vue-datepicker@8.3.2_vue@3.3.9_typescript@5.2.2_}/node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js +0 -0
- /package/lib/node_modules/.pnpm/{@vueuse_shared@10.2.0_vue@3.3.9 → @vueuse_shared@10.2.0_vue@3.3.9_typescript@5.2.2_}/node_modules/@vueuse/shared/index.js +0 -0
- /package/lib/node_modules/.pnpm/{floating-vue@5.2.2_vue@3.3.9 → floating-vue@5.2.2_@nuxt_kit@3.10.1_rollup@3.29.4__vue@3.3.9_typescript@5.2.2_}/node_modules/floating-vue/dist/floating-vue.js +0 -0
package/README.md
CHANGED
|
@@ -8,10 +8,10 @@ try {
|
|
|
8
8
|
|
|
9
9
|
if (storedMode) {
|
|
10
10
|
colorMode.value = storedMode
|
|
11
|
-
} else {
|
|
12
|
-
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
13
|
-
|
|
14
|
-
}
|
|
11
|
+
// } else {
|
|
12
|
+
// if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
|
13
|
+
// colorMode.value = 'dark'
|
|
14
|
+
// }
|
|
15
15
|
}
|
|
16
16
|
} catch (e) {
|
|
17
17
|
colorMode.value = 'light'
|
package/docs/layouts/default.vue
CHANGED
|
@@ -22,8 +22,8 @@ const drawer = ref(false)
|
|
|
22
22
|
<x-drawer v-model="drawer" breakpoint="lg" width="220" class="border-r flex">
|
|
23
23
|
<docs-menu class="flex-1" @close="drawer = false" />
|
|
24
24
|
</x-drawer>
|
|
25
|
-
<x-notifications
|
|
26
|
-
<div class="flex-1 overflow-y-scroll bg-secondary-50 dark:bg-gray-900">
|
|
25
|
+
<x-notifications>
|
|
26
|
+
<div id="main" class="flex-1 overflow-y-scroll bg-secondary-50 dark:bg-gray-900">
|
|
27
27
|
<x-container class="py-4 lg:py-8" tag="section">
|
|
28
28
|
<router-view />
|
|
29
29
|
</x-container>
|
package/docs/pages/colors.vue
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed, ref } from 'vue'
|
|
3
3
|
import { useColors, useNotifications, colors as TailwindColors } from '@indielayer/ui'
|
|
4
4
|
|
|
5
|
-
const notifications = useNotifications(
|
|
5
|
+
const notifications = useNotifications()
|
|
6
6
|
const { getPalette } = useColors()
|
|
7
7
|
|
|
8
8
|
const color500 = ref('#10B981')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="grid grid-cols-
|
|
2
|
+
<div class="grid md:grid-cols-3 gap-4">
|
|
3
3
|
<x-button color="#F46262" light>Custom color</x-button>
|
|
4
4
|
<x-button color="indigo" light glow>It's glowing</x-button>
|
|
5
5
|
<x-button color="pink" outlined light glow>Glow</x-button>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useNotifications, type SelectOption } from '@indielayer/ui'
|
|
3
3
|
import { ref } from 'vue'
|
|
4
4
|
|
|
5
|
-
const notifications = useNotifications(
|
|
5
|
+
const notifications = useNotifications()
|
|
6
6
|
|
|
7
7
|
const email = ref('')
|
|
8
8
|
const password = ref('')
|
|
@@ -71,6 +71,7 @@ function onSubmit(isValid: string) {
|
|
|
71
71
|
v-model="country"
|
|
72
72
|
:rules="[rules.isRequired]"
|
|
73
73
|
:options="countries"
|
|
74
|
+
filterable
|
|
74
75
|
name="country"
|
|
75
76
|
placeholder="Select another country"
|
|
76
77
|
label="Country"
|
|
@@ -4,11 +4,12 @@ import { useNotifications } from '@indielayer/ui'
|
|
|
4
4
|
|
|
5
5
|
const show = ref(false)
|
|
6
6
|
|
|
7
|
-
const notifications = useNotifications(
|
|
7
|
+
const notifications = useNotifications()
|
|
8
8
|
|
|
9
9
|
const email = ref('')
|
|
10
10
|
const password = ref('')
|
|
11
11
|
const description = ref('')
|
|
12
|
+
const datetime = ref('')
|
|
12
13
|
|
|
13
14
|
const selected = ref()
|
|
14
15
|
const options = [
|
|
@@ -62,7 +63,15 @@ function onSubmit(isValid: boolean) {
|
|
|
62
63
|
placeholder="Description"
|
|
63
64
|
hide-footer
|
|
64
65
|
/>
|
|
65
|
-
<x-select
|
|
66
|
+
<x-select
|
|
67
|
+
v-model="selected"
|
|
68
|
+
filterable
|
|
69
|
+
:options="options"
|
|
70
|
+
label="Country"
|
|
71
|
+
:rules="[rules.isRequired]"
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<x-datepicker v-model="datetime" label="Start date" :rules="[rules.isRequired]"/>
|
|
66
75
|
|
|
67
76
|
<!-- <template #tertiary-action>
|
|
68
77
|
<x-button color="gray" size="lg">Tertiary</x-button>
|
|
@@ -75,5 +84,5 @@ function onSubmit(isValid: boolean) {
|
|
|
75
84
|
</template>
|
|
76
85
|
</x-modal>
|
|
77
86
|
|
|
78
|
-
<x-button class="mr-2" @click="show = true">
|
|
87
|
+
<x-button class="mr-2" @click="show = true">Modal as a XForm</x-button>
|
|
79
88
|
</template>
|
|
@@ -41,10 +41,7 @@ const show3 = ref(false)
|
|
|
41
41
|
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iure praesentium non id dolores vitae. Nam ratione veritatis ab cumque voluptas porro illum, voluptate perferendis ducimus dolorem optio magni assumenda dolore! Doloremque facere aliquid facilis distinctio accusamus, dolorum eligendi consequuntur molestias sapiente non rem vero sed eos minus itaque sunt officiis iste ea repellendus possimus earum maiores? Quo laudantium fuga odit tenetur sint fugit deleniti dolores placeat, accusamus magni consectetur unde totam sunt labore dolor rem consequatur quaerat! Iure temporibus voluptatem cumque, dolore maiores rerum neque vero, iusto veritatis repellat eligendi amet! Molestiae cumque officiis eius harum iste, fuga corporis molestias.
|
|
42
42
|
</x-modal>
|
|
43
43
|
|
|
44
|
-
<x-modal v-model="show2" backdrop>
|
|
45
|
-
<template #header>
|
|
46
|
-
Modal Header
|
|
47
|
-
</template>
|
|
44
|
+
<x-modal v-model="show2" backdrop title="Title">
|
|
48
45
|
|
|
49
46
|
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iure praesentium non id dolores vitae. Nam ratione veritatis ab cumque voluptas porro illum, voluptate perferendis ducimus dolorem optio magni assumenda dolore! Doloremque facere aliquid facilis distinctio accusamus, dolorum eligendi consequuntur molestias sapiente non rem vero sed eos minus itaque sunt officiis iste ea repellendus possimus earum maiores? Quo laudantium fuga odit tenetur sint fugit deleniti dolores placeat, accusamus magni consectetur unde totam sunt labore dolor rem consequatur quaerat! Iure temporibus voluptatem cumque, dolore maiores rerum neque vero, iusto veritatis repellat eligendi amet! Molestiae cumque officiis eius harum iste, fuga corporis molestias.
|
|
50
47
|
|
|
@@ -54,16 +51,12 @@ const show3 = ref(false)
|
|
|
54
51
|
</template>
|
|
55
52
|
</x-modal>
|
|
56
53
|
|
|
57
|
-
<x-modal v-model="show3" show-close :has-actions="false">
|
|
58
|
-
<template #header>
|
|
59
|
-
Modal Title
|
|
60
|
-
</template>
|
|
61
|
-
|
|
54
|
+
<x-modal v-model="show3" show-close :has-actions="false" title="Modal Title">
|
|
62
55
|
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Iure praesentium non id dolores vitae. Nam ratione veritatis ab cumque voluptas porro illum, voluptate perferendis ducimus dolorem optio magni assumenda dolore! Doloremque facere aliquid facilis distinctio accusamus, dolorum eligendi consequuntur molestias sapiente non rem vero sed eos minus itaque sunt officiis iste ea repellendus possimus earum maiores? Quo laudantium fuga odit tenetur sint fugit deleniti dolores placeat, accusamus magni consectetur unde totam sunt labore dolor rem consequatur quaerat! Iure temporibus voluptatem cumque, dolore maiores rerum neque vero, iusto veritatis repellat eligendi amet! Molestiae cumque officiis eius harum iste, fuga corporis molestias.
|
|
63
56
|
</x-modal>
|
|
64
57
|
|
|
65
58
|
<x-button class="mr-2" @click="show = true">complete</x-button>
|
|
66
|
-
<x-button class="mr-2" @click="show1 = true">
|
|
67
|
-
<x-button class="mr-2" @click="show2 = true">title &
|
|
68
|
-
<x-button class="mr-2" @click="show3 = true">
|
|
59
|
+
<x-button class="mr-2" @click="show1 = true">persistent</x-button>
|
|
60
|
+
<x-button class="mr-2" @click="show2 = true">title & footer</x-button>
|
|
61
|
+
<x-button class="mr-2" @click="show3 = true">title & content</x-button>
|
|
69
62
|
</template>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<script setup>
|
|
1
|
+
<script setup lang="ts">
|
|
2
2
|
import { useNotifications } from '@indielayer/ui'
|
|
3
3
|
|
|
4
|
-
const notification = useNotifications(
|
|
4
|
+
const notification = useNotifications()
|
|
5
5
|
|
|
6
|
-
const log = () => {notification
|
|
7
|
-
const info = () => {notification
|
|
8
|
-
const error = () => {notification
|
|
9
|
-
const warn = () => {notification
|
|
10
|
-
const success = () => {notification
|
|
6
|
+
const log = () => {notification?.log('Default notification.')}
|
|
7
|
+
const info = () => {notification?.info('Starwars is a movie.')}
|
|
8
|
+
const error = () => {notification?.error('Disk is full!')}
|
|
9
|
+
const warn = () => {notification?.warn('Disk is almost full.')}
|
|
10
|
+
const success = () => {notification?.success('File saved!')}
|
|
11
11
|
const custom = () => {
|
|
12
|
-
notification
|
|
12
|
+
notification?.info({
|
|
13
13
|
timeout: 0,
|
|
14
14
|
title: 'Notification title',
|
|
15
15
|
message: 'Subtitle text goes here.',
|
|
@@ -25,7 +25,7 @@ const custom = () => {
|
|
|
25
25
|
})
|
|
26
26
|
}
|
|
27
27
|
const custom2 = () => {
|
|
28
|
-
notification
|
|
28
|
+
notification?.info({
|
|
29
29
|
timeout: 0,
|
|
30
30
|
title: 'Notification title',
|
|
31
31
|
message: 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem accusamus quisquam deleniti error possimus ipsa, fugit maiores. Fuga, non ab id odit praesentium earum optio tempore veniam, eligendi deleniti culpa neque aliquam blanditiis distinctio perferendis delectus ut aut. Sapiente repellendus culpa magnam ullam placeat et sunt laborum minus inventore. Cupiditate, totam soluta. Numquam placeat illum provident culpa corporis quis exercitationem, praesentium dicta quisquam quaerat voluptatem soluta dignissimos, enim dolores, saepe ullam. Dolorem, quo porro officiis aspernatur odit neque at minima totam eius! Cum aliquid repudiandae molestias, dolore accusantium qui ratione iusto, consequatur mollitia quaerat at ipsa voluptatibus quia minima? Nobis?',
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
<
|
|
2
|
-
<div class="grid grid-cols-3 gap-4">
|
|
3
|
-
<x-progress :percentage="percentage" gradient color="sky" />
|
|
4
|
-
<x-progress :percentage="percentage" color="rose" />
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script setup>
|
|
1
|
+
<script setup lang="ts">
|
|
9
2
|
import { ref, onMounted } from 'vue'
|
|
10
3
|
const percentage = ref(0)
|
|
11
4
|
|
|
@@ -16,3 +9,10 @@ onMounted(() => {
|
|
|
16
9
|
}, 100)
|
|
17
10
|
})
|
|
18
11
|
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div class="grid grid-cols-3 gap-4">
|
|
15
|
+
<x-progress :percentage="percentage" gradient color="sky" />
|
|
16
|
+
<x-progress :percentage="percentage" color="rose" />
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const selected = ref('a')
|
|
5
|
+
</script>
|
|
6
|
+
|
|
1
7
|
<template>
|
|
2
8
|
<div class="grid grid-cols-4 gap-4">
|
|
3
9
|
<x-radio v-model="selected" disabled value="a" label="Disabled" />
|
|
@@ -5,9 +11,3 @@
|
|
|
5
11
|
<x-radio v-model="selected" error="Invalid input" value="a" label="Error" />
|
|
6
12
|
</div>
|
|
7
13
|
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
export default {
|
|
11
|
-
data() { return { selected: 'a' } },
|
|
12
|
-
}
|
|
13
|
-
</script>
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const selected = ref('a')
|
|
5
|
+
</script>
|
|
6
|
+
|
|
1
7
|
<template>
|
|
2
8
|
<div class="grid grid-cols-4 gap-4">
|
|
3
9
|
<x-radio
|
|
@@ -31,9 +37,3 @@
|
|
|
31
37
|
>Glow</x-radio>
|
|
32
38
|
</div>
|
|
33
39
|
</template>
|
|
34
|
-
|
|
35
|
-
<script>
|
|
36
|
-
export default {
|
|
37
|
-
data() { return { selected: 'a' } },
|
|
38
|
-
}
|
|
39
|
-
</script>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { XSelect } from '@indielayer/ui'
|
|
3
3
|
import UsageDemoCode from './usage.vue?raw'
|
|
4
4
|
import UsageDemo from './usage.vue'
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import SizeDemoCode from './size.vue?raw'
|
|
6
|
+
import SizeDemo from './size.vue'
|
|
7
7
|
import StatesDemoCode from './states.vue?raw'
|
|
8
8
|
import StatesDemo from './states.vue'
|
|
9
9
|
|
|
@@ -16,10 +16,10 @@ const demos = [{
|
|
|
16
16
|
code: UsageDemoCode,
|
|
17
17
|
component: UsageDemo,
|
|
18
18
|
}, {
|
|
19
|
-
name: '
|
|
19
|
+
name: 'Size',
|
|
20
20
|
description: '',
|
|
21
|
-
code:
|
|
22
|
-
component:
|
|
21
|
+
code: SizeDemoCode,
|
|
22
|
+
component: SizeDemo,
|
|
23
23
|
}, {
|
|
24
24
|
name: 'States',
|
|
25
25
|
description: '',
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const selected = ref<undefined | string>()
|
|
5
|
+
const options = ref([
|
|
6
|
+
{ value: 'A', label: 'Option A' },
|
|
7
|
+
{ value: 'B', label: 'Option B' },
|
|
8
|
+
])
|
|
9
|
+
</script>
|
|
10
|
+
|
|
1
11
|
<template>
|
|
2
|
-
<div class="
|
|
12
|
+
<div class="grid md:grid-cols-5 gap-4">
|
|
3
13
|
<x-select v-model="selected" :options="options" placeholder="xs" size="xs" />
|
|
4
14
|
<x-select v-model="selected" :options="options" placeholder="sm" size="sm" />
|
|
5
15
|
<x-select v-model="selected" :options="options" placeholder="md"/>
|
|
@@ -7,17 +17,3 @@
|
|
|
7
17
|
<x-select v-model="selected" :options="options" placeholder="xl" size="xl" />
|
|
8
18
|
</div>
|
|
9
19
|
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
export default {
|
|
13
|
-
data() {
|
|
14
|
-
return {
|
|
15
|
-
selected: '',
|
|
16
|
-
options: [
|
|
17
|
-
{ value: 'A', label: 'Option A' },
|
|
18
|
-
{ value: 'B', label: 'Option B' },
|
|
19
|
-
],
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const selected = ref('A')
|
|
5
|
+
const options = ref([
|
|
6
|
+
{ value: 'A', label: 'Option A' },
|
|
7
|
+
{ value: 'B', label: 'Option B' },
|
|
8
|
+
])
|
|
9
|
+
</script>
|
|
10
|
+
|
|
1
11
|
<template>
|
|
2
|
-
<div class="grid grid-cols-4 gap-4">
|
|
12
|
+
<div class="grid md:grid-cols-4 gap-4">
|
|
3
13
|
<x-select v-model="selected" label="Disabled" disabled :options="options"/>
|
|
4
14
|
<x-select v-model="selected" label="Read Only" readonly :options="options"/>
|
|
5
15
|
<x-select v-model="selected" label="Loading" loading :options="options"/>
|
|
6
16
|
<x-select v-model="selected" label="Error" error="Invalid input" :options="options"/>
|
|
7
17
|
</div>
|
|
8
18
|
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
export default {
|
|
12
|
-
data() {
|
|
13
|
-
return {
|
|
14
|
-
selected: 'A',
|
|
15
|
-
options: [
|
|
16
|
-
{ value: 'A', label: 'Option A' },
|
|
17
|
-
{ value: 'B', label: 'Option B' },
|
|
18
|
-
],
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
}
|
|
22
|
-
</script>
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const selected = ref<undefined | string>()
|
|
5
|
+
const selectedMultiple = ref<string[]>(['A', 'B'])
|
|
6
|
+
const options = ref([
|
|
7
|
+
{ value: 'A', label: 'Option A' },
|
|
8
|
+
{ value: 'B', label: 'Option B' },
|
|
9
|
+
])
|
|
10
|
+
|
|
11
|
+
for (let i = 0; i < 20; i++) {
|
|
12
|
+
options.value.push({ value: i.toString(), label: 'Option ' + i })
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
1
16
|
<template>
|
|
2
|
-
<div class="grid grid-cols-3 gap-4">
|
|
17
|
+
<div class="grid md:grid-cols-3 gap-4">
|
|
3
18
|
<x-select
|
|
4
19
|
v-model="selected"
|
|
5
20
|
label="Simple native select"
|
|
@@ -13,34 +28,16 @@
|
|
|
13
28
|
v-model="selected"
|
|
14
29
|
label="Dropdown select"
|
|
15
30
|
placeholder="Placeholder"
|
|
31
|
+
filterable
|
|
16
32
|
:options="options"
|
|
17
33
|
/>
|
|
18
34
|
<x-select
|
|
19
35
|
v-model="selectedMultiple"
|
|
20
36
|
label="Multi select"
|
|
21
|
-
placeholder="
|
|
37
|
+
placeholder="Multiple"
|
|
38
|
+
filterable
|
|
22
39
|
:options="options"
|
|
23
40
|
multiple
|
|
24
41
|
/>
|
|
25
42
|
</div>
|
|
26
43
|
</template>
|
|
27
|
-
|
|
28
|
-
<script>
|
|
29
|
-
export default {
|
|
30
|
-
data() {
|
|
31
|
-
return {
|
|
32
|
-
selected: null,
|
|
33
|
-
selectedMultiple: ['A', 'B'],
|
|
34
|
-
options: [
|
|
35
|
-
{ value: 'A', label: 'Option Ao qoiw oqi jdoqiwd oqid joqiw jdoijoi' },
|
|
36
|
-
{ value: 'B', label: 'Option B' },
|
|
37
|
-
],
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
created() {
|
|
41
|
-
for (let i = 0; i < 20; i++) {
|
|
42
|
-
this.options.push({ value: i, label: 'Option ' + i })
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
}
|
|
46
|
-
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useNotifications, type TableHeader } from '@indielayer/ui'
|
|
3
3
|
import { computed, ref } from 'vue'
|
|
4
4
|
|
|
5
|
-
const notifications = useNotifications(
|
|
5
|
+
const notifications = useNotifications()
|
|
6
6
|
|
|
7
7
|
const headers: TableHeader[] = [
|
|
8
8
|
{ text: '#', value: 'id', sortable: true, align: 'center' },
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useNotifications } from '@indielayer/ui'
|
|
3
|
+
|
|
4
|
+
const notifications = useNotifications()
|
|
5
|
+
</script>
|
|
6
|
+
|
|
1
7
|
<template>
|
|
2
8
|
<div class="space-x-2">
|
|
3
9
|
<x-tag color="primary">Hello</x-tag>
|
|
@@ -5,23 +11,9 @@
|
|
|
5
11
|
<x-tag outlined>I'm a tag</x-tag>
|
|
6
12
|
<x-tag rounded outlined color="pink">I'm a tag</x-tag>
|
|
7
13
|
<x-tag color="pink">I'm a tag</x-tag>
|
|
8
|
-
<x-tag removable @remove="notifications
|
|
9
|
-
<x-tag removable size="xs" @remove="notifications
|
|
10
|
-
<x-tag removable size="lg" @remove="notifications
|
|
11
|
-
<x-tag removable size="xl" @remove="notifications
|
|
14
|
+
<x-tag removable @remove="notifications?.log('remove me')">I'm a tag</x-tag>
|
|
15
|
+
<x-tag removable size="xs" @remove="notifications?.log('remove me')">I'm a tag</x-tag>
|
|
16
|
+
<x-tag removable size="lg" @remove="notifications?.log('remove me')">I'm a tag</x-tag>
|
|
17
|
+
<x-tag removable size="xl" @remove="notifications?.log('remove me')">I'm a tag</x-tag>
|
|
12
18
|
</div>
|
|
13
19
|
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
import { useNotifications } from '@indielayer/ui'
|
|
17
|
-
|
|
18
|
-
export default {
|
|
19
|
-
setup() {
|
|
20
|
-
const notifications = useNotifications('notifica')
|
|
21
|
-
|
|
22
|
-
return {
|
|
23
|
-
notifications,
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
</script>
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const checked = ref(true)
|
|
5
|
+
</script>
|
|
6
|
+
|
|
1
7
|
<template>
|
|
2
8
|
<div class="grid grid-cols-4 gap-4">
|
|
3
9
|
<x-toggle disabled label="Disabled" />
|
|
@@ -5,9 +11,3 @@
|
|
|
5
11
|
<x-toggle error="Invalid input" label="Error"/>
|
|
6
12
|
</div>
|
|
7
13
|
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
export default {
|
|
11
|
-
data() { return { checked: true } },
|
|
12
|
-
}
|
|
13
|
-
</script>
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const checked = ref(false)
|
|
5
|
+
</script>
|
|
6
|
+
|
|
1
7
|
<template>
|
|
2
8
|
<div class="flex items-center space-x-4">
|
|
3
9
|
<x-toggle v-model="checked" size="xs" label="xs"/>
|
|
@@ -7,9 +13,3 @@
|
|
|
7
13
|
<x-toggle v-model="checked" size="xl" label="xl"/>
|
|
8
14
|
</div>
|
|
9
15
|
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
export default {
|
|
13
|
-
data() { return { checked: false } },
|
|
14
|
-
}
|
|
15
|
-
</script>
|
package/docs/pages/icons.vue
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
const iconExample = `// icons.js
|
|
3
|
+
export default {
|
|
4
|
+
check: '<polyline points="20 6 9 17 4 12"></polyline>'
|
|
5
|
+
}`
|
|
6
|
+
|
|
7
|
+
const installExample = `// main.js
|
|
8
|
+
import { createApp } from 'vue'
|
|
9
|
+
import UI from '@indielayer/ui'
|
|
10
|
+
import icons from './icons'
|
|
11
|
+
|
|
12
|
+
const app = createApp(App)
|
|
13
|
+
|
|
14
|
+
app.use(UI, {
|
|
15
|
+
icons,
|
|
16
|
+
})`
|
|
17
|
+
|
|
18
|
+
const iconExample1 = `// icons.js
|
|
19
|
+
export default {
|
|
20
|
+
check: '<polyline points="20 6 9 17 4 12"></polyline>',
|
|
21
|
+
// or
|
|
22
|
+
check2: {
|
|
23
|
+
icon: '<polyline points="20 6 9 17 4 12"></polyline>',
|
|
24
|
+
viewBox: '0 0 24 24', // default
|
|
25
|
+
filled: false, // default
|
|
26
|
+
},
|
|
27
|
+
// or
|
|
28
|
+
check3: '<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"><polyline points="20 6 9 17 4 12"></polyline></svg>'
|
|
29
|
+
}`
|
|
30
|
+
|
|
31
|
+
const iconExample2 = `<template>
|
|
32
|
+
<x-icon icon="check" />
|
|
33
|
+
</template>
|
|
34
|
+
`
|
|
35
|
+
</script>
|
|
36
|
+
|
|
1
37
|
<template>
|
|
2
38
|
<h2 class="text-4xl font-semibold">Icons</h2>
|
|
3
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>
|
|
@@ -60,42 +96,3 @@
|
|
|
60
96
|
</div>
|
|
61
97
|
<code-snippet lang="js" :code="iconExample2"/>
|
|
62
98
|
</template>
|
|
63
|
-
|
|
64
|
-
<script>
|
|
65
|
-
export default {
|
|
66
|
-
data() {
|
|
67
|
-
return {
|
|
68
|
-
iconExample: `// icons.js
|
|
69
|
-
export default {
|
|
70
|
-
check: '<polyline points="20 6 9 17 4 12"></polyline>'
|
|
71
|
-
}`,
|
|
72
|
-
installExample: `// main.js
|
|
73
|
-
import { createApp } from 'vue'
|
|
74
|
-
import UI from '@indielayer/ui'
|
|
75
|
-
import icons from './icons'
|
|
76
|
-
|
|
77
|
-
const app = createApp(App)
|
|
78
|
-
|
|
79
|
-
app.use(UI, {
|
|
80
|
-
icons,
|
|
81
|
-
})`,
|
|
82
|
-
iconExample1: `// icons.js
|
|
83
|
-
export default {
|
|
84
|
-
check: '<polyline points="20 6 9 17 4 12"></polyline>',
|
|
85
|
-
// or
|
|
86
|
-
check2: {
|
|
87
|
-
icon: '<polyline points="20 6 9 17 4 12"></polyline>',
|
|
88
|
-
viewBox: '0 0 24 24', // default
|
|
89
|
-
filled: false, // default
|
|
90
|
-
},
|
|
91
|
-
// or
|
|
92
|
-
check3: '<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"><polyline points="20 6 9 17 4 12"></polyline></svg>'
|
|
93
|
-
}`,
|
|
94
|
-
iconExample2: `<template>
|
|
95
|
-
<x-icon icon="check" />
|
|
96
|
-
</template>
|
|
97
|
-
`,
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
}
|
|
101
|
-
</script>
|