primer_view_components 0.0.90 → 0.0.91
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/app/assets/styles/primer_view_components.css +0 -0
- data/app/assets/styles/primer_view_components.css.map +1 -0
- data/app/components/primer/alpha/hidden_text_expander.rb +57 -0
- data/app/components/primer/alpha/segmented-control-element.d.ts +8 -0
- data/app/components/primer/alpha/segmented-control-element.js +28 -0
- data/app/components/primer/alpha/tooltip.rb +71 -52
- data/app/components/primer/base_component.rb +1 -1
- data/app/components/primer/beta/blankslate.rb +2 -2
- data/app/components/primer/{details_component.html.erb → beta/details.html.erb} +0 -0
- data/app/components/primer/beta/details.rb +70 -0
- data/app/components/primer/beta/heading.rb +46 -0
- data/app/components/primer/details_component.rb +2 -63
- data/app/components/primer/dropdown.html.erb +1 -1
- data/app/components/primer/dropdown.rb +1 -1
- data/app/components/primer/dropdown_menu_component.rb +1 -1
- data/app/components/primer/heading_component.rb +2 -39
- data/app/components/primer/hidden_text_expander.rb +2 -48
- data/app/components/primer/icon_button.rb +1 -0
- data/app/components/primer/popover_component.rb +2 -2
- data/app/components/primer/primer.d.ts +1 -0
- data/app/components/primer/primer.js +1 -0
- data/app/components/primer/primer.pcss +1 -0
- data/app/lib/primer/view_helper.rb +1 -1
- data/lib/primer/view_components/linters/helpers/deprecated_components_helpers.rb +3 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/cop/primer/component_name_migration.rb +3 -0
- data/lib/tasks/docs.rake +3 -3
- data/static/arguments.yml +43 -43
- data/static/audited_at.json +3 -0
- data/static/constants.json +28 -22
- data/static/statuses.json +6 -3
- metadata +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 968358f568de903663f771e64cd155951a91a1c61d5ddece836599b18dcf7098
|
4
|
+
data.tar.gz: 3d1d9b74914fd53dff67b0d4bb8071321e9d29cc5ddca96e14dce72ebe61a529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6bde4597bc70d55ccbcdb1bd41fc5925c19f6a6edff4c4bae4e93f81b85ddd7ecff84de174f3d1037f5329e6f48a0c332e6c01329b83fdb233e8581a2579575
|
7
|
+
data.tar.gz: 74d4f0db0db3113e04175e650080f70ac9364a51fd0465b3656f0f331943f0420a0b1ea0dd4487d359c47b2ba53524cf3dc4d7edf6a59b8f84fa57627265041a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.0.91
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#1280](https://github.com/primer/view_components/pull/1280) [`1337cd47`](https://github.com/primer/view_components/commit/1337cd471cb26eda8813ec7c508a0f19e7d0309b) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - moving Primer::DetailsComponent to Primer::Beta::Details, and replacing the original with a deprecated component for backward compatibility
|
8
|
+
|
9
|
+
* [#1303](https://github.com/primer/view_components/pull/1303) [`16204453`](https://github.com/primer/view_components/commit/1620445358b7dbc482fa371ac9df8a221f00ca90) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - moving Primer::Alpha::HiddenTextExpander to Primer::Alpha::HiddenTextExpander and replacing the original with a deprecated version
|
10
|
+
|
11
|
+
- [#1314](https://github.com/primer/view_components/pull/1314) [`9aef2dcb`](https://github.com/primer/view_components/commit/9aef2dcb4164e0a92f160c49ab40dd74fb24c8ff) Thanks [@camertron](https://github.com/camertron)! - Instruct terser to not mangle class names so Catalyst works
|
12
|
+
|
13
|
+
* [#1306](https://github.com/primer/view_components/pull/1306) [`5e9003eb`](https://github.com/primer/view_components/commit/5e9003eb32740c7a18864f2e6d7d51642e31d615) Thanks [@khiga8](https://github.com/khiga8)! - Update docs to discourage standalone tooltip use.
|
14
|
+
|
15
|
+
- [#1308](https://github.com/primer/view_components/pull/1308) [`b773b71c`](https://github.com/primer/view_components/commit/b773b71cbcecc20c04a835efc24e0dca0995b118) Thanks [@joelhawksley](https://github.com/joelhawksley)! - Update ViewComponent dependency to fix failing integration tests.
|
16
|
+
|
17
|
+
* [#1297](https://github.com/primer/view_components/pull/1297) [`c684d071`](https://github.com/primer/view_components/commit/c684d0718b571d47cd508f3865237743c48172ee) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - migrating Primer::HeadingComponent to Primer::Beta::Heading, and replacing original with deprecated version
|
18
|
+
|
19
|
+
- [#1316](https://github.com/primer/view_components/pull/1316) [`6241f130`](https://github.com/primer/view_components/commit/6241f1307f4b46cce23981b5a1916c424a700d4c) Thanks [@jonrohan](https://github.com/jonrohan)! - Creating a primer_view_components.css bundle that will ship with the npm package
|
20
|
+
|
3
21
|
## 0.0.90
|
4
22
|
|
5
23
|
### Patch Changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"primer_view_components.css"}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
module Alpha
|
5
|
+
# Use `HiddenTextExpander` to indicate and toggle hidden text.
|
6
|
+
#
|
7
|
+
# @accessibility
|
8
|
+
# `HiddenTextExpander` requires an `aria-label`, which will provide assistive technologies with an accessible label.
|
9
|
+
# The `aria-label` should describe the action to be invoked by the `HiddenTextExpander`. For instance,
|
10
|
+
# if your `HiddenTextExpander` expands a list of 5 comments, the `aria-label` should be
|
11
|
+
# `"Expand 5 more comments"` instead of `"More"`.
|
12
|
+
class HiddenTextExpander < Primer::Component
|
13
|
+
status :alpha
|
14
|
+
|
15
|
+
# @example Default
|
16
|
+
# <%= render(Primer::Alpha::HiddenTextExpander.new("aria-label": "No effect")) %>
|
17
|
+
#
|
18
|
+
# @example Inline
|
19
|
+
# <%= render(Primer::Alpha::HiddenTextExpander.new(inline: true, "aria-label": "No effect")) %>
|
20
|
+
#
|
21
|
+
# @example Styling the button
|
22
|
+
# <%= render(Primer::Alpha::HiddenTextExpander.new("aria-label": "No effect", button_arguments: { p: 1, classes: "custom-class" })) %>
|
23
|
+
#
|
24
|
+
# @param inline [Boolean] Whether or not the expander is inline.
|
25
|
+
# @param button_arguments [Hash] <%= link_to_system_arguments_docs %> for the button element.
|
26
|
+
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
27
|
+
def initialize(inline: false, button_arguments: {}, **system_arguments)
|
28
|
+
@system_arguments = deny_tag_argument(**system_arguments)
|
29
|
+
@button_arguments = button_arguments
|
30
|
+
|
31
|
+
@system_arguments[:tag] = :span
|
32
|
+
@system_arguments[:classes] = class_names(
|
33
|
+
"hidden-text-expander",
|
34
|
+
@system_arguments[:classes],
|
35
|
+
"inline" => inline
|
36
|
+
)
|
37
|
+
|
38
|
+
aria_label = system_arguments[:"aria-label"] || system_arguments.dig(:aria, :label) || @aria_label
|
39
|
+
if aria_label.present?
|
40
|
+
@button_arguments[:"aria-label"] = aria_label
|
41
|
+
@system_arguments[:aria]&.delete(:label)
|
42
|
+
end
|
43
|
+
|
44
|
+
@button_arguments[:classes] = class_names(
|
45
|
+
"ellipsis-expander",
|
46
|
+
button_arguments[:classes]
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
def call
|
51
|
+
render(Primer::BaseComponent.new(**@system_arguments)) do
|
52
|
+
render(Primer::HellipButton.new(**@button_arguments))
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/* eslint-disable custom-elements/no-constructor */
|
2
|
+
export default class SegmentedControlElement extends HTMLElement {
|
3
|
+
constructor() {
|
4
|
+
super();
|
5
|
+
this.addEventListener('click', (event) => {
|
6
|
+
var _a, _b;
|
7
|
+
const controls = Array.from(this.querySelectorAll('ul button')).filter(tab => tab instanceof HTMLElement && tab.closest(this.tagName) === this);
|
8
|
+
if (!(event.target instanceof Element))
|
9
|
+
return;
|
10
|
+
if (event.target.closest(this.tagName) !== this)
|
11
|
+
return;
|
12
|
+
const selectedControl = event.target.closest('button');
|
13
|
+
if (!(selectedControl instanceof HTMLElement) || !selectedControl.closest('ul'))
|
14
|
+
return;
|
15
|
+
for (const control of controls) {
|
16
|
+
(_a = control.closest('li')) === null || _a === void 0 ? void 0 : _a.classList.remove('SegmentedControl-item--selected');
|
17
|
+
control.setAttribute('aria-current', 'false');
|
18
|
+
}
|
19
|
+
(_b = selectedControl.closest('li')) === null || _b === void 0 ? void 0 : _b.classList.add('SegmentedControl-item--selected');
|
20
|
+
selectedControl.setAttribute('aria-current', 'true');
|
21
|
+
selectedControl.focus();
|
22
|
+
});
|
23
|
+
}
|
24
|
+
}
|
25
|
+
if (!window.customElements.get('segmented-control')) {
|
26
|
+
window.SegmentedControlElement = SegmentedControlElement;
|
27
|
+
window.customElements.define('segmented-control', SegmentedControlElement);
|
28
|
+
}
|
@@ -2,82 +2,101 @@
|
|
2
2
|
|
3
3
|
module Primer
|
4
4
|
module Alpha
|
5
|
-
# `Tooltip` only appears on mouse hover or keyboard focus and contain a label or description text.
|
6
|
-
# Use tooltips
|
7
|
-
#
|
8
|
-
# When using a tooltip, follow the provided guidelines to avoid accessibility issues.
|
9
|
-
#
|
10
|
-
# - Tooltip text should be brief and to the point. The tooltip content must be a string.
|
11
|
-
# - Tooltips should contain only **non-essential text**. Tooltips can easily be missed and are not accessible on touch devices so never
|
12
|
-
# use tooltips to convey critical information.
|
5
|
+
# `Tooltip` only appears on mouse hover or keyboard focus and contain a label or description text. Use tooltips sparingly and as a last resort.
|
6
|
+
# Use tooltips as a last resort. Please consider [Tooltips alternatives](https://primer.style/design/accessibility/tooltip-alternatives).
|
13
7
|
#
|
8
|
+
# When using a tooltip, follow the provided guidelines to avoid accessibility issues:
|
9
|
+
# - Tooltips should contain only **non-essential text**. Tooltips can easily be missed and are not accessible on touch devices so never use tooltips to convey critical information.
|
10
|
+
# - `Tooltip` should be rendered through the API of <%= link_to_component(Primer::ButtonComponent)%>, <%= link_to_component(Primer::LinkComponent)%>, or <%= link_to_component(Primer::IconButton)%>. Avoid using `Tooltip` a standalone component unless absolutely necessary (and **only** on interactive elements).
|
14
11
|
# @accessibility
|
15
|
-
# -
|
16
|
-
#
|
17
|
-
# -
|
12
|
+
# - Tooltip text must be brief and concise whether it is a label or a description.
|
13
|
+
# - Tooltip can only hold string content.
|
14
|
+
# - **Never set tooltips on static, non-interactive elements** like `span` or `div`. Tooltips should only be used on interactive elements like buttons or links to avoid excluding keyboard-only users
|
15
|
+
# and screen reader users. Use of tooltip through <%= link_to_component(Primer::ButtonComponent) %>, <%= link_to_component(Primer::LinkComponent) %>, or <%= link_to_component(Primer::IconButton) %> will guarantee this.
|
16
|
+
# - If you must use `Tooltip` as a standalone component, place it adjacent after the trigger element in the DOM. This allows screen reader users to navigate to and copy the tooltip
|
18
17
|
# content.
|
19
|
-
# ### Which
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
# - When there is already a visible label text on the trigger element, the tooltip is likely intended to supplement the existing text, so set `type: :description`.
|
18
|
+
# ### Which type should I set?
|
19
|
+
# Semantically, a tooltip will either act an accessible name or an accessible description for the element that it is associated with resulting in either a
|
20
|
+
# `aria-labelledby` or an `aria-describedby` association. The `type` drastically changes semantics and screen reader behavior so follow these guidelines carefully:
|
21
|
+
# - When there is already a visible label text on the trigger element, the tooltip is likely intended be supplementary, so set `type: :description`.
|
24
22
|
# The majority of tooltips will fall under this category.
|
25
23
|
# - When there is no visible text on the trigger element and the tooltip content is appropriate as a label for the element, set `type: :label`.
|
26
|
-
#
|
24
|
+
# `label` type is usually only appropriate for an icon-only control.
|
27
25
|
class Tooltip < Primer::Component
|
28
26
|
DIRECTION_DEFAULT = :s
|
29
27
|
DIRECTION_OPTIONS = [DIRECTION_DEFAULT, :n, :e, :w, :ne, :nw, :se, :sw].freeze
|
30
28
|
|
31
29
|
TYPE_FALLBACK = :description
|
32
30
|
TYPE_OPTIONS = [:label, :description].freeze
|
33
|
-
# @example As a description for
|
31
|
+
# @example As a supplementary description for a button
|
34
32
|
# @description
|
35
|
-
#
|
36
|
-
#
|
33
|
+
# In this example, the button has a visible label text, "Save". `type: :description` is set because the tooltip content is supplementary.
|
34
|
+
# A screen reader user who encounters this button will hear the accessible name, "Save" followed by the accessible description, "This will immediately impact all organization members".
|
37
35
|
# @code
|
38
|
-
# <%= render(Primer::
|
39
|
-
#
|
40
|
-
#
|
36
|
+
# <%= render(Primer::ButtonComponent.new(id: "save-button")) do |c| %>
|
37
|
+
# <% c.with_tooltip(text: "This will immediately impact all organization members", type: :description, direction: :ne) %>
|
38
|
+
# Save
|
39
|
+
# <% end %>
|
40
|
+
# @example As a label for an `IconButton`
|
41
41
|
# @description
|
42
|
-
#
|
42
|
+
# An `IconButton` of `tag: :button` and `tag: :a` will render a tooltip using the `aria-label` content by default. While tooltips should generally be avoided, a tooltip on an `IconButton`
|
43
|
+
# has usability benefits because it provides a textual label for sighted users.
|
44
|
+
# A screen reader user who encounters the following button will hear the accessible name, "Bold".
|
43
45
|
# @code
|
44
|
-
# <%= render(Primer::
|
45
|
-
#
|
46
|
-
#
|
47
|
-
# @example As a description for a button with visible label
|
46
|
+
# <%= render(Primer::IconButton.new(id: "bold-button-0", icon: :bold, "aria-label": "Bold")) %>
|
47
|
+
# @example As a supplementary description for an `IconButton`
|
48
48
|
# @description
|
49
|
-
# If
|
49
|
+
# If you want to provide a description for the `IconButton`, set both `aria-label` and `aria-description` text. The tooltip will use the `aria-description` text.
|
50
|
+
# A screen reader user who encounters the following button will hear the accessible name "Search", followed by the accessible description "Use keywords like 'repo:' and 'org:' in your query".
|
50
51
|
# @code
|
51
|
-
# <%= render(Primer::
|
52
|
-
#
|
52
|
+
# <%= render(Primer::IconButton.new(id: "search-button", icon: :search, "aria-label": "Search", "aria-description": "Use keywords like 'repo:' and 'org:' in your query")) %>
|
53
|
+
#
|
53
54
|
# @example With direction
|
54
55
|
# @description
|
55
56
|
# Set direction of tooltip with `direction`. The tooltip is responsive and will automatically adjust direction to avoid cutting off.
|
56
57
|
# @code
|
57
|
-
# <%= render(Primer::ButtonComponent.new(id: "North", m: 2))
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
# <%= render(Primer::ButtonComponent.new(id: "
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
# <%= render(Primer::ButtonComponent.new(id: "
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
# <%= render(Primer::ButtonComponent.new(id: "
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
58
|
+
# <%= render(Primer::ButtonComponent.new(id: "North", m: 2)) do |c| %>
|
59
|
+
# <% c.with_tooltip(text: "This is a North-facing tooltip, and is responsive.", type: :description, direction: :n) %>
|
60
|
+
# North
|
61
|
+
# <% end %>
|
62
|
+
# <%= render(Primer::ButtonComponent.new(id: "South", m: 2)) do |c| %>
|
63
|
+
# <% c.with_tooltip(text: "This is a South-facing tooltip, and is responsive.", type: :description, direction: :s) %>
|
64
|
+
# South
|
65
|
+
# <% end %>
|
66
|
+
# <%= render(Primer::ButtonComponent.new(id: "East", m: 2)) do |c| %>
|
67
|
+
# <% c.with_tooltip(text: "This is a East-facing tooltip, and is responsive.", type: :description, direction: :e) %>
|
68
|
+
# East
|
69
|
+
# <% end %>
|
70
|
+
# <%= render(Primer::ButtonComponent.new(id: "West", m: 2)) do |c| %>
|
71
|
+
# <% c.with_tooltip(text: "This is a West-facing tooltip, and is responsive.", type: :description, direction: :w) %>
|
72
|
+
# West
|
73
|
+
# <% end %>
|
74
|
+
# <%= render(Primer::ButtonComponent.new(id: "Northwest", m: 2)) do |c| %>
|
75
|
+
# <% c.with_tooltip(text: "This is a Northwest-facing tooltip, and is responsive.", type: :description, direction: :nw) %>
|
76
|
+
# Northwest
|
77
|
+
# <% end %>
|
78
|
+
# <%= render(Primer::ButtonComponent.new(id: "Southwest", m: 2)) do |c| %>
|
79
|
+
# <% c.with_tooltip(text: "This is a Southwest-facing tooltip, and is responsive.", type: :description, direction: :sw) %>
|
80
|
+
# Southwest
|
81
|
+
# <% end %>
|
82
|
+
# <%= render(Primer::ButtonComponent.new(id: "Northeast", m: 2)) do |c| %>
|
83
|
+
# <% c.with_tooltip(text: "This is a Northeast-facing tooltip, and is responsive.", type: :description, direction: :ne) %>
|
84
|
+
# Northeast
|
85
|
+
# <% end %>
|
86
|
+
# <%= render(Primer::ButtonComponent.new(id: "Southeast", m: 2)) do |c| %>
|
87
|
+
# <% c.with_tooltip(text: "This is a Southeast-facing tooltip, and is responsive.", type: :description, direction: :se) %>
|
88
|
+
# Southeast
|
89
|
+
# <% end %>
|
90
|
+
# @example Directly using `Tooltip`
|
74
91
|
# @description
|
75
|
-
# When
|
92
|
+
# When you have a valid tooltip usecase for an interactive element that is not one of the supported components, you may need to use the `Tooltip` component directly.
|
93
|
+
# The tooltip should be placed directly adjacent after the element you are associating it with.
|
94
|
+
# The tooltip is absolutely positioned so ensure there is a wrapper with `position: relative` to avoid positioning issues.
|
76
95
|
# @code
|
77
|
-
# <
|
78
|
-
#
|
96
|
+
# <div style="position: relative;">
|
97
|
+
# <button type="button" id="test-button">Test</button>
|
79
98
|
# <%= render(Primer::Alpha::Tooltip.new(for_id: "test-button", type: :description, text: "This tooltip should take up the full width", direction: :ne)) %>
|
80
|
-
# </
|
99
|
+
# </div>
|
81
100
|
# @param for_id [String] The ID of the element that the tooltip should be attached to.
|
82
101
|
# @param type [Symbol] <%= one_of(Primer::Alpha::Tooltip::TYPE_OPTIONS) %>
|
83
102
|
# @param direction [Symbol] <%= one_of(Primer::Alpha::Tooltip::DIRECTION_OPTIONS) %>
|
@@ -46,14 +46,14 @@ module Primer
|
|
46
46
|
|
47
47
|
# Required heading.
|
48
48
|
#
|
49
|
-
# @param tag [String] <%= one_of(Primer::
|
49
|
+
# @param tag [String] <%= one_of(Primer::Beta::Heading::TAG_OPTIONS) %>
|
50
50
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
51
51
|
renders_one :heading, lambda { |tag:, **system_arguments|
|
52
52
|
deny_tag_argument(**system_arguments)
|
53
53
|
system_arguments[:tag] = tag
|
54
54
|
system_arguments[:classes] = class_names("blankslate-heading", system_arguments[:classes])
|
55
55
|
|
56
|
-
Primer::
|
56
|
+
Primer::Beta::Heading.new(**system_arguments)
|
57
57
|
}
|
58
58
|
|
59
59
|
# Optional description.
|
File without changes
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
module Beta
|
5
|
+
# Use `DetailsComponent` to reveal content after clicking a button.
|
6
|
+
class Details < Primer::Component
|
7
|
+
status :beta
|
8
|
+
|
9
|
+
BODY_TAG_DEFAULT = :div
|
10
|
+
BODY_TAG_OPTIONS = [:ul, :"details-menu", :"details-dialog", BODY_TAG_DEFAULT].freeze
|
11
|
+
NO_OVERLAY = :none
|
12
|
+
OVERLAY_MAPPINGS = {
|
13
|
+
NO_OVERLAY => "",
|
14
|
+
:default => "details-overlay",
|
15
|
+
:dark => "details-overlay details-overlay-dark"
|
16
|
+
}.freeze
|
17
|
+
|
18
|
+
# Use the Summary slot as a trigger to reveal the content.
|
19
|
+
#
|
20
|
+
# @param button [Boolean] (true) Whether to render the Summary as a button or not.
|
21
|
+
# @param kwargs [Hash] The same arguments as <%= link_to_system_arguments_docs %>.
|
22
|
+
renders_one :summary, lambda { |button: true, **system_arguments|
|
23
|
+
system_arguments[:tag] = :summary
|
24
|
+
system_arguments[:role] = "button"
|
25
|
+
|
26
|
+
return Primer::BaseComponent.new(**system_arguments) unless button
|
27
|
+
|
28
|
+
Primer::ButtonComponent.new(**system_arguments)
|
29
|
+
}
|
30
|
+
|
31
|
+
# Use the Body slot as the main content to be shown when triggered by the Summary.
|
32
|
+
#
|
33
|
+
# @param tag [Symbol] (Primer::Beta::Details::BODY_TAG_DEFAULT) <%= one_of(Primer::Beta::Details::BODY_TAG_OPTIONS) %>
|
34
|
+
# @param kwargs [Hash] The same arguments as <%= link_to_system_arguments_docs %>.
|
35
|
+
renders_one :body, lambda { |tag: BODY_TAG_DEFAULT, **system_arguments|
|
36
|
+
system_arguments[:tag] = fetch_or_fallback(BODY_TAG_OPTIONS, tag, BODY_TAG_DEFAULT)
|
37
|
+
|
38
|
+
Primer::BaseComponent.new(**system_arguments)
|
39
|
+
}
|
40
|
+
|
41
|
+
# @example Default
|
42
|
+
#
|
43
|
+
# <%= render Primer::Beta::Details.new do |c| %>
|
44
|
+
# <% c.with_summary do %>
|
45
|
+
# Summary
|
46
|
+
# <% end %>
|
47
|
+
# <% c.with_body do %>
|
48
|
+
# Body
|
49
|
+
# <% end %>
|
50
|
+
# <% end %>
|
51
|
+
#
|
52
|
+
# @param overlay [Symbol] Dictates the type of overlay to render with. <%= one_of(Primer::Beta::Details::OVERLAY_MAPPINGS.keys) %>
|
53
|
+
# @param reset [Boolean] Defaults to false. If set to true, it will remove the default caret and remove style from the summary element
|
54
|
+
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
55
|
+
def initialize(overlay: NO_OVERLAY, reset: false, **system_arguments)
|
56
|
+
@system_arguments = deny_tag_argument(**system_arguments)
|
57
|
+
@system_arguments[:tag] = :details
|
58
|
+
@system_arguments[:classes] = class_names(
|
59
|
+
system_arguments[:classes],
|
60
|
+
OVERLAY_MAPPINGS[fetch_or_fallback(OVERLAY_MAPPINGS.keys, overlay, NO_OVERLAY)],
|
61
|
+
"details-reset" => reset
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
def render?
|
66
|
+
summary.present? && body.present?
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
module Beta
|
5
|
+
# `Heading` should be used to communicate page organization and hierarchy.
|
6
|
+
#
|
7
|
+
# - Set tag to one of `:h1`, `:h2`, `:h3`, `:h4`, `:h5`, `:h6` based on what is appropriate for the page context.
|
8
|
+
# - Use `Heading` as the title of a section or sub section.
|
9
|
+
# - Do not use `Heading` for styling alone. For simply styling text, consider using <%= link_to_component(Primer::Beta::Text) %> with relevant <%= link_to_typography_docs %>
|
10
|
+
# such as `font_size` and `font_weight`.
|
11
|
+
# - Do not jump heading levels. For instance, do not follow a `<h1>` with an `<h3>`. Heading levels should increase by one in ascending order.
|
12
|
+
#
|
13
|
+
# @accessibility
|
14
|
+
# While sighted users rely on visual cues such as font size changes to determine what the heading is, assistive technology users rely on programatic cues that can be read out.
|
15
|
+
# When text on a page is visually implied to be a heading, ensure that it is coded as a heading. Additionally, visually implied heading level and coded heading level should be
|
16
|
+
# consistent. [See WCAG success criteria: 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html)
|
17
|
+
#
|
18
|
+
# Headings allow assistive technology users to quickly navigate around a page. Navigation to text that is not meant to be a heading can be a confusing experience.
|
19
|
+
# <%= link_to_heading_practices %>
|
20
|
+
class Heading < Primer::Component
|
21
|
+
status :beta
|
22
|
+
|
23
|
+
TAG_FALLBACK = :h2
|
24
|
+
TAG_OPTIONS = [:h1, TAG_FALLBACK, :h3, :h4, :h5, :h6].freeze
|
25
|
+
|
26
|
+
# @example Default
|
27
|
+
# <%= render(Primer::Beta::Heading.new(tag: :h1)) { "H1 Text" } %>
|
28
|
+
# <%= render(Primer::Beta::Heading.new(tag: :h2)) { "H2 Text" } %>
|
29
|
+
# <%= render(Primer::Beta::Heading.new(tag: :h3)) { "H3 Text" } %>
|
30
|
+
# <%= render(Primer::Beta::Heading.new(tag: :h4)) { "H4 Text" } %>
|
31
|
+
# <%= render(Primer::Beta::Heading.new(tag: :h5)) { "H5 Text" } %>
|
32
|
+
# <%= render(Primer::Beta::Heading.new(tag: :h6)) { "H6 Text" } %>
|
33
|
+
#
|
34
|
+
# @param tag [String] <%= one_of(Primer::Beta::Heading::TAG_OPTIONS) %>
|
35
|
+
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
36
|
+
def initialize(tag:, **system_arguments)
|
37
|
+
@system_arguments = system_arguments
|
38
|
+
@system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, TAG_FALLBACK)
|
39
|
+
end
|
40
|
+
|
41
|
+
def call
|
42
|
+
render(Primer::BaseComponent.new(**@system_arguments)) { content }
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -1,68 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Primer
|
4
|
-
|
5
|
-
|
6
|
-
status :beta
|
7
|
-
|
8
|
-
BODY_TAG_DEFAULT = :div
|
9
|
-
BODY_TAG_OPTIONS = [:ul, :"details-menu", :"details-dialog", BODY_TAG_DEFAULT].freeze
|
10
|
-
NO_OVERLAY = :none
|
11
|
-
OVERLAY_MAPPINGS = {
|
12
|
-
NO_OVERLAY => "",
|
13
|
-
:default => "details-overlay",
|
14
|
-
:dark => "details-overlay details-overlay-dark"
|
15
|
-
}.freeze
|
16
|
-
|
17
|
-
# Use the Summary slot as a trigger to reveal the content.
|
18
|
-
#
|
19
|
-
# @param button [Boolean] (true) Whether to render the Summary as a button or not.
|
20
|
-
# @param kwargs [Hash] The same arguments as <%= link_to_system_arguments_docs %>.
|
21
|
-
renders_one :summary, lambda { |button: true, **system_arguments|
|
22
|
-
system_arguments[:tag] = :summary
|
23
|
-
system_arguments[:role] = "button"
|
24
|
-
|
25
|
-
return Primer::BaseComponent.new(**system_arguments) unless button
|
26
|
-
|
27
|
-
Primer::ButtonComponent.new(**system_arguments)
|
28
|
-
}
|
29
|
-
|
30
|
-
# Use the Body slot as the main content to be shown when triggered by the Summary.
|
31
|
-
#
|
32
|
-
# @param tag [Symbol] (Primer::DetailsComponent::BODY_TAG_DEFAULT) <%= one_of(Primer::DetailsComponent::BODY_TAG_OPTIONS) %>
|
33
|
-
# @param kwargs [Hash] The same arguments as <%= link_to_system_arguments_docs %>.
|
34
|
-
renders_one :body, lambda { |tag: BODY_TAG_DEFAULT, **system_arguments|
|
35
|
-
system_arguments[:tag] = fetch_or_fallback(BODY_TAG_OPTIONS, tag, BODY_TAG_DEFAULT)
|
36
|
-
|
37
|
-
Primer::BaseComponent.new(**system_arguments)
|
38
|
-
}
|
39
|
-
|
40
|
-
# @example Default
|
41
|
-
#
|
42
|
-
# <%= render Primer::DetailsComponent.new do |c| %>
|
43
|
-
# <% c.with_summary do %>
|
44
|
-
# Summary
|
45
|
-
# <% end %>
|
46
|
-
# <% c.with_body do %>
|
47
|
-
# Body
|
48
|
-
# <% end %>
|
49
|
-
# <% end %>
|
50
|
-
#
|
51
|
-
# @param overlay [Symbol] Dictates the type of overlay to render with. <%= one_of(Primer::DetailsComponent::OVERLAY_MAPPINGS.keys) %>
|
52
|
-
# @param reset [Boolean] Defaults to false. If set to true, it will remove the default caret and remove style from the summary element
|
53
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
54
|
-
def initialize(overlay: NO_OVERLAY, reset: false, **system_arguments)
|
55
|
-
@system_arguments = deny_tag_argument(**system_arguments)
|
56
|
-
@system_arguments[:tag] = :details
|
57
|
-
@system_arguments[:classes] = class_names(
|
58
|
-
system_arguments[:classes],
|
59
|
-
OVERLAY_MAPPINGS[fetch_or_fallback(OVERLAY_MAPPINGS.keys, overlay, NO_OVERLAY)],
|
60
|
-
"details-reset" => reset
|
61
|
-
)
|
62
|
-
end
|
63
|
-
|
64
|
-
def render?
|
65
|
-
summary.present? && body.present?
|
66
|
-
end
|
4
|
+
class DetailsComponent < Primer::Beta::Details
|
5
|
+
status :deprecated
|
67
6
|
end
|
68
7
|
end
|
@@ -128,7 +128,7 @@ module Primer
|
|
128
128
|
# end %>
|
129
129
|
# <% end %>
|
130
130
|
#
|
131
|
-
# @param overlay [Symbol] <%= one_of(Primer::
|
131
|
+
# @param overlay [Symbol] <%= one_of(Primer::Beta::Details::OVERLAY_MAPPINGS.keys) %>
|
132
132
|
# @param with_caret [Boolean] Whether or not a caret should be rendered in the button.
|
133
133
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
134
134
|
def initialize(overlay: :default, with_caret: false, **system_arguments)
|
@@ -18,7 +18,7 @@ module Primer
|
|
18
18
|
|
19
19
|
# @example With a header
|
20
20
|
# <div>
|
21
|
-
# <%= render(Primer::
|
21
|
+
# <%= render(Primer::Beta::Details.new(overlay: :default, reset: true, position: :relative)) do |c| %>
|
22
22
|
# <% c.summary do %>
|
23
23
|
# Dropdown
|
24
24
|
# <% end %>
|
@@ -1,44 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Primer
|
4
|
-
|
5
|
-
|
6
|
-
# - Set tag to one of `:h1`, `:h2`, `:h3`, `:h4`, `:h5`, `:h6` based on what is appropriate for the page context.
|
7
|
-
# - Use `Heading` as the title of a section or sub section.
|
8
|
-
# - Do not use `Heading` for styling alone. For simply styling text, consider using <%= link_to_component(Primer::Beta::Text) %> with relevant <%= link_to_typography_docs %>
|
9
|
-
# such as `font_size` and `font_weight`.
|
10
|
-
# - Do not jump heading levels. For instance, do not follow a `<h1>` with an `<h3>`. Heading levels should increase by one in ascending order.
|
11
|
-
#
|
12
|
-
# @accessibility
|
13
|
-
# While sighted users rely on visual cues such as font size changes to determine what the heading is, assistive technology users rely on programatic cues that can be read out.
|
14
|
-
# When text on a page is visually implied to be a heading, ensure that it is coded as a heading. Additionally, visually implied heading level and coded heading level should be
|
15
|
-
# consistent. [See WCAG success criteria: 1.3.1: Info and Relationships](https://www.w3.org/WAI/WCAG21/Understanding/info-and-relationships.html)
|
16
|
-
#
|
17
|
-
# Headings allow assistive technology users to quickly navigate around a page. Navigation to text that is not meant to be a heading can be a confusing experience.
|
18
|
-
# <%= link_to_heading_practices %>
|
19
|
-
class HeadingComponent < Primer::Component
|
20
|
-
status :beta
|
21
|
-
|
22
|
-
TAG_FALLBACK = :h2
|
23
|
-
TAG_OPTIONS = [:h1, TAG_FALLBACK, :h3, :h4, :h5, :h6].freeze
|
24
|
-
|
25
|
-
# @example Default
|
26
|
-
# <%= render(Primer::HeadingComponent.new(tag: :h1)) { "H1 Text" } %>
|
27
|
-
# <%= render(Primer::HeadingComponent.new(tag: :h2)) { "H2 Text" } %>
|
28
|
-
# <%= render(Primer::HeadingComponent.new(tag: :h3)) { "H3 Text" } %>
|
29
|
-
# <%= render(Primer::HeadingComponent.new(tag: :h4)) { "H4 Text" } %>
|
30
|
-
# <%= render(Primer::HeadingComponent.new(tag: :h5)) { "H5 Text" } %>
|
31
|
-
# <%= render(Primer::HeadingComponent.new(tag: :h6)) { "H6 Text" } %>
|
32
|
-
#
|
33
|
-
# @param tag [String] <%= one_of(Primer::HeadingComponent::TAG_OPTIONS) %>
|
34
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
35
|
-
def initialize(tag:, **system_arguments)
|
36
|
-
@system_arguments = system_arguments
|
37
|
-
@system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, TAG_FALLBACK)
|
38
|
-
end
|
39
|
-
|
40
|
-
def call
|
41
|
-
render(Primer::BaseComponent.new(**@system_arguments)) { content }
|
42
|
-
end
|
4
|
+
class HeadingComponent < Primer::Beta::Heading
|
5
|
+
status :deprecated
|
43
6
|
end
|
44
7
|
end
|
@@ -1,53 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Primer
|
4
|
-
|
5
|
-
|
6
|
-
# @accessibility
|
7
|
-
# `HiddenTextExpander` requires an `aria-label`, which will provide assistive technologies with an accessible label.
|
8
|
-
# The `aria-label` should describe the action to be invoked by the `HiddenTextExpander`. For instance,
|
9
|
-
# if your `HiddenTextExpander` expands a list of 5 comments, the `aria-label` should be
|
10
|
-
# `"Expand 5 more comments"` instead of `"More"`.
|
11
|
-
class HiddenTextExpander < Primer::Component
|
12
|
-
# @example Default
|
13
|
-
# <%= render(Primer::HiddenTextExpander.new("aria-label": "No effect")) %>
|
14
|
-
#
|
15
|
-
# @example Inline
|
16
|
-
# <%= render(Primer::HiddenTextExpander.new(inline: true, "aria-label": "No effect")) %>
|
17
|
-
#
|
18
|
-
# @example Styling the button
|
19
|
-
# <%= render(Primer::HiddenTextExpander.new("aria-label": "No effect", button_arguments: { p: 1, classes: "custom-class" })) %>
|
20
|
-
#
|
21
|
-
# @param inline [Boolean] Whether or not the expander is inline.
|
22
|
-
# @param button_arguments [Hash] <%= link_to_system_arguments_docs %> for the button element.
|
23
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
24
|
-
def initialize(inline: false, button_arguments: {}, **system_arguments)
|
25
|
-
@system_arguments = deny_tag_argument(**system_arguments)
|
26
|
-
@button_arguments = button_arguments
|
27
|
-
|
28
|
-
@system_arguments[:tag] = :span
|
29
|
-
@system_arguments[:classes] = class_names(
|
30
|
-
"hidden-text-expander",
|
31
|
-
@system_arguments[:classes],
|
32
|
-
"inline" => inline
|
33
|
-
)
|
34
|
-
|
35
|
-
aria_label = system_arguments[:"aria-label"] || system_arguments.dig(:aria, :label) || @aria_label
|
36
|
-
if aria_label.present?
|
37
|
-
@button_arguments[:"aria-label"] = aria_label
|
38
|
-
@system_arguments[:aria]&.delete(:label)
|
39
|
-
end
|
40
|
-
|
41
|
-
@button_arguments[:classes] = class_names(
|
42
|
-
"ellipsis-expander",
|
43
|
-
button_arguments[:classes]
|
44
|
-
)
|
45
|
-
end
|
46
|
-
|
47
|
-
def call
|
48
|
-
render(Primer::BaseComponent.new(**@system_arguments)) do
|
49
|
-
render(Primer::HellipButton.new(**@button_arguments))
|
50
|
-
end
|
51
|
-
end
|
4
|
+
class HiddenTextExpander < Primer::Alpha::HiddenTextExpander
|
5
|
+
status :deprecated
|
52
6
|
end
|
53
7
|
end
|
@@ -3,6 +3,7 @@
|
|
3
3
|
module Primer
|
4
4
|
# Use `IconButton` to render Icon-only buttons without the default button styles.
|
5
5
|
#
|
6
|
+
# `IconButton` will always render with a tooltip unless the tag is `:summary`.
|
6
7
|
# @accessibility
|
7
8
|
# `IconButton` requires an `aria-label`, which will provide assistive technologies with an accessible label.
|
8
9
|
# The `aria-label` should describe the action to be invoked rather than the icon itself. For instance,
|
@@ -27,13 +27,13 @@ module Primer
|
|
27
27
|
|
28
28
|
# The heading
|
29
29
|
#
|
30
|
-
# @param tag [Symbol] (Primer::PopoverComponent::DEFAULT_HEADING_TAG) <%= one_of(Primer::
|
30
|
+
# @param tag [Symbol] (Primer::PopoverComponent::DEFAULT_HEADING_TAG) <%= one_of(Primer::Beta::Heading::TAG_OPTIONS) %>
|
31
31
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
32
32
|
renders_one :heading, lambda { |tag: DEFAULT_HEADING_TAG, **system_arguments|
|
33
33
|
system_arguments[:tag] = tag
|
34
34
|
system_arguments[:mb] ||= 2
|
35
35
|
|
36
|
-
Primer::
|
36
|
+
Primer::Beta::Heading.new(**system_arguments)
|
37
37
|
}
|
38
38
|
|
39
39
|
# The body
|
@@ -0,0 +1 @@
|
|
1
|
+
/* CSS component styles here */
|
@@ -7,9 +7,12 @@ module ERBLint
|
|
7
7
|
module DeprecatedComponentsHelpers
|
8
8
|
# If there is no alternative to suggest, set the value to nil
|
9
9
|
COMPONENT_TO_USE_INSTEAD = {
|
10
|
+
"Primer::HiddenTextExpander" => "Primer::Alpha::HiddenTextExpander",
|
11
|
+
"Primer::HeadingComponent" => "Primer::Beta::Heading",
|
10
12
|
"Primer::ButtonGroup" => "Primer::Beta::ButtonGroup",
|
11
13
|
"Primer::CloseButton" => "Primer::Beta::CloseButton",
|
12
14
|
"Primer::CounterComponent" => "Primer::Beta::Counter",
|
15
|
+
"Primer::DetailsComponent" => "Primer::Beta::Details",
|
13
16
|
"Primer::Alpha::AutoComplete::Item" => "Primer::Beta::AutoComplete::Item",
|
14
17
|
"Primer::Alpha::AutoComplete" => "Primer::Beta::AutoComplete",
|
15
18
|
"Primer::BlankslateComponent" => "Primer::Beta::Blankslate",
|
@@ -15,6 +15,9 @@ module RuboCop
|
|
15
15
|
# Primer::Beta::ComponentName.new()
|
16
16
|
class ComponentNameMigration < BaseCop
|
17
17
|
DEPRECATIONS = {
|
18
|
+
"Primer::HiddenTextExpander" => "Primer::Alpha::HiddenTextExpander",
|
19
|
+
"Primer::DetailsComponent" => "Primer::Beta::Details",
|
20
|
+
"Primer::HeadingComponent" => "Primer::Beta::Heading",
|
18
21
|
"Primer::BoxComponent" => "Primer::Box",
|
19
22
|
"Primer::ButtonGroup" => "Primer::Beta::ButtonGroup",
|
20
23
|
"Primer::CloseButton" => "Primer::Beta::CloseButton",
|
data/lib/tasks/docs.rake
CHANGED
@@ -52,14 +52,14 @@ namespace :docs do
|
|
52
52
|
Primer::ClipboardCopy,
|
53
53
|
Primer::Beta::CloseButton,
|
54
54
|
Primer::Beta::Counter,
|
55
|
-
Primer::
|
55
|
+
Primer::Beta::Details,
|
56
56
|
Primer::Dropdown,
|
57
57
|
Primer::DropdownMenuComponent,
|
58
58
|
Primer::Beta::Flash,
|
59
59
|
Primer::FlexComponent,
|
60
60
|
Primer::FlexItemComponent,
|
61
|
-
Primer::
|
62
|
-
Primer::HiddenTextExpander,
|
61
|
+
Primer::Beta::Heading,
|
62
|
+
Primer::Alpha::HiddenTextExpander,
|
63
63
|
Primer::LabelComponent,
|
64
64
|
Primer::LayoutComponent,
|
65
65
|
Primer::LinkComponent,
|
data/static/arguments.yml
CHANGED
@@ -22,6 +22,21 @@
|
|
22
22
|
type: Hash
|
23
23
|
default: N/A
|
24
24
|
description: "[System arguments](/system-arguments)"
|
25
|
+
- component: HiddenTextExpander
|
26
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/hidden_text_expander.rb
|
27
|
+
parameters:
|
28
|
+
- name: inline
|
29
|
+
type: Boolean
|
30
|
+
default: "`false`"
|
31
|
+
description: Whether or not the expander is inline.
|
32
|
+
- name: button_arguments
|
33
|
+
type: Hash
|
34
|
+
default: "`{}`"
|
35
|
+
description: "[System arguments](/system-arguments) for the button element."
|
36
|
+
- name: system_arguments
|
37
|
+
type: Hash
|
38
|
+
default: N/A
|
39
|
+
description: "[System arguments](/system-arguments)"
|
25
40
|
- component: Layout
|
26
41
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/layout.rb
|
27
42
|
parameters:
|
@@ -521,6 +536,23 @@
|
|
521
536
|
type: Hash
|
522
537
|
default: N/A
|
523
538
|
description: "[System arguments](/system-arguments)"
|
539
|
+
- component: Details
|
540
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/details.rb
|
541
|
+
parameters:
|
542
|
+
- name: overlay
|
543
|
+
type: Symbol
|
544
|
+
default: "`:none`"
|
545
|
+
description: Dictates the type of overlay to render with. One of `:dark`, `:default`,
|
546
|
+
or `:none`.
|
547
|
+
- name: reset
|
548
|
+
type: Boolean
|
549
|
+
default: "`false`"
|
550
|
+
description: Defaults to false. If set to true, it will remove the default caret
|
551
|
+
and remove style from the summary element
|
552
|
+
- name: system_arguments
|
553
|
+
type: Hash
|
554
|
+
default: N/A
|
555
|
+
description: "[System arguments](/system-arguments)"
|
524
556
|
- component: Flash
|
525
557
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/flash.rb
|
526
558
|
parameters:
|
@@ -548,6 +580,17 @@
|
|
548
580
|
type: Hash
|
549
581
|
default: N/A
|
550
582
|
description: "[System arguments](/system-arguments)"
|
583
|
+
- component: Heading
|
584
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/heading.rb
|
585
|
+
parameters:
|
586
|
+
- name: tag
|
587
|
+
type: String
|
588
|
+
default: N/A
|
589
|
+
description: One of `:h1`, `:h2`, `:h3`, `:h4`, `:h5`, or `:h6`.
|
590
|
+
- name: system_arguments
|
591
|
+
type: Hash
|
592
|
+
default: N/A
|
593
|
+
description: "[System arguments](/system-arguments)"
|
551
594
|
- component: Text
|
552
595
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/text.rb
|
553
596
|
parameters:
|
@@ -632,23 +675,6 @@
|
|
632
675
|
type: Hash
|
633
676
|
default: N/A
|
634
677
|
description: "[System arguments](/system-arguments)"
|
635
|
-
- component: Details
|
636
|
-
source: https://github.com/primer/view_components/tree/main/app/components/primer/details_component.rb
|
637
|
-
parameters:
|
638
|
-
- name: overlay
|
639
|
-
type: Symbol
|
640
|
-
default: "`:none`"
|
641
|
-
description: Dictates the type of overlay to render with. One of `:dark`, `:default`,
|
642
|
-
or `:none`.
|
643
|
-
- name: reset
|
644
|
-
type: Boolean
|
645
|
-
default: "`false`"
|
646
|
-
description: Defaults to false. If set to true, it will remove the default caret
|
647
|
-
and remove style from the summary element
|
648
|
-
- name: system_arguments
|
649
|
-
type: Hash
|
650
|
-
default: N/A
|
651
|
-
description: "[System arguments](/system-arguments)"
|
652
678
|
- component: Dropdown
|
653
679
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/dropdown.rb
|
654
680
|
parameters:
|
@@ -727,17 +753,6 @@
|
|
727
753
|
type: Hash
|
728
754
|
default: N/A
|
729
755
|
description: "[System arguments](/system-arguments)"
|
730
|
-
- component: Heading
|
731
|
-
source: https://github.com/primer/view_components/tree/main/app/components/primer/heading_component.rb
|
732
|
-
parameters:
|
733
|
-
- name: tag
|
734
|
-
type: String
|
735
|
-
default: N/A
|
736
|
-
description: One of `:h1`, `:h2`, `:h3`, `:h4`, `:h5`, or `:h6`.
|
737
|
-
- name: system_arguments
|
738
|
-
type: Hash
|
739
|
-
default: N/A
|
740
|
-
description: "[System arguments](/system-arguments)"
|
741
756
|
- component: HellipButton
|
742
757
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/hellip_button.rb
|
743
758
|
parameters:
|
@@ -749,21 +764,6 @@
|
|
749
764
|
type: Hash
|
750
765
|
default: N/A
|
751
766
|
description: "[System arguments](/system-arguments)"
|
752
|
-
- component: HiddenTextExpander
|
753
|
-
source: https://github.com/primer/view_components/tree/main/app/components/primer/hidden_text_expander.rb
|
754
|
-
parameters:
|
755
|
-
- name: inline
|
756
|
-
type: Boolean
|
757
|
-
default: "`false`"
|
758
|
-
description: Whether or not the expander is inline.
|
759
|
-
- name: button_arguments
|
760
|
-
type: Hash
|
761
|
-
default: "`{}`"
|
762
|
-
description: "[System arguments](/system-arguments) for the button element."
|
763
|
-
- name: system_arguments
|
764
|
-
type: Hash
|
765
|
-
default: N/A
|
766
|
-
description: "[System arguments](/system-arguments)"
|
767
767
|
- component: IconButton
|
768
768
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/icon_button.rb
|
769
769
|
parameters:
|
data/static/audited_at.json
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
"Primer::Alpha::AutoComplete": "",
|
3
3
|
"Primer::Alpha::AutoComplete::Item": "",
|
4
4
|
"Primer::Alpha::ButtonMarketing": "",
|
5
|
+
"Primer::Alpha::HiddenTextExpander": "",
|
5
6
|
"Primer::Alpha::Layout": "",
|
6
7
|
"Primer::Alpha::Layout::Main": "",
|
7
8
|
"Primer::Alpha::Layout::Sidebar": "",
|
@@ -25,7 +26,9 @@
|
|
25
26
|
"Primer::Beta::ButtonGroup": "",
|
26
27
|
"Primer::Beta::CloseButton": "",
|
27
28
|
"Primer::Beta::Counter": "",
|
29
|
+
"Primer::Beta::Details": "",
|
28
30
|
"Primer::Beta::Flash": "",
|
31
|
+
"Primer::Beta::Heading": "",
|
29
32
|
"Primer::Beta::Text": "",
|
30
33
|
"Primer::Beta::Truncate": "",
|
31
34
|
"Primer::Beta::Truncate::TruncateText": "",
|
data/static/constants.json
CHANGED
@@ -38,6 +38,8 @@
|
|
38
38
|
"large"
|
39
39
|
]
|
40
40
|
},
|
41
|
+
"Primer::Alpha::HiddenTextExpander": {
|
42
|
+
},
|
41
43
|
"Primer::Alpha::Layout": {
|
42
44
|
"FIRST_IN_SOURCE_DEFAULT": "sidebar",
|
43
45
|
"FIRST_IN_SOURCE_OPTIONS": [
|
@@ -326,6 +328,21 @@
|
|
326
328
|
"secondary"
|
327
329
|
]
|
328
330
|
},
|
331
|
+
"Primer::Beta::Details": {
|
332
|
+
"BODY_TAG_DEFAULT": "div",
|
333
|
+
"BODY_TAG_OPTIONS": [
|
334
|
+
"ul",
|
335
|
+
"details-menu",
|
336
|
+
"details-dialog",
|
337
|
+
"div"
|
338
|
+
],
|
339
|
+
"NO_OVERLAY": "none",
|
340
|
+
"OVERLAY_MAPPINGS": {
|
341
|
+
"none": "",
|
342
|
+
"default": "details-overlay",
|
343
|
+
"dark": "details-overlay details-overlay-dark"
|
344
|
+
}
|
345
|
+
},
|
329
346
|
"Primer::Beta::Flash": {
|
330
347
|
"DEFAULT_SCHEME": "default",
|
331
348
|
"SCHEME_MAPPINGS": {
|
@@ -335,6 +352,17 @@
|
|
335
352
|
"success": "flash-success"
|
336
353
|
}
|
337
354
|
},
|
355
|
+
"Primer::Beta::Heading": {
|
356
|
+
"TAG_FALLBACK": "h2",
|
357
|
+
"TAG_OPTIONS": [
|
358
|
+
"h1",
|
359
|
+
"h2",
|
360
|
+
"h3",
|
361
|
+
"h4",
|
362
|
+
"h5",
|
363
|
+
"h6"
|
364
|
+
]
|
365
|
+
},
|
338
366
|
"Primer::Beta::Text": {
|
339
367
|
"DEFAULT_TAG": "span"
|
340
368
|
},
|
@@ -393,19 +421,6 @@
|
|
393
421
|
"Primer::CounterComponent": {
|
394
422
|
},
|
395
423
|
"Primer::DetailsComponent": {
|
396
|
-
"BODY_TAG_DEFAULT": "div",
|
397
|
-
"BODY_TAG_OPTIONS": [
|
398
|
-
"ul",
|
399
|
-
"details-menu",
|
400
|
-
"details-dialog",
|
401
|
-
"div"
|
402
|
-
],
|
403
|
-
"NO_OVERLAY": "none",
|
404
|
-
"OVERLAY_MAPPINGS": {
|
405
|
-
"none": "",
|
406
|
-
"default": "details-overlay",
|
407
|
-
"dark": "details-overlay details-overlay-dark"
|
408
|
-
}
|
409
424
|
},
|
410
425
|
"Primer::Dropdown": {
|
411
426
|
"Menu": "Primer::Dropdown::Menu"
|
@@ -521,15 +536,6 @@
|
|
521
536
|
"FLEX_AUTO_DEFAULT": false
|
522
537
|
},
|
523
538
|
"Primer::HeadingComponent": {
|
524
|
-
"TAG_FALLBACK": "h2",
|
525
|
-
"TAG_OPTIONS": [
|
526
|
-
"h1",
|
527
|
-
"h2",
|
528
|
-
"h3",
|
529
|
-
"h4",
|
530
|
-
"h5",
|
531
|
-
"h6"
|
532
|
-
]
|
533
539
|
},
|
534
540
|
"Primer::HellipButton": {
|
535
541
|
},
|
data/static/statuses.json
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
"Primer::Alpha::AutoComplete": "deprecated",
|
3
3
|
"Primer::Alpha::AutoComplete::Item": "deprecated",
|
4
4
|
"Primer::Alpha::ButtonMarketing": "alpha",
|
5
|
+
"Primer::Alpha::HiddenTextExpander": "alpha",
|
5
6
|
"Primer::Alpha::Layout": "alpha",
|
6
7
|
"Primer::Alpha::Layout::Main": "alpha",
|
7
8
|
"Primer::Alpha::Layout::Sidebar": "alpha",
|
@@ -25,7 +26,9 @@
|
|
25
26
|
"Primer::Beta::ButtonGroup": "beta",
|
26
27
|
"Primer::Beta::CloseButton": "beta",
|
27
28
|
"Primer::Beta::Counter": "beta",
|
29
|
+
"Primer::Beta::Details": "beta",
|
28
30
|
"Primer::Beta::Flash": "beta",
|
31
|
+
"Primer::Beta::Heading": "beta",
|
29
32
|
"Primer::Beta::Text": "beta",
|
30
33
|
"Primer::Beta::Truncate": "beta",
|
31
34
|
"Primer::Beta::Truncate::TruncateText": "alpha",
|
@@ -40,16 +43,16 @@
|
|
40
43
|
"Primer::ConditionalWrapper": "alpha",
|
41
44
|
"Primer::Content": "stable",
|
42
45
|
"Primer::CounterComponent": "deprecated",
|
43
|
-
"Primer::DetailsComponent": "
|
46
|
+
"Primer::DetailsComponent": "deprecated",
|
44
47
|
"Primer::Dropdown": "alpha",
|
45
48
|
"Primer::Dropdown::Menu": "alpha",
|
46
49
|
"Primer::Dropdown::Menu::Item": "alpha",
|
47
50
|
"Primer::DropdownMenuComponent": "deprecated",
|
48
51
|
"Primer::FlexComponent": "deprecated",
|
49
52
|
"Primer::FlexItemComponent": "deprecated",
|
50
|
-
"Primer::HeadingComponent": "
|
53
|
+
"Primer::HeadingComponent": "deprecated",
|
51
54
|
"Primer::HellipButton": "alpha",
|
52
|
-
"Primer::HiddenTextExpander": "
|
55
|
+
"Primer::HiddenTextExpander": "deprecated",
|
53
56
|
"Primer::IconButton": "beta",
|
54
57
|
"Primer::Image": "alpha",
|
55
58
|
"Primer::ImageCrop": "alpha",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: primer_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.91
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -406,12 +406,17 @@ files:
|
|
406
406
|
- README.md
|
407
407
|
- app/assets/javascripts/primer_view_components.js
|
408
408
|
- app/assets/javascripts/primer_view_components.js.map
|
409
|
+
- app/assets/styles/primer_view_components.css
|
410
|
+
- app/assets/styles/primer_view_components.css.map
|
409
411
|
- app/components/primer/alpha/auto_complete.rb
|
410
412
|
- app/components/primer/alpha/auto_complete/auto_complete.html.erb
|
411
413
|
- app/components/primer/alpha/auto_complete/item.rb
|
412
414
|
- app/components/primer/alpha/button_marketing.rb
|
415
|
+
- app/components/primer/alpha/hidden_text_expander.rb
|
413
416
|
- app/components/primer/alpha/layout.html.erb
|
414
417
|
- app/components/primer/alpha/layout.rb
|
418
|
+
- app/components/primer/alpha/segmented-control-element.d.ts
|
419
|
+
- app/components/primer/alpha/segmented-control-element.js
|
415
420
|
- app/components/primer/alpha/tab_nav.html.erb
|
416
421
|
- app/components/primer/alpha/tab_nav.rb
|
417
422
|
- app/components/primer/alpha/tab_panels.html.erb
|
@@ -449,8 +454,11 @@ files:
|
|
449
454
|
- app/components/primer/beta/button_group.rb
|
450
455
|
- app/components/primer/beta/close_button.rb
|
451
456
|
- app/components/primer/beta/counter.rb
|
457
|
+
- app/components/primer/beta/details.html.erb
|
458
|
+
- app/components/primer/beta/details.rb
|
452
459
|
- app/components/primer/beta/flash.html.erb
|
453
460
|
- app/components/primer/beta/flash.rb
|
461
|
+
- app/components/primer/beta/heading.rb
|
454
462
|
- app/components/primer/beta/text.rb
|
455
463
|
- app/components/primer/beta/truncate.html.erb
|
456
464
|
- app/components/primer/beta/truncate.rb
|
@@ -472,7 +480,6 @@ files:
|
|
472
480
|
- app/components/primer/conditional_wrapper.rb
|
473
481
|
- app/components/primer/content.rb
|
474
482
|
- app/components/primer/counter_component.rb
|
475
|
-
- app/components/primer/details_component.html.erb
|
476
483
|
- app/components/primer/details_component.rb
|
477
484
|
- app/components/primer/dropdown.d.ts
|
478
485
|
- app/components/primer/dropdown.html.erb
|
@@ -520,6 +527,7 @@ files:
|
|
520
527
|
- app/components/primer/popover_component.rb
|
521
528
|
- app/components/primer/primer.d.ts
|
522
529
|
- app/components/primer/primer.js
|
530
|
+
- app/components/primer/primer.pcss
|
523
531
|
- app/components/primer/primer.ts
|
524
532
|
- app/components/primer/progress_bar_component.html.erb
|
525
533
|
- app/components/primer/progress_bar_component.rb
|