@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.
- package/LICENSE +1 -1
- package/README.md +2 -2
- package/{lib/nuxt.js → exports/nuxt.mjs} +1 -1
- package/{src/exports → exports}/nuxt.plugin.js +1 -1
- package/lib/components/alert/Alert.vue.d.ts +11 -2
- package/lib/components/avatar/Avatar.vue.d.ts +9 -2
- package/lib/components/badge/Badge.vue.d.ts +10 -2
- package/lib/components/breadcrumbs/Breadcrumbs.vue.d.ts +2 -2
- package/lib/components/button/Button.vue.d.ts +9 -2
- package/lib/components/button/ButtonGroup.vue.d.ts +9 -2
- package/lib/components/card/Card.vue.d.ts +8 -1
- package/lib/components/checkbox/Checkbox.vue.d.ts +12 -4
- package/lib/components/collapse/Collapse.vue.d.ts +15 -1
- package/lib/components/container/Container.vue.d.ts +8 -1
- package/lib/components/divider/Divider.vue.d.ts +1 -1
- package/lib/components/drawer/Drawer.vue.d.ts +11 -2
- package/lib/components/form/Form.vue.d.ts +10 -3
- package/lib/components/helpers/InputError.d.ts +2 -2
- package/lib/components/icon/Icon.vue.d.ts +1 -1
- package/lib/components/image/Image.vue.d.ts +1 -1
- package/lib/components/input/Input.vue.d.ts +4 -4
- package/lib/components/link/Link.vue.d.ts +8 -1
- package/lib/components/menu/Menu.vue.d.ts +1 -1
- package/lib/components/menu/MenuItem.vue.d.ts +11 -2
- package/lib/components/modal/Modal.vue.d.ts +11 -1
- package/lib/components/notifications/Notifications.vue.d.ts +13 -6
- package/lib/components/pagination/Pagination.vue.d.ts +1 -1
- package/lib/components/pagination/PaginationItem.vue.d.ts +1 -1
- package/lib/components/popover/Popover.vue.d.ts +11 -3
- package/lib/components/popover/PopoverContainer.vue.d.ts +8 -1
- package/lib/components/progress/Progress.theme.d.ts +3 -1
- package/lib/components/progress/Progress.vue.d.ts +2 -2
- package/lib/components/radio/Radio.vue.d.ts +11 -4
- package/lib/components/scroll/Scroll.vue.d.ts +8 -1
- package/lib/components/select/Select.vue.d.ts +11 -4
- package/lib/components/skeleton/Skeleton.vue.d.ts +1 -1
- package/lib/components/slider/Slider.vue.d.ts +16 -4
- package/lib/components/spacer/Spacer.d.ts +1 -1
- package/lib/components/spinner/Spinner.vue.d.ts +1 -1
- package/lib/components/tab/Tab.vue.d.ts +14 -1
- package/lib/components/tab/TabGroup.vue.d.ts +8 -1
- package/lib/components/table/Table.vue.d.ts +12 -5
- package/lib/components/table/TableBody.d.ts +1 -1
- package/lib/components/table/TableCell.vue.d.ts +8 -1
- package/lib/components/table/TableHead.d.ts +1 -1
- package/lib/components/table/TableHeader.vue.d.ts +10 -3
- package/lib/components/table/TableRow.vue.d.ts +8 -1
- package/lib/components/tag/Tag.vue.d.ts +9 -2
- package/lib/components/textarea/Textarea.vue.d.ts +3 -3
- package/lib/components/toggle/Toggle.vue.d.ts +4 -4
- package/lib/components/tooltip/Tooltip.vue.d.ts +9 -1
- package/lib/composables/colors.d.ts +4 -3
- package/lib/composables/common.d.ts +1 -1
- package/lib/composables/css.d.ts +1 -1
- package/lib/composables/notifications.d.ts +1 -1
- package/lib/composables/theme.d.ts +1 -1
- package/lib/create.d.ts +1 -1
- package/lib/index.cjs.js +1 -1
- package/lib/index.es.js +3959 -5956
- package/lib/version.d.ts +1 -1
- package/package.json +51 -51
- package/src/components/alert/Alert.vue +2 -1
- package/src/components/avatar/Avatar.vue +2 -1
- package/src/components/breadcrumbs/Breadcrumbs.vue +7 -7
- package/src/components/button/Button.theme.ts +5 -11
- package/src/components/button/Button.vue +2 -1
- package/src/components/button/ButtonGroup.vue +4 -4
- package/src/components/checkbox/Checkbox.vue +1 -1
- package/src/components/collapse/Collapse.vue +12 -12
- package/src/components/drawer/Drawer.vue +24 -24
- package/src/components/form/Form.vue +8 -9
- package/src/components/input/Input.vue +2 -2
- package/src/components/link/Link.vue +4 -1
- package/src/components/menu/MenuItem.vue +11 -6
- package/src/components/modal/Modal.vue +1 -1
- package/src/components/notifications/Notifications.vue +16 -16
- package/src/components/popover/Popover.vue +31 -27
- package/src/components/radio/Radio.vue +3 -2
- package/src/components/scroll/Scroll.vue +23 -16
- package/src/components/select/Select.vue +3 -4
- package/src/components/table/Table.vue +6 -6
- package/src/components/table/TableCell.vue +2 -2
- package/src/components/table/TableHeader.vue +2 -2
- package/src/components/table/TableRow.vue +1 -1
- package/src/components/textarea/Textarea.vue +0 -0
- package/src/composables/colors-utils.ts +3 -268
- package/src/composables/colors.ts +16 -14
- package/src/composables/css.ts +4 -4
- package/src/composables/inputtable.ts +4 -4
- package/src/composables/interactive.ts +2 -2
- package/src/composables/theme.ts +6 -6
- package/src/create.ts +5 -5
- package/src/version.ts +1 -1
- package/volar.d.ts +1 -3
- package/lib/nuxt.plugin.js +0 -8
- package/src/exports/nuxt.js +0 -33
- package/src/exports/tailwind.preset.js +0 -55
- /package/{lib → exports}/tailwind.preset.js +0 -0
package/src/composables/css.ts
CHANGED
|
@@ -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
|
|
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
|
|
package/src/composables/theme.ts
CHANGED
|
@@ -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.
|
|
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
|
|
package/lib/nuxt.plugin.js
DELETED
package/src/exports/nuxt.js
DELETED
|
@@ -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
|