velvetkit 0.3.0 → 0.4.1

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.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +109 -0
  3. data/README.md +5 -1
  4. data/lib/generators/velvetkit/add/add_generator.rb +58 -0
  5. data/lib/velvetkit/version.rb +4 -1
  6. data/lib/velvetkit.rb +7 -0
  7. data/registry/app/assets/tailwind/velvetkit.css +90 -155
  8. data/registry/app/components/ui/chart.html.erb +47 -0
  9. data/registry/app/components/ui/chart.rb +177 -0
  10. data/registry/app/components/ui/command/group.rb +27 -0
  11. data/registry/app/components/ui/command/item.rb +64 -0
  12. data/registry/app/components/ui/command.html.erb +41 -0
  13. data/registry/app/components/ui/command.rb +122 -0
  14. data/registry/app/components/ui/date_picker.html.erb +58 -64
  15. data/registry/app/components/ui/date_picker.rb +199 -75
  16. data/registry/app/components/ui/file_field.html.erb +14 -4
  17. data/registry/app/components/ui/file_field.rb +179 -28
  18. data/registry/app/components/ui/gallery/image.rb +20 -0
  19. data/registry/app/components/ui/gallery.html.erb +52 -0
  20. data/registry/app/components/ui/gallery.rb +164 -0
  21. data/registry/app/components/ui/kbd.html.erb +27 -0
  22. data/registry/app/components/ui/kbd.rb +134 -0
  23. data/registry/app/components/ui/money_input.html.erb +8 -0
  24. data/registry/app/components/ui/money_input.rb +153 -0
  25. data/registry/app/components/ui/number_input.html.erb +11 -0
  26. data/registry/app/components/ui/number_input.rb +103 -0
  27. data/registry/app/components/ui/progress/segment.rb +25 -0
  28. data/registry/app/components/ui/progress.html.erb +25 -0
  29. data/registry/app/components/ui/progress.rb +182 -0
  30. data/registry/app/components/ui/scan_input.html.erb +6 -0
  31. data/registry/app/components/ui/scan_input.rb +94 -0
  32. data/registry/app/components/ui/select.html.erb +24 -5
  33. data/registry/app/components/ui/select.rb +44 -5
  34. data/registry/app/components/ui/slider.html.erb +23 -0
  35. data/registry/app/components/ui/slider.rb +254 -0
  36. data/registry/app/components/ui/timeline/item.html.erb +21 -0
  37. data/registry/app/components/ui/timeline/item.rb +145 -0
  38. data/registry/app/components/ui/timeline.html.erb +1 -0
  39. data/registry/app/components/ui/timeline.rb +42 -0
  40. data/registry/app/javascript/chart_js.ts +37 -0
  41. data/registry/app/javascript/controllers/ui/_internal/date_format.ts +74 -0
  42. data/registry/app/javascript/controllers/ui/_internal/shortcut.ts +80 -0
  43. data/registry/app/javascript/controllers/ui/chart_controller.ts +585 -0
  44. data/registry/app/javascript/controllers/ui/command_controller.ts +454 -0
  45. data/registry/app/javascript/controllers/ui/date_picker_controller.ts +247 -82
  46. data/registry/app/javascript/controllers/ui/file_field_controller.ts +288 -16
  47. data/registry/app/javascript/controllers/ui/gallery_controller.ts +568 -0
  48. data/registry/app/javascript/controllers/ui/kbd_controller.ts +60 -0
  49. data/registry/app/javascript/controllers/ui/money_input_controller.ts +228 -0
  50. data/registry/app/javascript/controllers/ui/number_input_controller.ts +111 -0
  51. data/registry/app/javascript/controllers/ui/progress_controller.ts +87 -0
  52. data/registry/app/javascript/controllers/ui/scan_input_controller.ts +143 -0
  53. data/registry/app/javascript/controllers/ui/select_controller.ts +198 -8
  54. data/registry/app/javascript/controllers/ui/slider_controller.ts +216 -0
  55. data/registry/app/javascript/vanilla_calendar.ts +15 -0
  56. data/registry/components.yml +25 -3
  57. data/registry/config/locales/velvetkit.en.yml +79 -0
  58. data/registry/icons/lucide/download.svg +17 -0
  59. data/registry/icons/lucide/file-plus.svg +18 -0
  60. data/registry/icons/lucide/file.svg +16 -0
  61. data/registry/icons/lucide/folder.svg +15 -0
  62. data/registry/icons/lucide/keyboard.svg +23 -0
  63. data/registry/icons/lucide/minus.svg +15 -0
  64. data/registry/icons/lucide/package.svg +18 -0
  65. data/registry/icons/lucide/pause.svg +16 -0
  66. data/registry/icons/lucide/percent.svg +17 -0
  67. data/registry/icons/lucide/printer.svg +17 -0
  68. data/registry/icons/lucide/receipt.svg +17 -0
  69. data/registry/icons/lucide/scan-barcode.svg +21 -0
  70. data/registry/icons/lucide/sun-moon.svg +19 -0
  71. data/registry/icons/lucide/truck.svg +19 -0
  72. data/registry/icons/lucide/user-plus.svg +18 -0
  73. data/registry/icons/lucide/volume-2.svg +17 -0
  74. data/registry/icons/lucide/volume-x.svg +17 -0
  75. data/registry/icons/lucide/zoom-in.svg +18 -0
  76. data/registry/icons/lucide/zoom-out.svg +17 -0
  77. data/registry/icons/phosphor/barcode.svg +2 -0
  78. data/registry/icons/phosphor/circle-half.svg +2 -0
  79. data/registry/icons/phosphor/download-simple.svg +2 -0
  80. data/registry/icons/phosphor/file-plus.svg +2 -0
  81. data/registry/icons/phosphor/file.svg +2 -0
  82. data/registry/icons/phosphor/folder.svg +2 -0
  83. data/registry/icons/phosphor/keyboard.svg +2 -0
  84. data/registry/icons/phosphor/magnifying-glass-minus.svg +2 -0
  85. data/registry/icons/phosphor/magnifying-glass-plus.svg +2 -0
  86. data/registry/icons/phosphor/minus.svg +2 -0
  87. data/registry/icons/phosphor/package.svg +2 -0
  88. data/registry/icons/phosphor/pause.svg +2 -0
  89. data/registry/icons/phosphor/percent.svg +2 -0
  90. data/registry/icons/phosphor/printer.svg +2 -0
  91. data/registry/icons/phosphor/receipt.svg +2 -0
  92. data/registry/icons/phosphor/speaker-high.svg +2 -0
  93. data/registry/icons/phosphor/speaker-x.svg +2 -0
  94. data/registry/icons/phosphor/truck.svg +2 -0
  95. data/registry/icons/phosphor/user-plus.svg +2 -0
  96. data/registry/icons/tabler/barcode.svg +23 -0
  97. data/registry/icons/tabler/download.svg +18 -0
  98. data/registry/icons/tabler/file-plus.svg +19 -0
  99. data/registry/icons/tabler/file.svg +17 -0
  100. data/registry/icons/tabler/folder.svg +16 -0
  101. data/registry/icons/tabler/keyboard.svg +23 -0
  102. data/registry/icons/tabler/minus.svg +16 -0
  103. data/registry/icons/tabler/package.svg +20 -0
  104. data/registry/icons/tabler/percentage.svg +18 -0
  105. data/registry/icons/tabler/player-pause.svg +17 -0
  106. data/registry/icons/tabler/printer.svg +18 -0
  107. data/registry/icons/tabler/receipt.svg +16 -0
  108. data/registry/icons/tabler/sun-moon.svg +21 -0
  109. data/registry/icons/tabler/truck.svg +18 -0
  110. data/registry/icons/tabler/user-plus.svg +19 -0
  111. data/registry/icons/tabler/volume-3.svg +17 -0
  112. data/registry/icons/tabler/volume.svg +18 -0
  113. data/registry/icons/tabler/zoom-in.svg +19 -0
  114. data/registry/icons/tabler/zoom-out.svg +18 -0
  115. data/registry/icons.yml +19 -0
  116. data/registry/test/components/previews/ui/chart_preview/cash_flow.html.erb +6 -0
  117. data/registry/test/components/previews/ui/chart_preview/donut.html.erb +6 -0
  118. data/registry/test/components/previews/ui/chart_preview/margin.html.erb +6 -0
  119. data/registry/test/components/previews/ui/chart_preview/pie.html.erb +6 -0
  120. data/registry/test/components/previews/ui/chart_preview/sales.html.erb +6 -0
  121. data/registry/test/components/previews/ui/chart_preview/stock.html.erb +6 -0
  122. data/registry/test/components/previews/ui/chart_preview/takings.html.erb +8 -0
  123. data/registry/test/components/previews/ui/chart_preview.rb +46 -0
  124. data/registry/test/components/previews/ui/command_preview/_picked.html.erb +14 -0
  125. data/registry/test/components/previews/ui/command_preview/dialog.html.erb +24 -0
  126. data/registry/test/components/previews/ui/command_preview/inline.html.erb +16 -0
  127. data/registry/test/components/previews/ui/command_preview/playground.html.erb +15 -0
  128. data/registry/test/components/previews/ui/command_preview/server_search.html.erb +24 -0
  129. data/registry/test/components/previews/ui/command_preview/shortcuts.html.erb +12 -0
  130. data/registry/test/components/previews/ui/command_preview/till.html.erb +17 -0
  131. data/registry/test/components/previews/ui/command_preview.rb +25 -0
  132. data/registry/test/components/previews/ui/date_picker_preview/custom_presets.html.erb +6 -0
  133. data/registry/test/components/previews/ui/date_picker_preview/in_form.html.erb +11 -0
  134. data/registry/test/components/previews/ui/date_picker_preview/range.html.erb +5 -0
  135. data/registry/test/components/previews/ui/date_picker_preview/states.html.erb +4 -3
  136. data/registry/test/components/previews/ui/date_picker_preview.rb +26 -6
  137. data/registry/test/components/previews/ui/file_field_preview/multiple_files.html.erb +1 -1
  138. data/registry/test/components/previews/ui/file_field_preview/product_photos.html.erb +12 -0
  139. data/registry/test/components/previews/ui/file_field_preview/single_image.html.erb +4 -0
  140. data/registry/test/components/previews/ui/file_field_preview.rb +32 -5
  141. data/registry/test/components/previews/ui/gallery_preview/hover_zoom.html.erb +13 -0
  142. data/registry/test/components/previews/ui/gallery_preview/landscape.html.erb +5 -0
  143. data/registry/test/components/previews/ui/gallery_preview/product_page.html.erb +13 -0
  144. data/registry/test/components/previews/ui/gallery_preview/single.html.erb +3 -0
  145. data/registry/test/components/previews/ui/gallery_preview.rb +45 -0
  146. data/registry/test/components/previews/ui/kbd_preview/bound.html.erb +20 -0
  147. data/registry/test/components/previews/ui/kbd_preview/keys.html.erb +13 -0
  148. data/registry/test/components/previews/ui/kbd_preview/menu.html.erb +13 -0
  149. data/registry/test/components/previews/ui/kbd_preview/search_field.html.erb +8 -0
  150. data/registry/test/components/previews/ui/kbd_preview/shortcuts_list.html.erb +17 -0
  151. data/registry/test/components/previews/ui/kbd_preview/till.html.erb +23 -0
  152. data/registry/test/components/previews/ui/kbd_preview/tooltip_and_buttons.html.erb +14 -0
  153. data/registry/test/components/previews/ui/kbd_preview.rb +32 -0
  154. data/registry/test/components/previews/ui/money_input_preview/cash_tendered.html.erb +24 -0
  155. data/registry/test/components/previews/ui/money_input_preview/currencies.html.erb +7 -0
  156. data/registry/test/components/previews/ui/money_input_preview/invoice.html.erb +24 -0
  157. data/registry/test/components/previews/ui/money_input_preview/sizes_and_states.html.erb +9 -0
  158. data/registry/test/components/previews/ui/money_input_preview.rb +34 -0
  159. data/registry/test/components/previews/ui/number_input_preview/cart.html.erb +11 -0
  160. data/registry/test/components/previews/ui/number_input_preview/decimals.html.erb +4 -0
  161. data/registry/test/components/previews/ui/number_input_preview/sizes.html.erb +5 -0
  162. data/registry/test/components/previews/ui/number_input_preview/states.html.erb +7 -0
  163. data/registry/test/components/previews/ui/number_input_preview/stock_adjustment.html.erb +3 -0
  164. data/registry/test/components/previews/ui/number_input_preview.rb +36 -0
  165. data/registry/test/components/previews/ui/progress_preview/file_upload.html.erb +36 -0
  166. data/registry/test/components/previews/ui/progress_preview/free_shipping.html.erb +4 -0
  167. data/registry/test/components/previews/ui/progress_preview/indeterminate.html.erb +4 -0
  168. data/registry/test/components/previews/ui/progress_preview/sizes_and_tones.html.erb +8 -0
  169. data/registry/test/components/previews/ui/progress_preview/steps.html.erb +9 -0
  170. data/registry/test/components/previews/ui/progress_preview/storage.html.erb +8 -0
  171. data/registry/test/components/previews/ui/progress_preview/storage_by_category.html.erb +7 -0
  172. data/registry/test/components/previews/ui/progress_preview/tasks_by_status.html.erb +14 -0
  173. data/registry/test/components/previews/ui/progress_preview/traffic_by_source.html.erb +15 -0
  174. data/registry/test/components/previews/ui/progress_preview.rb +46 -0
  175. data/registry/test/components/previews/ui/scan_input_preview/_simulate.html.erb +20 -0
  176. data/registry/test/components/previews/ui/scan_input_preview/library_checkout.html.erb +30 -0
  177. data/registry/test/components/previews/ui/scan_input_preview/playground.html.erb +13 -0
  178. data/registry/test/components/previews/ui/scan_input_preview/stock_count.html.erb +24 -0
  179. data/registry/test/components/previews/ui/scan_input_preview/ticket_check_in.html.erb +34 -0
  180. data/registry/test/components/previews/ui/scan_input_preview/till.html.erb +9 -0
  181. data/registry/test/components/previews/ui/scan_input_preview.rb +33 -0
  182. data/registry/test/components/previews/ui/select_preview/server_search.html.erb +22 -0
  183. data/registry/test/components/previews/ui/select_preview.rb +5 -0
  184. data/registry/test/components/previews/ui/slider_preview/named_steps.html.erb +7 -0
  185. data/registry/test/components/previews/ui/slider_preview/opening_hours.html.erb +5 -0
  186. data/registry/test/components/previews/ui/slider_preview/price_range.html.erb +6 -0
  187. data/registry/test/components/previews/ui/slider_preview/sizes_and_states.html.erb +9 -0
  188. data/registry/test/components/previews/ui/slider_preview/text_size.html.erb +16 -0
  189. data/registry/test/components/previews/ui/slider_preview/tip.html.erb +22 -0
  190. data/registry/test/components/previews/ui/slider_preview/volume.html.erb +5 -0
  191. data/registry/test/components/previews/ui/slider_preview.rb +45 -0
  192. data/registry/test/components/previews/ui/timeline_preview/activity_log.html.erb +7 -0
  193. data/registry/test/components/previews/ui/timeline_preview/colored.html.erb +7 -0
  194. data/registry/test/components/previews/ui/timeline_preview/colored_by_meaning.html.erb +7 -0
  195. data/registry/test/components/previews/ui/timeline_preview/failed_delivery.html.erb +6 -0
  196. data/registry/test/components/previews/ui/timeline_preview/order_status.html.erb +9 -0
  197. data/registry/test/components/previews/ui/timeline_preview/real_dates.html.erb +5 -0
  198. data/registry/test/components/previews/ui/timeline_preview/stock_history.html.erb +6 -0
  199. data/registry/test/components/previews/ui/timeline_preview.rb +40 -0
  200. data/registry/test/components/ui/chart_test.rb +187 -0
  201. data/registry/test/components/ui/command/group_test.rb +19 -0
  202. data/registry/test/components/ui/command/item_test.rb +47 -0
  203. data/registry/test/components/ui/command_test.rb +110 -0
  204. data/registry/test/components/ui/date_picker_test.rb +129 -111
  205. data/registry/test/components/ui/file_field_test.rb +105 -9
  206. data/registry/test/components/ui/gallery_test.rb +192 -0
  207. data/registry/test/components/ui/kbd_test.rb +150 -0
  208. data/registry/test/components/ui/money_input_test.rb +149 -0
  209. data/registry/test/components/ui/number_input_test.rb +155 -0
  210. data/registry/test/components/ui/progress_test.rb +188 -0
  211. data/registry/test/components/ui/scan_input_test.rb +110 -0
  212. data/registry/test/components/ui/select_test.rb +62 -0
  213. data/registry/test/components/ui/slider_test.rb +190 -0
  214. data/registry/test/components/ui/timeline_test.rb +175 -0
  215. metadata +188 -2
  216. data/registry/app/javascript/cally.ts +0 -8
