kiso 0.1.0.pre → 0.2.0.pre

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 (236) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -2
  3. data/README.md +67 -27
  4. data/Rakefile +8 -0
  5. data/app/assets/tailwind/kiso/checkbox.css +18 -0
  6. data/app/assets/tailwind/kiso/color-mode.css +9 -0
  7. data/app/assets/tailwind/kiso/dashboard.css +194 -0
  8. data/app/assets/tailwind/kiso/engine.css +117 -0
  9. data/app/assets/tailwind/kiso/input-otp.css +10 -0
  10. data/app/assets/tailwind/kiso/radio-group.css +17 -0
  11. data/app/helpers/kiso/component_helper.rb +46 -27
  12. data/app/helpers/kiso/icon_helper.rb +53 -9
  13. data/app/helpers/kiso/theme_helper.rb +38 -0
  14. data/app/javascript/controllers/kiso/combobox_controller.js +616 -0
  15. data/app/javascript/controllers/kiso/command_controller.js +184 -0
  16. data/app/javascript/controllers/kiso/command_dialog_controller.js +104 -0
  17. data/app/javascript/controllers/kiso/dropdown_menu_controller.js +684 -0
  18. data/app/javascript/controllers/kiso/index.d.ts +12 -0
  19. data/app/javascript/controllers/kiso/index.js +42 -0
  20. data/app/javascript/controllers/kiso/input_otp_controller.js +195 -0
  21. data/app/javascript/controllers/kiso/popover_controller.js +254 -0
  22. data/app/javascript/controllers/kiso/select_controller.js +307 -0
  23. data/app/javascript/controllers/kiso/sidebar_controller.js +84 -0
  24. data/app/javascript/controllers/kiso/theme_controller.js +89 -0
  25. data/app/javascript/controllers/kiso/toggle_controller.js +24 -0
  26. data/app/javascript/controllers/kiso/toggle_group_controller.js +128 -0
  27. data/app/javascript/kiso/utils/focusable.js +8 -0
  28. data/app/javascript/kiso/utils/highlight.js +43 -0
  29. data/app/javascript/kiso/utils/positioning.js +86 -0
  30. data/app/javascript/kiso/vendor/floating-ui-core.js +1 -0
  31. data/app/javascript/kiso/vendor/floating-ui-dom.js +1 -0
  32. data/app/views/kiso/components/_alert.html.erb +1 -1
  33. data/app/views/kiso/components/_avatar.html.erb +23 -0
  34. data/app/views/kiso/components/_badge.html.erb +1 -1
  35. data/app/views/kiso/components/_breadcrumb.html.erb +8 -0
  36. data/app/views/kiso/components/_button.html.erb +1 -1
  37. data/app/views/kiso/components/_card.html.erb +1 -1
  38. data/app/views/kiso/components/_checkbox.html.erb +7 -0
  39. data/app/views/kiso/components/_color_mode_button.html.erb +14 -0
  40. data/app/views/kiso/components/_color_mode_select.html.erb +24 -0
  41. data/app/views/kiso/components/_combobox.html.erb +12 -0
  42. data/app/views/kiso/components/_command.html.erb +7 -0
  43. data/app/views/kiso/components/_dashboard_group.html.erb +14 -0
  44. data/app/views/kiso/components/_dashboard_navbar.html.erb +7 -0
  45. data/app/views/kiso/components/_dashboard_panel.html.erb +7 -0
  46. data/app/views/kiso/components/_dashboard_sidebar.html.erb +11 -0
  47. data/app/views/kiso/components/_dashboard_toolbar.html.erb +7 -0
  48. data/app/views/kiso/components/_dropdown_menu.html.erb +7 -0
  49. data/app/views/kiso/components/{_empty_state.html.erb → _empty.html.erb} +2 -2
  50. data/app/views/kiso/components/_field.html.erb +12 -0
  51. data/app/views/kiso/components/_field_group.html.erb +7 -0
  52. data/app/views/kiso/components/_field_set.html.erb +7 -0
  53. data/app/views/kiso/components/_input.html.erb +8 -0
  54. data/app/views/kiso/components/_input_group.html.erb +8 -0
  55. data/app/views/kiso/components/_input_otp.html.erb +22 -0
  56. data/app/views/kiso/components/_kbd.html.erb +7 -0
  57. data/app/views/kiso/components/_label.html.erb +5 -0
  58. data/app/views/kiso/components/_nav.html.erb +7 -0
  59. data/app/views/kiso/components/_pagination.html.erb +9 -0
  60. data/app/views/kiso/components/_popover.html.erb +8 -0
  61. data/app/views/kiso/components/_radio_group.html.erb +8 -0
  62. data/app/views/kiso/components/_select.html.erb +8 -0
  63. data/app/views/kiso/components/_select_native.html.erb +16 -0
  64. data/app/views/kiso/components/_separator.html.erb +1 -1
  65. data/app/views/kiso/components/_stats_card.html.erb +1 -1
  66. data/app/views/kiso/components/_stats_grid.html.erb +1 -1
  67. data/app/views/kiso/components/_switch.html.erb +10 -0
  68. data/app/views/kiso/components/_table.html.erb +2 -1
  69. data/app/views/kiso/components/_textarea.html.erb +9 -0
  70. data/app/views/kiso/components/_toggle.html.erb +12 -0
  71. data/app/views/kiso/components/_toggle_group.html.erb +12 -0
  72. data/app/views/kiso/components/alert/_description.html.erb +1 -1
  73. data/app/views/kiso/components/alert/_title.html.erb +1 -1
  74. data/app/views/kiso/components/avatar/_badge.html.erb +7 -0
  75. data/app/views/kiso/components/avatar/_fallback.html.erb +7 -0
  76. data/app/views/kiso/components/avatar/_group.html.erb +7 -0
  77. data/app/views/kiso/components/avatar/_group_count.html.erb +7 -0
  78. data/app/views/kiso/components/avatar/_image.html.erb +6 -0
  79. data/app/views/kiso/components/breadcrumb/_ellipsis.html.erb +10 -0
  80. data/app/views/kiso/components/breadcrumb/_item.html.erb +7 -0
  81. data/app/views/kiso/components/breadcrumb/_link.html.erb +7 -0
  82. data/app/views/kiso/components/breadcrumb/_list.html.erb +7 -0
  83. data/app/views/kiso/components/breadcrumb/_page.html.erb +9 -0
  84. data/app/views/kiso/components/breadcrumb/_separator.html.erb +9 -0
  85. data/app/views/kiso/components/card/_action.html.erb +7 -0
  86. data/app/views/kiso/components/card/_content.html.erb +1 -1
  87. data/app/views/kiso/components/card/_description.html.erb +1 -1
  88. data/app/views/kiso/components/card/_footer.html.erb +1 -1
  89. data/app/views/kiso/components/card/_header.html.erb +1 -1
  90. data/app/views/kiso/components/card/_title.html.erb +1 -1
  91. data/app/views/kiso/components/combobox/_chip.html.erb +19 -0
  92. data/app/views/kiso/components/combobox/_chips.html.erb +20 -0
  93. data/app/views/kiso/components/combobox/_chips_input.html.erb +10 -0
  94. data/app/views/kiso/components/combobox/_content.html.erb +9 -0
  95. data/app/views/kiso/components/combobox/_empty.html.erb +9 -0
  96. data/app/views/kiso/components/combobox/_group.html.erb +8 -0
  97. data/app/views/kiso/components/combobox/_input.html.erb +23 -0
  98. data/app/views/kiso/components/combobox/_item.html.erb +19 -0
  99. data/app/views/kiso/components/combobox/_label.html.erb +7 -0
  100. data/app/views/kiso/components/combobox/_list.html.erb +10 -0
  101. data/app/views/kiso/components/combobox/_separator.html.erb +6 -0
  102. data/app/views/kiso/components/command/_dialog.html.erb +11 -0
  103. data/app/views/kiso/components/command/_empty.html.erb +9 -0
  104. data/app/views/kiso/components/command/_group.html.erb +14 -0
  105. data/app/views/kiso/components/command/_input.html.erb +16 -0
  106. data/app/views/kiso/components/command/_item.html.erb +13 -0
  107. data/app/views/kiso/components/command/_list.html.erb +10 -0
  108. data/app/views/kiso/components/command/_separator.html.erb +7 -0
  109. data/app/views/kiso/components/command/_shortcut.html.erb +7 -0
  110. data/app/views/kiso/components/dashboard_navbar/_toggle.html.erb +11 -0
  111. data/app/views/kiso/components/dashboard_sidebar/_collapse.html.erb +12 -0
  112. data/app/views/kiso/components/dashboard_sidebar/_footer.html.erb +7 -0
  113. data/app/views/kiso/components/dashboard_sidebar/_header.html.erb +7 -0
  114. data/app/views/kiso/components/dashboard_sidebar/_toggle.html.erb +11 -0
  115. data/app/views/kiso/components/dashboard_toolbar/_left.html.erb +7 -0
  116. data/app/views/kiso/components/dashboard_toolbar/_right.html.erb +7 -0
  117. data/app/views/kiso/components/dropdown_menu/_checkbox_item.html.erb +18 -0
  118. data/app/views/kiso/components/dropdown_menu/_content.html.erb +10 -0
  119. data/app/views/kiso/components/dropdown_menu/_group.html.erb +8 -0
  120. data/app/views/kiso/components/dropdown_menu/_item.html.erb +15 -0
  121. data/app/views/kiso/components/dropdown_menu/_label.html.erb +8 -0
  122. data/app/views/kiso/components/dropdown_menu/_radio_group.html.erb +10 -0
  123. data/app/views/kiso/components/dropdown_menu/_radio_item.html.erb +19 -0
  124. data/app/views/kiso/components/dropdown_menu/_separator.html.erb +6 -0
  125. data/app/views/kiso/components/dropdown_menu/_shortcut.html.erb +7 -0
  126. data/app/views/kiso/components/dropdown_menu/_sub.html.erb +8 -0
  127. data/app/views/kiso/components/dropdown_menu/_sub_content.html.erb +10 -0
  128. data/app/views/kiso/components/dropdown_menu/_sub_trigger.html.erb +12 -0
  129. data/app/views/kiso/components/dropdown_menu/_trigger.html.erb +9 -0
  130. data/app/views/kiso/components/empty/_content.html.erb +7 -0
  131. data/app/views/kiso/components/empty/_description.html.erb +7 -0
  132. data/app/views/kiso/components/empty/_header.html.erb +7 -0
  133. data/app/views/kiso/components/empty/_media.html.erb +7 -0
  134. data/app/views/kiso/components/empty/_title.html.erb +7 -0
  135. data/app/views/kiso/components/field/_content.html.erb +7 -0
  136. data/app/views/kiso/components/field/_description.html.erb +7 -0
  137. data/app/views/kiso/components/field/_error.html.erb +22 -0
  138. data/app/views/kiso/components/field/_label.html.erb +5 -0
  139. data/app/views/kiso/components/field/_separator.html.erb +15 -0
  140. data/app/views/kiso/components/field/_title.html.erb +7 -0
  141. data/app/views/kiso/components/field_set/_legend.html.erb +9 -0
  142. data/app/views/kiso/components/input_group/_addon.html.erb +7 -0
  143. data/app/views/kiso/components/input_otp/_group.html.erb +7 -0
  144. data/app/views/kiso/components/input_otp/_separator.html.erb +8 -0
  145. data/app/views/kiso/components/input_otp/_slot.html.erb +11 -0
  146. data/app/views/kiso/components/kbd/_group.html.erb +7 -0
  147. data/app/views/kiso/components/nav/_item.html.erb +15 -0
  148. data/app/views/kiso/components/nav/_section.html.erb +37 -0
  149. data/app/views/kiso/components/nav/_section_title.html.erb +7 -0
  150. data/app/views/kiso/components/pagination/_content.html.erb +7 -0
  151. data/app/views/kiso/components/pagination/_ellipsis.html.erb +9 -0
  152. data/app/views/kiso/components/pagination/_item.html.erb +7 -0
  153. data/app/views/kiso/components/pagination/_link.html.erb +9 -0
  154. data/app/views/kiso/components/pagination/_next.html.erb +12 -0
  155. data/app/views/kiso/components/pagination/_previous.html.erb +12 -0
  156. data/app/views/kiso/components/popover/_anchor.html.erb +8 -0
  157. data/app/views/kiso/components/popover/_content.html.erb +11 -0
  158. data/app/views/kiso/components/popover/_description.html.erb +7 -0
  159. data/app/views/kiso/components/popover/_header.html.erb +7 -0
  160. data/app/views/kiso/components/popover/_title.html.erb +7 -0
  161. data/app/views/kiso/components/popover/_trigger.html.erb +9 -0
  162. data/app/views/kiso/components/radio_group/_item.html.erb +6 -0
  163. data/app/views/kiso/components/select/_content.html.erb +10 -0
  164. data/app/views/kiso/components/select/_group.html.erb +8 -0
  165. data/app/views/kiso/components/select/_item.html.erb +19 -0
  166. data/app/views/kiso/components/select/_label.html.erb +7 -0
  167. data/app/views/kiso/components/select/_separator.html.erb +6 -0
  168. data/app/views/kiso/components/select/_trigger.html.erb +13 -0
  169. data/app/views/kiso/components/select/_value.html.erb +11 -0
  170. data/app/views/kiso/components/stats_card/_description.html.erb +1 -1
  171. data/app/views/kiso/components/stats_card/_header.html.erb +1 -1
  172. data/app/views/kiso/components/stats_card/_label.html.erb +1 -1
  173. data/app/views/kiso/components/stats_card/_value.html.erb +1 -1
  174. data/app/views/kiso/components/table/_body.html.erb +1 -1
  175. data/app/views/kiso/components/table/_caption.html.erb +1 -1
  176. data/app/views/kiso/components/table/_cell.html.erb +1 -1
  177. data/app/views/kiso/components/table/_footer.html.erb +1 -1
  178. data/app/views/kiso/components/table/_head.html.erb +1 -1
  179. data/app/views/kiso/components/table/_header.html.erb +1 -1
  180. data/app/views/kiso/components/table/_row.html.erb +1 -1
  181. data/app/views/kiso/components/toggle_group/_item.html.erb +13 -0
  182. data/config/deploy.docs.yml +31 -0
  183. data/config/deploy.yml +34 -0
  184. data/config/importmap.rb +10 -0
  185. data/lib/kiso/cli/base.rb +15 -0
  186. data/lib/kiso/cli/icons.rb +2 -1
  187. data/lib/kiso/cli/main.rb +6 -0
  188. data/lib/kiso/cli/make.rb +22 -12
  189. data/lib/kiso/configuration.rb +54 -0
  190. data/lib/kiso/engine.rb +36 -1
  191. data/lib/kiso/theme_overrides.rb +130 -0
  192. data/lib/kiso/themes/alert.rb +16 -1
  193. data/lib/kiso/themes/avatar.rb +53 -0
  194. data/lib/kiso/themes/badge.rb +15 -5
  195. data/lib/kiso/themes/breadcrumb.rb +44 -0
  196. data/lib/kiso/themes/button.rb +15 -2
  197. data/lib/kiso/themes/card.rb +18 -2
  198. data/lib/kiso/themes/checkbox.rb +33 -0
  199. data/lib/kiso/themes/color_mode_button.rb +15 -0
  200. data/lib/kiso/themes/color_mode_select.rb +7 -0
  201. data/lib/kiso/themes/combobox.rb +97 -0
  202. data/lib/kiso/themes/command.rb +79 -0
  203. data/lib/kiso/themes/dashboard.rb +51 -0
  204. data/lib/kiso/themes/dropdown_menu.rb +108 -0
  205. data/lib/kiso/themes/empty.rb +54 -0
  206. data/lib/kiso/themes/field.rb +76 -0
  207. data/lib/kiso/themes/field_group.rb +15 -0
  208. data/lib/kiso/themes/field_set.rb +32 -0
  209. data/lib/kiso/themes/input.rb +33 -0
  210. data/lib/kiso/themes/input_group.rb +39 -0
  211. data/lib/kiso/themes/input_otp.rb +46 -0
  212. data/lib/kiso/themes/kbd.rb +31 -0
  213. data/lib/kiso/themes/label.rb +16 -0
  214. data/lib/kiso/themes/nav.rb +27 -0
  215. data/lib/kiso/themes/pagination.rb +73 -0
  216. data/lib/kiso/themes/popover.rb +32 -0
  217. data/lib/kiso/themes/radio_group.rb +43 -0
  218. data/lib/kiso/themes/select.rb +78 -0
  219. data/lib/kiso/themes/select_native.rb +49 -0
  220. data/lib/kiso/themes/separator.rb +8 -2
  221. data/lib/kiso/themes/shared.rb +51 -0
  222. data/lib/kiso/themes/stats_card.rb +26 -14
  223. data/lib/kiso/themes/switch.rb +56 -0
  224. data/lib/kiso/themes/table.rb +18 -15
  225. data/lib/kiso/themes/textarea.rb +33 -0
  226. data/lib/kiso/themes/toggle.rb +71 -0
  227. data/lib/kiso/themes/toggle_group.rb +13 -0
  228. data/lib/kiso/version.rb +4 -1
  229. data/lib/kiso.rb +70 -2
  230. metadata +183 -22
  231. data/app/views/kiso/components/empty_state/_content.html.erb +0 -7
  232. data/app/views/kiso/components/empty_state/_description.html.erb +0 -7
  233. data/app/views/kiso/components/empty_state/_header.html.erb +0 -7
  234. data/app/views/kiso/components/empty_state/_media.html.erb +0 -7
  235. data/app/views/kiso/components/empty_state/_title.html.erb +0 -7
  236. data/lib/kiso/themes/empty_state.rb +0 -42
