@@ -11,20 +11,88 @@ def view_template
1111
1212 render Docs ::VisualCodeExample . new ( title : "Select (Deconstructed)" , context : self ) do
1313 <<~RUBY
14- div(class: 'w-56 flex items-center justify-center') do
15- Select do
16- SelectInput(value: "apple", id: "select-a-fruit")
17- SelectTrigger do
18- SelectValue(placeholder: 'Select a fruit', id: "select-a-fruit") { "Apple" }
14+ Select(class: "w-56") do
15+ SelectInput(value: "apple", id: "select-a-fruit")
16+
17+ SelectTrigger do
18+ SelectValue(placeholder: "Select a fruit", id: "select-a-fruit") { "Apple" }
19+ end
20+
21+ SelectContent(outlet_id: "select-a-fruit") do
22+ SelectGroup do
23+ SelectLabel { "Fruits" }
24+ SelectItem(value: "apple") { "Apple" }
25+ SelectItem(value: "orange") { "Orange" }
26+ SelectItem(value: "banana") { "Banana" }
27+ SelectItem(value: "watermelon") { "Watermelon" }
28+ end
29+ end
30+ end
31+ RUBY
32+ end
33+
34+ render Docs ::VisualCodeExample . new ( title : "Disabled" , context : self ) do
35+ <<~RUBY
36+ Select(class: "w-56") do
37+ SelectInput(value: "apple", id: "select-a-fruit")
38+
39+ SelectTrigger(disabled: true) do
40+ SelectValue(placeholder: "Select a fruit", id: "select-a-fruit") { "Apple" }
41+ end
42+ end
43+ RUBY
44+ end
45+
46+ render Docs ::VisualCodeExample . new ( title : "Data Disabled" , context : self ) do
47+ <<~RUBY
48+ Select(class: "w-56") do
49+ SelectInput(value: "apple", id: "select-a-fruit")
50+
51+ SelectTrigger do
52+ SelectValue(placeholder: "Select a fruit", id: "select-a-fruit") { "Apple" }
53+ end
54+
55+ SelectContent(outlet_id: "select-a-fruit") do
56+ SelectGroup do
57+ SelectLabel { "Fruits" }
58+ SelectItem(data: {disabled: true}, value: "apple") { "Apple" }
59+ SelectItem(value: "orange") { "Orange" }
60+ SelectItem(value: "banana") { "Banana" }
61+ SelectItem(data: {disabled: true}, value: "watermelon") { "Watermelon" }
1962 end
20- SelectContent(outlet_id: "select-a-fruit") do
21- SelectGroup do
22- SelectLabel { "Fruits" }
23- SelectItem(value: "apple") { "Apple" }
24- SelectItem(value: "orange") { "Orange" }
25- SelectItem(value: "banana") { "Banana" }
26- SelectItem(value: "watermelon") { "Watermelon" }
27- end
63+ end
64+ end
65+ RUBY
66+ end
67+
68+ render Docs ::VisualCodeExample . new ( title : "Aria Disabled Trigger" , context : self ) do
69+ <<~RUBY
70+ Select(class: "w-56") do
71+ SelectInput(value: "apple", id: "select-a-fruit")
72+
73+ SelectTrigger(aria: {disabled: "true"}) do
74+ SelectValue(placeholder: "Select a fruit", id: "select-a-fruit") { "Apple" }
75+ end
76+ end
77+ RUBY
78+ end
79+
80+ render Docs ::VisualCodeExample . new ( title : "Aria Disabled Item" , context : self ) do
81+ <<~RUBY
82+ Select(class: "w-56") do
83+ SelectInput(value: "apple", id: "select-a-fruit")
84+
85+ SelectTrigger do
86+ SelectValue(placeholder: "Select a fruit", id: "select-a-fruit") { "Apple" }
87+ end
88+
89+ SelectContent(outlet_id: "select-a-fruit") do
90+ SelectGroup do
91+ SelectLabel { "Fruits" }
92+ SelectItem(aria: {disabled: "true"}, value: "apple") { "Apple" }
93+ SelectItem(value: "orange") { "Orange" }
94+ SelectItem(value: "banana") { "Banana" }
95+ SelectItem(aria: {disabled: "true"}, value: "watermelon") { "Watermelon" }
2896 end
2997 end
3098 end
0 commit comments