@@ -0,0 +1,17 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-file"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M14 3v4a1 1 0 0 0 1 1h4" />
16
+ <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2" />
17
+ </svg>
@@ -0,0 +1,16 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-folder"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2" />
16
+ </svg>
@@ -0,0 +1,23 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-keyboard"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M2 8a2 2 0 0 1 2 -2h16a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-16a2 2 0 0 1 -2 -2l0 -8" />
16
+ <path d="M6 10l0 .01" />
17
+ <path d="M10 10l0 .01" />
18
+ <path d="M14 10l0 .01" />
19
+ <path d="M18 10l0 .01" />
20
+ <path d="M6 14l0 .01" />
21
+ <path d="M18 14l0 .01" />
22
+ <path d="M10 14l4 .01" />
23
+ </svg>
@@ -0,0 +1,16 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-minus"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M5 12l14 0" />
16
+ </svg>
@@ -0,0 +1,20 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-package"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M12 3l8 4.5l0 9l-8 4.5l-8 -4.5l0 -9l8 -4.5" />
16
+ <path d="M12 12l8 -4.5" />
17
+ <path d="M12 12l0 9" />
18
+ <path d="M12 12l-8 -4.5" />
19
+ <path d="M16 5.25l-8 4.5" />
20
+ </svg>
@@ -0,0 +1,18 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-percentage"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M16 17a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
16
+ <path d="M6 7a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" />
17
+ <path d="M6 18l12 -12" />
18
+ </svg>
@@ -0,0 +1,17 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-player-pause"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M6 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12" />
16
+ <path d="M14 6a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1l0 -12" />
17
+ </svg>
@@ -0,0 +1,18 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-printer"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M17 17h2a2 2 0 0 0 2 -2v-4a2 2 0 0 0 -2 -2h-14a2 2 0 0 0 -2 2v4a2 2 0 0 0 2 2h2" />
16
+ <path d="M17 9v-4a2 2 0 0 0 -2 -2h-6a2 2 0 0 0 -2 2v4" />
17
+ <path d="M7 15a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-6a2 2 0 0 1 -2 -2l0 -4" />
18
+ </svg>
@@ -0,0 +1,16 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-receipt"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2m4 -14h6m-6 4h6m-2 4h2" />
16
+ </svg>
@@ -0,0 +1,21 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-sun-moon"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M9.173 14.83a4 4 0 1 1 5.657 -5.657" />
16
+ <path d="M11.294 12.707l.174 .247a7.5 7.5 0 0 0 8.845 2.492a9 9 0 0 1 -14.671 2.914" />
17
+ <path d="M3 12h1" />
18
+ <path d="M12 3v1" />
19
+ <path d="M5.6 5.6l.7 .7" />
20
+ <path d="M3 21l18 -18" />
21
+ </svg>
@@ -0,0 +1,18 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-truck"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M5 17a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
16
+ <path d="M15 17a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />
17
+ <path d="M5 17h-2v-11a1 1 0 0 1 1 -1h9v12m-4 0h6m4 0h2v-6h-8m0 -5h5l3 5" />
18
+ </svg>
@@ -0,0 +1,19 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-user-plus"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0" />
16
+ <path d="M16 19h6" />
17
+ <path d="M19 16v6" />
18
+ <path d="M6 21v-2a4 4 0 0 1 4 -4h4" />
19
+ </svg>
@@ -0,0 +1,17 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-volume-3"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a.8 .8 0 0 1 1.5 .5v14a.8 .8 0 0 1 -1.5 .5l-3.5 -4.5" />
16
+ <path d="M16 10l4 4m0 -4l-4 4" />
17
+ </svg>
@@ -0,0 +1,18 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-volume"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M15 8a5 5 0 0 1 0 8" />
16
+ <path d="M17.7 5a9 9 0 0 1 0 14" />
17
+ <path d="M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a.8 .8 0 0 1 1.5 .5v14a.8 .8 0 0 1 -1.5 .5l-3.5 -4.5" />
18
+ </svg>
@@ -0,0 +1,19 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-zoom-in"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" />
16
+ <path d="M7 10l6 0" />
17
+ <path d="M10 7l0 6" />
18
+ <path d="M21 21l-6 -6" />
19
+ </svg>
@@ -0,0 +1,18 @@
1
+ <!-- @license @tabler/icons v3.50.0 - MIT -->
2
+ <svg
3
+ xmlns="http://www.w3.org/2000/svg"
4
+ width="24"
5
+ height="24"
6
+ viewBox="0 0 24 24"
7
+ fill="none"
8
+ stroke="currentColor"
9
+ stroke-width="2"
10
+ stroke-linecap="round"
11
+ stroke-linejoin="round"
12
+ class="icon icon-tabler icons-tabler-outline icon-tabler-zoom-out"
13
+ >
14
+ <path stroke="none" d="M0 0h24v24H0z" fill="none" />
15
+ <path d="M3 10a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" />
16
+ <path d="M7 10l6 0" />
17
+ <path d="M21 21l-6 -6" />
18
+ </svg>
data/registry/icons.yml CHANGED
@@ -27,11 +27,15 @@ circle-alert: { tabler: alert-circle, phosphor: warning-circle }
27
27
  circle-check: { tabler: circle-check, phosphor: check-circle }
