@teammodlr/ui-kit 2.3.22 → 3.0.0-beta.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/avatar/Avatar.vue.d.ts +2 -2
- package/lib/components/badge/style/Badge.css.d.ts +2 -2
- package/lib/components/button/Button.vue.d.ts +7 -4
- package/lib/components/button/style/Button.css.d.ts +3 -3
- package/lib/components/cardcontextmenu/CardContextMenu.vue.d.ts +5 -8
- package/lib/components/cardcontextmenu/CardContextMenuItem.vue.d.ts +11 -2
- package/lib/components/cardcontextmenu/CardContextMenuTriggerProvider.vue.d.ts +2 -0
- package/lib/components/cardcontextmenu/style/Dropdown.css.d.ts +2 -1
- package/lib/components/cardcontextmenu/symbol.d.ts +1 -0
- package/lib/components/checkbox/Checkbox.vue.d.ts +15 -4
- package/lib/components/collapse/CollapseItem.vue.d.ts +3 -2
- package/lib/components/colorpicker/ColorPicker.vue.d.ts +8 -9
- package/lib/components/confirm/Confirm.vue.d.ts +9 -0
- package/lib/components/confirm/props.d.ts +4 -0
- package/lib/components/dialog/Dialog.vue.d.ts +13 -5
- package/lib/components/dialogprovider/DialogProvider.vue.d.ts +1 -0
- package/lib/components/dialogprovider/types.d.ts +1 -0
- package/lib/components/dropdown/Dropdown.vue.d.ts +3 -1
- package/lib/components/dropdown/DropdownItem.vue.d.ts +11 -1
- package/lib/components/dropdown/DropdownSeperator.vue.d.ts +1 -0
- package/lib/components/dropdown/DropdownTriggerProvider.vue.d.ts +2 -0
- package/lib/components/dropdown/style/Dropdown.css.d.ts +2 -1
- package/lib/components/dropdown/symbol.d.ts +2 -0
- package/lib/components/image/Image.vue.d.ts +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/messageprovider/Message.vue.d.ts +1 -1
- package/lib/components/messageprovider/MessageProvider.vue.d.ts +24 -24
- package/lib/components/messageprovider/style/Message.css.d.ts +1 -1
- package/lib/components/messageprovider/style/Toaster.css.d.ts +1 -0
- package/lib/components/messageprovider/types.d.ts +5 -0
- package/lib/components/modal/Modal.vue.d.ts +18 -6
- package/lib/components/popover/Popover.vue.d.ts +113 -0
- package/lib/components/popover/style/Popover.css.d.ts +4 -0
- package/lib/components/popover/style/index.d.ts +1 -0
- package/lib/components/radio/Radio.vue.d.ts +2 -0
- package/lib/components/radiobuttongroup/RadioButtonGroup.vue.d.ts +1 -0
- package/lib/components/select/Select.vue.d.ts +23 -11
- package/lib/components/select/style/Select.css.d.ts +2 -0
- package/lib/components/switch/Switch.vue.d.ts +2 -0
- package/lib/components/tab/Tab.vue.d.ts +5 -2
- package/lib/components/tab/TabGroup.vue.d.ts +8 -3
- package/lib/components/textarea/Textarea.vue.d.ts +2 -1
- package/lib/components/tooltip/Tooltip.vue.d.ts +5 -20
- package/lib/components/tooltip/TooltipTrigger.vue.d.ts +1 -10
- package/lib/components/tree/Tree.vue.d.ts +3 -3
- package/lib/components/tree/TreeNode.vue.d.ts +26 -12
- package/lib/components/tree/types.d.ts +5 -5
- package/lib/index.cjs.js +5 -14
- package/lib/index.es.js +14813 -10079
- package/lib/style.css +1 -1
- package/package.json +12 -6
- package/src/components/avatar/Avatar.vue +32 -24
- package/src/components/button/Button.vue +24 -5
- package/src/components/cardcontextmenu/CardContextMenu.vue +68 -95
- package/src/components/cardcontextmenu/CardContextMenuItem.vue +40 -50
- package/src/components/cardcontextmenu/CardContextMenuSeperator.vue +9 -7
- package/src/components/cardcontextmenu/CardContextMenuTriggerProvider.vue +15 -0
- package/src/components/cardcontextmenu/style/Dropdown.css.ts +155 -2
- package/src/components/cardcontextmenu/symbol.ts +3 -0
- package/src/components/checkbox/Checkbox.vue +37 -12
- package/src/components/checkbox/style/Checkbox.css.ts +6 -6
- package/src/components/collapse/CollapseItem.vue +46 -21
- package/src/components/collapse/style/Collapse.css.ts +5 -1
- package/src/components/colorpicker/ColorPicker.vue +76 -45
- package/src/components/confirm/Confirm.vue +15 -8
- package/src/components/confirm/props.ts +4 -0
- package/src/components/dialog/Dialog.vue +183 -37
- package/src/components/dialog/style/Dialog.css.ts +15 -1
- package/src/components/dialogprovider/types.ts +1 -0
- package/src/components/dropdown/Dropdown.vue +46 -3
- package/src/components/dropdown/DropdownItem.vue +55 -25
- package/src/components/dropdown/DropdownSeperator.vue +19 -11
- package/src/components/dropdown/DropdownTriggerProvider.vue +15 -0
- package/src/components/dropdown/examples/context.vue +2 -2
- package/src/components/dropdown/style/Dropdown.css.ts +173 -4
- package/src/components/dropdown/symbol.ts +4 -0
- package/src/components/form/examples/basic.vue +19 -8
- package/src/components/index.ts +1 -0
- package/src/components/messageprovider/MessageProvider.vue +139 -90
- package/src/components/messageprovider/examples/basic.vue +3 -1
- package/src/components/messageprovider/examples/index.stories.ts +37 -1
- package/src/components/messageprovider/style/Toaster.css.ts +24 -0
- package/src/components/messageprovider/types.ts +10 -0
- package/src/components/modal/Modal.vue +142 -67
- package/src/components/modal/style/Modal.css.ts +26 -2
- package/src/components/popover/Popover.vue +155 -0
- package/src/components/popover/examples/arrow.vue +47 -0
- package/src/components/popover/examples/basic.vue +15 -0
- package/src/components/popover/examples/index.stories.ts +19 -0
- package/src/components/popover/examples/index.ts +4 -0
- package/src/components/popover/examples/placement.vue +59 -0
- package/src/components/popover/examples/variant.vue +30 -0
- package/src/components/popover/style/Popover.css.ts +203 -0
- package/src/components/popover/style/index.ts +1 -0
- package/src/components/radio/Radio.vue +31 -17
- package/src/components/radiobutton/RadioButton.vue +15 -2
- package/src/components/radiobuttongroup/RadioButtonGroup.vue +11 -4
- package/src/components/select/Select.vue +309 -148
- package/src/components/select/examples/basic.vue +1 -1
- package/src/components/select/style/Select.css.ts +15 -0
- package/src/components/slider/Slider.vue +1 -1
- package/src/components/switch/Switch.vue +30 -10
- package/src/components/switch/style/Switch.css.ts +3 -5
- package/src/components/tab/Tab.vue +29 -20
- package/src/components/tab/TabGroup.vue +29 -38
- package/src/components/textarea/Textarea.vue +8 -4
- package/src/components/tooltip/Tooltip.vue +52 -141
- package/src/components/tooltip/TooltipTrigger.vue +14 -17
- package/src/components/tooltip/style/Tooltip.css.ts +148 -29
- package/src/components/tree/Tree.vue +138 -100
- package/src/components/tree/TreeNode.vue +105 -98
- package/src/components/tree/types.ts +4 -4
- package/src/styles/transitions.css.ts +36 -16
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="padding: 100px; display: flex; gap: 16px;">
|
|
3
|
+
<MPopover>
|
|
4
|
+
<MButton>Light (Default)</MButton>
|
|
5
|
+
<template #content>
|
|
6
|
+
<div style="padding: 8px; min-width: 150px;">
|
|
7
|
+
<p style="margin: 0; font-size: 14px;">Light popover content</p>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
</MPopover>
|
|
11
|
+
|
|
12
|
+
<MPopover variant="dark">
|
|
13
|
+
<MButton variant="dark">Dark</MButton>
|
|
14
|
+
<template #content>
|
|
15
|
+
<div style="padding: 8px; min-width: 150px;">
|
|
16
|
+
<p style="margin: 0; font-size: 14px;">Dark popover content</p>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
</MPopover>
|
|
20
|
+
|
|
21
|
+
<MPopover variant="dark" arrow placement="bottom">
|
|
22
|
+
<MButton variant="dark">Dark with Arrow</MButton>
|
|
23
|
+
<template #content>
|
|
24
|
+
<div style="padding: 8px; min-width: 150px;">
|
|
25
|
+
<p style="margin: 0; font-size: 14px;">Dark popover with arrow</p>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
</MPopover>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { globalKeyframes, globalStyle, style } from '@vanilla-extract/css';
|
|
2
|
+
import { themeVars } from '../../../styles/theme.css';
|
|
3
|
+
|
|
4
|
+
const menuFadeOutAnimation = 'popover-fade-out';
|
|
5
|
+
globalKeyframes(menuFadeOutAnimation, {
|
|
6
|
+
from: {
|
|
7
|
+
opacity: 1
|
|
8
|
+
},
|
|
9
|
+
to: {
|
|
10
|
+
opacity: 0
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const menuSlideFadeOutTopAnimation = 'popover-slide-fade-out-top';
|
|
15
|
+
globalKeyframes(menuSlideFadeOutTopAnimation, {
|
|
16
|
+
from: {
|
|
17
|
+
opacity: 1,
|
|
18
|
+
transform: 'translateY(0) scale(1)'
|
|
19
|
+
},
|
|
20
|
+
to: {
|
|
21
|
+
opacity: 0,
|
|
22
|
+
transform: 'translateY(6px) scale(0.98)'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const menuSlideFadeOutBottomAnimation = 'popover-slide-fade-out-bottom';
|
|
27
|
+
globalKeyframes(menuSlideFadeOutBottomAnimation, {
|
|
28
|
+
from: {
|
|
29
|
+
opacity: 1,
|
|
30
|
+
transform: 'translateY(0) scale(1)'
|
|
31
|
+
},
|
|
32
|
+
to: {
|
|
33
|
+
opacity: 0,
|
|
34
|
+
transform: 'translateY(-6px) scale(0.98)'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const menuSlideFadeOutLeftAnimation = 'popover-slide-fade-out-left';
|
|
39
|
+
globalKeyframes(menuSlideFadeOutLeftAnimation, {
|
|
40
|
+
from: {
|
|
41
|
+
opacity: 1,
|
|
42
|
+
transform: 'translateX(0) scale(1)'
|
|
43
|
+
},
|
|
44
|
+
to: {
|
|
45
|
+
opacity: 0,
|
|
46
|
+
transform: 'translateX(6px) scale(0.98)'
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const menuSlideFadeOutRightAnimation = 'popover-slide-fade-out-right';
|
|
51
|
+
globalKeyframes(menuSlideFadeOutRightAnimation, {
|
|
52
|
+
from: {
|
|
53
|
+
opacity: 1,
|
|
54
|
+
transform: 'translateX(0) scale(1)'
|
|
55
|
+
},
|
|
56
|
+
to: {
|
|
57
|
+
opacity: 0,
|
|
58
|
+
transform: 'translateX(-6px) scale(0.98)'
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const menuSlideFadeTopAnimation = 'popover-slide-fade-top';
|
|
63
|
+
globalKeyframes(menuSlideFadeTopAnimation, {
|
|
64
|
+
from: {
|
|
65
|
+
opacity: 0,
|
|
66
|
+
transform: 'translateY(6px) scale(0.98)'
|
|
67
|
+
},
|
|
68
|
+
to: {
|
|
69
|
+
opacity: 1,
|
|
70
|
+
transform: 'translateY(0) scale(1)'
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const menuSlideFadeBottomAnimation = 'popover-slide-fade-bottom';
|
|
75
|
+
globalKeyframes(menuSlideFadeBottomAnimation, {
|
|
76
|
+
from: {
|
|
77
|
+
opacity: 0,
|
|
78
|
+
transform: 'translateY(-6px) scale(0.98)'
|
|
79
|
+
},
|
|
80
|
+
to: {
|
|
81
|
+
opacity: 1,
|
|
82
|
+
transform: 'translateY(0) scale(1)'
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const menuSlideFadeLeftAnimation = 'popover-slide-fade-left';
|
|
87
|
+
globalKeyframes(menuSlideFadeLeftAnimation, {
|
|
88
|
+
from: {
|
|
89
|
+
opacity: 0,
|
|
90
|
+
transform: 'translateX(6px) scale(0.98)'
|
|
91
|
+
},
|
|
92
|
+
to: {
|
|
93
|
+
opacity: 1,
|
|
94
|
+
transform: 'translateX(0) scale(1)'
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const menuSlideFadeRightAnimation = 'popover-slide-fade-right';
|
|
99
|
+
globalKeyframes(menuSlideFadeRightAnimation, {
|
|
100
|
+
from: {
|
|
101
|
+
opacity: 0,
|
|
102
|
+
transform: 'translateX(-6px) scale(0.98)'
|
|
103
|
+
},
|
|
104
|
+
to: {
|
|
105
|
+
opacity: 1,
|
|
106
|
+
transform: 'translateX(0) scale(1)'
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export const content = style({
|
|
111
|
+
backgroundColor: '#ffffff',
|
|
112
|
+
borderRadius: '5px',
|
|
113
|
+
padding: '5px',
|
|
114
|
+
zIndex: 4000,
|
|
115
|
+
boxSizing: 'border-box',
|
|
116
|
+
position: 'relative',
|
|
117
|
+
minWidth: '130px',
|
|
118
|
+
maxWidth: '350px',
|
|
119
|
+
border: `1px solid ${themeVars.color.gray[300]}`,
|
|
120
|
+
boxShadow: themeVars.shadow.md,
|
|
121
|
+
transformOrigin: 'var(--reka-popover-content-transform-origin)',
|
|
122
|
+
willChange: 'transform, opacity',
|
|
123
|
+
outline: 'none',
|
|
124
|
+
selectors: {
|
|
125
|
+
'&[data-state="open"]': {
|
|
126
|
+
animationDuration: '0.16s',
|
|
127
|
+
animationTimingFunction: 'cubic-bezier(0.16, 1, 0.3, 1)',
|
|
128
|
+
animationFillMode: 'both'
|
|
129
|
+
},
|
|
130
|
+
'&[data-state="closed"]': {
|
|
131
|
+
animationDuration: '0.12s',
|
|
132
|
+
animationTimingFunction: 'ease-out',
|
|
133
|
+
animationFillMode: 'both'
|
|
134
|
+
},
|
|
135
|
+
'&[data-state="closed"][data-side="top"]': {
|
|
136
|
+
animationName: menuSlideFadeOutTopAnimation
|
|
137
|
+
},
|
|
138
|
+
'&[data-state="closed"][data-side="bottom"]': {
|
|
139
|
+
animationName: menuSlideFadeOutBottomAnimation
|
|
140
|
+
},
|
|
141
|
+
'&[data-state="closed"][data-side="left"]': {
|
|
142
|
+
animationName: menuSlideFadeOutLeftAnimation
|
|
143
|
+
},
|
|
144
|
+
'&[data-state="closed"][data-side="right"]': {
|
|
145
|
+
animationName: menuSlideFadeOutRightAnimation
|
|
146
|
+
},
|
|
147
|
+
'&[data-state="open"][data-side="top"]': {
|
|
148
|
+
animationName: menuSlideFadeTopAnimation
|
|
149
|
+
},
|
|
150
|
+
'&[data-state="open"][data-side="bottom"]': {
|
|
151
|
+
animationName: menuSlideFadeBottomAnimation
|
|
152
|
+
},
|
|
153
|
+
'&[data-state="open"][data-side="left"]': {
|
|
154
|
+
animationName: menuSlideFadeLeftAnimation
|
|
155
|
+
},
|
|
156
|
+
'&[data-state="open"][data-side="right"]': {
|
|
157
|
+
animationName: menuSlideFadeRightAnimation
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
export const arrow = style({
|
|
163
|
+
fill: '#ffffff'
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
globalStyle(`${arrow} path`, {
|
|
167
|
+
fill: '#ffffff',
|
|
168
|
+
stroke: themeVars.color.gray[300],
|
|
169
|
+
strokeWidth: '1px'
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
export const dark = style({
|
|
173
|
+
backgroundColor: themeVars.color.gray[900],
|
|
174
|
+
border: `1px solid ${themeVars.color.gray[800]}`,
|
|
175
|
+
color: themeVars.color.gray[100]
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
globalStyle(`${dark} ${arrow}`, {
|
|
179
|
+
fill: themeVars.color.gray[900]
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
globalStyle(`${dark} ${arrow} path`, {
|
|
183
|
+
fill: themeVars.color.gray[900],
|
|
184
|
+
stroke: themeVars.color.gray[800]
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
export const close = style({
|
|
188
|
+
position: 'absolute',
|
|
189
|
+
top: themeVars.space[2],
|
|
190
|
+
right: themeVars.space[2],
|
|
191
|
+
display: 'flex',
|
|
192
|
+
alignItems: 'center',
|
|
193
|
+
justifyContent: 'center',
|
|
194
|
+
width: '20px',
|
|
195
|
+
height: '20px',
|
|
196
|
+
borderRadius: themeVars.rounded.default,
|
|
197
|
+
cursor: 'pointer',
|
|
198
|
+
color: themeVars.color.font.muted,
|
|
199
|
+
':hover': {
|
|
200
|
+
backgroundColor: themeVars.color.gray[100],
|
|
201
|
+
color: themeVars.color.font.text
|
|
202
|
+
}
|
|
203
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Popover.css';
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<label :class="style.base">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<span :class="classes"></span>
|
|
3
|
+
<RadioGroupRoot v-model="pick" :name="name" :disabled="disabled || loading">
|
|
4
|
+
<RadioGroupItem
|
|
5
|
+
:value="value"
|
|
6
|
+
:id="id"
|
|
7
|
+
:disabled="disabled || loading"
|
|
8
|
+
:aria-checked="checked ? 'true' : 'false'"
|
|
9
|
+
:aria-disabled="(disabled || loading) ? 'true' : 'false'"
|
|
10
|
+
:aria-labelledby="`${id}-label`"
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
:class="classes"
|
|
13
|
+
@blur="onBlur"
|
|
14
|
+
@focus="onFocus"
|
|
15
|
+
/>
|
|
16
|
+
</RadioGroupRoot>
|
|
18
17
|
<span :class="style.label" :id="`${id}-label`">
|
|
19
18
|
<template v-if="hasSlot">
|
|
20
19
|
<slot/>
|
|
@@ -29,6 +28,7 @@
|
|
|
29
28
|
|
|
30
29
|
<script lang="ts">
|
|
31
30
|
import type {PropType} from 'vue';
|
|
31
|
+
import { RadioGroupItem, RadioGroupRoot } from 'reka-ui';
|
|
32
32
|
import {computed, defineComponent, ref, toRef} from 'vue';
|
|
33
33
|
import {useInput} from '../../composables/useInput';
|
|
34
34
|
import {useInteractive} from "../../composables/useInteractive";
|
|
@@ -37,6 +37,10 @@ import * as style from './style';
|
|
|
37
37
|
|
|
38
38
|
export default defineComponent({
|
|
39
39
|
name: "Radio",
|
|
40
|
+
components: {
|
|
41
|
+
RadioGroupItem,
|
|
42
|
+
RadioGroupRoot
|
|
43
|
+
},
|
|
40
44
|
emits: useInput.emits(),
|
|
41
45
|
props: {
|
|
42
46
|
...useInput.props(),
|
|
@@ -76,7 +80,7 @@ export default defineComponent({
|
|
|
76
80
|
formDisabled,
|
|
77
81
|
formLoading,
|
|
78
82
|
inputListeners
|
|
79
|
-
} = useInput(props, {focus, emit});
|
|
83
|
+
} = useInput(props, {focus, emit, withListeners: false});
|
|
80
84
|
|
|
81
85
|
const disabled = computed(() => formDisabled || formLoading || props.disabled || props.loading);
|
|
82
86
|
const name = toRef(props, 'name');
|
|
@@ -106,6 +110,14 @@ export default defineComponent({
|
|
|
106
110
|
return formError.value || props.error;
|
|
107
111
|
});
|
|
108
112
|
|
|
113
|
+
function onFocus(event: FocusEvent) {
|
|
114
|
+
emit('focus', event);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function onBlur(event: FocusEvent) {
|
|
118
|
+
emit('blur', event);
|
|
119
|
+
}
|
|
120
|
+
|
|
109
121
|
expose({
|
|
110
122
|
focus,
|
|
111
123
|
blur,
|
|
@@ -129,7 +141,9 @@ export default defineComponent({
|
|
|
129
141
|
hasSlot,
|
|
130
142
|
inputListeners,
|
|
131
143
|
focus,
|
|
132
|
-
blur
|
|
144
|
+
blur,
|
|
145
|
+
onFocus,
|
|
146
|
+
onBlur
|
|
133
147
|
}
|
|
134
148
|
}
|
|
135
149
|
})
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<RadioGroupItem
|
|
3
|
+
:class="computedClasses"
|
|
4
|
+
:disabled="disabled"
|
|
5
|
+
:value="id"
|
|
6
|
+
:name="name"
|
|
7
|
+
v-bind="$attrs"
|
|
8
|
+
:aria-selected="selected"
|
|
9
|
+
:aria-disabled="disabled"
|
|
10
|
+
@click="handleClick"
|
|
11
|
+
>
|
|
3
12
|
<input type="radio" :class="computedRadioClasses" :name="name" :value="id" :disabled="disabled">
|
|
4
13
|
<span>
|
|
5
14
|
<slot />
|
|
6
15
|
</span>
|
|
7
|
-
</
|
|
16
|
+
</RadioGroupItem>
|
|
8
17
|
</template>
|
|
9
18
|
|
|
10
19
|
<script lang="ts">
|
|
11
20
|
import type {PropType} from "vue";
|
|
21
|
+
import { RadioGroupItem } from 'reka-ui';
|
|
12
22
|
import {computed, defineComponent, inject, ref } from "vue";
|
|
13
23
|
import type {Size} from "../../types/props";
|
|
14
24
|
import * as style from "./style";
|
|
@@ -18,6 +28,9 @@ import {RADIO_BUTTON_GROUP_STATE} from "../radiobuttongroup/symbol";
|
|
|
18
28
|
|
|
19
29
|
export default defineComponent({
|
|
20
30
|
name: "MRadioButton",
|
|
31
|
+
components: {
|
|
32
|
+
RadioGroupItem
|
|
33
|
+
},
|
|
21
34
|
props: {
|
|
22
35
|
...useInput.props(),
|
|
23
36
|
...useInteractive.props(),
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<RadioGroupRoot
|
|
3
|
+
v-model="selectedValue"
|
|
4
|
+
:name="name"
|
|
3
5
|
:class="computedClasses"
|
|
4
6
|
>
|
|
5
7
|
<slot/>
|
|
6
|
-
</
|
|
8
|
+
</RadioGroupRoot>
|
|
7
9
|
</template>
|
|
8
10
|
|
|
9
11
|
<script lang="ts">
|
|
12
|
+
import { RadioGroupRoot } from 'reka-ui';
|
|
10
13
|
import {computed, defineComponent, type PropType, provide, reactive, toRef} from "vue";
|
|
11
14
|
import type {Size} from '../../types/props';
|
|
12
15
|
import * as style from "./style";
|
|
@@ -15,6 +18,9 @@ import {RADIO_BUTTON_GROUP_STATE} from "./symbol";
|
|
|
15
18
|
|
|
16
19
|
export default defineComponent({
|
|
17
20
|
name: "MRadioButtonGroup",
|
|
21
|
+
components: {
|
|
22
|
+
RadioGroupRoot
|
|
23
|
+
},
|
|
18
24
|
props: {
|
|
19
25
|
modelValue: {
|
|
20
26
|
type: [String, Number],
|
|
@@ -68,8 +74,9 @@ export default defineComponent({
|
|
|
68
74
|
})
|
|
69
75
|
|
|
70
76
|
return {
|
|
71
|
-
computedClasses
|
|
77
|
+
computedClasses,
|
|
78
|
+
selectedValue
|
|
72
79
|
}
|
|
73
80
|
}
|
|
74
81
|
});
|
|
75
|
-
</script>
|
|
82
|
+
</script>
|