primer_view_components 0.5.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +90 -0
  3. data/app/assets/javascripts/app/components/primer/alpha/action_menu/action_menu_element.d.ts +3 -2
  4. data/app/assets/javascripts/app/components/primer/alpha/x_banner.d.ts +3 -1
  5. data/app/assets/javascripts/primer_view_components.js +1 -1
  6. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  7. data/app/assets/styles/primer_view_components.css +1 -1
  8. data/app/assets/styles/primer_view_components.css.map +1 -1
  9. data/app/components/primer/alpha/action_bar.rb +0 -8
  10. data/app/components/primer/alpha/action_list/item.rb +17 -6
  11. data/app/components/primer/alpha/action_list.css +1 -1
  12. data/app/components/primer/alpha/action_list.css.json +2 -0
  13. data/app/components/primer/alpha/action_list.css.map +1 -1
  14. data/app/components/primer/alpha/action_list.pcss +4 -2
  15. data/app/components/primer/alpha/action_list.rb +61 -6
  16. data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +3 -2
  17. data/app/components/primer/alpha/action_menu/action_menu_element.js +17 -3
  18. data/app/components/primer/alpha/action_menu/action_menu_element.ts +20 -6
  19. data/app/components/primer/alpha/action_menu/list.rb +63 -34
  20. data/app/components/primer/alpha/action_menu.rb +12 -269
  21. data/app/components/primer/alpha/auto_complete/item.rb +0 -12
  22. data/app/components/primer/alpha/auto_complete.css +1 -1
  23. data/app/components/primer/alpha/auto_complete.css.map +1 -1
  24. data/app/components/primer/alpha/auto_complete.rb +0 -47
  25. data/app/components/primer/alpha/banner.css +1 -1
  26. data/app/components/primer/alpha/banner.css.map +1 -1
  27. data/app/components/primer/alpha/banner.html.erb +1 -1
  28. data/app/components/primer/alpha/banner.rb +12 -39
  29. data/app/components/primer/alpha/button_marketing.rb +0 -12
  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/dialog.pcss +1 -1
  33. data/app/components/primer/alpha/dialog.rb +2 -18
  34. data/app/components/primer/alpha/dropdown.css +1 -1
  35. data/app/components/primer/alpha/dropdown.css.map +1 -1
  36. data/app/components/primer/alpha/dropdown.rb +0 -105
  37. data/app/components/primer/alpha/form_control.rb +0 -11
  38. data/app/components/primer/alpha/hellip_button.rb +0 -9
  39. data/app/components/primer/alpha/hidden_text_expander.rb +0 -9
  40. data/app/components/primer/alpha/image.rb +0 -16
  41. data/app/components/primer/alpha/image_crop.rb +0 -11
  42. data/app/components/primer/alpha/layout.css +1 -1
  43. data/app/components/primer/alpha/layout.css.map +1 -1
  44. data/app/components/primer/alpha/layout.pcss +1 -1
  45. data/app/components/primer/alpha/layout.rb +0 -118
  46. data/app/components/primer/alpha/menu.css +1 -1
  47. data/app/components/primer/alpha/menu.css.map +1 -1
  48. data/app/components/primer/alpha/menu.rb +0 -19
  49. data/app/components/primer/alpha/multi_input.rb +0 -33
  50. data/app/components/primer/alpha/nav_list/group.rb +12 -3
  51. data/app/components/primer/alpha/nav_list.rb +79 -84
  52. data/app/components/primer/alpha/navigation/tab.rb +0 -35
  53. data/app/components/primer/alpha/octicon_symbols.rb +0 -6
  54. data/app/components/primer/alpha/overlay.rb +0 -14
  55. data/app/components/primer/alpha/segmented_control.css +1 -1
  56. data/app/components/primer/alpha/segmented_control.css.map +1 -1
  57. data/app/components/primer/alpha/segmented_control.rb +0 -61
  58. data/app/components/primer/alpha/tab_container.rb +0 -18
  59. data/app/components/primer/alpha/tab_nav.css +1 -1
  60. data/app/components/primer/alpha/tab_nav.css.map +1 -1
  61. data/app/components/primer/alpha/tab_nav.rb +0 -63
  62. data/app/components/primer/alpha/tab_panels.rb +0 -16
  63. data/app/components/primer/alpha/text_field.css +1 -1
  64. data/app/components/primer/alpha/text_field.css.map +1 -1
  65. data/app/components/primer/alpha/text_field.rb +0 -68
  66. data/app/components/primer/alpha/toggle_switch.css +1 -1
  67. data/app/components/primer/alpha/toggle_switch.css.map +1 -1
  68. data/app/components/primer/alpha/toggle_switch.rb +0 -18
  69. data/app/components/primer/alpha/tool_tip.js +3 -3
  70. data/app/components/primer/alpha/tool_tip.ts +3 -3
  71. data/app/components/primer/alpha/tooltip.rb +1 -69
  72. data/app/components/primer/alpha/underline_nav.css +1 -1
  73. data/app/components/primer/alpha/underline_nav.css.map +1 -1
  74. data/app/components/primer/alpha/underline_nav.rb +0 -61
  75. data/app/components/primer/alpha/underline_panels.rb +0 -19
  76. data/app/components/primer/alpha/x_banner.d.ts +3 -1
  77. data/app/components/primer/alpha/x_banner.js +24 -10
  78. data/app/components/primer/alpha/x_banner.ts +14 -12
  79. data/app/components/primer/base_component.rb +1 -1
  80. data/app/components/primer/beta/auto_complete/item.rb +0 -8
  81. data/app/components/primer/beta/auto_complete.rb +0 -56
  82. data/app/components/primer/beta/avatar.css +1 -1
  83. data/app/components/primer/beta/avatar.css.map +1 -1
  84. data/app/components/primer/beta/avatar.rb +1 -19
  85. data/app/components/primer/beta/avatar_stack.css +1 -1
  86. data/app/components/primer/beta/avatar_stack.css.map +1 -1
  87. data/app/components/primer/beta/avatar_stack.rb +0 -21
  88. data/app/components/primer/beta/base_button.rb +0 -4
  89. data/app/components/primer/beta/blankslate.css +1 -1
  90. data/app/components/primer/beta/blankslate.css.map +1 -1
  91. data/app/components/primer/beta/blankslate.rb +0 -104
  92. data/app/components/primer/beta/border_box/header.rb +4 -11
  93. data/app/components/primer/beta/border_box.css +1 -1
  94. data/app/components/primer/beta/border_box.css.map +1 -1
  95. data/app/components/primer/beta/border_box.html.erb +2 -2
  96. data/app/components/primer/beta/border_box.rb +11 -55
  97. data/app/components/primer/beta/breadcrumbs.rb +0 -7
  98. data/app/components/primer/beta/button.css +1 -1
  99. data/app/components/primer/beta/button.css.map +1 -1
  100. data/app/components/primer/beta/button.pcss +3 -3
  101. data/app/components/primer/beta/button.rb +2 -43
  102. data/app/components/primer/beta/button_group.css +1 -1
  103. data/app/components/primer/beta/button_group.css.map +1 -1
  104. data/app/components/primer/beta/button_group.rb +0 -16
  105. data/app/components/primer/beta/clipboard_copy.rb +0 -12
  106. data/app/components/primer/beta/close_button.rb +0 -3
  107. data/app/components/primer/beta/counter.rb +0 -8
  108. data/app/components/primer/beta/details.rb +0 -11
  109. data/app/components/primer/beta/flash.css +1 -1
  110. data/app/components/primer/beta/flash.css.map +1 -1
  111. data/app/components/primer/beta/flash.rb +1 -23
  112. data/app/components/primer/beta/heading.rb +0 -8
  113. data/app/components/primer/beta/icon_button.rb +0 -21
  114. data/app/components/primer/beta/label.css +1 -1
  115. data/app/components/primer/beta/label.css.map +1 -1
  116. data/app/components/primer/beta/label.rb +0 -20
  117. data/app/components/primer/beta/link.rb +0 -22
  118. data/app/components/primer/beta/markdown.rb +1 -262
  119. data/app/components/primer/beta/octicon.rb +0 -10
  120. data/app/components/primer/beta/popover.css +1 -1
  121. data/app/components/primer/beta/popover.css.map +1 -1
  122. data/app/components/primer/beta/popover.rb +0 -43
  123. data/app/components/primer/beta/progress_bar.rb +1 -22
  124. data/app/components/primer/beta/relative_time.rb +0 -9
  125. data/app/components/primer/beta/spinner.rb +2 -10
  126. data/app/components/primer/beta/state.rb +0 -13
  127. data/app/components/primer/beta/subhead.rb +0 -55
  128. data/app/components/primer/beta/text.rb +0 -4
  129. data/app/components/primer/beta/timeline_item.css +1 -1
  130. data/app/components/primer/beta/timeline_item.css.map +1 -1
  131. data/app/components/primer/beta/timeline_item.rb +0 -9
  132. data/app/components/primer/beta/truncate.rb +0 -50
  133. data/app/components/primer/blankslate_component.rb +0 -76
  134. data/app/components/primer/box.rb +0 -6
  135. data/app/components/primer/button_component.rb +0 -49
  136. data/app/components/primer/conditional_wrapper.rb +2 -17
  137. data/app/components/primer/icon_button.rb +0 -30
  138. data/app/components/primer/layout_component.rb +0 -12
  139. data/app/components/primer/tooltip.rb +0 -27
  140. data/app/components/primer/truncate.rb +0 -19
  141. data/app/forms/submit_button_form.rb +1 -1
  142. data/lib/primer/accessibility.rb +1 -1
  143. data/lib/primer/classify/utilities.yml +2 -0
  144. data/lib/primer/deprecations.yml +3 -3
  145. data/lib/primer/forms/button.rb +0 -5
  146. data/lib/primer/forms/dsl/input.rb +3 -0
  147. data/lib/primer/static/generate_info_arch.rb +1 -0
  148. data/lib/primer/view_components/linters/details_menu_migration.rb +1 -1
  149. data/lib/primer/view_components/linters/migrations/truncate_component.rb +45 -0
  150. data/lib/primer/view_components/linters/tooltipped_migration.rb +1 -1
  151. data/lib/primer/view_components/linters.rb +1 -0
  152. data/lib/primer/view_components/version.rb +2 -2
  153. data/lib/primer/yard/lookbook_pages_backend.rb +31 -0
  154. data/lib/primer/yard.rb +8 -9
  155. data/lib/tasks/custom_utilities.yml +2 -0
  156. data/previews/primer/alpha/action_list_preview.rb +89 -17
  157. data/previews/primer/alpha/action_menu_preview.rb +79 -37
  158. data/previews/primer/alpha/banner_preview/with_action_button.html.erb +1 -1
  159. data/previews/primer/alpha/banner_preview/with_action_content.html.erb +1 -1
  160. data/previews/primer/alpha/banner_preview.rb +11 -14
  161. data/previews/primer/alpha/nav_list_preview.rb +17 -0
  162. data/previews/primer/alpha/tooltip_preview/with_multiple_on_a_page.html.erb +3 -3
  163. data/previews/primer/alpha/tooltip_preview.rb +11 -23
  164. data/static/arguments.json +18 -13
  165. data/static/constants.json +6 -0
  166. data/static/info_arch.json +493 -36
  167. data/static/previews.json +15 -15
  168. metadata +3 -3
  169. data/lib/primer/yard/legacy_gatsby_backend.rb +0 -233