@@ -0,0 +1,6 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= tag.div(
3
+ class: Kiso::Themes::DropdownMenuSeparator.render(class: css_classes),
4
+ role: "separator",
5
+ data: kiso_prepare_options(component_options, slot: "dropdown-menu-separator"),
6
+ **component_options) %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :span,
3
+ class: Kiso::Themes::DropdownMenuShortcut.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "dropdown-menu-shortcut"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::DropdownMenuSub.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "dropdown-menu-sub",
5
+ kiso__dropdown_menu_target: "sub"),
6
+ **component_options do %>
7
+ <%= yield %>
8
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::DropdownMenuSubContent.render(class: css_classes),
4
+ role: "menu",
5
+ data: kiso_prepare_options(component_options, slot: "dropdown-menu-sub-content",
6
+ kiso__dropdown_menu_target: "subContent"),
7
+ hidden: true,
8
+ **component_options do %>
9
+ <%= yield %>
10
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <%# locals: (inset: false, css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::DropdownMenuSubTrigger.render(class: css_classes),
4
+ tabindex: "-1",
5
+ data: kiso_prepare_options(component_options, slot: "dropdown-menu-sub-trigger",
6
+ kiso__dropdown_menu_target: "subTrigger",
7
+ action: "click->kiso--dropdown-menu#toggleSub mouseenter->kiso--dropdown-menu#openSubOnHover",
8
+ inset: (inset ? "" : nil)),
9
+ **component_options do %>
10
+ <%= yield %>
11
+ <%= kiso_component_icon(:chevron_right, class: "ml-auto size-4") %>
12
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::DropdownMenuTrigger.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "dropdown-menu-trigger",
5
+ kiso__dropdown_menu_target: "trigger",
6
+ action: "click->kiso--dropdown-menu#toggle keydown->kiso--dropdown-menu#triggerKeydown"),
7
+ **component_options do %>
8
+ <%= yield %>
9
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::EmptyContent.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "empty-content"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::EmptyDescription.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "empty-description"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::EmptyHeader.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "empty-header"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (variant: :default, css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::EmptyMedia.render(variant: variant, class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "empty-media"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::EmptyTitle.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "empty-title"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::FieldContent.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "field-content"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :p,
3
+ class: Kiso::Themes::FieldDescription.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "field-description"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <%# locals: (errors: [], css_classes: "", **component_options) %>
2
+ <% messages = Array(errors).compact.map(&:to_s).reject(&:blank?).uniq %>
3
+ <% content = capture { yield }.presence %>
4
+ <% if content || messages.any? %>
5
+ <%= content_tag :div,
6
+ role: :alert,
7
+ class: Kiso::Themes::FieldError.render(class: css_classes),
8
+ data: kiso_prepare_options(component_options, slot: "field-error"),
9
+ **component_options do %>
10
+ <% if content %>
11
+ <%= content %>
12
+ <% elsif messages.one? %>
13
+ <%= messages.first %>
14
+ <% else %>
15
+ <ul class="ml-4 flex list-disc flex-col gap-1">
16
+ <% messages.each do |msg| %>
17
+ <li><%= msg %></li>
18
+ <% end %>
19
+ </ul>
20
+ <% end %>
21
+ <% end %>
22
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <% component_options[:data] = (component_options[:data] || {}).merge(slot: "field-label") %>
3
+ <%= kui(:label,
4
+ css_classes: Kiso::Themes::FieldLabel.render(class: css_classes),
5
+ **component_options) { yield } %>
@@ -0,0 +1,15 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <% captured = capture { yield }.presence %>
3
+ <%= content_tag :div,
4
+ class: Kiso::Themes::FieldSeparator.render(class: css_classes),
5
+ data: kiso_prepare_options(component_options, slot: "field-separator").merge(
6
+ content: captured&.present? || nil
7
+ ).compact,
8
+ **component_options do %>
9
+ <%= kui(:separator, css_classes: "absolute inset-0 top-1/2") %>
10
+ <% if captured&.present? %>
11
+ <span class="<%= Kiso::Themes::FieldSeparatorText.render %>">
12
+ <%= captured %>
13
+ </span>
14
+ <% end %>
15
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::FieldTitle.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "field-title"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%# locals: (variant: :legend, css_classes: "", **component_options) %>
2
+ <%= content_tag :legend,
3
+ class: Kiso::Themes::FieldLegend.render(variant: variant, class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "field-set-legend").merge(
5
+ variant: variant
6
+ ),
7
+ **component_options do %>
8
+ <%= yield %>
9
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (align: :start, css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::InputGroupAddon.render(align: align, class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "input-group-addon"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::InputOtpGroup.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "input-otp-group"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ role: "separator",
4
+ class: Kiso::Themes::InputOtpSeparator.render(class: css_classes),
5
+ data: kiso_prepare_options(component_options, slot: "input-otp-separator"),
6
+ **component_options do %>
7
+ <%= capture { yield }.presence || kiso_component_icon(:minus) %>
8
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%# locals: (size: :md, css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::InputOtpSlot.render(size: size, class: css_classes),
4
+ aria: { hidden: "true" },
5
+ data: kiso_prepare_options(component_options, slot: "input-otp-slot",
6
+ kiso__input_otp_target: "slot") do %>
7
+ <span data-slot="input-otp-slot-char"></span>
8
+ <div data-slot="input-otp-caret" class="pointer-events-none absolute inset-0 flex items-center justify-center" hidden>
9
+ <div class="bg-foreground h-4 w-px animate-caret-blink"></div>
10
+ </div>
11
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :kbd,
3
+ class: Kiso::Themes::KbdGroup.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "kbd-group"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <%# locals: (href: "#", icon: nil, badge: nil, active: false, css_classes: "", **component_options) %>
2
+ <%= content_tag :a,
3
+ href: href,
4
+ class: Kiso::Themes::NavItem.render(class: css_classes),
5
+ data: kiso_prepare_options(component_options, slot: "nav-item", active: active || nil),
6
+ aria: active ? { current: "page" } : {},
7
+ **component_options do %>
8
+ <% if icon %>
9
+ <%= kiso_icon(icon, class: "size-4 shrink-0") %>
10
+ <% end %>
11
+ <span data-slot="nav-item-label" class="truncate"><%= yield %></span>
12
+ <% if badge %>
13
+ <span data-slot="nav-item-badge" class="<%= Kiso::Themes::NavItemBadge.render %>"><%= badge %></span>
14
+ <% end %>
15
+ <% end %>
@@ -0,0 +1,37 @@
1
+ <%# locals: (title: nil, open: true, collapsible: true, css_classes: "", **component_options) %>
2
+ <% if title && collapsible %>
3
+ <%= content_tag :details,
4
+ class: Kiso::Themes::NavSection.render(class: css_classes),
5
+ data: kiso_prepare_options(component_options, slot: "nav-section"),
6
+ open: open,
7
+ **component_options do %>
8
+ <summary class="<%= Kiso::Themes::NavSectionTitle.render %>" data-slot="nav-section-title">
9
+ <span class="truncate"><%= title %></span>
10
+ <span class="ml-auto" data-slot="nav-section-chevron">
11
+ <%= kiso_component_icon(:chevron_down, class: "size-4") %>
12
+ </span>
13
+ </summary>
14
+ <div data-slot="nav-section-content" class="<%= Kiso::Themes::NavSectionContent.render %>">
15
+ <%= yield %>
16
+ </div>
17
+ <% end %>
18
+ <% elsif title %>
19
+ <%= content_tag :div,
20
+ class: Kiso::Themes::NavSection.render(class: css_classes),
21
+ data: kiso_prepare_options(component_options, slot: "nav-section"),
22
+ **component_options do %>
23
+ <div class="<%= Kiso::Themes::NavSectionTitle.render %>" data-slot="nav-section-title">
24
+ <span class="truncate"><%= title %></span>
25
+ </div>
26
+ <div data-slot="nav-section-content" class="<%= Kiso::Themes::NavSectionContent.render %>">
27
+ <%= yield %>
28
+ </div>
29
+ <% end %>
30
+ <% else %>
31
+ <%= content_tag :div,
32
+ class: Kiso::Themes::NavSection.render(class: css_classes),
33
+ data: kiso_prepare_options(component_options, slot: "nav-section"),
34
+ **component_options do %>
35
+ <%= yield %>
36
+ <% end %>
37
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::NavSectionTitle.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "nav-section-title"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :ul,
3
+ class: Kiso::Themes::PaginationContent.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "pagination-content"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :span,
3
+ aria: {hidden: true},
4
+ class: Kiso::Themes::PaginationEllipsis.render(class: css_classes),
5
+ data: kiso_prepare_options(component_options, slot: "pagination-ellipsis"),
6
+ **component_options do %>
7
+ <%= kiso_component_icon(:ellipsis, size: :sm) %>
8
+ <%= content_tag :span, "More pages", class: "sr-only" %>
9
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :li,
3
+ class: Kiso::Themes::PaginationItem.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "pagination-item"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%# locals: (active: false, href: "#", css_classes: "", **component_options) %>
2
+ <%= content_tag :a,
3
+ href: href,
4
+ **(active ? {aria: {current: "page"}} : {}),
5
+ class: Kiso::Themes::PaginationLink.render(active: active, class: css_classes),
6
+ data: kiso_prepare_options(component_options, slot: "pagination-link", active: active),
7
+ **component_options do %>
8
+ <%= yield %>
9
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <%# locals: (href: "#", active: false, css_classes: "", **component_options) %>
2
+ <% aria_attrs = {label: "Go to next page"}
3
+ aria_attrs[:current] = "page" if active %>
4
+ <%= content_tag :a,
5
+ href: href,
6
+ aria: aria_attrs,
7
+ class: Kiso::Themes::PaginationNext.render(active: active, class: css_classes),
8
+ data: kiso_prepare_options(component_options, slot: "pagination-next"),
9
+ **component_options do %>
10
+ <%= content_tag :span, "Next", class: "hidden sm:block" %>
11
+ <%= kiso_component_icon(:chevron_right) %>
12
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <%# locals: (href: "#", active: false, css_classes: "", **component_options) %>
2
+ <% aria_attrs = {label: "Go to previous page"}
3
+ aria_attrs[:current] = "page" if active %>
4
+ <%= content_tag :a,
5
+ href: href,
6
+ aria: aria_attrs,
7
+ class: Kiso::Themes::PaginationPrevious.render(active: active, class: css_classes),
8
+ data: kiso_prepare_options(component_options, slot: "pagination-previous"),
9
+ **component_options do %>
10
+ <%= kiso_component_icon(:chevron_left) %>
11
+ <%= content_tag :span, "Previous", class: "hidden sm:block" %>
12
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: css_classes.presence,
4
+ data: kiso_prepare_options(component_options, slot: "popover-anchor",
5
+ kiso__popover_target: "anchor"),
6
+ **component_options do %>
7
+ <%= yield %>
8
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%# locals: (align: :center, css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::PopoverContent.render(class: css_classes),
4
+ role: "dialog",
5
+ data: kiso_prepare_options(component_options, slot: "popover-content",
6
+ kiso__popover_target: "content",
7
+ align: align),
8
+ hidden: true,
9
+ **component_options do %>
10
+ <%= yield %>
11
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :p,
3
+ class: Kiso::Themes::PopoverDescription.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "popover-description"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::PopoverHeader.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "popover-header"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::PopoverTitle.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "popover-title"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: css_classes.presence,
4
+ data: kiso_prepare_options(component_options, slot: "popover-trigger",
5
+ kiso__popover_target: "trigger",
6
+ action: "click->kiso--popover#toggle keydown->kiso--popover#triggerKeydown"),
7
+ **component_options do %>
8
+ <%= yield %>
9
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <%# locals: (color: :primary, css_classes: "", **component_options) %>
2
+ <% component_options[:type] = :radio %>
3
+ <%= tag.input(
4
+ class: Kiso::Themes::RadioGroupItem.render(color: color, class: css_classes),
5
+ data: kiso_prepare_options(component_options, slot: "radio-group-item"),
6
+ **component_options) %>
@@ -0,0 +1,10 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::SelectContent.render(class: css_classes),
4
+ role: "listbox",
5
+ data: kiso_prepare_options(component_options, slot: "select-content",
6
+ kiso__select_target: "content"),
7
+ hidden: true,
8
+ **component_options do %>
9
+ <%= yield %>
10
+ <% end %>
@@ -0,0 +1,8 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::SelectGroup.render(class: css_classes),
4
+ role: "group",
5
+ data: kiso_prepare_options(component_options, slot: "select-group"),
6
+ **component_options do %>
7
+ <%= yield %>
8
+ <% end %>
@@ -0,0 +1,19 @@
1
+ <%# locals: (value:, disabled: false, css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::SelectItem.render(class: css_classes),
4
+ role: "option",
5
+ tabindex: "-1",
6
+ data: kiso_prepare_options(component_options, slot: "select-item",
7
+ kiso__select_target: "item",
8
+ action: "click->kiso--select#selectItem",
9
+ value: value,
10
+ disabled: (disabled ? "true" : nil)),
11
+ aria: {selected: false, disabled: (disabled || nil)},
12
+ **component_options do %>
13
+ <%= tag.span class: Kiso::Themes::SelectItemIndicator.render,
14
+ data: { slot: "select-item-indicator", kiso__select_target: "indicator" },
15
+ hidden: true do %>
16
+ <%= kiso_component_icon(:check, class: "size-4") %>
17
+ <% end %>
18
+ <%= tag.span yield, data: { slot: "select-item-text" } %>
19
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= content_tag :div,
3
+ class: Kiso::Themes::SelectLabel.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "select-label"),
5
+ **component_options do %>
6
+ <%= yield %>
7
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <%# locals: (css_classes: "", **component_options) %>
2
+ <%= tag.div(
3
+ class: Kiso::Themes::SelectSeparator.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "select-separator"),
5
+ role: "separator",
6
+ **component_options) %>
@@ -0,0 +1,13 @@
1
+ <%# locals: (size: :md, disabled: false, css_classes: "", **component_options) %>
2
+ <% component_options[:disabled] = true if disabled %>
3
+ <%= content_tag :button,
4
+ type: "button",
5
+ class: Kiso::Themes::SelectTrigger.render(size: size, class: css_classes),
6
+ data: kiso_prepare_options(component_options, slot: "select-trigger",
7
+ kiso__select_target: "trigger",
8
+ action: "click->kiso--select#toggle keydown->kiso--select#triggerKeydown"),
9
+ aria: {haspopup: "listbox", expanded: false},
10
+ **component_options do %>
11
+ <%= yield %>
12
+ <%= kiso_component_icon(:chevron_down, class: "size-4 opacity-50") %>
13
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%# locals: (placeholder: nil, css_classes: "", **component_options) %>
2
+ <%= content_tag :span,
3
+ class: Kiso::Themes::SelectValue.render(class: css_classes),
4
+ data: kiso_prepare_options(component_options, slot: "select-value",
5
+ kiso__select_target: "valueDisplay",
6
+ placeholder: placeholder),
7
+ **component_options do %>
8
+ <% if placeholder %>
9
+ <span class="text-muted-foreground"><%= placeholder %></span>
10
+ <% end %>
11
+ <% end %>
@@ -1,7 +1,7 @@
1
1
  <%# locals: (css_classes: "", **component_options) %>
2
2
  <%= content_tag :div,
3
3
  class: Kiso::Themes::StatsCardDescription.render(class: css_classes),
4
- data: { component: :stats_card, stats_card_part: :description },
4
+ data: kiso_prepare_options(component_options, slot: "stats-card-description"),
5
5
  **component_options do %>
6
6
  <%= yield %>
7
7
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <%# locals: (css_classes: "", **component_options) %>
2
2
  <%= content_tag :div,
3
3
  class: Kiso::Themes::StatsCardHeader.render(class: css_classes),
4
- data: { component: :stats_card, stats_card_part: :header },
4
+ data: kiso_prepare_options(component_options, slot: "stats-card-header"),
5
5
  **component_options do %>
6
6
  <%= yield %>
7
7
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <%# locals: (css_classes: "", **component_options) %>
2
2
  <%= content_tag :div,
3
3
  class: Kiso::Themes::StatsCardLabel.render(class: css_classes),
4
- data: { component: :stats_card, stats_card_part: :label },
4
+ data: kiso_prepare_options(component_options, slot: "stats-card-label"),
5
5
  **component_options do %>
6
6
  <%= yield %>
7
7
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <%# locals: (css_classes: "", **component_options) %>
2
2
  <%= content_tag :div,
3
3
  class: Kiso::Themes::StatsCardValue.render(class: css_classes),
4
- data: { component: :stats_card, stats_card_part: :value },
4
+ data: kiso_prepare_options(component_options, slot: "stats-card-value"),
5
5
  **component_options do %>
6
6
  <%= yield %>
7
7
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <%# locals: (css_classes: "", **component_options) %>
2
2
  <%= content_tag :tbody,
3
3
  class: Kiso::Themes::TableBody.render(class: css_classes),
4
- data: { component: :table, table_part: :body },
4
+ data: kiso_prepare_options(component_options, slot: "table-body"),
5
5
  **component_options do %>
6
6
  <%= yield %>
7
7
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <%# locals: (css_classes: "", **component_options) %>
2
2
  <%= content_tag :caption,
3
3
  class: Kiso::Themes::TableCaption.render(class: css_classes),
4
- data: { component: :table, table_part: :caption },
4
+ data: kiso_prepare_options(component_options, slot: "table-caption"),
5
5
  **component_options do %>
6
6
  <%= yield %>
7
7
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <%# locals: (css_classes: "", **component_options) %>
2
2
  <%= content_tag :td,
3
3
  class: Kiso::Themes::TableCell.render(class: css_classes),
4
- data: { component: :table, table_part: :cell },
4
+ data: kiso_prepare_options(component_options, slot: "table-cell"),
5
5
  **component_options do %>
6
6
  <%= yield %>
7
7
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <%# locals: (css_classes: "", **component_options) %>
2
2
  <%= content_tag :tfoot,
3
3
  class: Kiso::Themes::TableFooter.render(class: css_classes),
4
- data: { component: :table, table_part: :footer },
4
+ data: kiso_prepare_options(component_options, slot: "table-footer"),
5
5
  **component_options do %>
6
6
  <%= yield %>
7
7
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <%# locals: (css_classes: "", **component_options) %>
2
2
  <%= content_tag :th,
3
3
  class: Kiso::Themes::TableHead.render(class: css_classes),
4
- data: { component: :table, table_part: :head },
4
+ data: kiso_prepare_options(component_options, slot: "table-head"),
5
5
  **component_options do %>
6
6
  <%= yield %>
7
7
  <% end %>