primer_view_components 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/app/assets/javascripts/primer_view_components.js +1 -1
  4. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  5. data/app/assets/styles/primer_view_components.css +2 -2
  6. data/app/assets/styles/primer_view_components.css.map +1 -1
  7. data/app/components/primer/alpha/action_list/heading.html.erb +1 -1
  8. data/app/components/primer/alpha/action_list/heading.rb +5 -3
  9. data/app/components/primer/alpha/action_list/item.html.erb +9 -0
  10. data/app/components/primer/alpha/action_list/item.rb +31 -10
  11. data/app/components/primer/alpha/action_list.css +1 -1
  12. data/app/components/primer/alpha/action_list.css.json +4 -41
  13. data/app/components/primer/alpha/action_list.css.map +1 -1
  14. data/app/components/primer/alpha/action_list.pcss +19 -20
  15. data/app/components/primer/alpha/action_list.rb +54 -6
  16. data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +22 -0
  17. data/app/components/primer/alpha/action_menu/action_menu_element.js +139 -0
  18. data/app/components/primer/alpha/action_menu/action_menu_element.ts +137 -0
  19. data/app/components/primer/alpha/action_menu/list.rb +81 -0
  20. data/app/components/primer/alpha/action_menu.html.erb +26 -0
  21. data/app/components/primer/alpha/action_menu.rb +322 -0
  22. data/app/components/primer/alpha/auto_complete.css.json +0 -11
  23. data/app/components/primer/alpha/banner.css.json +0 -14
  24. data/app/components/primer/alpha/button_marketing.css.json +0 -10
  25. data/app/components/primer/alpha/dialog.css.json +0 -63
  26. data/app/components/primer/alpha/dialog.rb +6 -2
  27. data/app/components/primer/alpha/dropdown.css.json +0 -21
  28. data/app/components/primer/alpha/layout.css.json +0 -27
  29. data/app/components/primer/alpha/menu.css.json +0 -11
  30. data/app/components/primer/alpha/nav_list/item.rb +5 -0
  31. data/app/components/primer/alpha/overlay.css +1 -1
  32. data/app/components/primer/alpha/overlay.css.json +0 -3
  33. data/app/components/primer/alpha/overlay.css.map +1 -1
  34. data/app/components/primer/alpha/overlay.pcss +1 -0
  35. data/app/components/primer/alpha/overlay.rb +14 -18
  36. data/app/components/primer/alpha/segmented_control.css.json +0 -15
  37. data/app/components/primer/alpha/tab_nav.css.json +0 -10
  38. data/app/components/primer/alpha/text_field.css.json +0 -38
  39. data/app/components/primer/alpha/toggle_switch.css.json +0 -16
  40. data/app/components/primer/alpha/underline_nav.css.json +0 -13
  41. data/app/components/primer/beta/avatar.css.json +0 -14
  42. data/app/components/primer/beta/avatar_stack.css.json +0 -9
  43. data/app/components/primer/beta/blankslate.css.json +0 -12
  44. data/app/components/primer/beta/border_box.css.json +0 -32
  45. data/app/components/primer/beta/border_box.rb +3 -3
  46. data/app/components/primer/beta/breadcrumbs.css.json +0 -4
  47. data/app/components/primer/beta/button.css +1 -1
  48. data/app/components/primer/beta/button.css.json +0 -22
  49. data/app/components/primer/beta/button.css.map +1 -1
  50. data/app/components/primer/beta/button.pcss +3 -3
  51. data/app/components/primer/beta/counter.css.json +0 -6
  52. data/app/components/primer/beta/flash.css.json +0 -15
  53. data/app/components/primer/beta/label.css.json +0 -20
  54. data/app/components/primer/beta/link.css.json +0 -8
  55. data/app/components/primer/beta/popover.css.json +0 -18
  56. data/app/components/primer/beta/progress_bar.css.json +0 -6
  57. data/app/components/primer/beta/state.css.json +0 -10
  58. data/app/components/primer/beta/subhead.css.json +0 -8
  59. data/app/components/primer/beta/timeline_item.css.json +0 -9
  60. data/app/components/primer/beta/truncate.css.json +0 -6
  61. data/app/components/primer/focus_group.d.ts +19 -0
  62. data/app/components/primer/focus_group.js +144 -0
  63. data/app/components/primer/focus_group.ts +137 -0
  64. data/app/components/primer/icon_button.rb +1 -1
  65. data/app/components/primer/primer.d.ts +2 -0
  66. data/app/components/primer/primer.js +2 -0
  67. data/app/components/primer/primer.ts +2 -0
  68. data/app/components/primer/truncate.css.json +0 -7
  69. data/app/forms/select_form.rb +2 -2
  70. data/app/lib/primer/css/layout.css.json +0 -263
  71. data/app/lib/primer/css/utilities.css.json +0 -1636
  72. data/lib/primer/classify/utilities.yml +60 -0
  73. data/lib/primer/forms/form_control.html.erb +1 -1
  74. data/lib/primer/forms/form_control.rb +5 -1
  75. data/lib/primer/forms/multi.html.erb +6 -8
  76. data/lib/primer/forms/text_field.html.erb +15 -17
  77. data/lib/primer/static/generate_arguments.rb +55 -0
  78. data/lib/primer/static/generate_audited_at.rb +17 -0
  79. data/lib/primer/static/generate_constants.rb +19 -0
  80. data/lib/primer/static/generate_info_arch.rb +156 -0
  81. data/lib/primer/static/generate_previews.rb +45 -0
  82. data/lib/primer/static/generate_statuses.rb +17 -0
  83. data/lib/primer/static.rb +72 -0
  84. data/lib/primer/view_components/linters/disallow_component_css_counter.rb +43 -4
  85. data/lib/primer/view_components/version.rb +1 -1
  86. data/lib/primer/view_components.rb +0 -48
  87. data/lib/primer/yard/component_manifest.rb +1 -0
  88. data/lib/primer/yard/component_ref.rb +14 -0
  89. data/lib/primer/yard/docs_helper.rb +3 -0
  90. data/lib/primer/yard/info_arch_docs_helper.rb +31 -0
  91. data/lib/primer/yard/legacy_gatsby_backend.rb +3 -35
  92. data/lib/primer/yard/registry.rb +2 -1
  93. data/lib/primer/yard.rb +1 -0
  94. data/lib/tasks/custom_utilities.yml +60 -0
  95. data/lib/tasks/docs.rake +10 -12
  96. data/lib/tasks/static.rake +20 -28
  97. data/previews/primer/alpha/action_list_preview.rb +4 -1
  98. data/previews/primer/alpha/action_menu_preview/align_end.html.erb +6 -0
  99. data/previews/primer/alpha/action_menu_preview/opens_dialog.html.erb +21 -0
  100. data/previews/primer/alpha/action_menu_preview.rb +238 -0
  101. data/previews/primer/alpha/dialog_preview/body_has_scrollbar_overflow.html.erb +2 -2
  102. data/previews/primer/alpha/dialog_preview/custom_header.html.erb +3 -3
  103. data/previews/primer/alpha/dialog_preview/nested_dialog.html.erb +4 -4
  104. data/previews/primer/alpha/dialog_preview/test.html.erb +3 -3
  105. data/previews/primer/alpha/dialog_preview/with_footer.html.erb +3 -3
  106. data/previews/primer/alpha/dialog_preview/with_form.html.erb +1 -1
  107. data/previews/primer/alpha/dialog_preview/with_text_input.html.erb +2 -2
  108. data/previews/primer/alpha/dialog_preview.rb +7 -2
  109. data/previews/primer/beta/auto_complete_item_preview.rb +1 -0
  110. data/static/arguments.json +3078 -1404
  111. data/static/audited_at.json +2 -0
  112. data/static/classes.json +576 -311
  113. data/static/constants.json +42 -2
  114. data/static/info_arch.json +8859 -0
  115. data/static/previews.json +221 -101
  116. data/static/statuses.json +2 -0
  117. metadata +23 -2
