openproject-primer_view_components 0.94.0 → 0.96.0

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 (189) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/app/assets/javascripts/primer_view_components.js +11 -1
  4. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  5. data/app/assets/styles/primer_view_components.css +1 -1
  6. data/app/assets/styles/primer_view_components.css.map +1 -1
  7. data/app/components/primer/alpha/action_bar.css +1 -1
  8. data/app/components/primer/alpha/action_bar.css.map +1 -1
  9. data/app/components/primer/alpha/action_list/item.rb +5 -1
  10. data/app/components/primer/alpha/action_list.css +1 -1
  11. data/app/components/primer/alpha/action_list.css.json +13 -11
  12. data/app/components/primer/alpha/action_list.css.map +1 -1
  13. data/app/components/primer/alpha/action_list.pcss +12 -0
  14. data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +6 -0
  15. data/app/components/primer/alpha/action_menu/action_menu_element.js +389 -84
  16. data/app/components/primer/alpha/action_menu/action_menu_element.ts +439 -78
  17. data/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.d.ts +4 -1
  18. data/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.js +37 -13
  19. data/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.ts +41 -12
  20. data/app/components/primer/alpha/action_menu/menu.html.erb +27 -19
  21. data/app/components/primer/alpha/action_menu/menu.rb +7 -0
  22. data/app/components/primer/alpha/action_menu/primary_menu.rb +15 -0
  23. data/app/components/primer/alpha/action_menu.rb +55 -0
  24. data/app/components/primer/alpha/auto_complete.css +1 -1
  25. data/app/components/primer/alpha/auto_complete.css.map +1 -1
  26. data/app/components/primer/alpha/banner.css +1 -1
  27. data/app/components/primer/alpha/banner.css.map +1 -1
  28. data/app/components/primer/alpha/button_marketing.css +1 -1
  29. data/app/components/primer/alpha/button_marketing.css.map +1 -1
  30. data/app/components/primer/alpha/dialog.css +1 -1
  31. data/app/components/primer/alpha/dialog.css.map +1 -1
  32. data/app/components/primer/alpha/dropdown/menu.rb +1 -1
  33. data/app/components/primer/alpha/dropdown.css +1 -1
  34. data/app/components/primer/alpha/dropdown.css.json +1 -1
  35. data/app/components/primer/alpha/dropdown.css.map +1 -1
  36. data/app/components/primer/alpha/layout.css +1 -1
  37. data/app/components/primer/alpha/layout.css.json +3 -3
  38. data/app/components/primer/alpha/layout.css.map +1 -1
  39. data/app/components/primer/alpha/menu.css +1 -1
  40. data/app/components/primer/alpha/menu.css.json +3 -3
  41. data/app/components/primer/alpha/menu.css.map +1 -1
  42. data/app/components/primer/alpha/overlay.css +1 -1
  43. data/app/components/primer/alpha/overlay.css.map +1 -1
  44. data/app/components/primer/alpha/segmented_control.css +1 -1
  45. data/app/components/primer/alpha/segmented_control.css.json +1 -1
  46. data/app/components/primer/alpha/segmented_control.css.map +1 -1
  47. data/app/components/primer/alpha/select_panel.css +1 -1
  48. data/app/components/primer/alpha/select_panel.css.map +1 -1
  49. data/app/components/primer/alpha/skeleton_box.css +1 -1
  50. data/app/components/primer/alpha/skeleton_box.css.map +1 -1
  51. data/app/components/primer/alpha/stack.css +1 -1
  52. data/app/components/primer/alpha/stack.css.map +1 -1
  53. data/app/components/primer/alpha/stack_item.css +1 -1
  54. data/app/components/primer/alpha/stack_item.css.map +1 -1
  55. data/app/components/primer/alpha/tab_nav.css +1 -1
  56. data/app/components/primer/alpha/tab_nav.css.map +1 -1
  57. data/app/components/primer/alpha/text_field.css +1 -1
  58. data/app/components/primer/alpha/text_field.css.map +1 -1
  59. data/app/components/primer/alpha/toggle_switch.css +1 -1
  60. data/app/components/primer/alpha/toggle_switch.css.map +1 -1
  61. data/app/components/primer/alpha/tree_view.css +1 -1
  62. data/app/components/primer/alpha/tree_view.css.json +3 -3
  63. data/app/components/primer/alpha/tree_view.css.map +1 -1
  64. data/app/components/primer/alpha/underline_nav.css +1 -1
  65. data/app/components/primer/alpha/underline_nav.css.map +1 -1
  66. data/app/components/primer/beta/border_box.css +1 -1
  67. data/app/components/primer/beta/border_box.css.json +5 -5
  68. data/app/components/primer/beta/border_box.css.map +1 -1
  69. data/app/components/primer/beta/button.css +1 -1
  70. data/app/components/primer/beta/button.css.map +1 -1
  71. data/app/components/primer/beta/button.pcss +97 -0
  72. data/app/components/primer/beta/button.rb +15 -3
  73. data/app/components/primer/beta/counter.css +1 -1
  74. data/app/components/primer/beta/counter.css.map +1 -1
  75. data/app/components/primer/beta/flash.css +1 -1
  76. data/app/components/primer/beta/flash.css.map +1 -1
  77. data/app/components/primer/beta/link.css +1 -1
  78. data/app/components/primer/beta/link.css.json +1 -1
  79. data/app/components/primer/beta/link.css.map +1 -1
  80. data/app/components/primer/beta/popover.css +1 -1
  81. data/app/components/primer/beta/popover.css.map +1 -1
  82. data/app/components/primer/beta/progress_bar.css +1 -1
  83. data/app/components/primer/beta/progress_bar.css.map +1 -1
  84. data/app/components/primer/beta/relative_time.rb +7 -1
  85. data/app/components/primer/beta/state.css +1 -1
  86. data/app/components/primer/beta/state.css.json +2 -2
  87. data/app/components/primer/beta/state.css.map +1 -1
  88. data/app/components/primer/beta/timeline_item.css +1 -1
  89. data/app/components/primer/beta/timeline_item.css.map +1 -1
  90. data/app/components/primer/open_project/border_grid.css +1 -1
  91. data/app/components/primer/open_project/border_grid.css.map +1 -1
  92. data/app/components/primer/open_project/color_field.css +1 -1
  93. data/app/components/primer/open_project/color_field.css.map +1 -1
  94. data/app/components/primer/open_project/color_swatch.css +1 -0
  95. data/app/components/primer/open_project/color_swatch.css.json +6 -0
  96. data/app/components/primer/open_project/color_swatch.css.map +1 -0
  97. data/app/components/primer/open_project/color_swatch.pcss +8 -0
  98. data/app/components/primer/open_project/color_swatch.rb +57 -0
  99. data/app/components/primer/open_project/inline_message.css +1 -1
  100. data/app/components/primer/open_project/inline_message.css.map +1 -1
  101. data/app/components/primer/open_project/input_group.css +1 -1
  102. data/app/components/primer/open_project/input_group.css.map +1 -1
  103. data/app/components/primer/open_project/inset_box.css +1 -0
  104. data/app/components/primer/open_project/inset_box.css.json +9 -0
  105. data/app/components/primer/open_project/inset_box.css.map +1 -0
  106. data/app/components/primer/open_project/inset_box.html.erb +46 -0
  107. data/app/components/primer/open_project/inset_box.pcss +24 -0
  108. data/app/components/primer/open_project/inset_box.rb +63 -0
  109. data/app/components/primer/open_project/keybinding_hint/chords.d.ts +5 -0
  110. data/app/components/primer/open_project/keybinding_hint/chords.js +29 -0
  111. data/app/components/primer/open_project/keybinding_hint/chords.ts +38 -0
  112. data/app/components/primer/open_project/keybinding_hint/key_names.d.ts +16 -0
  113. data/app/components/primer/open_project/keybinding_hint/key_names.js +107 -0
  114. data/app/components/primer/open_project/keybinding_hint/key_names.ts +116 -0
  115. data/app/components/primer/open_project/keybinding_hint/localized_names.d.ts +22 -0
  116. data/app/components/primer/open_project/keybinding_hint/localized_names.js +47 -0
  117. data/app/components/primer/open_project/keybinding_hint/localized_names.ts +71 -0
  118. data/app/components/primer/open_project/keybinding_hint/names.rb +92 -0
  119. data/app/components/primer/open_project/keybinding_hint/names_from_scope.d.ts +21 -0
  120. data/app/components/primer/open_project/keybinding_hint/names_from_scope.js +81 -0
  121. data/app/components/primer/open_project/keybinding_hint/names_from_scope.ts +96 -0
  122. data/app/components/primer/open_project/keybinding_hint/platform.d.ts +10 -0
  123. data/app/components/primer/open_project/keybinding_hint/platform.js +24 -0
  124. data/app/components/primer/open_project/keybinding_hint/platform.ts +34 -0
  125. data/app/components/primer/open_project/keybinding_hint/platform_override.d.ts +2 -0
  126. data/app/components/primer/open_project/keybinding_hint/platform_override.js +4 -0
  127. data/app/components/primer/open_project/keybinding_hint/platform_override.ts +7 -0
  128. data/app/components/primer/open_project/keybinding_hint.css +1 -0
  129. data/app/components/primer/open_project/keybinding_hint.css.json +10 -0
  130. data/app/components/primer/open_project/keybinding_hint.css.map +1 -0
  131. data/app/components/primer/open_project/keybinding_hint.html.erb +4 -0
  132. data/app/components/primer/open_project/keybinding_hint.pcss +65 -0
  133. data/app/components/primer/open_project/keybinding_hint.rb +112 -0
  134. data/app/components/primer/open_project/keybinding_hint_element.d.ts +31 -0
  135. data/app/components/primer/open_project/keybinding_hint_element.js +183 -0
  136. data/app/components/primer/open_project/keybinding_hint_element.ts +152 -0
  137. data/app/components/primer/open_project/page_header.css +1 -1
  138. data/app/components/primer/open_project/page_header.css.json +2 -2
  139. data/app/components/primer/open_project/page_header.css.map +1 -1
  140. data/app/components/primer/open_project/pagination.css +1 -1
  141. data/app/components/primer/open_project/pagination.css.json +1 -1
  142. data/app/components/primer/open_project/pagination.css.map +1 -1
  143. data/app/components/primer/open_project/sub_header.css +1 -1
  144. data/app/components/primer/open_project/sub_header.css.map +1 -1
  145. data/app/components/primer/primer.d.ts +1 -0
  146. data/app/components/primer/primer.js +1 -0
  147. data/app/components/primer/primer.pcss +3 -0
  148. data/app/components/primer/primer.ts +1 -0
  149. data/app/components/primer/truncate.css +1 -1
  150. data/app/components/primer/truncate.css.json +3 -4
  151. data/app/components/primer/truncate.css.map +1 -1
  152. data/app/controllers/primer/view_components/action_menu_controller.rb +35 -0
  153. data/app/views/primer/view_components/action_menu/deferred.html.erb +25 -11
  154. data/app/views/primer/view_components/action_menu/deferred_form.html.erb +10 -0
  155. data/app/views/primer/view_components/action_menu/deferred_preload.html.erb +7 -1
  156. data/config/locales/en.yml +179 -0
  157. data/config/routes.rb +1 -0
  158. data/lib/primer/accessibility.rb +1 -2
  159. data/lib/primer/classify.rb +1 -2
  160. data/lib/primer/view_components/version.rb +1 -1
  161. data/previews/primer/alpha/action_menu_preview/deferred_refresh.html.erb +34 -0
  162. data/previews/primer/alpha/action_menu_preview/deferred_refresh_form.html.erb +9 -0
  163. data/previews/primer/alpha/action_menu_preview.rb +14 -0
  164. data/previews/primer/open_project/color_swatch_preview.rb +27 -0
  165. data/previews/primer/open_project/inset_box_preview.rb +85 -0
  166. data/previews/primer/open_project/keybinding_hint_preview/full_format.html.erb +3 -0
  167. data/previews/primer/open_project/keybinding_hint_preview/in_action_list.html.erb +12 -0
  168. data/previews/primer/open_project/keybinding_hint_preview/in_button.html.erb +24 -0
  169. data/previews/primer/open_project/keybinding_hint_preview/platforms.html.erb +8 -0
  170. data/previews/primer/open_project/keybinding_hint_preview/playground.html.erb +4 -0
  171. data/previews/primer/open_project/keybinding_hint_preview/prose.html.erb +3 -0
  172. data/previews/primer/open_project/keybinding_hint_preview/schemes.html.erb +6 -0
  173. data/previews/primer/open_project/keybinding_hint_preview/sequence.html.erb +1 -0
  174. data/previews/primer/open_project/keybinding_hint_preview/sizes.html.erb +4 -0
  175. data/previews/primer/open_project/keybinding_hint_preview.rb +71 -0
  176. data/static/arguments.json +109 -1
  177. data/static/audited_at.json +3 -0
  178. data/static/classes.json +27 -0
  179. data/static/classnames.cjs +9 -0
  180. data/static/classnames.js +9 -0
  181. data/static/constants.json +63 -0
  182. data/static/info_arch.json +523 -8
  183. data/static/previews.json +310 -0
  184. data/static/statuses.json +3 -0
  185. metadata +55 -5
  186. data/app/components/primer/alpha/text_field.css.json +0 -134
  187. data/app/components/primer/alpha/toggle_switch.css.json +0 -40
  188. data/app/components/primer/alpha/underline_nav.css.json +0 -26
  189. data/app/components/primer/beta/button.css.json +0 -86
