@indielayer/ui 1.0.0-alpha.0 → 1.0.0-alpha.5

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 (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +26 -72
  3. package/lib/components/avatar/Avatar.vue.d.ts +2 -2
  4. package/lib/components/badge/Badge.vue.d.ts +2 -2
  5. package/lib/components/button/Button.vue.d.ts +2 -2
  6. package/lib/components/button/ButtonGroup.vue.d.ts +2 -2
  7. package/lib/components/checkbox/Checkbox.vue.d.ts +4 -3
  8. package/lib/components/drawer/Drawer.vue.d.ts +2 -2
  9. package/lib/components/icon/Icon.vue.d.ts +7 -3
  10. package/lib/components/index.d.ts +2 -2
  11. package/lib/components/input/Input.vue.d.ts +3 -2
  12. package/lib/components/menu/Menu.vue.d.ts +2 -2
  13. package/lib/components/menu/MenuItem.vue.d.ts +3 -3
  14. package/lib/components/notifications/Notifications.vue.d.ts +2 -2
  15. package/lib/components/pagination/Pagination.vue.d.ts +3 -2
  16. package/lib/components/pagination/PaginationItem.vue.d.ts +2 -2
  17. package/lib/components/radio/Radio.vue.d.ts +2 -2
  18. package/lib/components/select/Select.vue.d.ts +3 -2
  19. package/lib/components/slider/Slider.vue.d.ts +2 -2
  20. package/lib/components/spacer/Spacer.vue.d.ts +1 -1
  21. package/lib/components/spinner/Spinner.vue.d.ts +2 -2
  22. package/lib/components/{tabs → tab}/Tab.vue.d.ts +2 -2
  23. package/lib/components/{tabs/Tabs.vue.d.ts → tab/TabGroup.vue.d.ts} +0 -0
  24. package/lib/components/table/TableBody.vue.d.ts +1 -1
  25. package/lib/components/table/TableHead.vue.d.ts +1 -1
  26. package/lib/components/tag/Tag.vue.d.ts +2 -2
  27. package/lib/components/textarea/Textarea.vue.d.ts +3 -11
  28. package/lib/components/toggle/Toggle.vue.d.ts +2 -2
  29. package/lib/composables/keys.d.ts +1 -0
  30. package/lib/create.d.ts +12 -0
  31. package/lib/index.cjs.js +2 -2
  32. package/lib/index.d.ts +2 -0
  33. package/lib/index.es.js +271 -130
  34. package/lib/install.d.ts +4 -6
  35. package/lib/nuxt.js +15 -16
  36. package/lib/nuxt.plugin.js +8 -0
  37. package/lib/style.css +1 -1
  38. package/lib/version.d.ts +1 -1
  39. package/package.json +21 -15
  40. package/src/components/alert/Alert.vue +164 -0
  41. package/src/components/avatar/Avatar.vue +137 -0
  42. package/src/components/badge/Badge.vue +107 -0
  43. package/src/components/breadcrumbs/Breadcrumbs.vue +60 -0
  44. package/src/components/button/Button.vue +433 -0
  45. package/src/components/button/ButtonGroup.vue +73 -0
  46. package/src/components/card/Card.vue +25 -0
  47. package/src/components/checkbox/Checkbox.vue +205 -0
  48. package/src/components/collapse/Collapse.vue +181 -0
  49. package/src/components/container/Container.vue +23 -0
  50. package/src/components/divider/Divider.vue +52 -0
  51. package/src/components/drawer/Drawer.vue +244 -0
  52. package/src/components/form/Form.vue +111 -0
  53. package/src/components/icon/Icon.vue +123 -0
  54. package/src/components/image/Image.vue +36 -0
  55. package/src/components/index.ts +45 -0
  56. package/src/components/input/Input.vue +199 -0
  57. package/src/components/link/Link.vue +110 -0
  58. package/src/components/menu/Menu.vue +118 -0
  59. package/src/components/menu/MenuItem.vue +277 -0
  60. package/src/components/modal/Modal.vue +175 -0
  61. package/src/components/notifications/Notifications.vue +318 -0
  62. package/src/components/pagination/Pagination.vue +181 -0
  63. package/src/components/pagination/PaginationItem.vue +58 -0
  64. package/src/components/popover/Popover.vue +194 -0
  65. package/src/components/popover/PopoverContainer.vue +23 -0
  66. package/src/components/progress/Progress.vue +86 -0
  67. package/src/components/radio/Radio.vue +220 -0
  68. package/src/components/scroll/Scroll.vue +143 -0
  69. package/src/components/select/Select.vue +408 -0
  70. package/src/components/skeleton/Skeleton.vue +23 -0
  71. package/src/components/slider/Slider.vue +240 -0
  72. package/src/components/spacer/Spacer.vue +11 -0
  73. package/src/components/spinner/Spinner.vue +45 -0
  74. package/src/components/tab/Tab.vue +100 -0
  75. package/src/components/tab/TabGroup.vue +151 -0
  76. package/src/components/table/Table.vue +172 -0
  77. package/src/components/table/TableBody.vue +13 -0
  78. package/src/components/table/TableCell.vue +78 -0
  79. package/src/components/table/TableHead.vue +15 -0
  80. package/src/components/table/TableHeader.vue +94 -0
  81. package/src/components/table/TableRow.vue +43 -0
  82. package/src/components/tag/Tag.vue +98 -0
  83. package/src/components/textarea/Textarea.vue +156 -0
  84. package/src/components/toggle/Toggle.vue +144 -0
  85. package/src/components/tooltip/Tooltip.vue +26 -0
  86. package/src/composables/colors-utils.ts +378 -0
  87. package/src/composables/colors.ts +82 -0
  88. package/src/composables/common.ts +20 -0
  89. package/src/composables/css.ts +45 -0
  90. package/src/composables/index.ts +7 -0
  91. package/src/composables/inputtable.ts +128 -0
  92. package/src/composables/interactive.ts +16 -0
  93. package/src/composables/keys.ts +8 -0
  94. package/src/composables/notification.ts +10 -0
  95. package/src/create.ts +38 -0
  96. package/src/exports/nuxt.js +32 -0
  97. package/src/exports/nuxt.plugin.js +8 -0
  98. package/src/exports/tailwind.preset.js +55 -0
  99. package/src/index.ts +8 -0
  100. package/src/install.ts +8 -0
  101. package/src/shims-vue.d.ts +6 -0
  102. package/src/version.ts +1 -0
  103. package/volar.d.ts +1 -1
package/src/create.ts ADDED
@@ -0,0 +1,38 @@
1
+ import type { App } from 'vue'
2
+ import type { ColorLibrary } from './composables/colors'
3
+ import { injectColorsKey, injectIconsKey } from './composables/keys'
4
+
5
+ export interface IndielayerUIOptions {
6
+ prefix?: string,
7
+ components?: any,
8
+ colors?: ColorLibrary,
9
+ icons?: any
10
+ }
11
+
12
+ const defaultOptions: IndielayerUIOptions = {
13
+ prefix: 'X',
14
+ }
15
+
16
+ const create = (createOptions: IndielayerUIOptions = {}) => {
17
+ const install = (app: App, installOptions: IndielayerUIOptions = {}) => {
18
+ const options = {
19
+ ...defaultOptions,
20
+ ...createOptions,
21
+ ...installOptions,
22
+ }
23
+
24
+ if (options.components)
25
+ options.components.forEach((component: any) => {
26
+ app.component(`${options.prefix}${component.name.slice(1)}`, component)
27
+ })
28
+
29
+ app.provide(injectColorsKey, options.colors)
30
+ app.provide(injectIconsKey, options.icons)
31
+ }
32
+
33
+ return {
34
+ install,
35
+ }
36
+ }
37
+
38
+ export default create
@@ -0,0 +1,32 @@
1
+ import { defineNuxtModule, addPlugin, createResolver } from '@nuxt/kit'
2
+ import { fileURLToPath } from 'node:url'
3
+
4
+ export default defineNuxtModule({
5
+ meta: {
6
+ name: '@indielayer/ui',
7
+ configKey: 'indielayer',
8
+ compatibility: {
9
+ nuxt: '^3.0.0',
10
+ },
11
+ },
12
+ defaults: {
13
+ prefix: 'X',
14
+ },
15
+ async setup(options, nuxt) {
16
+ // Create resolver to resolve relative paths
17
+ const { resolve } = createResolver(import.meta.url)
18
+
19
+ nuxt.options.runtimeConfig.public.indielayerOptions = options
20
+
21
+ // plugin install
22
+ addPlugin(resolve('./nuxt.plugin.js'))
23
+
24
+ // nuxt install
25
+ nuxt.hook('components:dirs', (dirs) => {
26
+ dirs.push({
27
+ path: fileURLToPath(new URL('../src/components', import.meta.url)),
28
+ prefix: options?.prefix ? options?.prefix : 'X',
29
+ })
30
+ })
31
+ },
32
+ })
@@ -0,0 +1,8 @@
1
+ import { defineNuxtPlugin } from '#app'
2
+ import create from '../src/create'
3
+
4
+ export default defineNuxtPlugin((nuxtApp) => {
5
+ const UI = create(nuxtApp.$config.indielayerOptions)
6
+
7
+ nuxtApp.vueApp.use(UI)
8
+ })
@@ -0,0 +1,55 @@
1
+ const colors = require('tailwindcss/colors')
2
+
3
+ module.exports = (useDark = true) => ({
4
+ theme: {
5
+ extend: {
6
+ colors: {
7
+ primary: colors.emerald,
8
+ secondary: colors.slate,
9
+ success: colors.green,
10
+ warning: colors.yellow,
11
+ error: colors.red,
12
+ },
13
+ borderColor: colors.gray[100],
14
+ fontFamily: {
15
+ sans: [
16
+ 'Inter',
17
+ '-apple-system',
18
+ 'BlinkMacSystemFont',
19
+ 'ui-sans-serif',
20
+ 'system-ui',
21
+ '"Segoe UI"',
22
+ 'Roboto',
23
+ '"Helvetica Neue"',
24
+ 'Arial',
25
+ '"Noto Sans"',
26
+ 'sans-serif',
27
+ '"Apple Color Emoji"',
28
+ '"Segoe UI Emoji"',
29
+ '"Segoe UI Symbol"',
30
+ '"Noto Color Emoji"',
31
+ ],
32
+ },
33
+ },
34
+ },
35
+ plugins: useDark ? [
36
+ ({ addBase, config }) => {
37
+ addBase({
38
+ html: {
39
+ color: config('theme.colors.gray.900'),
40
+ backgroundColor: 'white',
41
+ },
42
+ 'html.dark': {
43
+ color: config('theme.colors.gray.100'),
44
+ backgroundColor: config('theme.colors.gray.900'),
45
+ },
46
+ '*, ::before, ::after': {
47
+ borderColor: colors.gray[200],
48
+ },
49
+ '.dark *, .dark ::before, .dark ::after': {
50
+ borderColor: colors.slate[700],
51
+ },
52
+ })
53
+ },
54
+ ] : [],
55
+ })
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ export { tailwindColors as colors } from './composables/colors-utils'
2
+ export { default as version } from './version'
3
+ export * from './components'
4
+ export * from './composables'
5
+
6
+ export { default as createUI } from './create'
7
+
8
+ export { default } from './install'
package/src/install.ts ADDED
@@ -0,0 +1,8 @@
1
+ import * as components from './components'
2
+ import create from './create'
3
+
4
+ export default create({
5
+ components: Object.keys(components).map(
6
+ (key) => components[key as keyof object],
7
+ ),
8
+ })
@@ -0,0 +1,6 @@
1
+ // shims-vue.d.ts
2
+ declare module '*.vue' {
3
+ import type { DefineComponent } from 'vue'
4
+ const component: DefineComponent<{}, {}, any>
5
+ export default component
6
+ }
package/src/version.ts ADDED
@@ -0,0 +1 @@
1
+ export default '1.0.0-alpha.5'
package/volar.d.ts CHANGED
@@ -40,7 +40,7 @@ declare module 'vue' {
40
40
  XTableHeader: typeof import('@indielayer/ui')['XTableHeader']
41
41
  XTableRow: typeof import('@indielayer/ui')['XTableRow']
42
42
  XTab: typeof import('@indielayer/ui')['XTab']
43
- XTabs: typeof import('@indielayer/ui')['XTabs']
43
+ XTabGroup: typeof import('@indielayer/ui')['XTabGroup']
44
44
  XTag: typeof import('@indielayer/ui')['XTag']
45
45
  XTextarea: typeof import('@indielayer/ui')['XTextarea']
46
46
  XToggle: typeof import('@indielayer/ui')['XToggle']