@@ -84,15 +84,6 @@ module Primer
84
84
  PRECISION_DEFAULT = nil
85
85
  PRECISION_OPTIONS = [PRECISION_DEFAULT, :second, :minute, :hour, :day, :month, :year].freeze
86
86
 
87
- # @example Default
88
- # <%= render(Primer::Beta::RelativeTime.new(datetime: Time.at(628232400))) %>
89
- #
90
- # @example Past Time
91
- # <%= render(Primer::Beta::RelativeTime.new(datetime: Time.at(628232400), tense: :past)) %>
92
- #
93
- # @example Elapsed Time
94
- # <%= render(Primer::Beta::RelativeTime.new(datetime: Time.at(628232400), format: :elapsed)) %>
95
- #
96
87
  # @param datetime [Time] The time to be formatted.
97
88
  # @param tense [Symbol] Which tense to use. <%= one_of(Primer::Beta::RelativeTime::TENSE_OPTIONS) %>
98
89
  # @param prefix [sring] What to prefix the relative ime display with.
@@ -12,21 +12,13 @@ module Primer
12
12
  DEFAULT_SIZE => 32,
13
13
  :large => 64
14
14
  }.freeze
15
+
15
16
  SIZE_OPTIONS = SIZE_MAPPINGS.keys
17
+
16
18
  # Setting `box-sizing: content-box` allows consumers to add padding
17
19
  # to the spinner without shrinking the icon
18
20
  DEFAULT_STYLE = "box-sizing: content-box; color: var(--color-icon-primary);"
19
21
 
20
- #
21
- # @example Default
22
- # <%= render(Primer::Beta::Spinner.new) %>
23
- #
24
- # @example Small
25
- # <%= render(Primer::Beta::Spinner.new(size: :small)) %>
26
- #
27
- # @example Large
28
- # <%= render(Primer::Beta::Spinner.new(size: :large)) %>
29
- #
30
22
  # @param size [Symbol] <%= one_of(Primer::Beta::Spinner::SIZE_MAPPINGS) %>
31
23
  # @param style [String] Custom element styles.
32
24
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
@@ -32,19 +32,6 @@ module Primer
32
32
  TAG_DEFAULT = :span
