primer_view_components 0.0.32 → 0.0.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +82 -0
- data/README.md +1 -1
- data/app/components/primer/{auto_complete_component.rb → auto_complete.rb} +13 -11
- data/app/components/primer/{auto_complete_component.d.ts → auto_complete/auto_complete.d.ts} +0 -0
- data/app/components/primer/{auto_complete_component.html.erb → auto_complete/auto_complete.html.erb} +0 -0
- data/app/components/primer/{auto_complete_component.js → auto_complete/auto_complete.js} +0 -0
- data/app/components/primer/{auto_complete_component.ts → auto_complete/auto_complete.ts} +0 -0
- data/app/components/primer/auto_complete/auto_component.d.ts +1 -0
- data/app/components/primer/auto_complete/auto_component.js +1 -0
- data/app/components/primer/auto_complete/item.rb +42 -0
- data/app/components/primer/avatar_stack_component.rb +2 -0
- data/app/components/primer/base_component.rb +115 -85
- data/app/components/primer/button_component.rb +37 -16
- data/app/components/primer/button_group_component.rb +3 -3
- data/app/components/primer/button_marketing_component.rb +12 -12
- data/app/components/primer/close_button.rb +30 -0
- data/app/components/primer/component.rb +1 -0
- data/app/components/primer/dropdown_component.rb +1 -1
- data/app/components/primer/dropdown_menu_component.rb +1 -1
- data/app/components/primer/flash_component.rb +10 -10
- data/app/components/primer/foo_bar.d.ts +1 -0
- data/app/components/primer/foo_bar.js +1 -0
- data/app/components/primer/hidden_text_expander.rb +43 -0
- data/app/components/primer/link_component.rb +9 -9
- data/app/components/primer/navigation/tab_component.html.erb +9 -7
- data/app/components/primer/navigation/tab_component.rb +27 -3
- data/app/components/primer/octicon_component.rb +0 -4
- data/app/components/primer/primer.d.ts +1 -1
- data/app/components/primer/primer.js +1 -1
- data/app/components/primer/primer.ts +1 -1
- data/app/components/primer/state_component.rb +13 -13
- data/app/components/primer/subhead_component.rb +1 -1
- data/app/components/primer/tab_nav_component.html.erb +2 -2
- data/app/components/primer/tab_nav_component.rb +22 -8
- data/app/components/primer/{truncate_component.rb → truncate.rb} +8 -6
- data/app/components/primer/underline_nav_component.rb +46 -14
- data/app/lib/primer/classify.rb +3 -12
- data/app/lib/primer/classify/cache.rb +14 -4
- data/app/lib/primer/classify/spacing.rb +63 -0
- data/app/lib/primer/tabbed_component_helper.rb +4 -2
- data/lib/primer/view_components/version.rb +1 -1
- data/static/statuses.json +1 -1
- metadata +107 -30
- data/app/assets/javascripts/primer_view_components.js.map.orig +0 -5
- data/app/assets/javascripts/primer_view_components.js.orig +0 -6
- data/app/components/primer/auto_complete_item_component.rb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99ba38719e7e512bdae00f2cacc9ccfcadfd9e6e1aa3be9cf35609a726f35683
|
4
|
+
data.tar.gz: 7b070fe5c45b26c99028e66c3eefc42e40bdd7ce1384ecfa37190ebc6e31d976
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48d665ac5c95897a59d7ba73ccc669ea202d20067e8e4a2389262556129f55354bb14d1e131ae987dfe16b2757e62a2dfb7916da8b84bccea039a84a5cde6ee7
|
7
|
+
data.tar.gz: cad49d95fb02936ebd247c808c44498708aaf1febefff38155845f244a94bbd6fbd4bc55ef3924d164b8df6dc739de95ee914312598082a966bff57789fb28c3
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,88 @@
|
|
2
2
|
|
3
3
|
## main
|
4
4
|
|
5
|
+
## 0.0.37
|
6
|
+
|
7
|
+
* Update NPM package to include subdirectory JS files.
|
8
|
+
|
9
|
+
*Manuel Puyol*
|
10
|
+
|
11
|
+
## 0.0.36
|
12
|
+
|
13
|
+
* Add `block` flag to `ButtonComponent`.
|
14
|
+
|
15
|
+
*Manuel Puyol*
|
16
|
+
|
17
|
+
* Add `link` and `invisible` schemes to `ButtonComponent`.
|
18
|
+
|
19
|
+
*Manuel Puyol*
|
20
|
+
|
21
|
+
* Create `CloseButton` and `HiddenTextExpander` component.
|
22
|
+
|
23
|
+
*Manuel Puyol*
|
24
|
+
|
25
|
+
* **Breaking change**: Rename `AutoCompleteComponent` to `AutoComplete` and `AutoCompleteItemComponent` to `AutoComplete::Item`.
|
26
|
+
|
27
|
+
*Manuel Puyol*
|
28
|
+
|
29
|
+
* **Breaking change**: Rename `TruncateComponent` to `Truncate` and promote it to beta.
|
30
|
+
|
31
|
+
*Manuel Puyol*
|
32
|
+
|
33
|
+
## 0.0.35
|
34
|
+
|
35
|
+
* Promote `AutoCompleteComponent`, `AutoCompleteItemComponent`, `AvatarStackComponent` and `ButtonComponent` to beta.
|
36
|
+
|
37
|
+
*Manuel Puyol*
|
38
|
+
|
39
|
+
* Allow `UnderlineNav` tabs to be rendered as a `<ul><li>` list.
|
40
|
+
|
41
|
+
*Manuel Puyol*
|
42
|
+
|
43
|
+
* _Accessibility:_ Don't add tab roles when `UnderlineNav` or `TabNav` use link redirects.
|
44
|
+
|
45
|
+
*Manuel Puyol*
|
46
|
+
|
47
|
+
* **Breaking change**: Make `label` required for `UnderlineNav` and `TabNav`.
|
48
|
+
|
49
|
+
*Manuel Puyol*
|
50
|
+
|
51
|
+
## 0.0.34
|
52
|
+
|
53
|
+
* Add `p: :responsive` and `m: :auto` system arguments.
|
54
|
+
|
55
|
+
*Manuel Puyol*
|
56
|
+
|
57
|
+
* Remove `my: :auto` and negative `m:` system arguments.
|
58
|
+
|
59
|
+
*Manuel Puyol*
|
60
|
+
|
61
|
+
* **Breaking change**: Rename `FlashComponent` `variant` argument to `scheme`.
|
62
|
+
|
63
|
+
*Manuel Puyol*
|
64
|
+
|
65
|
+
* **Breaking change**: Rename `LinkComponent` `variant` argument to `scheme`.
|
66
|
+
|
67
|
+
*Manuel Puyol*
|
68
|
+
|
69
|
+
* **Breaking change**: Rename `ButtonComponent` `button_type` argument to `scheme`.
|
70
|
+
|
71
|
+
*Manuel Puyol*
|
72
|
+
|
73
|
+
* **Breaking change**: Rename `ButtonMarketingComponent` `button_type` argument to `scheme`.
|
74
|
+
|
75
|
+
*Manuel Puyol*
|
76
|
+
|
77
|
+
* **Breaking change**: Rename `StateComponent` `color` argument to `scheme`.
|
78
|
+
|
79
|
+
*Manuel Puyol*
|
80
|
+
|
81
|
+
## 0.0.33
|
82
|
+
|
83
|
+
* Remove `TabbedComponent` validation requiring a tab to be selected.
|
84
|
+
|
85
|
+
*Manuel Puyol*
|
86
|
+
|
5
87
|
## 0.0.32
|
6
88
|
|
7
89
|
* Allow passing the icon name as a positional argument to `OcticonComponent`.
|
data/README.md
CHANGED
@@ -2,13 +2,15 @@
|
|
2
2
|
|
3
3
|
module Primer
|
4
4
|
# Use AutoComplete to populate input values from server search results.
|
5
|
-
class
|
5
|
+
class AutoComplete < Primer::Component
|
6
|
+
status :beta
|
7
|
+
|
6
8
|
DEFAULT_INPUT_TYPE = :text
|
7
9
|
INPUT_TYPE_OPTIONS = [DEFAULT_INPUT_TYPE, :search].freeze
|
8
10
|
|
9
11
|
# Required input used to search for results
|
10
12
|
#
|
11
|
-
# @param type [Symbol] <%= one_of(Primer::
|
13
|
+
# @param type [Symbol] <%= one_of(Primer::AutoComplete::INPUT_TYPE_OPTIONS) %>
|
12
14
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
13
15
|
renders_one :input, lambda { |type: DEFAULT_INPUT_TYPE, classes: "form-control", **system_arguments|
|
14
16
|
system_arguments[:tag] = :input
|
@@ -35,40 +37,40 @@ module Primer
|
|
35
37
|
}
|
36
38
|
|
37
39
|
# @example Default
|
38
|
-
# <%= render(Primer::
|
40
|
+
# <%= render(Primer::AutoComplete.new(src: "/users/search", id: "user-popup", position: :relative)) do |c| %>
|
39
41
|
# <% c.input(type: :text, name: "input") %>
|
40
42
|
# <% c.results do %>
|
41
|
-
# <%= render(Primer::
|
43
|
+
# <%= render(Primer::AutoComplete::Item.new(selected: true, value: "value")) do |c| %>
|
42
44
|
# Selected
|
43
45
|
# <% end %>
|
44
|
-
# <%= render(Primer::
|
46
|
+
# <%= render(Primer::AutoComplete::Item.new(value: "value")) do |c| %>
|
45
47
|
# Not selected
|
46
48
|
# <% end %>
|
47
49
|
# <% end %>
|
48
50
|
# <% end %>
|
49
51
|
#
|
50
52
|
# @example With custom classes for the results
|
51
|
-
# <%= render(Primer::
|
53
|
+
# <%= render(Primer::AutoComplete.new(src: "/users/search", id: "user-popup", position: :relative)) do |c| %>
|
52
54
|
# <% c.input(type: :text, name: "input") %>
|
53
55
|
# <% c.results(classes: "my-custom-class") do %>
|
54
|
-
# <%= render(Primer::
|
56
|
+
# <%= render(Primer::AutoComplete::Item.new(selected: true, value: "value")) do |c| %>
|
55
57
|
# Selected
|
56
58
|
# <% end %>
|
57
|
-
# <%= render(Primer::
|
59
|
+
# <%= render(Primer::AutoComplete::Item.new(value: "value")) do |c| %>
|
58
60
|
# Not selected
|
59
61
|
# <% end %>
|
60
62
|
# <% end %>
|
61
63
|
# <% end %>
|
62
64
|
#
|
63
65
|
# @example With Icon
|
64
|
-
# <%= render(Primer::
|
66
|
+
# <%= render(Primer::AutoComplete.new(src: "/users/search", id: "user-popup", position: :relative)) do |c| %>
|
65
67
|
# <% c.input(type: :text, name: "input") %>
|
66
68
|
# <% c.icon(icon: :search) %>
|
67
69
|
# <% c.results do %>
|
68
|
-
# <%= render(Primer::
|
70
|
+
# <%= render(Primer::AutoComplete::Item.new(selected: true, value: "value")) do |c| %>
|
69
71
|
# Selected
|
70
72
|
# <% end %>
|
71
|
-
# <%= render(Primer::
|
73
|
+
# <%= render(Primer::AutoComplete::Item.new(value: "value")) do |c| %>
|
72
74
|
# Not selected
|
73
75
|
# <% end %>
|
74
76
|
# <% end %>
|
data/app/components/primer/{auto_complete_component.d.ts → auto_complete/auto_complete.d.ts}
RENAMED
File without changes
|
data/app/components/primer/{auto_complete_component.html.erb → auto_complete/auto_complete.html.erb}
RENAMED
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
import '@github/auto-complete-element';
|
@@ -0,0 +1 @@
|
|
1
|
+
import '@github/auto-complete-element';
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Primer
|
4
|
+
class AutoComplete
|
5
|
+
# Use AutoCompleteItem to list results of an auto-completed search.
|
6
|
+
class Item < Primer::Component
|
7
|
+
status :beta
|
8
|
+
|
9
|
+
# @example Default
|
10
|
+
# <%= render(Primer::AutoComplete::Item.new(selected: true, value: "value")) do |c| %>
|
11
|
+
# Selected
|
12
|
+
# <% end %>
|
13
|
+
# <%= render(Primer::AutoComplete::Item.new(value: "value")) do |c| %>
|
14
|
+
# Not selected
|
15
|
+
# <% end %>
|
16
|
+
#
|
17
|
+
# @param value [String] Value of the item.
|
18
|
+
# @param selected [Boolean] Whether the item is selected.
|
19
|
+
# @param disabled [Boolean] Whether the item is disabled.
|
20
|
+
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
21
|
+
def initialize(value:, selected: false, disabled: false, **system_arguments)
|
22
|
+
@system_arguments = system_arguments
|
23
|
+
@system_arguments[:tag] = :li
|
24
|
+
@system_arguments[:role] = :option
|
25
|
+
@system_arguments[:"data-autocomplete-value"] = value
|
26
|
+
|
27
|
+
@system_arguments[:"aria-selected"] = true if selected
|
28
|
+
@system_arguments[:"aria-disabled"] = true if disabled
|
29
|
+
|
30
|
+
@system_arguments[:classes] = class_names(
|
31
|
+
"autocomplete-item",
|
32
|
+
system_arguments[:classes],
|
33
|
+
"disabled" => disabled
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
def call
|
38
|
+
render(Primer::BaseComponent.new(**@system_arguments)) { content }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -22,94 +22,124 @@ module Primer
|
|
22
22
|
# ```html
|
23
23
|
# <h1 class="mt-0 mt-lg-4 mt-xl-2">Hello world</h1>
|
24
24
|
# ```
|
25
|
-
#
|
26
|
-
# ## HTML attributes
|
27
|
-
#
|
28
|
-
# System arguments include most HTML attributes. For example:
|
29
|
-
#
|
30
|
-
# | Name | Type | Description |
|
31
|
-
# | :- | :- | :- |
|
32
|
-
# | `width` | `Integer` | Width. |
|
33
|
-
# | `height` | `Integer` | Height. |
|
34
|
-
# | `data` | `Hash` | Data attributes: `data: { foo: :bar }` renders `data-foo='bar'`. |
|
35
|
-
# | `aria` | `Hash` | Aria attributes: `aria: { label: "foo" }` renders `aria-label='foo'`. |
|
36
|
-
# | `title` | `String` | The `title` attribute. |
|
37
|
-
# | `style` | `String` | Inline styles. |
|
38
|
-
# | `hidden` | `Boolean` | Whether to assign the `hidden` attribute. |
|
39
25
|
class BaseComponent < Primer::Component
|
40
26
|
status :beta
|
41
27
|
|
42
|
-
|
43
|
-
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
28
|
+
# ## HTML attributes
|
29
|
+
#
|
30
|
+
# System arguments include most HTML attributes. For example:
|
31
|
+
#
|
32
|
+
# | Name | Type | Description |
|
33
|
+
# | :- | :- | :- |
|
34
|
+
# | `aria` | `Hash` | Aria attributes: `aria: { label: "foo" }` renders `aria-label='foo'`. |
|
35
|
+
# | `data` | `Hash` | Data attributes: `data: { foo: :bar }` renders `data-foo='bar'`. |
|
36
|
+
# | `height` | `Integer` | Height. |
|
37
|
+
# | `hidden` | `Boolean` | Whether to assign the `hidden` attribute. |
|
38
|
+
# | `style` | `String` | Inline styles. |
|
39
|
+
# | `title` | `String` | The `title` attribute. |
|
40
|
+
# | `width` | `Integer` | Width. |
|
41
|
+
#
|
42
|
+
# ## Animation
|
43
|
+
#
|
44
|
+
# | Name | Type | Description |
|
45
|
+
# | :- | :- | :- |
|
46
|
+
# | `animation` | Symbol | <%= one_of([:fade_in, :fade_out, :fade_up, :fade_down, :scale_in, :pulse, :grow_x, :grow]) %> |
|
47
|
+
#
|
48
|
+
# ## Border
|
49
|
+
#
|
50
|
+
# | Name | Type | Description |
|
51
|
+
# | :- | :- | :- |
|
52
|
+
# | `border_bottom` | Integer | Set to `0` to remove the bottom border. |
|
53
|
+
# | `border_left` | Integer | Set to `0` to remove the left border. |
|
54
|
+
# | `border_radius` | Integer | <%= one_of([0, 1, 2, 3]) %> |
|
55
|
+
# | `border_right` | Integer | Set to `0` to remove the right border. |
|
56
|
+
# | `border_top` | Integer | Set to `0` to remove the top border. |
|
57
|
+
# | `border` | Symbol | <%= one_of([:left, :top, :bottom, :right, :y, :x, true]) %> |
|
58
|
+
# | `box_shadow` | Boolean, Symbol | Box shadow. <%= one_of([true, :medium, :large, :extra_large, :none]) %> |
|
59
|
+
#
|
60
|
+
# ## Color
|
61
|
+
#
|
62
|
+
# | Name | Type | Description |
|
63
|
+
# | :- | :- | :- |
|
64
|
+
# | `bg` | String, Symbol | Background color. Accepts either a hex value as a String or <%= one_of(Primer::Classify::FunctionalBorderColors::OPTIONS, lower: true) %> |
|
65
|
+
# | `border_color` | Symbol | Border color. <%= one_of(Primer::Classify::FunctionalBorderColors::OPTIONS) %> |
|
66
|
+
# | `color` | Symbol | Text color. <%= one_of(Primer::Classify::FunctionalTextColors::OPTIONS) %> |
|
67
|
+
#
|
68
|
+
# ## Flex
|
69
|
+
#
|
70
|
+
# | Name | Type | Description |
|
71
|
+
# | :- | :- | :- |
|
72
|
+
# | `align_items` | Symbol | <%= one_of([:flex_start, :flex_end, :center, :baseline, :stretch]) %> |
|
73
|
+
# | `align_self` | Symbol | <%= one_of([:auto, :start, :end, :center, :baseline, :stretch]) %> |
|
74
|
+
# | `flex_grow` | Integer | To enable, set to `0`. |
|
75
|
+
# | `flex_shrink` | Integer | To enable, set to `0`. |
|
76
|
+
# | `flex` | Integer, Symbol | <%= one_of([1, :auto]) %> |
|
77
|
+
# | `justify_content` | Symbol | <%= one_of([:flex_start, :flex_end, :center, :space_between, :space_around]) %> |
|
78
|
+
# | `width` | Symbol | <%= one_of([:fit, :fill]) %> |
|
79
|
+
#
|
80
|
+
# ## Grid
|
81
|
+
#
|
82
|
+
# | Name | Type | Description |
|
83
|
+
# | :- | :- | :- |
|
84
|
+
# | `col` | Integer | Number of columns. |
|
85
|
+
#
|
86
|
+
# ## Layout
|
87
|
+
#
|
88
|
+
# | Name | Type | Description |
|
89
|
+
# | :- | :- | :- |
|
90
|
+
# | `display` | Symbol | <%= one_of([:none, :block, :flex, :inline, :inline_block, :table, :table_cell]) %> |
|
91
|
+
# | `height` | Symbol | <%= one_of([:fit, :fill]) %> |
|
92
|
+
# | `hide` | Symbol | Hide the element at a specific breakpoint. <%= one_of([:sm, :md, :lg, :xl]) %> |
|
93
|
+
# | `v` | Symbol | Visibility. <%= one_of([:hidden, :visible]) %> |
|
94
|
+
# | `vertical_align` | Symbol | <%= one_of([:baseline, :top, :middle, :bottom, :text_top, :text_bottom]) %> |
|
95
|
+
#
|
96
|
+
# ## Position
|
97
|
+
#
|
98
|
+
# | Name | Type | Description |
|
99
|
+
# | :- | :- | :- |
|
100
|
+
# | `bottom` | Boolean | If `false`, sets `bottom: 0`. |
|
101
|
+
# | `float` | Symbol | <%= one_of([:left, :right]) %> |
|
102
|
+
# | `left` | Boolean | If `false`, sets `left: 0`. |
|
103
|
+
# | `position` | Symbol | <%= one_of([:relative, :absolute, :fixed]) %> |
|
104
|
+
# | `right` | Boolean | If `false`, sets `right: 0`. |
|
105
|
+
# | `top` | Boolean | If `false`, sets `top: 0`. |
|
106
|
+
#
|
107
|
+
# ## Spacing
|
108
|
+
#
|
109
|
+
# | Name | Type | Description |
|
110
|
+
# | :- | :- | :- |
|
111
|
+
# | `m` | Integer | Margin. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:m]) %> |
|
112
|
+
# | `mb` | Integer | Margin bottom. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:mb]) %> |
|
113
|
+
# | `ml` | Integer | Margin left. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:ml]) %> |
|
114
|
+
# | `mr` | Integer | Margin right. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:mr]) %> |
|
115
|
+
# | `mt` | Integer | Margin top. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:mt]) %> |
|
116
|
+
# | `mx` | Integer | Horizontal margins. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:mx]) %> |
|
117
|
+
# | `my` | Integer | Vertical margins. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:my]) %> |
|
118
|
+
# | `p` | Integer | Padding. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:p]) %> |
|
119
|
+
# | `pb` | Integer | Padding bottom. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:pb]) %> |
|
120
|
+
# | `pl` | Integer | Padding left. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:pl]) %> |
|
121
|
+
# | `pr` | Integer | Padding right. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:pr]) %> |
|
122
|
+
# | `pt` | Integer | Padding left. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:pt]) %> |
|
123
|
+
# | `px` | Integer | Horizontal padding. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:px]) %> |
|
124
|
+
# | `py` | Integer | Vertical padding. <%= one_of(Primer::Classify::Spacing::MAPPINGS[:py]) %> |
|
125
|
+
#
|
126
|
+
# ## Typography
|
127
|
+
#
|
128
|
+
# | Name | Type | Description |
|
129
|
+
# | :- | :- | :- |
|
130
|
+
# | `font_size` | String, Integer | <%= one_of(["00", 0, 1, 2, 3, 4, 5, 6]) %> |
|
131
|
+
# | `font_weight` | Symbol | Font weight. <%= one_of([:light, :normal, :bold]) %> |
|
132
|
+
# | `text_align` | Symbol | Text alignment. <%= one_of([:left, :right, :center]) %> |
|
133
|
+
# | `underline` | Boolean | Whether text should be underlined. |
|
134
|
+
# | `word_break` | Symbol | Whether to break words on line breaks. Can only be `:break_all`. |
|
135
|
+
#
|
136
|
+
# ## Other
|
137
|
+
#
|
138
|
+
# | Name | Type | Description |
|
139
|
+
# | :- | :- | :- |
|
140
|
+
# | classes | String | CSS class name value to be concatenated with generated Primer CSS classes. |
|
141
|
+
# | tag | Symbol | HTML tag name to be passed to `content_tag`. |
|
142
|
+
# | test_selector | String | Adds `data-test-selector='given value'` in non-Production environments for testing purposes. |
|
113
143
|
def initialize(tag:, classes: nil, **system_arguments)
|
114
144
|
@tag = tag
|
115
145
|
@result = Primer::Classify.call(**system_arguments.merge(classes: classes))
|