@indielayer/ui 0.0.0-dev-20240127005325 → 0.0.0-dev-20240202140555

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 (198) hide show
  1. package/docs/App.vue +25 -0
  2. package/docs/assets/css/hljs.css +302 -0
  3. package/docs/assets/css/tailwind.css +46 -0
  4. package/docs/assets/images/error.svg +1 -0
  5. package/docs/assets/images/logo.png +0 -0
  6. package/docs/assets/images/logo_mini.svg +10 -0
  7. package/docs/assets/images/logo_white.png +0 -0
  8. package/docs/assets/images/logo_word.svg +12 -0
  9. package/docs/assets/images/logo_word_dark.svg +12 -0
  10. package/docs/assets/images/photo1.jpeg +0 -0
  11. package/docs/assets/images/photo2.jpeg +0 -0
  12. package/docs/components/Cookies.vue +42 -0
  13. package/docs/components/common/CodePreview.vue +80 -0
  14. package/docs/components/common/CodeSnippet.vue +49 -0
  15. package/docs/components/common/CopyButton.vue +50 -0
  16. package/docs/components/common/DocumentPage.vue +289 -0
  17. package/docs/components/common/Indielayer-theme.json +702 -0
  18. package/docs/components/common/MultiSnippet.vue +26 -0
  19. package/docs/components/menu/DocsMenu.vue +143 -0
  20. package/docs/components/toolbar/PreToolbar.vue +18 -0
  21. package/docs/components/toolbar/Toolbar.vue +63 -0
  22. package/docs/components/toolbar/ToolbarColorToggle.vue +49 -0
  23. package/docs/icons.ts +61 -0
  24. package/docs/layouts/default.vue +29 -0
  25. package/docs/layouts/simple.vue +3 -0
  26. package/docs/main.ts +33 -0
  27. package/docs/pages/colors.vue +125 -0
  28. package/docs/pages/component/accordion/index.vue +29 -0
  29. package/docs/pages/component/accordion/usage.vue +30 -0
  30. package/docs/pages/component/alert/index.vue +29 -0
  31. package/docs/pages/component/alert/usage.vue +18 -0
  32. package/docs/pages/component/avatar/index.vue +43 -0
  33. package/docs/pages/component/avatar/size.vue +9 -0
  34. package/docs/pages/component/avatar/usage.vue +9 -0
  35. package/docs/pages/component/avatar/variants.vue +8 -0
  36. package/docs/pages/component/badge/index.vue +29 -0
  37. package/docs/pages/component/badge/usage.vue +50 -0
  38. package/docs/pages/component/breadcrumbs/index.vue +29 -0
  39. package/docs/pages/component/breadcrumbs/usage.vue +19 -0
  40. package/docs/pages/component/button/button-group.vue +18 -0
  41. package/docs/pages/component/button/icons.vue +9 -0
  42. package/docs/pages/component/button/index.vue +64 -0
  43. package/docs/pages/component/button/size.vue +9 -0
  44. package/docs/pages/component/button/states.vue +6 -0
  45. package/docs/pages/component/button/usage.vue +12 -0
  46. package/docs/pages/component/button/variants.vue +7 -0
  47. package/docs/pages/component/card/index.vue +29 -0
  48. package/docs/pages/component/card/usage.vue +6 -0
  49. package/docs/pages/component/carousel/index.vue +29 -0
  50. package/docs/pages/component/carousel/usage.vue +10 -0
  51. package/docs/pages/component/checkbox/index.vue +50 -0
  52. package/docs/pages/component/checkbox/size.vue +9 -0
  53. package/docs/pages/component/checkbox/states.vue +9 -0
  54. package/docs/pages/component/checkbox/usage.vue +15 -0
  55. package/docs/pages/component/checkbox/variants.vue +8 -0
  56. package/docs/pages/component/container/index.vue +29 -0
  57. package/docs/pages/component/container/usage.vue +3 -0
  58. package/docs/pages/component/divider/index.vue +43 -0
  59. package/docs/pages/component/divider/label.vue +12 -0
  60. package/docs/pages/component/divider/usage.vue +7 -0
  61. package/docs/pages/component/divider/vertical.vue +7 -0
  62. package/docs/pages/component/drawer/index.vue +29 -0
  63. package/docs/pages/component/drawer/usage.vue +56 -0
  64. package/docs/pages/component/form/index.vue +29 -0
  65. package/docs/pages/component/form/usage.vue +96 -0
  66. package/docs/pages/component/formGroup/index.vue +29 -0
  67. package/docs/pages/component/formGroup/usage.vue +46 -0
  68. package/docs/pages/component/icon/index.vue +36 -0
  69. package/docs/pages/component/icon/usage.vue +6 -0
  70. package/docs/pages/component/icon/variants.vue +14 -0
  71. package/docs/pages/component/image/index.vue +29 -0
  72. package/docs/pages/component/image/usage.vue +8 -0
  73. package/docs/pages/component/input/index.vue +50 -0
  74. package/docs/pages/component/input/size.vue +13 -0
  75. package/docs/pages/component/input/states.vue +12 -0
  76. package/docs/pages/component/input/usage.vue +15 -0
  77. package/docs/pages/component/input/variants.vue +18 -0
  78. package/docs/pages/component/link/index.vue +29 -0
  79. package/docs/pages/component/link/usage.vue +12 -0
  80. package/docs/pages/component/loader/index.vue +29 -0
  81. package/docs/pages/component/loader/usage.vue +7 -0
  82. package/docs/pages/component/menu/index.vue +29 -0
  83. package/docs/pages/component/menu/usage.vue +69 -0
  84. package/docs/pages/component/modal/composed.vue +70 -0
  85. package/docs/pages/component/modal/index.vue +36 -0
  86. package/docs/pages/component/modal/usage.vue +61 -0
  87. package/docs/pages/component/notifications/index.vue +29 -0
  88. package/docs/pages/component/notifications/usage.vue +56 -0
  89. package/docs/pages/component/pagination/index.vue +29 -0
  90. package/docs/pages/component/pagination/usage.vue +17 -0
  91. package/docs/pages/component/popover/index.vue +29 -0
  92. package/docs/pages/component/popover/usage.vue +21 -0
  93. package/docs/pages/component/progress/index.vue +36 -0
  94. package/docs/pages/component/progress/usage.vue +7 -0
  95. package/docs/pages/component/progress/variants.vue +18 -0
  96. package/docs/pages/component/radio/index.vue +50 -0
  97. package/docs/pages/component/radio/size.vue +15 -0
  98. package/docs/pages/component/radio/states.vue +13 -0
  99. package/docs/pages/component/radio/usage.vue +14 -0
  100. package/docs/pages/component/radio/variants.vue +39 -0
  101. package/docs/pages/component/scroll/horizontal.vue +14 -0
  102. package/docs/pages/component/scroll/index.vue +36 -0
  103. package/docs/pages/component/scroll/usage.vue +5 -0
  104. package/docs/pages/component/select/index.vue +43 -0
  105. package/docs/pages/component/select/states.vue +22 -0
  106. package/docs/pages/component/select/usage.vue +45 -0
  107. package/docs/pages/component/select/variants.vue +23 -0
  108. package/docs/pages/component/skeleton/index.vue +29 -0
  109. package/docs/pages/component/skeleton/usage.vue +10 -0
  110. package/docs/pages/component/slider/index.vue +29 -0
  111. package/docs/pages/component/slider/usage.vue +15 -0
  112. package/docs/pages/component/spacer/index.vue +29 -0
  113. package/docs/pages/component/spacer/usage.vue +8 -0
  114. package/docs/pages/component/spinner/index.vue +36 -0
  115. package/docs/pages/component/spinner/usage.vue +3 -0
  116. package/docs/pages/component/spinner/variants.vue +9 -0
  117. package/docs/pages/component/stepper/index.vue +29 -0
  118. package/docs/pages/component/stepper/usage.vue +21 -0
  119. package/docs/pages/component/table/index.vue +36 -0
  120. package/docs/pages/component/table/states.vue +28 -0
  121. package/docs/pages/component/table/usage.vue +107 -0
  122. package/docs/pages/component/tabs/index.vue +29 -0
  123. package/docs/pages/component/tabs/usage.vue +137 -0
  124. package/docs/pages/component/tag/index.vue +29 -0
  125. package/docs/pages/component/tag/usage.vue +27 -0
  126. package/docs/pages/component/textarea/index.vue +43 -0
  127. package/docs/pages/component/textarea/states.vue +13 -0
  128. package/docs/pages/component/textarea/usage.vue +22 -0
  129. package/docs/pages/component/textarea/variants.vue +15 -0
  130. package/docs/pages/component/toggle/index.vue +43 -0
  131. package/docs/pages/component/toggle/states.vue +13 -0
  132. package/docs/pages/component/toggle/usage.vue +14 -0
  133. package/docs/pages/component/toggle/variants.vue +15 -0
  134. package/docs/pages/component/tooltip/index.vue +29 -0
  135. package/docs/pages/component/tooltip/usage.vue +16 -0
  136. package/docs/pages/error.vue +6 -0
  137. package/docs/pages/icons.vue +105 -0
  138. package/docs/pages/index.vue +157 -0
  139. package/docs/pages/play.vue +19 -0
  140. package/docs/pages/typography.vue +95 -0
  141. package/docs/router/index.ts +77 -0
  142. package/lib/components/accordion/Accordion.vue.d.ts +3 -0
  143. package/lib/components/accordion/Accordion.vue.js +7 -7
  144. package/lib/components/accordion/AccordionItem.vue.d.ts +1 -0
  145. package/lib/components/accordion/AccordionItem.vue.js +49 -47
  146. package/lib/components/accordion/index.d.ts +1 -1
  147. package/lib/components/accordion/theme/Accordion.carbon.theme.js +3 -6
  148. package/lib/components/accordion/theme/AccordionItem.base.theme.js +9 -9
  149. package/lib/components/accordion/theme/AccordionItem.carbon.theme.js +3 -14
  150. package/lib/components/carousel/CarouselSlide.vue.d.ts +19 -8
  151. package/lib/components/carousel/CarouselSlide.vue.js +2 -2
  152. package/lib/components/carousel/CarouselSlide.vue2.js +25 -18
  153. package/lib/components/checkbox/theme/Checkbox.base.theme.js +4 -4
  154. package/lib/components/container/Container.vue.d.ts +13 -0
  155. package/lib/components/container/Container.vue.js +15 -11
  156. package/lib/components/container/theme/Container.base.theme.js +7 -4
  157. package/lib/components/form/theme/Form.base.theme.js +1 -1
  158. package/lib/components/menu/Menu.vue.js +10 -10
  159. package/lib/components/menu/theme/MenuItem.base.theme.js +1 -1
  160. package/lib/components/modal/Modal.vue.d.ts +1 -1
  161. package/lib/components/radio/theme/Radio.base.theme.js +6 -6
  162. package/lib/components/select/Select.vue.js +47 -50
  163. package/lib/components/select/theme/Select.base.theme.js +10 -10
  164. package/lib/components/select/theme/Select.carbon.theme.js +4 -4
  165. package/lib/components/slider/theme/Slider.carbon.theme.js +4 -4
  166. package/lib/components/tab/Tab.vue.js +54 -53
  167. package/lib/components/tab/theme/TabGroup.carbon.theme.js +3 -3
  168. package/lib/components/table/Table.vue.js +47 -47
  169. package/lib/composables/keys.d.ts +2 -2
  170. package/lib/index.js +1 -1
  171. package/lib/index.umd.js +3 -3
  172. package/lib/version.d.ts +1 -1
  173. package/lib/version.js +1 -1
  174. package/package.json +4 -2
  175. package/src/components/accordion/Accordion.vue +5 -1
  176. package/src/components/accordion/AccordionItem.vue +5 -2
  177. package/src/components/accordion/index.ts +1 -1
  178. package/src/components/accordion/theme/Accordion.carbon.theme.ts +3 -5
  179. package/src/components/accordion/theme/AccordionItem.base.theme.ts +10 -7
  180. package/src/components/accordion/theme/AccordionItem.carbon.theme.ts +2 -30
  181. package/src/components/carousel/CarouselSlide.vue +9 -4
  182. package/src/components/checkbox/theme/Checkbox.base.theme.ts +1 -1
  183. package/src/components/container/Container.vue +4 -0
  184. package/src/components/container/theme/Container.base.theme.ts +7 -1
  185. package/src/components/form/theme/Form.base.theme.ts +1 -1
  186. package/src/components/label/theme/Label.carbon.theme.ts +0 -2
  187. package/src/components/menu/Menu.vue +1 -1
  188. package/src/components/menu/theme/MenuItem.base.theme.ts +1 -1
  189. package/src/components/radio/theme/Radio.base.theme.ts +1 -1
  190. package/src/components/select/Select.vue +0 -3
  191. package/src/components/select/theme/Select.base.theme.ts +1 -1
  192. package/src/components/select/theme/Select.carbon.theme.ts +1 -1
  193. package/src/components/slider/theme/Slider.carbon.theme.ts +1 -1
  194. package/src/components/tab/Tab.vue +1 -1
  195. package/src/components/tab/theme/TabGroup.carbon.theme.ts +1 -1
  196. package/src/components/table/Table.vue +1 -1
  197. package/src/composables/keys.ts +2 -2
  198. package/src/version.ts +1 -1
