primer_view_components 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +51 -0
- data/README.md +1 -1
- 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 -3
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list/item.rb +2 -2
- data/app/components/primer/alpha/action_list.css +1 -1
- data/app/components/primer/alpha/action_list.css.json +16 -16
- data/app/components/primer/alpha/action_list.css.map +1 -1
- data/app/components/primer/alpha/action_list.pcss +145 -145
- data/app/components/primer/alpha/action_list.rb +30 -15
- data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +2 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.js +44 -34
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +32 -30
- data/app/components/primer/alpha/action_menu/list.rb +6 -1
- data/app/components/primer/alpha/auto_complete.css +1 -1
- data/app/components/primer/alpha/auto_complete.css.map +1 -1
- data/app/components/primer/alpha/auto_complete.pcss +3 -3
- data/app/components/primer/alpha/banner.css +1 -1
- data/app/components/primer/alpha/banner.css.map +1 -1
- data/app/components/primer/alpha/banner.pcss +11 -11
- data/app/components/primer/alpha/button_marketing.css.map +1 -1
- data/app/components/primer/alpha/button_marketing.pcss +5 -12
- data/app/components/primer/alpha/button_marketing.rb +3 -0
- data/app/components/primer/alpha/dialog.css +1 -1
- data/app/components/primer/alpha/dialog.css.map +1 -1
- data/app/components/primer/alpha/dialog.pcss +36 -36
- data/app/components/primer/alpha/dropdown.css +1 -1
- data/app/components/primer/alpha/dropdown.css.map +1 -1
- data/app/components/primer/alpha/dropdown.pcss +12 -12
- data/app/components/primer/alpha/form_control.html.erb +1 -1
- data/app/components/primer/alpha/hellip_button.rb +3 -1
- data/app/components/primer/alpha/layout.css +1 -1
- data/app/components/primer/alpha/layout.css.map +1 -1
- data/app/components/primer/alpha/layout.pcss +4 -4
- data/app/components/primer/alpha/menu.css +1 -1
- data/app/components/primer/alpha/menu.css.map +1 -1
- data/app/components/primer/alpha/menu.pcss +21 -21
- data/app/components/primer/alpha/modal_dialog.js +11 -4
- data/app/components/primer/alpha/modal_dialog.ts +11 -4
- data/app/components/primer/alpha/nav_list/item.rb +2 -0
- data/app/components/primer/alpha/nav_list.js +6 -0
- data/app/components/primer/alpha/nav_list.rb +55 -36
- data/app/components/primer/alpha/nav_list.ts +8 -0
- data/app/components/primer/alpha/octicon_symbols.html.erb +1 -1
- data/app/components/primer/alpha/overlay.css +1 -1
- data/app/components/primer/alpha/overlay.css.json +1 -2
- data/app/components/primer/alpha/overlay.css.map +1 -1
- data/app/components/primer/alpha/overlay.pcss +14 -4
- data/app/components/primer/alpha/segmented_control.css +1 -1
- data/app/components/primer/alpha/segmented_control.css.map +1 -1
- data/app/components/primer/alpha/segmented_control.pcss +24 -33
- data/app/components/primer/alpha/tab_nav.css +1 -1
- data/app/components/primer/alpha/tab_nav.css.map +1 -1
- data/app/components/primer/alpha/tab_nav.pcss +12 -12
- data/app/components/primer/alpha/text_field.css +1 -3
- data/app/components/primer/alpha/text_field.css.json +1 -0
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/alpha/text_field.pcss +87 -83
- data/app/components/primer/alpha/toggle_switch.css +1 -1
- data/app/components/primer/alpha/toggle_switch.css.map +1 -1
- data/app/components/primer/alpha/toggle_switch.pcss +12 -12
- data/app/components/primer/alpha/underline_nav.css +1 -1
- data/app/components/primer/alpha/underline_nav.css.map +1 -1
- data/app/components/primer/alpha/underline_nav.pcss +11 -11
- data/app/components/primer/beta/avatar.css +1 -1
- data/app/components/primer/beta/avatar.css.map +1 -1
- data/app/components/primer/beta/avatar.pcss +18 -18
- data/app/components/primer/beta/avatar_stack.css +1 -1
- data/app/components/primer/beta/avatar_stack.css.map +1 -1
- data/app/components/primer/beta/avatar_stack.pcss +5 -5
- data/app/components/primer/beta/base_button.rb +11 -0
- data/app/components/primer/beta/blankslate.css +1 -1
- data/app/components/primer/beta/blankslate.css.map +1 -1
- data/app/components/primer/beta/blankslate.pcss +16 -16
- data/app/components/primer/beta/border_box.css +1 -1
- data/app/components/primer/beta/border_box.css.json +1 -1
- data/app/components/primer/beta/border_box.css.map +1 -1
- data/app/components/primer/beta/border_box.pcss +40 -42
- data/app/components/primer/beta/button.css +1 -1
- data/app/components/primer/beta/button.css.json +4 -0
- data/app/components/primer/beta/button.css.map +1 -1
- data/app/components/primer/beta/button.pcss +39 -24
- data/app/components/primer/beta/button.rb +3 -0
- data/app/components/primer/beta/button_group.css +1 -0
- data/app/components/primer/beta/button_group.css.json +14 -0
- data/app/components/primer/beta/button_group.css.map +1 -0
- data/app/components/primer/beta/button_group.pcss +27 -0
- data/app/components/primer/beta/button_group.rb +19 -19
- data/app/components/primer/beta/close_button.rb +3 -1
- data/app/components/primer/beta/counter.css +1 -1
- data/app/components/primer/beta/counter.css.map +1 -1
- data/app/components/primer/beta/counter.pcss +5 -5
- data/app/components/primer/beta/details.html.erb +6 -2
- data/app/components/primer/beta/details.rb +18 -10
- data/app/components/primer/beta/flash.css +1 -1
- data/app/components/primer/beta/flash.css.map +1 -1
- data/app/components/primer/beta/flash.pcss +12 -12
- data/app/components/primer/beta/icon_button.rb +7 -3
- data/app/components/primer/beta/label.css +1 -1
- data/app/components/primer/beta/label.css.map +1 -1
- data/app/components/primer/beta/label.pcss +3 -3
- data/app/components/primer/beta/popover.css +1 -1
- data/app/components/primer/beta/popover.css.map +1 -1
- data/app/components/primer/beta/popover.pcss +4 -4
- data/app/components/primer/beta/state.css +1 -1
- data/app/components/primer/beta/state.css.map +1 -1
- data/app/components/primer/beta/state.pcss +7 -7
- data/app/components/primer/beta/subhead.css +1 -1
- data/app/components/primer/beta/subhead.css.map +1 -1
- data/app/components/primer/beta/subhead.pcss +9 -9
- data/app/components/primer/beta/timeline_item.css +1 -1
- data/app/components/primer/beta/timeline_item.css.map +1 -1
- data/app/components/primer/beta/timeline_item.pcss +18 -18
- data/app/components/primer/beta/truncate.css +1 -1
- data/app/components/primer/beta/truncate.css.map +1 -1
- data/app/components/primer/beta/truncate.pcss +1 -1
- data/app/components/primer/focus_group.js +1 -10
- data/app/components/primer/focus_group.ts +1 -10
- 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/components/primer/primer.ts +1 -0
- data/lib/postcss_mixins/activeIndicatorLine.pcss +4 -4
- data/lib/primer/accessibility.rb +74 -0
- data/lib/primer/forms/form_control.html.erb +1 -1
- data/lib/primer/static/generate_previews.rb +15 -8
- data/lib/primer/view_components/linters/deprecated_components_counter.rb +37 -13
- data/lib/primer/view_components/version.rb +2 -2
- data/lib/primer/yard/lookbook_pages_backend.rb +3 -3
- data/previews/pages/forms/03_caption_templates.md.erb +1 -1
- data/previews/pages/forms/04_after_content.md.erb +1 -1
- data/previews/pages/forms/06_miscellaneous_inputs.md.erb +1 -1
- data/previews/pages/forms/07_toggle_switch_forms.md.erb +1 -1
- data/previews/primer/alpha/action_menu_preview/two_menus.html.erb +13 -0
- data/previews/primer/alpha/action_menu_preview/with_actions.html.erb +21 -0
- data/previews/primer/alpha/action_menu_preview.rb +5 -13
- data/previews/primer/alpha/button_marketing_preview.rb +3 -2
- data/previews/primer/alpha/dialog_preview.rb +4 -3
- data/previews/primer/alpha/hellip_button_preview.rb +3 -2
- data/previews/primer/alpha/nav_list_preview.rb +1 -1
- data/previews/primer/beta/base_button_preview.rb +9 -2
- data/previews/primer/beta/button_group_preview/action_menus.html.erb +8 -0
- data/previews/primer/beta/button_group_preview.rb +49 -11
- data/previews/primer/beta/button_preview/trailing_counter.html.erb +1 -1
- data/previews/primer/beta/button_preview.rb +5 -2
- data/previews/primer/beta/close_button_preview.rb +3 -2
- data/previews/primer/beta/details_preview.rb +11 -8
- data/previews/primer/forms_preview.rb +44 -0
- data/static/arguments.json +4 -4
- data/static/classes.json +378 -372
- data/static/constants.json +0 -1
- data/static/info_arch.json +5150 -1368
- data/static/previews.json +5197 -1433
- metadata +37 -29
- data/previews/primer/forms/forms_preview.rb +0 -48
- /data/previews/primer/{forms/forms_preview → forms_preview}/after_content_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/array_check_box_group_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/caption_template_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/check_box_group_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/check_box_with_nested_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/composed_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/example_toggle_switch_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/horizontal_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/immediate_validation_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/invalid_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/multi_input_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/multi_text_field_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/name_with_question_mark_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/radio_button_group_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/radio_button_with_nested_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/select_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/single_text_field_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/submit_button_form.html.erb +0 -0
- /data/previews/primer/{forms/forms_preview → forms_preview}/text_field_and_checkbox_form.html.erb +0 -0
@@ -5,8 +5,8 @@
|
|
5
5
|
background-color: var(--color-canvas-default);
|
6
6
|
border-color: var(--color-border-default);
|
7
7
|
border-style: solid;
|
8
|
-
border-width: var(--borderWidth-thin
|
9
|
-
border-radius: var(--borderRadius-medium
|
8
|
+
border-width: var(--borderWidth-thin);
|
9
|
+
border-radius: var(--borderRadius-medium);
|
10
10
|
}
|
11
11
|
|
12
12
|
/* Box padding density options */
|
@@ -14,106 +14,105 @@
|
|
14
14
|
line-height: 1.25;
|
15
15
|
|
16
16
|
& .Box-header {
|
17
|
-
padding: var(--stack-padding-condensed
|
17
|
+
padding: var(--stack-padding-condensed) var(--stack-padding-normal);
|
18
18
|
}
|
19
19
|
|
20
20
|
& .Box-body {
|
21
|
-
padding: var(--stack-padding-condensed
|
21
|
+
padding: var(--stack-padding-condensed) var(--stack-padding-normal);
|
22
22
|
}
|
23
23
|
|
24
24
|
& .Box-footer {
|
25
|
-
padding: var(--stack-padding-condensed
|
25
|
+
padding: var(--stack-padding-condensed) var(--stack-padding-normal);
|
26
26
|
}
|
27
27
|
|
28
28
|
& .Box-btn-octicon {
|
29
29
|
&.btn-octicon {
|
30
|
-
padding: var(--control-medium-paddingInline-condensed
|
31
|
-
margin: calc(var(--controlStack-medium-gap-condensed
|
32
|
-
calc(var(--controlStack-small-gap-spacious, 16px) * -1);
|
30
|
+
padding: var(--control-medium-paddingInline-condensed) var(--control-medium-paddingInline-spacious);
|
31
|
+
margin: calc(var(--controlStack-medium-gap-condensed) * -1) calc(var(--controlStack-small-gap-spacious) * -1);
|
33
32
|
line-height: 1.25;
|
34
33
|
}
|
35
34
|
}
|
36
35
|
|
37
36
|
& .Box-row {
|
38
|
-
padding: var(--stack-padding-condensed
|
37
|
+
padding: var(--stack-padding-condensed) var(--stack-padding-normal);
|
39
38
|
}
|
40
39
|
}
|
41
40
|
|
42
41
|
.Box--spacious {
|
43
42
|
& .Box-header {
|
44
|
-
padding: var(--stack-padding-spacious
|
43
|
+
padding: var(--stack-padding-spacious);
|
45
44
|
line-height: 1.25;
|
46
45
|
}
|
47
46
|
|
48
47
|
& .Box-title {
|
49
|
-
font-size: var(--text-title-size-medium
|
48
|
+
font-size: var(--text-title-size-medium);
|
50
49
|
}
|
51
50
|
|
52
51
|
& .Box-body {
|
53
|
-
padding: var(--stack-padding-spacious
|
52
|
+
padding: var(--stack-padding-spacious);
|
54
53
|
}
|
55
54
|
|
56
55
|
& .Box-footer {
|
57
|
-
padding: var(--stack-padding-spacious
|
56
|
+
padding: var(--stack-padding-spacious);
|
58
57
|
}
|
59
58
|
|
60
59
|
& .Box-btn-octicon {
|
61
60
|
&.btn-octicon {
|
62
|
-
padding: var(--stack-padding-spacious
|
63
|
-
margin: calc(var(--stack-gap-spacious
|
61
|
+
padding: var(--stack-padding-spacious);
|
62
|
+
margin: calc(var(--stack-gap-spacious) * -1) calc(var(--stack-gap-spacious) * -1);
|
64
63
|
}
|
65
64
|
}
|
66
65
|
|
67
66
|
& .Box-row {
|
68
|
-
padding: var(--stack-padding-spacious
|
67
|
+
padding: var(--stack-padding-spacious);
|
69
68
|
}
|
70
69
|
}
|
71
70
|
|
72
71
|
.Box-header {
|
73
|
-
padding: var(--stack-padding-normal
|
74
|
-
margin: calc(var(--borderWidth-thin
|
72
|
+
padding: var(--stack-padding-normal);
|
73
|
+
margin: calc(var(--borderWidth-thin) * -1) calc(var(--borderWidth-thin) * -1) 0;
|
75
74
|
background-color: var(--color-canvas-subtle);
|
76
75
|
border-color: var(--color-border-default);
|
77
76
|
border-style: solid;
|
78
|
-
border-width: var(--borderWidth-thin
|
79
|
-
border-top-left-radius: var(--borderRadius-medium
|
80
|
-
border-top-right-radius: var(--borderRadius-medium
|
77
|
+
border-width: var(--borderWidth-thin);
|
78
|
+
border-top-left-radius: var(--borderRadius-medium);
|
79
|
+
border-top-right-radius: var(--borderRadius-medium);
|
81
80
|
}
|
82
81
|
|
83
82
|
.Box-title {
|
84
|
-
font-size: var(--text-body-size-medium
|
85
|
-
font-weight: var(--base-text-weight-semibold
|
83
|
+
font-size: var(--text-body-size-medium);
|
84
|
+
font-weight: var(--base-text-weight-semibold);
|
86
85
|
}
|
87
86
|
|
88
87
|
.Box-body {
|
89
|
-
padding: var(--stack-padding-normal
|
90
|
-
border-bottom: var(--borderWidth-thin
|
88
|
+
padding: var(--stack-padding-normal);
|
89
|
+
border-bottom: var(--borderWidth-thin) solid var(--color-border-default);
|
91
90
|
|
92
91
|
/* Ensures bottom-border doesn't poke out when .Box-body used without box-footer */
|
93
92
|
&:last-of-type {
|
94
|
-
margin-bottom: calc(var(--borderWidth-thin
|
95
|
-
border-bottom-right-radius: var(--borderRadius-medium
|
96
|
-
border-bottom-left-radius: var(--borderRadius-medium
|
93
|
+
margin-bottom: calc(var(--borderWidth-thin) * -1);
|
94
|
+
border-bottom-right-radius: var(--borderRadius-medium);
|
95
|
+
border-bottom-left-radius: var(--borderRadius-medium);
|
97
96
|
}
|
98
97
|
}
|
99
98
|
|
100
99
|
/* Box rows */
|
101
100
|
.Box-row {
|
102
|
-
padding: var(--stack-padding-normal
|
103
|
-
margin-top: calc(var(--borderWidth-thin
|
101
|
+
padding: var(--stack-padding-normal);
|
102
|
+
margin-top: calc(var(--borderWidth-thin) * -1);
|
104
103
|
list-style-type: none; /* To account for applying Box component to a list */
|
105
104
|
border-top-color: var(--color-border-muted);
|
106
105
|
border-top-style: solid;
|
107
|
-
border-top-width: var(--borderWidth-thin
|
106
|
+
border-top-width: var(--borderWidth-thin);
|
108
107
|
|
109
108
|
&:first-of-type {
|
110
|
-
border-top-left-radius: var(--borderRadius-medium
|
111
|
-
border-top-right-radius: var(--borderRadius-medium
|
109
|
+
border-top-left-radius: var(--borderRadius-medium);
|
110
|
+
border-top-right-radius: var(--borderRadius-medium);
|
112
111
|
}
|
113
112
|
|
114
113
|
&:last-of-type {
|
115
|
-
border-bottom-right-radius: var(--borderRadius-medium
|
116
|
-
border-bottom-left-radius: var(--borderRadius-medium
|
114
|
+
border-bottom-right-radius: var(--borderRadius-medium);
|
115
|
+
border-bottom-left-radius: var(--borderRadius-medium);
|
117
116
|
}
|
118
117
|
|
119
118
|
/* Adds a blue vertical line to the left of the row
|
@@ -200,12 +199,12 @@
|
|
200
199
|
}
|
201
200
|
|
202
201
|
.Box-footer {
|
203
|
-
padding: var(--stack-padding-normal
|
204
|
-
margin-top: calc(var(--borderWidth-thin
|
202
|
+
padding: var(--stack-padding-normal);
|
203
|
+
margin-top: calc(var(--borderWidth-thin) * -1); /* prevents double border when used with .Box-body */
|
205
204
|
border-top-color: var(--color-border-default);
|
206
205
|
border-top-style: solid;
|
207
|
-
border-top-width: var(--borderWidth-thin
|
208
|
-
border-radius: 0 0 var(--borderRadius-medium
|
206
|
+
border-top-width: var(--borderWidth-thin);
|
207
|
+
border-radius: 0 0 var(--borderRadius-medium) var(--borderRadius-medium);
|
209
208
|
}
|
210
209
|
|
211
210
|
/* Option for a box with scrolling content */
|
@@ -278,9 +277,8 @@
|
|
278
277
|
.Box-btn-octicon {
|
279
278
|
/* Increase specificity when btn-octicon is used because comes after .Box in the cascade */
|
280
279
|
&.btn-octicon {
|
281
|
-
padding: var(--control-medium-paddingInline-spacious
|
282
|
-
margin: calc(var(--controlStack-small-gap-spacious
|
283
|
-
calc(var(--controlStack-small-gap-spacious, 16px) * -1);
|
280
|
+
padding: var(--control-medium-paddingInline-spacious) var(--control-medium-paddingInline-spacious);
|
281
|
+
margin: calc(var(--controlStack-small-gap-spacious) * -1) calc(var(--controlStack-small-gap-spacious) * -1);
|
284
282
|
line-height: 1.5; /* override btn-octicon line-height */
|
285
283
|
}
|
286
284
|
}
|
@@ -1 +1 @@
|
|
1
|
-
:root{--duration-fast:80ms;--easing-easeInOut:cubic-bezier(0.65,0,0.35,1)}.Button{align-items:center;background-color:initial;border:var(--borderWidth-thin,1px) solid;border-color:#0000;border-radius:var(--borderRadius-medium,6px);color:var(--color-btn-text);cursor:pointer;display:inline-flex;flex-direction:row;font-size:var(--text-body-size-medium
|
1
|
+
:root{--duration-fast:80ms;--easing-easeInOut:cubic-bezier(0.65,0,0.35,1)}.Button{align-items:center;background-color:initial;border:var(--borderWidth-thin,max(1px,.0625rem)) solid;border-color:#0000;border-radius:var(--borderRadius-medium,6px);color:var(--color-btn-text);cursor:pointer;display:inline-flex;flex-direction:row;font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-medium,500);gap:var(--base-size-4,.25rem);height:var(--control-medium-size,2rem);justify-content:space-between;min-width:max-content;padding:0 var(--control-medium-paddingInline-normal,.75rem);position:relative;text-align:center;transition:var(--duration-fast) var(--easing-easeInOut);transition-property:color,fill,background-color,border-color;-webkit-user-select:none;user-select:none}@media (pointer:coarse){.Button:before{content:"";height:100%;left:50%;min-height:48px;min-width:48px;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}}.Button:hover{transition-duration:var(--duration-fast)}.Button:active{transition:none}.Button:disabled,.Button[aria-disabled=true]{box-shadow:none;cursor:not-allowed}.Button-withTooltip{display:inline-block;position:relative}a.Button:hover,summary.Button:hover{text-decoration:none}.Button-content{align-items:center;display:grid;flex:1 0 auto;grid-template-areas:"leadingVisual text trailingVisual";grid-template-columns:min-content minmax(0,auto) min-content;place-content:center}.Button-content>:not(:last-child){margin-right:var(--control-medium-gap,.5rem)}.Button-content--alignStart{justify-content:start}.Button-visual{display:flex;pointer-events:none}.Button-visual .Counter{background-color:var(--color-btn-counter-bg);color:inherit}.Button-label{grid-area:text;line-height:var(--text-body-lineHeight-medium,1.42857);white-space:nowrap}.Button-leadingVisual{grid-area:leadingVisual}.Button-trailingVisual{grid-area:trailingVisual}.Button-trailingAction{margin-right:calc(var(--base-size-4,.25rem)*-1)}.Button--small{font-size:var(--text-body-size-small,.75rem);gap:var(--control-small-gap,.25rem);height:var(--control-small-size,1.75rem);padding:0 var(--control-small-paddingInline-condensed,.5rem)}.Button--small .Button-label{line-height:var(--text-body-lineHeight-small,1.66667)}.Button--small .Button-content>:not(:last-child){margin-right:var(--control-small-gap,.25rem)}.Button--large{gap:var(--control-large-gap,.5rem);height:var(--control-large-size,2.5rem);padding:0 var(--control-large-paddingInline-spacious,1rem)}.Button--large .Button-label{line-height:var(--text-body-lineHeight-large,1.5)}.Button--large .Button-content>:not(:last-child){margin-right:var(--control-large-gap,.5rem)}.Button--fullWidth{width:100%}.Button--primary{fill:var(--color-btn-primary-icon);background-color:var(--color-btn-primary-bg);border-color:var(--color-btn-primary-border);box-shadow:var(--color-btn-primary-shadow),var(--color-btn-primary-inset-shadow);color:var(--color-btn-primary-text)}.Button--primary:hover:not(:disabled){background-color:var(--color-btn-primary-hover-bg);border-color:var(--color-btn-primary-hover-border)}.Button--primary:focus{box-shadow:inset 0 0 0 3px var(--color-fg-on-emphasis);outline:2px solid var(--color-accent-fg);outline-offset:-2px}.Button--primary:focus:not(:focus-visible){box-shadow:none;outline:1px solid #0000}.Button--primary:focus-visible{box-shadow:inset 0 0 0 3px var(--color-fg-on-emphasis);outline:2px solid var(--color-accent-fg);outline-offset:-2px}.Button--primary:active:not(:disabled),.Button--primary[aria-pressed=true]{background-color:var(--color-btn-primary-selected-bg);box-shadow:var(--color-btn-primary-selected-shadow)}.Button--primary:disabled,.Button--primary[aria-disabled=true]{fill:var(--color-btn-primary-disabled-text);background-color:var(--color-btn-primary-disabled-bg);border-color:var(--color-btn-primary-disabled-border);color:var(--color-btn-primary-disabled-text)}.Button--primary .Counter{background-color:var(--color-btn-primary-counter-bg);color:inherit}.Button--secondary{fill:var(--color-fg-muted);background-color:var(--color-btn-bg);border-color:var(--color-btn-border);box-shadow:var(--color-btn-shadow),var(--color-btn-inset-shadow);color:var(--color-btn-text)}.Button--secondary:hover:not(:disabled){background-color:var(--color-btn-hover-bg);border-color:var(--color-btn-hover-border)}.Button--secondary:active:not(:disabled){background-color:var(--color-btn-active-bg);border-color:var(--color-btn-active-border)}.Button--secondary[aria-pressed=true]{background-color:var(--color-btn-selected-bg);box-shadow:var(--color-primer-shadow-inset)}.Button--secondary:disabled,.Button--secondary[aria-disabled=true]{fill:var(--color-primer-fg-disabled);background-color:var(--color-btn-bg);border-color:var(--color-btn-border);color:var(--color-primer-fg-disabled)}.Button--invisible{color:var(--color-btn-text)}.Button--invisible:hover:not(:disabled){background-color:var(--color-action-list-item-default-hover-bg)}.Button--invisible:active:not(:disabled),.Button--invisible[aria-pressed=true]{background-color:var(--color-action-list-item-default-active-bg)}.Button--invisible:disabled,.Button--invisible[aria-disabled=true]{fill:var(--color-primer-fg-disabled);background-color:var(--color-btn-bg);border-color:var(--color-btn-border);color:var(--color-primer-fg-disabled)}.Button--invisible.Button--invisible-noVisuals .Button-label{color:var(--color-accent-fg)}.Button--invisible .Button-visual{color:var(--color-fg-muted)}.Button--invisible .Button-visual .Counter{color:var(--color-fg-default)}.Button--link{fill:var(--color-accent-fg);border:none;color:var(--color-accent-fg);display:inline-block;font-size:inherit;height:unset;padding:0}.Button--link:hover:not(:disabled){text-decoration:underline}.Button--link:focus,.Button--link:focus-visible{outline-offset:2px}.Button--link:disabled,.Button--link[aria-disabled=true]{fill:var(--color-primer-fg-disabled);background-color:initial;border-color:#0000;color:var(--color-primer-fg-disabled)}.Button--danger{fill:var(--color-btn-danger-icon);background-color:var(--color-btn-bg);border-color:var(--color-btn-border);box-shadow:var(--color-btn-shadow),var(--color-btn-inset-shadow);color:var(--color-btn-danger-text)}.Button--danger:hover:not(:disabled){fill:var(--color-btn-danger-hover-text);background-color:var(--color-btn-danger-hover-bg);border-color:var(--color-btn-danger-hover-border);box-shadow:var(--color-btn-danger-hover-shadow),var(--color-btn-danger-hover-inset-shadow);color:var(--color-btn-danger-hover-text)}.Button--danger:hover:not(:disabled) .Counter{background-color:var(--color-btn-danger-hover-counter-bg);color:var(--color-btn-danger-hover-counter-fg)}.Button--danger:active:not(:disabled),.Button--danger[aria-pressed=true]{fill:var(--color-btn-danger-selected-text);background-color:var(--color-btn-danger-selected-bg);border-color:var(--color-btn-danger-selected-border);box-shadow:var(--color-btn-danger-selected-shadow);color:var(--color-btn-danger-selected-text)}.Button--danger:disabled,.Button--danger[aria-disabled=true]{fill:var(--color-btn-danger-disabled-text);background-color:var(--color-btn-danger-disabled-bg);border-color:var(--color-btn-border);color:var(--color-btn-danger-disabled-text)}.Button--danger:disabled .Counter,.Button--danger[aria-disabled=true] .Counter{background-color:var(--color-btn-danger-disabled-counter-bg);color:var(--color-btn-danger-disabled-counter-fg)}.Button--danger .Counter{background-color:var(--color-btn-danger-counter-bg);color:var(--color-btn-danger-counter-fg)}.Button--iconOnly{display:inline-grid;padding:unset;place-content:center;width:var(--control-medium-size,2rem)}.Button--iconOnly.Button--small{width:var(--control-small-size,1.75rem)}.Button--iconOnly.Button--large{width:var(--control-large-size,2.5rem)}
|
@@ -60,10 +60,14 @@
|
|
60
60
|
".Button--link[aria-disabled=true]",
|
61
61
|
".Button--danger",
|
62
62
|
".Button--danger:hover:not(:disabled)",
|
63
|
+
".Button--danger:hover:not(:disabled) .Counter",
|
63
64
|
".Button--danger:active:not(:disabled)",
|
64
65
|
".Button--danger[aria-pressed=true]",
|
65
66
|
".Button--danger:disabled",
|
66
67
|
".Button--danger[aria-disabled=true]",
|
68
|
+
".Button--danger:disabled .Counter",
|
69
|
+
".Button--danger[aria-disabled=true] .Counter",
|
70
|
+
".Button--danger .Counter",
|
67
71
|
".Button--iconOnly",
|
68
72
|
".Button--iconOnly.Button--small",
|
69
73
|
".Button--iconOnly.Button--large"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["button.pcss","<no source>","../../../../lib/postcss_mixins/focusOutlineOnEmphasis.pcss"],"names":[],"mappings":"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","file":"button.css","sourcesContent":["/* CSS for Button */\n\n/* temporary, pre primitives release */\n:root {\n --duration-fast: 80ms;\n --easing-easeInOut: cubic-bezier(0.65, 0, 0.35, 1);\n}\n\n/* base button */\n.Button {\n position: relative;\n font-size: var(--text-body-size-medium, 14px);\n font-weight: var(--base-text-weight-medium, 500);\n cursor: pointer;\n user-select: none;\n background-color: transparent;\n border: var(--borderWidth-thin, 1px) solid;\n border-color: transparent;\n border-radius: var(--borderRadius-medium, 6px);\n color: var(--color-btn-text);\n transition: var(--duration-fast) var(--easing-easeInOut);\n transition-property: color, fill, background-color, border-color;\n text-align: center;\n height: var(--control-medium-size, 32px);\n padding: 0 var(--control-medium-paddingInline-normal, 12px);\n display: inline-flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: var(--base-size-4, 4px);\n min-width: max-content;\n\n /* mobile friendly sizing */\n @media (pointer: coarse) {\n &::before {\n @mixin minTouchTarget 48px, 48px;\n }\n }\n\n /* base states */\n\n &:hover {\n transition-duration: var(--duration-fast);\n }\n\n &:active {\n transition: none;\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n cursor: not-allowed;\n box-shadow: none;\n }\n}\n\n.Button-withTooltip {\n position: relative;\n display: inline-block;\n}\n\na.Button,\nsummary.Button {\n &:hover {\n text-decoration: none;\n }\n}\n\n/* wrap grid content to allow trailingAction to lock-right */\n.Button-content {\n flex: 1 0 auto;\n display: grid;\n grid-template-areas: 'leadingVisual text trailingVisual';\n grid-template-columns: min-content minmax(0, auto) min-content;\n align-items: center;\n place-content: center;\n\n /* padding-bottom: 1px; optical alignment for firefox */\n\n & > :not(:last-child) {\n margin-right: var(--control-medium-gap, 8px);\n }\n}\n\n/* center child elements for fullWidth */\n.Button-content--alignStart {\n justify-content: start;\n}\n\n/* button child elements */\n\n/* align svg */\n.Button-visual {\n display: flex;\n pointer-events: none; /* allow click handler to work, avoiding visuals */\n\n & .Counter {\n color: inherit;\n background-color: var(--color-btn-counter-bg);\n }\n}\n\n.Button-label {\n grid-area: text;\n white-space: nowrap;\n line-height: var(--text-body-lineHeight-medium, calc(20 / 14));\n}\n\n.Button-leadingVisual {\n grid-area: leadingVisual;\n}\n\n.Button-trailingVisual {\n grid-area: trailingVisual;\n}\n\n.Button-trailingAction {\n margin-right: calc(var(--base-size-4, 4px) * -1);\n}\n\n/* sizes */\n\n.Button--small {\n font-size: var(--text-body-size-small, 12px);\n height: var(--control-small-size, 28px);\n padding: 0 var(--control-small-paddingInline-condensed, 8px);\n gap: var(--control-small-gap, 4px);\n\n & .Button-label {\n line-height: var(--text-body-lineHeight-small, calc(20 / 12));\n }\n\n & .Button-content {\n & > :not(:last-child) {\n margin-right: var(--control-small-gap, 4px);\n }\n }\n}\n\n.Button--large {\n height: var(--control-large-size, 40px);\n padding: 0 var(--control-large-paddingInline-spacious, 16px);\n gap: var(--control-large-gap, 8px);\n\n & .Button-label {\n line-height: var(--text-body-lineHeight-large, calc(48 / 32));\n }\n\n & .Button-content {\n & > :not(:last-child) {\n margin-right: var(--control-large-gap, 8px);\n }\n }\n}\n\n.Button--fullWidth {\n width: 100%;\n}\n\n/* variants */\n\n/* primary */\n.Button--primary {\n color: var(--color-btn-primary-text);\n fill: var(--color-btn-primary-icon);\n background-color: var(--color-btn-primary-bg);\n border-color: var(--color-btn-primary-border);\n box-shadow: var(--color-btn-primary-shadow), var(--color-btn-primary-inset-shadow);\n\n &:hover:not(:disabled) {\n background-color: var(--color-btn-primary-hover-bg);\n border-color: var(--color-btn-primary-hover-border);\n }\n\n /* fallback :focus state */\n &:focus {\n @mixin focusOutlineOnEmphasis;\n\n /* remove fallback :focus if :focus-visible is supported */\n &:not(:focus-visible) {\n outline: solid 1px transparent;\n box-shadow: none;\n }\n }\n\n /* default focus state */\n &:focus-visible {\n @mixin focusOutlineOnEmphasis;\n }\n\n &:active:not(:disabled),\n &[aria-pressed='true'] {\n background-color: var(--color-btn-primary-selected-bg);\n box-shadow: var(--color-btn-primary-selected-shadow);\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n color: var(--color-btn-primary-disabled-text);\n background-color: var(--color-btn-primary-disabled-bg);\n border-color: var(--color-btn-primary-disabled-border);\n fill: var(--color-btn-primary-disabled-text);\n }\n\n & .Counter {\n color: inherit;\n background-color: var(--color-btn-primary-counter-bg);\n }\n}\n\n/* default (secondary) */\n.Button--secondary {\n color: var(--color-btn-text);\n fill: var(--color-fg-muted); /* help this */\n background-color: var(--color-btn-bg);\n border-color: var(--color-btn-border);\n box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);\n\n &:hover:not(:disabled) {\n background-color: var(--color-btn-hover-bg);\n border-color: var(--color-btn-hover-border);\n }\n\n &:active:not(:disabled) {\n background-color: var(--color-btn-active-bg);\n border-color: var(--color-btn-active-border);\n }\n\n &[aria-pressed='true'] {\n background-color: var(--color-btn-selected-bg);\n box-shadow: var(--color-primer-shadow-inset);\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n color: var(--color-primer-fg-disabled);\n background-color: var(--color-btn-bg);\n border-color: var(--color-btn-border);\n fill: var(--color-primer-fg-disabled);\n }\n}\n\n.Button--invisible {\n color: var(--color-btn-text);\n\n &:hover:not(:disabled) {\n background-color: var(--color-action-list-item-default-hover-bg);\n }\n\n &[aria-pressed='true'],\n &:active:not(:disabled) {\n background-color: var(--color-action-list-item-default-active-bg);\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n color: var(--color-primer-fg-disabled);\n background-color: var(--color-btn-bg);\n border-color: var(--color-btn-border);\n fill: var(--color-primer-fg-disabled);\n }\n\n /* if button has no visuals, use link blue for text */\n &.Button--invisible-noVisuals .Button-label {\n color: var(--color-accent-fg);\n }\n\n & .Button-visual {\n color: var(--color-fg-muted);\n\n & .Counter {\n color: var(--color-fg-default);\n }\n }\n}\n\n.Button--link {\n color: var(--color-accent-fg);\n fill: var(--color-accent-fg);\n display: inline-block;\n font-size: inherit;\n border: none;\n height: unset;\n padding: 0;\n\n &:hover:not(:disabled) {\n text-decoration: underline;\n }\n\n &:focus-visible,\n &:focus {\n outline-offset: 2px;\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n color: var(--color-primer-fg-disabled);\n background-color: transparent;\n border-color: transparent;\n fill: var(--color-primer-fg-disabled);\n }\n}\n\n/* danger */\n.Button--danger {\n color: var(--color-btn-danger-text);\n fill: var(--color-btn-danger-icon);\n background-color: var(--color-btn-bg);\n border-color: var(--color-btn-border);\n box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);\n\n &:hover:not(:disabled) {\n color: var(--color-btn-danger-hover-text);\n fill: var(--color-btn-danger-hover-text);\n background-color: var(--color-btn-danger-hover-bg);\n border-color: var(--color-btn-danger-hover-border);\n box-shadow: var(--color-btn-danger-hover-shadow), var(--color-btn-danger-hover-inset-shadow);\n }\n\n &:active:not(:disabled),\n &[aria-pressed='true'] {\n color: var(--color-btn-danger-selected-text);\n fill: var(--color-btn-danger-selected-text);\n background-color: var(--color-btn-danger-selected-bg);\n border-color: var(--color-btn-danger-selected-border);\n box-shadow: var(--color-btn-danger-selected-shadow);\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n color: var(--color-btn-danger-disabled-text);\n fill: var(--color-btn-danger-disabled-text);\n background-color: var(--color-btn-danger-disabled-bg);\n border-color: var(--color-btn-border);\n }\n}\n\n.Button--iconOnly {\n display: inline-grid;\n place-content: center;\n padding: unset;\n width: var(--control-medium-size, 32px);\n\n &.Button--small {\n width: var(--control-small-size, 28px);\n }\n\n &.Button--large {\n width: var(--control-large-size, 40px);\n }\n}\n",null,"/* outline with fg box-shadow for buttons */\n@define-mixin focusOutlineOnEmphasis $outlineOffset: -2px, $outlineColor: var(--color-accent-fg) {\n outline: 2px solid $outlineColor;\n outline-offset: $outlineOffset;\n box-shadow: inset 0 0 0 3px var(--color-fg-on-emphasis);\n}\n"]}
|
1
|
+
{"version":3,"sources":["button.pcss","<no source>","../../../../lib/postcss_mixins/focusOutlineOnEmphasis.pcss"],"names":[],"mappings":"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","file":"button.css","sourcesContent":["/* CSS for Button */\n\n/* temporary, pre primitives release */\n:root {\n --duration-fast: 80ms;\n --easing-easeInOut: cubic-bezier(0.65, 0, 0.35, 1);\n}\n\n/* base button */\n.Button {\n position: relative;\n font-size: var(--text-body-size-medium);\n font-weight: var(--base-text-weight-medium);\n cursor: pointer;\n user-select: none;\n background-color: transparent;\n border: var(--borderWidth-thin) solid;\n border-color: transparent;\n border-radius: var(--borderRadius-medium);\n color: var(--color-btn-text);\n transition: var(--duration-fast) var(--easing-easeInOut);\n transition-property: color, fill, background-color, border-color;\n text-align: center;\n height: var(--control-medium-size);\n padding: 0 var(--control-medium-paddingInline-normal);\n display: inline-flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n gap: var(--base-size-4);\n min-width: max-content;\n\n /* mobile friendly sizing */\n @media (pointer: coarse) {\n &::before {\n @mixin minTouchTarget 48px, 48px;\n }\n }\n\n /* base states */\n\n &:hover {\n transition-duration: var(--duration-fast);\n }\n\n &:active {\n transition: none;\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n cursor: not-allowed;\n box-shadow: none;\n }\n}\n\n.Button-withTooltip {\n position: relative;\n display: inline-block;\n}\n\na.Button,\nsummary.Button {\n &:hover {\n text-decoration: none;\n }\n}\n\n/* wrap grid content to allow trailingAction to lock-right */\n.Button-content {\n flex: 1 0 auto;\n display: grid;\n grid-template-areas: 'leadingVisual text trailingVisual';\n grid-template-columns: min-content minmax(0, auto) min-content;\n align-items: center;\n place-content: center;\n\n /* padding-bottom: 1px; optical alignment for firefox */\n\n & > :not(:last-child) {\n margin-right: var(--control-medium-gap);\n }\n}\n\n/* center child elements for fullWidth */\n.Button-content--alignStart {\n justify-content: start;\n}\n\n/* button child elements */\n\n/* align svg */\n.Button-visual {\n display: flex;\n pointer-events: none; /* allow click handler to work, avoiding visuals */\n\n & .Counter {\n color: inherit;\n background-color: var(--color-btn-counter-bg);\n }\n}\n\n.Button-label {\n grid-area: text;\n white-space: nowrap;\n line-height: var(--text-body-lineHeight-medium);\n}\n\n.Button-leadingVisual {\n grid-area: leadingVisual;\n}\n\n.Button-trailingVisual {\n grid-area: trailingVisual;\n}\n\n.Button-trailingAction {\n margin-right: calc(var(--base-size-4) * -1);\n}\n\n/* sizes */\n\n.Button--small {\n font-size: var(--text-body-size-small);\n height: var(--control-small-size);\n padding: 0 var(--control-small-paddingInline-condensed);\n gap: var(--control-small-gap);\n\n & .Button-label {\n line-height: var(--text-body-lineHeight-small);\n }\n\n & .Button-content {\n & > :not(:last-child) {\n margin-right: var(--control-small-gap);\n }\n }\n}\n\n.Button--large {\n height: var(--control-large-size);\n padding: 0 var(--control-large-paddingInline-spacious);\n gap: var(--control-large-gap);\n\n & .Button-label {\n line-height: var(--text-body-lineHeight-large);\n }\n\n & .Button-content {\n & > :not(:last-child) {\n margin-right: var(--control-large-gap);\n }\n }\n}\n\n.Button--fullWidth {\n width: 100%;\n}\n\n/* variants */\n\n/* primary */\n.Button--primary {\n color: var(--color-btn-primary-text);\n fill: var(--color-btn-primary-icon);\n background-color: var(--color-btn-primary-bg);\n border-color: var(--color-btn-primary-border);\n box-shadow: var(--color-btn-primary-shadow), var(--color-btn-primary-inset-shadow);\n\n &:hover:not(:disabled) {\n background-color: var(--color-btn-primary-hover-bg);\n border-color: var(--color-btn-primary-hover-border);\n }\n\n /* fallback :focus state */\n &:focus {\n @mixin focusOutlineOnEmphasis;\n\n /* remove fallback :focus if :focus-visible is supported */\n &:not(:focus-visible) {\n outline: solid 1px transparent;\n box-shadow: none;\n }\n }\n\n /* default focus state */\n &:focus-visible {\n @mixin focusOutlineOnEmphasis;\n }\n\n &:active:not(:disabled),\n &[aria-pressed='true'] {\n background-color: var(--color-btn-primary-selected-bg);\n box-shadow: var(--color-btn-primary-selected-shadow);\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n color: var(--color-btn-primary-disabled-text);\n background-color: var(--color-btn-primary-disabled-bg);\n border-color: var(--color-btn-primary-disabled-border);\n fill: var(--color-btn-primary-disabled-text);\n }\n\n & .Counter {\n color: inherit;\n background-color: var(--color-btn-primary-counter-bg);\n }\n}\n\n/* default (secondary) */\n.Button--secondary {\n color: var(--color-btn-text);\n fill: var(--color-fg-muted); /* help this */\n background-color: var(--color-btn-bg);\n border-color: var(--color-btn-border);\n box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);\n\n &:hover:not(:disabled) {\n background-color: var(--color-btn-hover-bg);\n border-color: var(--color-btn-hover-border);\n }\n\n &:active:not(:disabled) {\n background-color: var(--color-btn-active-bg);\n border-color: var(--color-btn-active-border);\n }\n\n &[aria-pressed='true'] {\n background-color: var(--color-btn-selected-bg);\n box-shadow: var(--color-primer-shadow-inset);\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n color: var(--color-primer-fg-disabled);\n background-color: var(--color-btn-bg);\n border-color: var(--color-btn-border);\n fill: var(--color-primer-fg-disabled);\n }\n}\n\n.Button--invisible {\n color: var(--color-btn-text);\n\n &:hover:not(:disabled) {\n background-color: var(--color-action-list-item-default-hover-bg);\n }\n\n &[aria-pressed='true'],\n &:active:not(:disabled) {\n background-color: var(--color-action-list-item-default-active-bg);\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n color: var(--color-primer-fg-disabled);\n background-color: var(--color-btn-bg);\n border-color: var(--color-btn-border);\n fill: var(--color-primer-fg-disabled);\n }\n\n /* if button has no visuals, use link blue for text */\n &.Button--invisible-noVisuals .Button-label {\n color: var(--color-accent-fg);\n }\n\n & .Button-visual {\n color: var(--color-fg-muted);\n\n & .Counter {\n color: var(--color-fg-default);\n }\n }\n}\n\n.Button--link {\n color: var(--color-accent-fg);\n fill: var(--color-accent-fg);\n display: inline-block;\n font-size: inherit;\n border: none;\n height: unset;\n padding: 0;\n\n &:hover:not(:disabled) {\n text-decoration: underline;\n }\n\n &:focus-visible,\n &:focus {\n outline-offset: 2px;\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n color: var(--color-primer-fg-disabled);\n background-color: transparent;\n border-color: transparent;\n fill: var(--color-primer-fg-disabled);\n }\n}\n\n/* danger */\n.Button--danger {\n color: var(--color-btn-danger-text);\n fill: var(--color-btn-danger-icon);\n background-color: var(--color-btn-bg);\n border-color: var(--color-btn-border);\n box-shadow: var(--color-btn-shadow), var(--color-btn-inset-shadow);\n\n &:hover:not(:disabled) {\n color: var(--color-btn-danger-hover-text);\n fill: var(--color-btn-danger-hover-text);\n background-color: var(--color-btn-danger-hover-bg);\n border-color: var(--color-btn-danger-hover-border);\n box-shadow: var(--color-btn-danger-hover-shadow), var(--color-btn-danger-hover-inset-shadow);\n\n & .Counter {\n color: var(--color-btn-danger-hover-counter-fg);\n background-color: var(--color-btn-danger-hover-counter-bg);\n }\n }\n\n &:active:not(:disabled),\n &[aria-pressed='true'] {\n color: var(--color-btn-danger-selected-text);\n fill: var(--color-btn-danger-selected-text);\n background-color: var(--color-btn-danger-selected-bg);\n border-color: var(--color-btn-danger-selected-border);\n box-shadow: var(--color-btn-danger-selected-shadow);\n }\n\n &:disabled,\n &[aria-disabled='true'] {\n color: var(--color-btn-danger-disabled-text);\n fill: var(--color-btn-danger-disabled-text);\n background-color: var(--color-btn-danger-disabled-bg);\n border-color: var(--color-btn-border);\n\n & .Counter {\n color: var(--color-btn-danger-disabled-counter-fg);\n background-color: var(--color-btn-danger-disabled-counter-bg);\n }\n }\n\n & .Counter {\n color: var(--color-btn-danger-counter-fg);\n background-color: var(--color-btn-danger-counter-bg);\n }\n}\n\n.Button--iconOnly {\n display: inline-grid;\n place-content: center;\n padding: unset;\n width: var(--control-medium-size);\n\n &.Button--small {\n width: var(--control-small-size);\n }\n\n &.Button--large {\n width: var(--control-large-size);\n }\n}\n",null,"/* outline with fg box-shadow for buttons */\n@define-mixin focusOutlineOnEmphasis $outlineOffset: -2px, $outlineColor: var(--color-accent-fg) {\n outline: 2px solid $outlineColor;\n outline-offset: $outlineOffset;\n box-shadow: inset 0 0 0 3px var(--color-fg-on-emphasis);\n}\n"]}
|
@@ -9,25 +9,25 @@
|
|
9
9
|
/* base button */
|
10
10
|
.Button {
|
11
11
|
position: relative;
|
12
|
-
font-size: var(--text-body-size-medium
|
13
|
-
font-weight: var(--base-text-weight-medium
|
12
|
+
font-size: var(--text-body-size-medium);
|
13
|
+
font-weight: var(--base-text-weight-medium);
|
14
14
|
cursor: pointer;
|
15
15
|
user-select: none;
|
16
16
|
background-color: transparent;
|
17
|
-
border: var(--borderWidth-thin
|
17
|
+
border: var(--borderWidth-thin) solid;
|
18
18
|
border-color: transparent;
|
19
|
-
border-radius: var(--borderRadius-medium
|
19
|
+
border-radius: var(--borderRadius-medium);
|
20
20
|
color: var(--color-btn-text);
|
21
21
|
transition: var(--duration-fast) var(--easing-easeInOut);
|
22
22
|
transition-property: color, fill, background-color, border-color;
|
23
23
|
text-align: center;
|
24
|
-
height: var(--control-medium-size
|
25
|
-
padding: 0 var(--control-medium-paddingInline-normal
|
24
|
+
height: var(--control-medium-size);
|
25
|
+
padding: 0 var(--control-medium-paddingInline-normal);
|
26
26
|
display: inline-flex;
|
27
27
|
flex-direction: row;
|
28
28
|
justify-content: space-between;
|
29
29
|
align-items: center;
|
30
|
-
gap: var(--base-size-4
|
30
|
+
gap: var(--base-size-4);
|
31
31
|
min-width: max-content;
|
32
32
|
|
33
33
|
/* mobile friendly sizing */
|
@@ -78,7 +78,7 @@ summary.Button {
|
|
78
78
|
/* padding-bottom: 1px; optical alignment for firefox */
|
79
79
|
|
80
80
|
& > :not(:last-child) {
|
81
|
-
margin-right: var(--control-medium-gap
|
81
|
+
margin-right: var(--control-medium-gap);
|
82
82
|
}
|
83
83
|
}
|
84
84
|
|
@@ -103,7 +103,7 @@ summary.Button {
|
|
103
103
|
.Button-label {
|
104
104
|
grid-area: text;
|
105
105
|
white-space: nowrap;
|
106
|
-
line-height: var(--text-body-lineHeight-medium
|
106
|
+
line-height: var(--text-body-lineHeight-medium);
|
107
107
|
}
|
108
108
|
|
109
109
|
.Button-leadingVisual {
|
@@ -115,40 +115,40 @@ summary.Button {
|
|
115
115
|
}
|
116
116
|
|
117
117
|
.Button-trailingAction {
|
118
|
-
margin-right: calc(var(--base-size-4
|
118
|
+
margin-right: calc(var(--base-size-4) * -1);
|
119
119
|
}
|
120
120
|
|
121
121
|
/* sizes */
|
122
122
|
|
123
123
|
.Button--small {
|
124
|
-
font-size: var(--text-body-size-small
|
125
|
-
height: var(--control-small-size
|
126
|
-
padding: 0 var(--control-small-paddingInline-condensed
|
127
|
-
gap: var(--control-small-gap
|
124
|
+
font-size: var(--text-body-size-small);
|
125
|
+
height: var(--control-small-size);
|
126
|
+
padding: 0 var(--control-small-paddingInline-condensed);
|
127
|
+
gap: var(--control-small-gap);
|
128
128
|
|
129
129
|
& .Button-label {
|
130
|
-
line-height: var(--text-body-lineHeight-small
|
130
|
+
line-height: var(--text-body-lineHeight-small);
|
131
131
|
}
|
132
132
|
|
133
133
|
& .Button-content {
|
134
134
|
& > :not(:last-child) {
|
135
|
-
margin-right: var(--control-small-gap
|
135
|
+
margin-right: var(--control-small-gap);
|
136
136
|
}
|
137
137
|
}
|
138
138
|
}
|
139
139
|
|
140
140
|
.Button--large {
|
141
|
-
height: var(--control-large-size
|
142
|
-
padding: 0 var(--control-large-paddingInline-spacious
|
143
|
-
gap: var(--control-large-gap
|
141
|
+
height: var(--control-large-size);
|
142
|
+
padding: 0 var(--control-large-paddingInline-spacious);
|
143
|
+
gap: var(--control-large-gap);
|
144
144
|
|
145
145
|
& .Button-label {
|
146
|
-
line-height: var(--text-body-lineHeight-large
|
146
|
+
line-height: var(--text-body-lineHeight-large);
|
147
147
|
}
|
148
148
|
|
149
149
|
& .Button-content {
|
150
150
|
& > :not(:last-child) {
|
151
|
-
margin-right: var(--control-large-gap
|
151
|
+
margin-right: var(--control-large-gap);
|
152
152
|
}
|
153
153
|
}
|
154
154
|
}
|
@@ -315,6 +315,11 @@ summary.Button {
|
|
315
315
|
background-color: var(--color-btn-danger-hover-bg);
|
316
316
|
border-color: var(--color-btn-danger-hover-border);
|
317
317
|
box-shadow: var(--color-btn-danger-hover-shadow), var(--color-btn-danger-hover-inset-shadow);
|
318
|
+
|
319
|
+
& .Counter {
|
320
|
+
color: var(--color-btn-danger-hover-counter-fg);
|
321
|
+
background-color: var(--color-btn-danger-hover-counter-bg);
|
322
|
+
}
|
318
323
|
}
|
319
324
|
|
320
325
|
&:active:not(:disabled),
|
@@ -332,6 +337,16 @@ summary.Button {
|
|
332
337
|
fill: var(--color-btn-danger-disabled-text);
|
333
338
|
background-color: var(--color-btn-danger-disabled-bg);
|
334
339
|
border-color: var(--color-btn-border);
|
340
|
+
|
341
|
+
& .Counter {
|
342
|
+
color: var(--color-btn-danger-disabled-counter-fg);
|
343
|
+
background-color: var(--color-btn-danger-disabled-counter-bg);
|
344
|
+
}
|
345
|
+
}
|
346
|
+
|
347
|
+
& .Counter {
|
348
|
+
color: var(--color-btn-danger-counter-fg);
|
349
|
+
background-color: var(--color-btn-danger-counter-bg);
|
335
350
|
}
|
336
351
|
}
|
337
352
|
|
@@ -339,13 +354,13 @@ summary.Button {
|
|
339
354
|
display: inline-grid;
|
340
355
|
place-content: center;
|
341
356
|
padding: unset;
|
342
|
-
width: var(--control-medium-size
|
357
|
+
width: var(--control-medium-size);
|
343
358
|
|
344
359
|
&.Button--small {
|
345
|
-
width: var(--control-small-size
|
360
|
+
width: var(--control-small-size);
|
346
361
|
}
|
347
362
|
|
348
363
|
&.Button--large {
|
349
|
-
width: var(--control-large-size
|
364
|
+
width: var(--control-large-size);
|
350
365
|
}
|
351
366
|
}
|
@@ -135,18 +135,21 @@ module Primer
|
|
135
135
|
# @param align_content [Symbol] <%= one_of(Primer::Beta::Button::ALIGN_CONTENT_OPTIONS) %>
|
136
136
|
# @param tag [Symbol] (Primer::Beta::BaseButton::DEFAULT_TAG) <%= one_of(Primer::Beta::BaseButton::TAG_OPTIONS) %>
|
137
137
|
# @param type [Symbol] (Primer::Beta::BaseButton::DEFAULT_TYPE) <%= one_of(Primer::Beta::BaseButton::TYPE_OPTIONS) %>
|
138
|
+
# @param disabled [Boolean] Whether or not the button is disabled. If true, this option forces `tag:` to `:button`.
|
138
139
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
139
140
|
def initialize(
|
140
141
|
scheme: DEFAULT_SCHEME,
|
141
142
|
size: DEFAULT_SIZE,
|
142
143
|
block: false,
|
143
144
|
align_content: DEFAULT_ALIGN_CONTENT,
|
145
|
+
disabled: false,
|
144
146
|
**system_arguments
|
145
147
|
)
|
146
148
|
@scheme = scheme
|
147
149
|
@block = block
|
148
150
|
|
149
151
|
@system_arguments = system_arguments
|
152
|
+
@system_arguments[:disabled] = disabled
|
150
153
|
|
151
154
|
@id = @system_arguments[:id]
|
152
155
|
|
@@ -0,0 +1 @@
|
|
1
|
+
.ButtonGroup{display:inline-flex}.ButtonGroup .Button{border-radius:0;margin-inline-end:-1px;position:relative}.ButtonGroup .Button:active,.ButtonGroup .Button:focus,.ButtonGroup .Button:hover{z-index:1}.ButtonGroup>.Button-withTooltip:first-child .Button,.ButtonGroup>:first-child{border-bottom-left-radius:var(--borderRadius-medium,6px);border-top-left-radius:var(--borderRadius-medium,6px)}.ButtonGroup>.Button-withTooltip:last-child .Button,.ButtonGroup>:last-child{border-bottom-right-radius:var(--borderRadius-medium,6px);border-top-right-radius:var(--borderRadius-medium,6px)}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"name": "beta/button_group",
|
3
|
+
"selectors": [
|
4
|
+
".ButtonGroup",
|
5
|
+
".ButtonGroup .Button",
|
6
|
+
".ButtonGroup .Button:active",
|
7
|
+
".ButtonGroup .Button:focus",
|
8
|
+
".ButtonGroup .Button:hover",
|
9
|
+
".ButtonGroup>.Button-withTooltip:first-child .Button",
|
10
|
+
".ButtonGroup>:first-child",
|
11
|
+
".ButtonGroup>.Button-withTooltip:last-child .Button",
|
12
|
+
".ButtonGroup>:last-child"
|
13
|
+
]
|
14
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["button_group.pcss"],"names":[],"mappings":"AAAA,aACE,mBAyBF,CAvBE,qBAGE,eAAgB,CAFhB,sBAAuB,CACvB,iBAQF,CALE,kFAGE,SACF,CAGF,+EAGE,wDAAqD,CADrD,qDAEF,CAEA,6EAGE,yDAAsD,CADtD,sDAEF","file":"button_group.css","sourcesContent":[".ButtonGroup {\n display: inline-flex;\n\n & .Button {\n margin-inline-end: -1px;\n position: relative;\n border-radius: 0;\n\n &:focus,\n &:active,\n &:hover {\n z-index: 1;\n }\n }\n\n & > :first-child,\n & > :first-child.Button-withTooltip .Button {\n border-top-left-radius: var(--borderRadius-medium);\n border-bottom-left-radius: var(--borderRadius-medium);\n }\n\n & > :last-child,\n & > :last-child.Button-withTooltip .Button {\n border-top-right-radius: var(--borderRadius-medium);\n border-bottom-right-radius: var(--borderRadius-medium);\n }\n}\n"]}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
.ButtonGroup {
|
2
|
+
display: inline-flex;
|
3
|
+
|
4
|
+
& .Button {
|
5
|
+
margin-inline-end: -1px;
|
6
|
+
position: relative;
|
7
|
+
border-radius: 0;
|
8
|
+
|
9
|
+
&:focus,
|
10
|
+
&:active,
|
11
|
+
&:hover {
|
12
|
+
z-index: 1;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
& > :first-child,
|
17
|
+
& > :first-child.Button-withTooltip .Button {
|
18
|
+
border-top-left-radius: var(--borderRadius-medium);
|
19
|
+
border-bottom-left-radius: var(--borderRadius-medium);
|
20
|
+
}
|
21
|
+
|
22
|
+
& > :last-child,
|
23
|
+
& > :last-child.Button-withTooltip .Button {
|
24
|
+
border-top-right-radius: var(--borderRadius-medium);
|
25
|
+
border-bottom-right-radius: var(--borderRadius-medium);
|
26
|
+
}
|
27
|
+
}
|
@@ -8,45 +8,45 @@ module Primer
|
|
8
8
|
|
9
9
|
# Required list of buttons to be rendered.
|
10
10
|
#
|
11
|
-
# @param kwargs [Hash] The same arguments as <%= link_to_component(Primer::
|
11
|
+
# @param kwargs [Hash] The same arguments as <%= link_to_component(Primer::Beta::Button) %>
|
12
12
|
renders_many :buttons, lambda { |**kwargs|
|
13
|
-
kwargs[:group_item] = true
|
14
13
|
kwargs[:size] = @size
|
14
|
+
kwargs[:scheme] = @scheme
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
if kwargs[:icon]
|
17
|
+
Primer::Beta::IconButton.new(**kwargs)
|
18
|
+
else
|
19
|
+
Primer::Beta::Button.new(**kwargs)
|
20
|
+
end
|
19
21
|
}
|
20
22
|
|
21
23
|
# @example Default
|
22
24
|
#
|
23
25
|
# <%= render(Primer::Beta::ButtonGroup.new) do |component| %>
|
24
|
-
# <% component.with_button { "
|
25
|
-
# <% component.with_button
|
26
|
-
# <% component.with_button
|
27
|
-
# <% component.with_button(scheme: :outline) { "Outline" } %>
|
28
|
-
# <% component.with_button(classes: "custom-class") { "Custom class" } %>
|
26
|
+
# <% component.with_button { "Button 1" } %>
|
27
|
+
# <% component.with_button { "Button 2" } %>
|
28
|
+
# <% component.with_button { "Button 3" } %>
|
29
29
|
# <% end %>
|
30
30
|
#
|
31
31
|
# @example Sizes
|
32
32
|
#
|
33
33
|
# <%= render(Primer::Beta::ButtonGroup.new(size: :small)) do |component| %>
|
34
|
-
# <% component.with_button { "
|
35
|
-
# <% component.with_button
|
36
|
-
# <% component.with_button
|
37
|
-
# <% component.with_button(scheme: :outline) { "Outline" } %>
|
34
|
+
# <% component.with_button { "Button 1" } %>
|
35
|
+
# <% component.with_button { "Button 2" } %>
|
36
|
+
# <% component.with_button { "Button 3" } %>
|
38
37
|
# <% end %>
|
39
38
|
#
|
40
|
-
# @param
|
41
|
-
# @param size [Symbol] <%= one_of(Primer::
|
39
|
+
# @param scheme [Symbol] DEPRECATED. <%= one_of(Primer::Beta::Button::SCHEME_OPTIONS) %>
|
40
|
+
# @param size [Symbol] <%= one_of(Primer::Beta::Button::SIZE_OPTIONS) %>
|
42
41
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
43
|
-
def initialize(
|
44
|
-
@size =
|
42
|
+
def initialize(scheme: Primer::Beta::Button::DEFAULT_SCHEME, size: Primer::Beta::Button::DEFAULT_SIZE, **system_arguments)
|
43
|
+
@size = size
|
44
|
+
@scheme = scheme
|
45
45
|
@system_arguments = deny_tag_argument(**system_arguments)
|
46
46
|
@system_arguments[:tag] = :div
|
47
47
|
|
48
48
|
@system_arguments[:classes] = class_names(
|
49
|
-
"
|
49
|
+
"ButtonGroup",
|
50
50
|
system_arguments[:classes]
|
51
51
|
)
|
52
52
|
end
|
@@ -18,8 +18,9 @@ module Primer
|
|
18
18
|
# <%= render(Primer::Beta::CloseButton.new) %>
|
19
19
|
#
|
20
20
|
# @param type [Symbol] <%= one_of(Primer::Beta::CloseButton::TYPE_OPTIONS) %>
|
21
|
+
# @param disabled [Boolean] Whether or not the button is disabled.
|
21
22
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
22
|
-
def initialize(type: DEFAULT_TYPE, **system_arguments)
|
23
|
+
def initialize(type: DEFAULT_TYPE, disabled: false, **system_arguments)
|
23
24
|
@system_arguments = deny_tag_argument(**system_arguments)
|
24
25
|
@system_arguments[:tag] = :button
|
25
26
|
@system_arguments[:block] = false
|
@@ -29,6 +30,7 @@ module Primer
|
|
29
30
|
system_arguments[:classes]
|
30
31
|
)
|
31
32
|
@system_arguments[:"aria-label"] = aria("label", system_arguments) || "Close"
|
33
|
+
@system_arguments[:disabled] = disabled
|
32
34
|
end
|
33
35
|
|
34
36
|
def call
|
@@ -1 +1 @@
|
|
1
|
-
.Counter{background-color:var(--color-neutral-muted);border:var(--borderWidth-thin,1px) solid var(--color-counter-border);border-radius:2em;color:var(--color-fg-default);display:inline-block;font-size:var(--text-body-size-small
|
1
|
+
.Counter{background-color:var(--color-neutral-muted);border:var(--borderWidth-thin,max(1px,.0625rem)) solid var(--color-counter-border);border-radius:2em;color:var(--color-fg-default);display:inline-block;font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-medium,500);line-height:calc(var(--base-size-20,1.25rem) - var(--borderWidth-thin,max(1px, .0625rem))*2);min-width:var(--base-size-20,1.25rem);padding:0 6px;text-align:center}.Counter:empty{display:none}.Counter .octicon{opacity:.8;vertical-align:text-top}.Counter--primary{background-color:var(--color-neutral-emphasis);color:var(--color-fg-on-emphasis)}.Counter--secondary{background-color:var(--color-neutral-subtle);color:var(--color-fg-muted)}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["counter.pcss"],"names":[],"mappings":"AAEA,SASE,2CAA4C,CAC5C,
|
1
|
+
{"version":3,"sources":["counter.pcss"],"names":[],"mappings":"AAEA,SASE,2CAA4C,CAC5C,kFAAiE,CACjE,iBAAkB,CAJlB,6BAA8B,CAN9B,oBAAqB,CAGrB,4CAAsC,CACtC,8CAA2C,CAC3C,4FAAoE,CAJpE,qCAA8B,CAC9B,aAAc,CAKd,iBAcF,CATE,eACE,YACF,CAGA,kBAEE,UAAY,CADZ,uBAEF,CAGF,kBAEE,8CAA+C,CAD/C,iCAEF,CAEA,oBAEE,4CAA6C,CAD7C,2BAEF","file":"counter.css","sourcesContent":["/* Counter */\n\n.Counter {\n display: inline-block;\n min-width: var(--base-size-20); /* makes sure it's a circle with just one digit */\n padding: 0 6px;\n font-size: var(--text-body-size-small);\n font-weight: var(--base-text-weight-medium);\n line-height: calc(var(--base-size-20) - var(--borderWidth-thin) * 2); /* 20px - 2px for the borders */\n color: var(--color-fg-default);\n text-align: center;\n background-color: var(--color-neutral-muted);\n border: var(--borderWidth-thin) solid var(--color-counter-border);\n border-radius: 2em;\n\n &:empty {\n display: none;\n }\n\n /* Is this selector used? could not find any use of it */\n & .octicon {\n vertical-align: text-top;\n opacity: 0.8;\n }\n}\n\n.Counter--primary {\n color: var(--color-fg-on-emphasis);\n background-color: var(--color-neutral-emphasis);\n}\n\n.Counter--secondary {\n color: var(--color-fg-muted);\n background-color: var(--color-neutral-subtle);\n}\n"]}
|
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
.Counter {
|
4
4
|
display: inline-block;
|
5
|
-
min-width: var(--base-size-20
|
5
|
+
min-width: var(--base-size-20); /* makes sure it's a circle with just one digit */
|
6
6
|
padding: 0 6px;
|
7
|
-
font-size: var(--text-body-size-small
|
8
|
-
font-weight: var(--base-text-weight-medium
|
9
|
-
line-height: calc(var(--base-size-20
|
7
|
+
font-size: var(--text-body-size-small);
|
8
|
+
font-weight: var(--base-text-weight-medium);
|
9
|
+
line-height: calc(var(--base-size-20) - var(--borderWidth-thin) * 2); /* 20px - 2px for the borders */
|
10
10
|
color: var(--color-fg-default);
|
11
11
|
text-align: center;
|
12
12
|
background-color: var(--color-neutral-muted);
|
13
|
-
border: var(--borderWidth-thin
|
13
|
+
border: var(--borderWidth-thin) solid var(--color-counter-border);
|
14
14
|
border-radius: 2em;
|
15
15
|
|
16
16
|
&:empty {
|