33
33
  TAG_OPTIONS = [TAG_DEFAULT, :div].freeze
34
34
 
35
- # @example Default
36
- # <%= render(Primer::Beta::State.new(title: "title")) { "State" } %>
37
- #
38
- # @example Schemes
39
- # <%= render(Primer::Beta::State.new(title: "title")) { "Default" } %>
40
- # <%= render(Primer::Beta::State.new(title: "title", scheme: :open)) { "Open" } %>
41
- # <%= render(Primer::Beta::State.new(title: "title", scheme: :closed)) { "Closed" } %>
42
- # <%= render(Primer::Beta::State.new(title: "title", scheme: :merged)) { "Merged" } %>
43
- #
44
- # @example Sizes
45
- # <%= render(Primer::Beta::State.new(title: "title")) { "Default" } %>
46
- # <%= render(Primer::Beta::State.new(title: "title", size: :small)) { "Small" } %>
47
- #
48
35
  # @param title [String] `title` HTML attribute.
49
36
  # @param scheme [Symbol] Background color. <%= one_of(Primer::Beta::State::SCHEME_OPTIONS) %>
50
37
  # @param tag [Symbol] HTML tag for element. <%= one_of(Primer::Beta::State::TAG_OPTIONS) %>
@@ -55,61 +55,6 @@ module Primer
55
55
  Primer::BaseComponent.new(**system_arguments)
56
56
  }
57
57
 
58
- # @example Default
59
- # <%= render(Primer::Beta::Subhead.new) do |component| %>
60
- # <% component.with_heading(tag: :h3) do %>
61
- # My Heading
62
- # <% end %>
63
- # <% component.with_description do %>
64
- # My Description
65
- # <% end %>
66
- # <% end %>
67
- #
68
- # @example With dangerous heading
69
- # <%= render(Primer::Beta::Subhead.new) do |component| %>
70
- # <% component.with_heading(tag: :h3, danger: true) do %>
71
- # My Heading
72
- # <% end %>
73
- # <% component.with_description do %>
74
- # My Description
75
- # <% end %>
76
- # <% end %>
77
- #
78
- # @example With long description
79
- # <%= render(Primer::Beta::Subhead.new) do |component| %>
80
- # <% component.with_heading(tag: :h3) do %>
81
- # My Heading
82
- # <% end %>
83
- # <% end %>
84
- # <p> This is a longer description that is sitting below the Subhead. It's much longer than a description that could sit comfortably in the Subhead. </p>
85
- #
86
- # @example Without border
87
- # <%= render(Primer::Beta::Subhead.new(hide_border: true)) do |component| %>
88
- # <% component.with_heading do %>
89
- # My Heading
90
- # <% end %>
91
- # <% component.with_description do %>
92
- # My Description
93
- # <% end %>
94
- # <% end %>
95
- #
96
- # @example With actions
97
- # <%= render(Primer::Beta::Subhead.new) do |component| %>
98
- # <% component.with_heading do %>
99
- # My Heading
100
- # <% end %>
101
- # <% component.with_description do %>
102
- # My Description
103
- # <% end %>
104
- # <% component.with_actions do %>
105
- # <%= render(
106
- # Primer::ButtonComponent.new(
107
- # tag: :a, href: "http://www.google.com", scheme: :danger
108
- # )
109
- # ) { "Action" } %>
110
- # <% end %>
111
- # <% end %>
112
- #
113
58
  # @param spacious [Boolean] Whether to add spacing to the Subhead.
114
59
  # @param hide_border [Boolean] Whether to hide the border under the heading.
115
60
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
@@ -8,10 +8,6 @@ module Primer
8
8
 
9
9
  DEFAULT_TAG = :span
10
10
 
11
- # @example Default
12
- # <%= render(Primer::Beta::Text.new(tag: :p, font_weight: :bold)) { "Bold Text" } %>
13
- # <%= render(Primer::Beta::Text.new(tag: :p, color: :danger)) { "Danger Text" } %>
14
- #
15
11
  # @param tag [Symbol]
16
12
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
17
13
  def initialize(tag: DEFAULT_TAG, **system_arguments)