@@ -0,0 +1,157 @@
1
+ <template>
2
+ <div>
3
+ <section class="p-4 lg:p-8 max-w-4xl xl:max-w-7xl mx-auto">
4
+ <h2 class="text-4xl font-semibold">Getting Started</h2>
5
+ <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>
6
+ <x-divider class="mt-4 mb-8"/>
7
+
8
+ <h3 class="text-2xl mb-4">Quickstart a new Vue 3 or Nuxt 3 project</h3>
9
+ <p class="my-4">
10
+ This following command will install and execute <x-link
11
+ external
12
+ href="https://github.com/indielayer/ui/tree/main/packages/create-ui"
13
+ target="_blank"
14
+ shadow
15
+ color="primary"
16
+ >@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.
17
+ </p>
18
+ <code-snippet :code="`npm init @indielayer/ui`" lang="bash"/>
19
+ <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.
20
+ ❯ Vue 3
21
+ Nuxt 3</pre>
22
+
23
+ <h3 class="text-2xl mt-16 mb-4 text-gray-500">Manual guide</h3>
24
+ <h3 class="text-2xl mb-4">1. Install via package manager</h3>
25
+ <multi-snippet
26
+ :snippets="[{
27
+ label: 'npm',
28
+ lang: 'bash',
29
+ code: 'npm install @indielayer/ui'
30
+ }, {
31
+ label: 'yarn',
32
+ lang: 'bash',
33
+ code: 'yarn add @indielayer/ui'
34
+ }, {
35
+ label: 'pnpm',
36
+ lang: 'bash',
37
+ code: 'pnpm add @indielayer/ui'
38
+ }]"
39
+ />
40
+
41
+ <h3 class="text-2xl mt-8 mb-4">2. Setup TailwindCSS</h3>
42
+ <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>
43
+ <p class="my-4">
44
+ 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>
45
+ </p>
46
+ <code-snippet
47
+ lang="js"
48
+ :code="`// tailwind.config.js
49
+ const colors = require('tailwindcss/colors')
50
+ const indielayer = require('@indielayer/ui/tailwind.preset')
51
+
52
+ module.exports = {
53
+ darkMode: 'class',
54
+ // load indielayer ui presets
55
+ presets: [indielayer()],
56
+ // allow PurgeCSS to analyze components
57
+ content: [
58
+ './index.html',
59
+ './**/*.vue',
60
+ './src/**/*.{vue,js,ts,jsx,tsx}',
61
+ 'node_modules/@indielayer/ui/{lib,src}/**/*',
62
+ ],
63
+ theme: {
64
+ extend: {
65
+ colors: {
66
+ primary: colors.emerald,
67
+ secondary: colors.slate,
68
+ success: colors.green,
69
+ warning: colors.yellow,
70
+ error: colors.red,
71
+ },
72
+ },
73
+ },
74
+ plugins: [],
75
+ }`"
76
+ />
77
+ <h3 class="text-2xl mt-8 mb-4">3. Load the UI in your project</h3>
78
+ <h4 class="text-xl mt-8 mb-4">Load on a Vue 3 project</h4>
79
+ <code-snippet
80
+ lang="js"
81
+ :code="`import { createApp } from 'vue'
82
+ import UI from '@indielayer/ui'
83
+
84
+ const app = createApp(App)
85
+
86
+ app.use(UI, {
87
+ prefix: 'X',
88
+ })`"
89
+ />
90
+ <h4 class="text-xl mt-8 mb-4">Load on a Nuxt 3 project</h4>
91
+ <multi-snippet
92
+ class="my-4"
93
+ :snippets="[{
94
+ label: 'npm',
95
+ lang: 'bash',
96
+ code: 'npm install @indielayer/ui @vueuse/core floating-vue -D'
97
+ }, {
98
+ label: 'yarn',
99
+ lang: 'bash',
100
+ code: 'yarn add @indielayer/ui @vueuse/core floating-vue -D'
101
+ }, {
102
+ label: 'pnpm',
103
+ lang: 'bash',
104
+ code: 'pnpm add @indielayer/ui @vueuse/core floating-vue -D'
105
+ }]"
106
+ />
107
+ <code-snippet
108
+ lang="js"
109
+ :code="`import { colors } from '@indielayer/ui'
110
+
111
+ // https://nuxt.com/docs/api/configuration/nuxt-config
112
+ export default defineNuxtConfig({
113
+ modules: [
114
+ ['@indielayer/ui/nuxt', {
115
+ theme: {
116
+ colors: {
117
+ primary: colors.emerald,
118
+ secondary: colors.slate,
119
+ success: colors.green,
120
+ warning: colors.yellow,
121
+ error: colors.red,
122
+ },
123
+ },
124
+ }],
125
+ ],
126
+ css: ['~/assets/tailwind.css'],
127
+ /**
128
+ * @tailwind base;
129
+ * @tailwind components;
130
+ * @tailwind utilities;
131
+ */
132
+ postcss: {
133
+ plugins: {
134
+ 'tailwindcss/nesting': {},
135
+ tailwindcss: {},
136
+ autoprefixer: {},
137
+ },
138
+ },
139
+ })`"
140
+ />
141
+ <h3 class="text-2xl mt-8 mb-4">4. (optional) Load only the components you want</h3>
142
+ <code-snippet
143
+ lang="js"
144
+ :code="`import { createApp } from 'vue'
145
+ import { createUI, XButton, XAlert } from '@indielayer/ui'
146
+
147
+ const app = createApp(App)
148
+
149
+ const UI = createUI({
150
+ components: [XButton, XAlert],
151
+ })
152
+
153
+ app.use(UI)`"
154
+ />
155
+ </section>
156
+ </div>
157
+ </template>
@@ -0,0 +1,19 @@
1
+ <script>
2
+
3
+ export default {
4
+ components: {
5
+
6
+ },
7
+ data() {
8
+ return {
9
+
10
+ }
11
+ },
12
+ }
13
+ </script>
14
+
15
+ <template>
16
+ <div class="p-10">
17
+ hello
18
+ </div>
19
+ </template>
@@ -0,0 +1,95 @@
1
+ <script setup lang="ts">
2
+ const textClasses = {
3
+ 'text-xs': {
4
+ size: '0.75rem',
5
+ line: '1rem',
6
+ },
7
+ 'text-sm': {
8
+ size: '0.875rem',
9
+ line: '1.25rem',
10
+ },
11
+ 'text-base': {
12
+ size: '1rem',
13
+ line: '1.5rem',
14
+ },
15
+ 'text-lg': {
16
+ size: '1.125rem',
17
+ line: '1.75rem',
18
+ },
19
+ 'text-xl': {
20
+ size: '1.25rem',
21
+ line: '1.75rem',
22
+ },
23
+ 'text-2xl': {
24
+ size: '1.5rem',
25
+ line: '2rem',
26
+ },
27
+ 'text-3xl': {
28
+ size: '1.875rem',
29
+ line: '2.25rem',
30
+ },
31
+ 'text-4xl': {
32
+ size: '2.25rem',
33
+ line: '2.5rem',
34
+ },
35
+ 'text-5xl': {
36
+ size: '3rem',
37
+ line: 'auto',
38
+ },
39
+ 'text-6xl': {
40
+ size: '3.75rem',
41
+ line: 'auto',
42
+ },
43
+ 'text-7xl': {
44
+ size: '4.5rem',
45
+ line: 'auto',
46
+ },
47
+ 'text-8xl': {
48
+ size: '6rem',
49
+ line: 'auto',
50
+ },
51
+ 'text-9xl': {
52
+ size: '8rem',
53
+ line: 'auto',
54
+ },
55
+ }
56
+
57
+ </script>
58
+
59
+ <template>
60
+ <div>
61
+ <section class="p-4 lg:p-8 max-w-4xl xl:max-w-7xl mx-auto">
62
+ <h1 class="text-4xl font-semibold">Typography</h1>
63
+ <h2 class="text-lg my-2 text-gray-500 dark:text-gray-400">Big letters, small letters, fonts and stuff</h2>
64
+
65
+ <x-divider class="mt-4 mb-8"/>
66
+
67
+ <div>
68
+ <div>Main font</div>
69
+ <div class="text-gray-500 dark:text-gray-400">Inter</div>
70
+ <div class="text-6xl mt-4">AaBbCc</div>
71
+ </div>
72
+
73
+ <div class="mt-10">
74
+ <table class="text-left w-full">
75
+ <tr>
76
+ <th class="py-2">Class</th>
77
+ <th>Size</th>
78
+ <th>Line Height</th>
79
+ <th>Preview</th>
80
+ </tr>
81
+ <tr v-for="(c, key) in textClasses" :key="key" class="border-t">
82
+ <td class="py-2">{{ key }}</td>
83
+ <td class="text-secondary-500 font-light">{{ c.size }}</td>
84
+ <td class="text-secondary-500 font-light">{{ c.line }}</td>
85
+ <td :class="key" class="max-w-lg truncate">Preview text</td>
86
+ </tr>
87
+ </table>
88
+ </div>
89
+
90
+ <div class="text-secondary-500 mt-4">
91
+ See more about Tailwind typography classes here -> <x-link href="https://tailwindcss.com/docs/font-size" target="_blank" underline>Tailwind Documentation</x-link>
92
+ </div>
93
+ </section>
94
+ </div>
95
+ </template>
@@ -0,0 +1,77 @@
1
+ import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'
2
+
3
+ // layouts
4
+ import DefaultLayout from '../layouts/default.vue'
5
+ import SimpleLayout from '../layouts/simple.vue'
6
+
7
+ // help
8
+ import HomePage from '../pages/index.vue'
9
+ import IconsPage from '../pages/icons.vue'
10
+ import PlayPage from '../pages/play.vue'
11
+ import TypographyPage from '../pages/typography.vue'
12
+ import ColorsPage from '../pages/colors.vue'
13
+
14
+ const pages: Record<string, any> = import.meta.glob('../pages/component/*/index.vue', { eager: true })
15
+
16
+ const componentPages: RouteRecordRaw[] = []
17
+
18
+ Object.keys(pages).forEach((path) => {
19
+ const match = path.match(/\/pages\/component\/(.*)\/index\.vue$/)
20
+
21
+ if (match) {
22
+ const name = match[1].toLowerCase()
23
+
24
+ componentPages.push({
25
+ path: name,
26
+ component: pages[path].default,
27
+ })
28
+ }
29
+ })
30
+
31
+ const routes: RouteRecordRaw[] = [{
32
+ path: '/',
33
+ component: DefaultLayout,
34
+ children: [{
35
+ path: '',
36
+ redirect: { name: 'getting-started' },
37
+ }, {
38
+ path: 'getting-started',
39
+ name: 'getting-started',
40
+ component: HomePage,
41
+ }, {
42
+ path: 'icons',
43
+ name: 'icons',
44
+ component: IconsPage,
45
+ }, {
46
+ path: 'typography',
47
+ name: 'typography',
48
+ component: TypographyPage,
49
+ }, {
50
+ path: 'colors',
51
+ name: 'colors',
52
+ component: ColorsPage,
53
+ }, {
54
+ path: 'component',
55
+ component: SimpleLayout,
56
+ children: componentPages,
57
+ }],
58
+ }, {
59
+ path: '/play',
60
+ component: PlayPage,
61
+ }, {
62
+ path: '/:pathMatch(.*)*', name: 'NotFound', redirect: { name: 'getting-started' },
63
+ }]
64
+
65
+ const router = createRouter({
66
+ history: createWebHistory('/'),
67
+ routes,
68
+ scrollBehavior(to, from, savedPosition) {
69
+ if (savedPosition) {
70
+ return savedPosition
71
+ } else {
72
+ return { top: 0 }
73
+ }
74
+ },
75
+ })
76
+
77
+ export default router
@@ -15,6 +15,9 @@ declare const accordionProps: {
15
15
  iconAlign: PropType<"left" | "right">;
16
16
  };
17
17
  export type AccordionProps = ExtractPublicPropTypes<typeof accordionProps>;
18
+ export type AccordionInjection = AccordionProps & {
19
+ isInsideAccordion: boolean;
20
+ };
18
21
  type InternalClasses = 'wrapper';
19
22
  export interface AccordionTheme extends ThemeComponent<AccordionProps, InternalClasses> {
20
23
  }
@@ -1,5 +1,5 @@
1
- import { defineComponent as c, provide as l, openBlock as i, createElementBlock as d, normalizeStyle as p, unref as e, normalizeClass as m, renderSlot as f } from "vue";
2
- import { useTheme as u } from "../../composables/useTheme.js";
1
+ import { defineComponent as a, provide as i, openBlock as l, createElementBlock as d, normalizeStyle as p, unref as e, normalizeClass as m, renderSlot as u } from "vue";
2
+ import { useTheme as f } from "../../composables/useTheme.js";
3
3
  import { injectAccordionKey as _ } from "../../composables/keys.js";
4
4
  const y = {
5
5
  tag: {
@@ -17,21 +17,21 @@ const y = {
17
17
  }, g = {
18
18
  name: "XAccordion",
19
19
  validators: {}
20
- }, h = /* @__PURE__ */ c({
20
+ }, h = /* @__PURE__ */ a({
21
21
  ...g,
22
22
  props: y,
23
23
  setup(n) {
24
24
  const o = n;
25
- l(_, o);
26
- const { styles: t, classes: r, className: s } = u("Accordion", {}, o);
27
- return (a, B) => (i(), d("div", {
25
+ i(_, { ...o, isInsideAccordion: !0 });
26
+ const { styles: t, classes: r, className: s } = f("Accordion", {}, o);
27
+ return (c, A) => (l(), d("div", {
28
28
  style: p(e(t)),
29
29
  class: m([
30
30
  e(s),
31
31
  e(r).wrapper
32
32
  ])
33
33
  }, [
34
- f(a.$slots, "default")
34
+ u(c.$slots, "default")
35
35
  ], 6));
36
36
  }
37
37
  });
@@ -23,6 +23,7 @@ export type AccordionItemProps = ExtractPublicPropTypes<typeof accordionItemProp
23
23
  type InternalClasses = 'wrapper' | 'icon' | 'content';
24
24
  type InternalData = {
25
25
  collapsed: boolean;
26
+ isInsideAccordion: boolean;
26
27
  };
27
28
  export interface AccordionItemTheme extends ThemeComponent<AccordionItemProps, InternalClasses, InternalData> {
28
29
  }
@@ -1,4 +1,4 @@
1
- import { defineComponent as V, inject as j, computed as z, reactive as D, ref as f, watch as H, openBlock as s, createBlock as m, resolveDynamicComponent as K, normalizeStyle as M, unref as a, normalizeClass as l, withCtx as v, createElementVNode as r, renderSlot as d, createElementBlock as h, createCommentVNode as g, createVNode as X, Transition as q, withDirectives as F, vShow as G } from "vue";
1
+ import { defineComponent as V, inject as j, computed as z, reactive as D, ref as m, watch as H, openBlock as a, createBlock as v, resolveDynamicComponent as K, normalizeStyle as M, unref as s, normalizeClass as l, withCtx as h, createElementVNode as r, renderSlot as d, createElementBlock as g, createCommentVNode as y, createVNode as X, Transition as q, withDirectives as F, vShow as G } from "vue";
2
2
  import { useTheme as J } from "../../composables/useTheme.js";
3
3
  import O from "../icon/Icon.vue.js";
4
4
  import { injectAccordionKey as Q } from "../../composables/keys.js";
@@ -27,103 +27,105 @@ const R = { class: "flex-1 overflow-hidden" }, U = {
27
27
  type: String,
28
28
  default: "right"
29
29
  }
30
- }, te = {
30
+ }, oe = {
31
31
  name: "XAccordionItem",
32
32
  validators: {
33
33
  iconAlign: Z
34
34
  }
35
- }, se = /* @__PURE__ */ V({
36
- ...te,
35
+ }, ae = /* @__PURE__ */ V({
36
+ ...oe,
37
37
  props: ee,
38
38
  emits: ["expand"],
39
- setup(y, { expose: A, emit: x }) {
40
- const n = y, _ = x, k = j(Q, {}), w = z(() => k.iconAlign || n.iconAlign), B = D({
39
+ setup(A, { expose: x, emit: _ }) {
40
+ const n = A, k = _, u = j(Q, {
41
+ isInsideAccordion: !1
42
+ }), w = z(() => u.iconAlign || n.iconAlign), I = D({
41
43
  iconAlign: w
42
- }), t = f(!n.expanded), o = f(!0);
44
+ }), o = m(!n.expanded), t = m(!0);
43
45
  H(() => n.expanded, () => {
44
- t.value = !n.expanded;
46
+ o.value = !n.expanded;
45
47
  });
46
- function E(e) {
47
- o.value && (e.style.height = "0px");
48
+ function B(e) {
49
+ t.value && (e.style.height = "0px");
48
50
  }
49
- function C(e, i) {
50
- o.value ? (e.addEventListener("transitionend", i), setTimeout(() => {
51
+ function E(e, i) {
52
+ t.value ? (e.addEventListener("transitionend", i), setTimeout(() => {
51
53
  e.style.height = `${e.scrollHeight}px`;
52
54
  }, 1)) : i();
53
55
  }
54
- function I(e) {
55
- o.value ? e.style.removeProperty("height") : o.value = !0;
56
+ function C(e) {
57
+ t.value ? e.style.removeProperty("height") : t.value = !0;
56
58
  }
57
59
  function $(e) {
58
- o.value && (e.style.height = `${e.scrollHeight}px`);
60
+ t.value && (e.style.height = `${e.scrollHeight}px`);
59
61
  }
60
62
  function b(e, i) {
61
- o.value ? (e.addEventListener("transitionend", i), setTimeout(() => {
63
+ t.value ? (e.addEventListener("transitionend", i), setTimeout(() => {
62
64
  e.style.height = "0px";
63
65
  }, 1)) : i();
64
66
  }
65
67
  function S(e) {
66
- o.value ? e.style.removeProperty("height") : o.value = !0;
68
+ t.value ? e.style.removeProperty("height") : t.value = !0;
67
69
  }
68
- function u(e = !0) {
69
- o.value = e, t.value = !1;
70
+ function p(e = !0) {
71
+ t.value = e, o.value = !1;
70
72
  }
71
73
  function L(e = !0) {
72
- o.value = e, t.value = !0;
74
+ t.value = e, o.value = !0;
73
75
  }
74
- function p() {
75
- n.disabled || (t.value = !t.value);
76
+ function f() {
77
+ n.disabled || (o.value = !o.value);
76
78
  }
77
79
  function P(e = !0) {
78
- u(e), _("expand");
80
+ p(e), k("expand");
79
81
  }
80
82
  const { styles: N, classes: c, className: T } = J("AccordionItem", {}, {
81
83
  ...n,
82
- ...B
83
- }, { collapsed: t });
84
- return A({ toggle: p, open: u, close: L }), (e, i) => (s(), m(K(e.tag), {
85
- style: M(a(N)),
86
- class: l(a(T)),
84
+ ...I
85
+ }, { collapsed: o, isInsideAccordion: u.isInsideAccordion });
86
+ return x({ toggle: f, open: p, close: L }), (e, i) => (a(), v(K(e.tag), {
87
+ style: M(s(N)),
88
+ class: l(s(T)),
87
89
  "aria-disabled": e.disabled,
88
- "aria-expanded": t.value ? "false" : "true"
90
+ "aria-expanded": o.value ? "false" : "true"
89
91
  }, {
90
- default: v(() => [
92
+ default: h(() => [
91
93
  r("button", {
92
- class: l(a(c).wrapper),
93
- onClick: p
94
+ class: l(s(c).wrapper),
95
+ onClick: f
94
96
  }, [
95
97
  r("div", R, [
96
- d(e.$slots, "default", { collapsed: t.value })
98
+ d(e.$slots, "default", { collapsed: o.value })
97
99
  ]),
98
- e.showIcon ? (s(), h("div", {
100
+ e.showIcon ? (a(), g("div", {
99
101
  key: 0,
100
- class: l(a(c).icon)
102
+ class: l(s(c).icon)
101
103
  }, [
102
- e.icon ? (s(), m(O, {
104
+ e.icon ? (a(), v(O, {
103
105
  key: 0,
104
106
  icon: e.icon
105
- }, null, 8, ["icon"])) : (s(), h("svg", U, Y))
106
- ], 2)) : g("", !0)
107
+ }, null, 8, ["icon"])) : (a(), g("svg", U, Y))
108
+ ], 2)) : y("", !0)
107
109
  ], 2),
108
- e.$slots.summary ? d(e.$slots, "summary", { key: 0 }) : g("", !0),
110
+ e.$slots.summary ? d(e.$slots, "summary", { key: 0 }) : y("", !0),
109
111
  X(q, {
110
- onBeforeEnter: E,
111
- onEnter: C,
112
- onAfterEnter: I,
112
+ onBeforeEnter: B,
113
+ onEnter: E,
114
+ onAfterEnter: C,
113
115
  onBeforeLeave: $,
114
116
  onLeave: b,
115
117
  onAfterLeave: S
116
118
  }, {
117
- default: v(() => [
119
+ default: h(() => [
118
120
  F(r("div", {
119
- class: l(a(c).content)
121
+ class: l(s(c).content)
120
122
  }, [
121
123
  d(e.$slots, "content", {
122
124
  expand: P,
123
- collapsed: t.value
125
+ collapsed: o.value
124
126
  })
125
127
  ], 2), [
126
- [G, !t.value]
128
+ [G, !o.value]
127
129
  ])
128
130
  ]),
129
131
  _: 3
@@ -134,5 +136,5 @@ const R = { class: "flex-1 overflow-hidden" }, U = {
134
136
  }
135
137
  });
136
138
  export {
137
- se as default
139
+ ae as default
138
140
  };
@@ -1,4 +1,4 @@
1
1
  export { default as XAccordion } from './Accordion.vue';
2
- export type { AccordionProps, AccordionTheme } from './Accordion.vue';
2
+ export type { AccordionProps, AccordionInjection, AccordionTheme } from './Accordion.vue';
3
3
  export { default as XAccordionItem } from './AccordionItem.vue';
4
4
  export type { AccordionItemProps, AccordionItemTheme } from './AccordionItem.vue';
@@ -1,8 +1,5 @@
1
- const e = {
2
- classes: {
3
- wrapper: "grid grid-cols-1 divide-y border-b border-t"
4
- }
5
- }, r = e;
1
+ import e from "./Accordion.base.theme.js";
2
+ const t = e, o = t;
6
3
  export {
7
- r as default
4
+ o as default
8
5
  };
@@ -1,16 +1,16 @@
1
- const s = {
1
+ const r = {
2
2
  classes: {
3
- wrapper: ({ props: t, slots: r }) => {
4
- const e = ["relative flex items-center w-full text-left"];
5
- return r.default && (e.push("px-4 py-2"), t.disabled || e.push("hover:bg-gray-50 dark:hover:bg-gray-800")), t.iconAlign === "left" && e.push("flex-row-reverse"), t.disabled || e.push("cursor-pointer"), e;
3
+ wrapper: ({ props: s, slots: i, data: e }) => {
4
+ const t = ["relative flex items-center w-full text-left"];
5
+ return e.isInsideAccordion && (i.default && (s.iconAlign === "left" ? t.push("pl-8 pr-4") : t.push("pr-8 pl-4"), t.push("py-2"), s.disabled || t.push("hover:bg-gray-50 dark:hover:bg-gray-600")), s.disabled || t.push("cursor-pointer")), t;
6
6
  },
7
- icon: ({ props: t, data: r }) => {
8
- const e = ["flex transform transition-transform duration-150"];
9
- return r.collapsed || e.push("rotate-180"), t.disabled && e.push("text-gray-300"), t.iconAlign === "left" && e.push("mr-4"), e;
7
+ icon: ({ props: s, data: i }) => {
8
+ const e = ["absolute flex transform transition-transform duration-150"];
9
+ return i.collapsed || e.push("rotate-180"), s.disabled && e.push("text-gray-300"), s.iconAlign === "left" ? e.push("left-2") : e.push("right-2"), e;
10
10
  },
11
11
  content: "transition-[height] duration-150 overflow-y-hidden"
12
12
  }
13
- }, i = s;
13
+ }, l = r;
14
14
  export {
15
- i as default
15
+ l as default
16
16
  };
@@ -1,16 +1,5 @@
1
- const s = {
2
- classes: {
3
- wrapper: ({ props: t, slots: r }) => {
4
- const e = ["relative flex items-center w-full text-left"];
5
- return r.default && (e.push("px-4 py-2"), t.disabled || e.push("hover:bg-gray-50 dark:hover:bg-gray-800")), t.iconAlign === "left" && e.push("flex-row-reverse"), t.disabled || e.push("cursor-pointer"), e;
6
- },
7
- icon: ({ props: t, data: r }) => {
8
- const e = ["flex transform transition-transform duration-150"];
9
- return r.collapsed || e.push("rotate-180"), t.disabled && e.push("text-gray-300"), t.iconAlign === "left" && e.push("mr-4"), e;
10
- },
11
- content: "px-4 pt-2 pb-6 transition-[height] duration-150 overflow-y-hidden"
12
- }
13
- }, i = s;
1
+ import e from "./AccordionItem.base.theme.js";
2
+ const t = e, o = t;
14
3
  export {
15
- i as default
4
+ o as default
16
5
  };