@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.
- package/LICENSE +21 -0
- package/README.md +26 -72
- package/lib/components/avatar/Avatar.vue.d.ts +2 -2
- package/lib/components/badge/Badge.vue.d.ts +2 -2
- package/lib/components/button/Button.vue.d.ts +2 -2
- package/lib/components/button/ButtonGroup.vue.d.ts +2 -2
- package/lib/components/checkbox/Checkbox.vue.d.ts +4 -3
- package/lib/components/drawer/Drawer.vue.d.ts +2 -2
- package/lib/components/icon/Icon.vue.d.ts +7 -3
- package/lib/components/index.d.ts +2 -2
- package/lib/components/input/Input.vue.d.ts +3 -2
- package/lib/components/menu/Menu.vue.d.ts +2 -2
- package/lib/components/menu/MenuItem.vue.d.ts +3 -3
- package/lib/components/notifications/Notifications.vue.d.ts +2 -2
- package/lib/components/pagination/Pagination.vue.d.ts +3 -2
- package/lib/components/pagination/PaginationItem.vue.d.ts +2 -2
- package/lib/components/radio/Radio.vue.d.ts +2 -2
- package/lib/components/select/Select.vue.d.ts +3 -2
- package/lib/components/slider/Slider.vue.d.ts +2 -2
- package/lib/components/spacer/Spacer.vue.d.ts +1 -1
- package/lib/components/spinner/Spinner.vue.d.ts +2 -2
- package/lib/components/{tabs → tab}/Tab.vue.d.ts +2 -2
- package/lib/components/{tabs/Tabs.vue.d.ts → tab/TabGroup.vue.d.ts} +0 -0
- package/lib/components/table/TableBody.vue.d.ts +1 -1
- package/lib/components/table/TableHead.vue.d.ts +1 -1
- package/lib/components/tag/Tag.vue.d.ts +2 -2
- package/lib/components/textarea/Textarea.vue.d.ts +3 -11
- package/lib/components/toggle/Toggle.vue.d.ts +2 -2
- package/lib/composables/keys.d.ts +1 -0
- package/lib/create.d.ts +12 -0
- package/lib/index.cjs.js +2 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.es.js +271 -130
- package/lib/install.d.ts +4 -6
- package/lib/nuxt.js +15 -16
- package/lib/nuxt.plugin.js +8 -0
- package/lib/style.css +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +21 -15
- package/src/components/alert/Alert.vue +164 -0
- package/src/components/avatar/Avatar.vue +137 -0
- package/src/components/badge/Badge.vue +107 -0
- package/src/components/breadcrumbs/Breadcrumbs.vue +60 -0
- package/src/components/button/Button.vue +433 -0
- package/src/components/button/ButtonGroup.vue +73 -0
- package/src/components/card/Card.vue +25 -0
- package/src/components/checkbox/Checkbox.vue +205 -0
- package/src/components/collapse/Collapse.vue +181 -0
- package/src/components/container/Container.vue +23 -0
- package/src/components/divider/Divider.vue +52 -0
- package/src/components/drawer/Drawer.vue +244 -0
- package/src/components/form/Form.vue +111 -0
- package/src/components/icon/Icon.vue +123 -0
- package/src/components/image/Image.vue +36 -0
- package/src/components/index.ts +45 -0
- package/src/components/input/Input.vue +199 -0
- package/src/components/link/Link.vue +110 -0
- package/src/components/menu/Menu.vue +118 -0
- package/src/components/menu/MenuItem.vue +277 -0
- package/src/components/modal/Modal.vue +175 -0
- package/src/components/notifications/Notifications.vue +318 -0
- package/src/components/pagination/Pagination.vue +181 -0
- package/src/components/pagination/PaginationItem.vue +58 -0
- package/src/components/popover/Popover.vue +194 -0
- package/src/components/popover/PopoverContainer.vue +23 -0
- package/src/components/progress/Progress.vue +86 -0
- package/src/components/radio/Radio.vue +220 -0
- package/src/components/scroll/Scroll.vue +143 -0
- package/src/components/select/Select.vue +408 -0
- package/src/components/skeleton/Skeleton.vue +23 -0
- package/src/components/slider/Slider.vue +240 -0
- package/src/components/spacer/Spacer.vue +11 -0
- package/src/components/spinner/Spinner.vue +45 -0
- package/src/components/tab/Tab.vue +100 -0
- package/src/components/tab/TabGroup.vue +151 -0
- package/src/components/table/Table.vue +172 -0
- package/src/components/table/TableBody.vue +13 -0
- package/src/components/table/TableCell.vue +78 -0
- package/src/components/table/TableHead.vue +15 -0
- package/src/components/table/TableHeader.vue +94 -0
- package/src/components/table/TableRow.vue +43 -0
- package/src/components/tag/Tag.vue +98 -0
- package/src/components/textarea/Textarea.vue +156 -0
- package/src/components/toggle/Toggle.vue +144 -0
- package/src/components/tooltip/Tooltip.vue +26 -0
- package/src/composables/colors-utils.ts +378 -0
- package/src/composables/colors.ts +82 -0
- package/src/composables/common.ts +20 -0
- package/src/composables/css.ts +45 -0
- package/src/composables/index.ts +7 -0
- package/src/composables/inputtable.ts +128 -0
- package/src/composables/interactive.ts +16 -0
- package/src/composables/keys.ts +8 -0
- package/src/composables/notification.ts +10 -0
- package/src/create.ts +38 -0
- package/src/exports/nuxt.js +32 -0
- package/src/exports/nuxt.plugin.js +8 -0
- package/src/exports/tailwind.preset.js +55 -0
- package/src/index.ts +8 -0
- package/src/install.ts +8 -0
- package/src/shims-vue.d.ts +6 -0
- package/src/version.ts +1 -0
- 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,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
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
|
-
|
|
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']
|