@primer/view-components 0.45.1-rc.015a120e → 0.45.2
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/styles/primer_view_components.css +6963 -1
- package/app/assets/styles/primer_view_components.css.map +1 -1
- package/app/components/primer/alpha/action_bar.css +49 -1
- package/app/components/primer/alpha/action_list.css +525 -1
- package/app/components/primer/alpha/action_list.css.json +64 -64
- package/app/components/primer/alpha/auto_complete.css +131 -1
- package/app/components/primer/alpha/auto_complete.css.json +3 -3
- package/app/components/primer/alpha/banner.css +146 -1
- package/app/components/primer/alpha/banner.css.json +2 -2
- package/app/components/primer/alpha/button_marketing.css +183 -1
- package/app/components/primer/alpha/button_marketing.css.json +6 -6
- package/app/components/primer/alpha/dialog.css +377 -1
- package/app/components/primer/alpha/dialog.css.json +2 -2
- package/app/components/primer/alpha/dropdown.css +296 -1
- package/app/components/primer/alpha/dropdown.css.json +19 -19
- package/app/components/primer/alpha/layout.css +374 -1
- package/app/components/primer/alpha/layout.css.json +10 -10
- package/app/components/primer/alpha/menu.css +124 -1
- package/app/components/primer/alpha/menu.css.json +5 -5
- package/app/components/primer/alpha/overlay.css +25 -1
- package/app/components/primer/alpha/segmented_control.css +161 -1
- package/app/components/primer/alpha/segmented_control.css.json +5 -5
- package/app/components/primer/alpha/select_panel.css +10 -1
- package/app/components/primer/alpha/skeleton_box.css +36 -1
- package/app/components/primer/alpha/stack.css +255 -1
- package/app/components/primer/alpha/stack.css.json +84 -84
- package/app/components/primer/alpha/stack_item.css +27 -1
- package/app/components/primer/alpha/stack_item.css.json +6 -6
- package/app/components/primer/alpha/tab_nav.css +112 -1
- package/app/components/primer/alpha/tab_nav.css.json +5 -5
- package/app/components/primer/alpha/text_field.css +792 -1
- package/app/components/primer/alpha/text_field.css.json +39 -39
- package/app/components/primer/alpha/toggle_switch.css +230 -1
- package/app/components/primer/alpha/toggle_switch.css.json +10 -10
- package/app/components/primer/alpha/tree_view.css +396 -1
- package/app/components/primer/alpha/tree_view.css.json +25 -25
- package/app/components/primer/alpha/underline_nav.css +150 -1
- package/app/components/primer/alpha/underline_nav.css.json +6 -6
- package/app/components/primer/beta/avatar.css +77 -1
- package/app/components/primer/beta/avatar_stack.css +134 -1
- package/app/components/primer/beta/avatar_stack.css.json +6 -7
- package/app/components/primer/beta/blankslate.css +168 -1
- package/app/components/primer/beta/border_box.css +218 -1
- package/app/components/primer/beta/border_box.css.json +3 -3
- package/app/components/primer/beta/breadcrumbs.css +29 -1
- package/app/components/primer/beta/breadcrumbs.css.json +2 -2
- package/app/components/primer/beta/button.css +359 -1
- package/app/components/primer/beta/button.css.json +17 -17
- package/app/components/primer/beta/button_group.css +20 -1
- package/app/components/primer/beta/button_group.css.json +3 -3
- package/app/components/primer/beta/counter.css +38 -1
- package/app/components/primer/beta/flash.css +152 -1
- package/app/components/primer/beta/label.css +109 -1
- package/app/components/primer/beta/label.css.json +3 -3
- package/app/components/primer/beta/link.css +79 -1
- package/app/components/primer/beta/link.css.json +1 -1
- package/app/components/primer/beta/popover.css +215 -1
- package/app/components/primer/beta/popover.css.json +23 -23
- package/app/components/primer/beta/progress_bar.css +38 -1
- package/app/components/primer/beta/progress_bar.css.json +1 -1
- package/app/components/primer/beta/state.css +60 -1
- package/app/components/primer/beta/state.css.json +1 -1
- package/app/components/primer/beta/subhead.css +64 -1
- package/app/components/primer/beta/subhead.css.json +1 -1
- package/app/components/primer/beta/timeline_item.css +106 -1
- package/app/components/primer/beta/timeline_item.css.json +1 -1
- package/app/components/primer/beta/truncate.css +30 -1
- package/app/components/primer/beta/truncate.css.json +6 -6
- package/app/components/primer/truncate.css +23 -1
- package/app/components/primer/truncate.css.json +4 -4
- package/package.json +1 -1
@@ -15,11 +15,11 @@
|
|
15
15
|
".FormControl-select",
|
16
16
|
".FormControl-textarea",
|
17
17
|
"[disabled]:is(.FormControl-input,.FormControl-select,.FormControl-textarea)",
|
18
|
-
"[invalid=true]:is(.FormControl-input,.FormControl-select,.FormControl-textarea):not(:focus)",
|
19
|
-
"[invalid=false]:is(.FormControl-input,.FormControl-select,.FormControl-textarea):not(:focus)",
|
20
|
-
":is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type=checkbox],[type=radio]):focus",
|
21
|
-
":is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type=checkbox],[type=radio]):focus:not(:focus-visible)",
|
22
|
-
":is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type=checkbox],[type=radio]):focus-visible",
|
18
|
+
"[invalid='true']:is(.FormControl-input,.FormControl-select,.FormControl-textarea):not(:focus)",
|
19
|
+
"[invalid='false']:is(.FormControl-input,.FormControl-select,.FormControl-textarea):not(:focus)",
|
20
|
+
":is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type='checkbox'],[type='radio']):focus",
|
21
|
+
":is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type='checkbox'],[type='radio']):focus:not(:focus-visible)",
|
22
|
+
":is(.FormControl-input,.FormControl-select,.FormControl-textarea):not([type='checkbox'],[type='radio']):focus-visible",
|
23
23
|
"[disabled]:is(.FormControl-input,.FormControl-select,.FormControl-textarea)::placeholder",
|
24
24
|
"[readonly]:is(.FormControl-input,.FormControl-select,.FormControl-textarea)",
|
25
25
|
":is(.FormControl-input,.FormControl-select,.FormControl-textarea)::placeholder",
|
@@ -27,8 +27,8 @@
|
|
27
27
|
".FormControl-medium:is(.FormControl-input,.FormControl-select,.FormControl-textarea)",
|
28
28
|
".FormControl-large:is(.FormControl-input,.FormControl-select,.FormControl-textarea)",
|
29
29
|
".FormControl-inset:is(.FormControl-input,.FormControl-select,.FormControl-textarea)",
|
30
|
-
".FormControl-inset:is(.FormControl-input,.FormControl-select,.FormControl-textarea):focus",
|
31
30
|
".FormControl-inset:is(.FormControl-input,.FormControl-select,.FormControl-textarea):focus-visible",
|
31
|
+
".FormControl-inset:is(.FormControl-input,.FormControl-select,.FormControl-textarea):focus",
|
32
32
|
".FormControl-monospace:is(.FormControl-input,.FormControl-select,.FormControl-textarea)",
|
33
33
|
".FormControl-error:is(.FormControl-input,.FormControl-select,.FormControl-textarea)",
|
34
34
|
".FormControl-success:is(.FormControl-input,.FormControl-select,.FormControl-textarea)",
|
@@ -38,21 +38,21 @@
|
|
38
38
|
".FormControl-input-wrap .FormControl-input-leadingVisualWrap",
|
39
39
|
":is(.FormControl-input-wrap .FormControl-input-leadingVisualWrap) .FormControl-input-leadingVisual",
|
40
40
|
".FormControl-input-wrap .FormControl-input-trailingVisualWrap",
|
41
|
-
":is(.FormControl-input-wrap .FormControl-input-trailingVisualWrap):has(.FormControl-input-trailingVisualLabel)",
|
42
41
|
":is(.FormControl-input-wrap .FormControl-input-trailingVisualWrap):has(.FormControl-input-trailingVisualText)",
|
42
|
+
":is(.FormControl-input-wrap .FormControl-input-trailingVisualWrap):has(.FormControl-input-trailingVisualLabel)",
|
43
43
|
":is(.FormControl-input-wrap .FormControl-input-trailingVisualWrap) .FormControl-input-trailingVisualLabel",
|
44
44
|
".FormControl-input-wrap .FormControl-input-trailingAction",
|
45
45
|
":is(.FormControl-input-wrap .FormControl-input-trailingAction) svg",
|
46
46
|
"[disabled]:is(.FormControl-input-wrap .FormControl-input-trailingAction)",
|
47
47
|
":is(.FormControl-input-wrap .FormControl-input-trailingAction):hover",
|
48
48
|
":is(.FormControl-input-wrap .FormControl-input-trailingAction):active",
|
49
|
-
".FormControl-input-trailingAction--divider:is(.FormControl-input-wrap .FormControl-input-trailingAction)
|
50
|
-
":is(:is(.FormControl-input-wrap .FormControl-input-trailingAction)
|
51
|
-
":is(.FormControl-input-wrap .FormControl-input-trailingAction)
|
49
|
+
".FormControl-input-trailingAction--divider:is(.FormControl-input-wrap .FormControl-input-trailingAction)::before",
|
50
|
+
":is(:is(.FormControl-input-wrap .FormControl-input-trailingAction)::after)",
|
51
|
+
":is(.FormControl-input-wrap .FormControl-input-trailingAction)::after",
|
52
52
|
".FormControl-input-wrap.FormControl-input-wrap--leadingVisual .FormControl-input",
|
53
53
|
".FormControl-input-wrap.FormControl-input-wrap--trailingVisual .FormControl-input",
|
54
|
-
".FormControl-input-wrap.FormControl-input-wrap--trailingVisual:has(.FormControl-input-trailingVisualLabel) .FormControl-input",
|
55
54
|
".FormControl-input-wrap.FormControl-input-wrap--trailingVisual:has(.FormControl-input-trailingVisualText) .FormControl-input",
|
55
|
+
".FormControl-input-wrap.FormControl-input-wrap--trailingVisual:has(.FormControl-input-trailingVisualLabel) .FormControl-input",
|
56
56
|
".FormControl-input-wrap.FormControl-input-wrap--trailingAction .FormControl-input",
|
57
57
|
".FormControl-input-wrap.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input",
|
58
58
|
".FormControl-input-wrap.FormControl-input-wrap--small .FormControl-input-leadingVisualWrap",
|
@@ -60,60 +60,60 @@
|
|
60
60
|
".FormControl-input-wrap.FormControl-input-wrap--small.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-small",
|
61
61
|
".FormControl-input-wrap.FormControl-input-wrap--small.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-small",
|
62
62
|
".FormControl-input-wrap.FormControl-input-wrap--small .FormControl-input-trailingAction",
|
63
|
-
":is(.FormControl-input-wrap.FormControl-input-wrap--small .FormControl-input-trailingAction)
|
63
|
+
":is(.FormControl-input-wrap.FormControl-input-wrap--small .FormControl-input-trailingAction)::before",
|
64
64
|
".FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-leadingVisualWrap",
|
65
65
|
".FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-trailingVisualWrap",
|
66
66
|
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--leadingVisual .FormControl-input.FormControl-large",
|
67
67
|
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingVisual .FormControl-input",
|
68
|
-
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingLabel .FormControl-input.FormControl-large",
|
69
|
-
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingText .FormControl-input.FormControl-large",
|
70
|
-
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingVisual:has(.FormControl-input-trailingVisualLabel) .FormControl-input",
|
71
68
|
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingVisual:has(.FormControl-input-trailingVisualText) .FormControl-input",
|
69
|
+
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingVisual:has(.FormControl-input-trailingVisualLabel) .FormControl-input",
|
70
|
+
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingText .FormControl-input.FormControl-large",
|
71
|
+
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingLabel .FormControl-input.FormControl-large",
|
72
72
|
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-large",
|
73
73
|
".FormControl-input-wrap.FormControl-input-wrap--large.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-large",
|
74
74
|
".FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-trailingAction",
|
75
|
-
":is(.FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-trailingAction)
|
75
|
+
":is(.FormControl-input-wrap.FormControl-input-wrap--large .FormControl-input-trailingAction)::before",
|
76
76
|
".FormControl-select-wrap",
|
77
|
-
".FormControl-select-wrap
|
77
|
+
".FormControl-select-wrap::after",
|
78
78
|
".FormControl-select-wrap .FormControl-select",
|
79
|
-
".FormControl-select-wrap[data-multiple]
|
79
|
+
".FormControl-select-wrap[data-multiple]::after",
|
80
80
|
".FormControl-select-wrap[data-multiple] .FormControl-select",
|
81
81
|
".FormControl-checkbox-wrap",
|
82
82
|
".FormControl-radio-wrap",
|
83
83
|
":is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-checkbox-labelWrap",
|
84
84
|
":is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-radio-labelWrap",
|
85
85
|
":is(.FormControl-checkbox-wrap,.FormControl-radio-wrap) .FormControl-label",
|
86
|
-
".FormControl-check-group-wrap fieldset",
|
87
86
|
".FormControl-radio-group-wrap fieldset",
|
87
|
+
".FormControl-check-group-wrap fieldset",
|
88
88
|
".FormControl-checkbox",
|
89
89
|
".FormControl-checkbox[disabled]",
|
90
|
-
".FormControl-checkbox[invalid=true]:not(:focus)",
|
91
|
-
".FormControl-checkbox[invalid=false]:not(:focus)",
|
92
|
-
".FormControl-checkbox:not([type=checkbox],[type=radio]):focus",
|
93
|
-
".FormControl-checkbox:not([type=checkbox],[type=radio]):focus:not(:focus-visible)",
|
94
|
-
".FormControl-checkbox:not([type=checkbox],[type=radio]):focus-visible",
|
95
|
-
".FormControl-checkbox
|
96
|
-
":is(.FormControl-checkbox
|
97
|
-
":is(.FormControl-checkbox[disabled]
|
90
|
+
".FormControl-checkbox[invalid='true']:not(:focus)",
|
91
|
+
".FormControl-checkbox[invalid='false']:not(:focus)",
|
92
|
+
".FormControl-checkbox:not([type='checkbox'],[type='radio']):focus",
|
93
|
+
".FormControl-checkbox:not([type='checkbox'],[type='radio']):focus:not(:focus-visible)",
|
94
|
+
".FormControl-checkbox:not([type='checkbox'],[type='radio']):focus-visible",
|
95
|
+
".FormControl-checkbox::before",
|
96
|
+
":is(.FormControl-checkbox::after)",
|
97
|
+
":is(.FormControl-checkbox[disabled] ~ .FormControl-checkbox-labelWrap) .FormControl-label",
|
98
98
|
".FormControl-checkbox:checked",
|
99
|
-
".FormControl-checkbox:checked
|
99
|
+
".FormControl-checkbox:checked::before",
|
100
100
|
".FormControl-checkbox:checked:disabled",
|
101
|
-
".FormControl-checkbox:checked:disabled
|
101
|
+
".FormControl-checkbox:checked:disabled::before",
|
102
102
|
".FormControl-checkbox:focus-visible",
|
103
|
-
".FormControl-checkbox:indeterminate
|
103
|
+
".FormControl-checkbox:indeterminate::before",
|
104
104
|
".FormControl-radio",
|
105
105
|
".FormControl-radio[disabled]",
|
106
|
-
".FormControl-radio[invalid=true]:not(:focus)",
|
107
|
-
".FormControl-radio[invalid=false]:not(:focus)",
|
108
|
-
".FormControl-radio:not([type=checkbox],[type=radio]):focus",
|
109
|
-
".FormControl-radio:not([type=checkbox],[type=radio]):focus:not(:focus-visible)",
|
110
|
-
".FormControl-radio:not([type=checkbox],[type=radio]):focus-visible",
|
111
|
-
":is(.FormControl-radio
|
112
|
-
":is(.FormControl-radio[disabled]
|
106
|
+
".FormControl-radio[invalid='true']:not(:focus)",
|
107
|
+
".FormControl-radio[invalid='false']:not(:focus)",
|
108
|
+
".FormControl-radio:not([type='checkbox'],[type='radio']):focus",
|
109
|
+
".FormControl-radio:not([type='checkbox'],[type='radio']):focus:not(:focus-visible)",
|
110
|
+
".FormControl-radio:not([type='checkbox'],[type='radio']):focus-visible",
|
111
|
+
":is(.FormControl-radio::after)",
|
112
|
+
":is(.FormControl-radio[disabled] ~ .FormControl-radio-labelWrap) .FormControl-label",
|
113
113
|
".FormControl-radio:checked",
|
114
|
-
".FormControl-radio:checked:disabled",
|
115
114
|
".FormControl-radio[disabled]:checked",
|
116
|
-
"
|
115
|
+
".FormControl-radio:checked:disabled",
|
116
|
+
":is(:is(.FormControl-radio[disabled]:checked,.FormControl-radio:checked:disabled) ~ .FormControl-radio-labelWrap) .FormControl-label",
|
117
117
|
".FormControl-radio:focus-visible"
|
118
118
|
]
|
119
119
|
}
|
@@ -1 +1,230 @@
|
|
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);
|
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);
|
30
|
+
height: var(--control-medium-size);
|
31
|
+
padding: 0;
|
32
|
+
overflow: hidden;
|
33
|
+
-webkit-text-decoration: none;
|
34
|
+
text-decoration: none;
|
35
|
+
cursor: pointer;
|
36
|
+
-webkit-user-select: none;
|
37
|
+
user-select: none;
|
38
|
+
background-color: var(--controlTrack-bgColor-rest);
|
39
|
+
border: var(--borderWidth-thin) solid var(--controlTrack-borderColor-rest);
|
40
|
+
border-radius: var(--borderRadius-medium);
|
41
|
+
transition-timing-function: cubic-bezier(0.5, 1, 0.89, 1);
|
42
|
+
transition-duration: 80ms;
|
43
|
+
transition-property: background-color, border-color;
|
44
|
+
appearance: none;
|
45
|
+
}
|
46
|
+
|
47
|
+
.ToggleSwitch-track:focus,.ToggleSwitch-track:focus-visible {
|
48
|
+
outline-offset: 1px;
|
49
|
+
}
|
50
|
+
|
51
|
+
.ToggleSwitch-track:hover {
|
52
|
+
background-color: var(--controlTrack-bgColor-hover);
|
53
|
+
}
|
54
|
+
|
55
|
+
.ToggleSwitch-track:active {
|
56
|
+
background-color: var(--controlTrack-bgColor-active);
|
57
|
+
}
|
58
|
+
|
59
|
+
@media (pointer: coarse) {
|
60
|
+
:is(.ToggleSwitch-track::before) {
|
61
|
+
position: absolute;
|
62
|
+
top: 50%;
|
63
|
+
left: 50%;
|
64
|
+
width: 100%;
|
65
|
+
height: 100%;
|
66
|
+
min-height: 44px;
|
67
|
+
content: "";
|
68
|
+
transform: translateX(-50%) translateY(-50%);
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
@media (prefers-reduced-motion) {
|
73
|
+
|
74
|
+
.ToggleSwitch-track {
|
75
|
+
transition: none;
|
76
|
+
}
|
77
|
+
|
78
|
+
.ToggleSwitch-track * {
|
79
|
+
transition: none;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
.ToggleSwitch-track[aria-pressed='true'][disabled] {
|
84
|
+
color: var(--control-checked-fgColor-disabled);
|
85
|
+
background-color: var(--controlTrack-bgColor-disabled);
|
86
|
+
border-color: transparent;
|
87
|
+
}
|
88
|
+
|
89
|
+
.ToggleSwitch-track[aria-pressed='true'] {
|
90
|
+
background-color: var(--control-checked-bgColor-rest);
|
91
|
+
border-color: var(--borderColor-transparent);
|
92
|
+
}
|
93
|
+
|
94
|
+
.ToggleSwitch-track[aria-pressed='true']:not([disabled]):hover {
|
95
|
+
background-color: var(--control-checked-bgColor-hover);
|
96
|
+
}
|
97
|
+
|
98
|
+
.ToggleSwitch-track[aria-pressed='true']:not([disabled]):active {
|
99
|
+
background-color: var(--control-checked-bgColor-active);
|
100
|
+
}
|
101
|
+
|
102
|
+
.ToggleSwitch-track[aria-pressed='true'] .ToggleSwitch-knob {
|
103
|
+
background-color: var(--controlKnob-bgColor-checked);
|
104
|
+
border-color: var(--controlKnob-borderColor-checked);
|
105
|
+
transform: translateX(100%);
|
106
|
+
}
|
107
|
+
|
108
|
+
.ToggleSwitch-track[aria-pressed='true'] .ToggleSwitch-lineIcon {
|
109
|
+
transform: translateX(0%);
|
110
|
+
}
|
111
|
+
|
112
|
+
.ToggleSwitch-track[aria-pressed='true'] .ToggleSwitch-circleIcon {
|
113
|
+
transform: translateX(100%);
|
114
|
+
}
|
115
|
+
|
116
|
+
.ToggleSwitch-track[disabled] {
|
117
|
+
cursor: not-allowed;
|
118
|
+
background-color: var(--controlTrack-bgColor-disabled);
|
119
|
+
border-color: transparent;
|
120
|
+
transition-property: none;
|
121
|
+
}
|
122
|
+
|
123
|
+
.ToggleSwitch-track[disabled] .ToggleSwitch-knob {
|
124
|
+
border-color: var(--borderColor-default);
|
125
|
+
box-shadow: none;
|
126
|
+
}
|
127
|
+
|
128
|
+
.ToggleSwitch-track[disabled] .ToggleSwitch-lineIcon {
|
129
|
+
color: var(--controlTrack-fgColor-disabled);
|
130
|
+
}
|
131
|
+
|
132
|
+
.ToggleSwitch-track[disabled] .ToggleSwitch-circleIcon {
|
133
|
+
color: var(--controlTrack-fgColor-disabled);
|
134
|
+
}
|
135
|
+
|
136
|
+
.ToggleSwitch-icons {
|
137
|
+
display: flex;
|
138
|
+
align-items: center;
|
139
|
+
width: 100%;
|
140
|
+
height: 100%;
|
141
|
+
overflow: hidden;
|
142
|
+
}
|
143
|
+
|
144
|
+
.ToggleSwitch-lineIcon {
|
145
|
+
/* stylelint-disable-next-line primer/typography */
|
146
|
+
line-height: 0;
|
147
|
+
color: var(--control-checked-fgColor-rest);
|
148
|
+
transition-duration: 80ms;
|
149
|
+
transition-property: transform;
|
150
|
+
transform: translateX(-100%);
|
151
|
+
flex: 1 0 50%;
|
152
|
+
}
|
153
|
+
|
154
|
+
.ToggleSwitch-circleIcon {
|
155
|
+
/* stylelint-disable-next-line primer/typography */
|
156
|
+
line-height: 0;
|
157
|
+
color: var(--controlTrack-fgColor-rest);
|
158
|
+
transition-duration: 80ms;
|
159
|
+
transition-property: transform;
|
160
|
+
transform: translateX(0);
|
161
|
+
flex: 1 0 50%;
|
162
|
+
}
|
163
|
+
|
164
|
+
.ToggleSwitch-knob {
|
165
|
+
position: absolute;
|
166
|
+
top: 0;
|
167
|
+
bottom: 0;
|
168
|
+
z-index: 1;
|
169
|
+
width: 50%;
|
170
|
+
background-color: var(--controlKnob-bgColor-rest);
|
171
|
+
border: var(--borderWidth-thin) solid var(--controlKnob-borderColor-rest);
|
172
|
+
border-radius: var(--borderRadius-medium);
|
173
|
+
box-shadow: var(--shadow-resting-medium), var(--button-default-shadow-inset);
|
174
|
+
transition-timing-function: cubic-bezier(0.5, 1, 0.89, 1);
|
175
|
+
transition-duration: 80ms;
|
176
|
+
transition-property: transform;
|
177
|
+
}
|
178
|
+
|
179
|
+
@media (prefers-reduced-motion) {
|
180
|
+
|
181
|
+
.ToggleSwitch-knob {
|
182
|
+
transition: none;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
.ToggleSwitch-status {
|
187
|
+
position: relative;
|
188
|
+
font-size: var(--text-body-size-medium);
|
189
|
+
line-height: var(--text-title-lineHeight-large);
|
190
|
+
color: var(--fgColor-default);
|
191
|
+
text-align: right;
|
192
|
+
}
|
193
|
+
|
194
|
+
.ToggleSwitch-statusIcon {
|
195
|
+
display: flex;
|
196
|
+
width: var(--base-size-16);
|
197
|
+
/* stylelint-disable-next-line primer/spacing */
|
198
|
+
margin-top: 0.063rem;
|
199
|
+
}
|
200
|
+
|
201
|
+
.ToggleSwitch--small .ToggleSwitch-status {
|
202
|
+
font-size: var(--text-body-size-small);
|
203
|
+
}
|
204
|
+
|
205
|
+
.ToggleSwitch--small .ToggleSwitch-track {
|
206
|
+
width: var(--base-size-48);
|
207
|
+
height: var(--control-xsmall-size);
|
208
|
+
}
|
209
|
+
|
210
|
+
.ToggleSwitch--disabled .ToggleSwitch-status {
|
211
|
+
color: var(--fgColor-muted);
|
212
|
+
}
|
213
|
+
|
214
|
+
.ToggleSwitch-statusOn {
|
215
|
+
height: 0;
|
216
|
+
visibility: hidden;
|
217
|
+
}
|
218
|
+
|
219
|
+
.ToggleSwitch-statusOff {
|
220
|
+
height: auto;
|
221
|
+
visibility: visible;
|
222
|
+
}
|
223
|
+
|
224
|
+
.ToggleSwitch--statusAtEnd {
|
225
|
+
flex-direction: row-reverse;
|
226
|
+
}
|
227
|
+
|
228
|
+
.ToggleSwitch--statusAtEnd .ToggleSwitch-status {
|
229
|
+
text-align: left;
|
230
|
+
}
|
@@ -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
|
-
":is(.ToggleSwitch-track
|
13
|
+
":is(.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",
|