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
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["menu.pcss"],"names":[],"mappings":"AAIA,MAGE,4CAA6C,CAC7C,
|
1
|
+
{"version":3,"sources":["menu.pcss"],"names":[],"mappings":"AAIA,MAGE,4CAA6C,CAC7C,kFAAiE,CACjE,4CAAyC,CAHzC,eAAgB,CADhB,0CAKF,CAEA,WAKE,uFAAsE,CADtE,6BAA8B,CAF9B,aAAc,CACd,6GAAmG,CAFnG,iBA+EF,CAzEE,uBACE,YAAa,CAEb,sDAKF,CAHE,qDAHA,qDAKA,CAGF,sBACE,eAAgB,CAChB,yDAMF,CAHE,mDAFA,wDAIA,CAGF,iBAEE,4CAA6C,CAD7C,oBAEF,CAEA,kBACE,2CACF,CAEA,sGAIE,4CAA6C,CAD7C,cAYF,CATE,2HAOE,kDAAmD,CAJnD,QAAS,CAGT,UAAW,CAFX,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAGN,SAGF,CAGF,oBAGE,2BAA4B,CAD5B,4CAAuC,CAEvC,iBAAkB,CAHlB,UAIF,CAEA,oBACE,WAAY,CACZ,2CACF,CAEA,yBAEE,+BAAgC,CADhC,WAEF,CAEA,mBACE,UAAW,CACX,4CACF,CAGE,0BACE,4BACF,CAIJ,cAQE,uFAAsE,CADtE,6BAA8B,CAN9B,aAAc,CAId,iBAAkB,CAClB,gDAA6C,CAF7C,eAAgB,CADhB,YAAa,CADb,6GAsBF,CAdE,oBACE,oBACF,CAEA,0BACE,qDAAkD,CAClD,sDACF,CAEA,yBACE,eAAgB,CAEhB,wDAAqD,CADrD,yDAEF","file":"menu.css","sourcesContent":["/* menu */\n\n/* A menu on the side of a page, defaults to left side. e.g. github.com/about */\n\n.menu {\n margin-bottom: var(--stack-gap-normal);\n list-style: none;\n background-color: var(--color-canvas-default);\n border: var(--borderWidth-thin) solid var(--color-border-default);\n border-radius: var(--borderRadius-medium);\n}\n\n.menu-item {\n position: relative;\n display: block;\n padding: var(--control-medium-paddingInline-condensed) var(--control-medium-paddingInline-spacious);\n color: var(--color-fg-default);\n border-bottom: var(--borderWidth-thin) solid var(--color-border-muted);\n\n &:first-child {\n border-top: 0;\n border-top-left-radius: var(--borderRadius-medium);\n border-top-right-radius: var(--borderRadius-medium);\n\n &::before {\n border-top-left-radius: var(--borderRadius-medium);\n }\n }\n\n &:last-child {\n border-bottom: 0;\n border-bottom-right-radius: var(--borderRadius-medium);\n border-bottom-left-radius: var(--borderRadius-medium);\n\n &::before {\n border-bottom-left-radius: var(--borderRadius-medium);\n }\n }\n\n &:hover {\n text-decoration: none;\n background-color: var(--color-neutral-subtle);\n }\n\n &:active {\n background-color: var(--color-canvas-subtle);\n }\n\n &.selected,\n &[aria-selected='true'],\n &[aria-current]:not([aria-current='false']) {\n cursor: default;\n background-color: var(--color-menu-bg-active);\n\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 2px;\n content: '';\n background-color: var(--color-primer-border-active);\n }\n }\n\n & .octicon {\n width: 16px;\n margin-right: var(--control-medium-gap);\n color: var(--color-fg-muted);\n text-align: center;\n }\n\n & .Counter {\n float: right;\n margin-left: var(--control-small-gap);\n }\n\n & .menu-warning {\n float: right;\n color: var(--color-attention-fg);\n }\n\n & .avatar {\n float: left;\n margin-right: var(--control-small-gap);\n }\n\n &.alert {\n & .Counter {\n color: var(--color-danger-fg);\n }\n }\n}\n\n.menu-heading {\n display: block;\n padding: var(--control-medium-paddingInline-condensed) var(--control-medium-paddingInline-spacious);\n margin-top: 0;\n margin-bottom: 0;\n font-size: inherit;\n font-weight: var(--base-text-weight-semibold);\n color: var(--color-fg-default);\n border-bottom: var(--borderWidth-thin) solid var(--color-border-muted);\n\n &:hover {\n text-decoration: none;\n }\n\n &:first-child {\n border-top-left-radius: var(--borderRadius-medium);\n border-top-right-radius: var(--borderRadius-medium);\n }\n\n &:last-child {\n border-bottom: 0;\n border-bottom-right-radius: var(--borderRadius-medium);\n border-bottom-left-radius: var(--borderRadius-medium);\n }\n}\n"]}
|
@@ -3,37 +3,37 @@
|
|
3
3
|
/* A menu on the side of a page, defaults to left side. e.g. github.com/about */
|
4
4
|
|
5
5
|
.menu {
|
6
|
-
margin-bottom: var(--stack-gap-normal
|
6
|
+
margin-bottom: var(--stack-gap-normal);
|
7
7
|
list-style: none;
|
8
8
|
background-color: var(--color-canvas-default);
|
9
|
-
border: var(--borderWidth-thin
|
10
|
-
border-radius: var(--borderRadius-medium
|
9
|
+
border: var(--borderWidth-thin) solid var(--color-border-default);
|
10
|
+
border-radius: var(--borderRadius-medium);
|
11
11
|
}
|
12
12
|
|
13
13
|
.menu-item {
|
14
14
|
position: relative;
|
15
15
|
display: block;
|
16
|
-
padding: var(--control-medium-paddingInline-condensed
|
16
|
+
padding: var(--control-medium-paddingInline-condensed) var(--control-medium-paddingInline-spacious);
|
17
17
|
color: var(--color-fg-default);
|
18
|
-
border-bottom: var(--borderWidth-thin
|
18
|
+
border-bottom: var(--borderWidth-thin) solid var(--color-border-muted);
|
19
19
|
|
20
20
|
&:first-child {
|
21
21
|
border-top: 0;
|
22
|
-
border-top-left-radius: var(--borderRadius-medium
|
23
|
-
border-top-right-radius: var(--borderRadius-medium
|
22
|
+
border-top-left-radius: var(--borderRadius-medium);
|
23
|
+
border-top-right-radius: var(--borderRadius-medium);
|
24
24
|
|
25
25
|
&::before {
|
26
|
-
border-top-left-radius: var(--borderRadius-medium
|
26
|
+
border-top-left-radius: var(--borderRadius-medium);
|
27
27
|
}
|
28
28
|
}
|
29
29
|
|
30
30
|
&:last-child {
|
31
31
|
border-bottom: 0;
|
32
|
-
border-bottom-right-radius: var(--borderRadius-medium
|
33
|
-
border-bottom-left-radius: var(--borderRadius-medium
|
32
|
+
border-bottom-right-radius: var(--borderRadius-medium);
|
33
|
+
border-bottom-left-radius: var(--borderRadius-medium);
|
34
34
|
|
35
35
|
&::before {
|
36
|
-
border-bottom-left-radius: var(--borderRadius-medium
|
36
|
+
border-bottom-left-radius: var(--borderRadius-medium);
|
37
37
|
}
|
38
38
|
}
|
39
39
|
|
@@ -65,14 +65,14 @@
|
|
65
65
|
|
66
66
|
& .octicon {
|
67
67
|
width: 16px;
|
68
|
-
margin-right: var(--control-medium-gap
|
68
|
+
margin-right: var(--control-medium-gap);
|
69
69
|
color: var(--color-fg-muted);
|
70
70
|
text-align: center;
|
71
71
|
}
|
72
72
|
|
73
73
|
& .Counter {
|
74
74
|
float: right;
|
75
|
-
margin-left: var(--control-small-gap
|
75
|
+
margin-left: var(--control-small-gap);
|
76
76
|
}
|
77
77
|
|
78
78
|
& .menu-warning {
|
@@ -82,7 +82,7 @@
|
|
82
82
|
|
83
83
|
& .avatar {
|
84
84
|
float: left;
|
85
|
-
margin-right: var(--control-small-gap
|
85
|
+
margin-right: var(--control-small-gap);
|
86
86
|
}
|
87
87
|
|
88
88
|
&.alert {
|
@@ -94,26 +94,26 @@
|
|
94
94
|
|
95
95
|
.menu-heading {
|
96
96
|
display: block;
|
97
|
-
padding: var(--control-medium-paddingInline-condensed
|
97
|
+
padding: var(--control-medium-paddingInline-condensed) var(--control-medium-paddingInline-spacious);
|
98
98
|
margin-top: 0;
|
99
99
|
margin-bottom: 0;
|
100
100
|
font-size: inherit;
|
101
|
-
font-weight: var(--base-text-weight-semibold
|
101
|
+
font-weight: var(--base-text-weight-semibold);
|
102
102
|
color: var(--color-fg-default);
|
103
|
-
border-bottom: var(--borderWidth-thin
|
103
|
+
border-bottom: var(--borderWidth-thin) solid var(--color-border-muted);
|
104
104
|
|
105
105
|
&:hover {
|
106
106
|
text-decoration: none;
|
107
107
|
}
|
108
108
|
|
109
109
|
&:first-child {
|
110
|
-
border-top-left-radius: var(--borderRadius-medium
|
111
|
-
border-top-right-radius: var(--borderRadius-medium
|
110
|
+
border-top-left-radius: var(--borderRadius-medium);
|
111
|
+
border-top-right-radius: var(--borderRadius-medium);
|
112
112
|
}
|
113
113
|
|
114
114
|
&:last-child {
|
115
115
|
border-bottom: 0;
|
116
|
-
border-bottom-right-radius: var(--borderRadius-medium
|
117
|
-
border-bottom-left-radius: var(--borderRadius-medium
|
116
|
+
border-bottom-right-radius: var(--borderRadius-medium);
|
117
|
+
border-bottom-left-radius: var(--borderRadius-medium);
|
118
118
|
}
|
119
119
|
}
|
@@ -21,7 +21,7 @@ const overlayStack = [];
|
|
21
21
|
function clickHandler(event) {
|
22
22
|
const target = event.target;
|
23
23
|
const button = target === null || target === void 0 ? void 0 : target.closest('button');
|
24
|
-
if (!button)
|
24
|
+
if (!button || button.hasAttribute('disabled') || button.getAttribute('aria-disabled') === 'true')
|
25
25
|
return;
|
26
26
|
// If the user is clicking a valid dialog trigger
|
27
27
|
let dialogId = button === null || button === void 0 ? void 0 : button.getAttribute('data-show-dialog-id');
|
@@ -166,14 +166,21 @@ _ModalDialogElement_focusAbortController = new WeakMap(), _ModalDialogElement_in
|
|
166
166
|
return;
|
167
167
|
if (event.isComposing)
|
168
168
|
return;
|
169
|
+
if (!this.open)
|
170
|
+
return;
|
169
171
|
switch (event.key) {
|
170
172
|
case 'Escape':
|
171
|
-
|
172
|
-
|
173
|
-
|
173
|
+
this.close();
|
174
|
+
event.preventDefault();
|
175
|
+
event.stopPropagation();
|
176
|
+
break;
|
177
|
+
case 'Enter': {
|
178
|
+
const target = event.target;
|
179
|
+
if (target.getAttribute('data-close-dialog-id') === this.id) {
|
174
180
|
event.stopPropagation();
|
175
181
|
}
|
176
182
|
break;
|
183
|
+
}
|
177
184
|
}
|
178
185
|
};
|
179
186
|
if (!window.customElements.get('modal-dialog')) {
|
@@ -13,7 +13,7 @@ function clickHandler(event: Event) {
|
|
13
13
|
const target = event.target as HTMLElement
|
14
14
|
const button = target?.closest('button')
|
15
15
|
|
16
|
-
if (!button) return
|
16
|
+
if (!button || button.hasAttribute('disabled') || button.getAttribute('aria-disabled') === 'true') return
|
17
17
|
|
18
18
|
// If the user is clicking a valid dialog trigger
|
19
19
|
let dialogId = button?.getAttribute('data-show-dialog-id')
|
@@ -167,15 +167,22 @@ export class ModalDialogElement extends HTMLElement {
|
|
167
167
|
#keydown(event: Event) {
|
168
168
|
if (!(event instanceof KeyboardEvent)) return
|
169
169
|
if (event.isComposing) return
|
170
|
+
if (!this.open) return
|
170
171
|
|
171
172
|
switch (event.key) {
|
172
173
|
case 'Escape':
|
173
|
-
|
174
|
-
|
175
|
-
|
174
|
+
this.close()
|
175
|
+
event.preventDefault()
|
176
|
+
event.stopPropagation()
|
177
|
+
break
|
178
|
+
case 'Enter': {
|
179
|
+
const target = event.target as HTMLElement
|
180
|
+
|
181
|
+
if (target.getAttribute('data-close-dialog-id') === this.id) {
|
176
182
|
event.stopPropagation()
|
177
183
|
}
|
178
184
|
break
|
185
|
+
}
|
179
186
|
}
|
180
187
|
}
|
181
188
|
}
|
@@ -203,6 +203,9 @@ _NavListElement_instances = new WeakSet(), _NavListElement_parseHTML = function
|
|
203
203
|
if (currentlySelectedItem)
|
204
204
|
__classPrivateFieldGet(this, _NavListElement_instances, "m", _NavListElement_deselect).call(this, currentlySelectedItem);
|
205
205
|
navItem.classList.add('ActionListItem--navActive');
|
206
|
+
if (navItem.children.length > 0) {
|
207
|
+
navItem.children[0].setAttribute('aria-current', 'page');
|
208
|
+
}
|
206
209
|
const parentMenu = __classPrivateFieldGet(this, _NavListElement_instances, "m", _NavListElement_findParentMenu).call(this, navItem);
|
207
210
|
if (parentMenu) {
|
208
211
|
this.expandItem(parentMenu);
|
@@ -210,6 +213,9 @@ _NavListElement_instances = new WeakSet(), _NavListElement_parseHTML = function
|
|
210
213
|
}
|
211
214
|
}, _NavListElement_deselect = function _NavListElement_deselect(navItem) {
|
212
215
|
navItem.classList.remove('ActionListItem--navActive');
|
216
|
+
if (navItem.children.length > 0) {
|
217
|
+
navItem.children[0].removeAttribute('aria-current');
|
218
|
+
}
|
213
219
|
const parentMenu = __classPrivateFieldGet(this, _NavListElement_instances, "m", _NavListElement_findParentMenu).call(this, navItem);
|
214
220
|
if (parentMenu) {
|
215
221
|
this.collapseItem(parentMenu);
|
@@ -30,43 +30,62 @@ module Primer
|
|
30
30
|
).with_content(title)
|
31
31
|
}
|
32
32
|
|
33
|
-
#
|
33
|
+
# @!parse
|
34
|
+
# # Adds an item to the list.
|
35
|
+
# #
|
36
|
+
# # @param system_arguments [Hash] The arguments accepted by <%= link_to_component(Primer::Alpha::NavList::Item) %>.
|
37
|
+
# def with_group(**system_arguments, &block)
|
38
|
+
# end
|
39
|
+
|
40
|
+
# @!parse
|
41
|
+
# # Adds a group to the list. A group is a list of links and a (required) heading.
|
42
|
+
# #
|
43
|
+
# # @param system_arguments [Hash] The arguments accepted by <%= link_to_component(Primer::Alpha::NavList::Group) %>.
|
44
|
+
# def with_group(**system_arguments, &block)
|
45
|
+
# end
|
46
|
+
|
47
|
+
# @!parse
|
48
|
+
# # Adds a divider to the list. Dividers visually separate items and groups.
|
49
|
+
# #
|
50
|
+
# # @param system_arguments [Hash] The arguments accepted by <%= link_to_component(Primer::Alpha::ActionList::Divider) %>.
|
51
|
+
# def with_divider(**system_arguments, &block)
|
52
|
+
# end
|
53
|
+
|
54
|
+
# Items. Items can be individual items, dividers, or groups. See the documentation for `#with_item`, `#with_divider`, and `#with_group` respectively for more information.
|
34
55
|
#
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
&block
|
69
|
-
)
|
56
|
+
renders_many :items, types: {
|
57
|
+
item: {
|
58
|
+
renders: lambda { |component_klass: Primer::Alpha::NavList::Item, **system_arguments, &block|
|
59
|
+
# dummy group just so we have something to pass as the list: argument below
|
60
|
+
@top_level_group ||= Primer::Alpha::NavList::Group.new(selected_item_id: @selected_item_id)
|
61
|
+
|
62
|
+
component_klass.new(
|
63
|
+
list: @top_level_group,
|
64
|
+
selected_item_id: @selected_item_id,
|
65
|
+
**system_arguments,
|
66
|
+
&block
|
67
|
+
)
|
68
|
+
},
|
69
|
+
|
70
|
+
as: :item
|
71
|
+
},
|
72
|
+
|
73
|
+
divider: {
|
74
|
+
renders: Primer::Alpha::NavList::Divider,
|
75
|
+
as: :divider
|
76
|
+
},
|
77
|
+
|
78
|
+
group: {
|
79
|
+
renders: lambda { |**system_arguments, &block|
|
80
|
+
Primer::Alpha::NavList::Group.new(
|
81
|
+
selected_item_id: @selected_item_id,
|
82
|
+
**system_arguments,
|
83
|
+
&block
|
84
|
+
)
|
85
|
+
},
|
86
|
+
|
87
|
+
as: :group
|
88
|
+
}
|
70
89
|
}
|
71
90
|
|
72
91
|
# @example Items and headings
|
@@ -220,6 +220,10 @@ export class NavListElement extends HTMLElement {
|
|
220
220
|
|
221
221
|
navItem.classList.add('ActionListItem--navActive')
|
222
222
|
|
223
|
+
if (navItem.children.length > 0) {
|
224
|
+
navItem.children[0].setAttribute('aria-current', 'page')
|
225
|
+
}
|
226
|
+
|
223
227
|
const parentMenu = this.#findParentMenu(navItem)
|
224
228
|
|
225
229
|
if (parentMenu) {
|
@@ -231,6 +235,10 @@ export class NavListElement extends HTMLElement {
|
|
231
235
|
#deselect(navItem: HTMLElement) {
|
232
236
|
navItem.classList.remove('ActionListItem--navActive')
|
233
237
|
|
238
|
+
if (navItem.children.length > 0) {
|
239
|
+
navItem.children[0].removeAttribute('aria-current')
|
240
|
+
}
|
241
|
+
|
234
242
|
const parentMenu = this.#findParentMenu(navItem)
|
235
243
|
|
236
244
|
if (parentMenu) {
|
@@ -1 +1 @@
|
|
1
|
-
.Overlay[popover]{border-width:0;min-width:192px;padding:0;position:absolute}.Overlay[popover]:not(
|
1
|
+
.Overlay[popover]{border-width:0;inset:auto;min-width:192px;padding:0;position:absolute}.Overlay[popover]:not(.\:popover-open){display:none}@supports selector(:popover-open){.Overlay[popover]:not(.\:popover-open){display:revert}}@supports selector(:open){.Overlay[popover]:not(.\:popover-open){display:revert}}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["overlay.pcss"],"names":[],"mappings":"AAAA,kBACE,cAAe,
|
1
|
+
{"version":3,"sources":["overlay.pcss"],"names":[],"mappings":"AAAA,kBACE,cAAe,CAIf,UAAW,CADX,eAAgB,CAFhB,SAAU,CACV,iBAGF,CAEA,uCACE,YACF,CAGA,kCACE,uCACE,cACF,CACF,CAGA,0BACE,uCACI,cACJ,CACF","file":"overlay.css","sourcesContent":[".Overlay[popover] {\n border-width: 0;\n padding: 0;\n position: absolute;\n min-width: 192px;\n inset: auto;\n}\n\n.Overlay[popover]:not(.\\:popover-open) {\n display: none;\n}\n\n/* This reverts the declaration above for native popover, where `:popover-open` is supported */\n@supports selector(:popover-open) {\n .Overlay[popover]:not(.\\:popover-open) {\n display: revert;\n }\n}\n\n/* This reverts the declaration above for native popover, where `:open` is supported (Chrome 113, Safari TP) */\n@supports selector(:open) {\n .Overlay[popover]:not(.\\:popover-open) {\n display: revert;\n }\n}\n"]}
|
@@ -3,13 +3,23 @@
|
|
3
3
|
padding: 0;
|
4
4
|
position: absolute;
|
5
5
|
min-width: 192px;
|
6
|
+
inset: auto;
|
6
7
|
}
|
7
8
|
|
8
|
-
|
9
|
-
.Overlay[popover]:not(:popover-open) {
|
9
|
+
.Overlay[popover]:not(.\:popover-open) {
|
10
10
|
display: none;
|
11
11
|
}
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
/* This reverts the declaration above for native popover, where `:popover-open` is supported */
|
14
|
+
@supports selector(:popover-open) {
|
15
|
+
.Overlay[popover]:not(.\:popover-open) {
|
16
|
+
display: revert;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
20
|
+
/* This reverts the declaration above for native popover, where `:open` is supported (Chrome 113, Safari TP) */
|
21
|
+
@supports selector(:open) {
|
22
|
+
.Overlay[popover]:not(.\:popover-open) {
|
23
|
+
display: revert;
|
24
|
+
}
|
15
25
|
}
|
@@ -1 +1 @@
|
|
1
|
-
.SegmentedControl{background-color:var(--color-segmented-control-bg);border-radius:var(--borderRadius-medium,6px);display:inline-flex;list-style:none}.SegmentedControl-item{border:var(--borderWidth-thin,max(1px,.0625rem)) solid #0000;border-radius:var(--borderRadius-medium,6px);display:inline-flex;padding:var(--control-xsmall-paddingInline-condensed
|
1
|
+
.SegmentedControl{background-color:var(--color-segmented-control-bg);border-radius:var(--borderRadius-medium,6px);display:inline-flex;list-style:none}.SegmentedControl-item{border:var(--borderWidth-thin,max(1px,.0625rem)) solid #0000;border-radius:var(--borderRadius-medium,6px);display:inline-flex;padding:var(--control-xsmall-paddingInline-condensed,.25rem);position:relative}.SegmentedControl-item.SegmentedControl-item--selected{background-color:var(--color-segmented-control-button-bg);border-color:var(--color-segmented-control-button-selected-border)}.SegmentedControl-item.SegmentedControl-item--selected .Button{font-weight:var(--base-text-weight-semibold,600)}.SegmentedControl-item.SegmentedControl-item--selected .Button:hover{background-color:initial}.SegmentedControl-item.SegmentedControl-item--selected:before{border-color:#0000!important}.SegmentedControl-item.SegmentedControl-item--selected+.SegmentedControl-item:before{border-color:#0000}.SegmentedControl-item .Button-label[data-content]:before{content:attr(data-content);display:block;font-weight:var(--base-text-weight-semibold,600);height:0;visibility:hidden}.SegmentedControl-item:not(:first-child):before{border-left:var(--borderWidth-thin,max(1px,.0625rem)) solid var(--color-border-default);content:"";inset:0 0 0 -1px;margin-bottom:var(--control-medium-paddingBlock,.375rem);margin-top:var(--control-medium-paddingBlock,.375rem);position:absolute}.SegmentedControl-item .Button{border:0;color:var(--color-btn-text);font-weight:var(--base-text-weight-normal,400);transition:none}.SegmentedControl-item .Button:focus-visible{border-radius:calc(var(--borderRadius-medium,6px) - 5px);outline-offset:calc(var(--control-xsmall-paddingInline-condensed,.25rem) - var(--borderWidth-thin,max(1px, .0625rem)))}.SegmentedControl-item .Button--small{height:calc(var(--control-small-size,1.75rem) - var(--control-xsmall-paddingInline-condensed,.25rem)*2 - var(--borderWidth-thin,max(1px, .0625rem))*2);padding:0 calc(var(--control-small-paddingInline-condensed,.5rem) - var(--control-xsmall-paddingInline-condensed,.25rem))}.SegmentedControl-item .Button--small.Button--iconOnly{width:calc(var(--control-medium-size,2rem) - var(--control-xsmall-paddingInline-condensed,.25rem)*2 - var(--borderWidth-thin,max(1px, .0625rem))*2)}.SegmentedControl-item .Button--small.Button--iconOnly:before{content:"";height:100%;left:50%;min-height:var(--control-medium-size,2rem);min-width:var(--control-medium-size,2rem);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}.SegmentedControl-item .Button--medium{height:calc(var(--control-medium-size,2rem) - var(--control-xsmall-paddingInline-condensed,.25rem)*2 - var(--borderWidth-thin,max(1px, .0625rem))*2);padding:0 calc(var(--control-medium-paddingInline-normal,.75rem) - var(--control-xsmall-paddingInline-condensed,.25rem))}.SegmentedControl-item .Button--medium.Button--iconOnly{width:calc(var(--control-medium-size,2rem) - var(--control-xsmall-paddingInline-condensed,.25rem)*2 - var(--borderWidth-thin,max(1px, .0625rem))*2)}.SegmentedControl-item .Button--medium.Button--iconOnly:before{content:"";height:100%;left:50%;min-height:var(--control-medium-size,2rem);min-width:var(--control-medium-size,2rem);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}.SegmentedControl-item .Button--large{height:calc(var(--control-large-size,2.5rem) - var(--control-xsmall-paddingInline-condensed,.25rem)*2 - var(--borderWidth-thin,max(1px, .0625rem))*2);padding:0 calc(var(--control-large-paddingInline-spacious,1rem) - var(--control-xsmall-paddingInline-condensed,.25rem))}.SegmentedControl-item .Button--large.Button--iconOnly{width:calc(var(--control-large-size,2.5rem) - var(--control-xsmall-paddingInline-condensed,.25rem)*2 - var(--borderWidth-thin,max(1px, .0625rem))*2)}.SegmentedControl-item .Button--large.Button--iconOnly:before{content:"";height:100%;left:50%;min-height:var(--control-large-size,2.5rem);min-width:var(--control-large-size,2.5rem);position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}.SegmentedControl-item .Button--iconOnly{padding:initial}.SegmentedControl-item .Button--invisible.Button--invisible-noVisuals .Button-label{color:var(--color-btn-text)}.SegmentedControl--fullWidth{display:flex}.SegmentedControl--fullWidth .SegmentedControl-item{flex:1;justify-content:center}.SegmentedControl--fullWidth .Button--iconOnly,.SegmentedControl--fullWidth .Button-withTooltip{width:100%}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["segmented_control.pcss","<no source>"],"names":[],"mappings":"AAEA,kBAGE,kDAAmD,CACnD,
|
1
|
+
{"version":3,"sources":["segmented_control.pcss","<no source>"],"names":[],"mappings":"AAEA,kBAGE,kDAAmD,CACnD,4CAAyC,CAHzC,mBAAoB,CACpB,eAGF,CAEA,uBAGE,4DAAiD,CACjD,4CAAyC,CAFzC,mBAAoB,CAGpB,4DAAsD,CAJtD,iBAwHF,CAjHE,uDACE,yDAA0D,CAC1D,kEAiBF,CAfE,+DACE,gDAKF,CAHE,qEACE,wBACF,CAGF,8DACE,4BACF,CAEA,qFACE,kBACF,CAIF,0DAKE,0BAA2B,CAJ3B,aAAc,CAEd,gDAA6C,CAD7C,QAAS,CAET,iBAEF,CAIE,gDAME,uFAAsE,CADtE,UAAW,CAHX,gBAAiB,CAEjB,wDAAiD,CADjD,qDAA8C,CAF9C,iBAMF,CAIF,+BACE,QAAS,CAGT,2BAA4B,CAF5B,8CAA2C,CAC3C,eAOF,CAJE,6CAEE,wDAAqD,CADrD,sHAEF,CAGF,sCACE,sJAEC,CACD,yHAWF,CATE,uDACE,mJAOF,CAFI,8DCpFR,WAAA,YAAA,SAAA,2CAAA,0CAAA,kBAAA,QAAA,4CAAA,UDoFoF,CAKlF,uCACE,oJAEC,CACD,wHAWF,CATE,wDACE,mJAOF,CAFI,+DCrGR,WAAA,YAAA,SAAA,2CAAA,0CAAA,kBAAA,QAAA,4CAAA,UDqGoF,CAKlF,sCACE,qJAEC,CACD,uHAWF,CATE,uDACE,oJAOF,CAFI,8DCtHR,WAAA,YAAA,SAAA,4CAAA,2CAAA,kBAAA,QAAA,4CAAA,UDsHkF,CAKhF,yCACE,eACF,CAEA,oFACE,2BACF,CAIF,6BACE,YAYF,CAVE,oDACE,MAAO,CACP,sBACF,CAGA,gGAEE,UACF","file":"segmented_control.css","sourcesContent":["/* SegmentedControl */\n\n.SegmentedControl {\n display: inline-flex;\n list-style: none;\n background-color: var(--color-segmented-control-bg);\n border-radius: var(--borderRadius-medium);\n}\n\n.SegmentedControl-item {\n position: relative;\n display: inline-flex;\n border: var(--borderWidth-thin) solid transparent;\n border-radius: var(--borderRadius-medium);\n padding: var(--control-xsmall-paddingInline-condensed);\n\n /* Selected ---------------------------------------- */\n &.SegmentedControl-item--selected {\n background-color: var(--color-segmented-control-button-bg);\n border-color: var(--color-segmented-control-button-selected-border);\n\n & .Button {\n font-weight: var(--base-text-weight-semibold);\n\n &:hover {\n background-color: transparent;\n }\n }\n\n &::before {\n border-color: transparent !important;\n }\n\n & + .SegmentedControl-item::before {\n border-color: transparent;\n }\n }\n\n /* renders a visibly hidden \"copy\" of the text in bold, reserving box space for when text becomes bold on selected */\n & .Button-label[data-content]::before {\n display: block;\n height: 0;\n font-weight: var(--base-text-weight-semibold);\n visibility: hidden;\n content: attr(data-content);\n }\n\n /* Separator lines */\n &:not(:first-child) {\n &::before {\n position: absolute;\n inset: 0 0 0 -1px;\n margin-top: var(--control-medium-paddingBlock);\n margin-bottom: var(--control-medium-paddingBlock);\n content: '';\n border-left: var(--borderWidth-thin) solid var(--color-border-default);\n }\n }\n\n /* Button ----------------------------------------- */\n & .Button {\n border: 0;\n font-weight: var(--base-text-weight-normal);\n transition: none;\n color: var(--color-btn-text);\n\n &:focus-visible {\n outline-offset: calc(var(--control-xsmall-paddingInline-condensed) - var(--borderWidth-thin));\n border-radius: calc(var(--borderRadius-medium) - 5px);\n }\n }\n\n & .Button--small {\n height: calc(\n var(--control-small-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2\n );\n padding: 0 calc(var(--control-small-paddingInline-condensed) - var(--control-xsmall-paddingInline-condensed));\n\n &.Button--iconOnly {\n width: calc(\n var(--control-medium-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2\n );\n\n &::before {\n @mixin minTouchTarget var(--control-medium-size), var(--control-medium-size);\n }\n }\n }\n\n & .Button--medium {\n height: calc(\n var(--control-medium-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2\n );\n padding: 0 calc(var(--control-medium-paddingInline-normal) - var(--control-xsmall-paddingInline-condensed));\n\n &.Button--iconOnly {\n width: calc(\n var(--control-medium-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2\n );\n\n &::before {\n @mixin minTouchTarget var(--control-medium-size), var(--control-medium-size);\n }\n }\n }\n\n & .Button--large {\n height: calc(\n var(--control-large-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2\n );\n padding: 0 calc(var(--control-large-paddingInline-spacious) - var(--control-xsmall-paddingInline-condensed));\n\n &.Button--iconOnly {\n width: calc(\n var(--control-large-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2\n );\n\n &::before {\n @mixin minTouchTarget var(--control-large-size), var(--control-large-size);\n }\n }\n }\n\n & .Button--iconOnly {\n padding: initial;\n }\n\n & .Button--invisible.Button--invisible-noVisuals .Button-label {\n color: var(--color-btn-text);\n }\n}\n\n/* fullWidth */\n.SegmentedControl--fullWidth {\n display: flex;\n\n & .SegmentedControl-item {\n flex: 1;\n justify-content: center;\n }\n\n /* is .Button-withTooltip used anywhere? can't find use of it */\n & .Button--iconOnly,\n & .Button-withTooltip {\n width: 100%;\n }\n}\n",null]}
|
@@ -4,15 +4,15 @@
|
|
4
4
|
display: inline-flex;
|
5
5
|
list-style: none;
|
6
6
|
background-color: var(--color-segmented-control-bg);
|
7
|
-
border-radius: var(--borderRadius-medium
|
7
|
+
border-radius: var(--borderRadius-medium);
|
8
8
|
}
|
9
9
|
|
10
10
|
.SegmentedControl-item {
|
11
11
|
position: relative;
|
12
12
|
display: inline-flex;
|
13
|
-
border: var(--borderWidth-thin
|
14
|
-
border-radius: var(--borderRadius-medium
|
15
|
-
padding: var(--control-xsmall-paddingInline-condensed
|
13
|
+
border: var(--borderWidth-thin) solid transparent;
|
14
|
+
border-radius: var(--borderRadius-medium);
|
15
|
+
padding: var(--control-xsmall-paddingInline-condensed);
|
16
16
|
|
17
17
|
/* Selected ---------------------------------------- */
|
18
18
|
&.SegmentedControl-item--selected {
|
@@ -20,7 +20,7 @@
|
|
20
20
|
border-color: var(--color-segmented-control-button-selected-border);
|
21
21
|
|
22
22
|
& .Button {
|
23
|
-
font-weight: var(--base-text-weight-semibold
|
23
|
+
font-weight: var(--base-text-weight-semibold);
|
24
24
|
|
25
25
|
&:hover {
|
26
26
|
background-color: transparent;
|
@@ -40,7 +40,7 @@
|
|
40
40
|
& .Button-label[data-content]::before {
|
41
41
|
display: block;
|
42
42
|
height: 0;
|
43
|
-
font-weight: var(--base-text-weight-semibold
|
43
|
+
font-weight: var(--base-text-weight-semibold);
|
44
44
|
visibility: hidden;
|
45
45
|
content: attr(data-content);
|
46
46
|
}
|
@@ -50,82 +50,73 @@
|
|
50
50
|
&::before {
|
51
51
|
position: absolute;
|
52
52
|
inset: 0 0 0 -1px;
|
53
|
-
margin-top: var(--control-medium-paddingBlock
|
54
|
-
margin-bottom: var(--control-medium-paddingBlock
|
53
|
+
margin-top: var(--control-medium-paddingBlock);
|
54
|
+
margin-bottom: var(--control-medium-paddingBlock);
|
55
55
|
content: '';
|
56
|
-
border-left: var(--borderWidth-thin
|
56
|
+
border-left: var(--borderWidth-thin) solid var(--color-border-default);
|
57
57
|
}
|
58
58
|
}
|
59
59
|
|
60
60
|
/* Button ----------------------------------------- */
|
61
61
|
& .Button {
|
62
62
|
border: 0;
|
63
|
-
font-weight: var(--base-text-weight-normal
|
63
|
+
font-weight: var(--base-text-weight-normal);
|
64
64
|
transition: none;
|
65
65
|
color: var(--color-btn-text);
|
66
66
|
|
67
67
|
&:focus-visible {
|
68
|
-
outline-offset: calc(var(--control-xsmall-paddingInline-condensed
|
69
|
-
border-radius: calc(var(--borderRadius-medium
|
68
|
+
outline-offset: calc(var(--control-xsmall-paddingInline-condensed) - var(--borderWidth-thin));
|
69
|
+
border-radius: calc(var(--borderRadius-medium) - 5px);
|
70
70
|
}
|
71
71
|
}
|
72
72
|
|
73
73
|
& .Button--small {
|
74
74
|
height: calc(
|
75
|
-
var(--control-small-size
|
76
|
-
var(--borderWidth-thin, 1px) * 2
|
75
|
+
var(--control-small-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2
|
77
76
|
);
|
78
|
-
padding: 0
|
79
|
-
calc(var(--control-small-paddingInline-condensed, 8px) - var(--control-xsmall-paddingInline-condensed, 4px));
|
77
|
+
padding: 0 calc(var(--control-small-paddingInline-condensed) - var(--control-xsmall-paddingInline-condensed));
|
80
78
|
|
81
79
|
&.Button--iconOnly {
|
82
80
|
width: calc(
|
83
|
-
var(--control-medium-size
|
84
|
-
var(--borderWidth-thin, 1px) * 2
|
81
|
+
var(--control-medium-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2
|
85
82
|
);
|
86
83
|
|
87
84
|
&::before {
|
88
|
-
@mixin minTouchTarget var(--control-medium-size
|
85
|
+
@mixin minTouchTarget var(--control-medium-size), var(--control-medium-size);
|
89
86
|
}
|
90
87
|
}
|
91
88
|
}
|
92
89
|
|
93
90
|
& .Button--medium {
|
94
91
|
height: calc(
|
95
|
-
var(--control-medium-size
|
96
|
-
var(--borderWidth-thin, 1px) * 2
|
92
|
+
var(--control-medium-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2
|
97
93
|
);
|
98
|
-
padding: 0
|
99
|
-
calc(var(--control-medium-paddingInline-normal, 12px) - var(--control-xsmall-paddingInline-condensed, 4px));
|
94
|
+
padding: 0 calc(var(--control-medium-paddingInline-normal) - var(--control-xsmall-paddingInline-condensed));
|
100
95
|
|
101
96
|
&.Button--iconOnly {
|
102
97
|
width: calc(
|
103
|
-
var(--control-medium-size
|
104
|
-
var(--borderWidth-thin, 1px) * 2
|
98
|
+
var(--control-medium-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2
|
105
99
|
);
|
106
100
|
|
107
101
|
&::before {
|
108
|
-
@mixin minTouchTarget var(--control-medium-size
|
102
|
+
@mixin minTouchTarget var(--control-medium-size), var(--control-medium-size);
|
109
103
|
}
|
110
104
|
}
|
111
105
|
}
|
112
106
|
|
113
107
|
& .Button--large {
|
114
108
|
height: calc(
|
115
|
-
var(--control-large-size
|
116
|
-
var(--borderWidth-thin, 1px) * 2
|
109
|
+
var(--control-large-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2
|
117
110
|
);
|
118
|
-
padding: 0
|
119
|
-
calc(var(--control-large-paddingInline-spacious, 16px) - var(--control-xsmall-paddingInline-condensed, 4px));
|
111
|
+
padding: 0 calc(var(--control-large-paddingInline-spacious) - var(--control-xsmall-paddingInline-condensed));
|
120
112
|
|
121
113
|
&.Button--iconOnly {
|
122
114
|
width: calc(
|
123
|
-
var(--control-large-size
|
124
|
-
var(--borderWidth-thin, 1px) * 2
|
115
|
+
var(--control-large-size) - var(--control-xsmall-paddingInline-condensed) * 2 - var(--borderWidth-thin) * 2
|
125
116
|
);
|
126
117
|
|
127
118
|
&::before {
|
128
|
-
@mixin minTouchTarget var(--control-large-size
|
119
|
+
@mixin minTouchTarget var(--control-large-size), var(--control-large-size);
|
129
120
|
}
|
130
121
|
}
|
131
122
|
}
|
@@ -1 +1 @@
|
|
1
|
-
.tabnav{border-bottom:var(--borderWidth-thin,1px) solid var(--color-border-default);margin-bottom:var(--stack-gap-normal,
|
1
|
+
.tabnav{border-bottom:var(--borderWidth-thin,max(1px,.0625rem)) solid var(--color-border-default);margin-bottom:var(--stack-gap-normal,1rem);margin-top:0}.tabnav-tabs{display:flex;margin-bottom:calc(var(--borderWidth-thin,max(1px, .0625rem))*-1);overflow:auto}.tabnav-tab{background-color:initial;border:var(--borderWidth-thin,max(1px,.0625rem)) solid #0000;border-bottom:0;color:var(--color-fg-muted);display:inline-block;flex-shrink:0;font-size:var(--text-body-size-medium,.875rem);line-height:23px;padding:var(--base-size-8,.5rem) var(--control-medium-paddingInline-spacious,1rem);text-decoration:none;transition:color .2s cubic-bezier(.3,0,.5,1)}.tabnav-tab.selected,.tabnav-tab[aria-current]:not([aria-current=false]),.tabnav-tab[aria-selected=true]{background-color:var(--color-canvas-default);border-color:var(--color-border-default);border-radius:var(--borderRadius-medium,6px) var(--borderRadius-medium,6px) 0 0;color:var(--color-fg-default)}.tabnav-tab.selected .octicon,.tabnav-tab[aria-current]:not([aria-current=false]) .octicon,.tabnav-tab[aria-selected=true] .octicon{color:inherit}.tabnav-tab:hover{color:var(--color-fg-default);text-decoration:none;transition-duration:.1s}.tabnav-tab:focus,.tabnav-tab:focus-visible{border-radius:var(--borderRadius-medium,6px) var(--borderRadius-medium,6px) 0 0!important}.tabnav-tab:focus,.tabnav-tab:focus-visible{outline-offset:-6px}.tabnav-tab .octicon,.tabnav-tab:active{color:var(--color-fg-muted)}.tabnav-tab .octicon{margin-right:var(--control-small-gap,.25rem)}.tabnav-tab .Counter{color:inherit;margin-left:var(--control-small-gap,.25rem)}.tabnav-extra{color:var(--color-fg-muted);display:inline-block;font-size:var(--text-body-size-small,.75rem);margin-left:10px;padding-top:10px}.tabnav-extra>.octicon{margin-right:2px}a.tabnav-extra:hover{color:var(--color-accent-fg);text-decoration:none}.tabnav-btn{margin-left:var(--controlStack-medium-gap-condensed,.5rem)}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["tab_nav.pcss"],"names":[],"mappings":"AAGA,QAGE,
|
1
|
+
{"version":3,"sources":["tab_nav.pcss"],"names":[],"mappings":"AAGA,QAGE,yFAAwE,CADxE,0CAAsC,CADtC,YAGF,CAEA,aACE,YAAa,CACb,iEAAiD,CACjD,aACF,CAEA,YAQE,wBAA6B,CAE7B,4DAAgB,CAAhB,eAAgB,CAJhB,2BAA4B,CAL5B,oBAAqB,CACrB,aAAc,CAEd,8CAAuC,CACvC,gBAAiB,CAFjB,kFAAwE,CAIxE,oBAAqB,CAIrB,4CAwCF,CAtCE,yGAIE,4CAA6C,CAC7C,wCAAyC,CACzC,+EAAwE,CAHxE,6BAQF,CAHE,oIACE,aACF,CAGF,kBACE,6BAA8B,CAC9B,oBAAqB,CACrB,uBACF,CAEA,4CAEE,yFAEF,CAJA,4CAGE,mBACF,CAMA,wCAHE,2BAMF,CAHA,qBACE,4CAEF,CAEA,qBAEE,aAAc,CADd,2CAEF,CAQF,cAKE,2BAA4B,CAJ5B,oBAAqB,CAGrB,4CAAsC,CADtC,gBAAiB,CADjB,gBAQF,CAHE,uBACE,gBACF,CAKF,qBACE,4BAA6B,CAC7B,oBACF,CAOA,YACE,0DACF","file":"tab_nav.css","sourcesContent":["/* tabnav */\n\n/* Outer wrapper */\n.tabnav {\n margin-top: 0;\n margin-bottom: var(--stack-gap-normal);\n border-bottom: var(--borderWidth-thin) solid var(--color-border-default);\n}\n\n.tabnav-tabs {\n display: flex;\n margin-bottom: calc(var(--borderWidth-thin) * -1);\n overflow: auto;\n}\n\n.tabnav-tab {\n display: inline-block;\n flex-shrink: 0;\n padding: var(--base-size-8) var(--control-medium-paddingInline-spacious);\n font-size: var(--text-body-size-medium);\n line-height: 23px;\n color: var(--color-fg-muted);\n text-decoration: none;\n background-color: transparent;\n border: var(--borderWidth-thin) solid transparent;\n border-bottom: 0;\n transition: color 0.2s cubic-bezier(0.3, 0, 0.5, 1);\n\n &.selected,\n &[aria-selected='true'],\n &[aria-current]:not([aria-current='false']) {\n color: var(--color-fg-default);\n background-color: var(--color-canvas-default); /* cover bottom border */\n border-color: var(--color-border-default);\n border-radius: var(--borderRadius-medium) var(--borderRadius-medium) 0 0;\n\n & .octicon {\n color: inherit;\n }\n }\n\n &:hover {\n color: var(--color-fg-default);\n text-decoration: none;\n transition-duration: 0.1s;\n }\n\n &:focus,\n &:focus-visible {\n border-radius: var(--borderRadius-medium) var(--borderRadius-medium) 0 0 !important;\n outline-offset: -6px;\n }\n\n &:active {\n color: var(--color-fg-muted);\n }\n\n & .octicon {\n margin-right: var(--control-small-gap);\n color: var(--color-fg-muted);\n }\n\n & .Counter {\n margin-left: var(--control-small-gap);\n color: inherit;\n }\n}\n\n/* Tabnav extras\n**\n** Tabnav extras are non-tab elements that sit in the tabnav. Usually they're\n** inline text or links. */\n\n.tabnav-extra {\n display: inline-block;\n padding-top: 10px;\n margin-left: 10px;\n font-size: var(--text-body-size-small);\n color: var(--color-fg-muted);\n\n & > .octicon {\n margin-right: 2px;\n }\n}\n\n/* When tabnav-extra are anchors\n** stylelint-disable-next-line selector-no-qualifying-type */\na.tabnav-extra:hover {\n color: var(--color-accent-fg);\n text-decoration: none;\n}\n\n/* Tabnav buttons\n**\n** For when there are multiple buttons, space them out appropriately. Requires\n** the buttons to be floated or inline-block. */\n\n.tabnav-btn {\n margin-left: var(--controlStack-medium-gap-condensed);\n}\n"]}
|