@@ -9,6 +9,26 @@ def view_template
9
9
10
10
Heading ( level : 2 ) { "Usage" }
11
11
12
+ Alert do
13
+ info_icon ( )
14
+ AlertTitle { "Requirements" }
15
+ AlertDescription { "The sidebar component depends on the following components:" }
16
+ ul ( class : "list-disc list-inside" ) do
17
+ li do
18
+ InlineLink ( href : docs_sheet_path , target : "_blank" , class : "inline-flex items-center gap-2" ) do
19
+ span { "Sheet" }
20
+ external_icon_link ( )
21
+ end
22
+ end
23
+ li do
24
+ div ( class : "inline-flex items-center gap-2" ) do
25
+ InlineLink ( href : docs_separator_path , target : "_blank" ) { "Separator" }
26
+ external_icon_link ( )
27
+ end
28
+ end
29
+ end
30
+ end
31
+
12
32
render Docs ::VisualCodeExample . new ( title : "Example" , src : "/docs/sidebar/example" , context : self ) do
13
33
Views ::Docs ::Sidebar ::Example ::CODE
14
34
end
@@ -120,4 +140,37 @@ def inbox_icon
120
140
s . path ( d : "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" )
121
141
end
122
142
end
143
+
144
+ def external_icon_link
145
+ svg (
146
+ xmlns : "http://www.w3.org/2000/svg" ,
147
+ viewBox : "0 0 24 24" ,
148
+ fill : "none" ,
149
+ stroke : "currentColor" ,
150
+ stroke_width : "2" ,
151
+ stroke_linecap : "round" ,
152
+ stroke_linejoin : "round" ,
153
+ class : "lucide lucide-external-link-icon lucide-external-link size-3"
154
+ ) do |s |
155
+ s . path ( d : "M15 3h6v6" )
156
+ s . path ( d : "M10 14 21 3" )
157
+ s . path ( d : "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" )
158
+ end
159
+ end
160
+
161
+ def info_icon
162
+ svg (
163
+ xmlns : "http://www.w3.org/2000/svg" ,
164
+ viewbox : "0 0 24 24" ,
165
+ fill : "currentColor" ,
166
+ class : "w-5 h-5"
167
+ ) do |s |
168
+ s . path (
169
+ fill_rule : "evenodd" ,
170
+ d :
171
+ "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 01.67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 11-.671-1.34l.041-.022zM12 9a.75.75 0 100-1.5.75.75 0 000 1.5z" ,
172
+ clip_rule : "evenodd"
173
+ )
174
+ end
175
+ end
123
176
end
0 commit comments