@indielayer/ui 1.0.9 → 1.0.10

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 (98) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +2 -2
  3. package/{lib/nuxt.js → exports/nuxt.mjs} +1 -1
  4. package/{src/exports → exports}/nuxt.plugin.js +1 -1
  5. package/lib/components/alert/Alert.vue.d.ts +11 -2
  6. package/lib/components/avatar/Avatar.vue.d.ts +9 -2
  7. package/lib/components/badge/Badge.vue.d.ts +10 -2
  8. package/lib/components/breadcrumbs/Breadcrumbs.vue.d.ts +2 -2
  9. package/lib/components/button/Button.vue.d.ts +9 -2
  10. package/lib/components/button/ButtonGroup.vue.d.ts +9 -2
  11. package/lib/components/card/Card.vue.d.ts +8 -1
  12. package/lib/components/checkbox/Checkbox.vue.d.ts +12 -4
  13. package/lib/components/collapse/Collapse.vue.d.ts +15 -1
  14. package/lib/components/container/Container.vue.d.ts +8 -1
  15. package/lib/components/divider/Divider.vue.d.ts +1 -1
  16. package/lib/components/drawer/Drawer.vue.d.ts +11 -2
  17. package/lib/components/form/Form.vue.d.ts +10 -3
  18. package/lib/components/helpers/InputError.d.ts +2 -2
  19. package/lib/components/icon/Icon.vue.d.ts +1 -1
  20. package/lib/components/image/Image.vue.d.ts +1 -1
  21. package/lib/components/input/Input.vue.d.ts +4 -4
  22. package/lib/components/link/Link.vue.d.ts +8 -1
  23. package/lib/components/menu/Menu.vue.d.ts +1 -1
  24. package/lib/components/menu/MenuItem.vue.d.ts +11 -2
  25. package/lib/components/modal/Modal.vue.d.ts +11 -1
  26. package/lib/components/notifications/Notifications.vue.d.ts +13 -6
  27. package/lib/components/pagination/Pagination.vue.d.ts +1 -1
  28. package/lib/components/pagination/PaginationItem.vue.d.ts +1 -1
  29. package/lib/components/popover/Popover.vue.d.ts +11 -3
  30. package/lib/components/popover/PopoverContainer.vue.d.ts +8 -1
  31. package/lib/components/progress/Progress.theme.d.ts +3 -1
  32. package/lib/components/progress/Progress.vue.d.ts +2 -2
  33. package/lib/components/radio/Radio.vue.d.ts +11 -4
  34. package/lib/components/scroll/Scroll.vue.d.ts +8 -1
  35. package/lib/components/select/Select.vue.d.ts +11 -4
  36. package/lib/components/skeleton/Skeleton.vue.d.ts +1 -1
  37. package/lib/components/slider/Slider.vue.d.ts +16 -4
  38. package/lib/components/spacer/Spacer.d.ts +1 -1
  39. package/lib/components/spinner/Spinner.vue.d.ts +1 -1
  40. package/lib/components/tab/Tab.vue.d.ts +14 -1
  41. package/lib/components/tab/TabGroup.vue.d.ts +8 -1
  42. package/lib/components/table/Table.vue.d.ts +12 -5
  43. package/lib/components/table/TableBody.d.ts +1 -1
  44. package/lib/components/table/TableCell.vue.d.ts +8 -1
  45. package/lib/components/table/TableHead.d.ts +1 -1
  46. package/lib/components/table/TableHeader.vue.d.ts +10 -3
  47. package/lib/components/table/TableRow.vue.d.ts +8 -1
  48. package/lib/components/tag/Tag.vue.d.ts +9 -2
  49. package/lib/components/textarea/Textarea.vue.d.ts +3 -3
  50. package/lib/components/toggle/Toggle.vue.d.ts +4 -4
  51. package/lib/components/tooltip/Tooltip.vue.d.ts +9 -1
  52. package/lib/composables/colors.d.ts +4 -3
  53. package/lib/composables/common.d.ts +1 -1
  54. package/lib/composables/css.d.ts +1 -1
  55. package/lib/composables/notifications.d.ts +1 -1
  56. package/lib/composables/theme.d.ts +1 -1
  57. package/lib/create.d.ts +1 -1
  58. package/lib/index.cjs.js +1 -1
  59. package/lib/index.es.js +3959 -5956
  60. package/lib/version.d.ts +1 -1
  61. package/package.json +51 -51
  62. package/src/components/alert/Alert.vue +2 -1
  63. package/src/components/avatar/Avatar.vue +2 -1
  64. package/src/components/breadcrumbs/Breadcrumbs.vue +7 -7
  65. package/src/components/button/Button.theme.ts +5 -11
  66. package/src/components/button/Button.vue +2 -1
  67. package/src/components/button/ButtonGroup.vue +4 -4
  68. package/src/components/checkbox/Checkbox.vue +1 -1
  69. package/src/components/collapse/Collapse.vue +12 -12
  70. package/src/components/drawer/Drawer.vue +24 -24
  71. package/src/components/form/Form.vue +8 -9
  72. package/src/components/input/Input.vue +2 -2
  73. package/src/components/link/Link.vue +4 -1
  74. package/src/components/menu/MenuItem.vue +11 -6
  75. package/src/components/modal/Modal.vue +1 -1
  76. package/src/components/notifications/Notifications.vue +16 -16
  77. package/src/components/popover/Popover.vue +31 -27
  78. package/src/components/radio/Radio.vue +3 -2
  79. package/src/components/scroll/Scroll.vue +23 -16
  80. package/src/components/select/Select.vue +3 -4
  81. package/src/components/table/Table.vue +6 -6
  82. package/src/components/table/TableCell.vue +2 -2
  83. package/src/components/table/TableHeader.vue +2 -2
  84. package/src/components/table/TableRow.vue +1 -1
  85. package/src/components/textarea/Textarea.vue +0 -0
  86. package/src/composables/colors-utils.ts +3 -268
  87. package/src/composables/colors.ts +16 -14
  88. package/src/composables/css.ts +4 -4
  89. package/src/composables/inputtable.ts +4 -4
  90. package/src/composables/interactive.ts +2 -2
  91. package/src/composables/theme.ts +6 -6
  92. package/src/create.ts +5 -5
  93. package/src/version.ts +1 -1
  94. package/volar.d.ts +1 -3
  95. package/lib/nuxt.plugin.js +0 -8
  96. package/src/exports/nuxt.js +0 -33
  97. package/src/exports/tailwind.preset.js +0 -55
  98. /package/{lib → exports}/tailwind.preset.js +0 -0
