@@ -46,11 +46,18 @@ export const SimpleArray: Story = {
4646    components : {  Select } , 
4747    setup ( )  { 
4848      const  value  =  ref ( null ) ; 
49+ 
4950      return  {  args,  value } ; 
5051    } , 
5152    template : ` 
5253      <div class="space-y-4"> 
53-         <Select v-model="value" v-bind="args" /> 
54+         <Select  
55+           v-model="value"  
56+           :items="args.items" 
57+           :placeholder="args.placeholder" 
58+           :valueKey="args.valueKey" 
59+           :labelKey="args.labelKey" 
60+         /> 
5461        <p class="text-sm text-muted-foreground">Selected: {{ value }}</p> 
5562        <p class="text-sm">Items: {{ args.items }}</p> 
5663      </div> 
@@ -63,6 +70,26 @@ export const SimpleArray: Story = {
6370} ; 
6471
6572export  const  ObjectArray : Story  =  { 
73+   render : ( args )  =>  ( { 
74+     components : {  Select } , 
75+     setup ( )  { 
76+       const  value  =  ref ( null ) ; 
77+ 
78+       return  {  args,  value } ; 
79+     } , 
80+     template : ` 
81+       <div class="space-y-4"> 
82+         <Select  
83+           v-model="value"  
84+           :items="args.items" 
85+           :placeholder="args.placeholder" 
86+           :valueKey="args.valueKey" 
87+           :labelKey="args.labelKey" 
88+         /> 
89+         <p class="text-sm text-muted-foreground">Selected: {{ value }}</p> 
90+       </div> 
91+     ` , 
92+   } ) , 
6693  args : { 
6794    placeholder : 'Select a color' , 
6895    items : [ 
@@ -76,6 +103,26 @@ export const ObjectArray: Story = {
76103} ; 
77104
78105export  const  GroupedItems : Story  =  { 
106+   render : ( args )  =>  ( { 
107+     components : {  Select } , 
108+     setup ( )  { 
109+       const  value  =  ref ( null ) ; 
110+ 
111+       return  {  args,  value } ; 
112+     } , 
113+     template : ` 
114+       <div class="space-y-4"> 
115+         <Select  
116+           v-model="value"  
117+           :items="args.items" 
118+           :placeholder="args.placeholder" 
119+           :valueKey="args.valueKey" 
120+           :labelKey="args.labelKey" 
121+         /> 
122+         <p class="text-sm text-muted-foreground">Selected: {{ value }}</p> 
123+       </div> 
124+     ` , 
125+   } ) , 
79126  args : { 
80127    placeholder : 'Select food' , 
81128    items : [ 
@@ -96,6 +143,26 @@ export const GroupedItems: Story = {
96143} ; 
97144
98145export  const  WithDisabledItems : Story  =  { 
146+   render : ( args )  =>  ( { 
147+     components : {  Select } , 
148+     setup ( )  { 
149+       const  value  =  ref ( null ) ; 
150+ 
151+       return  {  args,  value } ; 
152+     } , 
153+     template : ` 
154+       <div class="space-y-4"> 
155+         <Select  
156+           v-model="value"  
157+           :items="args.items" 
158+           :placeholder="args.placeholder" 
159+           :valueKey="args.valueKey" 
160+           :labelKey="args.labelKey" 
161+         /> 
162+         <p class="text-sm text-muted-foreground">Selected: {{ value }}</p> 
163+       </div> 
164+     ` , 
165+   } ) , 
99166  args : { 
100167    placeholder : 'Select an option' , 
101168    items : [ 
@@ -108,6 +175,26 @@ export const WithDisabledItems: Story = {
108175} ; 
109176
110177export  const  WithSeparators : Story  =  { 
178+   render : ( args )  =>  ( { 
179+     components : {  Select } , 
180+     setup ( )  { 
181+       const  value  =  ref ( null ) ; 
182+ 
183+       return  {  args,  value } ; 
184+     } , 
185+     template : ` 
186+       <div class="space-y-4"> 
187+         <Select  
188+           v-model="value"  
189+           :items="args.items" 
190+           :placeholder="args.placeholder" 
191+           :valueKey="args.valueKey" 
192+           :labelKey="args.labelKey" 
193+         /> 
194+         <p class="text-sm text-muted-foreground">Selected: {{ value }}</p> 
195+       </div> 
196+     ` , 
197+   } ) , 
111198  args : { 
112199    placeholder : 'Select action' , 
113200    items : [ 
@@ -127,11 +214,18 @@ export const ControlledValue: Story = {
127214    components : {  Select } , 
128215    setup ( )  { 
129216      const  value  =  ref ( 'banana' ) ; 
217+ 
130218      return  {  args,  value } ; 
131219    } , 
132220    template : ` 
133221      <div class="space-y-4"> 
134-         <Select v-model="value" v-bind="args" /> 
222+         <Select  
223+           v-model="value"  
224+           :items="args.items" 
225+           :placeholder="args.placeholder" 
226+           :valueKey="args.valueKey" 
227+           :labelKey="args.labelKey" 
228+         /> 
135229        <p class="text-sm text-muted-foreground">Selected value: {{ value }}</p> 
136230      </div> 
137231    ` , 
@@ -151,17 +245,26 @@ export const MultipleSelection: Story = {
151245    components : {  Select } , 
152246    setup ( )  { 
153247      const  value  =  ref ( [ 'apple' ,  'orange' ] ) ; 
248+ 
154249      return  {  args,  value } ; 
155250    } , 
156251    template : ` 
157252      <div class="space-y-4"> 
158-         <Select v-model="value" multiple v-bind="args" /> 
253+         <Select  
254+           v-model="value"  
255+           :items="args.items" 
256+           :placeholder="args.placeholder" 
257+           :multiple="args.multiple" 
258+           :valueKey="args.valueKey" 
259+           :labelKey="args.labelKey" 
260+         /> 
159261        <p class="text-sm text-muted-foreground">Selected values: {{ Array.isArray(value) ? value.join(', ') : value }}</p> 
160262      </div> 
161263    ` , 
162264  } ) , 
163265  args : { 
164266    placeholder : 'Select fruits' , 
267+     multiple : true , 
165268    items : [ 
166269      {  value : 'apple' ,  label : 'Apple'  } , 
167270      {  value : 'banana' ,  label : 'Banana'  } , 
@@ -176,17 +279,28 @@ export const CustomSlots: Story = {
176279  render : ( args )  =>  ( { 
177280    components : {  Select } , 
178281    setup ( )  { 
179-       return  {  args } ; 
282+       const  value  =  ref ( null ) ; 
283+ 
284+       return  {  args,  value } ; 
180285    } , 
181286    template : ` 
182-       <Select v-bind="args"> 
183-         <template #item="{ item }"> 
184-           <div class="flex items-center gap-2"> 
185-             <span class="w-3 h-3 rounded-full" :style="{ backgroundColor: item.color }"></span> 
186-             {{ item.label }} 
187-           </div> 
188-         </template> 
189-       </Select> 
287+       <div class="space-y-4"> 
288+         <Select  
289+           v-model="value" 
290+           :items="args.items" 
291+           :placeholder="args.placeholder" 
292+           :valueKey="args.valueKey" 
293+           :labelKey="args.labelKey" 
294+         > 
295+           <template #item="{ item }"> 
296+             <div class="flex items-center gap-2"> 
297+               <span class="w-3 h-3 rounded-full" :style="{ backgroundColor: item.color }"></span> 
298+               {{ item.label }} 
299+             </div> 
300+           </template> 
301+         </Select> 
302+         <p class="text-sm text-muted-foreground">Selected: {{ value }}</p> 
303+       </div> 
190304    ` , 
191305  } ) , 
192306  args : { 
@@ -200,3 +314,36 @@ export const CustomSlots: Story = {
200314    ] , 
201315  } , 
202316} ; 
317+ 
318+ export  const  DisabledSelect : Story  =  { 
319+   render : ( args )  =>  ( { 
320+     components : {  Select } , 
321+     setup ( )  { 
322+       const  value  =  ref ( null ) ; 
323+       return  {  args,  value } ; 
324+     } , 
325+     template : ` 
326+       <div class="space-y-4"> 
327+         <Select  
328+           v-model="value"  
329+           :items="args.items" 
330+           :placeholder="args.placeholder" 
331+           :disabled="args.disabled" 
332+           :valueKey="args.valueKey" 
333+           :labelKey="args.labelKey" 
334+         /> 
335+         <p class="text-sm text-muted-foreground">Selected: {{ value }}</p> 
336+         <p class="text-xs text-muted-foreground">The entire select is disabled</p> 
337+       </div> 
338+     ` , 
339+   } ) , 
340+   args : { 
341+     placeholder : 'This select is disabled' , 
342+     disabled : true , 
343+     items : [ 
344+       {  value : 'option1' ,  label : 'Option 1'  } , 
345+       {  value : 'option2' ,  label : 'Option 2'  } , 
346+       {  value : 'option3' ,  label : 'Option 3'  } , 
347+     ] , 
348+   } , 
349+ } ; 
0 commit comments