@@ -1 +1 @@
1
- {"version":3,"sources":["sub_header.pcss"],"names":[],"mappings":"AAEA,WACI,YAAa,CACb,8DAA+D,CAC/D,mCAAoC,CACpC,oBAAqB,CACrB,iCACJ,CAEA,qBACI,eAAgB,CAChB,YAAa,CACb,kBAAmB,CACnB,eACJ,CAEA,sBACI,gBAAiB,CACjB,iBAAkB,CAClB,kBACJ,CAEA,sBACI,gBACJ,CAEA,oBACI,cAAe,CACf,YAAa,CACb,kBAAmB,CACnB,cAAe,CACf,2BAA4B,CAC5B,UASJ,CAJQ,gGACI,WACJ,CAIR,2BACI,YAAa,CACb,sBAAuB,CACvB,UAAW,CACX,OACJ,CAEA,2EACE,YACF,CAEA,4BACI,WACI,gEAAiE,CACjE,8BACJ,CAEA,2BACI,+DACJ,CAEA,qDACI,sBACJ,CAEA,0BACI,gEAAiE,CACjE,mCACJ,CAEA,gDACI,kBAAmB,CACnB,sBAAuB,CACvB,eACJ,CAEA,sBACI,eACJ,CAEA,8BACI,8BACJ,CACJ","file":"sub_header.css","sourcesContent":["/* CSS for SubHeader */\n\n.SubHeader {\n display: grid;\n grid-template-areas: \"left middle right\" \"bottom bottom bottom\";\n grid-template-columns: auto 1fr auto;\n align-items: baseline;\n margin-bottom: var(--base-size-16);\n}\n\n.SubHeader-rightPane {\n grid-area: right;\n display: flex;\n align-items: center;\n column-gap: 12px;\n}\n\n.SubHeader-middlePane {\n grid-area: middle;\n text-align: center;\n white-space: nowrap;\n}\n\n.SubHeader-bottomPane {\n grid-area: bottom;\n}\n\n.SubHeader-leftPane {\n grid-area: left;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: var(--base-size-16);\n width: 100%;\n\n /* Since the container is not full width (due to the grid around it)\n we want it to grow, and then be limited by the max-width of the \"FormControl-input-width--xy\" class */\n & [class*='FormControl-input-width--'] {\n &:not(.FormControl-input-width--auto) {\n width: 100vw;\n }\n }\n}\n\n.SubHeader-filterContainer {\n display: flex;\n flex-basis: max-content;\n width: 100%;\n gap: 8px;\n}\n\n.SubHeader-filterInput_hiddenClearButton + .FormControl-input-trailingAction {\n display: none;\n}\n\n@media (max-width: 767.98px) {\n .SubHeader {\n grid-template-areas: \"left right\" \"middle middle\" \"bottom bottom\";\n grid-template-columns: 1fr auto;\n }\n\n .SubHeader--expandedSearch {\n grid-template-areas: \"left left\" \"middle middle\" \"bottom bottom\";\n }\n\n .SubHeader--expandedSearch .SubHeader-hiddenOnExpand {\n display: none !important;\n }\n\n .SubHeader--emptyLeftPane {\n grid-template-areas: \"middle middle right\" \"bottom bottom bottom\";\n grid-template-columns: auto 1fr auto;\n }\n\n .SubHeader--emptyLeftPane .SubHeader-middlePane {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n .SubHeader-middlePane {\n text-align: left;\n }\n\n .SubHeader-middlePane:has(> *) {\n margin-top: var(--base-size-16);\n }\n}\n"]}
1
+ {"version":3,"sources":["sub_header.pcss"],"names":[],"mappings":"AAEA,WACI,YAAa,CACb,8DAA+D,CAC/D,mCAAoC,CACpC,oBAAqB,CACrB,iCACJ,CAEA,qBACI,eAAgB,CAChB,YAAa,CACb,kBAAmB,CACnB,eACJ,CAEA,sBACI,gBAAiB,CACjB,iBAAkB,CAClB,kBACJ,CAEA,sBACI,gBACJ,CAEA,oBACI,cAAe,CACf,YAAa,CACb,kBAAmB,CACnB,cAAe,CACf,2BAA4B,CAC5B,UASJ,CAJQ,gGACI,WACJ,CAIR,2BACI,YAAa,CACb,sBAAuB,CACvB,UAAW,CACX,OACJ,CAEA,2EACE,YACF,CAEA,2BACI,WACI,gEAAiE,CACjE,8BACJ,CAEA,2BACI,+DACJ,CAEA,qDACI,sBACJ,CAEA,0BACI,gEAAiE,CACjE,mCACJ,CAEA,gDACI,kBAAmB,CACnB,sBAAuB,CACvB,eACJ,CAEA,sBACI,eACJ,CAEA,8BACI,8BACJ,CACJ","file":"sub_header.css","sourcesContent":["/* CSS for SubHeader */\n\n.SubHeader {\n display: grid;\n grid-template-areas: \"left middle right\" \"bottom bottom bottom\";\n grid-template-columns: auto 1fr auto;\n align-items: baseline;\n margin-bottom: var(--base-size-16);\n}\n\n.SubHeader-rightPane {\n grid-area: right;\n display: flex;\n align-items: center;\n column-gap: 12px;\n}\n\n.SubHeader-middlePane {\n grid-area: middle;\n text-align: center;\n white-space: nowrap;\n}\n\n.SubHeader-bottomPane {\n grid-area: bottom;\n}\n\n.SubHeader-leftPane {\n grid-area: left;\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n row-gap: var(--base-size-16);\n width: 100%;\n\n /* Since the container is not full width (due to the grid around it)\n we want it to grow, and then be limited by the max-width of the \"FormControl-input-width--xy\" class */\n & [class*='FormControl-input-width--'] {\n &:not(.FormControl-input-width--auto) {\n width: 100vw;\n }\n }\n}\n\n.SubHeader-filterContainer {\n display: flex;\n flex-basis: max-content;\n width: 100%;\n gap: 8px;\n}\n\n.SubHeader-filterInput_hiddenClearButton + .FormControl-input-trailingAction {\n display: none;\n}\n\n@media (max-width: 767.98px) {\n .SubHeader {\n grid-template-areas: \"left right\" \"middle middle\" \"bottom bottom\";\n grid-template-columns: 1fr auto;\n }\n\n .SubHeader--expandedSearch {\n grid-template-areas: \"left left\" \"middle middle\" \"bottom bottom\";\n }\n\n .SubHeader--expandedSearch .SubHeader-hiddenOnExpand {\n display: none !important;\n }\n\n .SubHeader--emptyLeftPane {\n grid-template-areas: \"middle middle right\" \"bottom bottom bottom\";\n grid-template-columns: auto 1fr auto;\n }\n\n .SubHeader--emptyLeftPane .SubHeader-middlePane {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n\n .SubHeader-middlePane {\n text-align: left;\n }\n\n .SubHeader-middlePane:has(> *) {\n margin-top: var(--base-size-16);\n }\n}\n"]}
@@ -41,3 +41,4 @@ import './open_project/collapsible';
41
41
  import './open_project/border_box/collapsible_header';