@@ -1 +1 @@
1
- .TimelineItem{display:flex;margin-left:var(--stack-gap-normal,1rem);padding:var(--stack-padding-normal,1rem) 0;position:relative}.TimelineItem:before{background-color:var(--borderColor-muted,var(--color-border-muted));bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:var(--borderWidth-thick,max(2px,.125rem))}.TimelineItem:target .TimelineItem-badge{border-color:var(--borderColor-accent-emphasis,var(--color-accent-fg));box-shadow:0 0 .2em var(--borderColor-accent-muted,var(--color-accent-muted))}.TimelineItem-badge{align-items:center;background-color:var(--timelineBadge-bgColor,var(--color-timeline-badge-bg));border:var(--borderWidth-thick,max(2px,.125rem)) solid var(--bgColor-default,var(--color-canvas-default));border-radius:50%;color:var(--fgColor-muted,var(--color-fg-muted));display:flex;flex-shrink:0;height:var(--control-medium-size,2rem);justify-content:center;margin-left:calc(var(--control-medium-size,2rem)/-2 + 1px);margin-right:var(--controlStack-medium-gap-condensed,.5rem);position:relative;width:var(--control-medium-size,2rem);z-index:1}.TimelineItem-badge--success{background-color:var(--bgColor-success-emphasis,var(--color-success-fg));border:var(--borderWidth-thin,max(1px,.0625rem)) solid #0000;color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.TimelineItem-body{color:var(--fgColor-muted,var(--color-fg-muted));flex:auto;margin-top:var(--base-size-4,.25rem);max-width:100%;min-width:0}.TimelineItem-avatar{left:-72px;position:absolute;z-index:1}.TimelineItem-break{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;border-top:var(--borderWidth-thicker,max(4px,.25rem)) solid var(--borderColor-default,var(--color-border-default));height:var(--stack-gap-spacious,1.5rem);margin:0;margin-bottom:calc(var(--stack-gap-normal,1rem)*-1);margin-left:-56px;position:relative;z-index:1}.TimelineItem--condensed{padding-bottom:0;padding-top:var(--base-size-4,.25rem)}.TimelineItem--condensed:last-child{padding-bottom:var(--stack-gap-normal,1rem)}.TimelineItem--condensed .TimelineItem-badge{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;color:var(--fgColor-muted,var(--color-fg-muted));height:var(--base-size-16,1rem);margin-bottom:var(--base-size-8,.5rem);margin-top:var(--base-size-8,.5rem)}
1
+ .TimelineItem{display:flex;margin-left:var(--stack-gap-normal,1rem);padding:var(--stack-padding-normal,1rem) 0;position:relative}.TimelineItem:before{background-color:var(--borderColor-muted,var(--color-border-muted));bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:var(--borderWidth-thick,max(2px,.125rem))}.TimelineItem:target .TimelineItem-badge{border-color:var(--borderColor-accent-emphasis,var(--color-accent-emphasis));box-shadow:0 0 .2em var(--borderColor-accent-muted,var(--color-accent-muted))}.TimelineItem-badge{align-items:center;background-color:var(--timelineBadge-bgColor,var(--color-timeline-badge-bg));border:var(--borderWidth-thick,max(2px,.125rem)) solid var(--bgColor-default,var(--color-canvas-default));border-radius:50%;color:var(--fgColor-muted,var(--color-fg-muted));display:flex;flex-shrink:0;height:var(--control-medium-size,2rem);justify-content:center;margin-left:calc(var(--control-medium-size,2rem)/-2 + 1px);margin-right:var(--controlStack-medium-gap-condensed,.5rem);position:relative;width:var(--control-medium-size,2rem);z-index:1}.TimelineItem-badge--success{background-color:var(--bgColor-success-emphasis,var(--color-success-emphasis));border:var(--borderWidth-thin,max(1px,.0625rem)) solid #0000;color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.TimelineItem-body{color:var(--fgColor-muted,var(--color-fg-muted));flex:auto;margin-top:var(--base-size-4,.25rem);max-width:100%;min-width:0}.TimelineItem-avatar{left:-72px;position:absolute;z-index:1}.TimelineItem-break{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;border-top:var(--borderWidth-thicker,max(4px,.25rem)) solid var(--borderColor-default,var(--color-border-default));height:var(--stack-gap-spacious,1.5rem);margin:0;margin-bottom:calc(var(--stack-gap-normal,1rem)*-1);margin-left:-56px;position:relative;z-index:1}.TimelineItem--condensed{padding-bottom:0;padding-top:var(--base-size-4,.25rem)}.TimelineItem--condensed:last-child{padding-bottom:var(--stack-gap-normal,1rem)}.TimelineItem--condensed .TimelineItem-badge{background-color:var(--bgColor-default,var(--color-canvas-default));border:0;color:var(--fgColor-muted,var(--color-fg-muted));height:var(--base-size-16,1rem);margin-bottom:var(--base-size-8,.5rem);margin-top:var(--base-size-8,.5rem)}
@@ -1 +1 @@
1
- {"version":3,"sources":["timeline_item.pcss"],"names":[],"mappings":"AAEA,cAEE,YAAa,CAEb,wCAAoC,CADpC,0CAAsC,CAFtC,iBAqBF,CAfE,qBAQE,mEAA0C,CAL1C,QAAS,CAIT,UAAW,CAFX,aAAc,CADd,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAIN,+CAGF,CAEA,yCACE,sEAAgD,CAChD,6EACF,CAGF,oBASE,kBAAmB,CACnB,4EAA8C,CAC9C,yGAA6D,CAC7D,iBAAkB,CAJlB,gDAA2B,CAL3B,YAAa,CAWb,aAAc,CATd,sCAAkC,CAQlC,sBAAuB,CANvB,0DAAwD,CADxD,2DAAsD,CALtD,iBAAkB,CAGlB,qCAAiC,CAFjC,SAaF,CAEA,6BAEE,wEAAiD,CACjD,4DAAiD,CAFjD,2DAGF,CAEA,mBAIE,gDAA2B,CAC3B,SAAU,CAFV,oCAA8B,CAD9B,cAAe,CADf,WAKF,CAEA,qBAEE,UAAW,CADX,iBAAkB,CAElB,SACF,CAEA,oBAOE,mEAAwC,CACxC,QAAS,CACT,kHAAuE,CANvE,uCAAiC,CACjC,QAAS,CACT,mDAAiD,CACjD,iBAAkB,CALlB,iBAAkB,CAClB,SAQF,CAEA,yBAEE,gBAAiB,CADjB,qCAgBF,CAZE,oCACE,2CACF,CAEA,6CAKE,mEAAwC,CACxC,QAAS,CAFT,gDAA2B,CAH3B,+BAA2B,CAE3B,sCAAiC,CADjC,mCAKF","file":"timeline_item.css","sourcesContent":["/* TimelineItem */\n\n.TimelineItem {\n position: relative;\n display: flex;\n padding: var(--stack-padding-normal) 0;\n margin-left: var(--stack-gap-normal);\n\n /* The Timeline */\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: block;\n width: var(--borderWidth-thick);\n content: '';\n background-color: var(--borderColor-muted);\n }\n\n &:target .TimelineItem-badge {\n border-color: var(--borderColor-accent-emphasis);\n box-shadow: 0 0 0.2em var(--borderColor-accent-muted);\n }\n}\n\n.TimelineItem-badge {\n position: relative;\n z-index: 1;\n display: flex;\n width: var(--control-medium-size);\n height: var(--control-medium-size);\n margin-right: var(--controlStack-medium-gap-condensed);\n margin-left: calc(var(--control-medium-size) / -2 + 1px);\n color: var(--fgColor-muted);\n align-items: center;\n background-color: var(--timelineBadge-bgColor);\n border: var(--borderWidth-thick) solid var(--bgColor-default);\n border-radius: 50%;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.TimelineItem-badge--success {\n color: var(--fgColor-onEmphasis);\n background-color: var(--bgColor-success-emphasis);\n border: var(--borderWidth-thin) solid transparent;\n}\n\n.TimelineItem-body {\n min-width: 0;\n max-width: 100%;\n margin-top: var(--base-size-4);\n color: var(--fgColor-muted);\n flex: auto;\n}\n\n.TimelineItem-avatar {\n position: absolute;\n left: -72px;\n z-index: 1;\n}\n\n.TimelineItem-break {\n position: relative;\n z-index: 1;\n height: var(--stack-gap-spacious);\n margin: 0;\n margin-bottom: calc(var(--stack-gap-normal) * -1);\n margin-left: -56px;\n background-color: var(--bgColor-default);\n border: 0;\n border-top: var(--borderWidth-thicker) solid var(--borderColor-default);\n}\n\n.TimelineItem--condensed {\n padding-top: var(--base-size-4);\n padding-bottom: 0;\n\n /* TimelineItem--condensed is often grouped. (commits) */\n &:last-child {\n padding-bottom: var(--stack-gap-normal);\n }\n\n & .TimelineItem-badge {\n height: var(--base-size-16);\n margin-top: var(--base-size-8);\n margin-bottom: var(--base-size-8);\n color: var(--fgColor-muted);\n background-color: var(--bgColor-default);\n border: 0;\n }\n}\n"]}
1
+ {"version":3,"sources":["timeline_item.pcss"],"names":[],"mappings":"AAEA,cAEE,YAAa,CAEb,wCAAoC,CADpC,0CAAsC,CAFtC,iBAqBF,CAfE,qBAQE,mEAA0C,CAL1C,QAAS,CAIT,UAAW,CAFX,aAAc,CADd,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAIN,+CAGF,CAEA,yCACE,4EAAgD,CAChD,6EACF,CAGF,oBASE,kBAAmB,CACnB,4EAA8C,CAC9C,yGAA6D,CAC7D,iBAAkB,CAJlB,gDAA2B,CAL3B,YAAa,CAWb,aAAc,CATd,sCAAkC,CAQlC,sBAAuB,CANvB,0DAAwD,CADxD,2DAAsD,CALtD,iBAAkB,CAGlB,qCAAiC,CAFjC,SAaF,CAEA,6BAEE,8EAAiD,CACjD,4DAAiD,CAFjD,2DAGF,CAEA,mBAIE,gDAA2B,CAC3B,SAAU,CAFV,oCAA8B,CAD9B,cAAe,CADf,WAKF,CAEA,qBAEE,UAAW,CADX,iBAAkB,CAElB,SACF,CAEA,oBAOE,mEAAwC,CACxC,QAAS,CACT,kHAAuE,CANvE,uCAAiC,CACjC,QAAS,CACT,mDAAiD,CACjD,iBAAkB,CALlB,iBAAkB,CAClB,SAQF,CAEA,yBAEE,gBAAiB,CADjB,qCAgBF,CAZE,oCACE,2CACF,CAEA,6CAKE,mEAAwC,CACxC,QAAS,CAFT,gDAA2B,CAH3B,+BAA2B,CAE3B,sCAAiC,CADjC,mCAKF","file":"timeline_item.css","sourcesContent":["/* TimelineItem */\n\n.TimelineItem {\n position: relative;\n display: flex;\n padding: var(--stack-padding-normal) 0;\n margin-left: var(--stack-gap-normal);\n\n /* The Timeline */\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: block;\n width: var(--borderWidth-thick);\n content: '';\n background-color: var(--borderColor-muted);\n }\n\n &:target .TimelineItem-badge {\n border-color: var(--borderColor-accent-emphasis);\n box-shadow: 0 0 0.2em var(--borderColor-accent-muted);\n }\n}\n\n.TimelineItem-badge {\n position: relative;\n z-index: 1;\n display: flex;\n width: var(--control-medium-size);\n height: var(--control-medium-size);\n margin-right: var(--controlStack-medium-gap-condensed);\n margin-left: calc(var(--control-medium-size) / -2 + 1px);\n color: var(--fgColor-muted);\n align-items: center;\n background-color: var(--timelineBadge-bgColor);\n border: var(--borderWidth-thick) solid var(--bgColor-default);\n border-radius: 50%;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.TimelineItem-badge--success {\n color: var(--fgColor-onEmphasis);\n background-color: var(--bgColor-success-emphasis);\n border: var(--borderWidth-thin) solid transparent;\n}\n\n.TimelineItem-body {\n min-width: 0;\n max-width: 100%;\n margin-top: var(--base-size-4);\n color: var(--fgColor-muted);\n flex: auto;\n}\n\n.TimelineItem-avatar {\n position: absolute;\n left: -72px;\n z-index: 1;\n}\n\n.TimelineItem-break {\n position: relative;\n z-index: 1;\n height: var(--stack-gap-spacious);\n margin: 0;\n margin-bottom: calc(var(--stack-gap-normal) * -1);\n margin-left: -56px;\n background-color: var(--bgColor-default);\n border: 0;\n border-top: var(--borderWidth-thicker) solid var(--borderColor-default);\n}\n\n.TimelineItem--condensed {\n padding-top: var(--base-size-4);\n padding-bottom: 0;\n\n /* TimelineItem--condensed is often grouped. (commits) */\n &:last-child {\n padding-bottom: var(--stack-gap-normal);\n }\n\n & .TimelineItem-badge {\n height: var(--base-size-16);\n margin-top: var(--base-size-8);\n margin-bottom: var(--base-size-8);\n color: var(--fgColor-muted);\n background-color: var(--bgColor-default);\n border: 0;\n }\n}\n"]}
@@ -38,15 +38,6 @@ module Primer
38
38
  Primer::BaseComponent.new(**system_arguments)
39
39
  }
40
40
 
41
- # @example Default
42
- # <div style="padding-left: 60px">
43
- # <%= render(Primer::Beta::TimelineItem.new) do |component| %>
44
- # <% component.with_avatar(src: Primer::ExampleImage::BASE64_SRC, alt: "github") %>
45
- # <% component.with_badge(bg: :success_emphasis, color: :on_emphasis, icon: :check) %>
46
- # <% component.with_body { "Success!" } %>
47
- # <% end %>
48
- # </div>
49
- #
50
41
  # @param condensed [Boolean] Reduce the vertical padding and remove the background from the badge item. Most commonly used in commits.
51
42
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
52
43
  def initialize(condensed: false, **system_arguments)
@@ -14,56 +14,6 @@ module Primer
14
14
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
15
15
  renders_many :items, "TruncateText"
16
16
 
17
- # @example Default
18
- # <%= render(Primer::Beta::Truncate.new) { "branch-name-that-is-really-long" } %>
19
- #
20
- # @example Multiple items
21
- # <%= render(Primer::Beta::Truncate.new) do |component| %>
22
- # <% component.with_item do %>really-long-repository-owner-name<% end %>
23
- # <% component.with_item(font_weight: :bold) do %>
24
- # <%= render(Primer::BaseComponent.new(tag: :span, font_weight: :normal)) { "/" } %> really-long-repository-name
25
- # <% end %>
26
- # <% end %>
27
- #
28
- # @example Advanced multiple items
29
- # <%= render(Primer::Beta::Truncate.new(tag: :ol)) do |component| %>
30
- # <% component.with_item(tag: :li) do %>primer<% end %>
31
- # <% component.with_item(tag: :li, priority: true) do %>/ css<% end %>
32
- # <% component.with_item(tag: :li) do %>/ Issues<% end %>
33
- # <% component.with_item(tag: :li) do %>/ #123 —<% end %>
34
- # <% component.with_item(tag: :li, priority: true) do %>
35
- # Visual bug on primer.style found in lists
36
- # <% end %>
37
- # <% end %>
38
- #
39
- # @example Expand on hover or focus
40
- # <%= render(Primer::Beta::Truncate.new) do |component| %>
41
- # <% component.with_item(tag: :a, href: "#", expandable: true) do %>really-long-repository-owner-name<% end %>
42
- # <% component.with_item(tag: :a, href: "#", expandable: true) do %>really-long-repository-owner-name<% end %>
43
- # <% component.with_item(tag: :a, href: "#", expandable: true) do %>really-long-repository-owner-name<% end %>
44
- # <% component.with_item(tag: :a, href: "#", expandable: true) do %>really-long-repository-owner-name<% end %>
45
- # <% end %>
46
- #
47
- # @example Max widths
48
- # <%= render(Primer::Beta::Truncate.new) do |component| %>
49
- # <% component.with_item(max_width: 300, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
50
- # <% component.with_item(max_width: 200, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
51
- # <% component.with_item(max_width: 100, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
52
- # <% end %>
53
- #
54
- # @example Max widths on new lines
55
- # <%= render(Primer::Beta::Truncate.new) do |component| %>
56
- # <% component.with_item(max_width: 300, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
57
- # <% end %>
58
- # <br/>
59
- # <%= render(Primer::Beta::Truncate.new) do |component| %>
60
- # <% component.with_item(max_width: 200, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
61
- # <% end %>
62
- # <br/>
63
- # <%= render(Primer::Beta::Truncate.new) do |component| %>
64
- # <% component.with_item(max_width: 100, expandable: true) do %>branch-name-that-is-really-long-branch-name-that-is-really-long-branch-name-that-is-really-long<% end %>
65
- # <% end %>
66
- #
67
17
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
68
18
  def initialize(**system_arguments)
69
19
  @system_arguments = system_arguments
@@ -16,82 +16,6 @@ module Primer
16
16
  Primer::Beta::Spinner.new(**system_arguments)
17
17
  }