@@ -7,54 +7,6 @@ require "primer/view_components/engine"
7
7
  module Primer
8
8
  # :nodoc:
9
9
  module ViewComponents
10
- DEFAULT_STATIC_PATH = File.expand_path("static")
11
- FILE_NAMES = {
12
- statuses: "statuses.json",
13
- constants: "constants.json",
14
- audited_at: "audited_at.json"
15
- }.freeze
16
-
17
- # generate_statuses returns a hash mapping component name to
18
- # the component's status sorted alphabetically by the component name.
19
- def self.generate_statuses
20
- Primer::Component.descendants.sort_by(&:name).each_with_object({}) do |component, mem|
21
- mem[component.to_s] = component.status.to_s
22
- end
23
- end
24
-
25
- # generate_audited_at returns a hash mapping component name to
26
- # the day the component has passed an accessibility audit.
27
- def self.generate_audited_at
28
- Primer::Component.descendants.sort_by(&:name).each_with_object({}) do |component, mem|
29
- mem[component.to_s] = component.audited_at.to_s
30
- end
31
- end
32
-
33
- # generate_constants returns a hash mapping component name to
34
- # all of its constants.
35
- def self.generate_constants
36
- Primer::Component.descendants.sort_by(&:name).each_with_object({}) do |component, mem|
37
- mem[component.to_s] = component.constants(false).sort.each_with_object({}) do |constant, h|
38
- h[constant] = component.const_get(constant)
39
- end
40
- end
41
- end
42
-
43
- # dump generates the requested stat hash and outputs it to a file.
44
- def self.dump(stats)
45
- require "json"
46
-
47
- File.open(File.join(DEFAULT_STATIC_PATH, FILE_NAMES[stats]), "w") do |f|
48
- f.write(JSON.pretty_generate(send("generate_#{stats}")))
49
- f.write($INPUT_RECORD_SEPARATOR)
50
- end
51
- end
52
-
53
- # read returns a JSON string matching the output of the corresponding stat.
54
- def self.read(stats)
55
- File.read(File.join(DEFAULT_STATIC_PATH, FILE_NAMES[stats]))
56
- end
57
-
58
10
  # primer/view_components root directory.
