primer_view_components 0.36.5 → 0.38.0
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 +32 -0
- data/app/assets/javascripts/components/primer/beta/details_toggle_element.d.ts +39 -0
- data/app/assets/javascripts/components/primer/primer.d.ts +1 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.js +13 -3
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +14 -2
- data/app/components/primer/alpha/dialog.css +1 -1
- data/app/components/primer/alpha/dialog.css.json +0 -1
- data/app/components/primer/alpha/dialog.css.map +1 -1
- data/app/components/primer/alpha/dialog.pcss +1 -4
- data/app/components/primer/alpha/dropdown.rb +8 -0
- data/app/components/primer/alpha/form_control.rb +47 -7
- data/app/components/primer/alpha/toggle_switch.html.erb +1 -1
- data/app/components/primer/alpha/toggle_switch.js +1 -0
- data/app/components/primer/alpha/toggle_switch.rb +14 -2
- data/app/components/primer/alpha/toggle_switch.ts +1 -0
- data/app/components/primer/beta/auto_complete/item.rb +2 -3
- data/app/components/primer/beta/auto_complete/no_result_item.rb +21 -0
- data/app/components/primer/beta/details.html.erb +8 -6
- data/app/components/primer/beta/details.rb +42 -0
- data/app/components/primer/beta/details_toggle_element.d.ts +39 -0
- data/app/components/primer/beta/details_toggle_element.js +60 -0
- data/app/components/primer/beta/details_toggle_element.ts +57 -0
- data/app/components/primer/beta/markdown.rb +1 -0
- data/app/components/primer/beta/nav_list.rb +1 -1
- data/app/components/primer/dialog_helper.js +3 -0
- data/app/components/primer/dialog_helper.ts +3 -0
- data/app/components/primer/primer.d.ts +1 -0
- data/app/components/primer/primer.js +1 -0
- data/app/components/primer/primer.ts +1 -0
- data/app/lib/primer/forms/action_menu.html.erb +1 -1
- data/app/lib/primer/forms/action_menu.rb +5 -0
- data/lib/primer/view_components/version.rb +2 -2
- data/lib/primer/yard/component_manifest.rb +11 -10
- data/lib/primer/yard/lookbook_pages_backend.rb +8 -0
- data/previews/primer/alpha/action_menu_preview/multiple_select_form.html.erb +1 -1
- data/previews/primer/alpha/form_control_preview/playground.html.erb +14 -6
- data/previews/primer/alpha/overlay_preview.rb +0 -31
- data/previews/primer/alpha/select_preview.rb +6 -6
- data/previews/primer/alpha/text_field_preview.rb +22 -22
- data/previews/primer/alpha/toggle_switch_preview.rb +4 -0
- data/previews/primer/beta/auto_complete_preview.rb +6 -0
- data/previews/primer/beta/details_preview.rb +12 -0
- data/previews/primer/beta/markdown_preview.rb +9 -9
- data/previews/primer/beta/nav_list_preview/truncate.html.erb +25 -0
- data/previews/primer/beta/nav_list_preview.rb +4 -24
- data/previews/primer/beta/relative_time_preview.rb +20 -10
- data/static/arguments.json +23 -0
- data/static/audited_at.json +1 -0
- data/static/constants.json +8 -0
- data/static/info_arch.json +213 -85
- data/static/previews.json +42 -67
- data/static/statuses.json +1 -0
- metadata +8 -4
- data/previews/primer/alpha/overlay_preview/in_an_action_menu.html.erb +0 -13
- data/previews/primer/alpha/overlay_preview/overlay_with_header_filter.html.erb +0 -16
@@ -134,21 +134,10 @@ module Primer
|
|
134
134
|
#
|
135
135
|
# @param truncate_label [Symbol] select [none, truncate, show_tooltip]
|
136
136
|
# @snapshot
|
137
|
-
def
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
truncate_label: truncate_label
|
142
|
-
)
|
143
|
-
component.with_item(
|
144
|
-
label: "Really really long label that may wrap, truncate, or appear as a tooltip",
|
145
|
-
truncate_label: truncate_label
|
146
|
-
)
|
147
|
-
component.with_item(
|
148
|
-
label: "Really really long label that may wrap, truncate, or appear as a tooltip",
|
149
|
-
truncate_label: truncate_label
|
150
|
-
)
|
151
|
-
end
|
137
|
+
def truncate(truncate_label: :none)
|
138
|
+
render_with_template(locals: {
|
139
|
+
truncate_label: truncate_label
|
140
|
+
})
|
152
141
|
end
|
153
142
|
|
154
143
|
def long_label_wrap(truncate_label: :none)
|
@@ -160,15 +149,6 @@ module Primer
|
|
160
149
|
end
|
161
150
|
end
|
162
151
|
|
163
|
-
def long_label_truncate_no_tooltip(truncate_label: :truncate)
|
164
|
-
render(Primer::Beta::NavList.new(aria: { label: "List heading" })) do |component|
|
165
|
-
component.with_item(
|
166
|
-
label: "Really really long label that may wrap, truncate, or appear as a tooltip",
|
167
|
-
truncate_label: truncate_label
|
168
|
-
)
|
169
|
-
end
|
170
|
-
end
|
171
|
-
|
172
152
|
def long_label_show_tooltip_no_truncate_label
|
173
153
|
render(Primer::Beta::NavList.new(aria: { label: "List heading" })) do |component|
|
174
154
|
component.with_item(
|
@@ -41,7 +41,8 @@ module Primer
|
|
41
41
|
format_style: nil,
|
42
42
|
datetime: Time.utc(2020, 1, 1, 0, 0, 0),
|
43
43
|
lang: nil,
|
44
|
-
title: nil
|
44
|
+
title: nil,
|
45
|
+
no_title: true
|
45
46
|
)
|
46
47
|
render(Primer::Beta::RelativeTime.new(
|
47
48
|
tense: tense,
|
@@ -60,7 +61,8 @@ module Primer
|
|
60
61
|
format_style: format_style,
|
61
62
|
datetime: datetime,
|
62
63
|
lang: lang,
|
63
|
-
title: title
|
64
|
+
title: title,
|
65
|
+
no_title: no_title
|
64
66
|
))
|
65
67
|
end
|
66
68
|
|
@@ -98,7 +100,8 @@ module Primer
|
|
98
100
|
format_style: nil,
|
99
101
|
datetime: Time.now.utc,
|
100
102
|
lang: nil,
|
101
|
-
title: nil
|
103
|
+
title: nil,
|
104
|
+
no_title: true
|
102
105
|
)
|
103
106
|
render(Primer::Beta::RelativeTime.new(
|
104
107
|
tense: tense,
|
@@ -117,7 +120,8 @@ module Primer
|
|
117
120
|
format_style: format_style,
|
118
121
|
datetime: datetime,
|
119
122
|
lang: lang,
|
120
|
-
title: title
|
123
|
+
title: title,
|
124
|
+
no_title: no_title
|
121
125
|
))
|
122
126
|
end
|
123
127
|
|
@@ -153,7 +157,8 @@ module Primer
|
|
153
157
|
format_style: nil,
|
154
158
|
datetime: Time.now.iso8601,
|
155
159
|
lang: nil,
|
156
|
-
title: nil
|
160
|
+
title: nil,
|
161
|
+
no_title: true
|
157
162
|
)
|
158
163
|
render(Primer::Beta::RelativeTime.new(
|
159
164
|
tense: tense,
|
@@ -172,7 +177,8 @@ module Primer
|
|
172
177
|
format_style: format_style,
|
173
178
|
datetime: datetime,
|
174
179
|
lang: lang,
|
175
|
-
title: title
|
180
|
+
title: title,
|
181
|
+
no_title: no_title
|
176
182
|
))
|
177
183
|
end
|
178
184
|
|
@@ -210,7 +216,8 @@ module Primer
|
|
210
216
|
format_style: nil,
|
211
217
|
datetime: Time.now.iso8601,
|
212
218
|
lang: nil,
|
213
|
-
title: nil
|
219
|
+
title: nil,
|
220
|
+
no_title: true
|
214
221
|
)
|
215
222
|
render(Primer::Beta::RelativeTime.new(
|
216
223
|
tense: tense,
|
@@ -229,7 +236,8 @@ module Primer
|
|
229
236
|
format_style: format_style,
|
230
237
|
datetime: datetime,
|
231
238
|
lang: lang,
|
232
|
-
title: title
|
239
|
+
title: title,
|
240
|
+
no_title: no_title
|
233
241
|
))
|
234
242
|
end
|
235
243
|
|
@@ -261,7 +269,8 @@ module Primer
|
|
261
269
|
format_style: nil,
|
262
270
|
datetime: Time.utc(2038, 1, 19, 0o3, 14, 8),
|
263
271
|
lang: nil,
|
264
|
-
title: nil
|
272
|
+
title: nil,
|
273
|
+
no_title: true
|
265
274
|
)
|
266
275
|
render(Primer::Beta::RelativeTime.new(
|
267
276
|
tense: tense,
|
@@ -278,7 +287,8 @@ module Primer
|
|
278
287
|
format_style: format_style,
|
279
288
|
datetime: datetime,
|
280
289
|
lang: lang,
|
281
|
-
title: title
|
290
|
+
title: title,
|
291
|
+
no_title: no_title
|
282
292
|
))
|
283
293
|
end
|
284
294
|
|
data/static/arguments.json
CHANGED
@@ -1253,6 +1253,12 @@
|
|
1253
1253
|
"default": "`false`",
|
1254
1254
|
"description": "When set to `true`, the form control will take up all the horizontal space allowed by its container."
|
1255
1255
|
},
|
1256
|
+
{
|
1257
|
+
"name": "label_arguments",
|
1258
|
+
"type": "Hash",
|
1259
|
+
"default": "`{}`",
|
1260
|
+
"description": "HTML attributes to attach to the `<label>` element that labels the input."
|
1261
|
+
},
|
1256
1262
|
{
|
1257
1263
|
"name": "system_arguments",
|
1258
1264
|
"type": "Hash",
|
@@ -3074,6 +3080,12 @@
|
|
3074
3080
|
"default": "`false`",
|
3075
3081
|
"description": "Whether or not to request a turbo stream and render the response as such."
|
3076
3082
|
},
|
3083
|
+
{
|
3084
|
+
"name": "autofocus",
|
3085
|
+
"type": "Boolean",
|
3086
|
+
"default": "`nil`",
|
3087
|
+
"description": "Whether switch should be autofocused when rendered."
|
3088
|
+
},
|
3077
3089
|
{
|
3078
3090
|
"name": "system_arguments",
|
3079
3091
|
"type": "Hash",
|
@@ -3365,6 +3377,17 @@
|
|
3365
3377
|
}
|
3366
3378
|
]
|
3367
3379
|
},
|
3380
|
+
{
|
3381
|
+
"component": "AutoComplete::NoResultItem",
|
3382
|
+
"status": "beta",
|
3383
|
+
"a11y_reviewed": false,
|
3384
|
+
"short_name": "AutoCompleteNoResultItem",
|
3385
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/beta/auto_complete/no_result_item.rb",
|
3386
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/auto_complete/no_result_item/default/",
|
3387
|
+
"parameters": [
|
3388
|
+
|
3389
|
+
]
|
3390
|
+
},
|
3368
3391
|
{
|
3369
3392
|
"component": "Avatar",
|
3370
3393
|
"status": "beta",
|
data/static/audited_at.json
CHANGED
@@ -68,6 +68,7 @@
|
|
68
68
|
"Primer::BaseComponent": "",
|
69
69
|
"Primer::Beta::AutoComplete": "",
|
70
70
|
"Primer::Beta::AutoComplete::Item": "",
|
71
|
+
"Primer::Beta::AutoComplete::NoResultItem": "",
|
71
72
|
"Primer::Beta::Avatar": "",
|
72
73
|
"Primer::Beta::AvatarStack": "",
|
73
74
|
"Primer::Beta::BaseButton": "",
|
data/static/constants.json
CHANGED
@@ -333,6 +333,8 @@
|
|
333
333
|
]
|
334
334
|
},
|
335
335
|
"Primer::Alpha::Dropdown": {
|
336
|
+
"ARIA_LABEL_CLOSED_DEFAULT": "Open",
|
337
|
+
"ARIA_LABEL_OPEN_DEFAULT": "Close",
|
336
338
|
"GeneratedSlotMethods": "Primer::Alpha::Dropdown::GeneratedSlotMethods",
|
337
339
|
"Menu": "Primer::Alpha::Dropdown::Menu"
|
338
340
|
},
|
@@ -805,6 +807,7 @@
|
|
805
807
|
"DEFAULT_WIDTH": "auto",
|
806
808
|
"GeneratedSlotMethods": "Primer::Beta::AutoComplete::GeneratedSlotMethods",
|
807
809
|
"Item": "Primer::Beta::AutoComplete::Item",
|
810
|
+
"NoResultItem": "Primer::Beta::AutoComplete::NoResultItem",
|
808
811
|
"SIZE_MAPPINGS": {
|
809
812
|
"small": "FormControl-small",
|
810
813
|
"medium": "FormControl-medium",
|
@@ -844,6 +847,9 @@
|
|
844
847
|
],
|
845
848
|
"GeneratedSlotMethods": "Primer::Beta::AutoComplete::Item::GeneratedSlotMethods"
|
846
849
|
},
|
850
|
+
"Primer::Beta::AutoComplete::NoResultItem": {
|
851
|
+
"GeneratedSlotMethods": "Primer::Beta::AutoComplete::NoResultItem::GeneratedSlotMethods"
|
852
|
+
},
|
847
853
|
"Primer::Beta::Avatar": {
|
848
854
|
"DEFAULT_SHAPE": "circle",
|
849
855
|
"DEFAULT_SIZE": 20,
|
@@ -1037,6 +1043,8 @@
|
|
1037
1043
|
]
|
1038
1044
|
},
|
1039
1045
|
"Primer::Beta::Details": {
|
1046
|
+
"ARIA_LABEL_CLOSED_DEFAULT": "Expand",
|
1047
|
+
"ARIA_LABEL_OPEN_DEFAULT": "Collapse",
|
1040
1048
|
"BODY_TAG_DEFAULT": "div",
|
1041
1049
|
"BODY_TAG_OPTIONS": [
|
1042
1050
|
"ul",
|