18
18
 
19
- #
20
- # @example Basic
21
- # <%= render Primer::BlankslateComponent.new(
22
- # title: "Title",
23
- # description: "Description",
24
- # ) %>
25
- #
26
- # @example Icon
27
- # @description
28
- # Add an `icon` to give additional context. Refer to the [Octicons](https://primer.style/octicons/) documentation to choose an icon.
29
- # @code
30
- # <%= render Primer::BlankslateComponent.new(
31
- # icon: :globe,
32
- # title: "Title",
33
- # description: "Description",
34
- # ) %>
35
- #
36
- # @example Loading
37
- # @description
38
- # Add a [SpinnerComponent](https://primer.style/view-components/components/spinner) to the blankslate in place of an icon.
39
- # @code
40
- # <%= render Primer::BlankslateComponent.new(
41
- # title: "Title",
42
- # description: "Description",
43
- # ) do |component| %>
44
- # <% component.with_spinner(size: :large) %>
45
- # <% end %>
46
- #
47
- # @example Custom content
48
- # @description
49
- # Pass custom content as a block in place of `description`.
50
- # @code
51
- # <%= render Primer::BlankslateComponent.new(
52
- # title: "Title",
53
- # ) do %>
54
- # <em>Your custom content here</em>
55
- # <% end %>
56
- #
57
- # @example Action button
58
- # @description
59
- # Provide a button to guide users to take action from the blankslate. The button appears below the description and custom content.
60
- # @code
61
- # <%= render Primer::BlankslateComponent.new(
62
- # icon: :book,
63
- # title: "Welcome to the mona wiki!",
64
- # description: "Wikis provide a place in your repository to lay out the roadmap of your project, show the current status, and document software better, together.",
65
- #
66
- # button_text: "Create the first page",
67
- # button_url: "https://github.com/monalisa/mona/wiki/_new",
68
- # ) %>
69
- #
70
- # @example Link
71
- # @description
72
- # Add an additional link to help users learn more about a feature. The link will be shown at the very bottom:
73
- # @code
74
- # <%= render Primer::BlankslateComponent.new(
75
- # icon: :book,
76
- # title: "Welcome to the mona wiki!",
77
- # description: "Wikis provide a place in your repository to lay out the roadmap of your project, show the current status, and document software better, together.",
78
- # link_text: "Learn more about wikis",
79
- # link_url: "https://docs.github.com/en/github/building-a-strong-community/about-wikis",
80
- # ) %>
81
- #
82
- # @example Variations
83
- # @description
84
- # There are a few variations of how the Blankslate appears: `narrow` adds a maximum width, `large` increases the font size, and `spacious` adds extra padding.
85
- # @code
86
- # <%= render Primer::BlankslateComponent.new(
87
- # icon: :book,
88
- # title: "Welcome to the mona wiki!",
89
- # description: "Wikis provide a place in your repository to lay out the roadmap of your project, show the current status, and document software better, together.",
90
- # narrow: true,
91
- # large: true,
92
- # spacious: true,
93
- # ) %>
94
- #
95
19
  # @param title [String] Text that appears in a larger bold font.