42
42
  import './open_project/collapsible_section';
43
43
  import './open_project/filterable_tree_view';
44
+ import './open_project/keybinding_hint_element';
@@ -41,3 +41,4 @@ import './open_project/collapsible';
41
41
  import './open_project/border_box/collapsible_header';
42
42
  import './open_project/collapsible_section';
43
43
  import './open_project/filterable_tree_view';
44
+ import './open_project/keybinding_hint_element';
@@ -52,9 +52,12 @@
52
52
  @import "./open_project/input_group.pcss";
53
53
  @import "./open_project/color_field.pcss";
54
54
  @import "./open_project/inline_message.pcss";
55
+ @import "./open_project/keybinding_hint.pcss";
55
56
  @import "./open_project/sub_header.pcss";
56
57
  @import "./open_project/side_panel/section.pcss";
57
58
  @import "./open_project/border_box/collapsible_header.pcss";
58
59
  @import "./open_project/collapsible_section.pcss";
59
60
  @import "./open_project/pagination.pcss";
60
61
  @import "./open_project/filterable_tree_view.pcss";
62
+ @import "./open_project/color_swatch.pcss";
63
+ @import "./open_project/inset_box.pcss";
@@ -41,3 +41,4 @@ import './open_project/collapsible'
41
41
  import './open_project/border_box/collapsible_header'
