@indielayer/ui 1.7.5 → 1.8.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 (62) hide show
  1. package/README.md +0 -1
  2. package/docs/components/common/CodePreview.vue +1 -1
  3. package/docs/components/common/CopyButton.vue +1 -1
  4. package/docs/components/toolbar/ToolbarColorToggle.vue +4 -4
  5. package/docs/components/toolbar/ToolbarSearch.vue +1 -1
  6. package/docs/layouts/default.vue +2 -2
  7. package/docs/pages/colors.vue +1 -1
  8. package/docs/pages/component/alert/usage.vue +1 -1
  9. package/docs/pages/component/breadcrumbs/usage.vue +1 -1
  10. package/docs/pages/component/button/button-group.vue +1 -1
  11. package/docs/pages/component/button/variants.vue +1 -1
  12. package/docs/pages/component/drawer/usage.vue +1 -1
  13. package/docs/pages/component/form/usage.vue +1 -1
  14. package/docs/pages/component/formGroup/usage.vue +1 -1
  15. package/docs/pages/component/modal/composed.vue +2 -2
  16. package/docs/pages/component/modal/usage.vue +5 -12
  17. package/docs/pages/component/notifications/usage.vue +9 -9
  18. package/docs/pages/component/pagination/usage.vue +2 -1
  19. package/docs/pages/component/progress/variants.vue +8 -8
  20. package/docs/pages/component/radio/states.vue +6 -6
  21. package/docs/pages/component/radio/variants.vue +6 -6
  22. package/docs/pages/component/select/index.vue +5 -5
  23. package/docs/pages/component/select/{variants.vue → size.vue} +11 -15
  24. package/docs/pages/component/select/states.vue +11 -15
  25. package/docs/pages/component/select/usage.vue +19 -22
  26. package/docs/pages/component/spinner/variants.vue +1 -1
  27. package/docs/pages/component/table/usage.vue +1 -1
  28. package/docs/pages/component/tag/usage.vue +10 -18
  29. package/docs/pages/component/toggle/states.vue +6 -6
  30. package/docs/pages/component/toggle/variants.vue +6 -6
  31. package/docs/pages/icons.vue +36 -39
  32. package/docs/router/index.ts +1 -5
  33. package/lib/components/datepicker/Datepicker.vue.js +3 -3
  34. package/lib/components/drawer/Drawer.vue.js +1 -1
  35. package/lib/components/input/Input.vue.d.ts +3 -0
  36. package/lib/components/input/Input.vue.js +26 -24
  37. package/lib/components/menu/MenuItem.vue2.js +1 -1
  38. package/lib/components/modal/Modal.vue.js +1 -1
  39. package/lib/components/popover/Popover.vue.js +1 -1
  40. package/lib/components/scroll/Scroll.vue2.js +1 -1
  41. package/lib/components/select/Select.vue.d.ts +20 -1
  42. package/lib/components/select/Select.vue.js +301 -264
  43. package/lib/components/select/theme/Select.base.theme.js +3 -1
  44. package/lib/components/select/theme/Select.carbon.theme.js +3 -1
  45. package/lib/components/tab/Tab.vue.js +1 -1
  46. package/lib/components/tab/TabGroup.vue.js +2 -2
  47. package/lib/components/textarea/Textarea.vue.js +1 -1
  48. package/lib/components/tooltip/Tooltip.vue.js +1 -1
  49. package/lib/index.umd.js +4 -4
  50. 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
  51. package/lib/version.d.ts +1 -1
  52. package/lib/version.js +1 -1
  53. package/package.json +1 -1
  54. package/src/components/input/Input.vue +3 -1
  55. package/src/components/select/Select.vue +64 -25
  56. package/src/components/select/theme/Select.base.theme.ts +5 -1
  57. package/src/components/select/theme/Select.carbon.theme.ts +5 -1
  58. package/src/version.ts +1 -1
  59. /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
  60. /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
  61. /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
  62. /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
@@ -27,7 +27,6 @@ npm init @indielayer/ui@latest
27
27
  - Ensure you have the latest LTS version of Node.js installed
28
28
  - Install dependencies with `pnpm install`
29
29
  - Run `pnpm dev` to enter dev mode watch
30
- - Develop docs with `pnpm run docs`
31
30
 
32
31
  ### Documentation
33
32
 
@@ -14,7 +14,7 @@ const props = defineProps({
14
14
  expanded: Boolean,
15
15
  })
16
16
 
17
- const notifications = useNotifications('notifica')
17
+ const notifications = useNotifications()
18
18
 
19
19
  const codeRef = ref()
20
20
  const expandedSync = ref(props.expanded)