96
20
  # @param title_tag [Symbol] HTML tag to use for title.
97
21
  # @param icon [Symbol] Octicon icon to use at top of component.
@@ -5,12 +5,6 @@ module Primer
5
5
  class Box < Primer::Component
6
6
  status :stable
7
7
 
8
- # @example Default
9
- # <%= render(Primer::Box.new) { "Your content here" } %>
10
- #
11
- # @example Color and padding
12
- # <%= render(Primer::Box.new(bg: :subtle, p: 3)) { "Hello world" } %>
13
- #
14
8
  # @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
15
9
  def initialize(**system_arguments)
16
10
  @system_arguments = deny_tag_argument(**system_arguments)
@@ -71,55 +71,6 @@ module Primer
71
71
  Primer::Alpha::Tooltip.new(**system_arguments)
72
72
  }
73
73
 
74
- # @example Schemes
75
- # <%= render(Primer::ButtonComponent.new) { "Default" } %>
76
- # <%= render(Primer::ButtonComponent.new(scheme: :primary)) { "Primary" } %>
77
- # <%= render(Primer::ButtonComponent.new(scheme: :danger)) { "Danger" } %>
78
- # <%= render(Primer::ButtonComponent.new(scheme: :outline)) { "Outline" } %>
79
- # <%= render(Primer::ButtonComponent.new(scheme: :invisible)) { "Invisible" } %>
80
- # <%= render(Primer::ButtonComponent.new(scheme: :link)) { "Link" } %>
81
- #
82
- # @example Sizes
83
- # <%= render(Primer::ButtonComponent.new(size: :small)) { "Small" } %>
84
- # <%= render(Primer::ButtonComponent.new(size: :medium)) { "Medium" } %>
85
- #
86
- # @example Block
87
- # <%= render(Primer::ButtonComponent.new(block: :true)) { "Block" } %>
88
- # <%= render(Primer::ButtonComponent.new(block: :true, scheme: :primary)) { "Primary block" } %>
89
- #
90
- # @example With leading visual
91
- # <%= render(Primer::ButtonComponent.new) do |component| %>
92
- # <% component.with_leading_visual_icon(icon: :star) %>
93
- # Button
94
- # <% end %>
95
- #
96
- # @example With trailing visual
97
- # <%= render(Primer::ButtonComponent.new) do |component| %>
98
- # <% component.with_trailing_visual_counter(count: 15) %>
99
- # Button
100
- # <% end %>
101
- #
102
- # @example With leading and trailing visuals
103
- # <%= render(Primer::ButtonComponent.new) do |component| %>
104
- # <% component.with_leading_visual_icon(icon: :star) %>
105
- # <% component.with_trailing_visual_counter(count: 15) %>
106
- # Button
107
- # <% end %>
108
- #
109
- # @example With dropdown caret
110
- # <%= render(Primer::ButtonComponent.new(dropdown: true)) do %>
111
- # Button
112
- # <% end %>
113
- #
114
- # @example With tooltip
115
- # @description
116
- # Use tooltips sparingly and as a last resort. Consult the <%= link_to_component(Primer::Alpha::Tooltip) %> documentation for more information.
117
- # @code
118
- # <%= render(Primer::ButtonComponent.new(id: "button-with-tooltip")) do |component| %>
119
- # <% component.with_tooltip(text: "Tooltip text") %>
120
- # Button
121
- # <% end %>
122
- #
123
74
  # @param scheme [Symbol] <%= one_of(Primer::ButtonComponent::SCHEME_OPTIONS) %>