42
42
  import './open_project/collapsible_section'
43
43
  import './open_project/filterable_tree_view'
44
+ import './open_project/keybinding_hint_element'
@@ -1 +1 @@
1
- .css-truncate .css-truncate-overflow,.css-truncate .css-truncate-target,.css-truncate.css-truncate-overflow,.css-truncate.css-truncate-target{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.css-truncate .css-truncate-target,.css-truncate.css-truncate-target{display:inline-block;max-width:125px;vertical-align:top}.css-truncate.expandable.css-truncate-target:hover,.css-truncate.expandable.zeroclipboard-is-hover .css-truncate-target,.css-truncate.expandable.zeroclipboard-is-hover.css-truncate-target,.css-truncate.expandable:hover .css-truncate-target{max-width:10000px!important}
1
+ .css-truncate :is(.css-truncate-overflow,.css-truncate-target),.css-truncate.css-truncate-overflow,.css-truncate.css-truncate-target{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.css-truncate .css-truncate-target,.css-truncate.css-truncate-target{display:inline-block;max-width:125px;vertical-align:top}.css-truncate.expandable.css-truncate-target:hover,.css-truncate.expandable.zeroclipboard-is-hover.css-truncate-target,:is(.css-truncate.expandable.zeroclipboard-is-hover,.css-truncate.expandable:hover) .css-truncate-target{max-width:1e4px!important}
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "truncate",
3
3
  "selectors": [
4
- ".css-truncate .css-truncate-overflow",
5
- ".css-truncate .css-truncate-target",
4
+ ".css-truncate :is(.css-truncate-overflow,.css-truncate-target)",
6
5
  ".css-truncate.css-truncate-overflow",
7
6
  ".css-truncate.css-truncate-target",
7
+ ".css-truncate .css-truncate-target",
8
8
  ".css-truncate.expandable.css-truncate-target:hover",
9
- ".css-truncate.expandable.zeroclipboard-is-hover .css-truncate-target",
10
9
  ".css-truncate.expandable.zeroclipboard-is-hover.css-truncate-target",
11
- ".css-truncate.expandable:hover .css-truncate-target"
10
+ ":is(.css-truncate.expandable.zeroclipboard-is-hover,.css-truncate.expandable:hover) .css-truncate-target"
12
11
  ]
13
12
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["truncate.pcss"],"names":[],"mappings":"AAME,8IAIE,eAAgB,CAChB,sBAAuB,CACvB,kBACF,CAGA,qEAEE,oBAAqB,CACrB,eAAgB,CAChB,kBACF,CAEA,gPAIE,2BACF","file":"truncate.css","sourcesContent":["/* CSS truncate */\n\n/* css-truncate will shorten text with an ellipsis. */\n\n.css-truncate {\n /* css-truncate-overflow will shorten text with an ellipsis when overflowing */\n &.css-truncate-overflow,\n & .css-truncate-overflow,\n &.css-truncate-target,\n & .css-truncate-target {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n /* css-truncate-target will shorten text with an ellipsis and a max width */\n &.css-truncate-target,\n & .css-truncate-target {\n display: inline-block;\n max-width: 125px;\n vertical-align: top;\n }\n\n &.expandable.zeroclipboard-is-hover .css-truncate-target,\n &.expandable.zeroclipboard-is-hover.css-truncate-target,\n &.expandable:hover .css-truncate-target,\n &.expandable:hover.css-truncate-target {\n max-width: 10000px !important;\n }\n}\n"]}
1
+ {"version":3,"sources":["truncate.pcss"],"names":[],"mappings":"AAME,qIAIE,eAAgB,CAChB,sBAAuB,CACvB,kBACF,CAGA,qEAEE,oBAAqB,CACrB,eAAgB,CAChB,kBACF,CAEA,gOAIE,yBACF","file":"truncate.css","sourcesContent":["/* CSS truncate */\n\n/* css-truncate will shorten text with an ellipsis. */\n\n.css-truncate {\n /* css-truncate-overflow will shorten text with an ellipsis when overflowing */\n &.css-truncate-overflow,\n & .css-truncate-overflow,\n &.css-truncate-target,\n & .css-truncate-target {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n /* css-truncate-target will shorten text with an ellipsis and a max width */\n &.css-truncate-target,\n & .css-truncate-target {\n display: inline-block;\n max-width: 125px;\n vertical-align: top;\n }\n\n &.expandable.zeroclipboard-is-hover .css-truncate-target,\n &.expandable.zeroclipboard-is-hover.css-truncate-target,\n &.expandable:hover .css-truncate-target,\n &.expandable:hover.css-truncate-target {\n max-width: 10000px !important;\n }\n}\n"]}
@@ -11,13 +11,33 @@ module Primer
11
11
 
12
12
  def deferred
13
13
  sleep params[:delay].to_f if params[:delay].present?
14
+ status = request_gate_status
15
+ return head(status) unless status == 200
16
+ return render(html: "") if params[:empty].present?
17
+
18
+ assign_deferred_params
14
19
  render "primer/view_components/action_menu/deferred"
15
20
  end
16
21
 
17
22
  def deferred_preload
23
+ status = request_gate_status
24
+ return head(status) unless status == 200
25
+
26
+ assign_deferred_params
18
27
  render "primer/view_components/action_menu/deferred_preload"
19
28
  end
20
29
 
30
+ def deferred_form
31
+ status = request_gate_status
32
+ return head(status) unless status == 200
33
+
34
+ @label = params[:label].presence
35
+ @name = params[:name].presence || "foo"
36
+ @variant = params[:variant].presence || "multiple"
37
+ @checked = params.key?(:checked) ? params[:checked].to_s.split(",") : ["ours"]
38
+ render "primer/view_components/action_menu/deferred_form"
39
+ end
40
+
21
41
  def form_action
22
42
  respond_to do |format|
23
43
  format.html do
@@ -33,6 +53,21 @@ module Primer
33
53
 
34
54
  private
35
55
 
56
+ # Test-only: holds the request until the test releases it and returns
57
+ # the status it was released with (see test/test_helpers/request_gate.rb).
58
+ def request_gate_status
59
+ return 200 unless params[:gate].present? && defined?(Primer::RequestGate)
60
+
61
+ Primer::RequestGate.pass(params[:gate])
62
+ end
63
+
64
+ def assign_deferred_params
65
+ @label = params[:label].presence
66
+ @deferred_sub = params[:deferred_sub].present?
67
+ @with_sub_menu = params[:with_sub_menu].present?
68
+ @empty_list = params[:empty_list].present?
69
+ end
70
+
36
71
  def form_action_selected_value
37
72
  params.permit(:foo)[:foo] || params.permit(foo: [])[:foo]
38
73
  end
@@ -1,13 +1,27 @@
1
1
  <%= render(Primer::Alpha::ActionMenu::List.new(menu_id: "deferred")) do |list| %>
2
- <% list.with_item(label: "Copy link", value: "", autofocus: true) %>
3
- <% list.with_item(label: "Quote reply", value: "") %>
4
- <% list.with_item(label: "Reference in new issue", value: "") %>
5
- <% list.with_item(
6
- label: "Show dialog",
7
- tag: :button,
8
- # this dialog is rendered by demo/app/views/action_menu/deferred.html.erb
9
- content_arguments: { "data-show-dialog-id": "my-dialog" },
10
- value: "",
11
- scheme: :danger
12
- ) %>
2
+ <% unless @empty_list %>
3
+ <% if @label.present? %>
4
+ <% list.with_item(label: @label, value: "", autofocus: true) %>
5
+ <% end %>
6
+ <% list.with_item(label: "Copy link", value: "", autofocus: @label.blank?) %>
7
+ <% list.with_item(label: "Quote reply", value: "") %>
8
+ <% list.with_item(label: "Reference in new issue", value: "") %>
9
+ <% list.with_item(
10
+ label: "Show dialog",
11
+ tag: :button,
12
+ # this dialog is rendered by demo/app/views/action_menu/deferred.html.erb
13
+ content_arguments: { "data-show-dialog-id": "my-dialog" },
14
+ value: "",
15
+ scheme: :danger
16
+ ) %>
17
+ <% if @with_sub_menu %>
18
+ <% list.with_item(component_klass: Primer::Alpha::ActionMenu::SubMenuItem, label: "More") do |sub_menu| %>
19
+ <% sub_menu.with_item(label: "Sub one") %>
20
+ <% sub_menu.with_item(label: "Sub two") %>
21
+ <% end %>
22
+ <% end %>
23
+ <% if @deferred_sub %>
24
+ <% list.with_item(component_klass: Primer::Alpha::ActionMenu::SubMenuItem, label: "Deferred more", src: primer_view_components.action_menu_deferred_path) %>
25
+ <% end %>
26
+ <% end %>
13
27
  <% end %>
@@ -0,0 +1,10 @@
1
+ <%= fields do |f| %>
2
+ <%= render(Primer::Alpha::ActionMenu::List.new(menu_id: "deferred-form", select_variant: @variant.to_sym, form_arguments: { builder: f, name: @name })) do |list| %>
3
+ <% list.with_group do |group| %>
4
+ <% group.with_heading(title: "Strategy") %>
5
+ <% [["Fast forward", "fast_forward"], ["Recursive", "recursive"], ["Ours", "ours"]].each do |name, value| %>
6
+ <% group.with_item(label: [name, @label].compact.join(" "), content_arguments: { data: { value: value } }, active: @checked.include?(value)) %>
7
+ <% end %>
8
+ <% end %>
9
+ <% end %>
10
+ <% end %>
@@ -1,5 +1,11 @@
1
1
  <%= render(Primer::Alpha::ActionMenu::List.new(menu_id: "deferred-preload")) do |list| %>
2
- <% list.with_item(label: "Copy link", value: "", autofocus: true) %>
2
+ <% if @label.present? %>
3
+ <% list.with_item(label: @label, value: "", autofocus: true) %>
4
+ <% end %>
5
+ <% list.with_item(label: "Copy link", value: "", autofocus: @label.blank?) %>
3
6
  <% list.with_item(label: "Quote reply", value: "") %>
4
7
  <% list.with_item(label: "Reference in new issue", value: "") %>
8
+ <% if @deferred_sub %>
9
+ <% list.with_item(component_klass: Primer::Alpha::ActionMenu::SubMenuItem, label: "Deferred more", src: primer_view_components.action_menu_deferred_path) %>
10
+ <% end %>
5
11
  <% end %>
@@ -46,3 +46,182 @@ en:
46
46
 
47
47
  tree_view:
48
48
  label_empty_sub_tree: "No items"
49
+
50
+ keybinding_hint:
51
+ then: "then"
52
+ keys:
53
+ alt:
54
+ condensed: { apple: "⌥", other: "Alt" }
55
+ full: { apple: "Option", other: "Alt" }
56
+ accessible: { apple: "option", other: "alt" }
57
+ arrowdown:
58
+ full: { other: "Down Arrow" }
59
+ accessible: { other: "down arrow" }
60
+ arrowleft:
61
+ full: { other: "Left Arrow" }
62
+ accessible: { other: "left arrow" }
63
+ arrowright:
64
+ full: { other: "Right Arrow" }
65
+ accessible: { other: "right arrow" }
66
+ arrowup:
67
+ full: { other: "Up Arrow" }
68
+ accessible: { other: "up arrow" }
69
+ backspace:
70
+ full: { other: "Backspace" }
71
+ accessible: { other: "backspace" }
72
+ capslock:
73
+ condensed: { other: "CapsLock" }
74
+ full: { other: "Caps Lock" }
75
+ accessible: { other: "caps lock" }
76
+ control:
77
+ condensed: { apple: "⌃", other: "Ctrl" }
78
+ full: { other: "Control" }
79
+ accessible: { other: "control" }
80
+ delete:
81
+ condensed: { other: "Del" }
82
+ full: { other: "Delete" }
83
+ accessible: { other: "delete" }
84
+ end:
85
+ condensed: { other: "End" }
86
+ full: { other: "End" }
87
+ accessible: { other: "end" }
88
+ enter:
89
+ full: { other: "Enter" }
90
+ accessible: { other: "enter" }
91
+ escape:
92
+ condensed: { other: "Esc" }
93
+ full: { other: "Escape" }
94
+ accessible: { other: "escape" }
95
+ function:
96
+ condensed: { other: "Fn" }
97
+ full: { other: "Function" }
98
+ accessible: { other: "function" }
99
+ home:
100
+ condensed: { other: "Home" }
101
+ full: { other: "Home" }
102
+ accessible: { other: "home" }
103
+ insert:
104
+ condensed: { other: "Ins" }
105
+ full: { other: "Insert" }
106
+ accessible: { other: "insert" }
107
+ meta:
108
+ condensed: { apple: "⌘", windows: "Win", other: "Meta" }
109
+ full: { apple: "Command", windows: "Windows", other: "Meta" }
110
+ accessible: { apple: "command", windows: "Windows", other: "meta" }
111
+ pagedown:
112
+ condensed: { other: "PgDn" }
113
+ full: { other: "Page Down" }
114
+ accessible: { other: "page down" }
115
+ pageup:
116
+ condensed: { other: "PgUp" }
117
+ full: { other: "Page Up" }
118
+ accessible: { other: "page up" }
119
+ plus:
120
+ full: { other: "Plus" }
121
+ accessible: { other: "plus" }
122
+ printscreen:
123
+ condensed: { other: "PrtScn" }
124
+ full: { other: "Print Screen" }
125
+ accessible: { other: "print screen" }
126
+ shift:
127
+ full: { other: "Shift" }
128
+ accessible: { other: "shift" }
129
+ space:
130
+ full: { other: "Space" }
131
+ accessible: { other: "space" }
132
+ tab:
133
+ full: { other: "Tab" }
134
+ accessible: { other: "tab" }
135
+ ampersand:
136
+ key: "&"
137
+ accessible: { other: "ampersand" }
138
+ asterisk:
139
+ key: "*"
140
+ accessible: { other: "asterisk" }
141
+ at:
142
+ key: "@"
143
+ accessible: { other: "at" }
144
+ backslash:
145
+ key: "\\"
146
+ accessible: { other: "backslash" }
147
+ backtick:
148
+ key: "`"
149
+ accessible: { other: "backtick" }
150
+ caret:
151
+ key: "^"
152
+ accessible: { other: "caret" }
153
+ colon:
154
+ key: ":"
155
+ accessible: { other: "colon" }
156
+ comma:
157
+ key: ","
158
+ accessible: { other: "comma" }
159
+ dash:
160
+ key: "-"
161
+ accessible: { other: "dash" }
162
+ dollar_sign:
163
+ key: "$"
164
+ accessible: { other: "dollar sign" }
165
+ double_quote:
166
+ key: "\""
167
+ accessible: { other: "double quote" }
168
+ equals:
169
+ key: "="
170
+ accessible: { other: "equals" }
171
+ exclamation_point:
172
+ key: "!"
173
+ accessible: { other: "exclamation point" }
174
+ forward_slash:
175
+ key: "/"
176
+ accessible: { other: "forward slash" }
177
+ hash:
178
+ key: "#"
179
+ accessible: { other: "hash" }
180
+ left_angle_bracket:
181
+ key: "<"
182
+ accessible: { other: "left angle bracket" }
183
+ left_bracket:
184
+ key: "["
185
+ accessible: { other: "left bracket" }
186
+ left_curly_brace:
187
+ key: "{"
188
+ accessible: { other: "left curly brace" }
189
+ left_parenthesis:
190
+ key: "("
191
+ accessible: { other: "left parenthesis" }
192
+ percent:
193
+ key: "%"
194
+ accessible: { other: "percent" }
195
+ period:
196
+ key: "."
197
+ accessible: { other: "period" }
198
+ pipe:
199
+ key: "|"
200
+ accessible: { other: "pipe" }
201
+ question_mark:
202
+ key: "?"
203
+ accessible: { other: "question mark" }
204
+ right_angle_bracket:
205
+ key: ">"
206
+ accessible: { other: "right angle bracket" }
207
+ right_bracket:
208
+ key: "]"
209
+ accessible: { other: "right bracket" }
210
+ right_curly_brace:
211
+ key: "}"
212
+ accessible: { other: "right curly brace" }
213
+ right_parenthesis:
214
+ key: ")"
215
+ accessible: { other: "right parenthesis" }
216
+ semicolon:
217
+ key: ";"
218
+ accessible: { other: "semicolon" }
219
+ single_quote:
220
+ key: "'"
221
+ accessible: { other: "single quote" }
222
+ tilde:
223
+ key: "~"
224
+ accessible: { other: "tilde" }
225
+ underscore:
226
+ key: "_"
227
+ accessible: { other: "underscore" }
data/config/routes.rb CHANGED
@@ -28,6 +28,7 @@ Primer::ViewComponents::Engine.routes.draw do
28
28
  post "/action_menu/form_action", to: "action_menu#form_action", as: :action_menu_form_action
29
29
  get "/action_menu/deferred", to: "action_menu#deferred", as: :action_menu_deferred
30
30
  get "/action_menu/deferred_preload", to: "action_menu#deferred_preload", as: :action_menu_deferred_preload
31
+ get "/action_menu/deferred_form", to: "action_menu#deferred_form", as: :action_menu_deferred_form
31
32
 
32
33
  get "/include_fragment/deferred", to: "include_fragment#deferred", as: :include_fragment_deferred
33
34
  end
@@ -41,9 +41,8 @@ module Primer
41
41
  }
