primer_view_components 0.1.1 → 0.1.3
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 +36 -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_list/divider.rb +3 -3
- data/app/components/primer/alpha/action_list/heading.rb +1 -1
- data/app/components/primer/alpha/action_list/item.html.erb +1 -1
- data/app/components/primer/alpha/action_list/item.rb +18 -14
- data/app/components/primer/alpha/action_list.css +1 -1
- data/app/components/primer/alpha/action_list.css.json +3 -0
- data/app/components/primer/alpha/action_list.css.map +1 -1
- data/app/components/primer/alpha/action_list.html.erb +2 -1
- data/app/components/primer/alpha/action_list.pcss +7 -1
- data/app/components/primer/alpha/action_list.rb +12 -2
- data/app/components/primer/alpha/dialog/header.html.erb +3 -1
- data/app/components/primer/alpha/dialog.rb +20 -15
- data/app/components/primer/alpha/nav_list.rb +2 -2
- data/app/components/primer/alpha/overlay/header.html.erb +2 -2
- data/app/components/primer/alpha/overlay.rb +10 -3
- data/app/components/primer/beta/icon_button.rb +1 -1
- data/app/components/primer/component.rb +59 -3
- data/app/components/primer/layout_component.rb +2 -0
- data/app/components/primer/truncate.rb +1 -1
- data/lib/primer/deprecations.yml +10 -0
- data/lib/primer/forms/dsl/text_field_input.rb +1 -1
- data/lib/primer/forms/primer_text_field.js +17 -6
- data/lib/primer/forms/primer_text_field.ts +15 -7
- data/lib/primer/forms/text_field.html.erb +3 -3
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/alpha/action_list_preview.rb +35 -15
- data/previews/primer/alpha/nav_list_preview/trailing_action.html.erb +1 -1
- data/previews/primer/alpha/overlay_preview.rb +28 -3
- data/previews/primer/alpha/text_field_preview.rb +7 -0
- data/static/arguments.json +4 -4
- data/static/previews.json +15 -21
- data/static/statuses.json +2 -2
- metadata +4 -5
- data/previews/primer/layout_component_preview.rb +0 -30
data/lib/primer/deprecations.yml
CHANGED
@@ -26,6 +26,11 @@ deprecations:
|
|
26
26
|
autocorrect: true
|
27
27
|
replacement: "Primer::Beta::IconButton"
|
28
28
|
|
29
|
+
- component: "Primer::LayoutComponent"
|
30
|
+
autocorrect: false
|
31
|
+
replacement: "Primer::Alpha::Layout"
|
32
|
+
guide: "https://primer.style/view-components/guides/primer_layout_component"
|
33
|
+
|
29
34
|
- component: "Primer::Navigation::TabComponent"
|
30
35
|
autocorrect: true
|
31
36
|
replacement: "Primer::Alpha::Navigation::Tab"
|
@@ -33,3 +38,8 @@ deprecations:
|
|
33
38
|
- component: "Primer::Tooltip"
|
34
39
|
autocorrect: true
|
35
40
|
replacement: "Primer::Alpha::Tooltip"
|
41
|
+
|
42
|
+
- component: "Primer::Truncate"
|
43
|
+
autocorrect: false
|
44
|
+
replacement: "Primer::Beta::Truncate"
|
45
|
+
guide: "https://primer.style/view-components/guides/primer_truncate"
|
@@ -32,7 +32,7 @@ module Primer
|
|
32
32
|
|
33
33
|
super(**system_arguments)
|
34
34
|
|
35
|
-
add_input_data(:target, "primer-text-field.inputElement
|
35
|
+
add_input_data(:target, "primer-text-field.inputElement #{system_arguments.dig(:data, :target) || ''}")
|
36
36
|
add_input_classes("FormControl-inset") if inset?
|
37
37
|
add_input_classes("FormControl-monospace") if monospace?
|
38
38
|
end
|
@@ -18,7 +18,10 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
18
18
|
var _PrimerTextFieldElement_abortController;
|
19
19
|
import '@github/auto-check-element';
|
20
20
|
import { controller, target } from '@github/catalyst';
|
21
|
-
|
21
|
+
// eslint-disable-next-line custom-elements/expose-class-on-global
|
22
|
+
let PrimerTextFieldElement =
|
23
|
+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
24
|
+
class PrimerTextFieldElement extends HTMLElement {
|
22
25
|
constructor() {
|
23
26
|
super(...arguments);
|
24
27
|
_PrimerTextFieldElement_abortController.set(this, void 0);
|
@@ -27,22 +30,29 @@ let PrimerTextFieldElement = class PrimerTextFieldElement extends HTMLElement {
|
|
27
30
|
var _a;
|
28
31
|
(_a = __classPrivateFieldGet(this, _PrimerTextFieldElement_abortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
|
29
32
|
const { signal } = (__classPrivateFieldSet(this, _PrimerTextFieldElement_abortController, new AbortController(), "f"));
|
30
|
-
this.inputElement.addEventListener('auto-check-success', () => {
|
31
|
-
|
32
|
-
|
33
|
+
this.inputElement.addEventListener('auto-check-success', () => {
|
34
|
+
this.clearError();
|
35
|
+
}, { signal });
|
36
|
+
this.inputElement.addEventListener('auto-check-error', async (event) => {
|
37
|
+
const errorMessage = await event.detail.response.text();
|
38
|
+
this.setError(errorMessage);
|
33
39
|
}, { signal });
|
34
40
|
}
|
35
41
|
disconnectedCallback() {
|
36
42
|
var _a;
|
37
43
|
(_a = __classPrivateFieldGet(this, _PrimerTextFieldElement_abortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
|
38
44
|
}
|
45
|
+
clearContents() {
|
46
|
+
this.inputElement.value = '';
|
47
|
+
this.inputElement.focus();
|
48
|
+
}
|
39
49
|
clearError() {
|
40
50
|
this.inputElement.removeAttribute('invalid');
|
41
51
|
this.validationElement.hidden = true;
|
42
|
-
this.validationMessageElement.
|
52
|
+
this.validationMessageElement.textContent = '';
|
43
53
|
}
|
44
54
|
setError(message) {
|
45
|
-
this.validationMessageElement.
|
55
|
+
this.validationMessageElement.textContent = message;
|
46
56
|
this.validationElement.hidden = false;
|
47
57
|
this.inputElement.setAttribute('invalid', 'true');
|
48
58
|
}
|
@@ -59,4 +69,5 @@ __decorate([
|
|
59
69
|
], PrimerTextFieldElement.prototype, "validationMessageElement", void 0);
|
60
70
|
PrimerTextFieldElement = __decorate([
|
61
71
|
controller
|
72
|
+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
62
73
|
], PrimerTextFieldElement);
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import '@github/auto-check-element'
|
2
2
|
import {controller, target} from '@github/catalyst'
|
3
3
|
|
4
|
+
// eslint-disable-next-line custom-elements/expose-class-on-global
|
4
5
|
@controller
|
6
|
+
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
5
7
|
class PrimerTextFieldElement extends HTMLElement {
|
6
8
|
@target inputElement: HTMLInputElement
|
7
9
|
@target validationElement: HTMLElement
|
@@ -15,16 +17,17 @@ class PrimerTextFieldElement extends HTMLElement {
|
|
15
17
|
|
16
18
|
this.inputElement.addEventListener(
|
17
19
|
'auto-check-success',
|
18
|
-
() => {
|
20
|
+
() => {
|
21
|
+
this.clearError()
|
22
|
+
},
|
19
23
|
{signal}
|
20
24
|
)
|
21
25
|
|
22
26
|
this.inputElement.addEventListener(
|
23
27
|
'auto-check-error',
|
24
|
-
(event: any) => {
|
25
|
-
event.detail.response.text()
|
26
|
-
|
27
|
-
)
|
28
|
+
async (event: any) => {
|
29
|
+
const errorMessage = await event.detail.response.text()
|
30
|
+
this.setError(errorMessage)
|
28
31
|
},
|
29
32
|
{signal}
|
30
33
|
)
|
@@ -34,14 +37,19 @@ class PrimerTextFieldElement extends HTMLElement {
|
|
34
37
|
this.#abortController?.abort()
|
35
38
|
}
|
36
39
|
|
40
|
+
clearContents() {
|
41
|
+
this.inputElement.value = ''
|
42
|
+
this.inputElement.focus()
|
43
|
+
}
|
44
|
+
|
37
45
|
clearError(): void {
|
38
46
|
this.inputElement.removeAttribute('invalid')
|
39
47
|
this.validationElement.hidden = true
|
40
|
-
this.validationMessageElement.
|
48
|
+
this.validationMessageElement.textContent = ''
|
41
49
|
}
|
42
50
|
|
43
51
|
setError(message: string): void {
|
44
|
-
this.validationMessageElement.
|
52
|
+
this.validationMessageElement.textContent = message
|
45
53
|
this.validationElement.hidden = false
|
46
54
|
this.inputElement.setAttribute('invalid', 'true')
|
47
55
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
<primer-text-field>
|
2
2
|
<%= render(FormControl.new(input: @input)) do %>
|
3
3
|
<%= content_tag(:div, **@field_wrap_arguments) do %>
|
4
4
|
<% if @input.leading_visual %>
|
@@ -10,10 +10,10 @@
|
|
10
10
|
<%= builder.text_field(@input.name, **@input.input_arguments) %>
|
11
11
|
<% end %>
|
12
12
|
<% if @input.show_clear_button? %>
|
13
|
-
<button type="button" id="<%= @input.clear_button_id %>" class="FormControl-input-trailingAction" aria-label="Clear">
|
13
|
+
<button type="button" id="<%= @input.clear_button_id %>" class="FormControl-input-trailingAction" aria-label="Clear" data-action="click:primer-text-field#clearContents">
|
14
14
|
<%= render(Primer::Beta::Octicon.new(icon: :"x-circle-fill")) %>
|
15
15
|
</button>
|
16
16
|
<% end %>
|
17
17
|
<% end %>
|
18
18
|
<% end %>
|
19
|
-
|
19
|
+
</primer-text-field>
|
@@ -89,6 +89,39 @@ module Primer
|
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
+
# @label With manual dividers
|
93
|
+
#
|
94
|
+
# @param role text
|
95
|
+
# @param scheme [Symbol] select [full, inset]
|
96
|
+
# @param show_dividers toggle
|
97
|
+
def with_manual_dividers(
|
98
|
+
role: Primer::Alpha::ActionList::DEFAULT_ROLE,
|
99
|
+
scheme: Primer::Alpha::ActionList::DEFAULT_SCHEME,
|
100
|
+
show_dividers: false
|
101
|
+
)
|
102
|
+
render(Primer::Alpha::ActionList.new(
|
103
|
+
role: role,
|
104
|
+
scheme: scheme,
|
105
|
+
show_dividers: show_dividers
|
106
|
+
)) do |component|
|
107
|
+
component.with_heading(title: "Action List")
|
108
|
+
component.with_item(label: "Item one", href: "/") do |item|
|
109
|
+
item.with_leading_visual_icon(icon: :gear)
|
110
|
+
end
|
111
|
+
component.with_divider
|
112
|
+
component.with_item(label: "Item two", href: "/") do |item|
|
113
|
+
item.with_leading_visual_icon(icon: :star)
|
114
|
+
end
|
115
|
+
component.with_item(label: "Item three", href: "/") do |item|
|
116
|
+
item.with_leading_visual_icon(icon: :heart)
|
117
|
+
end
|
118
|
+
component.with_divider
|
119
|
+
component.with_item(label: "Item four", href: "/") do |item|
|
120
|
+
item.with_leading_visual_icon(icon: :bug)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
92
125
|
# @label Divider
|
93
126
|
#
|
94
127
|
# @param scheme [Symbol] select [subtle, filled]
|
@@ -135,7 +168,6 @@ module Primer
|
|
135
168
|
# @param private_leading_action_icon [Symbol] octicon
|
136
169
|
# @param private_trailing_action_icon [Symbol] octicon
|
137
170
|
# @param trailing_action toggle
|
138
|
-
# @param trailing_action_on_hover toggle
|
139
171
|
# @param tooltip toggle
|
140
172
|
def item(
|
141
173
|
label: "Label",
|
@@ -156,7 +188,6 @@ module Primer
|
|
156
188
|
trailing_visual_text: nil,
|
157
189
|
private_leading_action_icon: nil,
|
158
190
|
private_trailing_action_icon: nil,
|
159
|
-
trailing_action_on_hover: false,
|
160
191
|
trailing_action: false,
|
161
192
|
tooltip: false
|
162
193
|
)
|
@@ -195,7 +226,7 @@ module Primer
|
|
195
226
|
item.with_private_trailing_action_icon(icon: private_trailing_action_icon)
|
196
227
|
end
|
197
228
|
|
198
|
-
item.with_trailing_action(
|
229
|
+
item.with_trailing_action(icon: "plus", "aria-label": "Button tooltip", size: :medium) if trailing_action && trailing_action != :none
|
199
230
|
|
200
231
|
item.description { description } if description
|
201
232
|
|
@@ -294,18 +325,7 @@ module Primer
|
|
294
325
|
aria: { label: "List heading" }
|
295
326
|
)) do |component|
|
296
327
|
component.with_item(label: "Default item", href: "/") do |item|
|
297
|
-
item.with_trailing_action(
|
298
|
-
end
|
299
|
-
end
|
300
|
-
end
|
301
|
-
|
302
|
-
# @label Item [trailing action on hover]
|
303
|
-
def item_trailing_action_hover
|
304
|
-
render(Primer::Alpha::ActionList.new(
|
305
|
-
aria: { label: "List heading" }
|
306
|
-
)) do |component|
|
307
|
-
component.with_item(label: "Default item", href: "/") do |item|
|
308
|
-
item.with_trailing_action(show_on_hover: true, icon: "plus", "aria-label": "Button tooltip", size: :medium)
|
328
|
+
item.with_trailing_action(icon: "plus", "aria-label": "Button tooltip", size: :medium)
|
309
329
|
end
|
310
330
|
end
|
311
331
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<% list.with_group do |group| %>
|
3
3
|
<%= group.with_heading(title: "Shopping list") %>
|
4
4
|
<% group.with_item(label: "Bread", href: "/list/1") do |item| %>
|
5
|
-
<%= item.with_trailing_action(
|
5
|
+
<%= item.with_trailing_action(icon: :plus, aria: { label: "Activate alert" }, name: "bread_button") %>
|
6
6
|
<% end %>
|
7
7
|
<% group.with_item(label: "Cheese", href: "/list/2") do |item| %>
|
8
8
|
<%= item.with_trailing_action(icon: :plus, aria: { label: "Activate alert" }, name: "cheese_button") %>
|
@@ -32,10 +32,10 @@ module Primer
|
|
32
32
|
anchor_offset: anchor_offset,
|
33
33
|
anchor_side: anchor_side,
|
34
34
|
allow_out_of_bounds: allow_out_of_bounds,
|
35
|
-
visually_hide_title: visually_hide_title
|
35
|
+
visually_hide_title: visually_hide_title
|
36
36
|
)) do |d|
|
37
37
|
d.with_header(title: title, size: header_size)
|
38
|
-
if icon.present?
|
38
|
+
if icon.present? && (icon != :none)
|
39
39
|
d.with_show_button(icon: icon, "aria-label": icon.to_s)
|
40
40
|
else
|
41
41
|
d.with_show_button { button_text }
|
@@ -69,7 +69,7 @@ module Primer
|
|
69
69
|
anchor_align: anchor_align,
|
70
70
|
anchor_side: anchor_side,
|
71
71
|
allow_out_of_bounds: allow_out_of_bounds,
|
72
|
-
visually_hide_title: visually_hide_title
|
72
|
+
visually_hide_title: visually_hide_title
|
73
73
|
)) do |d|
|
74
74
|
d.with_header(title: title, size: header_size)
|
75
75
|
d.with_show_button { button_text }
|
@@ -77,6 +77,31 @@ module Primer
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
+
# @label Menu No Header
|
81
|
+
#
|
82
|
+
# @param size [Symbol] select [auto, small, medium, medium_portrait, large, xlarge]
|
83
|
+
# @param padding [Symbol] select [normal, condensed, none]
|
84
|
+
# @param anchor_align [Symbol] select [start, center, end]
|
85
|
+
# @param anchor_side [Symbol] select [inside_top, inside_bottom, inside_left, inside_right, inside_center, outside_top, outside_bottom, outside_left, outside_right]
|
86
|
+
# @param allow_out_of_bounds [Boolean] toggle
|
87
|
+
#
|
88
|
+
# @param button_text [String] text
|
89
|
+
# @param body_text [String] text
|
90
|
+
def menu_no_header(size: :auto, padding: :normal, anchor_align: :center, anchor_side: :outside_bottom, allow_out_of_bounds: false, button_text: "Show Overlay Menu", body_text: "This is a menu")
|
91
|
+
render(Primer::Alpha::Overlay.new(
|
92
|
+
title: "Menu",
|
93
|
+
role: :menu,
|
94
|
+
size: size,
|
95
|
+
padding: padding,
|
96
|
+
anchor_align: anchor_align,
|
97
|
+
anchor_side: anchor_side,
|
98
|
+
allow_out_of_bounds: allow_out_of_bounds
|
99
|
+
)) do |d|
|
100
|
+
d.with_show_button { button_text }
|
101
|
+
d.with_body { body_text }
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
80
105
|
# @label Middle Of Page
|
81
106
|
#
|
82
107
|
# @param title [String] text
|
@@ -167,6 +167,13 @@ module Primer
|
|
167
167
|
end
|
168
168
|
#
|
169
169
|
# @!endgroup
|
170
|
+
|
171
|
+
# @label With data target attribute
|
172
|
+
def with_data_target
|
173
|
+
render(Primer::Alpha::TextField.new(name: "my-text-field", label: "My text field", data: { target: "custom-component.inputElement" }))
|
174
|
+
end
|
175
|
+
#
|
176
|
+
# @!endgroup
|
170
177
|
end
|
171
178
|
end
|
172
179
|
end
|
data/static/arguments.json
CHANGED
@@ -1335,7 +1335,7 @@
|
|
1335
1335
|
},
|
1336
1336
|
{
|
1337
1337
|
"component": "Layout",
|
1338
|
-
"status": "
|
1338
|
+
"status": "deprecated",
|
1339
1339
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/layout_component.rb",
|
1340
1340
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/layout/default/",
|
1341
1341
|
"parameters": [
|
@@ -1805,7 +1805,7 @@
|
|
1805
1805
|
},
|
1806
1806
|
{
|
1807
1807
|
"component": "Truncate",
|
1808
|
-
"status": "
|
1808
|
+
"status": "deprecated",
|
1809
1809
|
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/truncate.rb",
|
1810
1810
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/truncate/default/",
|
1811
1811
|
"parameters": [
|
@@ -2394,8 +2394,8 @@
|
|
2394
2394
|
{
|
2395
2395
|
"name": "label",
|
2396
2396
|
"type": "String",
|
2397
|
-
"default": "
|
2398
|
-
"description": "Item label."
|
2397
|
+
"default": "`nil`",
|
2398
|
+
"description": "Item label. If no label is provided, content is used."
|
2399
2399
|
},
|
2400
2400
|
{
|
2401
2401
|
"name": "label_classes",
|
data/static/previews.json
CHANGED
@@ -18,6 +18,11 @@
|
|
18
18
|
"preview_path": "/lookbook/preview/primer/alpha/action_list/leading_visuals",
|
19
19
|
"name": "leading_visuals"
|
20
20
|
},
|
21
|
+
{
|
22
|
+
"inspect_path": "/lookbook/inspect/primer/alpha/action_list/with_manual_dividers",
|
23
|
+
"preview_path": "/lookbook/preview/primer/alpha/action_list/with_manual_dividers",
|
24
|
+
"name": "with_manual_dividers"
|
25
|
+
},
|
21
26
|
{
|
22
27
|
"inspect_path": "/lookbook/inspect/primer/alpha/action_list/divider",
|
23
28
|
"preview_path": "/lookbook/preview/primer/alpha/action_list/divider",
|
@@ -78,11 +83,6 @@
|
|
78
83
|
"preview_path": "/lookbook/preview/primer/alpha/action_list/item_trailing_action",
|
79
84
|
"name": "item_trailing_action"
|
80
85
|
},
|
81
|
-
{
|
82
|
-
"inspect_path": "/lookbook/inspect/primer/alpha/action_list/item_trailing_action_hover",
|
83
|
-
"preview_path": "/lookbook/preview/primer/alpha/action_list/item_trailing_action_hover",
|
84
|
-
"name": "item_trailing_action_hover"
|
85
|
-
},
|
86
86
|
{
|
87
87
|
"inspect_path": "/lookbook/inspect/primer/alpha/action_list/item_danger",
|
88
88
|
"preview_path": "/lookbook/preview/primer/alpha/action_list/item_danger",
|
@@ -1116,22 +1116,6 @@
|
|
1116
1116
|
}
|
1117
1117
|
]
|
1118
1118
|
},
|
1119
|
-
{
|
1120
|
-
"name": "layout",
|
1121
|
-
"lookup_path": "primer/layout",
|
1122
|
-
"examples": [
|
1123
|
-
{
|
1124
|
-
"inspect_path": "/lookbook/inspect/primer/layout/playground",
|
1125
|
-
"preview_path": "/lookbook/preview/primer/layout/playground",
|
1126
|
-
"name": "playground"
|
1127
|
-
},
|
1128
|
-
{
|
1129
|
-
"inspect_path": "/lookbook/inspect/primer/layout/default",
|
1130
|
-
"preview_path": "/lookbook/preview/primer/layout/default",
|
1131
|
-
"name": "default"
|
1132
|
-
}
|
1133
|
-
]
|
1134
|
-
},
|
1135
1119
|
{
|
1136
1120
|
"name": "link",
|
1137
1121
|
"lookup_path": "primer/beta/link",
|
@@ -1277,6 +1261,11 @@
|
|
1277
1261
|
"preview_path": "/lookbook/preview/primer/alpha/overlay/default",
|
1278
1262
|
"name": "default"
|
1279
1263
|
},
|
1264
|
+
{
|
1265
|
+
"inspect_path": "/lookbook/inspect/primer/alpha/overlay/menu_no_header",
|
1266
|
+
"preview_path": "/lookbook/preview/primer/alpha/overlay/menu_no_header",
|
1267
|
+
"name": "menu_no_header"
|
1268
|
+
},
|
1280
1269
|
{
|
1281
1270
|
"inspect_path": "/lookbook/inspect/primer/alpha/overlay/middle_of_page",
|
1282
1271
|
"preview_path": "/lookbook/preview/primer/alpha/overlay/middle_of_page",
|
@@ -1637,6 +1626,11 @@
|
|
1637
1626
|
"preview_path": "/lookbook/preview/primer/alpha/text_field/default",
|
1638
1627
|
"name": "default"
|
1639
1628
|
},
|
1629
|
+
{
|
1630
|
+
"inspect_path": "/lookbook/inspect/primer/alpha/text_field/with_data_target",
|
1631
|
+
"preview_path": "/lookbook/preview/primer/alpha/text_field/with_data_target",
|
1632
|
+
"name": "with_data_target"
|
1633
|
+
},
|
1640
1634
|
{
|
1641
1635
|
"inspect_path": "/lookbook/inspect/primer/alpha/text_field/auto_check",
|
1642
1636
|
"preview_path": "/lookbook/preview/primer/alpha/text_field/auto_check",
|
data/static/statuses.json
CHANGED
@@ -92,8 +92,8 @@
|
|
92
92
|
"Primer::ConditionalWrapper": "alpha",
|
93
93
|
"Primer::Content": "stable",
|
94
94
|
"Primer::IconButton": "deprecated",
|
95
|
-
"Primer::LayoutComponent": "
|
95
|
+
"Primer::LayoutComponent": "deprecated",
|
96
96
|
"Primer::Navigation::TabComponent": "deprecated",
|
97
97
|
"Primer::Tooltip": "deprecated",
|
98
|
-
"Primer::Truncate": "
|
98
|
+
"Primer::Truncate": "deprecated"
|
99
99
|
}
|
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.1.
|
4
|
+
version: 0.1.3
|
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: 2023-03-
|
11
|
+
date: 2023-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 18.0.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 18.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: view_component
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1034,7 +1034,6 @@ files:
|
|
1034
1034
|
- previews/primer/forms/forms_preview/single_text_field_form.html.erb
|
1035
1035
|
- previews/primer/forms/forms_preview/submit_button_form.html.erb
|
1036
1036
|
- previews/primer/forms/forms_preview/text_field_and_checkbox_form.html.erb
|
1037
|
-
- previews/primer/layout_component_preview.rb
|
1038
1037
|
- previews/primer/url_helpers.rb
|
1039
1038
|
- static/arguments.json
|
1040
1039
|
- static/assets/view-components.svg
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Primer
|
4
|
-
# @label LayoutComponent
|
5
|
-
class LayoutComponentPreview < ViewComponent::Preview
|
6
|
-
# @label Playground
|
7
|
-
#
|
8
|
-
# @param responsive [Boolean]
|
9
|
-
# @param side [Symbol] select [left, right]
|
10
|
-
# @param sidebar_col [Integer] select [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
11
|
-
def playground(responsive: false, side: :right, sidebar_col: 3)
|
12
|
-
render(Primer::LayoutComponent.new(responsive: responsive, side: side, sidebar_col: sidebar_col)) do |component|
|
13
|
-
component.with_main { "Main" }
|
14
|
-
component.with_sidebar { "Sidebar" }
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# @label Default
|
19
|
-
#
|
20
|
-
# @param responsive [Boolean]
|
21
|
-
# @param side [Symbol] select [left, right]
|
22
|
-
# @param sidebar_col [Integer] select [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
23
|
-
def default(responsive: false, side: :right, sidebar_col: 3)
|
24
|
-
render(Primer::LayoutComponent.new(responsive: responsive, side: side, sidebar_col: sidebar_col)) do |component|
|
25
|
-
component.with_main { "Main" }
|
26
|
-
component.with_sidebar { "Sidebar" }
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|