@primer/view-components 0.3.0-rc.d9da539f → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/javascripts/primer_view_components.js +1 -1
- package/app/assets/javascripts/primer_view_components.js.map +1 -1
- package/app/assets/styles/primer_view_components.css +4999 -1
- package/app/assets/styles/primer_view_components.css.map +1 -1
- package/app/components/primer/alpha/action_list.css +710 -1
- package/app/components/primer/alpha/action_list.css.json +77 -77
- package/app/components/primer/alpha/auto_complete.css +130 -1
- package/app/components/primer/alpha/auto_complete.css.json +4 -4
- package/app/components/primer/alpha/banner.css +131 -1
- package/app/components/primer/alpha/banner.css.json +2 -2
- package/app/components/primer/alpha/button_marketing.css +204 -1
- package/app/components/primer/alpha/button_marketing.css.json +9 -9
- package/app/components/primer/alpha/dialog.css +607 -1
- package/app/components/primer/alpha/dialog.css.json +10 -10
- package/app/components/primer/alpha/dropdown.css +265 -1
- package/app/components/primer/alpha/dropdown.css.json +19 -19
- package/app/components/primer/alpha/layout.css +398 -1
- package/app/components/primer/alpha/layout.css.json +16 -16
- package/app/components/primer/alpha/menu.css +117 -1
- package/app/components/primer/alpha/menu.css.json +7 -7
- package/app/components/primer/alpha/overlay.css +32 -1
- package/app/components/primer/alpha/overlay.css.json +3 -2
- package/app/components/primer/alpha/segmented_control.css +175 -1
- package/app/components/primer/alpha/segmented_control.css.json +7 -7
- package/app/components/primer/alpha/tab_nav.css +106 -1
- package/app/components/primer/alpha/tab_nav.css.json +6 -6
- package/app/components/primer/alpha/text_field.css +849 -1
- package/app/components/primer/alpha/text_field.css.json +45 -45
- package/app/components/primer/alpha/toggle_switch.css +228 -1
- package/app/components/primer/alpha/toggle_switch.css.json +10 -10
- package/app/components/primer/alpha/underline_nav.css +149 -1
- package/app/components/primer/alpha/underline_nav.css.json +8 -8
- package/app/components/primer/anchored_position.js +1 -3
- package/app/components/primer/beta/avatar.css +74 -1
- package/app/components/primer/beta/avatar_stack.css +138 -1
- package/app/components/primer/beta/avatar_stack.css.json +6 -6
- package/app/components/primer/beta/blankslate.css +90 -1
- package/app/components/primer/beta/border_box.css +279 -1
- package/app/components/primer/beta/border_box.css.json +4 -4
- package/app/components/primer/beta/breadcrumbs.css +27 -1
- package/app/components/primer/beta/breadcrumbs.css.json +3 -3
- package/app/components/primer/beta/button.css +385 -1
- package/app/components/primer/beta/button.css.json +16 -16
- package/app/components/primer/beta/button_group.css +23 -1
- package/app/components/primer/beta/button_group.css.json +5 -5
- package/app/components/primer/beta/counter.css +36 -1
- package/app/components/primer/beta/flash.css +150 -1
- package/app/components/primer/beta/label.css +105 -1
- package/app/components/primer/beta/label.css.json +4 -4
- package/app/components/primer/beta/link.css +62 -1
- package/app/components/primer/beta/link.css.json +3 -3
- package/app/components/primer/beta/popover.css +235 -1
- package/app/components/primer/beta/popover.css.json +29 -29
- package/app/components/primer/beta/progress_bar.css +26 -1
- package/app/components/primer/beta/progress_bar.css.json +1 -1
- package/app/components/primer/beta/state.css +50 -1
- package/app/components/primer/beta/state.css.json +1 -1
- package/app/components/primer/beta/subhead.css +54 -1
- package/app/components/primer/beta/subhead.css.json +1 -1
- package/app/components/primer/beta/timeline_item.css +95 -1
- package/app/components/primer/beta/timeline_item.css.json +1 -1
- package/app/components/primer/beta/truncate.css +37 -1
- package/app/components/primer/beta/truncate.css.json +6 -6
- package/app/components/primer/truncate.css +30 -1
- package/app/components/primer/truncate.css.json +4 -4
- package/package.json +1 -1
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
".FormControl-input[invalid]:not(:focus)",
|
|
20
20
|
".FormControl-select[invalid]:not(:focus)",
|
|
21
21
|
".FormControl-textarea[invalid]:not(:focus)",
|
|
22
|
-
".FormControl-input:not([type=checkbox],[type=radio]):focus",
|
|
23
|
-
".FormControl-select:not([type=checkbox],[type=radio]):focus",
|
|
24
|
-
".FormControl-textarea:not([type=checkbox],[type=radio]):focus",
|
|
25
|
-
".FormControl-input:not([type=checkbox],[type=radio]):focus:not(:focus-visible)",
|
|
26
|
-
".FormControl-select:not([type=checkbox],[type=radio]):focus:not(:focus-visible)",
|
|
27
|
-
".FormControl-textarea:not([type=checkbox],[type=radio]):focus:not(:focus-visible)",
|
|
28
|
-
".FormControl-input:not([type=checkbox],[type=radio]):focus-visible",
|
|
29
|
-
".FormControl-select:not([type=checkbox],[type=radio]):focus-visible",
|
|
30
|
-
".FormControl-textarea:not([type=checkbox],[type=radio]):focus-visible",
|
|
22
|
+
".FormControl-input:not([type='checkbox'], [type='radio']):focus",
|
|
23
|
+
".FormControl-select:not([type='checkbox'], [type='radio']):focus",
|
|
24
|
+
".FormControl-textarea:not([type='checkbox'], [type='radio']):focus",
|
|
25
|
+
".FormControl-input:not([type='checkbox'], [type='radio']):focus:not(:focus-visible)",
|
|
26
|
+
".FormControl-select:not([type='checkbox'], [type='radio']):focus:not(:focus-visible)",
|
|
27
|
+
".FormControl-textarea:not([type='checkbox'], [type='radio']):focus:not(:focus-visible)",
|
|
28
|
+
".FormControl-input:not([type='checkbox'], [type='radio']):focus-visible",
|
|
29
|
+
".FormControl-select:not([type='checkbox'], [type='radio']):focus-visible",
|
|
30
|
+
".FormControl-textarea:not([type='checkbox'], [type='radio']):focus-visible",
|
|
31
31
|
".FormControl-input[disabled]::placeholder",
|
|
32
32
|
".FormControl-select[disabled]::placeholder",
|
|
33
33
|
".FormControl-textarea[disabled]::placeholder",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
".FormControl-input.FormControl-inset",
|
|
50
50
|
".FormControl-select.FormControl-inset",
|
|
51
51
|
".FormControl-textarea.FormControl-inset",
|
|
52
|
-
".FormControl-input.FormControl-inset:focus",
|
|
53
52
|
".FormControl-input.FormControl-inset:focus-visible",
|
|
54
|
-
".FormControl-select.FormControl-inset:focus",
|
|
55
53
|
".FormControl-select.FormControl-inset:focus-visible",
|
|
56
|
-
".FormControl-textarea.FormControl-inset:focus",
|
|
57
54
|
".FormControl-textarea.FormControl-inset:focus-visible",
|
|
55
|
+
".FormControl-input.FormControl-inset:focus",
|
|
56
|
+
".FormControl-select.FormControl-inset:focus",
|
|
57
|
+
".FormControl-textarea.FormControl-inset:focus",
|
|
58
58
|
".FormControl-input.FormControl-monospace",
|
|
59
59
|
".FormControl-select.FormControl-monospace",
|
|
60
60
|
".FormControl-textarea.FormControl-monospace",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
".FormControl-input-wrap .FormControl-input-trailingAction[disabled]",
|
|
77
77
|
".FormControl-input-wrap .FormControl-input-trailingAction:hover",
|
|
78
78
|
".FormControl-input-wrap .FormControl-input-trailingAction:active",
|
|
79
|
-
".FormControl-input-wrap .FormControl-input-trailingAction.FormControl-input-trailingAction--divider
|
|
80
|
-
".FormControl-input-wrap .FormControl-input-trailingAction
|
|
79
|
+
".FormControl-input-wrap .FormControl-input-trailingAction.FormControl-input-trailingAction--divider::before",
|
|
80
|
+
".FormControl-input-wrap .FormControl-input-trailingAction::after",
|
|
81
81
|
".FormControl-input-wrap.FormControl-input-wrap--leadingVisual .FormControl-input",
|
|
82
82
|
".FormControl-input-wrap.FormControl-input-wrap--trailingAction .FormControl-input",
|
|
83
83
|
".FormControl-input-wrap.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input",
|
|
@@ -85,51 +85,51 @@
|
|
|
85
85
|
".FormControl-input-wrap.FormControl-input-wrap--small.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-small",
|
|
86
86
|
".FormControl-input-wrap.FormControl-input-wrap--small.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-small",
|
|
87
87
|
".FormControl-input-wrap.FormControl-input-wrap--small .FormControl-input-trailingAction",
|
|
88
|
-
".FormControl-input-wrap.FormControl-input-wrap--small .FormControl-input-trailingAction
|
|
88
|
+
".FormControl-input-wrap.FormControl-input-wrap--small .FormControl-input-trailingAction::before",
|
|
89
89
|
".FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-leadingVisualWrap",
|
|
90
90
|
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--leadingVisual .FormControl-input.FormControl-large",
|
|
91
91
|
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-large",
|
|
92
92
|
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-large",
|
|
93
93
|
".FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-trailingAction",
|
|
94
|
-
".FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-trailingAction
|
|
94
|
+
".FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-trailingAction::before",
|
|
95
95
|
".FormControl-select-wrap",
|
|
96
|
-
".FormControl-select-wrap
|
|
96
|
+
".FormControl-select-wrap::after",
|
|
97
97
|
".FormControl-select-wrap .FormControl-select",
|
|
98
98
|
".FormControl-checkbox-wrap",
|
|
99
99
|
".FormControl-radio-wrap",
|
|
100
100
|
".FormControl-checkbox-wrap .FormControl-checkbox-labelWrap",
|
|
101
|
-
".FormControl-checkbox-wrap .FormControl-radio-labelWrap",
|
|
102
101
|
".FormControl-radio-wrap .FormControl-checkbox-labelWrap",
|
|
102
|
+
".FormControl-checkbox-wrap .FormControl-radio-labelWrap",
|
|
103
103
|
".FormControl-radio-wrap .FormControl-radio-labelWrap",
|
|
104
104
|
".FormControl-checkbox-wrap .FormControl-label",
|
|
105
105
|
".FormControl-radio-wrap .FormControl-label",
|
|
106
|
-
".FormControl-check-group-wrap fieldset",
|
|
107
106
|
".FormControl-radio-group-wrap fieldset",
|
|
108
|
-
"
|
|
109
|
-
"input
|
|
110
|
-
"input.FormControl-checkbox[type=checkbox][
|
|
111
|
-
"input.FormControl-checkbox[type=checkbox]:not(
|
|
112
|
-
"input.FormControl-checkbox[type=checkbox]:not([type=checkbox],[type=radio]):focus
|
|
113
|
-
"input.FormControl-checkbox[type=checkbox]:not([type=checkbox],[type=radio]):focus-visible",
|
|
114
|
-
"input.FormControl-checkbox[type=checkbox]:
|
|
115
|
-
"input.FormControl-checkbox[type=checkbox]
|
|
116
|
-
"input.FormControl-checkbox[type=checkbox]
|
|
117
|
-
"input.FormControl-checkbox[type=checkbox][disabled]
|
|
118
|
-
"input.FormControl-checkbox[type=checkbox]
|
|
119
|
-
"input.FormControl-checkbox[type=checkbox]:checked
|
|
120
|
-
"input.FormControl-checkbox[type=checkbox]:checked
|
|
121
|
-
"input.FormControl-checkbox[type=checkbox]:checked:disabled
|
|
122
|
-
"input.FormControl-checkbox[type=checkbox]:
|
|
123
|
-
"input.FormControl-checkbox[type=checkbox]:
|
|
124
|
-
"input[type=
|
|
125
|
-
"input
|
|
126
|
-
"input.FormControl-radio[type=radio][
|
|
127
|
-
"input.FormControl-radio[type=radio]:not(
|
|
128
|
-
"input.FormControl-radio[type=radio]:not([type=checkbox],[type=radio]):focus
|
|
129
|
-
"input.FormControl-radio[type=radio]:not([type=checkbox],[type=radio]):focus-visible",
|
|
130
|
-
"input.FormControl-radio[type=radio]:
|
|
131
|
-
"input.FormControl-radio[type=radio]
|
|
132
|
-
"input.FormControl-radio[type=radio]:checked
|
|
133
|
-
"input.FormControl-radio[type=radio]:
|
|
107
|
+
".FormControl-check-group-wrap fieldset",
|
|
108
|
+
"input[type='checkbox'].FormControl-checkbox",
|
|
109
|
+
"input.FormControl-checkbox[type='checkbox'][disabled]",
|
|
110
|
+
"input.FormControl-checkbox[type='checkbox'][invalid]:not(:focus)",
|
|
111
|
+
"input.FormControl-checkbox[type='checkbox']:not([type='checkbox'], [type='radio']):focus",
|
|
112
|
+
"input.FormControl-checkbox[type='checkbox']:not([type='checkbox'], [type='radio']):focus:not(:focus-visible)",
|
|
113
|
+
"input.FormControl-checkbox[type='checkbox']:not([type='checkbox'], [type='radio']):focus-visible",
|
|
114
|
+
"input.FormControl-checkbox[type='checkbox']::before",
|
|
115
|
+
"input.FormControl-checkbox[type='checkbox']::after",
|
|
116
|
+
"input.FormControl-checkbox[type='checkbox'][disabled] ~ .FormControl-checkbox-labelWrap .FormControl-label",
|
|
117
|
+
"input.FormControl-checkbox[type='checkbox'][disabled] ~ .FormControl-radio-labelWrap .FormControl-label",
|
|
118
|
+
"input.FormControl-checkbox[type='checkbox']:checked",
|
|
119
|
+
"input.FormControl-checkbox[type='checkbox']:checked::before",
|
|
120
|
+
"input.FormControl-checkbox[type='checkbox']:checked:disabled",
|
|
121
|
+
"input.FormControl-checkbox[type='checkbox']:checked:disabled::before",
|
|
122
|
+
"input.FormControl-checkbox[type='checkbox']:focus-visible",
|
|
123
|
+
"input.FormControl-checkbox[type='checkbox']:indeterminate::before",
|
|
124
|
+
"input[type='radio'].FormControl-radio",
|
|
125
|
+
"input.FormControl-radio[type='radio'][disabled]",
|
|
126
|
+
"input.FormControl-radio[type='radio'][invalid]:not(:focus)",
|
|
127
|
+
"input.FormControl-radio[type='radio']:not([type='checkbox'], [type='radio']):focus",
|
|
128
|
+
"input.FormControl-radio[type='radio']:not([type='checkbox'], [type='radio']):focus:not(:focus-visible)",
|
|
129
|
+
"input.FormControl-radio[type='radio']:not([type='checkbox'], [type='radio']):focus-visible",
|
|
130
|
+
"input.FormControl-radio[type='radio']::after",
|
|
131
|
+
"input.FormControl-radio[type='radio']:checked",
|
|
132
|
+
"input.FormControl-radio[type='radio']:checked:disabled",
|
|
133
|
+
"input.FormControl-radio[type='radio']:focus-visible"
|
|
134
134
|
]
|
|
135
135
|
}
|
|
@@ -1 +1,228 @@
|
|
|
1
|
-
|
|
1
|
+
/* ToggleSwitch */
|
|
2
|
+
|
|
3
|
+
/* Catalyst in dotcom applies a display: block to all web component elements. This
|
|
4
|
+
** rule overrides it so the status label and toggle switch are laid out correctly. */
|
|
5
|
+
|
|
6
|
+
.ToggleSwitch.ToggleSwitch {
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ToggleSwitch {
|
|
11
|
+
align-items: center;
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
gap: var(--controlStack-medium-gap-condensed,0.5rem);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.ToggleSwitch--checked .ToggleSwitch-statusOn {
|
|
17
|
+
height: auto;
|
|
18
|
+
visibility: visible;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.ToggleSwitch--checked .ToggleSwitch-statusOff {
|
|
22
|
+
height: 0;
|
|
23
|
+
visibility: hidden;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ToggleSwitch-track {
|
|
27
|
+
position: relative;
|
|
28
|
+
display: block;
|
|
29
|
+
width: var(--base-size-64,4rem);
|
|
30
|
+
height: var(--control-medium-size,2rem);
|
|
31
|
+
padding: 0;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
-webkit-user-select: none;
|
|
36
|
+
user-select: none;
|
|
37
|
+
background-color: var(--controlTrack-bgColor-rest,var(--color-switch-track-bg));
|
|
38
|
+
border: var(--borderWidth-thin,max(1px, 0.0625rem)) solid var(--controlTrack-borderColor-rest,var(--color-switch-track-border));
|
|
39
|
+
border-radius: var(--borderRadius-medium,6px);
|
|
40
|
+
transition-timing-function: cubic-bezier(0.5, 1, 0.89, 1);
|
|
41
|
+
transition-duration: 80ms;
|
|
42
|
+
transition-property: background-color, border-color;
|
|
43
|
+
-webkit-appearance: none;
|
|
44
|
+
appearance: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ToggleSwitch-track:focus,
|
|
48
|
+
.ToggleSwitch-track:focus-visible {
|
|
49
|
+
outline-offset: 1px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ToggleSwitch-track:hover {
|
|
53
|
+
background-color: var(--controlTrack-bgColor-hover,var(--color-switch-track-hover-bg));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ToggleSwitch-track:active {
|
|
57
|
+
background-color: var(--controlTrack-bgColor-active,var(--color-switch-track-active-bg));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media (pointer: coarse) {
|
|
61
|
+
.ToggleSwitch-track::before {
|
|
62
|
+
position: absolute;
|
|
63
|
+
top: 50%;
|
|
64
|
+
left: 50%;
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 100%;
|
|
67
|
+
min-height: 44px;
|
|
68
|
+
content: "";
|
|
69
|
+
transform: translateX(-50%) translateY(-50%);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@media (prefers-reduced-motion) {
|
|
74
|
+
|
|
75
|
+
.ToggleSwitch-track {
|
|
76
|
+
transition: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ToggleSwitch-track * {
|
|
80
|
+
transition: none;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ToggleSwitch-track[aria-pressed='true'][disabled] {
|
|
85
|
+
background-color: var(--controlTrack-bgColor-disabled,var(--color-switch-track-disabled-bg));
|
|
86
|
+
color: var(--control-checked-fgColor-disabled,var(--color-switch-track-checked-disabled-fg));
|
|
87
|
+
border-color: transparent;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ToggleSwitch-track[aria-pressed='true'] {
|
|
91
|
+
background-color: var(--control-checked-bgColor-rest,var(--color-switch-track-checked-bg));
|
|
92
|
+
border-color: var(--controlTrack-borderColor-rest,var(--color-switch-track-border));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ToggleSwitch-track[aria-pressed='true']:not([disabled]):hover {
|
|
96
|
+
background-color: var(--control-checked-bgColor-hover,var(--color-switch-track-checked-hover-bg));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.ToggleSwitch-track[aria-pressed='true']:not([disabled]):active {
|
|
100
|
+
background-color: var(--control-checked-bgColor-active,var(--color-switch-track-checked-active-bg));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.ToggleSwitch-track[aria-pressed='true'] .ToggleSwitch-knob {
|
|
104
|
+
background-color: var(--controlKnob-bgColor-checked,var(--color-switch-knob-checked-bg));
|
|
105
|
+
border-color: var(--controlKnob-borderColor-checked,var(--color-switch-knob-checked-border));
|
|
106
|
+
transform: translateX(100%);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ToggleSwitch-track[aria-pressed='true'] .ToggleSwitch-lineIcon {
|
|
110
|
+
transform: translateX(0%);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.ToggleSwitch-track[aria-pressed='true'] .ToggleSwitch-circleIcon {
|
|
114
|
+
transform: translateX(100%);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ToggleSwitch-track[disabled] {
|
|
118
|
+
cursor: not-allowed;
|
|
119
|
+
background-color: var(--controlTrack-bgColor-disabled,var(--color-switch-track-disabled-bg));
|
|
120
|
+
border-color: transparent;
|
|
121
|
+
transition-property: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.ToggleSwitch-track[disabled] .ToggleSwitch-knob {
|
|
125
|
+
border-color: var(--controlKnob-borderColor-disabled,var(--color-btn-bg));
|
|
126
|
+
box-shadow: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.ToggleSwitch-track[disabled] .ToggleSwitch-lineIcon {
|
|
130
|
+
color: var(--controlTrack-fgColor-disabled,var(--color-switch-track-disabled-fg));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.ToggleSwitch-track[disabled] .ToggleSwitch-circleIcon {
|
|
134
|
+
color: var(--controlTrack-fgColor-disabled,var(--color-switch-track-disabled-fg));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.ToggleSwitch-icons {
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
width: 100%;
|
|
141
|
+
height: 100%;
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.ToggleSwitch-lineIcon {
|
|
146
|
+
line-height: 0;
|
|
147
|
+
color: var(--control-checked-fgColor-rest,var(--color-switch-track-checked-fg));
|
|
148
|
+
transition-duration: 80ms;
|
|
149
|
+
transition-property: transform;
|
|
150
|
+
transform: translateX(-100%);
|
|
151
|
+
flex: 1 0 50%;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.ToggleSwitch-circleIcon {
|
|
155
|
+
line-height: 0;
|
|
156
|
+
color: var(--controlTrack-fgColor-rest,var(--color-switch-track-fg));
|
|
157
|
+
transition-duration: 80ms;
|
|
158
|
+
transition-property: transform;
|
|
159
|
+
transform: translateX(0);
|
|
160
|
+
flex: 1 0 50%;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ToggleSwitch-knob {
|
|
164
|
+
position: absolute;
|
|
165
|
+
top: 0;
|
|
166
|
+
bottom: 0;
|
|
167
|
+
z-index: 1;
|
|
168
|
+
width: 50%;
|
|
169
|
+
background-color: var(--controlKnob-bgColor-rest,var(--color-switch-knob-bg));
|
|
170
|
+
border: var(--borderWidth-thin,max(1px, 0.0625rem)) solid var(--controlKnob-borderColor-rest,var(--color-switch-knob-border));
|
|
171
|
+
border-radius: var(--borderRadius-medium,6px);
|
|
172
|
+
box-shadow: var(--shadow-resting-medium,var(--color-shadow-medium)), var(--button-default-shadow-inset,var(--color-btn-inset-shadow));
|
|
173
|
+
transition-timing-function: cubic-bezier(0.5, 1, 0.89, 1);
|
|
174
|
+
transition-duration: 80ms;
|
|
175
|
+
transition-property: transform;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@media (prefers-reduced-motion) {
|
|
179
|
+
|
|
180
|
+
.ToggleSwitch-knob {
|
|
181
|
+
transition: none;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.ToggleSwitch-status {
|
|
186
|
+
position: relative;
|
|
187
|
+
font-size: var(--text-body-size-medium,0.875rem);
|
|
188
|
+
line-height: 1.5;
|
|
189
|
+
color: var(--fgColor-default,var(--color-fg-default));
|
|
190
|
+
text-align: right;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.ToggleSwitch-statusIcon {
|
|
194
|
+
width: var(--base-size-16,1rem);
|
|
195
|
+
display: flex;
|
|
196
|
+
margin-top: 0.063rem;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.ToggleSwitch--small .ToggleSwitch-status {
|
|
200
|
+
font-size: var(--text-body-size-small,0.75rem);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.ToggleSwitch--small .ToggleSwitch-track {
|
|
204
|
+
width: var(--base-size-48,3rem);
|
|
205
|
+
height: var(--control-xsmall-size,1.5rem);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.ToggleSwitch--disabled .ToggleSwitch-status {
|
|
209
|
+
color: var(--fgColor-muted,var(--color-fg-muted));
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.ToggleSwitch-statusOn {
|
|
213
|
+
height: 0;
|
|
214
|
+
visibility: hidden;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.ToggleSwitch-statusOff {
|
|
218
|
+
height: auto;
|
|
219
|
+
visibility: visible;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.ToggleSwitch--statusAtEnd {
|
|
223
|
+
flex-direction: row-reverse;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.ToggleSwitch--statusAtEnd .ToggleSwitch-status {
|
|
227
|
+
text-align: left;
|
|
228
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alpha/toggle_switch",
|
|
3
3
|
"selectors": [
|
|
4
|
-
".ToggleSwitch",
|
|
5
4
|
".ToggleSwitch.ToggleSwitch",
|
|
5
|
+
".ToggleSwitch",
|
|
6
6
|
".ToggleSwitch--checked .ToggleSwitch-statusOn",
|
|
7
7
|
".ToggleSwitch--checked .ToggleSwitch-statusOff",
|
|
8
8
|
".ToggleSwitch-track",
|
|
@@ -10,19 +10,19 @@
|
|
|
10
10
|
".ToggleSwitch-track:focus-visible",
|
|
11
11
|
".ToggleSwitch-track:hover",
|
|
12
12
|
".ToggleSwitch-track:active",
|
|
13
|
-
".ToggleSwitch-track
|
|
13
|
+
".ToggleSwitch-track::before",
|
|
14
14
|
".ToggleSwitch-track *",
|
|
15
|
-
".ToggleSwitch-track[aria-pressed=true][disabled]",
|
|
16
|
-
".ToggleSwitch-track[aria-pressed=true]",
|
|
17
|
-
".ToggleSwitch-track[aria-pressed=true]:not([disabled]):hover",
|
|
18
|
-
".ToggleSwitch-track[aria-pressed=true]:not([disabled]):active",
|
|
19
|
-
".ToggleSwitch-track[aria-pressed=true] .ToggleSwitch-knob",
|
|
20
|
-
".ToggleSwitch-track[aria-pressed=true] .ToggleSwitch-lineIcon",
|
|
21
|
-
".ToggleSwitch-track[aria-pressed=true] .ToggleSwitch-circleIcon",
|
|
15
|
+
".ToggleSwitch-track[aria-pressed='true'][disabled]",
|
|
16
|
+
".ToggleSwitch-track[aria-pressed='true']",
|
|
17
|
+
".ToggleSwitch-track[aria-pressed='true']:not([disabled]):hover",
|
|
18
|
+
".ToggleSwitch-track[aria-pressed='true']:not([disabled]):active",
|
|
19
|
+
".ToggleSwitch-track[aria-pressed='true'] .ToggleSwitch-knob",
|
|
20
|
+
".ToggleSwitch-track[aria-pressed='true'] .ToggleSwitch-lineIcon",
|
|
21
|
+
".ToggleSwitch-track[aria-pressed='true'] .ToggleSwitch-circleIcon",
|
|
22
22
|
".ToggleSwitch-track[disabled]",
|
|
23
23
|
".ToggleSwitch-track[disabled] .ToggleSwitch-knob",
|
|
24
|
-
".ToggleSwitch-track[disabled] .ToggleSwitch-circleIcon",
|
|
25
24
|
".ToggleSwitch-track[disabled] .ToggleSwitch-lineIcon",
|
|
25
|
+
".ToggleSwitch-track[disabled] .ToggleSwitch-circleIcon",
|
|
26
26
|
".ToggleSwitch-icons",
|
|
27
27
|
".ToggleSwitch-lineIcon",
|
|
28
28
|
".ToggleSwitch-circleIcon",
|
|
@@ -1 +1,149 @@
|
|
|
1
|
-
|
|
1
|
+
/* UnderlineNav */
|
|
2
|
+
|
|
3
|
+
.UnderlineNav {
|
|
4
|
+
display: flex;
|
|
5
|
+
min-height: var(--base-size-48,3rem);
|
|
6
|
+
overflow-x: auto;
|
|
7
|
+
overflow-y: hidden;
|
|
8
|
+
box-shadow: inset 0 -1px 0 var(--borderColor-muted,var(--color-neutral-muted));
|
|
9
|
+
-webkit-overflow-scrolling: auto;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.UnderlineNav .Counter {
|
|
14
|
+
margin-left: var(--control-medium-gap,0.5rem);
|
|
15
|
+
color: var(--fgColor-default,var(--color-fg-default));
|
|
16
|
+
background-color: var(--bgColor-neutral-muted,var(--color-neutral-muted));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.UnderlineNav .Counter--primary {
|
|
20
|
+
color: var(--fgColor-onEmphasis,var(--color-fg-on-emphasis));
|
|
21
|
+
background-color: var(--bgColor-neutral-emphasis,var(--color-fg-subtle));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.UnderlineNav-body {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: var(--control-medium-gap,0.5rem);
|
|
28
|
+
list-style: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.UnderlineNav-item {
|
|
32
|
+
position: relative;
|
|
33
|
+
display: flex;
|
|
34
|
+
padding: 0 var(--control-medium-paddingInline-condensed,0.5rem);
|
|
35
|
+
font-size: var(--text-body-size-medium,0.875rem);
|
|
36
|
+
line-height: 30px;
|
|
37
|
+
color: var(--fgColor-default,var(--color-fg-default));
|
|
38
|
+
text-align: center;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
background-color: transparent;
|
|
42
|
+
border: 0;
|
|
43
|
+
border-radius: var(--borderRadius-medium,6px);
|
|
44
|
+
align-items: center;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.UnderlineNav-item:hover,
|
|
48
|
+
.UnderlineNav-item:focus,
|
|
49
|
+
.UnderlineNav-item:focus-visible {
|
|
50
|
+
color: var(--fgColor-default,var(--color-fg-default));
|
|
51
|
+
text-decoration: none;
|
|
52
|
+
border-bottom-color: var(--borderColor-neutral-muted,var(--color-neutral-muted));
|
|
53
|
+
outline-offset: -2px;
|
|
54
|
+
transition: border-bottom-color 0.12s ease-out;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* renders a visibly hidden "copy" of the label in bold, reserving box space for when label becomes bold on selected */
|
|
58
|
+
|
|
59
|
+
.UnderlineNav-item [data-content]::before {
|
|
60
|
+
display: block;
|
|
61
|
+
height: 0;
|
|
62
|
+
font-weight: var(--base-text-weight-semibold,600);
|
|
63
|
+
visibility: hidden;
|
|
64
|
+
content: attr(data-content);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* increase touch target area */
|
|
68
|
+
|
|
69
|
+
.UnderlineNav-item::before {
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: 50%;
|
|
72
|
+
left: 50%;
|
|
73
|
+
width: 100%;
|
|
74
|
+
height: 100%;
|
|
75
|
+
min-height: 48px;
|
|
76
|
+
content: "";
|
|
77
|
+
transform: translateX(-50%) translateY(-50%);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* hover state was "sticking" on mobile after click */
|
|
81
|
+
|
|
82
|
+
@media (pointer: fine) {
|
|
83
|
+
.UnderlineNav-item:hover {
|
|
84
|
+
color: var(--fgColor-default,var(--color-fg-default));
|
|
85
|
+
text-decoration: none;
|
|
86
|
+
background: var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg));
|
|
87
|
+
transition: background 0.12s ease-out;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.UnderlineNav-item.selected,
|
|
92
|
+
.UnderlineNav-item[role='tab'][aria-selected='true'],
|
|
93
|
+
.UnderlineNav-item[aria-current]:not([aria-current='false']) {
|
|
94
|
+
font-weight: var(--base-text-weight-semibold,600);
|
|
95
|
+
color: var(--fgColor-default,var(--color-fg-default));
|
|
96
|
+
border-bottom-color: var(--underlineNav-borderColor-active,var(--color-primer-border-active));
|
|
97
|
+
|
|
98
|
+
/* current/selected underline */
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.UnderlineNav-item.selected::after, .UnderlineNav-item[role='tab'][aria-selected='true']::after, .UnderlineNav-item[aria-current]:not([aria-current='false'])::after {
|
|
102
|
+
position: absolute;
|
|
103
|
+
z-index: 1; /* raise above full-width flash banner */
|
|
104
|
+
right: 50%;
|
|
105
|
+
bottom: calc(50% - 25px); /* 48px total height / 2 (24px) + 1px */
|
|
106
|
+
width: 100%;
|
|
107
|
+
height: 2px;
|
|
108
|
+
content: '';
|
|
109
|
+
background: var(--underlineNav-borderColor-active,var(--color-primer-border-active));
|
|
110
|
+
border-radius: var(--borderRadius-medium,6px);
|
|
111
|
+
transform: translate(50%, -50%);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.UnderlineNav--right {
|
|
115
|
+
justify-content: flex-end;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.UnderlineNav--right .UnderlineNav-actions {
|
|
119
|
+
flex: 1 1 auto;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.UnderlineNav-actions {
|
|
123
|
+
align-self: center;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.UnderlineNav--full {
|
|
127
|
+
display: block;
|
|
128
|
+
|
|
129
|
+
/* required for underline to align with additional wrapper element */
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.UnderlineNav--full .UnderlineNav-body {
|
|
133
|
+
min-height: var(--base-size-48,3rem);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.UnderlineNav-octicon {
|
|
137
|
+
display: inline !important;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.UnderlineNav-octicon {
|
|
141
|
+
margin-right: var(--control-medium-gap,0.5rem);
|
|
142
|
+
color: var(--fgColor-muted,var(--color-fg-muted));
|
|
143
|
+
fill: var(--fgColor-muted,var(--color-fg-muted));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.UnderlineNav-container {
|
|
147
|
+
display: flex;
|
|
148
|
+
justify-content: space-between;
|
|
149
|
+
}
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
".UnderlineNav .Counter--primary",
|
|
7
7
|
".UnderlineNav-body",
|
|
8
8
|
".UnderlineNav-item",
|
|
9
|
+
".UnderlineNav-item:hover",
|
|
9
10
|
".UnderlineNav-item:focus",
|
|
10
11
|
".UnderlineNav-item:focus-visible",
|
|
11
|
-
".UnderlineNav-item
|
|
12
|
-
".UnderlineNav-item
|
|
13
|
-
".UnderlineNav-item:before",
|
|
12
|
+
".UnderlineNav-item [data-content]::before",
|
|
13
|
+
".UnderlineNav-item::before",
|
|
14
14
|
".UnderlineNav-item.selected",
|
|
15
|
-
".UnderlineNav-item[
|
|
16
|
-
".UnderlineNav-item[
|
|
17
|
-
".UnderlineNav-item.selected
|
|
18
|
-
".UnderlineNav-item[
|
|
19
|
-
".UnderlineNav-item[
|
|
15
|
+
".UnderlineNav-item[role='tab'][aria-selected='true']",
|
|
16
|
+
".UnderlineNav-item[aria-current]:not([aria-current='false'])",
|
|
17
|
+
".UnderlineNav-item.selected::after",
|
|
18
|
+
".UnderlineNav-item[role='tab'][aria-selected='true']::after",
|
|
19
|
+
".UnderlineNav-item[aria-current]:not([aria-current='false'])::after",
|
|
20
20
|
".UnderlineNav--right",
|
|
21
21
|
".UnderlineNav--right .UnderlineNav-actions",
|
|
22
22
|
".UnderlineNav-actions",
|
|
@@ -133,11 +133,9 @@ export default class AnchoredPositionElement extends HTMLElement {
|
|
|
133
133
|
const anchor = this.anchorElement;
|
|
134
134
|
if (!anchor)
|
|
135
135
|
return;
|
|
136
|
-
const { left, top
|
|
136
|
+
const { left, top } = getAnchoredPosition(this, anchor, this);
|
|
137
137
|
this.style.top = `${top}px`;
|
|
138
138
|
this.style.left = `${left}px`;
|
|
139
|
-
this.classList.remove('Overlay--anchorAlign-start', 'Overlay--anchorAlign-center', 'Overlay--anchorAlign-end', 'Overlay--anchorSide-insideTop', 'Overlay--anchorSide-insideBottom', 'Overlay--anchorSide-insideLeft', 'Overlay--anchorSide-insideRight', 'Overlay--anchorSide-insideCenter', 'Overlay--anchorSide-outsideTop', 'Overlay--anchorSide-outsideLeft', 'Overlay--anchorSide-outsideRight');
|
|
140
|
-
this.classList.add(`Overlay--anchorAlign-${anchorAlign}`, `Overlay--anchorSide-${anchorSide}`);
|
|
141
139
|
}), "f");
|
|
142
140
|
}
|
|
143
141
|
}
|