@teammodlr/ui-kit 2.1.8 → 2.1.9
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/lib/components/avatargroup/symbol.d.ts +2 -2
- package/lib/components/breadcrumb/style/index.d.ts +1 -1
- package/lib/components/breadcrumb/symbol.d.ts +1 -1
- package/lib/components/buttongroup/symbol.d.ts +2 -2
- package/lib/components/colorpicker/ColorPicker.vue.d.ts +1 -1
- package/lib/components/dropdown/Dropdown.vue.d.ts +1 -1
- package/lib/components/dropdown/symbol.d.ts +1 -1
- package/lib/components/form/symbol.d.ts +1 -1
- package/lib/components/messageprovider/style/index.d.ts +1 -1
- package/lib/components/radiobuttongroup/symbol.d.ts +2 -2
- package/lib/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/lib/components/tree/props.d.ts +4 -4
- package/lib/components/tree/types.d.ts +10 -10
- package/lib/composables/element.d.ts +1 -1
- package/lib/composables/useInteractive.d.ts +1 -1
- package/lib/composables/useMount.d.ts +1 -1
- package/lib/composables/usePopper.d.ts +2 -2
- package/lib/composables/useZIndex.d.ts +1 -1
- package/lib/index.cjs.js +9 -9
- package/lib/index.es.js +2297 -2276
- package/lib/install.d.ts +1 -1
- package/lib/nuxt.js +17 -15
- package/lib/nuxt.plugin.js +6 -6
- package/package.json +89 -79
- package/src/__storybook__/argTypes.ts +5 -13
- package/src/__storybook__/createStory.ts +10 -10
- package/src/call.ts +14 -14
- package/src/components/avatar/Avatar.vue +1 -1
- package/src/components/avatar/examples/index.stories.ts +4 -7
- package/src/components/avatar/style/Avatar.css.ts +17 -17
- package/src/components/avatargroup/examples/index.stories.ts +5 -10
- package/src/components/avatargroup/style/AvatarGroup.css.ts +9 -4
- package/src/components/avatargroup/symbol.ts +5 -5
- package/src/components/badge/examples/index.stories.ts +4 -6
- package/src/components/badge/style/Badge.css.ts +36 -36
- package/src/components/breadcrumb/examples/index.stories.ts +6 -10
- package/src/components/breadcrumb/style/Breadcrumb.css.ts +17 -17
- package/src/components/breadcrumb/style/index.ts +1 -1
- package/src/components/breadcrumb/symbol.ts +4 -3
- package/src/components/button/examples/index.stories.ts +4 -4
- package/src/components/button/style/Button.css.ts +143 -133
- package/src/components/buttongroup/examples/index.stories.ts +6 -12
- package/src/components/buttongroup/style/ButtonGroup.css.ts +13 -11
- package/src/components/buttongroup/symbol.ts +5 -4
- package/src/components/checkbox/Checkbox.vue +8 -8
- package/src/components/checkbox/examples/index.stories.ts +4 -9
- package/src/components/checkbox/examples/index.ts +0 -1
- package/src/components/checkbox/style/Checkbox.css.ts +31 -27
- package/src/components/checkbox/style/index.ts +1 -1
- package/src/components/colorpicker/examples/index.stories.ts +5 -10
- package/src/components/colorpicker/examples/index.ts +1 -1
- package/src/components/colorpicker/style/ColorPicker.css.ts +22 -14
- package/src/components/colorpicker/utils.ts +46 -28
- package/src/components/confirm/examples/index.stories.ts +5 -8
- package/src/components/confirm/props.ts +2 -2
- package/src/components/confirm/providerProps.ts +1 -2
- package/src/components/confirm/types.ts +15 -16
- package/src/components/confirm/useConfirm.ts +3 -1
- package/src/components/dialog/examples/index.stories.ts +5 -9
- package/src/components/dialog/style/Dialog.css.ts +38 -37
- package/src/components/dropdown/examples/index.stories.ts +3 -7
- package/src/components/dropdown/hooks.ts +20 -20
- package/src/components/dropdown/style/Dropdown.css.ts +24 -24
- package/src/components/dropdown/symbol.ts +3 -2
- package/src/components/form/Form.vue +1 -1
- package/src/components/form/examples/index.stories.ts +2 -4
- package/src/components/form/style/Form.css.ts +13 -8
- package/src/components/form/style/index.ts +2 -2
- package/src/components/form/symbol.ts +10 -5
- package/src/components/image/examples/index.stories.ts +5 -7
- package/src/components/input/Input.vue +8 -9
- package/src/components/input/examples/index.stories.ts +5 -7
- package/src/components/input/style/Input.css.ts +40 -43
- package/src/components/link/examples/index.stories.ts +4 -9
- package/src/components/messageprovider/examples/index.stories.ts +5 -8
- package/src/components/messageprovider/style/Message.css.ts +31 -31
- package/src/components/messageprovider/style/index.ts +1 -1
- package/src/components/messageprovider/types.ts +31 -22
- package/src/components/messageprovider/useMessage.ts +6 -4
- package/src/components/modal/examples/index.stories.ts +5 -10
- package/src/components/modal/style/Modal.css.ts +76 -73
- package/src/components/pagination/examples/index.stories.ts +5 -9
- package/src/components/pagination/examples/index.ts +1 -1
- package/src/components/pagination/style/Pagination.css.ts +41 -37
- package/src/components/radio/Radio.vue +7 -7
- package/src/components/radio/examples/index.stories.ts +4 -9
- package/src/components/radio/examples/index.ts +0 -1
- package/src/components/radio/style/Checkbox.css.ts +30 -31
- package/src/components/radio/style/index.ts +1 -1
- package/src/components/radiobutton/RadioButton.vue +3 -3
- package/src/components/radiobutton/style/RadioButton.css.ts +41 -36
- package/src/components/radiobuttongroup/examples/index.stories.ts +6 -10
- package/src/components/radiobuttongroup/examples/index.ts +0 -1
- package/src/components/radiobuttongroup/style/RadioButtonGroup.css.ts +14 -14
- package/src/components/radiobuttongroup/style/index.ts +1 -1
- package/src/components/radiobuttongroup/symbol.ts +8 -7
- package/src/components/renderer/examlpes/index.stories.ts +4 -8
- package/src/components/renderer/props.ts +2 -3
- package/src/components/renderer/renderer.ts +3 -3
- package/src/components/select/Select.vue +3 -4
- package/src/components/select/examples/index.stories.ts +4 -10
- package/src/components/select/style/Select.css.ts +62 -61
- package/src/components/skeleton/examples/index.stories.ts +5 -9
- package/src/components/skeleton/style/Skeleton.css.ts +16 -16
- package/src/components/skeleton/style/index.ts +2 -2
- package/src/components/slider/style/Slider.css.ts +12 -5
- package/src/components/switch/Switch.vue +4 -4
- package/src/components/switch/examples/index.stories.ts +4 -9
- package/src/components/switch/examples/index.ts +0 -1
- package/src/components/switch/style/Switch.css.ts +56 -57
- package/src/components/switch/style/index.ts +1 -1
- package/src/components/tab/examples/index.stories.ts +5 -11
- package/src/components/table/examples/index.stories.ts +6 -12
- package/src/components/table/style/Table.css.ts +22 -17
- package/src/components/table/style/index.ts +1 -1
- package/src/components/table/types/index.ts +1 -1
- package/src/components/tag/examples/index.stories.ts +4 -10
- package/src/components/tag/style/Tag.css.ts +14 -9
- package/src/components/textarea/Textarea.vue +7 -8
- package/src/components/textarea/examples/index.stories.ts +4 -8
- package/src/components/textarea/style/Textarea.css.ts +33 -33
- package/src/components/tooltip/examples/index.stories.ts +5 -10
- package/src/components/tooltip/examples/index.ts +2 -2
- package/src/components/tooltip/style/Tooltip.css.ts +24 -25
- package/src/components/transfer/examples/index.stories.ts +5 -9
- package/src/components/transfer/style/Transfer.css.ts +41 -40
- package/src/components/tree/examples/index.stories.ts +6 -10
- package/src/components/tree/props.ts +20 -18
- package/src/components/tree/style/Tree.css.ts +36 -31
- package/src/components/tree/types.ts +60 -62
- package/src/components/virtualscroll/examples/index.stories.ts +4 -8
- package/src/components/virtualscroll/style/VirtualScroll.css.ts +1 -2
- package/src/composables/element.ts +4 -4
- package/src/composables/useCachedUid.ts +7 -6
- package/src/composables/useEventListener.ts +11 -6
- package/src/composables/useInput.ts +63 -41
- package/src/composables/useInteractive.ts +10 -11
- package/src/composables/useMergedState.ts +7 -7
- package/src/composables/useMount.ts +11 -11
- package/src/composables/usePopper.ts +57 -36
- package/src/composables/useZIndex.ts +5 -5
- package/src/create.ts +10 -6
- package/src/examples/cards/cards.stories.ts +3 -3
- package/src/examples/modal/modal.stories.ts +3 -3
- package/src/exports/nuxt.js +17 -15
- package/src/exports/nuxt.plugin.js +6 -6
- package/src/index.ts +0 -2
- package/src/install.ts +5 -5
- package/src/shims-vue.d.ts +3 -3
- package/src/styles/theme.css.ts +51 -43
- package/src/styles/transitions.css.ts +26 -28
- package/src/types/props.ts +16 -2
- package/src/utils/injection.ts +3 -3
package/lib/install.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
install: (app: import("vue").App<any>, installOptions?: import("./create").ModlrUIOptions) => void;
|
|
2
|
+
install: (app: import("vue").App<any>, installOptions?: import("./create").ModlrUIOptions | undefined) => void;
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
package/lib/nuxt.js
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import { defineNuxtModule, addPlugin, createResolver } from '@nuxt/kit'
|
|
2
|
-
import { fileURLToPath } from 'node:url'
|
|
1
|
+
import { defineNuxtModule, addPlugin, createResolver } from '@nuxt/kit';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
3
|
|
|
4
4
|
export default defineNuxtModule({
|
|
5
5
|
meta: {
|
|
6
6
|
name: '@teammodlr/ui-kit',
|
|
7
7
|
configKey: 'modlr',
|
|
8
8
|
compatibility: {
|
|
9
|
-
nuxt: '^3.0.0-rc.1'
|
|
10
|
-
}
|
|
9
|
+
nuxt: '^3.0.0-rc.1'
|
|
10
|
+
}
|
|
11
11
|
},
|
|
12
12
|
defaults: {
|
|
13
|
-
prefix: 'M'
|
|
13
|
+
prefix: 'M'
|
|
14
14
|
},
|
|
15
15
|
async setup(options, nuxt) {
|
|
16
16
|
// Create resolver to resolve relative paths
|
|
17
|
-
const { resolve } = createResolver(import.meta.url)
|
|
17
|
+
const { resolve } = createResolver(import.meta.url);
|
|
18
18
|
|
|
19
|
-
nuxt.options.runtimeConfig.public.modlrUiOptions = options
|
|
19
|
+
nuxt.options.runtimeConfig.public.modlrUiOptions = options;
|
|
20
20
|
|
|
21
21
|
// plugin install
|
|
22
|
-
addPlugin(resolve('./nuxt.plugin.js'))
|
|
22
|
+
addPlugin(resolve('./nuxt.plugin.js'));
|
|
23
23
|
|
|
24
24
|
// nuxt install
|
|
25
|
-
nuxt.hook('components:dirs',
|
|
25
|
+
nuxt.hook('components:dirs', dirs => {
|
|
26
26
|
dirs.push({
|
|
27
|
-
path: fileURLToPath(
|
|
27
|
+
path: fileURLToPath(
|
|
28
|
+
new URL('../src/components', import.meta.url)
|
|
29
|
+
),
|
|
28
30
|
extensions: ['vue', 'tsx'],
|
|
29
|
-
prefix: options?.prefix ? options?.prefix : 'M'
|
|
30
|
-
})
|
|
31
|
-
})
|
|
32
|
-
}
|
|
33
|
-
})
|
|
31
|
+
prefix: options?.prefix ? options?.prefix : 'M'
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
package/lib/nuxt.plugin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from '#app'
|
|
2
|
-
import create from '../create'
|
|
1
|
+
import { defineNuxtPlugin } from '#app';
|
|
2
|
+
import create from '../create';
|
|
3
3
|
|
|
4
|
-
export default defineNuxtPlugin(
|
|
5
|
-
const UI = create(nuxtApp.$config.modlrUiOptions)
|
|
4
|
+
export default defineNuxtPlugin(nuxtApp => {
|
|
5
|
+
const UI = create(nuxtApp.$config.modlrUiOptions);
|
|
6
6
|
|
|
7
|
-
nuxtApp.vueApp.use(UI)
|
|
8
|
-
})
|
|
7
|
+
nuxtApp.vueApp.use(UI);
|
|
8
|
+
});
|
package/package.json
CHANGED
|
@@ -1,82 +1,92 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
"name": "@teammodlr/ui-kit",
|
|
3
|
+
"version": "2.1.9",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "lib/index.cjs.js",
|
|
6
|
+
"module": "lib/index.es.js",
|
|
7
|
+
"typings": "lib/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib",
|
|
10
|
+
"src",
|
|
11
|
+
"*.d.ts"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./lib/index.es.js",
|
|
16
|
+
"require": "./lib/index.cjs.js"
|
|
17
|
+
},
|
|
18
|
+
"./nuxt": "./lib/nuxt.js",
|
|
19
|
+
"./style": "./lib/style.css",
|
|
20
|
+
"./styles": "./lib/style.css",
|
|
21
|
+
"./nuxt.plugin": "./lib/nuxt.plugin.js",
|
|
22
|
+
"./nuxt.plugin.js": "./lib/nuxt.plugin.js"
|
|
17
23
|
},
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "npm run storybook",
|
|
27
|
+
"storybook": "storybook dev -p 6006",
|
|
28
|
+
"lint": "npx eslint . -c ./.config/.eslintrc.yml",
|
|
29
|
+
"build": "npm run build:vite && npm run gen-types",
|
|
30
|
+
"build:vite": "vite build",
|
|
31
|
+
"build:storybook": "storybook build",
|
|
32
|
+
"gen-types": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.vitest.json --composite false",
|
|
33
|
+
"release:prepare": "npm run build",
|
|
34
|
+
"release": "bumpp --execute=\"npm run release:prepare\" --all",
|
|
35
|
+
"release:publish": "npm run release && npm publish"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [],
|
|
38
|
+
"author": "",
|
|
39
|
+
"license": "ISC",
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@babel/core": "^7.21.0",
|
|
42
|
+
"@nuxt/kit": "^3.3.2",
|
|
43
|
+
"@nuxt/schema": "^3.3.2",
|
|
44
|
+
"@storybook/addon-actions": "^7.2.1",
|
|
45
|
+
"@storybook/addon-essentials": "^7.2.1",
|
|
46
|
+
"@storybook/addon-interactions": "^7.2.1",
|
|
47
|
+
"@storybook/addon-links": "^7.2.1",
|
|
48
|
+
"@storybook/addons": "^7.2.1",
|
|
49
|
+
"@storybook/testing-library": "^0.2.0",
|
|
50
|
+
"@storybook/theming": "^7.2.1",
|
|
51
|
+
"@storybook/vue3": "^7.2.1",
|
|
52
|
+
"@storybook/vue3-vite": "^7.2.1",
|
|
53
|
+
"@types/jsdom": "^21.1.0",
|
|
54
|
+
"@types/node": "^18.14.1",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
|
56
|
+
"@typescript-eslint/parser": "^6.6.0",
|
|
57
|
+
"@vanilla-extract/css": "^1.12.0",
|
|
58
|
+
"@vanilla-extract/vite-plugin": "^3.8.2",
|
|
59
|
+
"@vitejs/plugin-vue": "^4.2.3",
|
|
60
|
+
"@vue/tsconfig": "^0.4.0",
|
|
61
|
+
"@vueuse/core": "^10.4.1",
|
|
62
|
+
"babel-loader": "^9.1.2",
|
|
63
|
+
"bumpp": "^9.1.1",
|
|
64
|
+
"eslint": "^8.49.0",
|
|
65
|
+
"eslint-plugin-github": "^4.10.0",
|
|
66
|
+
"eslint-plugin-jsonc": "^2.9.0",
|
|
67
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
68
|
+
"eslint-plugin-vue": "^9.17.0",
|
|
69
|
+
"prettier": "^3.0.3",
|
|
70
|
+
"prettier-eslint": "^15.0.1",
|
|
71
|
+
"react": "^18.2.0",
|
|
72
|
+
"react-dom": "^18.2.0",
|
|
73
|
+
"storybook": "^7.2.1",
|
|
74
|
+
"ts-node": "^10.9.1",
|
|
75
|
+
"typescript": "^5.1.6",
|
|
76
|
+
"vite": "^4.4.8",
|
|
77
|
+
"vue": "^3.3.4",
|
|
78
|
+
"vue-loader": "^17.2.2",
|
|
79
|
+
"vue-tsc": "^1.8.8",
|
|
80
|
+
"vueuc": "^0.4.51"
|
|
81
|
+
},
|
|
82
|
+
"dependencies": {
|
|
83
|
+
"@floating-ui/vue": "^1.0.0",
|
|
84
|
+
"@popperjs/core": "^2.11.6",
|
|
85
|
+
"@vanilla-extract/dynamic": "^2.0.3",
|
|
86
|
+
"@vitejs/plugin-vue-jsx": "^3.0.1",
|
|
87
|
+
"@vueuse/integrations": "^10.0.0-beta.2",
|
|
88
|
+
"focus-trap": "^7.4.0",
|
|
89
|
+
"maska": "^2.1.9",
|
|
90
|
+
"treemate": "^0.3.11"
|
|
91
|
+
}
|
|
82
92
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { placementWhileList } from
|
|
1
|
+
import { placementWhileList } from '../composables/usePopper';
|
|
2
2
|
|
|
3
3
|
export const sizeArgType = () => ({
|
|
4
4
|
size: {
|
|
@@ -18,16 +18,9 @@ export const sizeArgType = () => ({
|
|
|
18
18
|
|
|
19
19
|
export const colorArgType = () => ({
|
|
20
20
|
color: {
|
|
21
|
-
options: [
|
|
22
|
-
'white',
|
|
23
|
-
'black',
|
|
24
|
-
'green',
|
|
25
|
-
'red',
|
|
26
|
-
'yellow',
|
|
27
|
-
'blue',
|
|
28
|
-
],
|
|
21
|
+
options: ['white', 'black', 'green', 'red', 'yellow', 'blue'],
|
|
29
22
|
control: {
|
|
30
|
-
type: 'select'
|
|
23
|
+
type: 'select'
|
|
31
24
|
}
|
|
32
25
|
}
|
|
33
26
|
});
|
|
@@ -50,12 +43,11 @@ export const variantArgType = () => ({
|
|
|
50
43
|
}
|
|
51
44
|
});
|
|
52
45
|
|
|
53
|
-
|
|
54
46
|
export const popperPositionArgType = () => ({
|
|
55
47
|
placement: {
|
|
56
48
|
options: placementWhileList,
|
|
57
49
|
control: {
|
|
58
|
-
type: 'select'
|
|
50
|
+
type: 'select'
|
|
59
51
|
}
|
|
60
52
|
}
|
|
61
|
-
})
|
|
53
|
+
});
|
|
@@ -3,13 +3,13 @@ import type { Component } from 'vue';
|
|
|
3
3
|
|
|
4
4
|
export const createStory =
|
|
5
5
|
(component: Component, storyArgs: { classes?: string } = {}) =>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
(args: any) => ({
|
|
7
|
+
setup: () => () =>
|
|
8
|
+
h(
|
|
9
|
+
'div',
|
|
10
|
+
{
|
|
11
|
+
class: `storybook-example ${storyArgs.classes || ''}`
|
|
12
|
+
},
|
|
13
|
+
[h(component, args)]
|
|
14
|
+
)
|
|
15
|
+
});
|
package/src/call.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
type AnyFunction = (...args: any[]) => any
|
|
1
|
+
type AnyFunction = (...args: any[]) => any;
|
|
2
2
|
|
|
3
|
-
function call
|
|
4
|
-
function call<A1>
|
|
5
|
-
function call<A1, A2>
|
|
3
|
+
function call(funcs: MaybeArray<() => void>): void;
|
|
4
|
+
function call<A1>(funcs: MaybeArray<(a1: A1) => void>, a1: A1): void;
|
|
5
|
+
function call<A1, A2>(
|
|
6
6
|
funcs: MaybeArray<(a1: A1, a2: A2) => void>,
|
|
7
7
|
a1: A1,
|
|
8
8
|
a2: A2
|
|
9
|
-
): void
|
|
10
|
-
function call<A1, A2, A3>
|
|
9
|
+
): void;
|
|
10
|
+
function call<A1, A2, A3>(
|
|
11
11
|
funcs: MaybeArray<(a1: A1, a2: A2, a3: A3) => void>,
|
|
12
12
|
a1: A1,
|
|
13
13
|
a2: A2,
|
|
14
14
|
a3: A3
|
|
15
|
-
): void
|
|
16
|
-
function call<A1, A2, A3, A4>
|
|
15
|
+
): void;
|
|
16
|
+
function call<A1, A2, A3, A4>(
|
|
17
17
|
funcs: MaybeArray<(a1: A1, a2: A2, a3: A3, a4: A4) => void>,
|
|
18
18
|
a1: A1,
|
|
19
19
|
a2: A2,
|
|
20
20
|
a3: A3,
|
|
21
21
|
a4: A4
|
|
22
|
-
): void
|
|
23
|
-
function call<A extends any[]>
|
|
22
|
+
): void;
|
|
23
|
+
function call<A extends any[]>(
|
|
24
24
|
funcs: AnyFunction[] | AnyFunction,
|
|
25
25
|
...args: A
|
|
26
26
|
): void {
|
|
27
27
|
if (Array.isArray(funcs)) {
|
|
28
|
-
funcs.forEach(
|
|
29
|
-
} else return funcs(...args)
|
|
28
|
+
funcs.forEach(func => (call as any)(func, ...args));
|
|
29
|
+
} else return funcs(...args);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export { call }
|
|
32
|
+
export { call };
|
|
33
33
|
|
|
34
|
-
export type MaybeArray<T> = T | T[]
|
|
34
|
+
export type MaybeArray<T> = T | T[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import MAvatar from
|
|
1
|
+
import MAvatar from '../Avatar.vue';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
MAvatarBasic,
|
|
@@ -6,12 +6,9 @@ import {
|
|
|
6
6
|
MAvatarCustomSize,
|
|
7
7
|
MAvatarVariant,
|
|
8
8
|
MAvatarSlot
|
|
9
|
-
} from
|
|
9
|
+
} from './index';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
colorArgType,
|
|
13
|
-
createStory, sizeArgType
|
|
14
|
-
} from "../../../__storybook__";
|
|
11
|
+
import { colorArgType, createStory, sizeArgType } from '../../../__storybook__';
|
|
15
12
|
|
|
16
13
|
export default {
|
|
17
14
|
component: MAvatar,
|
|
@@ -19,7 +16,7 @@ export default {
|
|
|
19
16
|
argTypes: {
|
|
20
17
|
...sizeArgType()
|
|
21
18
|
}
|
|
22
|
-
}
|
|
19
|
+
};
|
|
23
20
|
|
|
24
21
|
export const Basic = createStory(MAvatarBasic);
|
|
25
22
|
export const Sizes = createStory(MAvatarSize);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { createVar, style, styleVariants } from
|
|
2
|
-
import { themeVars } from
|
|
1
|
+
import { createVar, style, styleVariants } from '@vanilla-extract/css';
|
|
2
|
+
import { themeVars } from '../../../styles/theme.css';
|
|
3
3
|
|
|
4
4
|
const sizes = {
|
|
5
5
|
xs: '16px',
|
|
6
6
|
sm: '24px',
|
|
7
7
|
md: '32px',
|
|
8
8
|
lg: '40px',
|
|
9
|
-
xl: '96px'
|
|
9
|
+
xl: '96px'
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const borderRadiuses = {
|
|
@@ -14,12 +14,12 @@ const borderRadiuses = {
|
|
|
14
14
|
sm: '3px',
|
|
15
15
|
md: '4px',
|
|
16
16
|
lg: '6px',
|
|
17
|
-
xl: '8px'
|
|
17
|
+
xl: '8px'
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export const vars = {
|
|
21
21
|
size: createVar(),
|
|
22
|
-
radius: createVar()
|
|
22
|
+
radius: createVar()
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export const base = style({
|
|
@@ -47,33 +47,33 @@ export const size = styleVariants({
|
|
|
47
47
|
xs: {
|
|
48
48
|
vars: {
|
|
49
49
|
[vars.size]: sizes.xs,
|
|
50
|
-
[vars.radius]: borderRadiuses.xs
|
|
50
|
+
[vars.radius]: borderRadiuses.xs
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
sm: {
|
|
54
54
|
vars: {
|
|
55
55
|
[vars.size]: sizes.sm,
|
|
56
|
-
[vars.radius]: borderRadiuses.sm
|
|
57
|
-
}
|
|
56
|
+
[vars.radius]: borderRadiuses.sm
|
|
57
|
+
}
|
|
58
58
|
},
|
|
59
59
|
md: {
|
|
60
60
|
vars: {
|
|
61
61
|
[vars.size]: sizes.md,
|
|
62
|
-
[vars.radius]: borderRadiuses.md
|
|
63
|
-
}
|
|
62
|
+
[vars.radius]: borderRadiuses.md
|
|
63
|
+
}
|
|
64
64
|
},
|
|
65
65
|
lg: {
|
|
66
66
|
vars: {
|
|
67
67
|
[vars.size]: sizes.lg,
|
|
68
|
-
[vars.radius]: borderRadiuses.lg
|
|
69
|
-
}
|
|
68
|
+
[vars.radius]: borderRadiuses.lg
|
|
69
|
+
}
|
|
70
70
|
},
|
|
71
71
|
xl: {
|
|
72
72
|
vars: {
|
|
73
73
|
[vars.size]: sizes.xl,
|
|
74
|
-
[vars.radius]: borderRadiuses.xl
|
|
75
|
-
}
|
|
76
|
-
}
|
|
74
|
+
[vars.radius]: borderRadiuses.xl
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
77
|
});
|
|
78
78
|
|
|
79
79
|
export const image = style({
|
|
@@ -81,10 +81,10 @@ export const image = style({
|
|
|
81
81
|
width: '100%',
|
|
82
82
|
height: '100%',
|
|
83
83
|
flex: '1 1 100%'
|
|
84
|
-
})
|
|
84
|
+
});
|
|
85
85
|
|
|
86
86
|
export const rounded = style({
|
|
87
|
-
borderRadius: '9999px'
|
|
87
|
+
borderRadius: '9999px'
|
|
88
88
|
});
|
|
89
89
|
|
|
90
90
|
export const outline = style({
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import MAvatarGroup from
|
|
2
|
-
import MAvatar from
|
|
1
|
+
import MAvatarGroup from '../AvatarGroup.vue';
|
|
2
|
+
import MAvatar from '../../avatar/Avatar.vue';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
MAvatarGroupBasic
|
|
6
|
-
} from "./index";
|
|
4
|
+
import { MAvatarGroupBasic } from './index';
|
|
7
5
|
|
|
8
|
-
import {
|
|
9
|
-
createStory,
|
|
10
|
-
sizeArgType
|
|
11
|
-
} from "../../../__storybook__";
|
|
6
|
+
import { createStory, sizeArgType } from '../../../__storybook__';
|
|
12
7
|
|
|
13
8
|
export default {
|
|
14
9
|
component: MAvatarGroup,
|
|
@@ -19,6 +14,6 @@ export default {
|
|
|
19
14
|
argTypes: {
|
|
20
15
|
...sizeArgType()
|
|
21
16
|
}
|
|
22
|
-
}
|
|
17
|
+
};
|
|
23
18
|
|
|
24
19
|
export const Basic = createStory(MAvatarGroupBasic);
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
createVar,
|
|
3
|
+
globalStyle,
|
|
4
|
+
style,
|
|
5
|
+
styleVariants
|
|
6
|
+
} from '@vanilla-extract/css';
|
|
7
|
+
import { themeVars } from '../../../styles/theme.css';
|
|
3
8
|
|
|
4
9
|
const sizes = {
|
|
5
10
|
xs: '16px',
|
|
6
11
|
sm: '24px',
|
|
7
12
|
md: '32px',
|
|
8
13
|
lg: '40px',
|
|
9
|
-
xl: '96px'
|
|
14
|
+
xl: '96px'
|
|
10
15
|
};
|
|
11
16
|
|
|
12
17
|
export const base = style({
|
|
@@ -17,5 +22,5 @@ export const base = style({
|
|
|
17
22
|
});
|
|
18
23
|
|
|
19
24
|
export const item = style({
|
|
20
|
-
marginRight: '-10px'
|
|
25
|
+
marginRight: '-10px'
|
|
21
26
|
});
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import type {InjectionKey} from
|
|
2
|
-
import type {Size} from
|
|
1
|
+
import type { InjectionKey } from 'vue';
|
|
2
|
+
import type { Size } from '../../types/props';
|
|
3
3
|
|
|
4
4
|
export type Options = {
|
|
5
5
|
src: string;
|
|
6
6
|
srcSet: string;
|
|
7
7
|
alt: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
8
|
+
};
|
|
10
9
|
|
|
11
10
|
export interface AvatarGroupState {
|
|
12
11
|
max: number;
|
|
@@ -14,4 +13,5 @@ export interface AvatarGroupState {
|
|
|
14
13
|
rounded: boolean;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
export const AVATAR_GROUP_STATE: InjectionKey<AvatarGroupState> =
|
|
16
|
+
export const AVATAR_GROUP_STATE: InjectionKey<AvatarGroupState> =
|
|
17
|
+
Symbol('AVATAR_GROUP_STATE');
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import MBadge from
|
|
1
|
+
import MBadge from '../Badge.vue';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
MBadgeBasic,
|
|
5
|
-
} from "./index";
|
|
3
|
+
import { MBadgeBasic } from './index';
|
|
6
4
|
|
|
7
5
|
import {
|
|
8
6
|
variantArgType,
|
|
9
7
|
createStory,
|
|
10
8
|
sizeArgType
|
|
11
|
-
} from
|
|
9
|
+
} from '../../../__storybook__';
|
|
12
10
|
|
|
13
11
|
export default {
|
|
14
12
|
component: MBadge,
|
|
@@ -16,6 +14,6 @@ export default {
|
|
|
16
14
|
argTypes: {
|
|
17
15
|
...variantArgType()
|
|
18
16
|
}
|
|
19
|
-
}
|
|
17
|
+
};
|
|
20
18
|
|
|
21
19
|
export const Basic = createStory(MBadgeBasic);
|