@@ -5,13 +5,13 @@ const isTheme = (theme: string) => themes.includes(theme)
5
5
  const isModifier = (modifier: string) => modifiers.includes(modifier)
6
6
 
7
7
  export interface CSSComposition {
8
- get: (name: string, value: string, theme?: string, modifier?: string)=> string
9
- variable: (name: string, theme?: string, modifier?: string)=> string
10
- variables: (object: Record<string, string | object>, theme?: string, modifier?: string)=> Record<string, string>
8
+ get: (name: string, value: string, theme?: string, modifier?: string) => string;
9
+ variable: (name: string, theme?: string, modifier?: string) => string;
10
+ variables: (object: Record<string, string | object>, theme?: string, modifier?: string) => Record<string, string>;
11
11
  }
12
12
 
13
13
  export const useCSS = (namespace?: string): CSSComposition => {
14
- const get = (name: string, value: string, theme?: string, modifier?: string) => `${variable(name,theme,modifier)}: ${value}`
14
+ const get = (name: string, value: string, theme?: string, modifier?: string) => `${variable(name, theme, modifier)}: ${value}`
15
15
 
16
16
  const variable = (name: string, theme?: string, modifier?: string) =>
17
17
  `--x${namespace ? `-${namespace}` : ''}${theme ? `-${theme}` : ''}-${name}${modifier ? `-${modifier}` : ''}`
@@ -3,12 +3,12 @@ import { ref, computed, inject, watch, onMounted, onUnmounted } from 'vue'
3
3
  import { injectFormKey } from './keys'
4
4
 
5
5
  export interface XFormInputMethods {
6
- focus: ()=> void,
7
- validate: (val: any)=> boolean,
8
- setError: (val: string)=> void
6
+ focus: () => void;
7
+ validate: (val: any) => boolean;
8
+ setError: (val: string) => void;
9
9
  }
10
10
 
11
- export const useInputtable = (props: any, { focus, emit, withListeners = true }: { focus: ()=> void, emit: any, withListeners?: boolean }) => {
11
+ export const useInputtable = (props: any, { focus, emit, withListeners = true }: { focus: () => void; emit: any; withListeners?: boolean; }) => {
12
12
  const isFirstValidation = ref(true)
13
13
  const errorInternal = ref(props.error)
14
14
 
@@ -1,8 +1,8 @@
1
1
  import type { Ref } from 'vue'
2
2
 
3
3
  export interface InteractiveProps {
4
- disabled?: boolean
5
- loading?: boolean
4
+ disabled?: boolean;
5
+ loading?: boolean;
6
6
  }
7
7
 
8
8
  export const useInteractive = (
@@ -8,12 +8,12 @@ import { smartUnref } from '../common/utils'
8
8
  import type { Slots } from 'vue'
9
9
 
10
10
  export type ThemeParams = {
11
- props: any
12
- slots: Slots
13
- colors: ColorComposition
14
- css: CSSComposition
15
- rtl?: boolean
16
- data?: any
11
+ props: any;
12
+ slots: Slots;
13
+ colors: ColorComposition;
14
+ css: CSSComposition;
15
+ rtl?: boolean;
16
+ data?: any;
17
17
  }
18
18
 
19
19
  export const useTheme = (namespace: string, defaultTheme: any = {}, props: any, data?: any) => {
package/src/create.ts CHANGED
@@ -3,11 +3,11 @@ import type { ColorLibrary } from './composables/colors'
3
3
  import { injectColorsKey, injectIconsKey, injectThemeKey } from './composables/keys'
4
4
 
5
5
  export type IndielayerUIOptions = {
6
- prefix?: string,
7
- components?: any,
8
- colors?: ColorLibrary,
9
- icons?: any
10
- theme?: any
6
+ prefix?: string;
7
+ components?: any;
8
+ colors?: ColorLibrary;
9
+ icons?: any;
10
+ theme?: any;
11
11
  }
12
12
 
13
13
  const defaultOptions: IndielayerUIOptions = {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export default '1.0.9'
1
+ export default '1.0.10'
package/volar.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare module 'vue' {
1
+ declare module '@vue/runtime-core' {
2
2
  export interface GlobalComponents {
3
3
  XAlert: typeof import('@indielayer/ui')['XAlert']
4
4
  XAvatar: typeof import('@indielayer/ui')['XAvatar']
@@ -15,7 +15,6 @@ declare module 'vue' {
15
15
  XForm: typeof import('@indielayer/ui')['XForm']
16
16
  XIcon: typeof import('@indielayer/ui')['XIcon']
17
17
  XImage: typeof import('@indielayer/ui')['XImage']
18
- XAbac: typeof import('@indielayer/ui')['XAbac']
19
18
  XInput: typeof import('@indielayer/ui')['XInput']
20
19
  XLink: typeof import('@indielayer/ui')['XLink']
21
20
  XMenu: typeof import('@indielayer/ui')['XMenu']
@@ -46,7 +45,6 @@ declare module 'vue' {
46
45
  XTextarea: typeof import('@indielayer/ui')['XTextarea']
47
46
  XToggle: typeof import('@indielayer/ui')['XToggle']
48
47
  XTooltip: typeof import('@indielayer/ui')['XTooltip']
49
- [key: string]: any
50
48
  }
51
49
  }
52
50
 
@@ -1,8 +0,0 @@
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
- })
@@ -1,33 +0,0 @@
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-rc.1',
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
- extensions: ['vue', 'tsx'],
29
- prefix: options?.prefix ? options?.prefix : 'X',
30
- })
31
- })
32
- },
33
- })
@@ -1,55 +0,0 @@
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
- })
File without changes