59
11
  def self.root
60
12
  Pathname(File.expand_path(File.join("..", ".."), __dir__))
@@ -65,6 +65,7 @@ module Primer
65
65
  Primer::Alpha::Tooltip => { js: true },
66
66
  Primer::Alpha::ToggleSwitch => { js: true },
67
67
  Primer::Alpha::Overlay => { js: true },
68
+ Primer::Alpha::ActionMenu => { js: true },
68
69
 
69
70
  # Examples can be seen in the NavList docs
70
71
  Primer::Alpha::NavList => { js: true },
@@ -34,6 +34,20 @@ module Primer
34
34
  def form_component?
35
35
  @attrs.fetch(:form_component, ATTR_DEFAULTS[:form_component])
36
36
  end
37
+
38
+ def source_url
39
+ @source_url ||= begin
40
+ path = klass.name.split("::").map(&:underscore).join("/")
41
+ "https://github.com/primer/view_components/tree/main/app/components/#{path}.rb"
42
+ end
43
+ end
44
+
45
+ def lookbook_url
46
+ @lookbook_url ||= begin
47
+ path = klass.name.underscore.gsub("_component", "")
48
+ "https://primer.style/view-components/lookbook/inspect/#{path}/default/"
49
+ end
50
+ end
37
51
  end
38
52
  end
39
53
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  # :nocov:
4
4
  module Primer
5
+ # :nodoc:
5
6
  module Yard
6
7
  # Helper methods to use for yard documentation
7
8
  module DocsHelper
@@ -90,6 +91,8 @@ module Primer
90
91
  end
91
92
  end
92
93
  end
94
+
95
+ DocsHelper.extend(DocsHelper)
93
96
  end
94
97
  end
95
98
  # :nocov:
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ # :nocov:
4
+ module Primer
5
+ module Yard
6
+ # Helper methods to use for info arch yard documentation
7
+ module InfoArchDocsHelper
8
+ include DocsHelper
9
+
10
+ def link_to_component(component)
11
+ "{{#link_to_component}}#{component}{{/link_to_component}}"
12
+ end
13
+
14
+ def link_to_system_arguments_docs
15
+ "{{link_to_system_arguments_docs}}"
16
+ end
17
+
18
+ def link_to_typography_docs
19
+ "{{link_to_typography_docs}}"
20
+ end
21
+
22
+ def link_to_accessibility
23
+ "{{link_to_accessibility}}"
24
+ end
25
+
26
+ def link_to_octicons
27
+ "{{link_to_octicons}}"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -33,7 +33,6 @@ module Primer
33
33
  end
34
34
 
35
35
  def generate
36
- args_for_components = []
37
36
  errors = []
38
37
 
39
38
  each_component do |component_ref|
@@ -42,8 +41,8 @@ module Primer
42
41
  status_path = docs.status_module.nil? ? "" : "#{docs.status_module}/"
43
42
 
