@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
|
@@ -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: '26px',
|
|
6
11
|
sm: '30px',
|
|
7
12
|
md: '38px',
|
|
8
13
|
lg: '42px',
|
|
9
|
-
xl: '48px'
|
|
14
|
+
xl: '48px'
|
|
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 = {
|
|
@@ -27,13 +32,12 @@ export const vars = {
|
|
|
27
32
|
color: createVar(),
|
|
28
33
|
cursor: createVar(),
|
|
29
34
|
optionColor: createVar(),
|
|
30
|
-
optionBackgroundColor: createVar()
|
|
31
|
-
}
|
|
35
|
+
optionBackgroundColor: createVar()
|
|
36
|
+
};
|
|
32
37
|
|
|
33
38
|
export const wrapper = style({
|
|
34
39
|
position: 'relative',
|
|
35
|
-
outline: 'none'
|
|
36
|
-
|
|
40
|
+
outline: 'none'
|
|
37
41
|
});
|
|
38
42
|
|
|
39
43
|
export const base = style({
|
|
@@ -45,7 +49,7 @@ export const base = style({
|
|
|
45
49
|
[vars.borderColor]: themeVars.color.gray[300],
|
|
46
50
|
[vars.color]: themeVars.color.gray[900],
|
|
47
51
|
[vars.backgroundColor]: '#FFFFFF',
|
|
48
|
-
[vars.cursor]: 'text'
|
|
52
|
+
[vars.cursor]: 'text'
|
|
49
53
|
},
|
|
50
54
|
minHeight: vars.height,
|
|
51
55
|
width: '100%',
|
|
@@ -69,15 +73,15 @@ export const base = style({
|
|
|
69
73
|
border-color .3s ${themeVars.transition.default}`,
|
|
70
74
|
':hover': {
|
|
71
75
|
vars: {
|
|
72
|
-
[vars.borderColor]: themeVars.color.blue[400]
|
|
76
|
+
[vars.borderColor]: themeVars.color.blue[400]
|
|
73
77
|
}
|
|
74
78
|
},
|
|
75
79
|
':focus': {
|
|
76
80
|
vars: {
|
|
77
|
-
[vars.borderColor]: themeVars.color.blue[500]
|
|
81
|
+
[vars.borderColor]: themeVars.color.blue[500]
|
|
78
82
|
},
|
|
79
83
|
outline: 'none',
|
|
80
|
-
boxShadow: `0 0 0 2px ${themeVars.color.blue[200]}
|
|
84
|
+
boxShadow: `0 0 0 2px ${themeVars.color.blue[200]}`
|
|
81
85
|
}
|
|
82
86
|
});
|
|
83
87
|
|
|
@@ -87,11 +91,11 @@ export const selectedTags = style({
|
|
|
87
91
|
alignItems: 'center',
|
|
88
92
|
gap: themeVars.space[1],
|
|
89
93
|
paddingTop: themeVars.space[1.5],
|
|
90
|
-
paddingBottom: themeVars.space[1.5]
|
|
94
|
+
paddingBottom: themeVars.space[1.5]
|
|
91
95
|
});
|
|
92
96
|
|
|
93
97
|
export const block = style({
|
|
94
|
-
width: '100%'
|
|
98
|
+
width: '100%'
|
|
95
99
|
});
|
|
96
100
|
|
|
97
101
|
export const disabled = style({
|
|
@@ -99,23 +103,23 @@ export const disabled = style({
|
|
|
99
103
|
[vars.borderColor]: themeVars.color.gray[200],
|
|
100
104
|
[vars.color]: themeVars.color.gray[500],
|
|
101
105
|
[vars.backgroundColor]: themeVars.color.gray[50],
|
|
102
|
-
[vars.cursor]: 'not-allowed'
|
|
106
|
+
[vars.cursor]: 'not-allowed'
|
|
103
107
|
},
|
|
104
108
|
':focus': {
|
|
105
|
-
boxShadow: 'none'
|
|
109
|
+
boxShadow: 'none'
|
|
106
110
|
},
|
|
107
111
|
':hover': {
|
|
108
|
-
cursor: 'not-allowed'
|
|
112
|
+
cursor: 'not-allowed'
|
|
109
113
|
}
|
|
110
114
|
});
|
|
111
115
|
|
|
112
116
|
export const label = style({
|
|
113
|
-
fontWeight:
|
|
117
|
+
fontWeight: '500',
|
|
114
118
|
display: 'inline-block',
|
|
115
119
|
fontSize: themeVars.fontSize.base,
|
|
116
120
|
wordBreak: 'break-word',
|
|
117
121
|
cursor: 'pointer',
|
|
118
|
-
marginBottom: themeVars.space[1]
|
|
122
|
+
marginBottom: themeVars.space[1]
|
|
119
123
|
});
|
|
120
124
|
|
|
121
125
|
export const description = style({
|
|
@@ -125,7 +129,7 @@ export const description = style({
|
|
|
125
129
|
color: themeVars.color.gray[600],
|
|
126
130
|
lineHeight: themeVars.fontSize.large,
|
|
127
131
|
wordBreak: 'break-word',
|
|
128
|
-
marginBottom: themeVars.space[1.5]
|
|
132
|
+
marginBottom: themeVars.space[1.5]
|
|
129
133
|
});
|
|
130
134
|
|
|
131
135
|
export const errorMessage = style({
|
|
@@ -134,29 +138,29 @@ export const errorMessage = style({
|
|
|
134
138
|
fontSize: themeVars.fontSize.base,
|
|
135
139
|
color: themeVars.color.red[600],
|
|
136
140
|
wordBreak: 'break-word',
|
|
137
|
-
marginTop: themeVars.space[1.5]
|
|
141
|
+
marginTop: themeVars.space[1.5]
|
|
138
142
|
});
|
|
139
143
|
|
|
140
144
|
export const error = style({
|
|
141
145
|
vars: {
|
|
142
|
-
[vars.borderColor]: themeVars.color.red[500]
|
|
146
|
+
[vars.borderColor]: themeVars.color.red[500]
|
|
143
147
|
},
|
|
144
148
|
':hover': {
|
|
145
149
|
vars: {
|
|
146
|
-
[vars.borderColor]: themeVars.color.red[500]
|
|
150
|
+
[vars.borderColor]: themeVars.color.red[500]
|
|
147
151
|
}
|
|
148
152
|
},
|
|
149
153
|
':focus': {
|
|
150
154
|
boxShadow: `0 0 0 2px ${themeVars.color.red[200]}`,
|
|
151
155
|
vars: {
|
|
152
|
-
[vars.borderColor]: themeVars.color.red[500]
|
|
156
|
+
[vars.borderColor]: themeVars.color.red[500]
|
|
153
157
|
}
|
|
154
|
-
}
|
|
158
|
+
}
|
|
155
159
|
});
|
|
156
160
|
|
|
157
161
|
export const focused = style({
|
|
158
162
|
vars: {
|
|
159
|
-
[vars.borderColor]: themeVars.color.blue[500]
|
|
163
|
+
[vars.borderColor]: themeVars.color.blue[500]
|
|
160
164
|
},
|
|
161
165
|
boxShadow: `0 0 0 2px ${themeVars.color.blue[200]}`
|
|
162
166
|
});
|
|
@@ -171,28 +175,28 @@ export const rightIcon = style({
|
|
|
171
175
|
display: 'flex',
|
|
172
176
|
alignItems: 'center',
|
|
173
177
|
justifyContent: 'center',
|
|
174
|
-
width:
|
|
175
|
-
color: themeVars.color.gray[400]
|
|
178
|
+
width: '2.25rem',
|
|
179
|
+
color: themeVars.color.gray[400]
|
|
176
180
|
});
|
|
177
181
|
|
|
178
182
|
export const hasRightIcon = style({
|
|
179
|
-
paddingRight:
|
|
183
|
+
paddingRight: '2.25rem'
|
|
180
184
|
});
|
|
181
185
|
|
|
182
186
|
export const menu = style({
|
|
183
|
-
backgroundColor:
|
|
184
|
-
borderRadius:
|
|
187
|
+
backgroundColor: '#FFFFFF',
|
|
188
|
+
borderRadius: '4px',
|
|
185
189
|
zIndex: 4000,
|
|
186
190
|
border: `1px solid ${themeVars.color.gray[200]}`,
|
|
187
191
|
boxShadow: themeVars.shadow.md,
|
|
188
|
-
maxHeight:
|
|
189
|
-
overflowY:
|
|
192
|
+
maxHeight: '230px',
|
|
193
|
+
overflowY: 'auto'
|
|
190
194
|
});
|
|
191
195
|
|
|
192
196
|
export const placeholder = style({
|
|
193
|
-
userSelect:
|
|
194
|
-
color: themeVars.color.gray[500]
|
|
195
|
-
})
|
|
197
|
+
userSelect: 'none',
|
|
198
|
+
color: themeVars.color.gray[500]
|
|
199
|
+
});
|
|
196
200
|
|
|
197
201
|
export const search = style({
|
|
198
202
|
// padding: `${themeVars.space[1]} ${themeVars.space[1]} 0`,
|
|
@@ -201,7 +205,7 @@ export const search = style({
|
|
|
201
205
|
top: 0,
|
|
202
206
|
zIndex: 1,
|
|
203
207
|
borderBottom: `1px solid ${themeVars.color.gray[200]}`,
|
|
204
|
-
display: 'flex'
|
|
208
|
+
display: 'flex'
|
|
205
209
|
});
|
|
206
210
|
|
|
207
211
|
export const searchInput = style({
|
|
@@ -218,47 +222,46 @@ export const options = style({
|
|
|
218
222
|
padding: themeVars.space[1],
|
|
219
223
|
display: 'flex',
|
|
220
224
|
flexDirection: 'column',
|
|
221
|
-
gap: themeVars.space[0.5]
|
|
225
|
+
gap: themeVars.space[0.5]
|
|
222
226
|
});
|
|
223
227
|
|
|
224
228
|
export const option = style({
|
|
225
229
|
vars: {
|
|
226
230
|
[vars.optionColor]: themeVars.color.gray[800],
|
|
227
|
-
[vars.optionBackgroundColor]: '#FFFFFF'
|
|
231
|
+
[vars.optionBackgroundColor]: '#FFFFFF'
|
|
228
232
|
},
|
|
229
|
-
position:
|
|
230
|
-
display:
|
|
231
|
-
alignItems:
|
|
232
|
-
cursor:
|
|
233
|
-
minHeight:
|
|
233
|
+
position: 'relative',
|
|
234
|
+
display: 'flex',
|
|
235
|
+
alignItems: 'center',
|
|
236
|
+
cursor: 'pointer',
|
|
237
|
+
minHeight: '36px',
|
|
234
238
|
fontSize: themeVars.fontSize.base,
|
|
235
239
|
paddingBlock: themeVars.space['1.5'],
|
|
236
240
|
paddingInline: themeVars.space['3'],
|
|
237
241
|
gap: themeVars.space[2],
|
|
238
242
|
color: vars.optionColor,
|
|
239
|
-
transition:
|
|
243
|
+
transition: 'background-color 0.05s ease-in-out',
|
|
240
244
|
backgroundColor: vars.optionBackgroundColor,
|
|
241
245
|
borderRadius: borderRadiuses.md,
|
|
242
|
-
userSelect:
|
|
246
|
+
userSelect: 'none',
|
|
243
247
|
':hover': {
|
|
244
248
|
vars: {
|
|
245
249
|
[vars.optionColor]: themeVars.color.gray[800],
|
|
246
|
-
[vars.optionBackgroundColor]: themeVars.color.gray[100]
|
|
247
|
-
}
|
|
250
|
+
[vars.optionBackgroundColor]: themeVars.color.gray[100]
|
|
251
|
+
}
|
|
248
252
|
}
|
|
249
253
|
});
|
|
250
254
|
|
|
251
|
-
|
|
252
255
|
export const optionFocused = style({
|
|
253
256
|
vars: {
|
|
254
257
|
[vars.optionColor]: themeVars.color.gray[800],
|
|
255
|
-
[vars.optionBackgroundColor]: themeVars.color.gray[100]
|
|
258
|
+
[vars.optionBackgroundColor]: themeVars.color.gray[100]
|
|
256
259
|
},
|
|
257
260
|
':hover': {
|
|
258
261
|
vars: {
|
|
259
262
|
[vars.optionColor]: themeVars.color.gray[800],
|
|
260
|
-
[vars.optionBackgroundColor]: themeVars.color.gray[100]
|
|
261
|
-
}
|
|
263
|
+
[vars.optionBackgroundColor]: themeVars.color.gray[100]
|
|
264
|
+
}
|
|
262
265
|
}
|
|
263
266
|
});
|
|
264
267
|
|
|
@@ -275,9 +278,7 @@ export const optionSelected = style({
|
|
|
275
278
|
// }
|
|
276
279
|
});
|
|
277
280
|
|
|
278
|
-
export const optionLabel = style({
|
|
279
|
-
|
|
280
|
-
});
|
|
281
|
+
export const optionLabel = style({});
|
|
281
282
|
|
|
282
283
|
export const checkAll = style({
|
|
283
284
|
display: 'flex',
|
|
@@ -304,7 +305,7 @@ export const checkAllButton = style({
|
|
|
304
305
|
background: 'none',
|
|
305
306
|
outline: 'none',
|
|
306
307
|
':hover': {
|
|
307
|
-
borderColor: themeVars.color.gray[300]
|
|
308
|
+
borderColor: themeVars.color.gray[300]
|
|
308
309
|
}
|
|
309
310
|
});
|
|
310
311
|
|
|
@@ -314,7 +315,7 @@ export const checkAllButtonActive = style({
|
|
|
314
315
|
color: 'white',
|
|
315
316
|
':hover': {
|
|
316
317
|
borderColor: themeVars.color.blue[600],
|
|
317
|
-
background: themeVars.color.blue[600]
|
|
318
|
+
background: themeVars.color.blue[600]
|
|
318
319
|
}
|
|
319
320
|
});
|
|
320
321
|
|
|
@@ -339,7 +340,7 @@ globalStyle(`${optionIcon} > svg`, {
|
|
|
339
340
|
top: '1px',
|
|
340
341
|
width: themeVars.space[5],
|
|
341
342
|
height: themeVars.space[5],
|
|
342
|
-
color: themeVars.color.blue[500]
|
|
343
|
+
color: themeVars.color.blue[500]
|
|
343
344
|
});
|
|
344
345
|
|
|
345
346
|
export const noResults = style({
|
|
@@ -352,7 +353,7 @@ export const noResults = style({
|
|
|
352
353
|
gap: themeVars.space[0.5],
|
|
353
354
|
width: '100%',
|
|
354
355
|
color: themeVars.color.gray[500],
|
|
355
|
-
fontSize: themeVars.fontSize.small
|
|
356
|
+
fontSize: themeVars.fontSize.small
|
|
356
357
|
});
|
|
357
358
|
|
|
358
359
|
export const clearable = style({
|
|
@@ -361,5 +362,5 @@ export const clearable = style({
|
|
|
361
362
|
position: 'absolute',
|
|
362
363
|
right: themeVars.space[2],
|
|
363
364
|
top: '0',
|
|
364
|
-
display: 'flex'
|
|
365
|
-
})
|
|
365
|
+
display: 'flex'
|
|
366
|
+
});
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import { createStory } from
|
|
2
|
-
import MSkeleton from
|
|
1
|
+
import { createStory } from '../../../__storybook__';
|
|
2
|
+
import MSkeleton from '../Skeleton.vue';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
MSkeletonBasic,
|
|
6
|
-
MSkeletonPost
|
|
7
|
-
} from "./index";
|
|
4
|
+
import { MSkeletonBasic, MSkeletonPost } from './index';
|
|
8
5
|
|
|
9
6
|
export default {
|
|
10
7
|
component: MSkeleton,
|
|
11
8
|
title: 'Components/Skeleton',
|
|
12
|
-
argTypes: {
|
|
13
|
-
|
|
14
|
-
}
|
|
9
|
+
argTypes: {}
|
|
10
|
+
};
|
|
15
11
|
|
|
16
12
|
export const Basic = createStory(MSkeletonBasic);
|
|
17
13
|
export const Post = createStory(MSkeletonPost);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {createVar, globalKeyframes, style} from
|
|
2
|
-
import {themeVars} from
|
|
1
|
+
import { createVar, globalKeyframes, style } from '@vanilla-extract/css';
|
|
2
|
+
import { themeVars } from '../../../styles/theme.css';
|
|
3
3
|
|
|
4
4
|
const borderRadiuses = {
|
|
5
5
|
xs: '2px',
|
|
6
6
|
sm: '3px',
|
|
7
7
|
md: '4px',
|
|
8
8
|
lg: '6px',
|
|
9
|
-
xl: '8px'
|
|
9
|
+
xl: '8px'
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export const vars = {
|
|
@@ -15,7 +15,7 @@ export const vars = {
|
|
|
15
15
|
marginBottom: createVar(),
|
|
16
16
|
radius: createVar(),
|
|
17
17
|
startColor: createVar(),
|
|
18
|
-
endColor: createVar()
|
|
18
|
+
endColor: createVar()
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export const base = style({
|
|
@@ -25,31 +25,31 @@ export const base = style({
|
|
|
25
25
|
[vars.marginBottom]: themeVars.space[2],
|
|
26
26
|
[vars.radius]: borderRadiuses.md,
|
|
27
27
|
[vars.startColor]: themeVars.color.gray[200],
|
|
28
|
-
[vars.endColor]: themeVars.color.gray[100]
|
|
28
|
+
[vars.endColor]: themeVars.color.gray[100]
|
|
29
29
|
},
|
|
30
30
|
width: vars.width,
|
|
31
31
|
height: vars.height,
|
|
32
32
|
marginBottom: vars.marginBottom,
|
|
33
33
|
borderRadius: vars.radius,
|
|
34
|
-
position:
|
|
35
|
-
display:
|
|
36
|
-
overflow:
|
|
37
|
-
backgroundColor: themeVars.color.gray[200]
|
|
34
|
+
position: 'relative',
|
|
35
|
+
display: 'inline-block',
|
|
36
|
+
overflow: 'hidden',
|
|
37
|
+
backgroundColor: themeVars.color.gray[200]
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
const shineAnimation =
|
|
40
|
+
const shineAnimation = 'skeleton-shine-animation';
|
|
41
41
|
globalKeyframes(shineAnimation, {
|
|
42
42
|
'0%': {
|
|
43
|
-
background: themeVars.color.gray[200]
|
|
43
|
+
background: themeVars.color.gray[200]
|
|
44
44
|
},
|
|
45
45
|
'40%': {
|
|
46
|
-
background: themeVars.color.gray[100]
|
|
46
|
+
background: themeVars.color.gray[100]
|
|
47
47
|
},
|
|
48
48
|
'80%': {
|
|
49
|
-
background: themeVars.color.gray[200]
|
|
49
|
+
background: themeVars.color.gray[200]
|
|
50
50
|
},
|
|
51
51
|
'100%': {
|
|
52
|
-
background: themeVars.color.gray[200]
|
|
52
|
+
background: themeVars.color.gray[200]
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
|
|
@@ -60,13 +60,13 @@ export const loading = style({
|
|
|
60
60
|
position: 'absolute',
|
|
61
61
|
pointerEvents: 'none',
|
|
62
62
|
inset: '0',
|
|
63
|
-
|
|
63
|
+
|
|
64
64
|
// backgroundImage: `linear-gradient(to right,transparent 25%,${themeVars.color.gray[100]} 37%,transparent 63%)`,
|
|
65
65
|
backgroundColor: themeVars.color.gray[100],
|
|
66
66
|
transition: `${vars.startColor} .3s ease-in-out,
|
|
67
67
|
${vars.endColor} .3s ease-in-out,
|
|
68
68
|
background-color .3s ease-in-out`,
|
|
69
|
-
animation: `${shineAnimation} 1.5s cubic-bezier(0.36, 0, 0.64, 1) infinite
|
|
69
|
+
animation: `${shineAnimation} 1.5s cubic-bezier(0.36, 0, 0.64, 1) infinite`
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {assignInlineVars} from '@vanilla-extract/dynamic';
|
|
2
|
-
export * from './Skeleton.css';
|
|
1
|
+
export { assignInlineVars } from '@vanilla-extract/dynamic';
|
|
2
|
+
export * from './Skeleton.css';
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createVar,
|
|
3
|
+
globalKeyframes,
|
|
4
|
+
globalStyle,
|
|
5
|
+
style,
|
|
6
|
+
styleVariants
|
|
7
|
+
} from '@vanilla-extract/css';
|
|
2
8
|
|
|
3
9
|
export const slider = style({
|
|
4
10
|
userSelect: 'none',
|
|
5
11
|
position: 'relative',
|
|
6
|
-
height: '14px'
|
|
12
|
+
height: '14px'
|
|
7
13
|
});
|
|
8
14
|
|
|
9
15
|
export const sliderTransparent = style({
|
|
10
16
|
userSelect: 'none',
|
|
11
17
|
position: 'absolute',
|
|
12
18
|
height: '14px',
|
|
13
|
-
backgroundImage:
|
|
19
|
+
backgroundImage:
|
|
20
|
+
'linear-gradient(45deg, #bebebe 25%, transparent 25%), linear-gradient(-45deg, #bebebe 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #bebebe 75%), linear-gradient(-45deg, transparent 75%, #bebebe 75%)',
|
|
14
21
|
backgroundSize: '14px 14px',
|
|
15
22
|
backgroundPosition: '0 0, 0 7px, 7px -7px, -7px 0px',
|
|
16
23
|
overflow: 'hidden',
|
|
@@ -39,5 +46,5 @@ export const hueSliderThumb = style({
|
|
|
39
46
|
backgroundColor: 'rgba(255,255,255,0.5)',
|
|
40
47
|
border: '2px solid white',
|
|
41
48
|
boxShadow: '0 0 3px rgba(0, 0, 0, 1)',
|
|
42
|
-
cursor: 'e-resize'
|
|
43
|
-
});
|
|
49
|
+
cursor: 'e-resize'
|
|
50
|
+
});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:disabled="disabled || loading" :name="name" :id="id" :class="style.input" v-bind="$attrs"
|
|
6
6
|
v-on="inputListeners" />
|
|
7
7
|
|
|
8
|
-
<span :class="classes">
|
|
8
|
+
<span :class="classes">
|
|
9
9
|
</span>
|
|
10
10
|
|
|
11
11
|
<span :class="style.label" :id="`${id}-label`">
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
<script lang="ts">
|
|
25
|
-
import { computed, defineComponent,
|
|
25
|
+
import { computed, defineComponent, type PropType, ref, toRef, watch } from 'vue';
|
|
26
26
|
import { useInput } from '../../composables/useInput';
|
|
27
27
|
import { useInteractive } from "../../composables/useInteractive";
|
|
28
28
|
import type { Size } from '../../types/props';
|
|
@@ -50,7 +50,7 @@ export default defineComponent({
|
|
|
50
50
|
default: false
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
|
-
setup(props, { slots, emit }) {
|
|
53
|
+
setup(props, { slots, emit, expose }) {
|
|
54
54
|
const toggleRef = ref<HTMLElement | null>(null);
|
|
55
55
|
|
|
56
56
|
const { focus, blur } = useInteractive(toggleRef);
|
|
@@ -102,7 +102,7 @@ export default defineComponent({
|
|
|
102
102
|
checked.value = !checked.value;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
expose({
|
|
106
106
|
focus,
|
|
107
107
|
blur,
|
|
108
108
|
})
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import MSwitch from
|
|
2
|
-
import {
|
|
3
|
-
MSwitchBasic,
|
|
4
|
-
MSwitchSlot
|
|
5
|
-
} from "./index";
|
|
1
|
+
import MSwitch from '../Switch.vue';
|
|
2
|
+
import { MSwitchBasic, MSwitchSlot } from './index';
|
|
6
3
|
|
|
7
|
-
import {
|
|
8
|
-
createStory, sizeArgType, colorArgType
|
|
9
|
-
} from "../../../__storybook__";
|
|
4
|
+
import { createStory, sizeArgType, colorArgType } from '../../../__storybook__';
|
|
10
5
|
|
|
11
6
|
export default {
|
|
12
7
|
component: MSwitch,
|
|
@@ -14,7 +9,7 @@ export default {
|
|
|
14
9
|
argTypes: {
|
|
15
10
|
...sizeArgType()
|
|
16
11
|
}
|
|
17
|
-
}
|
|
12
|
+
};
|
|
18
13
|
|
|
19
14
|
export const Basic = createStory(MSwitchBasic);
|
|
20
15
|
export const Slot = createStory(MSwitchSlot);
|