@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
|
@@ -1,64 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
createVar,
|
|
3
|
+
globalKeyframes,
|
|
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: '300px',
|
|
6
11
|
sm: '400px',
|
|
7
12
|
md: '640px',
|
|
8
13
|
lg: '800px',
|
|
9
|
-
xl: '1140px'
|
|
14
|
+
xl: '1140px'
|
|
10
15
|
};
|
|
11
16
|
|
|
12
17
|
export const vars = {
|
|
13
18
|
backgroundColor: createVar(),
|
|
14
|
-
color: createVar()
|
|
15
|
-
}
|
|
19
|
+
color: createVar()
|
|
20
|
+
};
|
|
16
21
|
|
|
17
22
|
export const pagination = style({
|
|
18
|
-
display:
|
|
19
|
-
alignItems:
|
|
23
|
+
display: 'inline-flex',
|
|
24
|
+
alignItems: 'center',
|
|
20
25
|
fontSize: themeVars.fontSize.small,
|
|
21
|
-
boxSizing:
|
|
26
|
+
boxSizing: 'border-box'
|
|
22
27
|
});
|
|
23
28
|
|
|
24
29
|
export const buttons = style({
|
|
25
|
-
display:
|
|
26
|
-
alignItems:
|
|
30
|
+
display: 'inline-flex',
|
|
31
|
+
alignItems: 'center',
|
|
27
32
|
fontSize: themeVars.fontSize.small,
|
|
28
|
-
boxSizing:
|
|
29
|
-
gap: themeVars.space[
|
|
33
|
+
boxSizing: 'border-box',
|
|
34
|
+
gap: themeVars.space['2.5']
|
|
30
35
|
});
|
|
31
36
|
|
|
32
37
|
export const pages = style({
|
|
33
|
-
display:
|
|
34
|
-
alignItems:
|
|
38
|
+
display: 'inline-flex',
|
|
39
|
+
alignItems: 'center',
|
|
35
40
|
margin: 0,
|
|
36
|
-
gap: themeVars.space[
|
|
41
|
+
gap: themeVars.space['1']
|
|
37
42
|
});
|
|
38
43
|
|
|
39
44
|
export const page = style({
|
|
40
45
|
vars: {
|
|
41
|
-
[vars.backgroundColor]:
|
|
42
|
-
[vars.color]: themeVars.color.gray[
|
|
46
|
+
[vars.backgroundColor]: 'transparent',
|
|
47
|
+
[vars.color]: themeVars.color.gray['700']
|
|
43
48
|
},
|
|
44
|
-
height:
|
|
45
|
-
width:
|
|
49
|
+
height: '28px',
|
|
50
|
+
width: '28px',
|
|
46
51
|
borderRadius: themeVars.rounded.default,
|
|
47
|
-
outline:
|
|
48
|
-
border:
|
|
52
|
+
outline: 'none',
|
|
53
|
+
border: 'none',
|
|
49
54
|
fontSize: 'inherit',
|
|
50
|
-
padding: `0px ${themeVars.space[
|
|
51
|
-
display:
|
|
52
|
-
alignItems:
|
|
53
|
-
justifyContent:
|
|
55
|
+
padding: `0px ${themeVars.space['2']}`,
|
|
56
|
+
display: 'flex',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
justifyContent: 'center',
|
|
54
59
|
lineHeight: 1,
|
|
55
60
|
color: vars.color,
|
|
56
61
|
backgroundColor: vars.backgroundColor,
|
|
57
|
-
cursor:
|
|
62
|
+
cursor: 'pointer',
|
|
58
63
|
selectors: {
|
|
59
64
|
'&:hover': {
|
|
60
65
|
vars: {
|
|
61
|
-
[vars.backgroundColor]: themeVars.color.gray[
|
|
66
|
+
[vars.backgroundColor]: themeVars.color.gray['150']
|
|
62
67
|
}
|
|
63
68
|
}
|
|
64
69
|
}
|
|
@@ -66,23 +71,22 @@ export const page = style({
|
|
|
66
71
|
|
|
67
72
|
export const active = style({
|
|
68
73
|
vars: {
|
|
69
|
-
[vars.backgroundColor]: themeVars.color.blue[
|
|
70
|
-
[vars.color]:
|
|
74
|
+
[vars.backgroundColor]: themeVars.color.blue['600'],
|
|
75
|
+
[vars.color]: '#FFF'
|
|
71
76
|
},
|
|
72
77
|
selectors: {
|
|
73
78
|
'&:hover': {
|
|
74
79
|
vars: {
|
|
75
|
-
[vars.backgroundColor]: themeVars.color.blue[
|
|
80
|
+
[vars.backgroundColor]: themeVars.color.blue['700']
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
83
|
}
|
|
79
84
|
});
|
|
80
85
|
|
|
81
86
|
export const svg = style({
|
|
82
|
-
height:
|
|
83
|
-
width:
|
|
84
|
-
display:
|
|
85
|
-
fontSize:
|
|
86
|
-
userSelect:
|
|
87
|
-
|
|
88
|
-
});
|
|
87
|
+
height: 'calc(1em + 2px)',
|
|
88
|
+
width: 'calc(1em + 2px)',
|
|
89
|
+
display: 'inline-block',
|
|
90
|
+
fontSize: 'inherit',
|
|
91
|
+
userSelect: 'none'
|
|
92
|
+
});
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
|
|
30
30
|
<script lang="ts">
|
|
31
|
-
import type {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import type {
|
|
31
|
+
import type {PropType} from 'vue';
|
|
32
|
+
import {computed, defineComponent, ref, toRef} from 'vue';
|
|
33
|
+
import {useInput} from '../../composables/useInput';
|
|
34
|
+
import {useInteractive} from "../../composables/useInteractive";
|
|
35
|
+
import type {Size} from '../../types/props';
|
|
36
36
|
import * as style from './style';
|
|
37
37
|
|
|
38
38
|
export default defineComponent({
|
|
@@ -61,7 +61,7 @@ export default defineComponent({
|
|
|
61
61
|
default: null
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
-
setup(props, {slots, emit}) {
|
|
64
|
+
setup(props, {slots, emit, expose}) {
|
|
65
65
|
const radioRef = ref<HTMLElement | null>(null);
|
|
66
66
|
|
|
67
67
|
const {focus, blur} = useInteractive(radioRef);
|
|
@@ -106,7 +106,7 @@ export default defineComponent({
|
|
|
106
106
|
return formError.value || props.error;
|
|
107
107
|
});
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
expose({
|
|
110
110
|
focus,
|
|
111
111
|
blur,
|
|
112
112
|
})
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import MRadio from
|
|
2
|
-
import {
|
|
3
|
-
MRadioBasic,
|
|
4
|
-
MRadioGroup,
|
|
5
|
-
} from "./index";
|
|
1
|
+
import MRadio from '../Radio.vue';
|
|
2
|
+
import { MRadioBasic, MRadioGroup } 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: MRadio,
|
|
@@ -15,7 +10,7 @@ export default {
|
|
|
15
10
|
...sizeArgType(),
|
|
16
11
|
...colorArgType()
|
|
17
12
|
}
|
|
18
|
-
}
|
|
13
|
+
};
|
|
19
14
|
|
|
20
15
|
export const Basic = createStory(MRadioBasic);
|
|
21
16
|
export const Group = createStory(MRadioGroup);
|
|
@@ -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: '18px',
|
|
7
7
|
md: '20px',
|
|
8
8
|
lg: '22px',
|
|
9
|
-
xl: '24px'
|
|
9
|
+
xl: '24px'
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export const vars = {
|
|
@@ -15,30 +15,30 @@ export const vars = {
|
|
|
15
15
|
backgroundColor: createVar(),
|
|
16
16
|
borderColor: createVar(),
|
|
17
17
|
color: createVar()
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
|
|
20
20
|
export const base = style({
|
|
21
|
-
position:
|
|
22
|
-
display:
|
|
23
|
-
alignItems:
|
|
24
|
-
cursor:
|
|
25
|
-
gap: themeVars.space['1.5']
|
|
21
|
+
position: 'relative',
|
|
22
|
+
display: 'inline-flex',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
cursor: 'pointer',
|
|
25
|
+
gap: themeVars.space['1.5']
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
export const input = style({
|
|
29
29
|
position: 'absolute',
|
|
30
30
|
opacity: 0,
|
|
31
|
-
cursor:
|
|
31
|
+
cursor: 'pointer'
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
export const checkmark = style({
|
|
35
|
-
position:
|
|
35
|
+
position: 'absolute',
|
|
36
36
|
width: `calc(${vars.height} - 2px)`,
|
|
37
37
|
height: `calc(${vars.height} - 2px)`,
|
|
38
|
-
top:
|
|
39
|
-
left:
|
|
40
|
-
transform:
|
|
41
|
-
color:
|
|
38
|
+
top: '50%',
|
|
39
|
+
left: '50%',
|
|
40
|
+
transform: 'translate(-50%, -50%)',
|
|
41
|
+
color: 'white'
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
export const checkbox = style({
|
|
@@ -47,9 +47,9 @@ export const checkbox = style({
|
|
|
47
47
|
[vars.radius]: themeVars.rounded.full,
|
|
48
48
|
[vars.backgroundColor]: 'white',
|
|
49
49
|
[vars.borderColor]: themeVars.color.gray[300],
|
|
50
|
-
[vars.color]: themeVars.color.gray[600]
|
|
50
|
+
[vars.color]: themeVars.color.gray[600]
|
|
51
51
|
},
|
|
52
|
-
position:
|
|
52
|
+
position: 'relative',
|
|
53
53
|
width: vars.height,
|
|
54
54
|
height: vars.height,
|
|
55
55
|
borderRadius: vars.radius,
|
|
@@ -63,7 +63,7 @@ export const checkbox = style({
|
|
|
63
63
|
export const checked = style({
|
|
64
64
|
vars: {
|
|
65
65
|
[vars.borderColor]: themeVars.color.blue[500],
|
|
66
|
-
[vars.backgroundColor]: themeVars.color.blue[500]
|
|
66
|
+
[vars.backgroundColor]: themeVars.color.blue[500]
|
|
67
67
|
},
|
|
68
68
|
selectors: {
|
|
69
69
|
['&:after']: {
|
|
@@ -75,31 +75,31 @@ export const checked = style({
|
|
|
75
75
|
width: `calc(${vars.height} - 10px)`,
|
|
76
76
|
height: `calc(${vars.height} - 10px)`,
|
|
77
77
|
borderRadius: themeVars.rounded.full,
|
|
78
|
-
backgroundColor:
|
|
78
|
+
backgroundColor: '#FFF'
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
export const disabled = style({
|
|
84
84
|
opacity: 0.5,
|
|
85
|
-
cursor: 'not-allowed'
|
|
85
|
+
cursor: 'not-allowed'
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
export const indeterminate = style({
|
|
89
89
|
vars: {
|
|
90
90
|
[vars.borderColor]: themeVars.color.blue[500],
|
|
91
|
-
[vars.backgroundColor]: themeVars.color.blue[500]
|
|
91
|
+
[vars.backgroundColor]: themeVars.color.blue[500]
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
export const label = style({
|
|
96
96
|
marginLeft: themeVars.space['0.5'],
|
|
97
|
-
fontWeight:
|
|
97
|
+
fontWeight: '500',
|
|
98
98
|
display: 'inline-block',
|
|
99
99
|
fontSize: themeVars.fontSize.base,
|
|
100
100
|
wordBreak: 'break-word',
|
|
101
|
-
cursor: 'pointer'
|
|
102
|
-
})
|
|
101
|
+
cursor: 'pointer'
|
|
102
|
+
});
|
|
103
103
|
|
|
104
104
|
export const size = styleVariants({
|
|
105
105
|
xs: {
|
|
@@ -115,17 +115,16 @@ 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
|
-
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './Checkbox.css'
|
|
1
|
+
export * from './Checkbox.css';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
11
11
|
import type {PropType} from "vue";
|
|
12
|
-
import {computed, defineComponent, inject, ref
|
|
12
|
+
import {computed, defineComponent, inject, ref } from "vue";
|
|
13
13
|
import type {Size} from "../../types/props";
|
|
14
14
|
import * as style from "./style";
|
|
15
15
|
import {useInteractive} from "../../composables/useInteractive";
|
|
@@ -48,7 +48,7 @@ export default defineComponent({
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
emits: ['update:modelValue'],
|
|
51
|
-
setup(props, {emit}) {
|
|
51
|
+
setup(props, {emit, expose}) {
|
|
52
52
|
const radioRef = ref<HTMLElement | null>(null);
|
|
53
53
|
const parentState = inject(RADIO_BUTTON_GROUP_STATE, null);
|
|
54
54
|
const value = computed(() => {
|
|
@@ -110,7 +110,7 @@ export default defineComponent({
|
|
|
110
110
|
props.onClick(e);
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
expose({
|
|
114
114
|
focus,
|
|
115
115
|
blur,
|
|
116
116
|
})
|
|
@@ -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: '22px',
|
|
6
11
|
sm: '28px',
|
|
7
12
|
md: '36px',
|
|
8
13
|
lg: '40px',
|
|
9
|
-
xl: '45px'
|
|
14
|
+
xl: '45px'
|
|
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
|
const padding = {
|
|
@@ -22,8 +27,8 @@ const padding = {
|
|
|
22
27
|
sm: `0 ${themeVars.space[2]}`,
|
|
23
28
|
md: `0 ${themeVars.space[3]}`,
|
|
24
29
|
lg: `0 ${themeVars.space[3]}`,
|
|
25
|
-
xl: `0 ${themeVars.space[4]}
|
|
26
|
-
}
|
|
30
|
+
xl: `0 ${themeVars.space[4]}`
|
|
31
|
+
};
|
|
27
32
|
|
|
28
33
|
export const vars = {
|
|
29
34
|
height: createVar(),
|
|
@@ -32,18 +37,18 @@ export const vars = {
|
|
|
32
37
|
backgroundColor: createVar(),
|
|
33
38
|
borderColor: createVar(),
|
|
34
39
|
boxShadowColor: createVar(),
|
|
35
|
-
color: createVar()
|
|
36
|
-
}
|
|
40
|
+
color: createVar()
|
|
41
|
+
};
|
|
37
42
|
|
|
38
43
|
export const base = style({
|
|
39
44
|
vars: {
|
|
40
|
-
[vars.borderColor]:
|
|
45
|
+
[vars.borderColor]: 'transparent'
|
|
41
46
|
},
|
|
42
47
|
alignItems: 'center',
|
|
43
48
|
boxSizing: 'border-box',
|
|
44
49
|
display: 'inline-flex',
|
|
45
50
|
fontSize: themeVars.fontSize.base,
|
|
46
|
-
fontWeight:
|
|
51
|
+
fontWeight: '500',
|
|
47
52
|
maxWidth: '100%',
|
|
48
53
|
width: 'auto',
|
|
49
54
|
position: 'relative',
|
|
@@ -56,7 +61,7 @@ export const base = style({
|
|
|
56
61
|
lineHeight: vars.height,
|
|
57
62
|
borderRadius: vars.radius,
|
|
58
63
|
padding: vars.padding,
|
|
59
|
-
zIndex:
|
|
64
|
+
zIndex: 'auto',
|
|
60
65
|
backgroundColor: vars.backgroundColor,
|
|
61
66
|
border: `1px solid ${vars.borderColor}`,
|
|
62
67
|
color: vars.color,
|
|
@@ -66,30 +71,30 @@ export const base = style({
|
|
|
66
71
|
border-color .3s ${themeVars.transition.default}`,
|
|
67
72
|
fontFamily: 'inherit',
|
|
68
73
|
':hover': {
|
|
69
|
-
cursor: 'pointer'
|
|
74
|
+
cursor: 'pointer'
|
|
70
75
|
},
|
|
71
76
|
':focus': {
|
|
72
|
-
outline: 'none'
|
|
77
|
+
outline: 'none'
|
|
73
78
|
}
|
|
74
79
|
});
|
|
75
80
|
|
|
76
81
|
export const variant = styleVariants({
|
|
77
82
|
active: {
|
|
78
83
|
vars: {
|
|
79
|
-
[vars.backgroundColor]:
|
|
84
|
+
[vars.backgroundColor]: 'white',
|
|
80
85
|
[vars.color]: themeVars.color.blue[500],
|
|
81
86
|
[vars.boxShadowColor]: themeVars.color.gray[900],
|
|
82
|
-
[vars.borderColor]: themeVars.color.gray[200]
|
|
87
|
+
[vars.borderColor]: themeVars.color.gray[200]
|
|
83
88
|
},
|
|
84
89
|
boxShadow: `0 .5px 0px 4px rgba(0, 0, 0, 0.01)`,
|
|
85
90
|
':hover': {
|
|
86
91
|
vars: {
|
|
87
|
-
[vars.color]: themeVars.color.blue[600]
|
|
88
|
-
}
|
|
92
|
+
[vars.color]: themeVars.color.blue[600]
|
|
93
|
+
}
|
|
89
94
|
},
|
|
90
95
|
':focus': {
|
|
91
96
|
vars: {
|
|
92
|
-
[vars.color]: themeVars.color.blue[500]
|
|
97
|
+
[vars.color]: themeVars.color.blue[500]
|
|
93
98
|
}
|
|
94
99
|
}
|
|
95
100
|
},
|
|
@@ -98,16 +103,16 @@ export const variant = styleVariants({
|
|
|
98
103
|
[vars.color]: themeVars.color.gray[400],
|
|
99
104
|
[vars.backgroundColor]: 'transparent',
|
|
100
105
|
[vars.boxShadowColor]: themeVars.color.blue[500],
|
|
101
|
-
[vars.borderColor]:
|
|
106
|
+
[vars.borderColor]: 'transparent'
|
|
102
107
|
},
|
|
103
108
|
':hover': {
|
|
104
109
|
vars: {
|
|
105
|
-
[vars.color]: themeVars.color.blue[400]
|
|
106
|
-
}
|
|
110
|
+
[vars.color]: themeVars.color.blue[400]
|
|
111
|
+
}
|
|
107
112
|
},
|
|
108
113
|
':focus': {
|
|
109
114
|
vars: {
|
|
110
|
-
[vars.color]: themeVars.color.blue[400]
|
|
115
|
+
[vars.color]: themeVars.color.blue[400]
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
118
|
}
|
|
@@ -118,41 +123,41 @@ export const size = styleVariants({
|
|
|
118
123
|
vars: {
|
|
119
124
|
[vars.height]: sizes.xs,
|
|
120
125
|
[vars.radius]: borderRadiuses.xs,
|
|
121
|
-
[vars.padding]: padding.xs
|
|
126
|
+
[vars.padding]: padding.xs
|
|
122
127
|
},
|
|
123
|
-
fontSize: themeVars.fontSize.small
|
|
128
|
+
fontSize: themeVars.fontSize.small
|
|
124
129
|
},
|
|
125
130
|
sm: {
|
|
126
131
|
vars: {
|
|
127
132
|
[vars.height]: sizes.sm,
|
|
128
133
|
[vars.radius]: borderRadiuses.sm,
|
|
129
|
-
[vars.padding]: padding.sm
|
|
134
|
+
[vars.padding]: padding.sm
|
|
130
135
|
},
|
|
131
|
-
fontSize: themeVars.fontSize.small
|
|
136
|
+
fontSize: themeVars.fontSize.small
|
|
132
137
|
},
|
|
133
138
|
md: {
|
|
134
139
|
vars: {
|
|
135
140
|
[vars.height]: sizes.md,
|
|
136
141
|
[vars.radius]: borderRadiuses.md,
|
|
137
|
-
[vars.padding]: padding.md
|
|
138
|
-
}
|
|
142
|
+
[vars.padding]: padding.md
|
|
143
|
+
}
|
|
139
144
|
},
|
|
140
145
|
lg: {
|
|
141
146
|
vars: {
|
|
142
147
|
[vars.height]: sizes.lg,
|
|
143
148
|
[vars.radius]: borderRadiuses.lg,
|
|
144
|
-
[vars.padding]: padding.lg
|
|
149
|
+
[vars.padding]: padding.lg
|
|
145
150
|
},
|
|
146
|
-
fontSize: themeVars.fontSize.large
|
|
151
|
+
fontSize: themeVars.fontSize.large
|
|
147
152
|
},
|
|
148
153
|
xl: {
|
|
149
154
|
vars: {
|
|
150
155
|
[vars.height]: sizes.xl,
|
|
151
156
|
[vars.radius]: borderRadiuses.xl,
|
|
152
|
-
[vars.padding]: padding.xl
|
|
157
|
+
[vars.padding]: padding.xl
|
|
153
158
|
},
|
|
154
|
-
fontSize: themeVars.fontSize.large
|
|
155
|
-
}
|
|
159
|
+
fontSize: themeVars.fontSize.large
|
|
160
|
+
}
|
|
156
161
|
});
|
|
157
162
|
|
|
158
163
|
export const icon = style({
|
|
@@ -173,12 +178,12 @@ globalStyle(`${icon} > svg`, {
|
|
|
173
178
|
});
|
|
174
179
|
|
|
175
180
|
export const radio = style({
|
|
176
|
-
pointerEvents:
|
|
177
|
-
position:
|
|
181
|
+
pointerEvents: 'none',
|
|
182
|
+
position: 'absolute',
|
|
178
183
|
border: 0,
|
|
179
184
|
left: 0,
|
|
180
185
|
right: 0,
|
|
181
186
|
top: 0,
|
|
182
187
|
bottom: 0,
|
|
183
188
|
opacity: 0
|
|
184
|
-
})
|
|
189
|
+
});
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import MRadioButtonGroup from
|
|
2
|
-
import MRadioButton from
|
|
3
|
-
import {
|
|
4
|
-
MRadioButtonGroupBasic,
|
|
5
|
-
} from "./index";
|
|
1
|
+
import MRadioButtonGroup from '../RadioButtonGroup.vue';
|
|
2
|
+
import MRadioButton from '../../radiobutton/RadioButton.vue';
|
|
3
|
+
import { MRadioButtonGroupBasic } from './index';
|
|
6
4
|
|
|
7
|
-
import {
|
|
8
|
-
createStory, sizeArgType, colorArgType
|
|
9
|
-
} from "../../../__storybook__";
|
|
5
|
+
import { createStory, sizeArgType, colorArgType } from '../../../__storybook__';
|
|
10
6
|
|
|
11
7
|
export default {
|
|
12
8
|
component: MRadioButtonGroup,
|
|
@@ -15,8 +11,8 @@ export default {
|
|
|
15
11
|
},
|
|
16
12
|
title: 'Components/Radio Button Group',
|
|
17
13
|
argTypes: {
|
|
18
|
-
...sizeArgType()
|
|
14
|
+
...sizeArgType()
|
|
19
15
|
}
|
|
20
|
-
}
|
|
16
|
+
};
|
|
21
17
|
|
|
22
18
|
export const Basic = createStory(MRadioButtonGroupBasic);
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import {createVar, globalStyle, style} from
|
|
2
|
-
import {base as button} from
|
|
3
|
-
import {themeVars} from
|
|
1
|
+
import { createVar, globalStyle, style } from '@vanilla-extract/css';
|
|
2
|
+
import { base as button } from '../../radiobutton/style/RadioButton.css';
|
|
3
|
+
import { themeVars } from '../../../styles/theme.css';
|
|
4
4
|
|
|
5
5
|
const vars = {
|
|
6
6
|
padding: createVar(),
|
|
7
7
|
borderRadius: createVar(),
|
|
8
8
|
gap: createVar()
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
10
|
|
|
11
11
|
export const base = style({
|
|
12
12
|
vars: {
|
|
13
13
|
[vars.padding]: themeVars.space[1],
|
|
14
14
|
[vars.borderRadius]: themeVars.rounded.default,
|
|
15
|
-
[vars.gap]: themeVars.space[1]
|
|
15
|
+
[vars.gap]: themeVars.space[1]
|
|
16
16
|
},
|
|
17
|
-
display:
|
|
18
|
-
position:
|
|
19
|
-
flexWrap:
|
|
17
|
+
display: 'inline-flex',
|
|
18
|
+
position: 'relative',
|
|
19
|
+
flexWrap: 'nowrap',
|
|
20
20
|
backgroundColor: themeVars.color.gray[100],
|
|
21
21
|
padding: vars.padding,
|
|
22
22
|
borderRadius: vars.borderRadius,
|
|
23
|
-
gap: vars.gap
|
|
23
|
+
gap: vars.gap
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
export const vertical = style({
|
|
27
|
-
flexDirection:
|
|
27
|
+
flexDirection: 'column'
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
export const block = style({
|
|
31
|
-
display:
|
|
32
|
-
alignItems:
|
|
31
|
+
display: 'flex',
|
|
32
|
+
alignItems: 'stretch'
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
globalStyle(`${base}${block} > ${button}`, {
|
|
36
|
-
flex: 1
|
|
37
|
-
});
|
|
36
|
+
flex: 1
|
|
37
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './RadioButtonGroup.css';
|
|
1
|
+
export * from './RadioButtonGroup.css';
|
|
@@ -1,11 +1,12 @@
|
|
|
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 interface RadioButtonGroupState {
|
|
5
|
-
size: Size
|
|
6
|
-
name: string
|
|
7
|
-
modelValue: string | number
|
|
8
|
-
doUpdateValue: (value: string | number) => void
|
|
5
|
+
size: Size;
|
|
6
|
+
name: string;
|
|
7
|
+
modelValue: string | number;
|
|
8
|
+
doUpdateValue: (value: string | number) => void;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export const RADIO_BUTTON_GROUP_STATE: InjectionKey<RadioButtonGroupState> =
|
|
11
|
+
export const RADIO_BUTTON_GROUP_STATE: InjectionKey<RadioButtonGroupState> =
|
|
12
|
+
Symbol('RADIO_BUTTON_GROUP_STATE');
|