primer_view_components 0.0.85 → 0.0.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/components/primer/alpha/auto_complete/item.rb +1 -1
- data/app/components/primer/alpha/auto_complete.rb +1 -1
- data/app/components/primer/alpha/button_marketing.rb +1 -1
- data/app/components/primer/alpha/text_field.rb +105 -0
- data/app/components/primer/alpha/tool-tip-element.d.ts +3 -1
- data/app/components/primer/alpha/tool-tip-element.js +20 -13
- data/app/components/primer/alpha/tool-tip-element.ts +23 -14
- data/app/components/primer/alpha/tooltip.rb +1 -1
- data/app/components/primer/beta/base_button.rb +47 -0
- data/app/components/primer/{alpha → beta}/border_box/header.html.erb +0 -0
- data/app/components/primer/{alpha → beta}/border_box/header.rb +6 -6
- data/app/components/primer/{border_box_component.html.erb → beta/border_box.html.erb} +0 -0
- data/app/components/primer/beta/border_box.rb +147 -0
- data/app/components/primer/blankslate_component.rb +2 -150
- data/app/components/primer/border_box_component.rb +2 -140
- data/app/components/primer/button_component.html.erb +12 -4
- data/app/components/primer/button_component.rb +2 -2
- data/app/components/primer/clipboard_copy.rb +6 -2
- data/app/components/primer/close_button.rb +1 -1
- data/app/components/primer/hellip_button.rb +1 -1
- data/app/components/primer/icon_button.html.erb +6 -0
- data/app/components/primer/icon_button.rb +46 -10
- data/app/components/primer/link_component.html.erb +12 -0
- data/app/components/primer/link_component.rb +2 -9
- data/app/lib/primer/join_style_arguments_helper.rb +1 -1
- data/lib/primer/classify/utilities.rb +3 -6
- data/lib/primer/form_components.rb +36 -0
- data/lib/primer/forms/acts_as_component.rb +118 -0
- data/lib/primer/forms/base.html.erb +8 -0
- data/lib/primer/forms/base.rb +137 -0
- data/lib/primer/forms/base_component.rb +58 -0
- data/lib/primer/forms/buffer_rewriter.rb +50 -0
- data/lib/primer/forms/caption.html.erb +10 -0
- data/lib/primer/forms/caption.rb +29 -0
- data/lib/primer/forms/check_box.html.erb +9 -0
- data/lib/primer/forms/check_box.rb +16 -0
- data/lib/primer/forms/check_box_group.html.erb +12 -0
- data/lib/primer/forms/check_box_group.rb +14 -0
- data/lib/primer/forms/dsl/check_box_group_input.rb +41 -0
- data/lib/primer/forms/dsl/check_box_input.rb +27 -0
- data/lib/primer/forms/dsl/form_object.rb +25 -0
- data/lib/primer/forms/dsl/form_reference_input.rb +36 -0
- data/lib/primer/forms/dsl/hidden_input.rb +29 -0
- data/lib/primer/forms/dsl/input.rb +259 -0
- data/lib/primer/forms/dsl/input_group.rb +41 -0
- data/lib/primer/forms/dsl/input_methods.rb +86 -0
- data/lib/primer/forms/dsl/multi_input.rb +58 -0
- data/lib/primer/forms/dsl/radio_button_group_input.rb +38 -0
- data/lib/primer/forms/dsl/radio_button_input.rb +37 -0
- data/lib/primer/forms/dsl/select_list_input.rb +53 -0
- data/lib/primer/forms/dsl/submit_button_input.rb +28 -0
- data/lib/primer/forms/dsl/text_area_input.rb +33 -0
- data/lib/primer/forms/dsl/text_field_input.rb +65 -0
- data/lib/primer/forms/form_control.html.erb +18 -0
- data/lib/primer/forms/form_control.rb +23 -0
- data/lib/primer/forms/form_list.html.erb +5 -0
- data/lib/primer/forms/form_list.rb +21 -0
- data/lib/primer/forms/form_reference.html.erb +3 -0
- data/lib/primer/forms/form_reference.rb +14 -0
- data/lib/primer/forms/group.html.erb +5 -0
- data/lib/primer/forms/group.rb +27 -0
- data/lib/primer/forms/hidden_field.html.erb +1 -0
- data/lib/primer/forms/hidden_field.rb +15 -0
- data/lib/primer/forms/multi.html.erb +3 -0
- data/lib/primer/forms/multi.rb +14 -0
- data/lib/primer/forms/radio_button.html.erb +14 -0
- data/lib/primer/forms/radio_button.rb +29 -0
- data/lib/primer/forms/radio_button_group.html.erb +12 -0
- data/lib/primer/forms/radio_button_group.rb +14 -0
- data/lib/primer/forms/select_list.html.erb +5 -0
- data/lib/primer/forms/select_list.rb +26 -0
- data/lib/primer/forms/separator.html.erb +1 -0
- data/lib/primer/forms/separator.rb +8 -0
- data/lib/primer/forms/spacing_wrapper.html.erb +3 -0
- data/lib/primer/forms/spacing_wrapper.rb +8 -0
- data/lib/primer/forms/submit_button.html.erb +4 -0
- data/lib/primer/forms/submit_button.rb +50 -0
- data/lib/primer/forms/text_area.html.erb +5 -0
- data/lib/primer/forms/text_area.rb +16 -0
- data/lib/primer/forms/text_field.html.erb +19 -0
- data/lib/primer/forms/text_field.rb +14 -0
- data/lib/primer/view_components/engine.rb +23 -0
- data/lib/primer/view_components/linters/argument_mappers/button.rb +2 -2
- data/lib/primer/view_components/linters/button_component_migration_counter.rb +1 -1
- data/lib/primer/view_components/linters/helpers/deprecated_components_helpers.rb +2 -8
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/rubocop/cop/primer/component_name_migration.rb +3 -0
- data/lib/tasks/deprecated.rake +22 -0
- data/lib/tasks/docs.rake +5 -3
- data/static/arguments.yml +148 -39
- data/static/audited_at.json +4 -2
- data/static/classes.yml +2 -1
- data/static/constants.json +44 -39
- data/static/statuses.json +7 -5
- metadata +66 -7
- data/app/components/primer/base_button.rb +0 -43
- data/app/components/primer/blankslate_component.html.erb +0 -30
data/static/arguments.yml
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
- component: BorderBoxHeader
|
|
3
|
-
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/border_box/header.rb
|
|
4
|
-
parameters:
|
|
5
|
-
- name: system_arguments
|
|
6
|
-
type: Hash
|
|
7
|
-
default: N/A
|
|
8
|
-
description: "[System arguments](/system-arguments)"
|
|
9
2
|
- component: ButtonMarketing
|
|
10
3
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/button_marketing.rb
|
|
11
4
|
parameters:
|
|
@@ -95,6 +88,100 @@
|
|
|
95
88
|
type: Hash
|
|
96
89
|
default: N/A
|
|
97
90
|
description: "[System arguments](/system-arguments)"
|
|
91
|
+
- component: TextField
|
|
92
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/text_field.rb
|
|
93
|
+
parameters:
|
|
94
|
+
- name: name
|
|
95
|
+
type: String
|
|
96
|
+
default: N/A
|
|
97
|
+
description: Value for the HTML name attribute.
|
|
98
|
+
- name: id
|
|
99
|
+
type: String
|
|
100
|
+
default: N/A
|
|
101
|
+
description: Value for the HTML id attribute.
|
|
102
|
+
- name: class
|
|
103
|
+
type: String
|
|
104
|
+
default: N/A
|
|
105
|
+
description: A list of CSS classes to add to the input. Exists for compatibility
|
|
106
|
+
with Rails form builders.
|
|
107
|
+
- name: classes
|
|
108
|
+
type: String
|
|
109
|
+
default: N/A
|
|
110
|
+
description: A list of CSS classes to add to the input. Combined with the `:class`
|
|
111
|
+
argument.
|
|
112
|
+
- name: caption
|
|
113
|
+
type: String
|
|
114
|
+
default: N/A
|
|
115
|
+
description: Caption text to render below the input.
|
|
116
|
+
- name: label
|
|
117
|
+
type: String
|
|
118
|
+
default: N/A
|
|
119
|
+
description: Label text displayed above the input.
|
|
120
|
+
- name: visually_hide_label
|
|
121
|
+
type: Boolean
|
|
122
|
+
default: N/A
|
|
123
|
+
description: Whether or not to visually hide the label. If `true` the label will
|
|
124
|
+
be hidden visually but still available to screen readers.
|
|
125
|
+
- name: size
|
|
126
|
+
type: Symbol
|
|
127
|
+
default: N/A
|
|
128
|
+
description: The size of the field. One of `:large`, `:medium`, or `:small`.
|
|
129
|
+
- name: show_clear_button
|
|
130
|
+
type: Boolean
|
|
131
|
+
default: N/A
|
|
132
|
+
description: Whether or not to include a clear button inside the input that clears
|
|
133
|
+
the input's contents when clicked.
|
|
134
|
+
- name: clear_button_id
|
|
135
|
+
type: String
|
|
136
|
+
default: N/A
|
|
137
|
+
description: The HTML id attribute of the clear button.
|
|
138
|
+
- name: full_width
|
|
139
|
+
type: Boolean
|
|
140
|
+
default: N/A
|
|
141
|
+
description: Controls whether or not the input takes the full width of its container.
|
|
142
|
+
- name: disabled
|
|
143
|
+
type: Boolean
|
|
144
|
+
default: N/A
|
|
145
|
+
description: Whether or not the input should accept keyboard and mouse input.
|
|
146
|
+
- name: invalid
|
|
147
|
+
type: Boolean
|
|
148
|
+
default: N/A
|
|
149
|
+
description: If `true`, renders the input in a visually invalid state.
|
|
150
|
+
- name: placeholder
|
|
151
|
+
type: String
|
|
152
|
+
default: N/A
|
|
153
|
+
description: Placeholder text.
|
|
154
|
+
- name: inset
|
|
155
|
+
type: Boolean
|
|
156
|
+
default: N/A
|
|
157
|
+
description: If `true`, renders the input in a visually inset state.
|
|
158
|
+
- name: monospace
|
|
159
|
+
type: Boolean
|
|
160
|
+
default: N/A
|
|
161
|
+
description: If `true`, uses a monospace font for the input field.
|
|
162
|
+
- name: leading_visual
|
|
163
|
+
type: Hash
|
|
164
|
+
default: N/A
|
|
165
|
+
description: Renders a leading visual icon before the text field's cursor. The
|
|
166
|
+
hash will be passed to Primer's [Octicon component](https://primer.style/view-components/components/octicon).
|
|
167
|
+
- name: validation_message
|
|
168
|
+
type: String
|
|
169
|
+
default: N/A
|
|
170
|
+
description: A validation message to display beneath the input. Implicitly sets
|
|
171
|
+
`invalid` to `true`.
|
|
172
|
+
- name: label_arguments
|
|
173
|
+
type: Hash
|
|
174
|
+
default: N/A
|
|
175
|
+
description: System arugments passed to the Rails builder's `#label` method. These
|
|
176
|
+
arguments will appear as HTML attributes on the `<label>` tag.
|
|
177
|
+
- name: system_arguments
|
|
178
|
+
type: Hash
|
|
179
|
+
default: N/A
|
|
180
|
+
description: "[System arguments](/system-arguments)"
|
|
181
|
+
- name: block
|
|
182
|
+
type: Proc
|
|
183
|
+
default: N/A
|
|
184
|
+
description: Unused.
|
|
98
185
|
- component: Tooltip
|
|
99
186
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/alpha/tooltip.rb
|
|
100
187
|
parameters:
|
|
@@ -167,25 +254,6 @@
|
|
|
167
254
|
type: Hash
|
|
168
255
|
default: N/A
|
|
169
256
|
description: "[System arguments](/system-arguments)"
|
|
170
|
-
- component: BaseButton
|
|
171
|
-
source: https://github.com/primer/view_components/tree/main/app/components/primer/base_button.rb
|
|
172
|
-
parameters:
|
|
173
|
-
- name: tag
|
|
174
|
-
type: Symbol
|
|
175
|
-
default: "`:button`"
|
|
176
|
-
description: One of `:a`, `:button`, or `:summary`.
|
|
177
|
-
- name: type
|
|
178
|
-
type: Symbol
|
|
179
|
-
default: "`:button`"
|
|
180
|
-
description: One of `:button`, `:reset`, or `:submit`.
|
|
181
|
-
- name: block
|
|
182
|
-
type: Boolean
|
|
183
|
-
default: "`false`"
|
|
184
|
-
description: 'Whether button is full-width with `display: block`.'
|
|
185
|
-
- name: system_arguments
|
|
186
|
-
type: Hash
|
|
187
|
-
default: N/A
|
|
188
|
-
description: "[System arguments](/system-arguments)"
|
|
189
257
|
- component: AutoComplete
|
|
190
258
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/auto_complete.rb
|
|
191
259
|
parameters:
|
|
@@ -331,6 +399,25 @@
|
|
|
331
399
|
type: Hash
|
|
332
400
|
default: N/A
|
|
333
401
|
description: "[System arguments](/system-arguments)"
|
|
402
|
+
- component: BaseButton
|
|
403
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/base_button.rb
|
|
404
|
+
parameters:
|
|
405
|
+
- name: tag
|
|
406
|
+
type: Symbol
|
|
407
|
+
default: "`:button`"
|
|
408
|
+
description: One of `:a`, `:button`, or `:summary`.
|
|
409
|
+
- name: type
|
|
410
|
+
type: Symbol
|
|
411
|
+
default: "`:button`"
|
|
412
|
+
description: One of `:button`, `:reset`, or `:submit`.
|
|
413
|
+
- name: block
|
|
414
|
+
type: Boolean
|
|
415
|
+
default: "`false`"
|
|
416
|
+
description: 'Whether button is full-width with `display: block`.'
|
|
417
|
+
- name: system_arguments
|
|
418
|
+
type: Hash
|
|
419
|
+
default: N/A
|
|
420
|
+
description: "[System arguments](/system-arguments)"
|
|
334
421
|
- component: Blankslate
|
|
335
422
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/blankslate.rb
|
|
336
423
|
parameters:
|
|
@@ -350,6 +437,24 @@
|
|
|
350
437
|
type: Hash
|
|
351
438
|
default: N/A
|
|
352
439
|
description: "[System arguments](/system-arguments)"
|
|
440
|
+
- component: BorderBox
|
|
441
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/border_box.rb
|
|
442
|
+
parameters:
|
|
443
|
+
- name: padding
|
|
444
|
+
type: Symbol
|
|
445
|
+
default: "`:default`"
|
|
446
|
+
description: One of `:condensed`, `:default`, or `:spacious`.
|
|
447
|
+
- name: system_arguments
|
|
448
|
+
type: Hash
|
|
449
|
+
default: N/A
|
|
450
|
+
description: "[System arguments](/system-arguments)"
|
|
451
|
+
- component: BorderBoxHeader
|
|
452
|
+
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/border_box/header.rb
|
|
453
|
+
parameters:
|
|
454
|
+
- name: system_arguments
|
|
455
|
+
type: Hash
|
|
456
|
+
default: N/A
|
|
457
|
+
description: "[System arguments](/system-arguments)"
|
|
353
458
|
- component: Breadcrumbs
|
|
354
459
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/beta/breadcrumbs.rb
|
|
355
460
|
parameters:
|
|
@@ -402,17 +507,6 @@
|
|
|
402
507
|
type: Hash
|
|
403
508
|
default: N/A
|
|
404
509
|
description: "[System arguments](/system-arguments)"
|
|
405
|
-
- component: BorderBox
|
|
406
|
-
source: https://github.com/primer/view_components/tree/main/app/components/primer/border_box_component.rb
|
|
407
|
-
parameters:
|
|
408
|
-
- name: padding
|
|
409
|
-
type: Symbol
|
|
410
|
-
default: "`:default`"
|
|
411
|
-
description: One of `:condensed`, `:default`, or `:spacious`.
|
|
412
|
-
- name: system_arguments
|
|
413
|
-
type: Hash
|
|
414
|
-
default: N/A
|
|
415
|
-
description: "[System arguments](/system-arguments)"
|
|
416
510
|
- component: Box
|
|
417
511
|
source: https://github.com/primer/view_components/tree/main/app/components/primer/box_component.rb
|
|
418
512
|
parameters:
|
|
@@ -689,11 +783,26 @@
|
|
|
689
783
|
type: Symbol
|
|
690
784
|
default: N/A
|
|
691
785
|
description: One of `:button`, `:reset`, or `:submit`.
|
|
786
|
+
- name: aria-label
|
|
787
|
+
type: String
|
|
788
|
+
default: N/A
|
|
789
|
+
description: String that can be read by assistive technology. A label should be
|
|
790
|
+
short and concise. See the accessibility section for more information.
|
|
791
|
+
- name: aria-description
|
|
792
|
+
type: String
|
|
793
|
+
default: N/A
|
|
794
|
+
description: String that can be read by assistive technology. A description can
|
|
795
|
+
be longer as it is intended to provide more context and information. See the
|
|
796
|
+
accessibility section for more information.
|
|
797
|
+
- name: tooltip_direction
|
|
798
|
+
type: Symbol
|
|
799
|
+
default: "`:s`"
|
|
800
|
+
description: One of `:e`, `:n`, `:ne`, `:nw`, `:s`, `:se`, `:sw`, or `:w`.
|
|
692
801
|
- name: box
|
|
693
802
|
type: Boolean
|
|
694
803
|
default: "`false`"
|
|
695
|
-
description: Whether the button is in a [BorderBox](/components/borderbox).
|
|
696
|
-
`true`, the button will have the `Box-btn-octicon` class.
|
|
804
|
+
description: Whether the button is in a [BorderBox](/components/beta/borderbox).
|
|
805
|
+
If `true`, the button will have the `Box-btn-octicon` class.
|
|
697
806
|
- name: system_arguments
|
|
698
807
|
type: Hash
|
|
699
808
|
default: N/A
|
data/static/audited_at.json
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"Primer::Alpha::AutoComplete": "",
|
|
3
3
|
"Primer::Alpha::AutoComplete::Item": "",
|
|
4
|
-
"Primer::Alpha::BorderBox::Header": "",
|
|
5
4
|
"Primer::Alpha::ButtonMarketing": "",
|
|
6
5
|
"Primer::Alpha::Layout": "",
|
|
7
6
|
"Primer::Alpha::Layout::Main": "",
|
|
8
7
|
"Primer::Alpha::Layout::Sidebar": "",
|
|
9
8
|
"Primer::Alpha::TabNav": "",
|
|
10
9
|
"Primer::Alpha::TabPanels": "",
|
|
10
|
+
"Primer::Alpha::TextField": "",
|
|
11
11
|
"Primer::Alpha::Tooltip": "",
|
|
12
12
|
"Primer::Alpha::UnderlineNav": "",
|
|
13
13
|
"Primer::Alpha::UnderlinePanels": "",
|
|
14
|
-
"Primer::BaseButton": "",
|
|
15
14
|
"Primer::BaseComponent": "",
|
|
16
15
|
"Primer::Beta::AutoComplete": "",
|
|
17
16
|
"Primer::Beta::AutoComplete::Item": "",
|
|
18
17
|
"Primer::Beta::Avatar": "",
|
|
19
18
|
"Primer::Beta::AvatarStack": "",
|
|
19
|
+
"Primer::Beta::BaseButton": "",
|
|
20
20
|
"Primer::Beta::Blankslate": "",
|
|
21
|
+
"Primer::Beta::BorderBox": "",
|
|
22
|
+
"Primer::Beta::BorderBox::Header": "",
|
|
21
23
|
"Primer::Beta::Breadcrumbs": "",
|
|
22
24
|
"Primer::Beta::Breadcrumbs::Item": "",
|
|
23
25
|
"Primer::Beta::Flash": "",
|
data/static/classes.yml
CHANGED
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
- ".Counter--secondary"
|
|
26
26
|
- ".FormControl"
|
|
27
27
|
- ".FormControl--fullWidth"
|
|
28
|
+
- ".FormControl-caption"
|
|
29
|
+
- ".FormControl-inlineValidation"
|
|
28
30
|
- ".FormControl-input"
|
|
29
31
|
- ".FormControl-input-leadingVisual"
|
|
30
32
|
- ".FormControl-input-leadingVisualWrap"
|
|
@@ -62,7 +64,6 @@
|
|
|
62
64
|
- ".Layout-main-centered-md"
|
|
63
65
|
- ".Layout-main-centered-xl"
|
|
64
66
|
- ".Layout-sidebar"
|
|
65
|
-
- ".Link"
|
|
66
67
|
- ".Link--muted"
|
|
67
68
|
- ".Link--primary"
|
|
68
69
|
- ".Link--secondary"
|
data/static/constants.json
CHANGED
|
@@ -4,17 +4,6 @@
|
|
|
4
4
|
},
|
|
5
5
|
"Primer::Alpha::AutoComplete::Item": {
|
|
6
6
|
},
|
|
7
|
-
"Primer::Alpha::BorderBox::Header": {
|
|
8
|
-
"TITLE_TAG_FALLBACK": "h2",
|
|
9
|
-
"TITLE_TAG_OPTIONS": [
|
|
10
|
-
"h1",
|
|
11
|
-
"h2",
|
|
12
|
-
"h3",
|
|
13
|
-
"h4",
|
|
14
|
-
"h5",
|
|
15
|
-
"h6"
|
|
16
|
-
]
|
|
17
|
-
},
|
|
18
7
|
"Primer::Alpha::ButtonMarketing": {
|
|
19
8
|
"DEFAULT_SCHEME": "default",
|
|
20
9
|
"DEFAULT_TAG": "button",
|
|
@@ -143,6 +132,8 @@
|
|
|
143
132
|
"div"
|
|
144
133
|
]
|
|
145
134
|
},
|
|
135
|
+
"Primer::Alpha::TextField": {
|
|
136
|
+
},
|
|
146
137
|
"Primer::Alpha::Tooltip": {
|
|
147
138
|
"DIRECTION_DEFAULT": "s",
|
|
148
139
|
"DIRECTION_OPTIONS": [
|
|
@@ -171,20 +162,6 @@
|
|
|
171
162
|
},
|
|
172
163
|
"Primer::Alpha::UnderlinePanels": {
|
|
173
164
|
},
|
|
174
|
-
"Primer::BaseButton": {
|
|
175
|
-
"DEFAULT_TAG": "button",
|
|
176
|
-
"DEFAULT_TYPE": "button",
|
|
177
|
-
"TAG_OPTIONS": [
|
|
178
|
-
"button",
|
|
179
|
-
"a",
|
|
180
|
-
"summary"
|
|
181
|
-
],
|
|
182
|
-
"TYPE_OPTIONS": [
|
|
183
|
-
"button",
|
|
184
|
-
"reset",
|
|
185
|
-
"submit"
|
|
186
|
-
]
|
|
187
|
-
},
|
|
188
165
|
"Primer::BaseComponent": {
|
|
189
166
|
"SELF_CLOSING_TAGS": [
|
|
190
167
|
"area",
|
|
@@ -258,6 +235,20 @@
|
|
|
258
235
|
"span"
|
|
259
236
|
]
|
|
260
237
|
},
|
|
238
|
+
"Primer::Beta::BaseButton": {
|
|
239
|
+
"DEFAULT_TAG": "button",
|
|
240
|
+
"DEFAULT_TYPE": "button",
|
|
241
|
+
"TAG_OPTIONS": [
|
|
242
|
+
"button",
|
|
243
|
+
"a",
|
|
244
|
+
"summary"
|
|
245
|
+
],
|
|
246
|
+
"TYPE_OPTIONS": [
|
|
247
|
+
"button",
|
|
248
|
+
"reset",
|
|
249
|
+
"submit"
|
|
250
|
+
]
|
|
251
|
+
},
|
|
261
252
|
"Primer::Beta::Blankslate": {
|
|
262
253
|
"VISUAL_OPTIONS": [
|
|
263
254
|
"icon",
|
|
@@ -265,6 +256,34 @@
|
|
|
265
256
|
"image"
|
|
266
257
|
]
|
|
267
258
|
},
|
|
259
|
+
"Primer::Beta::BorderBox": {
|
|
260
|
+
"DEFAULT_PADDING": "default",
|
|
261
|
+
"DEFAULT_ROW_SCHEME": "default",
|
|
262
|
+
"Header": "Primer::Beta::BorderBox::Header",
|
|
263
|
+
"PADDING_MAPPINGS": {
|
|
264
|
+
"default": "",
|
|
265
|
+
"condensed": "Box--condensed",
|
|
266
|
+
"spacious": "Box--spacious"
|
|
267
|
+
},
|
|
268
|
+
"PADDING_SUGGESTION": "Perhaps you could consider using :padding options of default, condensed, and spacious?",
|
|
269
|
+
"ROW_SCHEME_MAPPINGS": {
|
|
270
|
+
"default": "",
|
|
271
|
+
"neutral": "Box-row--gray",
|
|
272
|
+
"info": "Box-row--blue",
|
|
273
|
+
"warning": "Box-row--yellow"
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"Primer::Beta::BorderBox::Header": {
|
|
277
|
+
"TITLE_TAG_FALLBACK": "h2",
|
|
278
|
+
"TITLE_TAG_OPTIONS": [
|
|
279
|
+
"h1",
|
|
280
|
+
"h2",
|
|
281
|
+
"h3",
|
|
282
|
+
"h4",
|
|
283
|
+
"h5",
|
|
284
|
+
"h6"
|
|
285
|
+
]
|
|
286
|
+
},
|
|
268
287
|
"Primer::Beta::Breadcrumbs": {
|
|
269
288
|
"ARGS_DENYLIST": {
|
|
270
289
|
"[:p, :pt, :pb, :pr, :pl, :px, :py]": "Padding system arguments are not allowed on Breadcrumbs. Consider using margins instead.",
|
|
@@ -299,20 +318,6 @@
|
|
|
299
318
|
"Primer::BlankslateComponent": {
|
|
300
319
|
},
|
|
301
320
|
"Primer::BorderBoxComponent": {
|
|
302
|
-
"DEFAULT_PADDING": "default",
|
|
303
|
-
"DEFAULT_ROW_SCHEME": "default",
|
|
304
|
-
"PADDING_MAPPINGS": {
|
|
305
|
-
"default": "",
|
|
306
|
-
"condensed": "Box--condensed",
|
|
307
|
-
"spacious": "Box--spacious"
|
|
308
|
-
},
|
|
309
|
-
"PADDING_SUGGESTION": "Perhaps you could consider using :padding options of default, condensed, and spacious?",
|
|
310
|
-
"ROW_SCHEME_MAPPINGS": {
|
|
311
|
-
"default": "",
|
|
312
|
-
"neutral": "Box-row--gray",
|
|
313
|
-
"info": "Box-row--blue",
|
|
314
|
-
"warning": "Box-row--yellow"
|
|
315
|
-
}
|
|
316
321
|
},
|
|
317
322
|
"Primer::BoxComponent": {
|
|
318
323
|
},
|
data/static/statuses.json
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
"Primer::Alpha::AutoComplete": "
|
|
3
|
-
"Primer::Alpha::AutoComplete::Item": "
|
|
4
|
-
"Primer::Alpha::BorderBox::Header": "alpha",
|
|
2
|
+
"Primer::Alpha::AutoComplete": "deprecated",
|
|
3
|
+
"Primer::Alpha::AutoComplete::Item": "deprecated",
|
|
5
4
|
"Primer::Alpha::ButtonMarketing": "alpha",
|
|
6
5
|
"Primer::Alpha::Layout": "alpha",
|
|
7
6
|
"Primer::Alpha::Layout::Main": "alpha",
|
|
8
7
|
"Primer::Alpha::Layout::Sidebar": "alpha",
|
|
9
8
|
"Primer::Alpha::TabNav": "alpha",
|
|
10
9
|
"Primer::Alpha::TabPanels": "alpha",
|
|
10
|
+
"Primer::Alpha::TextField": "alpha",
|
|
11
11
|
"Primer::Alpha::Tooltip": "alpha",
|
|
12
12
|
"Primer::Alpha::UnderlineNav": "alpha",
|
|
13
13
|
"Primer::Alpha::UnderlinePanels": "alpha",
|
|
14
|
-
"Primer::BaseButton": "beta",
|
|
15
14
|
"Primer::BaseComponent": "beta",
|
|
16
15
|
"Primer::Beta::AutoComplete": "beta",
|
|
17
16
|
"Primer::Beta::AutoComplete::Item": "beta",
|
|
18
17
|
"Primer::Beta::Avatar": "beta",
|
|
19
18
|
"Primer::Beta::AvatarStack": "beta",
|
|
19
|
+
"Primer::Beta::BaseButton": "beta",
|
|
20
20
|
"Primer::Beta::Blankslate": "beta",
|
|
21
|
+
"Primer::Beta::BorderBox": "beta",
|
|
22
|
+
"Primer::Beta::BorderBox::Header": "alpha",
|
|
21
23
|
"Primer::Beta::Breadcrumbs": "beta",
|
|
22
24
|
"Primer::Beta::Breadcrumbs::Item": "alpha",
|
|
23
25
|
"Primer::Beta::Flash": "beta",
|
|
@@ -25,7 +27,7 @@
|
|
|
25
27
|
"Primer::Beta::Truncate": "beta",
|
|
26
28
|
"Primer::Beta::Truncate::TruncateText": "alpha",
|
|
27
29
|
"Primer::BlankslateComponent": "deprecated",
|
|
28
|
-
"Primer::BorderBoxComponent": "
|
|
30
|
+
"Primer::BorderBoxComponent": "deprecated",
|
|
29
31
|
"Primer::BoxComponent": "stable",
|
|
30
32
|
"Primer::ButtonComponent": "beta",
|
|
31
33
|
"Primer::ButtonGroup": "beta",
|
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.86
|
|
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-
|
|
11
|
+
date: 2022-08-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: actionview
|
|
@@ -409,8 +409,6 @@ files:
|
|
|
409
409
|
- app/components/primer/alpha/auto_complete.rb
|
|
410
410
|
- app/components/primer/alpha/auto_complete/auto_complete.html.erb
|
|
411
411
|
- app/components/primer/alpha/auto_complete/item.rb
|
|
412
|
-
- app/components/primer/alpha/border_box/header.html.erb
|
|
413
|
-
- app/components/primer/alpha/border_box/header.rb
|
|
414
412
|
- app/components/primer/alpha/button_marketing.rb
|
|
415
413
|
- app/components/primer/alpha/layout.html.erb
|
|
416
414
|
- app/components/primer/alpha/layout.rb
|
|
@@ -418,6 +416,7 @@ files:
|
|
|
418
416
|
- app/components/primer/alpha/tab_nav.rb
|
|
419
417
|
- app/components/primer/alpha/tab_panels.html.erb
|
|
420
418
|
- app/components/primer/alpha/tab_panels.rb
|
|
419
|
+
- app/components/primer/alpha/text_field.rb
|
|
421
420
|
- app/components/primer/alpha/tool-tip-element.d.ts
|
|
422
421
|
- app/components/primer/alpha/tool-tip-element.js
|
|
423
422
|
- app/components/primer/alpha/tool-tip-element.ts
|
|
@@ -426,7 +425,6 @@ files:
|
|
|
426
425
|
- app/components/primer/alpha/underline_nav.rb
|
|
427
426
|
- app/components/primer/alpha/underline_panels.html.erb
|
|
428
427
|
- app/components/primer/alpha/underline_panels.rb
|
|
429
|
-
- app/components/primer/base_button.rb
|
|
430
428
|
- app/components/primer/base_component.rb
|
|
431
429
|
- app/components/primer/beta/auto_complete.rb
|
|
432
430
|
- app/components/primer/beta/auto_complete/auto_complete.d.ts
|
|
@@ -438,8 +436,13 @@ files:
|
|
|
438
436
|
- app/components/primer/beta/avatar.rb
|
|
439
437
|
- app/components/primer/beta/avatar_stack.html.erb
|
|
440
438
|
- app/components/primer/beta/avatar_stack.rb
|
|
439
|
+
- app/components/primer/beta/base_button.rb
|
|
441
440
|
- app/components/primer/beta/blankslate.html.erb
|
|
442
441
|
- app/components/primer/beta/blankslate.rb
|
|
442
|
+
- app/components/primer/beta/border_box.html.erb
|
|
443
|
+
- app/components/primer/beta/border_box.rb
|
|
444
|
+
- app/components/primer/beta/border_box/header.html.erb
|
|
445
|
+
- app/components/primer/beta/border_box/header.rb
|
|
443
446
|
- app/components/primer/beta/breadcrumbs.html.erb
|
|
444
447
|
- app/components/primer/beta/breadcrumbs.rb
|
|
445
448
|
- app/components/primer/beta/flash.html.erb
|
|
@@ -447,9 +450,7 @@ files:
|
|
|
447
450
|
- app/components/primer/beta/text.rb
|
|
448
451
|
- app/components/primer/beta/truncate.html.erb
|
|
449
452
|
- app/components/primer/beta/truncate.rb
|
|
450
|
-
- app/components/primer/blankslate_component.html.erb
|
|
451
453
|
- app/components/primer/blankslate_component.rb
|
|
452
|
-
- app/components/primer/border_box_component.html.erb
|
|
453
454
|
- app/components/primer/border_box_component.rb
|
|
454
455
|
- app/components/primer/box_component.rb
|
|
455
456
|
- app/components/primer/button_component.html.erb
|
|
@@ -485,6 +486,7 @@ files:
|
|
|
485
486
|
- app/components/primer/heading_component.rb
|
|
486
487
|
- app/components/primer/hellip_button.rb
|
|
487
488
|
- app/components/primer/hidden_text_expander.rb
|
|
489
|
+
- app/components/primer/icon_button.html.erb
|
|
488
490
|
- app/components/primer/icon_button.rb
|
|
489
491
|
- app/components/primer/image.rb
|
|
490
492
|
- app/components/primer/image_crop.d.ts
|
|
@@ -495,6 +497,7 @@ files:
|
|
|
495
497
|
- app/components/primer/label_component.rb
|
|
496
498
|
- app/components/primer/layout_component.html.erb
|
|
497
499
|
- app/components/primer/layout_component.rb
|
|
500
|
+
- app/components/primer/link_component.html.erb
|
|
498
501
|
- app/components/primer/link_component.rb
|
|
499
502
|
- app/components/primer/local_time.d.ts
|
|
500
503
|
- app/components/primer/local_time.js
|
|
@@ -548,6 +551,61 @@ files:
|
|
|
548
551
|
- lib/primer/classify/utilities.rb
|
|
549
552
|
- lib/primer/classify/utilities.yml
|
|
550
553
|
- lib/primer/classify/validation.rb
|
|
554
|
+
- lib/primer/form_components.rb
|
|
555
|
+
- lib/primer/forms/acts_as_component.rb
|
|
556
|
+
- lib/primer/forms/base.html.erb
|
|
557
|
+
- lib/primer/forms/base.rb
|
|
558
|
+
- lib/primer/forms/base_component.rb
|
|
559
|
+
- lib/primer/forms/buffer_rewriter.rb
|
|
560
|
+
- lib/primer/forms/caption.html.erb
|
|
561
|
+
- lib/primer/forms/caption.rb
|
|
562
|
+
- lib/primer/forms/check_box.html.erb
|
|
563
|
+
- lib/primer/forms/check_box.rb
|
|
564
|
+
- lib/primer/forms/check_box_group.html.erb
|
|
565
|
+
- lib/primer/forms/check_box_group.rb
|
|
566
|
+
- lib/primer/forms/dsl/check_box_group_input.rb
|
|
567
|
+
- lib/primer/forms/dsl/check_box_input.rb
|
|
568
|
+
- lib/primer/forms/dsl/form_object.rb
|
|
569
|
+
- lib/primer/forms/dsl/form_reference_input.rb
|
|
570
|
+
- lib/primer/forms/dsl/hidden_input.rb
|
|
571
|
+
- lib/primer/forms/dsl/input.rb
|
|
572
|
+
- lib/primer/forms/dsl/input_group.rb
|
|
573
|
+
- lib/primer/forms/dsl/input_methods.rb
|
|
574
|
+
- lib/primer/forms/dsl/multi_input.rb
|
|
575
|
+
- lib/primer/forms/dsl/radio_button_group_input.rb
|
|
576
|
+
- lib/primer/forms/dsl/radio_button_input.rb
|
|
577
|
+
- lib/primer/forms/dsl/select_list_input.rb
|
|
578
|
+
- lib/primer/forms/dsl/submit_button_input.rb
|
|
579
|
+
- lib/primer/forms/dsl/text_area_input.rb
|
|
580
|
+
- lib/primer/forms/dsl/text_field_input.rb
|
|
581
|
+
- lib/primer/forms/form_control.html.erb
|
|
582
|
+
- lib/primer/forms/form_control.rb
|
|
583
|
+
- lib/primer/forms/form_list.html.erb
|
|
584
|
+
- lib/primer/forms/form_list.rb
|
|
585
|
+
- lib/primer/forms/form_reference.html.erb
|
|
586
|
+
- lib/primer/forms/form_reference.rb
|
|
587
|
+
- lib/primer/forms/group.html.erb
|
|
588
|
+
- lib/primer/forms/group.rb
|
|
589
|
+
- lib/primer/forms/hidden_field.html.erb
|
|
590
|
+
- lib/primer/forms/hidden_field.rb
|
|
591
|
+
- lib/primer/forms/multi.html.erb
|
|
592
|
+
- lib/primer/forms/multi.rb
|
|
593
|
+
- lib/primer/forms/radio_button.html.erb
|
|
594
|
+
- lib/primer/forms/radio_button.rb
|
|
595
|
+
- lib/primer/forms/radio_button_group.html.erb
|
|
596
|
+
- lib/primer/forms/radio_button_group.rb
|
|
597
|
+
- lib/primer/forms/select_list.html.erb
|
|
598
|
+
- lib/primer/forms/select_list.rb
|
|
599
|
+
- lib/primer/forms/separator.html.erb
|
|
600
|
+
- lib/primer/forms/separator.rb
|
|
601
|
+
- lib/primer/forms/spacing_wrapper.html.erb
|
|
602
|
+
- lib/primer/forms/spacing_wrapper.rb
|
|
603
|
+
- lib/primer/forms/submit_button.html.erb
|
|
604
|
+
- lib/primer/forms/submit_button.rb
|
|
605
|
+
- lib/primer/forms/text_area.html.erb
|
|
606
|
+
- lib/primer/forms/text_area.rb
|
|
607
|
+
- lib/primer/forms/text_field.html.erb
|
|
608
|
+
- lib/primer/forms/text_field.rb
|
|
551
609
|
- lib/primer/view_components.rb
|
|
552
610
|
- lib/primer/view_components/constants.rb
|
|
553
611
|
- lib/primer/view_components/engine.rb
|
|
@@ -595,6 +653,7 @@ files:
|
|
|
595
653
|
- lib/rubocop/cop/primer/system_argument_instead_of_class.rb
|
|
596
654
|
- lib/tasks/coverage.rake
|
|
597
655
|
- lib/tasks/custom_utilities.yml
|
|
656
|
+
- lib/tasks/deprecated.rake
|
|
598
657
|
- lib/tasks/docs.rake
|
|
599
658
|
- lib/tasks/helpers/ast_processor.rb
|
|
600
659
|
- lib/tasks/helpers/ast_traverser.rb
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Primer
|
|
4
|
-
# Use `BaseButton` to render an unstyled `<button>` tag that can be customized.
|
|
5
|
-
class BaseButton < Primer::Component
|
|
6
|
-
status :beta
|
|
7
|
-
|
|
8
|
-
DEFAULT_TAG = :button
|
|
9
|
-
TAG_OPTIONS = [DEFAULT_TAG, :a, :summary].freeze
|
|
10
|
-
|
|
11
|
-
DEFAULT_TYPE = :button
|
|
12
|
-
TYPE_OPTIONS = [DEFAULT_TYPE, :reset, :submit].freeze
|
|
13
|
-
|
|
14
|
-
# @example Block
|
|
15
|
-
# <%= render(Primer::BaseButton.new(block: :true)) { "Block" } %>
|
|
16
|
-
# <%= render(Primer::BaseButton.new(block: :true, scheme: :primary)) { "Primary block" } %>
|
|
17
|
-
#
|
|
18
|
-
# @param tag [Symbol] <%= one_of(Primer::BaseButton::TAG_OPTIONS) %>
|
|
19
|
-
# @param type [Symbol] <%= one_of(Primer::BaseButton::TYPE_OPTIONS) %>
|
|
20
|
-
# @param block [Boolean] Whether button is full-width with `display: block`.
|
|
21
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
|
22
|
-
def initialize(
|
|
23
|
-
tag: DEFAULT_TAG,
|
|
24
|
-
type: DEFAULT_TYPE,
|
|
25
|
-
block: false,
|
|
26
|
-
**system_arguments
|
|
27
|
-
)
|
|
28
|
-
@system_arguments = system_arguments
|
|
29
|
-
@system_arguments[:tag] = fetch_or_fallback(TAG_OPTIONS, tag, DEFAULT_TAG)
|
|
30
|
-
|
|
31
|
-
@system_arguments[:type] = fetch_or_fallback(TYPE_OPTIONS, type, DEFAULT_TYPE) if @system_arguments[:tag] == :button
|
|
32
|
-
|
|
33
|
-
@system_arguments[:classes] = class_names(
|
|
34
|
-
system_arguments[:classes],
|
|
35
|
-
"btn-block" => block
|
|
36
|
-
)
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def call
|
|
40
|
-
render(Primer::BaseComponent.new(**@system_arguments)) { content }
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<%# erblint:counter ButtonComponentMigrationCounter 1 %>
|
|
2
|
-
<%= render Primer::BaseComponent.new(**@system_arguments) do %>
|
|
3
|
-
<% if spinner.present? %>
|
|
4
|
-
<%= spinner %>
|
|
5
|
-
<% elsif @icon.present? %>
|
|
6
|
-
<%= primer_octicon @icon, size: @icon_size, classes: "blankslate-icon" %>
|
|
7
|
-
<% elsif @image_src.present? && @image_alt.present? %>
|
|
8
|
-
<%= image_tag @image_src.to_s, class: "mb-3", size: "56x56", alt: @image_alt.to_s %>
|
|
9
|
-
<% end %>
|
|
10
|
-
|
|
11
|
-
<% if @title.present? %>
|
|
12
|
-
<%= render Primer::BaseComponent.new(tag: @title_tag, mb: 1) do %><%= @title %><% end %>
|
|
13
|
-
<% end %>
|
|
14
|
-
|
|
15
|
-
<% if @description.present? %>
|
|
16
|
-
<p><%= @description %></p>
|
|
17
|
-
<% end %>
|
|
18
|
-
|
|
19
|
-
<%= content %>
|
|
20
|
-
|
|
21
|
-
<% if @button_text.present? && @button_url.present? %>
|
|
22
|
-
<a class="btn <%= @button_classes %>" href="<%= @button_url %>"><%= @button_text %></a>
|
|
23
|
-
<% end %>
|
|
24
|
-
|
|
25
|
-
<% if @link_text.present? && @link_url.present? %>
|
|
26
|
-
<p>
|
|
27
|
-
<%= link_to @link_url.to_s do %><%= @link_text %><% end %>
|
|
28
|
-
</p>
|
|
29
|
-
<% end %>
|
|
30
|
-
<% end %>
|