42
42
  }.freeze
43
43
 
44
- # rubocop:disable Style/ClassMethodsDefinitions
44
+ # rubocop:disable-next Style/ClassMethodsDefinitions
45
45
  class << self
46
- # rubocop:enable Style/ClassMethodsDefinitions
47
46
 
48
47
  def ignore_preview?(preview_class)
49
48
  IGNORED_PREVIEWS.include?(preview_class)
@@ -98,9 +98,8 @@ module Primer
98
98
  else
99
99
  next if val.nil?
100
100
 
101
- # rubocop:disable Style/RescueModifier
101
+ # rubocop:disable-next Style/RescueModifier
102
102
  found = (LOOKUP[key][val][0] rescue nil) || validate(key, val, 0)
103
- # rubocop:enable Style/RescueModifier
104
103
  if found
105
104
  result << found
106
105
  result << TMP_PREFIX_CACHE[found] if TMP_PREFIX_CACHE.key?(found)
@@ -5,7 +5,7 @@ module Primer
5
5
  module ViewComponents
6
6
  module VERSION
7
7
  MAJOR = 0
8
- MINOR = 94
8
+ MINOR = 96
9
9
  PATCH = 0
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH].join(".")
@@ -0,0 +1,34 @@
1
+ <%= render(Primer::Alpha::ActionMenu.new(menu_id: "deferred", preload: preload, src: primer_view_components.action_menu_deferred_path)) do |menu| %>
2
+ <% menu.with_show_button { "Menu with refreshable content" } %>
3
+ <% end %>
4
+
5
+ <%= render(Primer::Beta::Button.new(id: "deferred-refresh-button", ml: 2)) { "Refresh" } %>
6
+ <%= render(Primer::Beta::Button.new(id: "deferred-reload-button", ml: 2)) { "Reload" } %>
7
+
8
+ <%# Used by the "Show dialog" item rendered by ActionMenuController#deferred. %>
9
+ <%= render(Primer::Alpha::Dialog.new(id: "my-dialog", title: "Confirm deletion")) do |d| %>
10
+ <%= render(Primer::Alpha::Dialog::Body.new()) do %>
11
+ Are you sure you want to delete this?
12
+ <% end %>
13
+ <%= render(Primer::Alpha::Dialog::Footer.new()) do %>
14
+ <%= render(Primer::Beta::Button.new(data: { "close-dialog-id": "my-dialog" })) { "Cancel" } %>
15
+ <%= render(Primer::Beta::Button.new(scheme: :danger)) { "Delete" } %>
16
+ <% end %>
17
+ <% end %>
18
+
19
+ <script type="text/javascript">
20
+ (() => {
21
+ let count = 0
22
+ document.getElementById("deferred-refresh-button").addEventListener("click", () => {
23
+ const menu = document.querySelector("action-menu")
24
+ const url = new URL(menu.getAttribute("src"), window.location.href)
25
+ count += 1
26
+ url.searchParams.set("label", `Refreshed ${count}`)
27
+ menu.setAttribute("src", `${url.pathname}${url.search}`)
28
+ })
29
+
30
+ document.getElementById("deferred-reload-button").addEventListener("click", () => {
31
+ document.querySelector("action-menu").refresh()
32
+ })
33
+ })()
34
+ </script>
@@ -0,0 +1,9 @@
1
+ <%= form_with(url: primer_view_components.action_menu_form_action_path(format: route_format)) do |f| %>
2
+ <%= render(Primer::Alpha::ActionMenu.new(select_variant: select_variant, dynamic_label: true, dynamic_label_prefix: "Strategy", menu_id: "deferred-form", src: primer_view_components.action_menu_deferred_form_path(variant: (select_variant if select_variant == :single)), form_arguments: { builder: f, name: "foo" })) do |menu| %>
3
+ <% menu.with_show_button { "Strategy" } %>
4
+ <% end %>
5
+ <hr>
6
+ <div>
7
+ <%= f.submit(class: "Button--secondary Button--medium Button") %>
8
+ </div>
9
+ <% end %>
@@ -310,6 +310,20 @@ module Primer
310
310
  render_with_template(locals: { nest_in_sub_menu: nest_in_sub_menu })
