File tree Expand file tree Collapse file tree 2 files changed +43
-4
lines changed Expand file tree Collapse file tree 2 files changed +43
-4
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ function focus() {
111
111
</script >
112
112
113
113
<template >
114
- <div >
115
- <div class =" mb-2 text-sm " >
114
+ <div class = " text-sm " >
115
+ <div class =" mb-2" >
116
116
<NeFormItemLabel class =" mb-0" >
117
117
{{ label }}
118
118
<span v-if =" $slots.tooltip" class =" ml-1" >
@@ -122,6 +122,7 @@ function focus() {
122
122
<p v-if =" description" class =" text-gray-500 dark:text-gray-400" >{{ description }}</p >
123
123
</div >
124
124
<div v-if =" card" :class =" gridStyle" class =" grid" >
125
+ <!-- card layout -->
125
126
<button
126
127
v-for =" option in options"
127
128
:key =" option.id"
@@ -161,6 +162,7 @@ function focus() {
161
162
</button >
162
163
</div >
163
164
<template v-else >
165
+ <!-- standard layout -->
164
166
<fieldset >
165
167
<legend class =" sr-only" >{{ label }}</legend >
166
168
<div class =" space-y-3" >
@@ -178,9 +180,12 @@ function focus() {
178
180
<label
179
181
:for =" option.id"
180
182
:disabled =" option.disabled"
181
- class =" ml -2 text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-50 dark:text-gray-50"
183
+ class =" ms -2 text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-50 dark:text-gray-50"
182
184
>
183
- {{ option.label }}
185
+ <div >{{ option.label }}</div >
186
+ <div v-if =" option.description" class =" text-gray-500 dark:text-gray-400" >
187
+ {{ option.description }}
188
+ </div >
184
189
</label >
185
190
</div >
186
191
</div >
Original file line number Diff line number Diff line change @@ -193,3 +193,37 @@ export const WithSlot: StoryObj<typeof NeRadioSelection> = {
193
193
gridStyle : 'grid-cols-3 gap-3'
194
194
}
195
195
}
196
+
197
+ const template = '<NeRadioSelection v-bind="args" />'
198
+
199
+ export const OptionsWithDescription : StoryObj < typeof NeRadioSelection > = {
200
+ render : ( args ) => ( {
201
+ components : { NeRadioSelection } ,
202
+ setup ( ) {
203
+ return { args }
204
+ } ,
205
+ template : template
206
+ } ) ,
207
+ args : {
208
+ options : [
209
+ {
210
+ id : '1' ,
211
+ label : 'Choose 1' ,
212
+ description : 'Lorem ipsum dolor sit amet, consectetur adipisci elit'
213
+ } ,
214
+ {
215
+ id : '2' ,
216
+ label : 'Choose 2' ,
217
+ description :
218
+ 'Lorem ipsum dolor sit amet, consectetur adipisci elit, sed do eiusmod tempor incidunt'
219
+ } ,
220
+ {
221
+ id : '3' ,
222
+ label : 'Choose 3' ,
223
+ disabled : true ,
224
+ description :
225
+ 'Lorem ipsum dolor sit amet, consectetur adipisci elit, sed do eiusmod tempor incidunt ut labore et dolore magna aliqua'
226
+ }
227
+ ]
228
+ }
229
+ }
You can’t perform that action at this time.
0 commit comments