44
43
  metadata = docs.metadata.merge(
45
- source: source_url(component),
46
- lookbook: lookbook_url(component),
44
+ source: component_ref.source_url,
45
+ lookbook: component_ref.lookbook_url,
47
46
  path: "docs/content/components/#{status_path}#{docs.short_name.downcase}.md",
48
47
  example_path: example_path(component),
49
48
  require_js_path: require_js_path(component)
@@ -113,30 +112,11 @@ module Primer
113
112
  errors << { component.name => err }
114
113
  end
115
114
 
116
- args = []
117
115
  docs.params.each do |tag|
118
116
  default_value = pretty_default_value(tag, component)
119
-
120
- args << {
121
- "name" => tag.name,
122
- "type" => tag.types.join(", "),
123
- "default" => default_value,
124
- "description" => view_context.render(inline: tag.text.squish)
125
- }
126
-
127
117
  f.puts("| `#{tag.name}` | `#{tag.types.join(', ')}` | #{default_value} | #{view_context.render(inline: tag.text.squish)} |")
128
118
  end
129
119
 
130
- component_args = {
131
- "component" => metadata[:title],
132
- "status" => component.status.to_s,
133
- "source" => metadata[:source],
134
- "lookbook" => metadata[:lookbook],
135
- "parameters" => args
136
- }
137
-
138
- args_for_components << component_args
139
-
140
120
  if docs.slot_methods.any?
141
121
  f.puts
142
122
  f.puts("## Slots")
@@ -190,7 +170,7 @@ module Primer
190
170
  f.puts(view_context.render(inline: system_args_docs.constructor.base_docstring))
191
171
  end
192
172
 
193
- [args_for_components, errors]
173
+ errors
194
174
  end
195
175
 
196
176
  private
@@ -220,18 +200,6 @@ module Primer
220
200
  manifest.each(&block)
221
201
  end
222
202
 
223
- def source_url(component)
224
- path = component.name.split("::").map(&:underscore).join("/")
225
-
226
- "https://github.com/primer/view_components/tree/main/app/components/#{path}.rb"
227
- end
228
-
229
- def lookbook_url(component)
230
- path = component.name.underscore.gsub("_component", "")
231
-
232
- "https://primer.style/view-components/lookbook/inspect/#{path}/default/"
233
- end
234
-
235
203
  def example_path(component)
236
204
  example_path = "../../src/@primer/gatsby-theme-doctocat/components/example"
237
205
  example_path = "../#{example_path}" if status_module?(component)
@@ -28,6 +28,7 @@ module Primer
28
28
 
29
29
  {
30
30
  title: class_name,
31
+ class_name: class_name,
31
32
  component_id: short_name.underscore,
32
33
  status: status.capitalize,
33
34
  status_module: status_module,
@@ -42,7 +43,7 @@ module Primer
42
43
  end
43
44
 
44
45
  def params
45
- constructor.tags(:param)
46
+ constructor&.tags(:param) || []
46
47
  end
47
48
 
48
49
  def slot_methods
data/lib/primer/yard.rb CHANGED
@@ -6,6 +6,7 @@ module Primer
6
6
  autoload :ComponentManifest, "primer/yard/component_manifest"
7
7
  autoload :ComponentRef, "primer/yard/component_ref"
8
8
  autoload :DocsHelper, "primer/yard/docs_helper"
9
+ autoload :InfoArchDocsHelper, "primer/yard/info_arch_docs_helper"
9
10
  autoload :LegacyGatsbyBackend, "primer/yard/legacy_gatsby_backend"
10
11
  autoload :Registry, "primer/yard/registry"
11
12
  autoload :RendersManyHandler, "primer/yard/renders_many_handler"
@@ -99,45 +99,105 @@
99
99
  :border:
100
100
  :left:
101
101
  - border-left
102
+ - border-sm-left
103
+ - border-md-left
104
+ - border-lg-left
105
+ - border-xl-left
102
106
  :top:
103
107
  - border-top
108
+ - border-sm-top
109
+ - border-md-top
110
+ - border-lg-top
111
+ - border-xl-top
104
112
  :bottom:
105
113
  - border-bottom
114
+ - border-sm-bottom
115
+ - border-md-bottom
116
+ - border-lg-bottom
117
+ - border-xl-bottom
106
118
  :right:
107
119
  - border-right
120
+ - border-sm-right
121
+ - border-md-right
122
+ - border-lg-right
123
+ - border-xl-right
108
124
  :y:
109
125
  - border-y
110
126
  :x:
111
127
  - border-x
112
128
  true:
113
129
  - border
130
+ - border-sm
131
+ - border-md
132
+ - border-lg
133
+ - border-xl
114
134
  0:
115
135
  - border-0
136
+ - border-sm-0
137
+ - border-md-0
138
+ - border-lg-0
139
+ - border-xl-0
116
140
  false:
117
141
  - border-0
142
+ - border-sm-0
143
+ - border-md-0
144
+ - border-lg-0
145
+ - border-xl-0
118
146
  :dashed:
119
147
  - border-dashed
120
148
  :border_top:
121
149
  0:
122
150
  - border-top-0
151
+ - border-sm-top-0
152
+ - border-md-top-0
153
+ - border-lg-top-0
154
+ - border-xl-top-0
123
155
  :border_bottom:
124
156
  0:
125
157
  - border-bottom-0
158
+ - border-sm-bottom-0
159
+ - border-md-bottom-0
160
+ - border-lg-bottom-0
161
+ - border-xl-bottom-0
126
162
  :border_left:
127
163
  0:
128
164
  - border-left-0
165
+ - border-sm-left-0
166
+ - border-md-left-0
167
+ - border-lg-left-0
168
+ - border-xl-left-0
129
169
  :border_right:
130
170
  0:
131
171
  - border-right-0
172
+ - border-sm-right-0
173
+ - border-md-right-0
174
+ - border-lg-right-0
175
+ - border-xl-right-0
132
176
  :border_radius:
133
177
  0:
134
178
  - rounded-0
179
+ - rounded-sm-0
180
+ - rounded-md-0
181
+ - rounded-lg-0
182
+ - rounded-xl-0
135
183
  1:
136
184
  - rounded-1
185
+ - rounded-sm-1
186
+ - rounded-md-1
187
+ - rounded-lg-1
188
+ - rounded-xl-1
137
189
  2:
138
190
  - rounded-2
191
+ - rounded-sm-2
192
+ - rounded-md-2
193
+ - rounded-lg-2
194
+ - rounded-xl-2
139
195
  3:
140
196
  - rounded-3
197
+ - rounded-sm-3
198
+ - rounded-md-3
199
+ - rounded-lg-3
200
+ - rounded-xl-3
141
201
  :justify_content:
142
202
  :flex_start:
143
203
  - flex-justify-start
data/lib/tasks/docs.rake CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  require "active_support/inflector"
4
4
 
5
+ task :init_pvc do
6
+ ENV["RAILS_ENV"] = "test"
7
+ ENV["VC_COMPAT_PATCH_ENABLED"] = "true"
8
+
9
+ require File.expand_path("./../../demo/config/environment.rb", __dir__)
10
+ Dir[File.expand_path("../../app/components/primer/**/*.rb", __dir__)].sort.each { |file| require file }
11
+ end
12
+
5
13
  namespace :docs do
6
14
  task :livereload do
7
15
  require "listen"
@@ -39,7 +47,7 @@ namespace :docs do
39
47
 
40
48
  manifest = Primer::Yard::ComponentManifest.where(published: true)
41
49
  backend = Primer::Yard::LegacyGatsbyBackend.new(registry, manifest)
42
- args_for_components, errors = backend.generate
50
+ errors = backend.generate
43
51
 
44
52
  unless errors.empty?
45
53
  puts "==============================================="
@@ -50,11 +58,7 @@ namespace :docs do
50
58
  puts "==============================================="
51
59
  puts "==============================================="
52
60
 
53
- raise
54
- end
55
-
56
- File.open("static/arguments.json", "w") do |f|
57
- f.puts JSON.pretty_generate(args_for_components)
61
+ raise
58
62
  end
59
63
 
60
64
  puts "Markdown compiled."
@@ -162,12 +166,6 @@ namespace :docs do
162
166
  end
163
167
  end
164
168
 
165
- task :init_pvc do
166
- ENV["RAILS_ENV"] = "test"
167
- require File.expand_path("./../../demo/config/environment.rb", __dir__)
168
- Dir[File.expand_path("../../app/components/primer/**/*.rb", __dir__)].sort.each { |file| require file }
169
- end
170
-
171
169
  task build_yard_registry: :init_pvc do
172
170
  require "primer/yard"
173
171
 
@@ -1,37 +1,29 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  namespace :static do
4
- task :dump do
5
- ENV["RAILS_ENV"] = "test"
6
- require File.expand_path("./../../demo/config/environment.rb", __dir__)
7
- require "primer/view_components"
8
- require "lookbook"
9
- # Loads all components for `.descendants` to work properly
10
- Dir["./app/components/primer/**/*.rb"].sort.each { |file| require file }
4
+ task dump: [:dump_statuses, :dump_constants, :dump_audited_at, :dump_previews, :dump_arguments, :dump_info_arch]
11
5
 
12
- Primer::ViewComponents.dump(:statuses)
13
- Primer::ViewComponents.dump(:constants)
14
- Primer::ViewComponents.dump(:audited_at)
6
+ task dump_statuses: :init_pvc do
7
+ Primer::Static.dump(:statuses)
8
+ end
9
+
10
+ task dump_constants: :init_pvc do
11
+ Primer::Static.dump(:constants)
12
+ end
15
13
 
16
- previews = Lookbook.previews.map do |preview|
17
- {
18
- name: preview.name,
19
- lookup_path: preview.lookup_path,
20
- examples: preview.examples.map { |example|
21
- {
22
- inspect_path: example.url_path,
23
- preview_path: example.url_path.sub("/inspect/", "/preview/"),
24
- name: example.name
25
- }
26
- }
27
- }
28
- end
14
+ task dump_audited_at: :init_pvc do
15
+ Primer::Static.dump(:audited_at)
16
+ end
29
17
 
30
- require "json"
18
+ task dump_previews: :init_pvc do
19
+ Primer::Static.dump(:previews)
20
+ end
21
+
22
+ task dump_arguments: ["docs:build_yard_registry", :init_pvc] do
23
+ Primer::Static.dump(:arguments)
24
+ end
31
25
 
32
- File.open(File.join(Primer::ViewComponents::DEFAULT_STATIC_PATH, "previews.json"), "w") do |f|
33
- f.write(JSON.pretty_generate(previews))
34
- f.write($INPUT_RECORD_SEPARATOR)
35
- end
26
+ task dump_info_arch: ["docs:build_yard_registry", :dump_previews, :dump_arguments] do
27
+ Primer::Static.dump(:info_arch)
36
28
  end
37
29
  end
@@ -344,7 +344,10 @@ module Primer
344
344
  render(Primer::Alpha::ActionList.new(
345
345
  aria: { label: "List heading" }
346
346
  )) do |component|
347
- component.with_item(label: "Disabled item", href: "/", disabled: true)
347
+ component.with_item(label: "Disabled item", href: "/", disabled: true) do |item|
348
+ item.with_description { "Item description" }
349
+ item.with_leading_visual_icon(icon: :gear)
350
+ end
348
351
  end
349
352
  end
350
353
 
@@ -0,0 +1,6 @@
1
+ <div style="display: grid; place-content: center;">
2
+ <%= render(Primer::Alpha::ActionMenu.new(anchor_align: :end)) do |component| %>
3
+ <% component.with_show_button { "Menu" } %>
4
+ <% component.with_item(label: "Item", tag: :button, value: "") %>
5
+ <% end %>
6
+ </div>
@@ -0,0 +1,21 @@
1
+ <%= render(Primer::Alpha::ActionMenu.new) do |component| %>
2
+ <% component.with_show_button { "Menu" } %>
3
+ <% component.with_item(label: "Item", tag: :button, value: "") %>
4
+ <% component.with_item(
5
+ label: "Show dialog",
6
+ tag: :button,
7
+ content_arguments: { "data-show-dialog-id": "my-dialog" },
8
+ value: "",
9
+ scheme: :danger
10
+ ) %>
11
+ <% end %>
12
+
13
+ <%= render(Primer::Alpha::Dialog.new(id: "my-dialog", title: "Confirm deletion")) do |d| %>
14
+ <%= render(Primer::Alpha::Dialog::Body.new()) do %>
15
+ Are you sure you want to delete this?
16
+ <% end %>
17
+ <%= render(Primer::Alpha::Dialog::Footer.new()) do %>
18
+ <%= render(Primer::Beta::Button.new(data: { "close-dialog-id": "my-dialog" })) { "Cancel" } %>
19
+ <%= render(Primer::Beta::Button.new(scheme: :danger)) { "Delete" } %>
20
+ <% end %>
21
+ <% end %>