@indielayer/ui 1.5.0 → 1.5.2
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/docs/components/toolbar/Toolbar.vue +2 -9
- package/docs/pages/component/form/usage.vue +16 -19
- package/docs/pages/component/modal/composed.vue +7 -0
- package/docs/pages/component/modal/usage.vue +1 -1
- package/exports/nuxt.plugin.js +9 -2
- package/lib/components/accordion/AccordionItem.vue.js +25 -24
- package/lib/components/accordion/theme/AccordionItem.base.theme.js +7 -7
- package/lib/components/alert/Alert.vue2.js +4 -3
- package/lib/components/button/Button.vue.js +2 -2
- package/lib/components/button/Button.vue2.js +26 -26
- package/lib/components/checkbox/theme/Checkbox.base.theme.js +35 -35
- package/lib/components/inputFooter/theme/InputFooter.base.theme.js +1 -1
- package/lib/components/label/theme/Label.base.theme.js +1 -1
- package/lib/components/modal/Modal.vue.js +34 -32
- package/lib/components/notifications/Notifications.vue.js +1 -0
- package/lib/components/popover/Popover.vue.d.ts +7 -25
- package/lib/components/popover/Popover.vue.js +12 -12
- package/lib/components/radio/theme/Radio.base.theme.js +27 -27
- package/lib/components/scroll/Scroll.vue2.js +4 -4
- package/lib/components/stepper/Stepper.vue.js +35 -34
- package/lib/components/tab/Tab.vue.js +7 -6
- package/lib/components/table/Table.vue.js +16 -15
- package/lib/components/tooltip/Tooltip.vue.js +1 -1
- package/lib/create.d.ts +5 -1
- package/lib/create.js +18 -15
- package/lib/index.js +1 -1
- package/lib/index.umd.js +4 -3
- package/lib/node_modules/.pnpm/{floating-vue@5.2.0_vue@3.3.9 → floating-vue@5.2.2_vue@3.3.9}/node_modules/floating-vue/dist/floating-vue.js +208 -183
- package/lib/nuxt.plugin.js +9 -2
- package/lib/themes/base/index.js +2 -2
- package/lib/themes/base/styles.d.ts +2 -0
- package/{src/themes/base/styles.css → lib/themes/base/styles.js} +5 -1
- package/lib/themes/carbon/index.js +2 -2
- package/lib/themes/carbon/styles.d.ts +2 -0
- package/lib/themes/carbon/{styles.css.js → styles.js} +2 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/src/components/accordion/AccordionItem.vue +1 -0
- package/src/components/accordion/theme/AccordionItem.base.theme.ts +2 -2
- package/src/components/alert/Alert.vue +1 -1
- package/src/components/button/Button.vue +1 -1
- package/src/components/checkbox/theme/Checkbox.base.theme.ts +5 -3
- package/src/components/inputFooter/theme/InputFooter.base.theme.ts +1 -1
- package/src/components/label/theme/Label.base.theme.ts +1 -1
- package/src/components/modal/Modal.vue +4 -2
- package/src/components/notifications/Notifications.vue +1 -0
- package/src/components/popover/Popover.vue +2 -2
- package/src/components/radio/theme/Radio.base.theme.ts +5 -3
- package/src/components/scroll/Scroll.vue +1 -1
- package/src/components/stepper/Stepper.vue +1 -0
- package/src/components/tab/Tab.vue +1 -0
- package/src/components/table/Table.vue +1 -1
- package/src/create.ts +11 -4
- package/src/themes/base/index.ts +2 -2
- package/{lib/themes/base/styles.css.js → src/themes/base/styles.ts} +2 -5
- package/src/themes/carbon/index.ts +2 -2
- package/src/themes/carbon/{styles.css → styles.ts} +2 -0
- package/src/version.ts +1 -1
package/lib/nuxt.plugin.js
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { defineNuxtPlugin } from '#app'
|
|
2
|
-
import
|
|
2
|
+
import { BaseTheme, injectIconsKey, injectOptionsKey, injectThemeKey, createUI } from '../src'
|
|
3
3
|
|
|
4
4
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
|
-
const UI =
|
|
5
|
+
const UI = createUI({
|
|
6
|
+
...nuxtApp.$config.public?.indielayerOptions,
|
|
7
|
+
theme: BaseTheme,
|
|
8
|
+
injectIconsKey,
|
|
9
|
+
injectOptionsKey,
|
|
10
|
+
injectThemeKey,
|
|
11
|
+
|
|
12
|
+
})
|
|
6
13
|
|
|
7
14
|
nuxtApp.vueApp.use(UI)
|
|
8
15
|
})
|
package/lib/themes/base/index.js
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\nhtml {\n color: #111827;\n background-color: white;\n}\n\nhtml.dark {\n color: #f3f4f6;\n background-color: #111827;\n}\n\nbody {\n font-size: 14px;\n}\n\n*,\n::before,\n::after {\n border-color: #e5e7eb;\n}\n\n.dark *,\n.dark ::before,\n.dark ::after {\n border-color: #374151;\n}\n\n:root {\n --font-family-sans: Inter, -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, sans-serif;\n --font-family-mono: ui-monospace, monospace;\n --border-color: 226, 232, 240;\n --primary-color-50: 236, 253, 245;\n --primary-color-100: 209, 250, 229;\n --primary-color-200: 167, 243, 208;\n --primary-color-300: 110, 231, 183;\n --primary-color-400: 52, 211, 153;\n --primary-color-500: 16, 185, 129;\n --primary-color-600: 5, 150, 105;\n --primary-color-700: 4, 120, 87;\n --primary-color-800: 6, 95, 70;\n --primary-color-900: 6, 78, 59;\n --primary-color-950: 2, 44, 34;\n --secondary-color-50: 248, 250, 252;\n --secondary-color-100: 241, 245, 249;\n --secondary-color-200: 226, 232, 240;\n --secondary-color-300: 203, 213, 225;\n --secondary-color-400: 148, 163, 184;\n --secondary-color-500: 100, 116, 139;\n --secondary-color-600: 71, 85, 105;\n --secondary-color-700: 51, 65, 85;\n --secondary-color-800: 30, 41, 59;\n --secondary-color-900: 15, 23, 42;\n --secondary-color-950: 2, 6, 23;\n --success-color-50: 240, 253, 244;\n --success-color-100: 220, 252, 231;\n --success-color-200: 187, 247, 208;\n --success-color-300: 134, 239, 172;\n --success-color-400: 74, 222, 128;\n --success-color-500: 34, 197, 94;\n --success-color-600: 22, 163, 74;\n --success-color-700: 21, 128, 61;\n --success-color-800: 22, 101, 52;\n --success-color-900: 20, 83, 45;\n --success-color-950: 5, 46, 22;\n --warning-color-50: 254, 252, 232;\n --warning-color-100: 254, 249, 195;\n --warning-color-200: 254, 240, 138;\n --warning-color-300: 253, 224, 71;\n --warning-color-400: 250, 204, 21;\n --warning-color-500: 234, 179, 8;\n --warning-color-600: 202, 138, 4;\n --warning-color-700: 161, 98, 7;\n --warning-color-800: 133, 77, 14;\n --warning-color-900: 113, 63, 18;\n --warning-color-950: 66, 32, 6;\n --error-color-50: 254, 242, 242;\n --error-color-100: 254, 226, 226;\n --error-color-200: 254, 202, 202;\n --error-color-300: 252, 165, 165;\n --error-color-400: 248, 113, 113;\n --error-color-500: 239, 68, 68;\n --error-color-600: 220, 38, 38;\n --error-color-700: 185, 28, 28;\n --error-color-800: 153, 27, 27;\n --error-color-900: 127, 29, 29;\n --error-color-950: 69, 10, 10;\n}\n";
|
|
2
|
+
export default _default;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as e from "./components.js";
|
|
2
|
-
import f from "./styles.
|
|
2
|
+
import f from "./styles.js";
|
|
3
3
|
const a = {
|
|
4
4
|
name: "Carbon",
|
|
5
5
|
colors: {
|
|
6
6
|
primary: { 50: "#eff6ff", 100: "#dbeafe", 200: "#bfdbfe", 300: "#93c5fd", 400: "#60a5fa", 500: "#3b82f6", 600: "#2563eb", 700: "#1d4ed8", 800: "#1e40af", 900: "#1e3a8a", 950: "#172554" }
|
|
7
7
|
},
|
|
8
|
-
styles:
|
|
8
|
+
styles: f,
|
|
9
9
|
classPrefix: "x-",
|
|
10
10
|
components: e
|
|
11
11
|
}, r = a;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\nhtml {\n color: #111827;\n background-color: white;\n}\n\nhtml.dark {\n color: #f3f4f6;\n background-color: #111827;\n}\n\n*,\n::before,\n::after {\n border-color: #e5e7eb;\n}\n\n.dark *,\n.dark ::before,\n.dark ::after {\n border-color: #374151;\n}\n\n:root {\n --font-family-sans: \"IBM Plex Sans\", \"Helvetica Neue\", arial, sans-serif;\n --font-family-mono: \"IBM Plex Mono\", \"Menlo\", \"DejaVu Sans Mono\", \"Bitstream Vera Sans Mono\", courier, monospace;\n --border-color: 226, 232, 240;\n --primary-color-50: 236, 253, 245;\n --primary-color-100: 209, 250, 229;\n --primary-color-200: 167, 243, 208;\n --primary-color-300: 110, 231, 183;\n --primary-color-400: 52, 211, 153;\n --primary-color-500: 16, 185, 129;\n --primary-color-600: 5, 150, 105;\n --primary-color-700: 4, 120, 87;\n --primary-color-800: 6, 95, 70;\n --primary-color-900: 6, 78, 59;\n --primary-color-950: 2, 44, 34;\n --secondary-color-50: 248, 250, 252;\n --secondary-color-100: 241, 245, 249;\n --secondary-color-200: 226, 232, 240;\n --secondary-color-300: 203, 213, 225;\n --secondary-color-400: 148, 163, 184;\n --secondary-color-500: 100, 116, 139;\n --secondary-color-600: 71, 85, 105;\n --secondary-color-700: 51, 65, 85;\n --secondary-color-800: 30, 41, 59;\n --secondary-color-900: 15, 23, 42;\n --secondary-color-950: 2, 6, 23;\n --success-color-50: 240, 253, 244;\n --success-color-100: 220, 252, 231;\n --success-color-200: 187, 247, 208;\n --success-color-300: 134, 239, 172;\n --success-color-400: 74, 222, 128;\n --success-color-500: 34, 197, 94;\n --success-color-600: 22, 163, 74;\n --success-color-700: 21, 128, 61;\n --success-color-800: 22, 101, 52;\n --success-color-900: 20, 83, 45;\n --success-color-950: 5, 46, 22;\n --warning-color-50: 254, 252, 232;\n --warning-color-100: 254, 249, 195;\n --warning-color-200: 254, 240, 138;\n --warning-color-300: 253, 224, 71;\n --warning-color-400: 250, 204, 21;\n --warning-color-500: 234, 179, 8;\n --warning-color-600: 202, 138, 4;\n --warning-color-700: 161, 98, 7;\n --warning-color-800: 133, 77, 14;\n --warning-color-900: 113, 63, 18;\n --warning-color-950: 66, 32, 6;\n --error-color-50: 254, 242, 242;\n --error-color-100: 254, 226, 226;\n --error-color-200: 254, 202, 202;\n --error-color-300: 252, 165, 165;\n --error-color-400: 248, 113, 113;\n --error-color-500: 239, 68, 68;\n --error-color-600: 220, 38, 38;\n --error-color-700: 185, 28, 28;\n --error-color-800: 153, 27, 27;\n --error-color-900: 127, 29, 29;\n --error-color-950: 69, 10, 10;\n}\n";
|
|
2
|
+
export default _default;
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.5.
|
|
1
|
+
declare const _default: "1.5.2";
|
|
2
2
|
export default _default;
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indielayer/ui",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "Indielayer UI Components with Tailwind CSS build for Vue 3",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "João Teixeira",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"c8": "^7.12.0",
|
|
63
63
|
"clean-css": "^5.3.0",
|
|
64
64
|
"eslint": "^8.43.0",
|
|
65
|
-
"floating-vue": "^5.2.
|
|
65
|
+
"floating-vue": "^5.2.2",
|
|
66
66
|
"jsdom": "^22.1.0",
|
|
67
67
|
"postcss": "^8.4.4",
|
|
68
68
|
"rollup-plugin-visualizer": "^5.9.2",
|
|
@@ -3,7 +3,7 @@ import type { AccordionItemTheme } from '../AccordionItem.vue'
|
|
|
3
3
|
const theme: AccordionItemTheme = {
|
|
4
4
|
classes: {
|
|
5
5
|
wrapper: ({ props, slots, data }) => {
|
|
6
|
-
const classes = ['relative flex items-center w-full text-left']
|
|
6
|
+
const classes = ['relative flex items-center w-full text-left rounded']
|
|
7
7
|
|
|
8
8
|
if (!data.isInsideAccordion) return classes
|
|
9
9
|
|
|
@@ -11,7 +11,7 @@ const theme: AccordionItemTheme = {
|
|
|
11
11
|
if (props.iconAlign === 'left') classes.push('pl-8 pr-4')
|
|
12
12
|
else classes.push('pr-8 pl-4')
|
|
13
13
|
classes.push('py-2')
|
|
14
|
-
if (!props.disabled) classes.push('hover:bg-secondary-
|
|
14
|
+
if (!props.disabled) classes.push('hover:bg-secondary-100 dark:hover:bg-secondary-600')
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
if (!props.disabled) classes.push('cursor-pointer')
|
|
@@ -72,7 +72,7 @@ const { styles, classes, className } = useTheme('Alert', {}, props)
|
|
|
72
72
|
</div>
|
|
73
73
|
<template v-if="removable">
|
|
74
74
|
<div class="flex-grow"></div>
|
|
75
|
-
<button class="shrink-0" :aria-label="closeLabel" @click="(e: Event) => $emit('remove', e)">
|
|
75
|
+
<button type="button" class="shrink-0" :aria-label="closeLabel" @click="(e: Event) => $emit('remove', e)">
|
|
76
76
|
<slot name="removeIcon">
|
|
77
77
|
<x-icon :icon="closeIcon"/>
|
|
78
78
|
</slot>
|
|
@@ -122,7 +122,7 @@ defineExpose({ focus, blur })
|
|
|
122
122
|
:label="loadingLabel"
|
|
123
123
|
:status="loadingStatus"
|
|
124
124
|
/>
|
|
125
|
-
<div :class="{ 'invisible': loading }">
|
|
125
|
+
<div class="inline-flex items-center justify-center" :class="{ 'invisible': loading }">
|
|
126
126
|
<x-icon
|
|
127
127
|
v-if="computedIconLeft"
|
|
128
128
|
:size="computedSize"
|
|
@@ -5,7 +5,7 @@ const theme: CheckboxTheme = {
|
|
|
5
5
|
wrapper: ({ data }) => {
|
|
6
6
|
const classes = ['inline-block relative cursor-pointer align-middle']
|
|
7
7
|
|
|
8
|
-
if (data.isInsideForm && !data.isInsideFormGroup) classes.push('mb-
|
|
8
|
+
if (data.isInsideForm && !data.isInsideFormGroup) classes.push('mb-5')
|
|
9
9
|
|
|
10
10
|
return classes
|
|
11
11
|
},
|
|
@@ -38,8 +38,10 @@ const theme: CheckboxTheme = {
|
|
|
38
38
|
return classes
|
|
39
39
|
},
|
|
40
40
|
|
|
41
|
-
label: ({ props }) => {
|
|
42
|
-
const classes = ['inline-block
|
|
41
|
+
label: ({ props, data }) => {
|
|
42
|
+
const classes = ['inline-block text-secondary-800 dark:text-secondary-200 pl-2']
|
|
43
|
+
|
|
44
|
+
classes.push(data.isInsideFormGroup ? 'font-normal' : 'font-medium')
|
|
43
45
|
|
|
44
46
|
if (props.size === 'xs') classes.push('text-xs')
|
|
45
47
|
else if (props.size === 'sm') classes.push('text-sm')
|
|
@@ -2,7 +2,7 @@ import type { InputFooterTheme } from '../InputFooter.vue'
|
|
|
2
2
|
|
|
3
3
|
const theme: InputFooterTheme = {
|
|
4
4
|
classes: {
|
|
5
|
-
wrapper: '
|
|
5
|
+
wrapper: 'text-xs mt-1',
|
|
6
6
|
helperText: 'text-secondary-500 dark:text-secondary-400',
|
|
7
7
|
errorText: 'text-error-500 dark:text-error-400',
|
|
8
8
|
},
|
|
@@ -5,7 +5,7 @@ const theme: LabelTheme = {
|
|
|
5
5
|
wrapper: ({ props }) => {
|
|
6
6
|
const classes = ['block relative align-bottom focus:outline-none']
|
|
7
7
|
|
|
8
|
-
if (props.isInsideForm) classes.push('mb-
|
|
8
|
+
if (props.isInsideForm) classes.push('mb-5')
|
|
9
9
|
if (props.block) classes.push('w-full')
|
|
10
10
|
|
|
11
11
|
return classes
|
|
@@ -89,7 +89,9 @@ watch(value, (val) => {
|
|
|
89
89
|
|
|
90
90
|
if (val) {
|
|
91
91
|
setTimeout(() => {
|
|
92
|
-
stopClickOutside = onClickOutside(modalRef, clickOutsideCallback
|
|
92
|
+
stopClickOutside = onClickOutside(modalRef, clickOutsideCallback, {
|
|
93
|
+
ignore: ['.v-popper__popper'],
|
|
94
|
+
})
|
|
93
95
|
})
|
|
94
96
|
}
|
|
95
97
|
})
|
|
@@ -187,7 +189,7 @@ defineExpose({ open, close })
|
|
|
187
189
|
role="dialog"
|
|
188
190
|
aria-modal="true"
|
|
189
191
|
aria-labelledby="modal-headline"
|
|
190
|
-
@submit="$emit('submit')"
|
|
192
|
+
@submit="(isValid: boolean) => $emit('submit', isValid)"
|
|
191
193
|
>
|
|
192
194
|
<slot name="image"></slot>
|
|
193
195
|
<div v-if="hasHeader" :class="classes.header">
|
|
@@ -33,10 +33,10 @@ const popoverProps = {
|
|
|
33
33
|
popperShowTriggers: [Array, Function] as PropType<Array<PopoverTriggerEvent> | ((triggers: Array<PopoverTriggerEvent>) => Array<PopoverTriggerEvent>)>,
|
|
34
34
|
popperHideTriggers: [Array, Function] as PropType<Array<PopoverTriggerEvent> | ((triggers: Array<PopoverTriggerEvent>) => Array<PopoverTriggerEvent>)>,
|
|
35
35
|
container: {
|
|
36
|
-
type: [String, Object,
|
|
36
|
+
type: [String, Object, Boolean],
|
|
37
37
|
default: 'body',
|
|
38
38
|
},
|
|
39
|
-
boundary: [String,
|
|
39
|
+
boundary: [String, Object],
|
|
40
40
|
strategy: {
|
|
41
41
|
type: String as PropType<'absolute' | 'fixed'>,
|
|
42
42
|
default: 'absolute',
|
|
@@ -5,7 +5,7 @@ const theme: RadioTheme = {
|
|
|
5
5
|
wrapper: ({ data }) => {
|
|
6
6
|
const classes = ['inline-block relative cursor-pointer focus:outline-none group']
|
|
7
7
|
|
|
8
|
-
if (data.isInsideForm && !data.isInsideFormGroup) classes.push('mb-
|
|
8
|
+
if (data.isInsideForm && !data.isInsideFormGroup) classes.push('mb-5')
|
|
9
9
|
|
|
10
10
|
return classes
|
|
11
11
|
},
|
|
@@ -33,8 +33,10 @@ const theme: RadioTheme = {
|
|
|
33
33
|
return c
|
|
34
34
|
},
|
|
35
35
|
|
|
36
|
-
label: ({ props }) => {
|
|
37
|
-
let c = '
|
|
36
|
+
label: ({ props, data }) => {
|
|
37
|
+
let c = 'text-secondary-800 dark:text-secondary-200 pl-2'
|
|
38
|
+
|
|
39
|
+
c += data.isInsideFormGroup ? ' font-normal' : ' font-medium'
|
|
38
40
|
|
|
39
41
|
if (props.size === 'xs') c += ' text-xs'
|
|
40
42
|
else if (props.size === 'sm') c += ' text-sm'
|
|
@@ -114,6 +114,7 @@ const { styles, classes, className } = useTheme('Stepper', {}, props)
|
|
|
114
114
|
:is="interactive ? 'button' : 'div'"
|
|
115
115
|
v-for="(step, index) in steps"
|
|
116
116
|
:key="index"
|
|
117
|
+
:type="interactive ? 'button' : undefined"
|
|
117
118
|
:class="[classes.step, {
|
|
118
119
|
'cursor-pointer': interactive && !step.disabled,
|
|
119
120
|
'text-secondary-400 dark:text-secondary-600': step.disabled,
|
|
@@ -121,6 +121,7 @@ const { styles, classes, className } = useTheme('Tab', {}, ref({
|
|
|
121
121
|
<component
|
|
122
122
|
:is="to ? XLink : tag"
|
|
123
123
|
ref="elRef"
|
|
124
|
+
:type="tag === 'button' ? 'button' : undefined"
|
|
124
125
|
:data-value="computedValue"
|
|
125
126
|
:to="to"
|
|
126
127
|
:color="selected ? color : undefined"
|
|
@@ -227,7 +227,7 @@ const { styles, classes, className } = useTheme('Table', {}, props)
|
|
|
227
227
|
@click="$emit('click-row', item)"
|
|
228
228
|
>
|
|
229
229
|
<x-table-cell v-if="expandable" width="48" class="!p-1">
|
|
230
|
-
<button class="p-4" @click="internalItems[index].__expanded = !internalItems[index].__expanded">
|
|
230
|
+
<button type="button" class="p-4" @click="internalItems[index].__expanded = !internalItems[index].__expanded">
|
|
231
231
|
<x-icon
|
|
232
232
|
:icon="chevronDownIcon"
|
|
233
233
|
:size="dense ? 'xs' : 'md'"
|
package/src/create.ts
CHANGED
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import type { App } from 'vue'
|
|
1
|
+
import type { App, InjectionKey, MaybeRef } from 'vue'
|
|
2
2
|
import { injectIconsKey, injectOptionsKey, injectThemeKey } from './composables/keys'
|
|
3
3
|
import { injectThemeStyles, type UITheme } from './theme'
|
|
4
|
+
import type { IconInjection } from './components/icon/Icon.vue'
|
|
4
5
|
|
|
5
6
|
export type UIOptions = {
|
|
6
7
|
prefix?: string;
|
|
7
8
|
components?: any[];
|
|
8
9
|
icons?: Record<string, any>;
|
|
9
10
|
theme?: UITheme;
|
|
11
|
+
injectIconsKey?: InjectionKey<IconInjection>;
|
|
12
|
+
injectOptionsKey?: InjectionKey<UIOptions>;
|
|
13
|
+
injectThemeKey?: InjectionKey<MaybeRef<UITheme>>;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
const defaultOptions: UIOptions = {
|
|
13
17
|
prefix: 'X',
|
|
18
|
+
injectIconsKey,
|
|
19
|
+
injectOptionsKey,
|
|
20
|
+
injectThemeKey,
|
|
14
21
|
}
|
|
15
22
|
|
|
16
23
|
const create = (createOptions: UIOptions = {}) => {
|
|
@@ -28,9 +35,9 @@ const create = (createOptions: UIOptions = {}) => {
|
|
|
28
35
|
if (!app.component(`${options.prefix}${name}`)) app.component(`${options.prefix}${name}`, component)
|
|
29
36
|
})
|
|
30
37
|
|
|
31
|
-
app.provide(injectOptionsKey, options)
|
|
32
|
-
app.provide(injectIconsKey, options.icons || {})
|
|
33
|
-
app.provide(injectThemeKey, options.theme || {})
|
|
38
|
+
app.provide(installOptions.injectOptionsKey || injectOptionsKey, options)
|
|
39
|
+
app.provide(installOptions.injectIconsKey || injectIconsKey, options.icons || {})
|
|
40
|
+
app.provide(installOptions.injectThemeKey || injectThemeKey, options.theme || {})
|
|
34
41
|
|
|
35
42
|
if (options.theme?.styles) injectThemeStyles(options.theme.name || '', options.theme.styles)
|
|
36
43
|
}
|
package/src/themes/base/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { UITheme } from '../../theme'
|
|
2
2
|
import * as components from './components'
|
|
3
|
-
import
|
|
3
|
+
import styles from './styles'
|
|
4
4
|
|
|
5
5
|
const theme: UITheme = {
|
|
6
6
|
name: 'Base',
|
|
7
|
-
styles
|
|
7
|
+
styles,
|
|
8
8
|
classPrefix: 'x-',
|
|
9
9
|
components,
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export default `
|
|
2
2
|
html {
|
|
3
3
|
color: #111827;
|
|
4
4
|
background-color: white;
|
|
@@ -85,7 +85,4 @@ body {
|
|
|
85
85
|
--error-color-900: 127, 29, 29;
|
|
86
86
|
--error-color-950: 69, 10, 10;
|
|
87
87
|
}
|
|
88
|
-
|
|
89
|
-
export {
|
|
90
|
-
o as default
|
|
91
|
-
};
|
|
88
|
+
`
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { UITheme } from '../../theme'
|
|
2
2
|
import * as components from './components'
|
|
3
|
-
import
|
|
3
|
+
import styles from './styles'
|
|
4
4
|
|
|
5
5
|
const theme: UITheme = {
|
|
6
6
|
name: 'Carbon',
|
|
7
7
|
colors: {
|
|
8
8
|
primary: { '50': '#eff6ff', '100': '#dbeafe', '200': '#bfdbfe', '300': '#93c5fd', '400': '#60a5fa', '500': '#3b82f6', '600': '#2563eb', '700': '#1d4ed8', '800': '#1e40af', '900': '#1e3a8a', '950': '#172554' },
|
|
9
9
|
},
|
|
10
|
-
styles
|
|
10
|
+
styles,
|
|
11
11
|
classPrefix: 'x-',
|
|
12
12
|
components,
|
|
13
13
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.5.
|
|
1
|
+
export default '1.5.2'
|