28
28
  cloud: { tabler: cloud, phosphor: cloud }
29
29
  credit-card: { tabler: credit-card, phosphor: credit-card }
30
+ download: { tabler: download, phosphor: download-simple }
30
31
  ellipsis: { tabler: dots, phosphor: dots-three }
31
32
  ellipsis-vertical: { tabler: dots-vertical, phosphor: dots-three-vertical }
32
33
  eye: { tabler: eye, phosphor: eye }
33
34
  eye-off: { tabler: eye-off, phosphor: eye-slash }
35
+ file: { tabler: file, phosphor: file }
36
+ file-plus: { tabler: file-plus, phosphor: file-plus }
34
37
  file-text: { tabler: file-text, phosphor: file-text }
38
+ folder: { tabler: folder, phosphor: folder }
35
39
  folder-kanban: { tabler: layout-kanban, phosphor: kanban }
36
40
  git-branch: { tabler: git-branch, phosphor: git-branch }
37
41
  globe: { tabler: world, phosphor: globe }
@@ -41,6 +45,7 @@ home: { tabler: home, phosphor: house }
41
45
  inbox: { tabler: inbox, phosphor: tray }
42
46
  info: { tabler: info-circle, phosphor: info }
43
47
  italic: { tabler: italic, phosphor: text-italic }
