@teammodlr/ui-kit 2.1.8 → 2.1.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/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/modal/Modal.vue.d.ts +6 -3
- package/lib/components/modal/style/Modal.css.d.ts +3 -0
- 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 +2256 -2213
- package/lib/install.d.ts +1 -1
- package/lib/nuxt.js +17 -15
- package/lib/nuxt.plugin.js +6 -6
- package/lib/style.css +1 -1
- 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/Modal.vue +72 -54
- package/src/components/modal/examples/index.stories.ts +6 -10
- package/src/components/modal/examples/index.ts +1 -0
- package/src/components/modal/examples/sidebar.vue +75 -0
- package/src/components/modal/style/Modal.css.ts +91 -72
- 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
|
@@ -2,23 +2,23 @@ import {
|
|
|
2
2
|
createVar,
|
|
3
3
|
globalStyle,
|
|
4
4
|
style,
|
|
5
|
-
styleVariants
|
|
6
|
-
} from
|
|
7
|
-
import { themeVars } from
|
|
5
|
+
styleVariants
|
|
6
|
+
} from '@vanilla-extract/css';
|
|
7
|
+
import { themeVars } from '../../../styles/theme.css';
|
|
8
8
|
|
|
9
9
|
const sizes = {
|
|
10
|
-
xs:
|
|
11
|
-
sm:
|
|
12
|
-
md:
|
|
13
|
-
lg:
|
|
14
|
-
xl:
|
|
10
|
+
xs: '14px',
|
|
11
|
+
sm: '16px',
|
|
12
|
+
md: '18px',
|
|
13
|
+
lg: '20px',
|
|
14
|
+
xl: '22px'
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const vars = {
|
|
18
18
|
offBackground: createVar(),
|
|
19
19
|
onBackground: createVar(),
|
|
20
20
|
handleBackground: createVar(),
|
|
21
|
-
height: createVar()
|
|
21
|
+
height: createVar()
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export const toggle = style({
|
|
@@ -26,79 +26,79 @@ export const toggle = style({
|
|
|
26
26
|
[vars.height]: sizes.md,
|
|
27
27
|
[vars.offBackground]: themeVars.color.gray[300],
|
|
28
28
|
[vars.onBackground]: themeVars.color.blue[500],
|
|
29
|
-
[vars.handleBackground]:
|
|
29
|
+
[vars.handleBackground]: '#fff'
|
|
30
30
|
},
|
|
31
31
|
outline: 0,
|
|
32
|
-
display:
|
|
32
|
+
display: 'block',
|
|
33
33
|
width: `calc(${vars.height} * 2)`,
|
|
34
34
|
minWidth: `calc(${vars.height} * 2)`,
|
|
35
35
|
height: `calc(${vars.height} + 2px)`,
|
|
36
|
-
position:
|
|
37
|
-
cursor:
|
|
38
|
-
userSelect:
|
|
39
|
-
borderRadius:
|
|
40
|
-
padding:
|
|
36
|
+
position: 'relative',
|
|
37
|
+
cursor: 'pointer',
|
|
38
|
+
userSelect: 'none',
|
|
39
|
+
borderRadius: '2em',
|
|
40
|
+
padding: '2px',
|
|
41
41
|
background: vars.offBackground,
|
|
42
|
-
transition:
|
|
42
|
+
transition: 'all .4s ease',
|
|
43
43
|
selectors: {
|
|
44
|
-
[
|
|
45
|
-
position:
|
|
46
|
-
display:
|
|
44
|
+
['&:after']: {
|
|
45
|
+
position: 'relative',
|
|
46
|
+
display: 'block',
|
|
47
47
|
content: '""',
|
|
48
48
|
width: `calc(${vars.height} - 2px)`,
|
|
49
|
-
height:
|
|
49
|
+
height: '100%',
|
|
50
50
|
left: 0,
|
|
51
|
-
borderRadius:
|
|
51
|
+
borderRadius: '50%',
|
|
52
52
|
background: vars.handleBackground,
|
|
53
|
-
transition:
|
|
53
|
+
transition: 'all .2s ease'
|
|
54
54
|
},
|
|
55
|
-
[
|
|
56
|
-
position:
|
|
55
|
+
['&:before']: {
|
|
56
|
+
position: 'relative',
|
|
57
57
|
content: '""',
|
|
58
|
-
width:
|
|
59
|
-
height:
|
|
60
|
-
display:
|
|
61
|
-
}
|
|
62
|
-
}
|
|
58
|
+
width: '50%',
|
|
59
|
+
height: '100%',
|
|
60
|
+
display: 'none'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
export const checked = style({
|
|
66
66
|
vars: {
|
|
67
|
-
[vars.offBackground]: vars.onBackground
|
|
67
|
+
[vars.offBackground]: vars.onBackground
|
|
68
68
|
},
|
|
69
69
|
selectors: {
|
|
70
|
-
[
|
|
71
|
-
left:
|
|
72
|
-
}
|
|
73
|
-
}
|
|
70
|
+
['&:after']: {
|
|
71
|
+
left: '50%'
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
export const base = style({
|
|
77
|
-
position:
|
|
78
|
-
display:
|
|
79
|
-
alignItems:
|
|
80
|
-
cursor:
|
|
81
|
-
gap: themeVars.space[
|
|
77
|
+
position: 'relative',
|
|
78
|
+
display: 'inline-flex',
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
cursor: 'pointer',
|
|
81
|
+
gap: themeVars.space['1.5']
|
|
82
82
|
});
|
|
83
83
|
|
|
84
84
|
export const input = style({
|
|
85
|
-
position:
|
|
85
|
+
position: 'absolute',
|
|
86
86
|
opacity: 0,
|
|
87
|
-
cursor:
|
|
87
|
+
cursor: 'pointer'
|
|
88
88
|
});
|
|
89
89
|
|
|
90
90
|
export const disabled = style({
|
|
91
91
|
opacity: 0.5,
|
|
92
|
-
cursor:
|
|
92
|
+
cursor: 'not-allowed'
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
export const label = style({
|
|
96
|
-
marginLeft: themeVars.space[
|
|
97
|
-
fontWeight:
|
|
98
|
-
display:
|
|
96
|
+
marginLeft: themeVars.space['0.5'],
|
|
97
|
+
fontWeight: '500',
|
|
98
|
+
display: 'inline-block',
|
|
99
99
|
fontSize: themeVars.fontSize.base,
|
|
100
|
-
wordBreak:
|
|
101
|
-
cursor:
|
|
100
|
+
wordBreak: 'break-word',
|
|
101
|
+
cursor: 'pointer'
|
|
102
102
|
});
|
|
103
103
|
|
|
104
104
|
export const size = styleVariants({
|
|
@@ -115,22 +115,21 @@ export const size = styleVariants({
|
|
|
115
115
|
md: {
|
|
116
116
|
vars: {
|
|
117
117
|
[vars.height]: sizes.md
|
|
118
|
-
}
|
|
118
|
+
}
|
|
119
119
|
},
|
|
120
120
|
lg: {
|
|
121
121
|
vars: {
|
|
122
|
-
[vars.height]: sizes.lg
|
|
123
|
-
}
|
|
122
|
+
[vars.height]: sizes.lg
|
|
123
|
+
}
|
|
124
124
|
},
|
|
125
125
|
xl: {
|
|
126
126
|
vars: {
|
|
127
|
-
[vars.height]: sizes.xl
|
|
128
|
-
}
|
|
129
|
-
}
|
|
127
|
+
[vars.height]: sizes.xl
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
130
|
});
|
|
131
131
|
|
|
132
132
|
globalStyle(`${base} ${input}:focus + ${toggle}`, {
|
|
133
|
-
vars: {
|
|
134
|
-
}
|
|
135
|
-
boxShadow: `0 0 0 2px ${themeVars.color.blue[200]}`,
|
|
133
|
+
vars: {},
|
|
134
|
+
boxShadow: `0 0 0 2px ${themeVars.color.blue[200]}`
|
|
136
135
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Switch.css'
|
|
1
|
+
export * from './Switch.css';
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import MTabGroup from
|
|
2
|
-
import MTab from
|
|
3
|
-
import {
|
|
4
|
-
MTabsBasic,
|
|
5
|
-
MTabsVertical
|
|
6
|
-
} from "./index";
|
|
1
|
+
import MTabGroup from '../TabGroup.vue';
|
|
2
|
+
import MTab from '../Tab.vue';
|
|
3
|
+
import { MTabsBasic, MTabsVertical } from './index';
|
|
7
4
|
|
|
8
|
-
import {
|
|
9
|
-
createStory,
|
|
10
|
-
sizeArgType
|
|
11
|
-
} from "../../../__storybook__";
|
|
5
|
+
import { createStory, sizeArgType } from '../../../__storybook__';
|
|
12
6
|
|
|
13
7
|
export default {
|
|
14
8
|
component: MTabGroup,
|
|
@@ -19,7 +13,7 @@ export default {
|
|
|
19
13
|
argTypes: {
|
|
20
14
|
...sizeArgType()
|
|
21
15
|
}
|
|
22
|
-
}
|
|
16
|
+
};
|
|
23
17
|
|
|
24
18
|
export const Basic = createStory(MTabsBasic);
|
|
25
19
|
export const Vertical = createStory(MTabsVertical);
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
import MTable from
|
|
2
|
-
import MButton from
|
|
3
|
-
import {
|
|
4
|
-
MTableBasic,
|
|
5
|
-
MTableEmpty,
|
|
6
|
-
MTableSelected
|
|
7
|
-
} from "./index";
|
|
1
|
+
import MTable from '../Table.vue';
|
|
2
|
+
import MButton from '../../button/Button.vue';
|
|
3
|
+
import { MTableBasic, MTableEmpty, MTableSelected } from './index';
|
|
8
4
|
|
|
9
|
-
import {
|
|
10
|
-
createStory
|
|
11
|
-
} from "../../../__storybook__";
|
|
5
|
+
import { createStory } from '../../../__storybook__';
|
|
12
6
|
|
|
13
7
|
export default {
|
|
14
8
|
component: MTable,
|
|
15
9
|
subcomponents: {
|
|
16
10
|
MButton
|
|
17
11
|
},
|
|
18
|
-
title: 'Components/Table'
|
|
19
|
-
}
|
|
12
|
+
title: 'Components/Table'
|
|
13
|
+
};
|
|
20
14
|
|
|
21
15
|
export const Basic = createStory(MTableBasic);
|
|
22
16
|
export const Empty = createStory(MTableEmpty);
|
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
createVar,
|
|
3
|
+
globalKeyframes,
|
|
4
|
+
globalStyle,
|
|
5
|
+
style,
|
|
6
|
+
styleVariants
|
|
7
|
+
} from '@vanilla-extract/css';
|
|
8
|
+
import { themeVars } from '../../../styles/theme.css';
|
|
3
9
|
|
|
4
10
|
export const wrapper = style({
|
|
5
|
-
width:
|
|
6
|
-
overflow:
|
|
11
|
+
width: '100%',
|
|
12
|
+
overflow: 'auto'
|
|
7
13
|
});
|
|
8
14
|
|
|
9
15
|
const vars = {
|
|
10
16
|
headerHeight: createVar(),
|
|
11
17
|
cellPadding: createVar(),
|
|
12
18
|
fontSize: createVar()
|
|
13
|
-
}
|
|
19
|
+
};
|
|
14
20
|
|
|
15
21
|
export const table = style({
|
|
16
22
|
vars: {
|
|
17
|
-
[vars.headerHeight]:
|
|
18
|
-
[vars.cellPadding]:
|
|
19
|
-
[vars.fontSize]: themeVars.fontSize.base
|
|
23
|
+
[vars.headerHeight]: '44px',
|
|
24
|
+
[vars.cellPadding]: '8px 14px',
|
|
25
|
+
[vars.fontSize]: themeVars.fontSize.base
|
|
20
26
|
},
|
|
21
|
-
width:
|
|
22
|
-
borderCollapse:
|
|
27
|
+
width: '100%',
|
|
28
|
+
borderCollapse: 'collapse',
|
|
23
29
|
fontSize: vars.fontSize
|
|
24
30
|
});
|
|
25
31
|
|
|
@@ -27,31 +33,30 @@ export const hoverable = style({});
|
|
|
27
33
|
export const striped = style({});
|
|
28
34
|
|
|
29
35
|
globalStyle(`${striped} tbody tr:nth-child(even)`, {
|
|
30
|
-
backgroundColor: themeVars.color.gray[75]
|
|
36
|
+
backgroundColor: themeVars.color.gray[75]
|
|
31
37
|
});
|
|
32
38
|
|
|
33
|
-
|
|
34
39
|
globalStyle(`${table} th`, {
|
|
35
40
|
height: vars.headerHeight,
|
|
36
41
|
padding: vars.cellPadding,
|
|
37
|
-
textAlign:
|
|
42
|
+
textAlign: 'left',
|
|
38
43
|
backgroundColor: themeVars.color.gray[100],
|
|
39
44
|
borderBottom: `1px solid ${themeVars.color.gray[200]}`,
|
|
40
45
|
color: themeVars.color.gray[600],
|
|
41
46
|
fontWeight: 500,
|
|
42
47
|
fontSize: themeVars.fontSize.base,
|
|
43
|
-
marginBottom:
|
|
48
|
+
marginBottom: '5px'
|
|
44
49
|
});
|
|
45
50
|
|
|
46
51
|
globalStyle(`${table} td`, {
|
|
47
52
|
padding: vars.cellPadding,
|
|
48
|
-
textAlign:
|
|
53
|
+
textAlign: 'left',
|
|
49
54
|
color: themeVars.color.gray[900],
|
|
50
55
|
borderBottom: `1px solid ${themeVars.color.gray[200]}`,
|
|
51
56
|
fontWeight: 400,
|
|
52
|
-
transition: `background-color 0.2s ${themeVars.transition.default}
|
|
57
|
+
transition: `background-color 0.2s ${themeVars.transition.default}`
|
|
53
58
|
});
|
|
54
59
|
|
|
55
60
|
globalStyle(`${hoverable} tr:hover td`, {
|
|
56
|
-
backgroundColor: themeVars.color.gray[100]
|
|
61
|
+
backgroundColor: themeVars.color.gray[100]
|
|
57
62
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Table.css';
|
|
1
|
+
export * from './Table.css';
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import MTag from
|
|
1
|
+
import MTag from '../Tag.vue';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
MTagBasic,
|
|
5
|
-
} from "./index";
|
|
3
|
+
import { MTagBasic } from './index';
|
|
6
4
|
|
|
7
|
-
import {
|
|
8
|
-
colorArgType,
|
|
9
|
-
createStory,
|
|
10
|
-
sizeArgType
|
|
11
|
-
} from "../../../__storybook__";
|
|
5
|
+
import { colorArgType, createStory, sizeArgType } from '../../../__storybook__';
|
|
12
6
|
|
|
13
7
|
export default {
|
|
14
8
|
component: MTag,
|
|
@@ -17,6 +11,6 @@ export default {
|
|
|
17
11
|
...colorArgType(),
|
|
18
12
|
...sizeArgType()
|
|
19
13
|
}
|
|
20
|
-
}
|
|
14
|
+
};
|
|
21
15
|
|
|
22
16
|
export const Basic = createStory(MTagBasic);
|
|
@@ -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: '18px',
|
|
6
11
|
sm: '22px',
|
|
7
12
|
md: '26px',
|
|
8
13
|
lg: '30px',
|
|
9
|
-
xl: '34px'
|
|
14
|
+
xl: '34px'
|
|
10
15
|
};
|
|
11
16
|
|
|
12
17
|
const borderRadiuses = {
|
|
@@ -14,7 +19,7 @@ const borderRadiuses = {
|
|
|
14
19
|
sm: '3px',
|
|
15
20
|
md: '4px',
|
|
16
21
|
lg: '6px',
|
|
17
|
-
xl: '8px'
|
|
22
|
+
xl: '8px'
|
|
18
23
|
};
|
|
19
24
|
|
|
20
25
|
export const vars = {
|
|
@@ -24,7 +29,7 @@ export const vars = {
|
|
|
24
29
|
paddingY: createVar(),
|
|
25
30
|
borderColor: createVar(),
|
|
26
31
|
backgroundColor: createVar(),
|
|
27
|
-
color: createVar()
|
|
32
|
+
color: createVar()
|
|
28
33
|
};
|
|
29
34
|
|
|
30
35
|
export const base = style({
|
|
@@ -35,7 +40,7 @@ export const base = style({
|
|
|
35
40
|
[vars.paddingY]: themeVars.space[0],
|
|
36
41
|
[vars.borderColor]: themeVars.color.gray[100],
|
|
37
42
|
[vars.color]: themeVars.color.gray[700],
|
|
38
|
-
[vars.backgroundColor]: themeVars.color.gray[100]
|
|
43
|
+
[vars.backgroundColor]: themeVars.color.gray[100]
|
|
39
44
|
},
|
|
40
45
|
height: vars.height,
|
|
41
46
|
minHeight: vars.height,
|
|
@@ -50,7 +55,7 @@ export const base = style({
|
|
|
50
55
|
wordBreak: 'break-word',
|
|
51
56
|
fontSize: themeVars.fontSize.base,
|
|
52
57
|
display: 'inline-flex',
|
|
53
|
-
alignItems: 'center'
|
|
58
|
+
alignItems: 'center'
|
|
54
59
|
});
|
|
55
60
|
|
|
56
61
|
export const close = style({
|
|
@@ -70,9 +75,9 @@ export const close = style({
|
|
|
70
75
|
borderRadius: '50%',
|
|
71
76
|
':hover': {
|
|
72
77
|
backgroundColor: themeVars.color.gray[200],
|
|
73
|
-
color: themeVars.color.gray[700]
|
|
78
|
+
color: themeVars.color.gray[700]
|
|
74
79
|
},
|
|
75
80
|
':focus': {
|
|
76
81
|
outline: 'none'
|
|
77
82
|
}
|
|
78
|
-
})
|
|
83
|
+
});
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
<div v-if="description" :class="style.description">
|
|
7
7
|
{{ description }}
|
|
8
8
|
</div>
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
<div :class="wrapperComputedClasses">
|
|
11
|
-
<textarea
|
|
11
|
+
<textarea
|
|
12
12
|
:style="`height: ${height}px`"
|
|
13
13
|
ref="element"
|
|
14
|
-
:id="id"
|
|
14
|
+
:id="id"
|
|
15
15
|
:placeholder="placeholder"
|
|
16
|
-
:name="name"
|
|
16
|
+
:name="name"
|
|
17
17
|
:value="modelValue || ''"
|
|
18
18
|
:readonly="readonly"
|
|
19
19
|
v-on="inputListeners"
|
|
@@ -38,8 +38,7 @@ import {
|
|
|
38
38
|
defineComponent,
|
|
39
39
|
ref,
|
|
40
40
|
computed,
|
|
41
|
-
toRef
|
|
42
|
-
defineExpose
|
|
41
|
+
toRef
|
|
43
42
|
} from "vue";
|
|
44
43
|
import { useInput } from "../../composables/useInput";
|
|
45
44
|
import { useInteractive } from "../../composables/useInteractive";
|
|
@@ -91,7 +90,7 @@ export default defineComponent({
|
|
|
91
90
|
},
|
|
92
91
|
},
|
|
93
92
|
emits: useInput.emits(),
|
|
94
|
-
setup(props, { slots, emit }) {
|
|
93
|
+
setup(props, { slots, emit, expose }) {
|
|
95
94
|
const element = ref<HTMLInputElement|null>(null);
|
|
96
95
|
const { focus, blur } = useInteractive(element);
|
|
97
96
|
const {
|
|
@@ -150,7 +149,7 @@ export default defineComponent({
|
|
|
150
149
|
emit('update:modelValue', '');
|
|
151
150
|
};
|
|
152
151
|
|
|
153
|
-
|
|
152
|
+
expose({
|
|
154
153
|
focus,
|
|
155
154
|
blur,
|
|
156
155
|
})
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import MTextarea from
|
|
2
|
-
import {
|
|
3
|
-
MTextareaBasic,
|
|
4
|
-
} from "./index";
|
|
1
|
+
import MTextarea from '../Textarea.vue';
|
|
2
|
+
import { MTextareaBasic } from './index';
|
|
5
3
|
|
|
6
|
-
import {
|
|
7
|
-
createStory, sizeArgType
|
|
8
|
-
} from "../../../__storybook__";
|
|
4
|
+
import { createStory, sizeArgType } from '../../../__storybook__';
|
|
9
5
|
|
|
10
6
|
export default {
|
|
11
7
|
component: MTextarea,
|
|
@@ -13,6 +9,6 @@ export default {
|
|
|
13
9
|
argTypes: {
|
|
14
10
|
...sizeArgType()
|
|
15
11
|
}
|
|
16
|
-
}
|
|
12
|
+
};
|
|
17
13
|
|
|
18
14
|
export const Basic = createStory(MTextareaBasic);
|