@@ -6,7 +6,7 @@ const props = defineProps({
6
6
  text: String,
7
7
  })
8
8
 
9
- const notifications = useNotifications('notifica')
9
+ const notifications = useNotifications()
10
10
 
11
11
  const icon = ref('copy')
12
12
  const animation = ref('')
@@ -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
- colorMode.value = 'dark'
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'
@@ -193,7 +193,7 @@ if (document) {
193
193
  @click="openSearch"
194
194
  >
195
195
  Search
196
- <span class="text-secondary-400 ml-2">
196
+ <span class="text-secondary-400 ml-2 hidden md:inline">
197
197
  {{ metaKey }}K
198
198
  </span>
199
199
  </x-button>
@@ -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 inject-key="notifica">
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>
@@ -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('notifica')
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="space-y-4">
2
+ <div class="grid gap-4">
3
3
  <x-alert>Default</x-alert>
4
4
  <x-alert color="primary" outlined>Outlined</x-alert>
5
5
  <x-alert color="sky" type="info" light removable>Hello</x-alert>
@@ -1,4 +1,4 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  const simple = [
3
3
  { to: '#', label: 'Breadcrumb item 1' },
4
4
  { to: '#', label: 'Breadcrumb item 2' },
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="space-x-4">
2
+ <div class="grid md:grid-cols-4 gap-4">
3
3
  <x-button-group>
4
4
  <x-button >Cancel</x-button>
5
5
  <x-button color="primary">Save</x-button>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="grid grid-cols-4 gap-4">
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>
@@ -1,4 +1,4 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  import { ref } from 'vue'
3
3
 
4
4
  const el = ref(null)
@@ -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('notifica')
5
+ const notifications = useNotifications()
6
6
 
7
7
  const email = ref('')
8
8
  const password = ref('')
@@ -2,7 +2,7 @@
2
2
  import { useNotifications } from '@indielayer/ui'
3
3
  import { ref } from 'vue'
4
4
 
5
- const notifications = useNotifications('notifica')
5
+ const notifications = useNotifications()
6
6
 
7
7
  const selected = ref(['a'])
8
8
  const checked = ref()
@@ -4,7 +4,7 @@ import { useNotifications } from '@indielayer/ui'
4
4
 
5
5
  const show = ref(false)
6
6
 
7
- const notifications = useNotifications('notifica')
7
+ const notifications = useNotifications()
8
8
 
9
9
  const email = ref('')
10
10
  const password = ref('')
@@ -75,5 +75,5 @@ function onSubmit(isValid: boolean) {
75
75
  </template>
76
76
  </x-modal>
77
77
 
78
- <x-button class="mr-2" @click="show = true">Open modal</x-button>
78
+ <x-button class="mr-2" @click="show = true">Modal as a XForm</x-button>
79
79
  </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">content only</x-button>
67
- <x-button class="mr-2" @click="show2 = true">title & content</x-button>
68
- <x-button class="mr-2" @click="show3 = true">header & content</x-button>
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('notifica')
4
+ const notification = useNotifications()
5
5
 
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!')}
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.info({
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.info({
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,5 +1,6 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  import { ref } from 'vue'
3
+
3
4
  const totalPages = 10
4
5
  const page = ref(1)
5
6
  </script>
@@ -1,11 +1,4 @@
1
- <template>
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 VariantsDemoCode from './variants.vue?raw'
6
- import VariantsDemo from './variants.vue'
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: 'Variants',
19
+ name: 'Size',
20
20
  description: '',
21
- code: VariantsDemoCode,
22
- component: VariantsDemo,
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="flex items-center space-x-4">
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="Let's go baby"
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>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="flex items-center space-x-4">
2
+ <div class="flex items-center gap-4">
3
3
  <x-spinner size="xs" />
4
4
  <x-spinner size="sm" />
5
5
  <x-spinner />
@@ -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('notifica')
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.log('remove me')">I'm a tag</x-tag>
9
- <x-tag removable size="xs" @remove="notifications.log('remove me')">I'm a tag</x-tag>
10
- <x-tag removable size="lg" @remove="notifications.log('remove me')">I'm a tag</x-tag>
11
- <x-tag removable size="xl" @remove="notifications.log('remove me')">I'm a tag</x-tag>
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>
@@ -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>
@@ -66,11 +66,7 @@ const router = createRouter({
66
66
  history: createWebHistory('/'),
67
67
  routes,
68
68
  scrollBehavior(to, from, savedPosition) {
69
- if (savedPosition) {
70
- return savedPosition
71
- } else {
72
- return { top: 0 }
73
- }
69
+ document.getElementById('main')?.scrollTo(0, 0)
74
70
  },
75
71
  })
76
72