48
+ keyboard: { tabler: keyboard, phosphor: keyboard }
44
49
  layout-dashboard: { tabler: layout-dashboard, phosphor: squares-four }
45
50
  layout-grid: { tabler: layout-grid, phosphor: grid-four }
46
51
  life-buoy: { tabler: lifebuoy, phosphor: lifebuoy }
@@ -51,24 +56,38 @@ log-out: { tabler: logout, phosphor: sign-out }
51
56
  mail: { tabler: mail, phosphor: envelope }
52
57
  menu: { tabler: menu-2, phosphor: list }
53
58
  message-circle: { tabler: message-circle, phosphor: chat-circle }
59
+ minus: { tabler: minus, phosphor: minus }
54
60
  monitor: { tabler: device-desktop, phosphor: desktop }
55
61
  moon: { tabler: moon, phosphor: moon }
56
62
  newspaper: { tabler: news, phosphor: newspaper }
63
+ package: { tabler: package, phosphor: package }
57
64
  panel-left: { tabler: layout-sidebar, phosphor: sidebar }
65
+ pause: { tabler: player-pause, phosphor: pause }
66
+ percent: { tabler: percentage, phosphor: percent }
58
67
  plus: { tabler: plus, phosphor: plus }
68
+ printer: { tabler: printer, phosphor: printer }
59
69
  qr-code: { tabler: qrcode, phosphor: qr-code }