124
75
  # @param variant [Symbol] DEPRECATED. <%= one_of(Primer::ButtonComponent::SIZE_OPTIONS) %>
125
76
  # @param size [Symbol] <%= one_of(Primer::ButtonComponent::SIZE_OPTIONS) %>
@@ -4,24 +4,9 @@ module Primer
4
4
  # Conditionally renders a `Primer::BaseComponent` around the given content. If the given condition
5
5
  # is true, a `Primer::BaseComponent` will render around the content. If the condition is false, only
6
6
  # the content is rendered.
7
- #
8
- # @example True conditional
9
- # <%# condition is true, so content will be wrapped in a <span> tag
10
- # <%= render Primer::ConditionalWrapper.new(condition: true, tag: :span, class: "foobar")) do %>
11
- # <%# also rendered %>
12
- # <p class="bazboo">Some text</p>
13
- # <% end %>
14
- #
15
- # @example False conditional
16
- # <%# condition is false so no <span> tag will render around the content (i.e. the <p> tag)
17
- # <%= render(Primer::ConditionalWrapper.new(condition: false, tag: :span, class: "foobar")) do %>
18
- # <%# this content will be rendered %>
19
- # <p class="bazboo">Some text</p>
20
- # <% end %>
21
- #
22
- # @param condition [Boolean] Whether or not to wrap the content in a `Primer::BaseComponent`.
23
- # @param base_component_arguments [Hash] The arguments to pass to `Primer::BaseComponent`.
24
7
  class ConditionalWrapper < Primer::Component
8
+ # @param condition [Boolean] Whether or not to wrap the content in a `Primer::BaseComponent`.
9
+ # @param base_component_arguments [Hash] The arguments to pass to `Primer::BaseComponent`.
25
10
  def initialize(condition:, **base_component_arguments)
26
11
  @condition = condition
27
12
  @base_component_arguments = base_component_arguments
@@ -21,36 +21,6 @@ module Primer
21
21
  }.freeze
22
22
  SCHEME_OPTIONS = SCHEME_MAPPINGS.keys
23
23
 
24
- # @example Default
25
- #
26
- # <%= render(Primer::IconButton.new(icon: :search, "aria-label": "Search", id: "search-button")) %>
27
- #
28
- # @example Schemes
29
- #
30
- # <%= render(Primer::IconButton.new(icon: :search, "aria-label": "Search")) %>
31
- # <%= render(Primer::IconButton.new(icon: :trash, "aria-label": "Delete", scheme: :danger)) %>
32
- #
33
- # @example In a BorderBox
34
- #
35
- # <%= render(Primer::Beta::BorderBox.new) do |component| %>
36
- # <% component.with_body do %>
37
- # <%= render(Primer::Beta::Text.new(pr: 2)) { "Body" } %>
38
- # <%= render(Primer::IconButton.new(icon: :pencil, box: true, "aria-label": "Edit")) %>
39
- # <% end %>
40
- # <% end %>
41
- #
42
- # @example With an `aria-description`
43
- # @description
44
- # If you need to have a longer description for the icon button, use both the `aria-label` and `aria-description`
45
- # attributes. A label should be short and concise, while the description can be longer as it is intended to provide
46
- # more context and information. See the accessibility section for more information.
47
- # @code
48
- # <%= render(Primer::IconButton.new(icon: :bold, "aria-label": "Bold", "aria-description": "Add bold text, Cmd+b")) %>
49
- #
50
- # @example Custom tooltip direction
51
- #
52
- # <%= render(Primer::IconButton.new(icon: :search, "aria-label": "Search", tooltip_direction: :e)) %>
53
- #
54
24
  # @param scheme [Symbol] <%= one_of(Primer::IconButton::SCHEME_OPTIONS) %>
55
25
  # @param icon [String] Name of <%= link_to_octicons %> to use.
56
26
  # @param tag [Symbol] <%= one_of(Primer::Beta::BaseButton::TAG_OPTIONS) %>
@@ -38,18 +38,6 @@ module Primer
38
38
  DEFAULT_SIDEBAR_COL = 3
39
39
  ALLOWED_SIDEBAR_COLS = (1..(MAX_COL - 1)).to_a.freeze
40
40
 
41
- # @example Default
42
- # <%= render(Primer::LayoutComponent.new) do |component| %>
43
- # <% component.with_sidebar { "Sidebar" } %>
44
- # <% component.with_main { "Main" } %>
45
- # <% end %>
46
- #
47
- # @example Left sidebar
48
- # <%= render(Primer::LayoutComponent.new(side: :left)) do |component| %>
49
- # <% component.with_sidebar { "Sidebar" } %>
50
- # <% component.with_main { "Main" } %>
51
- # <% end %>
52
- #
53
41
  # @param responsive [Boolean] Whether to collapse layout to a single column at smaller widths.
54
42
  # @param side [Symbol] Which side to display the sidebar on. <%= one_of(Primer::LayoutComponent::ALLOWED_SIDES) %>
55
43
  # @param sidebar_col [Integer] Sidebar column width.
@@ -28,33 +28,6 @@ module Primer
28
28
  se
29
29
  ]
30
30
 
31
- # @example Default
32
- # <div class="pt-5">
33
- # <%= render(Primer::Tooltip.new(label: "Even bolder")) { "Default Bold Text" } %>
34
- # </div>
35
- #
36
- # @example Wrapping another component
37
- # <div class="pt-5">
38
- # <%= render(Primer::Tooltip.new(label: "Even bolder")) do %>
39
- # <%= render(Primer::ButtonComponent.new) { "Bold Button" } %>
40
- # <% end %>
41
- # </div>
42
- #
43
- # @example With a direction
44
- # <div class="pt-5">
45
- # <%= render(Primer::Tooltip.new(label: "Even bolder", direction: :s)) { "Bold Text With a Direction" } %>
46
- # </div>
47
- #
48
- # @example With an alignment
49
- # <div class="pt-5">
50
- # <%= render(Primer::Tooltip.new(label: "Even bolder", direction: :s, alignment: :right_1)) { "Bold Text With an Alignment" } %>
51
- # </div>
52
- #
53
- # @example Without a delay
54
- # <div class="pt-5">
55
- # <%= render(Primer::Tooltip.new(label: "Even bolder", direction: :s, no_delay: true)) { "Bold Text without a delay" } %>
56
- # </div>
57
- #
58
31
  # @param label [String] the text to appear in the tooltip
