ui_components 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/ui_components/controllers/countdown_controller.js +55 -0
- data/app/components/documentation/body/example_preview_component.rb +1 -1
- data/app/components/documentation/body_component.html.erb +1 -1
- data/app/components/documentation/body_component.rb +4 -4
- data/app/components/ui_components/daisy_ui/action/button_component.rb +13 -13
- data/app/components/ui_components/daisy_ui/action/dropdown/anchor_component.rb +1 -11
- data/app/components/ui_components/daisy_ui/action/dropdown/card/item_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/action/dropdown/card_component.rb +4 -14
- data/app/components/ui_components/daisy_ui/action/dropdown/menu/item_component.rb +32 -0
- data/app/components/ui_components/daisy_ui/action/dropdown/menu_component.rb +2 -12
- data/app/components/ui_components/daisy_ui/action/dropdown_component.rb +12 -12
- data/app/components/ui_components/daisy_ui/action/modal/anchor_component.rb +1 -11
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box/action/item_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box/action_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box/body_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box/close_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box/title_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog_component.rb +2 -12
- data/app/components/ui_components/daisy_ui/action/swap/off_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/swap/on_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/swap_component.rb +6 -6
- data/app/components/ui_components/daisy_ui/base_component.rb +24 -3
- data/app/components/ui_components/daisy_ui/data_display/accordion/item/anchor_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/accordion/item/body_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/accordion/item_component.rb +15 -15
- data/app/components/ui_components/daisy_ui/data_display/avatar/item/box_component.rb +63 -0
- data/app/components/ui_components/daisy_ui/data_display/avatar/item_component.rb +8 -8
- data/app/components/ui_components/daisy_ui/data_display/badge_component.rb +7 -7
- data/app/components/ui_components/daisy_ui/data_display/card/body/action_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/card/body/context_component.rb +17 -0
- data/app/components/ui_components/daisy_ui/data_display/card/body/title_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/card/body_component.rb +34 -0
- data/app/components/ui_components/daisy_ui/data_display/card/figure_component.rb +15 -0
- data/app/components/ui_components/daisy_ui/data_display/card_component.rb +83 -0
- data/app/components/ui_components/daisy_ui/data_display/carousel/indicator_component.rb +18 -0
- data/app/components/ui_components/daisy_ui/data_display/carousel/item/passer_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/carousel/item_component.rb +26 -0
- data/app/components/ui_components/daisy_ui/data_display/carousel_component.rb +63 -0
- data/app/components/ui_components/daisy_ui/data_display/chat/bubble_component.rb +42 -0
- data/app/components/ui_components/daisy_ui/data_display/chat/footer_component.rb +18 -0
- data/app/components/ui_components/daisy_ui/data_display/chat/header_component.rb +18 -0
- data/app/components/ui_components/daisy_ui/data_display/chat_component.rb +58 -0
- data/app/components/ui_components/daisy_ui/data_display/countdown/item_component.rb +49 -0
- data/app/components/ui_components/daisy_ui/data_display/countdown_component.rb +37 -0
- data/app/components/ui_components/daisy_ui/data_display/{accordion/anchor_component.rb → diff/item1_component.rb} +5 -8
- data/app/components/ui_components/daisy_ui/data_display/{accordion/body_component.rb → diff/item2_component.rb} +6 -8
- data/app/components/ui_components/daisy_ui/data_display/diff/resizer_component.rb +25 -0
- data/app/components/ui_components/daisy_ui/data_display/diff_component.rb +35 -0
- data/app/components/ui_components/daisy_ui/data_display/kbd_component.rb +40 -0
- data/app/components/ui_components/daisy_ui/data_display/list/item_component.rb +40 -0
- data/app/components/ui_components/daisy_ui/data_display/list_component.rb +22 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item/action_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item/description_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item/figure_component.rb +24 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item/title_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item/value_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item_component.rb +39 -0
- data/app/components/ui_components/daisy_ui/data_display/stat_component.rb +50 -0
- data/app/components/ui_components/daisy_ui/data_display/status_component.rb +59 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/body_component.rb +23 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/foot_component.rb +23 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/head_component.rb +23 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/row/data_component.rb +19 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/row/header_component.rb +19 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/row_component.rb +32 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item_component.rb +29 -0
- data/app/components/ui_components/daisy_ui/data_display/table_component.rb +72 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_end_component.rb +44 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_middle_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_start_component.rb +44 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline/item/line_component.rb +17 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline/item_component.rb +40 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline_component.rb +50 -0
- data/app/controllers/ui_components/daisy_ui/data_display_components_controller.rb +22 -0
- data/app/helpers/data_display/carousel_helper.rb +13 -0
- data/app/views/ui_components/daisy_ui/action_components/button.html.erb +35 -33
- data/app/views/ui_components/daisy_ui/action_components/dropdown.html.erb +38 -25
- data/app/views/ui_components/daisy_ui/action_components/modal.html.erb +31 -18
- data/app/views/ui_components/daisy_ui/action_components/swap.html.erb +31 -17
- data/app/views/ui_components/daisy_ui/data_display_components/accordion.html.erb +59 -105
- data/app/views/ui_components/daisy_ui/data_display_components/avatar.html.erb +40 -27
- data/app/views/ui_components/daisy_ui/data_display_components/badge.html.erb +45 -42
- data/app/views/ui_components/daisy_ui/data_display_components/card.html.erb +302 -0
- data/app/views/ui_components/daisy_ui/data_display_components/carousel.html.erb +303 -0
- data/app/views/ui_components/daisy_ui/data_display_components/chat.html.erb +190 -0
- data/app/views/ui_components/daisy_ui/data_display_components/countdown.html.erb +211 -0
- data/app/views/ui_components/daisy_ui/data_display_components/diff.html.erb +69 -0
- data/app/views/ui_components/daisy_ui/data_display_components/kbd.html.erb +157 -0
- data/app/views/ui_components/daisy_ui/data_display_components/list.html.erb +247 -0
- data/app/views/ui_components/daisy_ui/data_display_components/stat.html.erb +208 -0
- data/app/views/ui_components/daisy_ui/data_display_components/status.html.erb +93 -0
- data/app/views/ui_components/daisy_ui/data_display_components/table.html.erb +358 -0
- data/app/views/ui_components/daisy_ui/data_display_components/timeline.html.erb +431 -0
- data/app/views/ui_components/daisy_ui/home/index.html.erb +11 -0
- data/config/routes.rb +13 -2
- data/lib/tasks/ui_components_tasks.rake +3 -6
- data/lib/ui_components/config/daisy_ui_class_names.rb +3 -2
- data/lib/ui_components/config/tailwind_class_names.rb +27 -4
- data/lib/ui_components/version.rb +1 -1
- metadata +65 -7
- data/app/components/ui_components/daisy_ui/action/dropdown/card_item_component.rb +0 -29
- data/app/components/ui_components/daisy_ui/action/dropdown/list_item_component.rb +0 -30
- data/app/components/ui_components/daisy_ui/data_display/avatar/box_component.rb +0 -61
@@ -0,0 +1,211 @@
|
|
1
|
+
<% component = UiComponents::DaisyUi::DataDisplay::CountdownComponent %>
|
2
|
+
|
3
|
+
<div class="grid grid-cols gap-16 p-2 mt-6 mb-36">
|
4
|
+
<div class="mb-2">
|
5
|
+
<h1 class="font-bold mb-2"># Data display > Countdown</h1>
|
6
|
+
<ul class="bg-base-100 rounded-box shadow-md p-2">
|
7
|
+
<%= link_to "< Chat bobble", daisy_ui_chat_path, class: "link link-primary m-2" %>
|
8
|
+
<%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
|
9
|
+
<%= link_to "Diff >", daisy_ui_diff_path, class: "link link-primary m-2" %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="divider"></div>
|
14
|
+
|
15
|
+
<%= render DocumentationComponent.new do |doc| %>
|
16
|
+
<%= doc.with_header { "# Countdown" } %>
|
17
|
+
<%= doc.with_body do |body| %>
|
18
|
+
<%= body.with_preview_example(
|
19
|
+
source: <<~ERB
|
20
|
+
<$= render #{component}.new do |countdown| $>
|
21
|
+
<$= countdown.with_item(value: "59") $>
|
22
|
+
<$ end $>
|
23
|
+
ERB
|
24
|
+
) %>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<%= render DocumentationComponent.new do |doc| %>
|
29
|
+
<%= doc.with_header { "# No automatic countdown" } %>
|
30
|
+
<%= doc.with_body do |body| %>
|
31
|
+
<%= body.with_preview_example(
|
32
|
+
source: <<~ERB
|
33
|
+
<$= render #{component}.new(automatic: false) do |countdown| $>
|
34
|
+
<$= countdown.with_item(value: "59") $>
|
35
|
+
<$ end $>
|
36
|
+
ERB
|
37
|
+
) %>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
40
|
+
|
41
|
+
<%= render DocumentationComponent.new do |doc| %>
|
42
|
+
<%= doc.with_header { "# Large text" } %>
|
43
|
+
<%= doc.with_body do |body| %>
|
44
|
+
<%= body.with_preview_example(
|
45
|
+
source: <<~ERB
|
46
|
+
<$= render #{component}.new(css_class: "font-mono text-6xl") do |countdown| $>
|
47
|
+
<$= countdown.with_item(value: "59") $>
|
48
|
+
<$ end $>
|
49
|
+
ERB
|
50
|
+
) %>
|
51
|
+
<% end %>
|
52
|
+
<% end %>
|
53
|
+
|
54
|
+
<%= render DocumentationComponent.new do |doc| %>
|
55
|
+
<%= doc.with_header { "# Clock countdown" } %>
|
56
|
+
<%= doc.with_body do |body| %>
|
57
|
+
<%= body.with_preview_example(
|
58
|
+
source: <<~ERB
|
59
|
+
<$= render #{component}.new(css_class: "font-mono text-2xl") do |countdown| $>
|
60
|
+
<$= countdown.with_item(value: "10", type: "hour", label: "h") $>
|
61
|
+
<$= countdown.with_item(value: "24", type: "minute", label: "m") $>
|
62
|
+
<$= countdown.with_item(value: "59", type: "second", label: "s") $>
|
63
|
+
<$ end $>
|
64
|
+
ERB
|
65
|
+
) %>
|
66
|
+
<% end %>
|
67
|
+
<% end %>
|
68
|
+
|
69
|
+
<%= render DocumentationComponent.new do |doc| %>
|
70
|
+
<%= doc.with_header { "# Clock countdown with colons" } %>
|
71
|
+
<%= doc.with_body do |body| %>
|
72
|
+
<%= body.with_preview_example(
|
73
|
+
source: <<~ERB
|
74
|
+
<$= render #{component}.new(css_class: "font-mono text-2xl") do |countdown| $>
|
75
|
+
<$= countdown.with_item(value: "10", type: "hour", label: ":") $>
|
76
|
+
<$= countdown.with_item(value: "24", type: "minute", label: ":") $>
|
77
|
+
<$= countdown.with_item(value: "59", type: "second") $>
|
78
|
+
<$ end $>
|
79
|
+
ERB
|
80
|
+
) %>
|
81
|
+
<% end %>
|
82
|
+
<% end %>
|
83
|
+
|
84
|
+
<%= render DocumentationComponent.new do |doc| %>
|
85
|
+
<%= doc.with_header { "# Large text with labels" } %>
|
86
|
+
<%= doc.with_body do |body| %>
|
87
|
+
<%= body.with_preview_example(
|
88
|
+
source: <<~ERB
|
89
|
+
<div class="flex gap-5">
|
90
|
+
<div>
|
91
|
+
<$= render #{component}.new(css_class: "font-mono text-2xl") do |countdown| $>
|
92
|
+
<$= countdown.with_item(value: "15", type: "day") $>
|
93
|
+
<$ end $>
|
94
|
+
days
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<div>
|
98
|
+
<$= render #{component}.new(css_class: "font-mono text-2xl") do |countdown| $>
|
99
|
+
<$= countdown.with_item(value: "10", type: "hour") $>
|
100
|
+
<$ end $>
|
101
|
+
hours
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<div>
|
105
|
+
<$= render #{component}.new(css_class: "font-mono text-2xl") do |countdown| $>
|
106
|
+
<$= countdown.with_item(value: "24", type: "minute") $>
|
107
|
+
<$ end $>
|
108
|
+
minutes
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<div>
|
112
|
+
<$= render #{component}.new(css_class: "font-mono text-2xl") do |countdown| $>
|
113
|
+
<$= countdown.with_item(value: "59", type: "second") $>
|
114
|
+
<$ end $>
|
115
|
+
sec
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
ERB
|
119
|
+
) %>
|
120
|
+
<% end %>
|
121
|
+
<% end %>
|
122
|
+
|
123
|
+
<%= render DocumentationComponent.new do |doc| %>
|
124
|
+
<%= doc.with_header { "# Large text with labels under" } %>
|
125
|
+
<%= doc.with_body do |body| %>
|
126
|
+
<%= body.with_preview_example(
|
127
|
+
source: <<~ERB
|
128
|
+
<div class="grid auto-cols-max grid-flow-col gap-5 text-center">
|
129
|
+
<div class="flex flex-col">
|
130
|
+
<$= render #{component}.new(css_class: "font-mono text-5xl") do |countdown| $>
|
131
|
+
<$= countdown.with_item(value: "15", type: "day") $>
|
132
|
+
<$ end $>
|
133
|
+
days
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<div class="flex flex-col">
|
137
|
+
<$= render #{component}.new(css_class: "font-mono text-5xl") do |countdown| $>
|
138
|
+
<$= countdown.with_item(value: "10", type: "hour") $>
|
139
|
+
<$ end $>
|
140
|
+
hours
|
141
|
+
</div>
|
142
|
+
|
143
|
+
<div class="flex flex-col">
|
144
|
+
<$= render #{component}.new(css_class: "font-mono text-5xl") do |countdown| $>
|
145
|
+
<$= countdown.with_item(value: "24", type: "minute") $>
|
146
|
+
<$ end $>
|
147
|
+
minutes
|
148
|
+
</div>
|
149
|
+
|
150
|
+
<div class="flex flex-col">
|
151
|
+
<$= render #{component}.new(css_class: "font-mono text-5xl") do |countdown| $>
|
152
|
+
<$= countdown.with_item(value: "59", type: "second") $>
|
153
|
+
<$ end $>
|
154
|
+
sec
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
ERB
|
158
|
+
) %>
|
159
|
+
<% end %>
|
160
|
+
<% end %>
|
161
|
+
|
162
|
+
<%= render DocumentationComponent.new do |doc| %>
|
163
|
+
<%= doc.with_header { "# In boxes" } %>
|
164
|
+
<%= doc.with_body do |body| %>
|
165
|
+
<%= body.with_preview_example(
|
166
|
+
source: <<~ERB
|
167
|
+
<div class="grid auto-cols-max grid-flow-col gap-5 text-center">
|
168
|
+
<div class="bg-neutral rounded-box flex flex-col p-2">
|
169
|
+
<$= render #{component}.new(css_class: "font-mono text-5xl") do |countdown| $>
|
170
|
+
<$= countdown.with_item(value: "15", type: "day") $>
|
171
|
+
<$ end $>
|
172
|
+
days
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<div class="bg-neutral rounded-box flex flex-col p-2">
|
176
|
+
<$= render #{component}.new(css_class: "font-mono text-5xl") do |countdown| $>
|
177
|
+
<$= countdown.with_item(value: "10", type: "hour") $>
|
178
|
+
<$ end $>
|
179
|
+
hours
|
180
|
+
</div>
|
181
|
+
|
182
|
+
<div class="bg-neutral rounded-box flex flex-col p-2">
|
183
|
+
<$= render #{component}.new(css_class: "font-mono text-5xl") do |countdown| $>
|
184
|
+
<$= countdown.with_item(value: "24", type: "minute") $>
|
185
|
+
<$ end $>
|
186
|
+
minutes
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<div class="bg-neutral rounded-box flex flex-col p-2">
|
190
|
+
<$= render #{component}.new(css_class: "font-mono text-5xl") do |countdown| $>
|
191
|
+
<$= countdown.with_item(value: "59", type: "second") $>
|
192
|
+
<$ end $>
|
193
|
+
sec
|
194
|
+
</div>
|
195
|
+
</div>
|
196
|
+
ERB
|
197
|
+
) %>
|
198
|
+
<% end %>
|
199
|
+
<% end %>
|
200
|
+
|
201
|
+
<div class="divider"></div>
|
202
|
+
|
203
|
+
<div class="mb-2">
|
204
|
+
<h1 class="font-bold mb-2"># Data display > Countdown</h1>
|
205
|
+
<ul class="bg-base-100 rounded-box shadow-md p-2">
|
206
|
+
<%= link_to "< Chat bobble", daisy_ui_chat_path, class: "link link-primary m-2" %>
|
207
|
+
<%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
|
208
|
+
<%= link_to "Diff >", daisy_ui_diff_path, class: "link link-primary m-2" %>
|
209
|
+
</ul>
|
210
|
+
</div>
|
211
|
+
</div>
|
@@ -0,0 +1,69 @@
|
|
1
|
+
<% component = UiComponents::DaisyUi::DataDisplay::DiffComponent %>
|
2
|
+
|
3
|
+
<div class="grid grid-cols gap-16 p-2 mt-6 mb-36">
|
4
|
+
<div class="mb-2">
|
5
|
+
<h1 class="font-bold mb-2"># Data display > Diff</h1>
|
6
|
+
<ul class="bg-base-100 rounded-box shadow-md p-2">
|
7
|
+
<%= link_to "< Countdown", daisy_ui_countdown_path, class: "link link-primary m-2" %>
|
8
|
+
<%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
|
9
|
+
<%= link_to "Kbd >", daisy_ui_kbd_path, class: "link link-primary m-2" %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="divider"></div>
|
14
|
+
|
15
|
+
<%= render DocumentationComponent.new do |doc| %>
|
16
|
+
<%= doc.with_header { "# Diff" } %>
|
17
|
+
<%= doc.with_body(preview_options: { css_class: "p-2 min-w-2xs max-w-4xl" }) do |body| %>
|
18
|
+
<%= body.with_preview_example(
|
19
|
+
source: <<~ERB
|
20
|
+
<$= render #{component}.new(css_class: "aspect-16/9") do |diff| $>
|
21
|
+
<$= diff.with_item1 do $>
|
22
|
+
<img alt="daisy" src="https://img.daisyui.com/images/stock/photo-1560717789-0ac7c58ac90a.webp" />
|
23
|
+
<$ end $>
|
24
|
+
|
25
|
+
<$= diff.with_item2 do $>
|
26
|
+
<img alt="daisy" src="https://img.daisyui.com/images/stock/photo-1560717789-0ac7c58ac90a-blur.webp" />
|
27
|
+
<$ end $>
|
28
|
+
|
29
|
+
<$= diff.with_resizer $>
|
30
|
+
<$ end $>
|
31
|
+
ERB
|
32
|
+
) %>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|
35
|
+
|
36
|
+
<%= render DocumentationComponent.new do |doc| %>
|
37
|
+
<%= doc.with_header { "# Diff text" } %>
|
38
|
+
<%= doc.with_body(preview_options: { css_class: "p-2 min-w-2xs max-w-4xl" }) do |body| %>
|
39
|
+
<%= body.with_preview_example(
|
40
|
+
source: <<~ERB
|
41
|
+
<$= render #{component}.new(css_class: "aspect-16/9") do |diff| $>
|
42
|
+
<$= diff.with_item1 do $>
|
43
|
+
<div class="bg-primary grid place-content-center text-9xl font-black">
|
44
|
+
DAISY
|
45
|
+
</div>
|
46
|
+
<$ end $>
|
47
|
+
|
48
|
+
<$= diff.with_item2 do $>
|
49
|
+
<div class="bg-base-200 grid place-content-center text-9xl font-black">DAISY</div>
|
50
|
+
<$ end $>
|
51
|
+
|
52
|
+
<$= diff.with_resizer $>
|
53
|
+
<$ end $>
|
54
|
+
ERB
|
55
|
+
) %>
|
56
|
+
<% end %>
|
57
|
+
<% end %>
|
58
|
+
|
59
|
+
<div class="divider"></div>
|
60
|
+
|
61
|
+
<div class="mb-2">
|
62
|
+
<h1 class="font-bold mb-2"># Data display > Diff</h1>
|
63
|
+
<ul class="bg-base-100 rounded-box shadow-md p-2">
|
64
|
+
<%= link_to "< Countdown", daisy_ui_countdown_path, class: "link link-primary m-2" %>
|
65
|
+
<%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
|
66
|
+
<%= link_to "Kbd >", daisy_ui_kbd_path, class: "link link-primary m-2" %>
|
67
|
+
</ul>
|
68
|
+
</div>
|
69
|
+
</div>
|
@@ -0,0 +1,157 @@
|
|
1
|
+
<% component = UiComponents::DaisyUi::DataDisplay::KbdComponent %>
|
2
|
+
|
3
|
+
<div class="grid grid-cols gap-16 p-2 mt-6 mb-36">
|
4
|
+
<div class="mb-2">
|
5
|
+
<h1 class="font-bold mb-2"># Data display > Kbd</h1>
|
6
|
+
<ul class="bg-base-100 rounded-box shadow-md p-2">
|
7
|
+
<%= link_to "< Diff", daisy_ui_diff_path, class: "link link-primary m-2" %>
|
8
|
+
<%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
|
9
|
+
<%= link_to "List >", daisy_ui_list_path, class: "link link-primary m-2" %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="divider"></div>
|
14
|
+
|
15
|
+
<%= render DocumentationComponent.new do |doc| %>
|
16
|
+
<%= doc.with_header { "# Kbd" } %>
|
17
|
+
<%= doc.with_body do |body| %>
|
18
|
+
<%= body.with_preview_example(
|
19
|
+
source: <<~ERB
|
20
|
+
<$= render #{component}.new.with_content("K") $>
|
21
|
+
ERB
|
22
|
+
) %>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
<% sizes = { 'xs' => 'Xsmall', 'sm' => 'Small', 'md' => 'Medium', 'lg' => 'Large', 'xl' => 'Xlarge' } %>
|
27
|
+
|
28
|
+
<%= render DocumentationComponent.new do |doc| %>
|
29
|
+
<%= doc.with_header { "# Kbd sizes" } %>
|
30
|
+
<%= doc.with_body do |body| %>
|
31
|
+
<% sizes.each do |key, value| %>
|
32
|
+
<%= body.with_preview_example(
|
33
|
+
source: <<~ERB
|
34
|
+
<$= render #{component}.new(size: "#{key}").with_content("#{value}") $>
|
35
|
+
ERB
|
36
|
+
) %>
|
37
|
+
<% end %>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
40
|
+
|
41
|
+
<%= render DocumentationComponent.new do |doc| %>
|
42
|
+
<%= doc.with_header { "# In text" } %>
|
43
|
+
<%= doc.with_body do |body| %>
|
44
|
+
<%= body.with_preview_example(
|
45
|
+
source: <<~ERB
|
46
|
+
Press
|
47
|
+
<$= render #{component}.new(size: "sm").with_content("F") $>
|
48
|
+
to pay respects.
|
49
|
+
ERB
|
50
|
+
) %>
|
51
|
+
<% end %>
|
52
|
+
<% end %>
|
53
|
+
|
54
|
+
<%= render DocumentationComponent.new do |doc| %>
|
55
|
+
<%= doc.with_header { "# Key combination" } %>
|
56
|
+
<%= doc.with_body do |body| %>
|
57
|
+
<%= body.with_preview_example(
|
58
|
+
source: <<~ERB
|
59
|
+
<$= render #{component}.new.with_content("ctrl") $>
|
60
|
+
+
|
61
|
+
<$= render #{component}.new.with_content("shift") $>
|
62
|
+
+
|
63
|
+
<$= render #{component}.new.with_content("del") $>
|
64
|
+
ERB
|
65
|
+
) %>
|
66
|
+
<% end %>
|
67
|
+
<% end %>
|
68
|
+
|
69
|
+
<% function_keys = %w[⌘ ⌥ ⇧ ⌃] %>
|
70
|
+
|
71
|
+
<%= render DocumentationComponent.new do |doc| %>
|
72
|
+
<%= doc.with_header { "# Function Keys" } %>
|
73
|
+
<%= doc.with_body do |body| %>
|
74
|
+
<% function_keys.each do |value| %>
|
75
|
+
<%= body.with_preview_example(
|
76
|
+
source: <<~ERB
|
77
|
+
<$= render #{component}.new.with_content("#{value}") $>
|
78
|
+
ERB
|
79
|
+
) %>
|
80
|
+
<% end %>
|
81
|
+
<% end %>
|
82
|
+
<% end %>
|
83
|
+
|
84
|
+
<%= render DocumentationComponent.new do |doc| %>
|
85
|
+
<%= doc.with_header { "# A full keyboard" } %>
|
86
|
+
<%= doc.with_body(preview_options: { css_class: "w-72" }) do |body| %>
|
87
|
+
<%= body.with_preview_example(
|
88
|
+
source: <<~ERB
|
89
|
+
<div class="my-1 flex w-full justify-center gap-1">
|
90
|
+
<$= render #{component}.new.with_content("q") $>
|
91
|
+
<$= render #{component}.new.with_content("w") $>
|
92
|
+
<$= render #{component}.new.with_content("e") $>
|
93
|
+
<$= render #{component}.new.with_content("r") $>
|
94
|
+
<$= render #{component}.new.with_content("t") $>
|
95
|
+
<$= render #{component}.new.with_content("y") $>
|
96
|
+
<$= render #{component}.new.with_content("u") $>
|
97
|
+
<$= render #{component}.new.with_content("i") $>
|
98
|
+
<$= render #{component}.new.with_content("o") $>
|
99
|
+
<$= render #{component}.new.with_content("p") $>
|
100
|
+
</div>
|
101
|
+
<div class="my-1 flex w-full justify-center gap-1">
|
102
|
+
<$= render #{component}.new.with_content("a") $>
|
103
|
+
<$= render #{component}.new.with_content("s") $>
|
104
|
+
<$= render #{component}.new.with_content("d") $>
|
105
|
+
<$= render #{component}.new.with_content("f") $>
|
106
|
+
<$= render #{component}.new.with_content("g") $>
|
107
|
+
<$= render #{component}.new.with_content("h") $>
|
108
|
+
<$= render #{component}.new.with_content("j") $>
|
109
|
+
<$= render #{component}.new.with_content("k") $>
|
110
|
+
<$= render #{component}.new.with_content("l") $>
|
111
|
+
</div>
|
112
|
+
<div class="my-1 flex w-full justify-center gap-1">
|
113
|
+
<$= render #{component}.new.with_content("z") $>
|
114
|
+
<$= render #{component}.new.with_content("x") $>
|
115
|
+
<$= render #{component}.new.with_content("c") $>
|
116
|
+
<$= render #{component}.new.with_content("v") $>
|
117
|
+
<$= render #{component}.new.with_content("b") $>
|
118
|
+
<$= render #{component}.new.with_content("n") $>
|
119
|
+
<$= render #{component}.new.with_content("m") $>
|
120
|
+
<$= render #{component}.new.with_content("/") $>
|
121
|
+
</div>
|
122
|
+
ERB
|
123
|
+
) %>
|
124
|
+
<% end %>
|
125
|
+
<% end %>
|
126
|
+
|
127
|
+
<%= render DocumentationComponent.new do |doc| %>
|
128
|
+
<%= doc.with_header { "# Arrow Keys" } %>
|
129
|
+
<%= doc.with_body(preview_options: { css_class: "w-30" }) do |body| %>
|
130
|
+
<%= body.with_preview_example(
|
131
|
+
source: <<~ERB
|
132
|
+
<div class="flex w-full justify-center">
|
133
|
+
<$= render #{component}.new.with_content("▲") $>
|
134
|
+
</div>
|
135
|
+
<div class="flex w-full justify-center gap-12">
|
136
|
+
<$= render #{component}.new.with_content("◀︎") $>
|
137
|
+
<$= render #{component}.new.with_content("▶︎") $>
|
138
|
+
</div>
|
139
|
+
<div class="flex w-full justify-center">
|
140
|
+
<$= render #{component}.new.with_content("▼") $>
|
141
|
+
</div>
|
142
|
+
ERB
|
143
|
+
) %>
|
144
|
+
<% end %>
|
145
|
+
<% end %>
|
146
|
+
|
147
|
+
<div class="divider"></div>
|
148
|
+
|
149
|
+
<div class="mb-2">
|
150
|
+
<h1 class="font-bold mb-2"># Data display > Kbd</h1>
|
151
|
+
<ul class="bg-base-100 rounded-box shadow-md p-2">
|
152
|
+
<%= link_to "< Diff", daisy_ui_diff_path, class: "link link-primary m-2" %>
|
153
|
+
<%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
|
154
|
+
<%= link_to "List >", daisy_ui_list_path, class: "link link-primary m-2" %>
|
155
|
+
</ul>
|
156
|
+
</div>
|
157
|
+
</div>
|