70
+ receipt: { tabler: receipt, phosphor: receipt }
60
71
  rocket: { tabler: rocket, phosphor: rocket }
61
72
  rotate-cw: { tabler: rotate-clockwise, phosphor: arrow-clockwise }
73
+ scan-barcode: { tabler: barcode, phosphor: barcode }
62
74
  search: { tabler: search, phosphor: magnifying-glass }
63
75
  settings: { tabler: settings, phosphor: gear }
64
76
  shield: { tabler: shield, phosphor: shield }
65
77
  shield-check: { tabler: shield-check, phosphor: shield-check }
66
78
  store: { tabler: building-store, phosphor: storefront }
67
79
  sun: { tabler: sun, phosphor: sun }
80
+ sun-moon: { tabler: sun-moon, phosphor: circle-half }
68
81
  trash-2: { tabler: trash, phosphor: trash }
82
+ truck: { tabler: truck, phosphor: truck }
69
83
  underline: { tabler: underline, phosphor: text-underline }
70
84
  upload: { tabler: upload, phosphor: upload-simple }
71
85
  user: { tabler: user, phosphor: user }
86
+ user-plus: { tabler: user-plus, phosphor: user-plus }
72
87
  users: { tabler: users, phosphor: users }
88
+ volume-2: { tabler: volume, phosphor: speaker-high }
89
+ volume-x: { tabler: volume-3, phosphor: speaker-x }
73
90
  workflow: { tabler: sitemap, phosphor: flow-arrow }