311
311
  end
312
312
 
313
+ # @label Deferred refresh
314
+ #
315
+ # @param preload toggle
316
+ def deferred_refresh(preload: false)
317
+ render_with_template(locals: { preload: preload.to_s == "true" })
318
+ end
319
+
320
+ # @label Deferred refresh with form
321
+ #
322
+ # @hidden
323
+ def deferred_refresh_form(route_format: :json, select_variant: :multiple)
324
+ render_with_template(locals: { route_format: route_format, select_variant: select_variant.to_sym })
325
+ end
326
+
313
327
  # @label With deferred content near the bottom of the viewport
314
328
  #
315
329
  # @hidden
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Primer
4
+ module OpenProject
5
+ # @label ColorSwatch
6
+ class ColorSwatchPreview < ViewComponent::Preview
7
+ # @label Playground
8
+ # @param hexcode [String] text
9
+ # @param show_value [Boolean] toggle
10
+ def playground(hexcode: "#CC0000", show_value: false)
11
+ render(Primer::OpenProject::ColorSwatch.new(hexcode: hexcode, show_value: show_value))
12
+ end
13
+
14
+ # @label Default
15
+ # @snapshot
16
+ def default
17
+ render(Primer::OpenProject::ColorSwatch.new(hexcode: "#CC0000"))
18
+ end
19
+
20
+ # @label With value
21
+ # @snapshot
22
+ def with_value
23
+ render(Primer::OpenProject::ColorSwatch.new(hexcode: "#CC0000", show_value: true))
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,85 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Primer
4
+ module OpenProject
5
+ # @label InsetBox
6
+ class InsetBoxPreview < ViewComponent::Preview
7
+ # @label Playground
8
+ # @param border [Boolean] toggle
9
+ # @param scheme [Symbol] select [default, info, warning, danger, success]
10
+ # @param show_title [Boolean] toggle
11
+ # @param show_icon [Boolean] toggle
12
+ # @param show_actions [Boolean] toggle
13
+ # @param show_clipboard_copy_button [Boolean] toggle
14
+ def playground(border: true, scheme: :default, show_title: true, show_icon: false, show_actions: false, show_clipboard_copy_button: false)
15
+ render(Primer::OpenProject::InsetBox.new(border: border, scheme: scheme)) do |component|
16
+ component.with_title_icon(icon: :info) if show_icon
17
+ component.with_title { "Title" } if show_title
18
+ component.with_clipboard_copy_button(value: "Copyable value", "aria-label": "Copy value") if show_clipboard_copy_button
19
+
20
+ component.with_action_button(scheme: :default) { "Action" } if show_actions
21
+
22
+ "This is the content of the inset box."
23
+ end
24
+ end
25
+
26
+ # @label Default
27
+ # @snapshot
28
+ def default
29
+ render(Primer::OpenProject::InsetBox.new) do |component|
30
+ component.with_title { "Title" }
31
+ "This is the content of the inset box."
32
+ end
33
+ end
34
+
35
+ # @label With scheme
36
+ # @snapshot
37
+ def with_scheme
38
+ render(Primer::OpenProject::InsetBox.new(scheme: :warning)) do |component|
39
+ component.with_title { "Watch out" }
40
+ "This is a warning message."
41
+ end
42
+ end
43
+
44
+ # @label With icon
45
+ # @snapshot
46
+ def with_icon
47
+ render(Primer::OpenProject::InsetBox.new) do |component|
48
+ component.with_title_icon(icon: :info)
49
+ component.with_title { "Title" }
50
+ "This is the content of the inset box."
51
+ end
52
+ end
53
+
54
+ # @label With clipboard copy button
55
+ # @snapshot
56
+ def with_clipboard_copy_button
57
+ render(Primer::OpenProject::InsetBox.new) do |component|
58
+ component.with_title { "Title" }
59
+ component.with_clipboard_copy_button(value: "Copyable value", "aria-label": "Copy value")
60
+ "This is the content of the inset box."
61
+ end
62
+ end
63
+
64
+ # @label With actions
65
+ # @snapshot
66
+ def with_actions
67
+ render(Primer::OpenProject::InsetBox.new) do |component|
68
+ component.with_title { "Title" }
69
+ component.with_action_button(scheme: :default) { "Edit" }
70
+ component.with_action_button(scheme: :danger) { "Delete" }
71
+ "This is the content of the inset box."
72
+ end
73
+ end
74
+
75
+ # @label Without border
76
+ # @snapshot
77
+ def without_border
78
+ render(Primer::OpenProject::InsetBox.new(border: false)) do |component|
79
+ component.with_title { "Title" }
80
+ "This is the content of the inset box."
81
+ end
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,3 @@
1
+ <%= render(Primer::Beta::Text.new(tag: :p)) do %>
2
+ Press <%= render(Primer::OpenProject::KeybindingHint.new(keys: "Mod+Shift+p", format: :full, data: { platform: "other" })) %> to open the command palette.
3
+ <% end %>
@@ -0,0 +1,12 @@
1
+ <%= render(Primer::Alpha::ActionList.new(aria: { label: "Comment actions" })) do |list| %>
2
+ <% list.with_item(label: "Add comment") %>
3
+ <% list.with_item(label: "Save") do |item| %>
4
+ <% item.with_trailing_visual_keybinding_hint(keys: "Mod+Enter", data: { platform: "other" }) %>
5
+ <% end %>
6
+ <% list.with_item(label: "Preview") do |item| %>
7
+ <% item.with_trailing_visual_keybinding_hint(keys: "Mod+Shift+p", data: { platform: "other" }) %>
8
+ <% end %>
9
+ <% list.with_item(label: "Delete", scheme: :danger) do |item| %>
10
+ <% item.with_trailing_visual_keybinding_hint(keys: "Mod+Backspace", data: { platform: "other" }) %>
11
+ <% end %>
12
+ <% end %>
@@ -0,0 +1,24 @@
1
+ <%= render(Primer::Box.new(display: :flex, style: "flex-direction: column; gap: var(--base-size-16)")) do %>
2
+ <% %i[default primary danger invisible].each do |scheme| %>
3
+ <%= render(Primer::Box.new(display: :flex, style: "gap: var(--base-size-8); align-items: center; flex-wrap: wrap")) do %>
4
+ <% %i[small medium large].each do |size| %>
5
+ <%= render(Primer::Beta::Button.new(scheme: scheme, size: size)) do |button| %>
6
+ <% button.with_trailing_visual_keybinding_hint(keys: "Mod+s", data: { platform: "other" }) %>
7
+ <%= "#{scheme} #{size}" %>
8
+ <% end %>
9
+ <% end %>
10
+ <%= render(Primer::Beta::Button.new(scheme: scheme, disabled: true)) do |button| %>
11
+ <% button.with_trailing_visual_keybinding_hint(keys: "Mod+s", data: { platform: "other" }) %>
12
+ <%= "#{scheme} disabled" %>
13
+ <% end %>
14
+ <%= render(Primer::Beta::Button.new(scheme: scheme, inactive: true)) do |button| %>
15
+ <% button.with_trailing_visual_keybinding_hint(keys: "Mod+s", data: { platform: "other" }) %>
16
+ <%= "#{scheme} inactive" %>
17
+ <% end %>
18
+ <% end %>
19
+ <% end %>
20
+ <%= render(Primer::Beta::Button.new(aria: { label: "Save document" })) do |button| %>
21
+ <% button.with_trailing_visual_keybinding_hint(keys: "Mod+s", data: { platform: "other" }) %>
22
+ Save
23
+ <% end %>
24
+ <% end %>