59
32
  # @param direction [String] Direction of the tooltip. <%= one_of(Primer::Tooltip::DIRECTION_OPTIONS) %>
60
33
  # @param align [String] Align tooltips to the left or right of an element, combined with a `direction` to specify north or south. <%= one_of(Primer::Tooltip::ALIGN_MAPPING.keys) %>
@@ -8,25 +8,6 @@ module Primer
8
8
  DEFAULT_TAG = :div
9
9
  TAG_OPTIONS = [DEFAULT_TAG, :span, :p, :strong].freeze
10
10
 
11
- # @example Default
12
- # <div class="col-2">
13
- # <%= render(Primer::Truncate.new(tag: :p)) { "branch-name-that-is-really-long" } %>
14
- # </div>
15
- #
16
- # @example Inline
17
- # <%= render(Primer::Truncate.new(tag: :span, inline: true)) { "branch-name-that-is-really-long" } %>
18
- #
19
- # @example Expandable
20
- # <%= render(Primer::Truncate.new(tag: :span, inline: true, expandable: true)) { "branch-name-that-is-really-long" } %>
21
- #
22
- # @example Custom size
23
- # <%= render(Primer::Truncate.new(tag: :span, inline: true, expandable: true, max_width: 100)) { "branch-name-that-is-really-long" } %>
24
- #
25
- # @example With HTML content
26
- # <%= render(Primer::Truncate.new(tag: :span, inline: true, expandable: true, max_width: 100)) do %>
27
- # <span>branch-name-that-is-really-long</span>
28
- # <% end %>
29
- #
30
11
  # @param tag [Symbol] <%= one_of(Primer::Truncate::TAG_OPTIONS) %>
31
12
  # @param inline [Boolean] Whether the element is inline (or inline-block).
32
13
  # @param expandable [Boolean] Whether the entire string should be revealed on hover. Can only be used in conjunction with `inline`.
@@ -14,7 +14,7 @@ class SubmitButtonForm < ApplicationForm
14
14
  )
15
15
 
16
16
  my_form.group(layout: :horizontal) do |button_group|
17
- button_group.submit(name: :submit, label: "Submit", scheme: :primary, mb: 3) do |component|
17
+ button_group.submit(name: :submit, label: "Submit", scheme: :primary, mb: 3, disabled: true) do |component|
18
18
  component.with_leading_visual_icon(icon: :"check-circle")
19
19
  end
20
20
 
@@ -39,7 +39,7 @@ module Primer
39
39
 
40
40
  class << self
41
41
  def ignore_preview?(preview_class)
42
- preview_class.name.start_with?("Docs::") || IGNORED_PREVIEWS.include?(preview_class)
42
+ IGNORED_PREVIEWS.include?(preview_class)
43
43
  end
44
44
 
45
45
  def axe_rules_to_skip(component: nil, scenario_name: nil, flatten: false)
@@ -1558,6 +1558,8 @@
1558
1558
  :text_transform:
1559
1559
  :uppercase:
1560
1560
  - text-uppercase
1561
+ :capitalize:
1562
+ - text-capitalize
1561
1563
  :text_align:
1562
1564
  :right:
1563
1565
  - text-right
@@ -20,7 +20,7 @@ deprecations:
20
20
  - component: "Primer::ButtonComponent"
21
21
  autocorrect: false
22
22
  replacement: "Primer::Beta::Button"
23
- guide: "https://primer.style/view-components/guides/primer_button_component"
23
+ guide: "https://primer.style/design/guides/development/rails/migration-guides/primer-button-component"
24
24
 
25
25
  - component: "Primer::IconButton"
26
26
  autocorrect: true
@@ -29,7 +29,7 @@ deprecations:
29
29
  - component: "Primer::LayoutComponent"
30
30
  autocorrect: false
31
31
  replacement: "Primer::Alpha::Layout"
32
- guide: "https://primer.style/view-components/guides/primer_layout_component"
32
+ guide: "https://primer.style/design/guides/development/rails/migration-guides/primer-layout-component"
33
33
 
34
34
  - component: "Primer::Navigation::TabComponent"
35
35
  autocorrect: true
@@ -42,4 +42,4 @@ deprecations:
42
42
  - component: "Primer::Truncate"
43
43
  autocorrect: false
44
44
  replacement: "Primer::Beta::Truncate"
45
- guide: "https://primer.style/view-components/guides/primer_truncate"
45
+ guide: "https://primer.style/design/guides/development/rails/migration-guides/primer-truncate"
@@ -39,11 +39,6 @@ module Primer
39
39
 
40
40
  # rails uses a string for this, but PVC wants a symbol
41
41
  @input.merge_input_arguments!(type: type.to_sym)
42
-
43
- # Never disable buttons. This overrides the global
44
- # ActionView::Base.automatically_disable_submit_tag setting.
45
- # Disabling buttons is not accessible.
46
- @input.remove_input_data(:disable_with)
47
42
  end
48
43
 
49
44
  def input_arguments
@@ -115,6 +115,7 @@ module Primer
115
115
  end
116
116
 
117
117
  add_input_aria(:required, true) if required?
118
+ add_input_aria(:invalid, true) if invalid?
118
119
  add_input_aria(:describedby, ids.values) if ids.any?
119
120
 
120
121
  # avoid browser-native validation, which doesn't match Primer's style
@@ -147,9 +148,11 @@ module Primer
147
148
  input_data[key] = value
148
149
  end
149
150
 
151
+ # :nocov:
150
152
  def remove_input_data(key)
151
153
  input_data.delete(key)
152
154
  end
155
+ # :nocov:
153
156
 
154
157
  def merge_input_arguments!(arguments)
155
158
  arguments.each do |k, v|
@@ -72,6 +72,7 @@ module Primer
72
72
  memo[component] = {
73
73
  "fully_qualified_name" => component.name,
74
74
  "description" => description,
75
+ "accessibility_docs" => docs.tags(:accessibility)&.first&.text,
75
76
  "is_form_component" => docs.manifest_entry.form_component?,
76
77
  "is_published" => docs.manifest_entry.published?,
77
78
  "requires_js" => docs.manifest_entry.requires_js?,
@@ -11,7 +11,7 @@ module ERBLint
11
11
  include Helpers::RuleHelpers
12
12
 
13
13
  MIGRATE_FROM_DETAILS_MENU = "<details-menu> has been deprecated. Please instead use Primer::Alpha::ActionMenu" \
14
- "https://primer.style/design/components/action-menu/rails/alpha"
14
+ " https://primer.style/design/components/action-menu/rails/alpha"
15
15
  DETAILS_MENU_RUBY_PATTERN = /tag:?\s+:"details-menu"/.freeze
16
16
 
17
17
  def run(processed_source)