@teammodlr/ui-kit 2.1.3 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/select/Select.vue.d.ts +21 -1
- package/lib/components/select/style/Select.css.d.ts +6 -0
- package/lib/index.cjs.js +2 -2
- package/lib/index.es.js +1723 -1642
- package/lib/style.css +1 -1
- package/lib/styles/theme.css.d.ts +7 -1
- package/package.json +1 -1
- package/src/components/select/Select.vue +96 -34
- package/src/components/select/examples/multiple.vue +1 -1
- package/src/components/select/style/Select.css.ts +91 -11
- package/src/components/tag/style/Tag.css.ts +0 -1
- package/src/components/transfer/Transfer.vue +3 -2
- package/src/components/transfer/examples/basic.vue +2 -2
- package/src/components/transfer/style/Transfer.css.ts +16 -4
- package/src/styles/theme.css.ts +3 -1
- package/lib/styles/typography.css.d.ts +0 -22
- package/src/styles/typography.css.ts +0 -91
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createVar, globalStyle, style, styleVariants } from "@vanilla-extract/css";
|
|
2
2
|
import { themeVars } from "../../../styles/theme.css";
|
|
3
|
-
import { fonts } from "../../../styles/typography.css";
|
|
4
3
|
|
|
5
4
|
const sizes = {
|
|
6
5
|
xs: '26px',
|
|
@@ -48,7 +47,6 @@ export const base = style({
|
|
|
48
47
|
[vars.backgroundColor]: '#FFFFFF',
|
|
49
48
|
[vars.cursor]: 'text',
|
|
50
49
|
},
|
|
51
|
-
height: vars.height,
|
|
52
50
|
minHeight: vars.height,
|
|
53
51
|
width: '100%',
|
|
54
52
|
borderRadius: vars.radius,
|
|
@@ -88,6 +86,8 @@ export const selectedTags = style({
|
|
|
88
86
|
flexWrap: 'wrap',
|
|
89
87
|
alignItems: 'center',
|
|
90
88
|
gap: themeVars.space[1],
|
|
89
|
+
paddingTop: themeVars.space[1.5],
|
|
90
|
+
paddingBottom: themeVars.space[1.5],
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
export const block = style({
|
|
@@ -200,6 +200,8 @@ export const search = style({
|
|
|
200
200
|
position: 'sticky',
|
|
201
201
|
top: 0,
|
|
202
202
|
zIndex: 1,
|
|
203
|
+
borderBottom: `1px solid ${themeVars.color.gray[200]}`,
|
|
204
|
+
display: 'flex',
|
|
203
205
|
});
|
|
204
206
|
|
|
205
207
|
export const searchInput = style({
|
|
@@ -208,8 +210,8 @@ export const searchInput = style({
|
|
|
208
210
|
outline: 'none',
|
|
209
211
|
width: '100%',
|
|
210
212
|
fontSize: themeVars.fontSize.base,
|
|
211
|
-
borderBottom: `1px solid ${themeVars.color.gray[200]}`,
|
|
212
213
|
color: themeVars.color.gray[800],
|
|
214
|
+
flexShrink: 1
|
|
213
215
|
});
|
|
214
216
|
|
|
215
217
|
export const options = style({
|
|
@@ -237,6 +239,7 @@ export const option = style({
|
|
|
237
239
|
transition: "background-color 0.05s ease-in-out",
|
|
238
240
|
backgroundColor: vars.optionBackgroundColor,
|
|
239
241
|
borderRadius: borderRadiuses.md,
|
|
242
|
+
userSelect: "none",
|
|
240
243
|
':hover': {
|
|
241
244
|
vars: {
|
|
242
245
|
[vars.optionColor]: themeVars.color.gray[800],
|
|
@@ -245,6 +248,7 @@ export const option = style({
|
|
|
245
248
|
}
|
|
246
249
|
});
|
|
247
250
|
|
|
251
|
+
|
|
248
252
|
export const optionFocused = style({
|
|
249
253
|
vars: {
|
|
250
254
|
[vars.optionColor]: themeVars.color.gray[800],
|
|
@@ -259,18 +263,85 @@ export const optionFocused = style({
|
|
|
259
263
|
});
|
|
260
264
|
|
|
261
265
|
export const optionSelected = style({
|
|
262
|
-
vars: {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
},
|
|
266
|
+
// vars: {
|
|
267
|
+
// [vars.optionColor]: themeVars.color.blue[50],
|
|
268
|
+
// [vars.optionBackgroundColor]: themeVars.color.blue[500],
|
|
269
|
+
// },
|
|
270
|
+
// ':hover': {
|
|
271
|
+
// vars: {
|
|
272
|
+
// [vars.optionColor]: themeVars.color.blue[50],
|
|
273
|
+
// [vars.optionBackgroundColor]: themeVars.color.blue[600],
|
|
274
|
+
// },
|
|
275
|
+
// }
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
export const optionLabel = style({
|
|
279
|
+
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
export const checkAll = style({
|
|
283
|
+
display: 'flex',
|
|
284
|
+
alignItems: 'center',
|
|
285
|
+
justifyContent: 'center',
|
|
286
|
+
width: themeVars.space[5],
|
|
287
|
+
margin: `0 ${themeVars.space[2]}`,
|
|
288
|
+
flexShrink: 0,
|
|
289
|
+
flex: 1
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
export const checkAllButton = style({
|
|
293
|
+
flexShrink: 0,
|
|
294
|
+
alignItems: 'center',
|
|
295
|
+
cursor: 'pointer',
|
|
296
|
+
justifyContent: 'center',
|
|
297
|
+
marginLeft: themeVars.space[2.5],
|
|
298
|
+
width: themeVars.space[6],
|
|
299
|
+
height: themeVars.space[6],
|
|
300
|
+
borderRadius: borderRadiuses.md,
|
|
301
|
+
color: themeVars.color.blue[500],
|
|
302
|
+
border: `2px solid ${themeVars.color.gray[200]}`,
|
|
303
|
+
padding: 0,
|
|
304
|
+
background: 'none',
|
|
305
|
+
outline: 'none',
|
|
266
306
|
':hover': {
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
307
|
+
borderColor: themeVars.color.gray[300],
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
export const checkAllButtonActive = style({
|
|
312
|
+
border: `1px solid ${themeVars.color.blue[500]}`,
|
|
313
|
+
background: themeVars.color.blue[500],
|
|
314
|
+
color: 'white',
|
|
315
|
+
':hover': {
|
|
316
|
+
borderColor: themeVars.color.blue[600],
|
|
317
|
+
background: themeVars.color.blue[600],
|
|
271
318
|
}
|
|
272
319
|
});
|
|
273
320
|
|
|
321
|
+
globalStyle(`${checkAllButtonActive} > svg`, {
|
|
322
|
+
position: 'relative',
|
|
323
|
+
top: '1px',
|
|
324
|
+
width: themeVars.space[4],
|
|
325
|
+
height: themeVars.space[4],
|
|
326
|
+
color: 'white'
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
export const optionIcon = style({
|
|
330
|
+
display: 'flex',
|
|
331
|
+
alignItems: 'center',
|
|
332
|
+
justifyContent: 'center',
|
|
333
|
+
width: themeVars.space[5],
|
|
334
|
+
marginLeft: '-2px'
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
globalStyle(`${optionIcon} > svg`, {
|
|
338
|
+
position: 'relative',
|
|
339
|
+
top: '1px',
|
|
340
|
+
width: themeVars.space[5],
|
|
341
|
+
height: themeVars.space[5],
|
|
342
|
+
color: themeVars.color.blue[500],
|
|
343
|
+
});
|
|
344
|
+
|
|
274
345
|
export const noResults = style({
|
|
275
346
|
padding: `${themeVars.space[2]} 0`,
|
|
276
347
|
display: 'flex',
|
|
@@ -283,3 +354,12 @@ export const noResults = style({
|
|
|
283
354
|
color: themeVars.color.gray[500],
|
|
284
355
|
fontSize: themeVars.fontSize.small,
|
|
285
356
|
});
|
|
357
|
+
|
|
358
|
+
export const clearable = style({
|
|
359
|
+
width: themeVars.space[4],
|
|
360
|
+
height: themeVars.space[4],
|
|
361
|
+
position: 'absolute',
|
|
362
|
+
right: themeVars.space[2],
|
|
363
|
+
top: '0',
|
|
364
|
+
display: 'flex',
|
|
365
|
+
})
|
|
@@ -85,7 +85,7 @@ export default defineComponent({
|
|
|
85
85
|
modelValue: {
|
|
86
86
|
type: Array,
|
|
87
87
|
default: () => []
|
|
88
|
-
}
|
|
88
|
+
}
|
|
89
89
|
},
|
|
90
90
|
setup(props, { emit }) {
|
|
91
91
|
const wrapper = ref<HTMLElement | null>(null);
|
|
@@ -98,6 +98,7 @@ export default defineComponent({
|
|
|
98
98
|
|
|
99
99
|
const sourceData = computed(() =>
|
|
100
100
|
props.options.filter((option: any) => !props.modelValue.includes(option[props.optionKey]))
|
|
101
|
+
.sort((a: any, b: any) => a[props.optionLabel].localeCompare(b[props.optionLabel]))
|
|
101
102
|
);
|
|
102
103
|
|
|
103
104
|
const targetData = computed(() => {
|
|
@@ -141,4 +142,4 @@ export default defineComponent({
|
|
|
141
142
|
}
|
|
142
143
|
}
|
|
143
144
|
})
|
|
144
|
-
</script>
|
|
145
|
+
</script>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { ref } from 'vue';
|
|
11
11
|
|
|
12
12
|
function createOptions () {
|
|
13
|
-
return Array.from({ length:
|
|
13
|
+
return Array.from({ length: 8 }).map((_,index) => ({
|
|
14
14
|
label: 'Option ' + index,
|
|
15
15
|
value: index,
|
|
16
16
|
}))
|
|
@@ -18,4 +18,4 @@ function createOptions () {
|
|
|
18
18
|
|
|
19
19
|
const options = ref(createOptions());
|
|
20
20
|
const selected = ref([1, 2, 3, 4, 5]);
|
|
21
|
-
</script>
|
|
21
|
+
</script>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createVar, style, styleVariants } from "@vanilla-extract/css";
|
|
1
|
+
import { createVar, globalStyle, style, styleVariants } from "@vanilla-extract/css";
|
|
2
2
|
import { themeVars } from "../../../styles/theme.css";
|
|
3
3
|
|
|
4
4
|
export const vars = {
|
|
@@ -24,19 +24,30 @@ export const list = style({
|
|
|
24
24
|
height: "inherit",
|
|
25
25
|
display: "flex",
|
|
26
26
|
flexDirection: "column",
|
|
27
|
-
overflow: "auto"
|
|
27
|
+
overflow: "auto",
|
|
28
|
+
borderRight: `1px solid ${themeVars.color.gray[200]}`,
|
|
28
29
|
});
|
|
29
30
|
|
|
31
|
+
|
|
32
|
+
// lastchild of list in wrapper
|
|
33
|
+
globalStyle(`${wrapper} > ${list}:last-child`, {
|
|
34
|
+
borderRight: "none"
|
|
35
|
+
})
|
|
36
|
+
|
|
30
37
|
export const listHeader = style({
|
|
31
38
|
minHeight: "40px",
|
|
32
39
|
boxSizing: "border-box",
|
|
33
40
|
display: "flex",
|
|
41
|
+
flexShrink: 0,
|
|
34
42
|
padding: `${themeVars.space["4"]}`,
|
|
35
43
|
alignItems: "center",
|
|
36
44
|
position: "sticky",
|
|
37
45
|
top: 0,
|
|
38
46
|
backgroundColor: "#FFF",
|
|
47
|
+
color: themeVars.color.gray[900],
|
|
39
48
|
zIndex: 1,
|
|
49
|
+
fontWeight: 500,
|
|
50
|
+
borderBottom: `1px solid ${themeVars.color.gray[200]}`
|
|
40
51
|
});
|
|
41
52
|
|
|
42
53
|
export const listBody = style({
|
|
@@ -59,10 +70,11 @@ export const transferItem = style({
|
|
|
59
70
|
minHeight: "35px",
|
|
60
71
|
display: "flex",
|
|
61
72
|
alignItems: "center",
|
|
62
|
-
color: themeVars.color.
|
|
73
|
+
color: themeVars.color.gray[800],
|
|
63
74
|
cursor: "pointer",
|
|
75
|
+
fontSize: themeVars.fontSize.base,
|
|
64
76
|
userSelect: "none",
|
|
65
77
|
':hover': {
|
|
66
78
|
backgroundColor: themeVars.color.gray[150]
|
|
67
79
|
}
|
|
68
|
-
})
|
|
80
|
+
})
|
package/src/styles/theme.css.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {createGlobalTheme, globalStyle, styleVariants} from '@vanilla-extract/css';
|
|
2
|
-
import {fonts} from "./typography.css";
|
|
3
2
|
|
|
4
3
|
export const spaceScale = {
|
|
5
4
|
'0': '0px',
|
|
@@ -12,6 +11,9 @@ export const spaceScale = {
|
|
|
12
11
|
'3.5': '14px',
|
|
13
12
|
'4': '16px',
|
|
14
13
|
'5': '18px',
|
|
14
|
+
'6': '20px',
|
|
15
|
+
'7': '24px',
|
|
16
|
+
'8': '28px',
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
export const marginVariants = styleVariants(spaceScale, (space) => ({
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { FontMetrics } from "@capsizecss/core";
|
|
2
|
-
interface Meta {
|
|
3
|
-
fallback: string;
|
|
4
|
-
file: string;
|
|
5
|
-
format: string;
|
|
6
|
-
metrics: FontMetrics;
|
|
7
|
-
name: string;
|
|
8
|
-
wghtRange: string;
|
|
9
|
-
wghts: {
|
|
10
|
-
[key: string]: number;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
type FontFamilyId = "INTER";
|
|
14
|
-
type Fonts = Record<FontFamilyId, Meta>;
|
|
15
|
-
export declare const fonts: Fonts;
|
|
16
|
-
export declare const fontStyles: {
|
|
17
|
-
INTER_SMALL: string;
|
|
18
|
-
INTER_MED: string;
|
|
19
|
-
INTER_LARGE: string;
|
|
20
|
-
INTER_XLARGE: string;
|
|
21
|
-
};
|
|
22
|
-
export {};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { FontMetrics } from "@capsizecss/core";
|
|
2
|
-
import interFontMetrics from "@capsizecss/metrics/inter";
|
|
3
|
-
import { createTextStyle } from "@capsizecss/vanilla-extract";
|
|
4
|
-
import { style } from "@vanilla-extract/css";
|
|
5
|
-
|
|
6
|
-
interface Meta {
|
|
7
|
-
fallback: string;
|
|
8
|
-
file: string;
|
|
9
|
-
format: string;
|
|
10
|
-
metrics: FontMetrics;
|
|
11
|
-
name: string;
|
|
12
|
-
wghtRange: string;
|
|
13
|
-
wghts: {
|
|
14
|
-
[key: string]: number;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
type FontFamilyId = "INTER";
|
|
19
|
-
|
|
20
|
-
type Fonts = Record<FontFamilyId, Meta>;
|
|
21
|
-
|
|
22
|
-
const FONT_DIR = `/fonts`;
|
|
23
|
-
|
|
24
|
-
export const fonts: Fonts = {
|
|
25
|
-
INTER: {
|
|
26
|
-
fallback: `sans-serif`,
|
|
27
|
-
file: ``,
|
|
28
|
-
format: `truetype-variations`,
|
|
29
|
-
metrics: interFontMetrics,
|
|
30
|
-
name: `Inter`,
|
|
31
|
-
wghtRange: `100 900`,
|
|
32
|
-
wghts: {
|
|
33
|
-
"400": 400,
|
|
34
|
-
"500": 500,
|
|
35
|
-
"600": 600,
|
|
36
|
-
"700": 700,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// https://type-scale.com
|
|
42
|
-
// Major Third
|
|
43
|
-
// base: 16
|
|
44
|
-
const typeScale = {
|
|
45
|
-
s: 12.8,
|
|
46
|
-
m: 16,
|
|
47
|
-
l: 20,
|
|
48
|
-
xl: 25,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
interface Props {
|
|
52
|
-
id: FontFamilyId;
|
|
53
|
-
leading: number;
|
|
54
|
-
size: number;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function calcFontCss({ id, leading, size }: Props) {
|
|
58
|
-
return style([
|
|
59
|
-
createTextStyle({
|
|
60
|
-
fontMetrics: fonts[id].metrics,
|
|
61
|
-
fontSize: size,
|
|
62
|
-
leading,
|
|
63
|
-
}),
|
|
64
|
-
{
|
|
65
|
-
fontFamily: `"${fonts[id].name}", ${fonts[id].fallback}`,
|
|
66
|
-
},
|
|
67
|
-
]);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export const fontStyles = {
|
|
71
|
-
INTER_SMALL: calcFontCss({
|
|
72
|
-
id: "INTER",
|
|
73
|
-
leading: 16.5,
|
|
74
|
-
size: typeScale.s,
|
|
75
|
-
}),
|
|
76
|
-
INTER_MED: calcFontCss({
|
|
77
|
-
id: "INTER",
|
|
78
|
-
leading: 21,
|
|
79
|
-
size: typeScale.m,
|
|
80
|
-
}),
|
|
81
|
-
INTER_LARGE: calcFontCss({
|
|
82
|
-
id: "INTER",
|
|
83
|
-
leading: 25,
|
|
84
|
-
size: typeScale.l,
|
|
85
|
-
}),
|
|
86
|
-
INTER_XLARGE: calcFontCss({
|
|
87
|
-
id: "INTER",
|
|
88
|
-
leading: 32,
|
|
89
|
-
size: typeScale.xl,
|
|
90
|
-
}),
|
|
91
|
-
};
|