File tree Expand file tree Collapse file tree 4 files changed +58
-4
lines changed
Expand file tree Collapse file tree 4 files changed +58
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @sysvale/cuida" ,
3- "version" : " 3.74.0 " ,
3+ "version" : " 3.74.1 " ,
44 "description" : " A design system built by Sysvale, using storybook and Vue components" ,
55 "repository" : {
66 "type" : " git" ,
Original file line number Diff line number Diff line change 33 class =" radio__button"
44 :style =" cssVars"
55 >
6+ <div class =" radio-button__label" >
7+ <span >{{ label }}</span >
8+
9+ <span
10+ v-if =" required && label"
11+ class =" radio-button__required"
12+ >
13+ *
14+ </span >
15+ </div >
16+
617 <div
718 :class =" {'button-group': inline }"
819 >
@@ -58,6 +69,20 @@ export default {
5869 default: null ,
5970 required: true ,
6071 },
72+ /**
73+ * Especifica o título do grupo de radio buttons
74+ */
75+ label: {
76+ type: String ,
77+ default: ' Label' ,
78+ },
79+ /**
80+ * Especifica se o grupo de radio buttons é obrigatório
81+ */
82+ required: {
83+ type: Boolean ,
84+ default: false ,
85+ },
6186 /**
6287 * O número de radio buttons a ser renderizado no grupo
6388 */
@@ -211,6 +236,16 @@ export default {
211236 gap : 20px ;
212237 margin : mb (2 );
213238
239+ & __label {
240+ @include label ;
241+ margin : mb (3 );
242+ color : $n-700 ;
243+ }
244+
245+ & __required {
246+ color : $rc-600 ;
247+ }
248+
214249 & __container--vertical {
215250 margin : mr (4 );
216251 & :last-child {
Original file line number Diff line number Diff line change @@ -70,8 +70,8 @@ export const Template = (args) => ({
7070- Houver 4 ou mais opções. Prefira Dropdowns nesses casos.
7171
7272## Obs.:
73- - Você pode disabilitar cada um dos radio buttons passando a propriedade ``` disable: true ``` , no respectivo objeto
74- no array de opções. Caso você queira disabilitar todo o grupo, você pode setar a prop ``` disabled ``` como true no componente.
73+ - Você pode desabilitar cada um dos radio buttons passando a propriedade ``` disable: true ``` , no respectivo objeto
74+ no array de opções. Caso você queira desabilitar todo o grupo, você pode setar a prop ``` disabled ``` como true no componente.
7575
7676<br />
7777
@@ -104,6 +104,7 @@ export const options = [
104104 disabled: false ,
105105 variant: ' green' ,
106106 inline: false ,
107+ label: ' Label'
107108 }}
108109 >
109110 { Template .bind ({}) }
Original file line number Diff line number Diff line change 11// Vitest Snapshot v1
22
3- exports[`RadioButtonGroup > renders correctly 1`] = `"<span data-v-575576ed=\\"\\" class=\\"radio__button\\" style=\\"--border-color-selected: #377EE1; --background-color: #f6f9fe; --display-vertical: inline-flex;\\" id=\\"radio-button\\" value=\\"\\"><div data-v-575576ed=\\"\\" class=\\"\\"><div data-v-575576ed=\\"\\" class=\\"\\" style=\\"\\"><label data-v-575576ed=\\"\\" class=\\"radio-button\\" disabled=\\"true\\" for=\\"radio-button-value1\\"><input data-v-575576ed=\\"\\" id=\\"radio-button-value1\\" type=\\"radio\\" disabled=\\"\\" value=\\"value1\\"><label data-v-575576ed=\\"\\" class=\\"radio-button__content\\" for=\\"radio-button-value1\\"><div data-v-575576ed=\\"\\" class=\\"content-title\\">Component1</div><!--v-if--></label></label></div><div data-v-575576ed=\\"\\" class=\\"\\" style=\\"\\"><label data-v-575576ed=\\"\\" class=\\"radio-button\\" disabled=\\"false\\" for=\\"radio-button-value2\\"><input data-v-575576ed=\\"\\" id=\\"radio-button-value2\\" type=\\"radio\\" value=\\"value2\\"><label data-v-575576ed=\\"\\" class=\\"radio-button__content\\" for=\\"radio-button-value2\\"><div data-v-575576ed=\\"\\" class=\\"content-title\\">Component2</div><!--v-if--></label></label></div><div data-v-575576ed=\\"\\" class=\\"\\" style=\\"\\"><label data-v-575576ed=\\"\\" class=\\"radio-button\\" disabled=\\"false\\" for=\\"radio-button-value3\\"><input data-v-575576ed=\\"\\" id=\\"radio-button-value3\\" type=\\"radio\\" value=\\"value3\\"><label data-v-575576ed=\\"\\" class=\\"radio-button__content\\" for=\\"radio-button-value3\\"><div data-v-575576ed=\\"\\" class=\\"content-title\\">Component3</div><!--v-if--></label></label></div></div></span>"`;
3+ exports [` RadioButtonGroup > renders correctly 1` ] = `
4+ "<span data-v-575576ed =\\"\\" class =\\"radio__button\\" style =\\"--border-color-selected: #377EE1; --background-color: #f6f9fe; --display-vertical: inline-flex;\\" id =\\"radio-button\\" value =\\"\\"><div data-v-575576ed =\\"\\" class =\\"radio-button__label\\"><span data-v-575576ed =\\"\\">Label</span>
5+ <!--v-if-->
6+ </div>
7+ <div data-v-575576ed =\\"\\" class =\\"\\">
8+ <div data-v-575576ed =\\"\\" class =\\"\\" style =\\"\\"><label data-v-575576ed =\\"\\" class =\\"radio-button\\" disabled =\\"true\\" for =\\"radio-button-value1\\"><input data-v-575576ed =\\"\\" id =\\"radio-button-value1\\" type =\\"radio\\" disabled =\\"\\" value =\\"value1\\"><label data-v-575576ed =\\"\\" class =\\"radio-button__content\\" for =\\"radio-button-value1\\">
9+ <div data-v-575576ed =\\"\\" class =\\"content-title\\">Component1</div>
10+ <!--v-if-->
11+ </label></label></div>
12+ <div data-v-575576ed =\\"\\" class =\\"\\" style =\\"\\"><label data-v-575576ed =\\"\\" class =\\"radio-button\\" disabled =\\"false\\" for =\\"radio-button-value2\\"><input data-v-575576ed =\\"\\" id =\\"radio-button-value2\\" type =\\"radio\\" value =\\"value2\\"><label data-v-575576ed =\\"\\" class =\\"radio-button__content\\" for =\\"radio-button-value2\\">
13+ <div data-v-575576ed =\\"\\" class =\\"content-title\\">Component2</div>
14+ <!--v-if-->
15+ </label></label></div>
16+ <div data-v-575576ed =\\"\\" class =\\"\\" style =\\"\\"><label data-v-575576ed =\\"\\" class =\\"radio-button\\" disabled =\\"false\\" for =\\"radio-button-value3\\"><input data-v-575576ed =\\"\\" id =\\"radio-button-value3\\" type =\\"radio\\" value =\\"value3\\"><label data-v-575576ed =\\"\\" class =\\"radio-button__content\\" for =\\"radio-button-value3\\">
17+ <div data-v-575576ed =\\"\\" class =\\"content-title\\">Component3</div>
18+ <!--v-if-->
19+ </label></label></div>
20+ </div></span>"
21+ `;
You can’t perform that action at this time.
0 commit comments