74
91
  x: { tabler: x, phosphor: x }
92
+ zoom-in: { tabler: zoom-in, phosphor: magnifying-glass-plus }
93
+ zoom-out: { tabler: zoom-out, phosphor: magnifying-glass-minus }
@@ -0,0 +1,6 @@
1
+ <div class="max-w-2xl space-y-1">
2
+ <h3 class="font-semibold">Net cash flow</h3>
3
+ <%= render(UI::Chart.new(type: :bar, format: :currency, label: "Net cash flow by month",
4
+ labels: UI::ChartPreview::MONTHS.first(8),
5
+ series: [ { name: "Net cash flow", data: [ 4200, -1800, 2600, 3900, -2400, 1500, 5100, -600 ] } ])) %>
6
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="max-w-2xl space-y-1">
2
+ <h3 class="font-semibold">Stock by warehouse</h3>
3
+ <%= render(UI::Chart.new(type: :donut, label: "Units in stock by warehouse", height: 240,
4
+ labels: [ "Bengaluru", "Mumbai", "Delhi", "Chennai", "Other" ],
5
+ series: [ { name: "Units", data: [ 1840, 1320, 960, 610, 270 ] } ])) %>
6
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="max-w-2xl space-y-1">
2
+ <h3 class="font-semibold">Gross margin</h3>
3
+ <%= render(UI::Chart.new(type: :line, format: :percent, label: "Gross margin by month", height: 220,
4
+ labels: UI::ChartPreview::MONTHS.first(9),
5
+ series: [ { name: "Gross margin", data: [ 38.2, 39.5, 37.1, 40.8, 41.6, nil, 42.3, 43.9, 44.1 ] } ])) %>
6
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="max-w-2xl space-y-1">
2
+ <h3 class="font-semibold">Today's takings, by payment</h3>
3
+ <%= render(UI::Chart.new(type: :pie, format: :currency, label: "Today's takings, by payment", height: 240,
4
+ labels: [ "Card", "Cash", "UPI", "Store credit" ],
5
+ series: [ { name: "Takings", data: [ 4260, 1310, 980, 240 ] } ])) %>
6
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="max-w-2xl space-y-1">
2
+ <h3 class="font-semibold">Sales, this year and last</h3>
3
+ <%= render(UI::Chart.new(type: :line, format: :currency, label: "Sales, this year and last",
4
+ labels: UI::ChartPreview::MONTHS,
5
+ series: [ { name: "This year", data: UI::ChartPreview::THIS_YEAR }, { name: "Last year", data: UI::ChartPreview::LAST_YEAR } ])) %>
6
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="max-w-2xl space-y-1">
2
+ <h3 class="font-semibold">Units in stock</h3>
3
+ <%= render(UI::Chart.new(type: :bar, label: "Units in stock by category",
4
+ labels: [ "Mugs", "Plates", "Bowls", "Glasses", "Cutlery", "Linen" ],
5
+ series: [ { name: "In stock", data: [ 148, 96, 121, 64, 212, 38 ] } ])) %>
6
+ </div>
@@ -0,0 +1,8 @@
1
+ <div class="max-w-2xl space-y-1">
2
+ <h3 class="font-semibold">Takings this week, by payment</h3>
3
+ <%= render(UI::Chart.new(type: :bar, stacked: true, format: :currency, label: "Takings this week, by payment",
4
+ labels: %w[Mon Tue Wed Thu Fri Sat Sun],
5
+ series: [ { name: "Card", data: [ 1840, 2210, 1960, 2480, 3120, 4260, 3380 ] },
6
+ { name: "Cash", data: [ 620, 540, 710, 680, 940, 1310, 1020 ] },
7
+ { name: "UPI", data: [ 410, 520, 480, 610, 760, 980, 830 ] } ])) %>
8
+ </div>
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ class UI::ChartPreview < ViewComponent::Preview
4
+ MONTHS = %w[Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec].freeze
5
+ THIS_YEAR = [ 42_800, 39_100, 47_600, 51_200, 49_800, 56_300, 61_900, 58_400, 63_700, 66_100, 71_800, 84_500 ].freeze
6
+ LAST_YEAR = [ 38_200, 36_900, 41_300, 44_800, 46_100, 48_700, 52_300, 51_900, 55_400, 57_800, 62_100, 73_200 ].freeze
7
+
8
+ # @label Playground
9
+ # @param type select { choices: [line, bar, pie, donut] }
10
+ # @param stacked toggle
11
+ # @param series_count number { min: 1, max: 5 }
12
+ # @param format select { choices: [number, currency, percent] }
13
+ def playground(type: :bar, stacked: false, series_count: 2, format: :number)
14
+ names = %w[North South East West Online]
15
+ # A pie or donut is one series, a slice per label, five at most.
16
+ circular = %w[pie donut].include?(type.to_s)
17
+ series_count = 1 if circular
18
+ points = circular ? 5 : 6
19
+ series = names.first(series_count.to_i).each_with_index.map do |name, i|
20
+ { name: name, data: [ 120, 140, 135, 160, 172, 158 ].first(points).map { |v| v - (i * 18) + ((i * 7) % 11) } }
21
+ end
22
+ render(UI::Chart.new(type: type.to_sym, stacked: stacked, format: format.to_sym, label: "Orders by region",
23
+ labels: MONTHS.first(points), series: series, class: "max-w-2xl"))
24
+ end
25
+
26
+ # @label Sales, This Year and Last
27
+ def sales; render_with_template; end
28
+
29
+ # @label Stock by Category
30
+ def stock; render_with_template; end
31
+
32
+ # @label Takings by Payment, Stacked
33
+ def takings; render_with_template; end
34
+
35
+ # @label Cash Flow, Below Zero
36
+ def cash_flow; render_with_template; end
37
+
38
+ # @label Percentages
39
+ def margin; render_with_template; end
40
+
41
+ # @label Pie
42
+ def pie; render_with_template; end
43
+
44
+ # @label Donut, with Its Total
45
+ def donut; render_with_template; end
46
+ end
@@ -0,0 +1,14 @@
1
+ <%# Shows what was picked, instead of going there, so the demo stays on this page. %>
2
+ <p class="mt-4 text-sm text-muted-foreground" data-demo="picked" role="status">Nothing picked yet.</p>
3
+ <script>
4
+ (() => {
5
+ const out = document.currentScript.previousElementSibling;
6
+ const root = out.parentElement;
7
+ root.addEventListener("ui--command:select", (event) => {
8
+ event.preventDefault();
9
+ event.target.closest("dialog")?.close();
10
+ const { label, value, href } = event.detail;
11
+ out.textContent = `Picked "${label}"${href ? `, going to ${href}` : `, value ${value}`}`;
12
+ });
13
+ })();
14
+ </script>
@@ -0,0 +1,24 @@
1
+ <%# Press ⌘K (Ctrl+K off a Mac) anywhere on the page, or click the button. %>
2
+ <div>
3
+ <%= render(UI::Command.new(dialog: true)) do |command| %>
4
+ <% command.with_trigger(class: "w-72") %>
5
+ <% command.with_group(heading: "Pages") do |group| %>
6
+ <% group.with_item(label: "Dashboard", href: "/dashboard", icon: "layout-dashboard", shortcut: %w[g d]) %>
7
+ <% group.with_item(label: "Projects", href: "/projects", icon: "folder", shortcut: %w[g p]) %>
8
+ <% group.with_item(label: "Calendar", href: "/calendar", icon: "calendar") %>
9
+ <% group.with_item(label: "Reports", href: "/reports", icon: "chart-column", description: "Revenue, usage and growth") %>
10
+ <% group.with_item(label: "Settings", href: "/settings", icon: "settings", shortcut: "mod+,") %>
11
+ <% end %>
12
+ <% command.with_group(heading: "Actions") do |group| %>
13
+ <% group.with_item(label: "New project", value: "new-project", icon: "plus", keywords: "create add") %>
14
+ <% group.with_item(label: "Invite people", value: "invite", icon: "user-plus", keywords: "team member colleague") %>
15
+ <% group.with_item(label: "Switch theme", value: "theme", icon: "sun-moon", keywords: "dark light mode") %>
16
+ <% group.with_item(label: "Export data", value: "export", icon: "download", disabled: true, description: "Available on the Team plan") %>
17
+ <% end %>
18
+ <% command.with_group(heading: "Help") do |group| %>
19
+ <% group.with_item(label: "Keyboard shortcuts", value: "shortcuts", icon: "keyboard", shortcut: "?") %>
20
+ <% group.with_item(label: "Contact support", value: "support", icon: "life-buoy", keywords: "help chat email") %>
21
+ <% end %>
22
+ <% end %>
23
+ <%= render "ui/command_preview/picked" %>
24
+ </div>
@@ -0,0 +1,16 @@
1
+ <%# Not in a dialog: a search box with its list, on the page, like a help centre's. %>
2
+ <div class="max-w-md">
3
+ <%= render(UI::Command.new(placeholder: "Search help articles…", label: "Help articles")) do |command| %>
4
+ <% command.with_group(heading: "Getting started") do |group| %>
5
+ <% group.with_item(label: "Create your account", href: "#account", icon: "file-text") %>
6
+ <% group.with_item(label: "Invite your team", href: "#team", icon: "file-text", keywords: "colleagues members") %>
7
+ <% group.with_item(label: "Import from a spreadsheet", href: "#import", icon: "file-text", keywords: "csv excel upload") %>
8
+ <% end %>
9
+ <% command.with_group(heading: "Billing") do |group| %>
10
+ <% group.with_item(label: "Change your plan", href: "#plan", icon: "file-text", keywords: "upgrade downgrade") %>
11
+ <% group.with_item(label: "Download invoices", href: "#invoices", icon: "file-text", keywords: "receipt pdf") %>
12
+ <% group.with_item(label: "Cancel your subscription", href: "#cancel", icon: "file-text") %>
13
+ <% end %>
14
+ <% end %>
15
+ <%= render "ui/command_preview/picked" %>
16
+ </div>
@@ -0,0 +1,15 @@
1
+ <div>
2
+ <%= render(UI::Command.new(dialog: dialog, placeholder: placeholder, class: ("max-w-md" unless dialog))) do |command| %>
3
+ <% command.with_trigger(class: "w-64") if dialog %>
4
+ <% command.with_group(heading: "Pages") do |group| %>
5
+ <% group.with_item(label: "Dashboard", href: "/dashboard", icon: "layout-dashboard") %>
6
+ <% group.with_item(label: "Projects", href: "/projects", icon: "folder") %>
7
+ <% group.with_item(label: "Calendar", href: "/calendar", icon: "calendar") %>
8
+ <% end %>
9
+ <% command.with_group(heading: "Actions") do |group| %>
10
+ <% group.with_item(label: "New project", value: "new-project", icon: "plus", keywords: "create add") %>
11
+ <% group.with_item(label: "Invite people", value: "invite", icon: "user-plus", keywords: "team member") %>
12
+ <% end %>
13
+ <% end %>
14
+ <%= render "ui/command_preview/picked" %>
15
+ </div>
@@ -0,0 +1,24 @@
1
+ <%#
2
+ Pages and actions are on the page; customers come from the server as you
3
+ type. Try "rao" or "kapoor". The endpoint answers GET /search?q=… like this:
4
+
5
+ def search
6
+ customers = Customer.where("name ILIKE ?", "%#{params[:q]}%").limit(6)
7
+ render json: customers.map { |c|
8
+ { label: c.name, href: customer_path(c), description: c.email, group: "Customers" }
9
+ }
10
+ end
11
+ %>
12
+ <div>
13
+ <%= render(UI::Command.new(dialog: true, url: "/demo/search", placeholder: "Search customers, pages and actions…")) do |command| %>
14
+ <% command.with_trigger(label: "Search customers…", class: "w-72") %>
15
+ <% command.with_group(heading: "Pages") do |group| %>
16
+ <% group.with_item(label: "Customers", href: "/customers", icon: "users") %>
17
+ <% group.with_item(label: "Invoices", href: "/invoices", icon: "receipt", keywords: "bills") %>
18
+ <% end %>
19
+ <% command.with_group(heading: "Actions") do |group| %>
20
+ <% group.with_item(label: "New customer", value: "new-customer", icon: "user-plus", keywords: "add create") %>
21
+ <% end %>
22
+ <% end %>
23
+ <%= render "ui/command_preview/picked" %>
24
+ </div>
@@ -0,0 +1,12 @@
1
+ <%# bind: true makes an item's shortcut pick it from anywhere, with the palette closed. Try ⌥N or ⌥I (Alt off a Mac). %>
2
+ <div>
3
+ <%= render(UI::Command.new(dialog: true)) do |command| %>
4
+ <% command.with_trigger(class: "w-72") %>
5
+ <% command.with_group(heading: "Actions") do |group| %>
6
+ <% group.with_item(label: "New document", value: "new-document", icon: "file-plus", shortcut: "alt+n", bind: true) %>
7
+ <% group.with_item(label: "Invite people", value: "invite", icon: "user-plus", shortcut: "alt+i", bind: true) %>
8
+ <% group.with_item(label: "Print", value: "print", icon: "printer", shortcut: "alt+p", bind: true, disabled: true, description: "Nothing to print yet") %>
9
+ <% end %>
10
+ <% end %>
11
+ <%= render "ui/command_preview/picked" %>
12
+ </div>
@@ -0,0 +1,17 @@
1
+ <%# A point-of-sale till: F3 opens it, type part of a product's name or code, Enter adds it. %>
2
+ <div>
3
+ <%= render(UI::Command.new(dialog: true, shortcut: "F3", placeholder: "Product name or code…", label: "Add to sale")) do |command| %>
4
+ <% command.with_trigger(label: "Add a product", class: "w-64") %>
5
+ <% command.with_group(heading: "Products") do |group| %>
6
+ <% [["Basmati rice, 5 kg", "RIC-005", "$12.40"], ["Toor dal, 1 kg", "DAL-001", "$3.10"], ["Sunflower oil, 1 L", "OIL-101", "$2.85"],
7
+ ["Ghee, 500 g", "GHE-500", "$7.20"], ["Masala chai, 250 g", "TEA-250", "$4.50"], ["Wheat flour, 10 kg", "ATA-010", "$9.90"]].each do |name, code, price| %>
8
+ <% group.with_item(label: name, value: code, keywords: code, description: "#{code} · #{price}") %>
9
+ <% end %>
10
+ <% end %>
11
+ <% command.with_group(heading: "Sale") do |group| %>
12
+ <% group.with_item(label: "Hold this sale", value: "hold", icon: "pause") %>
13
+ <% group.with_item(label: "Apply a discount", value: "discount", icon: "percent", shortcut: "F6") %>
14
+ <% end %>
15
+ <% end %>
16
+ <%= render "ui/command_preview/picked" %>
17
+ </div>