@primer/view-components 0.1.0-rc.d6eb7cd7 → 0.1.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 +2 -2
- package/app/assets/styles/primer_view_components.css.map +1 -1
- package/app/components/primer/alpha/action_list.css.json +164 -1
- package/app/components/primer/alpha/auto_complete.css.json +34 -1
- package/app/components/primer/alpha/banner.css.json +38 -1
- package/app/components/primer/alpha/button_marketing.css.json +43 -1
- package/app/components/primer/alpha/dialog.css.json +145 -1
- package/app/components/primer/alpha/dropdown.css.json +61 -1
- package/app/components/primer/alpha/layout.css.json +107 -1
- package/app/components/primer/alpha/menu.css.json +39 -1
- package/app/components/primer/alpha/modal_dialog.js +2 -0
- package/app/components/primer/alpha/nav_list.d.ts +6 -3
- package/app/components/primer/alpha/nav_list.js +98 -6
- package/app/components/primer/alpha/overlay.css +1 -0
- package/app/components/primer/alpha/overlay.css.json +11 -0
- package/app/components/primer/alpha/segmented_control.css +1 -1
- package/app/components/primer/alpha/segmented_control.css.json +46 -1
- package/app/components/primer/alpha/tab_nav.css.json +34 -1
- package/app/components/primer/alpha/text_field.css +2 -2
- package/app/components/primer/alpha/text_field.css.json +172 -1
- package/app/components/primer/alpha/toggle_switch.css +1 -1
- package/app/components/primer/alpha/toggle_switch.css.json +56 -1
- package/app/components/primer/alpha/toggle_switch.js +23 -11
- package/app/components/primer/alpha/tool_tip.js +0 -3
- package/app/components/primer/alpha/underline_nav.css.json +41 -1
- package/app/components/primer/anchored_position.d.ts +27 -0
- package/app/components/primer/anchored_position.js +149 -0
- package/app/components/primer/beta/avatar.css.json +31 -1
- package/app/components/primer/beta/avatar_stack.css.json +37 -1
- package/app/components/primer/beta/blankslate.css.json +34 -1
- package/app/components/primer/beta/border_box.css.json +86 -1
- package/app/components/primer/beta/breadcrumbs.css.json +15 -1
- package/app/components/primer/beta/button.css +1 -1
- package/app/components/primer/beta/button.css.json +93 -1
- package/app/components/primer/beta/counter.css.json +16 -1
- package/app/components/primer/beta/flash.css.json +42 -1
- package/app/components/primer/beta/label.css.json +45 -1
- package/app/components/primer/beta/link.css.json +27 -1
- package/app/components/primer/beta/popover.css.json +57 -1
- package/app/components/primer/beta/progress_bar.css.json +16 -1
- package/app/components/primer/beta/state.css.json +23 -1
- package/app/components/primer/beta/subhead.css.json +20 -1
- package/app/components/primer/beta/timeline_item.css.json +25 -1
- package/app/components/primer/beta/truncate.css.json +18 -1
- package/app/components/primer/primer.d.ts +4 -2
- package/app/components/primer/primer.js +4 -2
- package/app/components/primer/truncate.css.json +20 -1
- package/lib/primer/forms/toggle_switch_input.d.ts +5 -0
- package/lib/primer/forms/toggle_switch_input.js +29 -0
- package/package.json +4 -2
- package/static/arguments.json +1416 -1402
- package/static/audited_at.json +16 -24
- package/static/classes.json +311 -0
- package/static/constants.json +129 -71
- package/static/previews.json +1833 -0
- package/static/statuses.json +14 -22
- package/app/components/primer/time_ago_component.d.ts +0 -1
- package/app/components/primer/time_ago_component.js +0 -1
- /package/app/components/primer/{local_time.d.ts → beta/relative_time.d.ts} +0 -0
- /package/app/components/primer/{local_time.js → beta/relative_time.js} +0 -0
|
@@ -1 +1,172 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "alpha/text_field",
|
|
3
|
+
"selectors": [
|
|
4
|
+
".FormControl",
|
|
5
|
+
".FormControl--fullWidth",
|
|
6
|
+
".FormControl-label",
|
|
7
|
+
".FormControl-caption",
|
|
8
|
+
".FormControl-inlineValidation",
|
|
9
|
+
".FormControl-inlineValidation p",
|
|
10
|
+
".FormControl-spacingWrapper",
|
|
11
|
+
".FormControl-horizontalGroup",
|
|
12
|
+
".FormControl-input",
|
|
13
|
+
".FormControl-select",
|
|
14
|
+
".FormControl-textarea",
|
|
15
|
+
".FormControl-input[disabled]",
|
|
16
|
+
".FormControl-select[disabled]",
|
|
17
|
+
".FormControl-textarea[disabled]",
|
|
18
|
+
".FormControl-input[invalid]:not(:focus)",
|
|
19
|
+
".FormControl-select[invalid]:not(:focus)",
|
|
20
|
+
".FormControl-textarea[invalid]:not(:focus)",
|
|
21
|
+
".FormControl-input:not([type=checkbox],[type=radio]):focus",
|
|
22
|
+
".FormControl-select:not([type=checkbox],[type=radio]):focus",
|
|
23
|
+
".FormControl-textarea:not([type=checkbox],[type=radio]):focus",
|
|
24
|
+
".FormControl-input:not([type=checkbox],[type=radio]):focus:not(:focus-visible)",
|
|
25
|
+
".FormControl-select:not([type=checkbox],[type=radio]):focus:not(:focus-visible)",
|
|
26
|
+
".FormControl-textarea:not([type=checkbox],[type=radio]):focus:not(:focus-visible)",
|
|
27
|
+
".FormControl-input:not([type=checkbox],[type=radio]):focus-visible",
|
|
28
|
+
".FormControl-select:not([type=checkbox],[type=radio]):focus-visible",
|
|
29
|
+
".FormControl-textarea:not([type=checkbox],[type=radio]):focus-visible",
|
|
30
|
+
".FormControl-input[disabled]::placeholder",
|
|
31
|
+
".FormControl-select[disabled]::placeholder",
|
|
32
|
+
".FormControl-textarea[disabled]::placeholder",
|
|
33
|
+
".FormControl-input[readonly]",
|
|
34
|
+
".FormControl-select[readonly]",
|
|
35
|
+
".FormControl-textarea[readonly]",
|
|
36
|
+
".FormControl-input::placeholder",
|
|
37
|
+
".FormControl-select::placeholder",
|
|
38
|
+
".FormControl-textarea::placeholder",
|
|
39
|
+
".FormControl-input.FormControl-small",
|
|
40
|
+
".FormControl-select.FormControl-small",
|
|
41
|
+
".FormControl-textarea.FormControl-small",
|
|
42
|
+
".FormControl-input.FormControl-medium",
|
|
43
|
+
".FormControl-select.FormControl-medium",
|
|
44
|
+
".FormControl-textarea.FormControl-medium",
|
|
45
|
+
".FormControl-input.FormControl-large",
|
|
46
|
+
".FormControl-select.FormControl-large",
|
|
47
|
+
".FormControl-textarea.FormControl-large",
|
|
48
|
+
".FormControl-input.FormControl-inset",
|
|
49
|
+
".FormControl-select.FormControl-inset",
|
|
50
|
+
".FormControl-textarea.FormControl-inset",
|
|
51
|
+
".FormControl-input.FormControl-inset:focus",
|
|
52
|
+
".FormControl-input.FormControl-inset:focus-visible",
|
|
53
|
+
".FormControl-select.FormControl-inset:focus",
|
|
54
|
+
".FormControl-select.FormControl-inset:focus-visible",
|
|
55
|
+
".FormControl-textarea.FormControl-inset:focus",
|
|
56
|
+
".FormControl-textarea.FormControl-inset:focus-visible",
|
|
57
|
+
".FormControl-input.FormControl-monospace",
|
|
58
|
+
".FormControl-select.FormControl-monospace",
|
|
59
|
+
".FormControl-textarea.FormControl-monospace",
|
|
60
|
+
".FormControl-input.FormControl-error",
|
|
61
|
+
".FormControl-select.FormControl-error",
|
|
62
|
+
".FormControl-textarea.FormControl-error",
|
|
63
|
+
".FormControl-input.FormControl-success",
|
|
64
|
+
".FormControl-select.FormControl-success",
|
|
65
|
+
".FormControl-textarea.FormControl-success",
|
|
66
|
+
".FormControl-input.FormControl-warning",
|
|
67
|
+
".FormControl-select.FormControl-warning",
|
|
68
|
+
".FormControl-textarea.FormControl-warning",
|
|
69
|
+
".FormControl-toggleSwitchInput",
|
|
70
|
+
".FormControl-input-wrap",
|
|
71
|
+
".FormControl-input-wrap .FormControl-input-leadingVisualWrap",
|
|
72
|
+
".FormControl-input-wrap .FormControl-input-leadingVisualWrap .FormControl-input-leadingVisual",
|
|
73
|
+
".FormControl-input-wrap .FormControl-input-trailingAction",
|
|
74
|
+
".FormControl-input-wrap .FormControl-input-trailingAction svg",
|
|
75
|
+
".FormControl-input-wrap .FormControl-input-trailingAction[disabled]",
|
|
76
|
+
".FormControl-input-wrap .FormControl-input-trailingAction:hover",
|
|
77
|
+
".FormControl-input-wrap .FormControl-input-trailingAction:active",
|
|
78
|
+
".FormControl-input-wrap .FormControl-input-trailingAction.FormControl-input-trailingAction--divider:before",
|
|
79
|
+
".FormControl-input-wrap .FormControl-input-trailingAction:after",
|
|
80
|
+
".FormControl-input-wrap.FormControl-input-wrap--leadingVisual .FormControl-input",
|
|
81
|
+
".FormControl-input-wrap.FormControl-input-wrap--trailingAction .FormControl-input",
|
|
82
|
+
".FormControl-input-wrap.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input",
|
|
83
|
+
".FormControl-input-wrap.FormControl-small .FormControl-input-leadingVisualWrap",
|
|
84
|
+
".FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-small",
|
|
85
|
+
".FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-small",
|
|
86
|
+
".FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction",
|
|
87
|
+
".FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction:before",
|
|
88
|
+
".FormControl-input-wrap.FormControl-large .FormControl-input-leadingVisualWrap",
|
|
89
|
+
".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--leadingVisual .FormControl-input.FormControl-large",
|
|
90
|
+
".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-large",
|
|
91
|
+
".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-large",
|
|
92
|
+
".FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction",
|
|
93
|
+
".FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction:before",
|
|
94
|
+
".FormControl-select-wrap",
|
|
95
|
+
".FormControl-select-wrap:after",
|
|
96
|
+
".FormControl-select-wrap .FormControl-select",
|
|
97
|
+
".FormControl-checkbox-wrap",
|
|
98
|
+
".FormControl-radio-wrap",
|
|
99
|
+
".FormControl-checkbox-wrap .FormControl-checkbox-labelWrap",
|
|
100
|
+
".FormControl-checkbox-wrap .FormControl-radio-labelWrap",
|
|
101
|
+
".FormControl-radio-wrap .FormControl-checkbox-labelWrap",
|
|
102
|
+
".FormControl-radio-wrap .FormControl-radio-labelWrap",
|
|
103
|
+
".FormControl-checkbox-wrap .FormControl-label",
|
|
104
|
+
".FormControl-radio-wrap .FormControl-label",
|
|
105
|
+
".FormControl-check-group-wrap fieldset",
|
|
106
|
+
".FormControl-radio-group-wrap fieldset",
|
|
107
|
+
"input[type=checkbox].FormControl-checkbox",
|
|
108
|
+
"input.FormControl-checkbox[type=checkbox][disabled]",
|
|
109
|
+
"input.FormControl-checkbox[type=checkbox][invalid]:not(:focus)",
|
|
110
|
+
"input.FormControl-checkbox[type=checkbox]:not([type=checkbox],[type=radio]):focus",
|
|
111
|
+
"input.FormControl-checkbox[type=checkbox]:not([type=checkbox],[type=radio]):focus:not(:focus-visible)",
|
|
112
|
+
"input.FormControl-checkbox[type=checkbox]:not([type=checkbox],[type=radio]):focus-visible",
|
|
113
|
+
"input.FormControl-checkbox[type=checkbox]:before",
|
|
114
|
+
"input.FormControl-checkbox[type=checkbox]:after",
|
|
115
|
+
"input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-checkbox-labelWrap .FormControl-label",
|
|
116
|
+
"input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-radio-labelWrap .FormControl-label",
|
|
117
|
+
"input.FormControl-checkbox[type=checkbox]:checked",
|
|
118
|
+
"input.FormControl-checkbox[type=checkbox]:checked:before",
|
|
119
|
+
"input.FormControl-checkbox[type=checkbox]:checked:disabled",
|
|
120
|
+
"input.FormControl-checkbox[type=checkbox]:checked:disabled:before",
|
|
121
|
+
"input.FormControl-checkbox[type=checkbox]:focus-visible",
|
|
122
|
+
"input.FormControl-checkbox[type=checkbox]:indeterminate:before",
|
|
123
|
+
"input[type=radio].FormControl-radio",
|
|
124
|
+
"input.FormControl-radio[type=radio][disabled]",
|
|
125
|
+
"input.FormControl-radio[type=radio][invalid]:not(:focus)",
|
|
126
|
+
"input.FormControl-radio[type=radio]:not([type=checkbox],[type=radio]):focus",
|
|
127
|
+
"input.FormControl-radio[type=radio]:not([type=checkbox],[type=radio]):focus:not(:focus-visible)",
|
|
128
|
+
"input.FormControl-radio[type=radio]:not([type=checkbox],[type=radio]):focus-visible",
|
|
129
|
+
"input.FormControl-radio[type=radio]:after",
|
|
130
|
+
"input.FormControl-radio[type=radio]:checked",
|
|
131
|
+
"input.FormControl-radio[type=radio]:checked:disabled",
|
|
132
|
+
"input.FormControl-radio[type=radio]:focus-visible"
|
|
133
|
+
],
|
|
134
|
+
"classes": [
|
|
135
|
+
"FormControl",
|
|
136
|
+
"FormControl--fullWidth",
|
|
137
|
+
"FormControl-label",
|
|
138
|
+
"FormControl-caption",
|
|
139
|
+
"FormControl-inlineValidation",
|
|
140
|
+
"FormControl-spacingWrapper",
|
|
141
|
+
"FormControl-horizontalGroup",
|
|
142
|
+
"FormControl-input",
|
|
143
|
+
"FormControl-select",
|
|
144
|
+
"FormControl-textarea",
|
|
145
|
+
"FormControl-small",
|
|
146
|
+
"FormControl-medium",
|
|
147
|
+
"FormControl-large",
|
|
148
|
+
"FormControl-inset",
|
|
149
|
+
"FormControl-monospace",
|
|
150
|
+
"FormControl-error",
|
|
151
|
+
"FormControl-success",
|
|
152
|
+
"FormControl-warning",
|
|
153
|
+
"FormControl-toggleSwitchInput",
|
|
154
|
+
"FormControl-input-wrap",
|
|
155
|
+
"FormControl-input-leadingVisualWrap",
|
|
156
|
+
"FormControl-input-leadingVisual",
|
|
157
|
+
"FormControl-input-trailingAction",
|
|
158
|
+
"FormControl-input-trailingAction--divider",
|
|
159
|
+
"FormControl-input-wrap--leadingVisual",
|
|
160
|
+
"FormControl-input-wrap--trailingAction",
|
|
161
|
+
"FormControl-input-wrap-trailingAction--divider",
|
|
162
|
+
"FormControl-select-wrap",
|
|
163
|
+
"FormControl-checkbox-wrap",
|
|
164
|
+
"FormControl-radio-wrap",
|
|
165
|
+
"FormControl-checkbox-labelWrap",
|
|
166
|
+
"FormControl-radio-labelWrap",
|
|
167
|
+
"FormControl-check-group-wrap",
|
|
168
|
+
"FormControl-radio-group-wrap",
|
|
169
|
+
"FormControl-checkbox",
|
|
170
|
+
"FormControl-radio"
|
|
171
|
+
]
|
|
172
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ToggleSwitch,.ToggleSwitch.ToggleSwitch{display:inline-flex}.ToggleSwitch{align-items:center;gap:var(--primer-controlStack-medium-gap-condensed,8px)}.ToggleSwitch
|
|
1
|
+
.ToggleSwitch,.ToggleSwitch.ToggleSwitch{display:inline-flex}.ToggleSwitch{align-items:center;gap:var(--primer-controlStack-medium-gap-condensed,8px)}.ToggleSwitch--checked .ToggleSwitch-statusOn{height:auto;visibility:visible}.ToggleSwitch--checked .ToggleSwitch-statusOff{height:0;visibility:hidden}.ToggleSwitch-track{-webkit-appearance:none;appearance:none;background-color:var(--color-switch-track-bg);border:var(--primer-borderWidth-thin,1px) solid var(--color-switch-track-border);border-radius:var(--primer-borderRadius-medium,6px);cursor:pointer;display:block;height:var(--primer-control-medium-size,32px);overflow:hidden;padding:0;position:relative;text-decoration:none;transition-duration:80ms;transition-property:background-color,border-color;transition-timing-function:cubic-bezier(.5,1,.89,1);-webkit-user-select:none;user-select:none;width:var(--base-size-64,64px)}.ToggleSwitch-track:focus,.ToggleSwitch-track:focus-visible{outline-offset:1px}.ToggleSwitch-track:hover{background-color:var(--color-switch-track-hover-bg)}.ToggleSwitch-track:active{background-color:var(--color-switch-track-active-bg)}@media (pointer:coarse){.ToggleSwitch-track:before{content:"";height:100%;left:50%;min-height:44px;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:100%}}@media (prefers-reduced-motion){.ToggleSwitch-track,.ToggleSwitch-track *{transition:none}}.ToggleSwitch-track[aria-checked=true][aria-disabled=true]{background-color:var(--color-switch-track-disabled-bg);border-color:#0000;color:var(--color-switch-track-checked-disabled-fg)}.ToggleSwitch-track[aria-checked=true]{background-color:var(--color-switch-track-checked-bg);border-color:var(--color-switch-track-checked-border)}.ToggleSwitch-track[aria-checked=true]:not([aria-disabled=true]):hover{background-color:var(--color-switch-track-checked-hover-bg)}.ToggleSwitch-track[aria-checked=true]:not([aria-disabled=true]):active{background-color:var(--color-switch-track-checked-active-bg)}.ToggleSwitch-track[aria-checked=true] .ToggleSwitch-knob{background-color:var(--color-switch-knob-checked-bg);border-color:var(--color-switch-knob-checked-border);transform:translateX(100%)}.ToggleSwitch-track[aria-checked=true] .ToggleSwitch-lineIcon{transform:translateX(0)}.ToggleSwitch-track[aria-checked=true] .ToggleSwitch-circleIcon{transform:translateX(100%)}.ToggleSwitch-track[aria-disabled=true]{background-color:var(--color-switch-track-disabled-bg);border-color:#0000;cursor:not-allowed;transition-property:none}.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob{border-color:var(--color-border-default);box-shadow:none}.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-circleIcon,.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-lineIcon{color:var(--color-switch-track-disabled-fg)}.ToggleSwitch-icons{align-items:center;display:flex;height:100%;overflow:hidden;width:100%}.ToggleSwitch-lineIcon{color:var(--color-switch-track-checked-fg);transform:translateX(-100%)}.ToggleSwitch-circleIcon,.ToggleSwitch-lineIcon{flex:1 0 50%;line-height:0;transition-duration:80ms;transition-property:transform}.ToggleSwitch-circleIcon{color:var(--color-switch-track-fg);transform:translateX(0)}.ToggleSwitch-knob{background-color:var(--color-switch-knob-bg);border:var(--primer-borderWidth-thin,1px) solid var(--color-switch-knob-border);border-radius:var(--primer-borderRadius-medium,6px);bottom:0;box-shadow:var(--color-shadow-medium),var(--color-btn-inset-shadow);position:absolute;top:0;transition-duration:80ms;transition-property:transform;transition-timing-function:cubic-bezier(.5,1,.89,1);width:50%;z-index:1}@media (prefers-reduced-motion){.ToggleSwitch-knob{transition:none}}.ToggleSwitch-status{color:var(--color-fg-default);font-size:var(--primer-text-body-size-medium,14px);line-height:1.5;position:relative;text-align:right}.ToggleSwitch-statusIcon{display:flex;margin-top:.063rem;width:var(--base-size-16,16px)}.ToggleSwitch--small .ToggleSwitch-status{font-size:var(--primer-text-body-size-small,12px)}.ToggleSwitch--small .ToggleSwitch-track{height:var(--primer-control-xsmall-size,24px);width:var(--base-size-48,48px)}.ToggleSwitch--disabled .ToggleSwitch-status{color:var(--color-fg-muted)}.ToggleSwitch-statusOn{height:0;visibility:hidden}.ToggleSwitch-statusOff{height:auto;visibility:visible}.ToggleSwitch--statusAtEnd{flex-direction:row-reverse}.ToggleSwitch--statusAtEnd .ToggleSwitch-status{text-align:left}
|
|
@@ -1 +1,56 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "alpha/toggle_switch",
|
|
3
|
+
"selectors": [
|
|
4
|
+
".ToggleSwitch",
|
|
5
|
+
".ToggleSwitch.ToggleSwitch",
|
|
6
|
+
".ToggleSwitch--checked .ToggleSwitch-statusOn",
|
|
7
|
+
".ToggleSwitch--checked .ToggleSwitch-statusOff",
|
|
8
|
+
".ToggleSwitch-track",
|
|
9
|
+
".ToggleSwitch-track:focus",
|
|
10
|
+
".ToggleSwitch-track:focus-visible",
|
|
11
|
+
".ToggleSwitch-track:hover",
|
|
12
|
+
".ToggleSwitch-track:active",
|
|
13
|
+
".ToggleSwitch-track:before",
|
|
14
|
+
".ToggleSwitch-track *",
|
|
15
|
+
".ToggleSwitch-track[aria-checked=true][aria-disabled=true]",
|
|
16
|
+
".ToggleSwitch-track[aria-checked=true]",
|
|
17
|
+
".ToggleSwitch-track[aria-checked=true]:not([aria-disabled=true]):hover",
|
|
18
|
+
".ToggleSwitch-track[aria-checked=true]:not([aria-disabled=true]):active",
|
|
19
|
+
".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-knob",
|
|
20
|
+
".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-lineIcon",
|
|
21
|
+
".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-circleIcon",
|
|
22
|
+
".ToggleSwitch-track[aria-disabled=true]",
|
|
23
|
+
".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob",
|
|
24
|
+
".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-circleIcon",
|
|
25
|
+
".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-lineIcon",
|
|
26
|
+
".ToggleSwitch-icons",
|
|
27
|
+
".ToggleSwitch-lineIcon",
|
|
28
|
+
".ToggleSwitch-circleIcon",
|
|
29
|
+
".ToggleSwitch-knob",
|
|
30
|
+
".ToggleSwitch-status",
|
|
31
|
+
".ToggleSwitch-statusIcon",
|
|
32
|
+
".ToggleSwitch--small .ToggleSwitch-status",
|
|
33
|
+
".ToggleSwitch--small .ToggleSwitch-track",
|
|
34
|
+
".ToggleSwitch--disabled .ToggleSwitch-status",
|
|
35
|
+
".ToggleSwitch-statusOn",
|
|
36
|
+
".ToggleSwitch-statusOff",
|
|
37
|
+
".ToggleSwitch--statusAtEnd",
|
|
38
|
+
".ToggleSwitch--statusAtEnd .ToggleSwitch-status"
|
|
39
|
+
],
|
|
40
|
+
"classes": [
|
|
41
|
+
"ToggleSwitch",
|
|
42
|
+
"ToggleSwitch--checked",
|
|
43
|
+
"ToggleSwitch-statusOn",
|
|
44
|
+
"ToggleSwitch-statusOff",
|
|
45
|
+
"ToggleSwitch-track",
|
|
46
|
+
"ToggleSwitch-knob",
|
|
47
|
+
"ToggleSwitch-lineIcon",
|
|
48
|
+
"ToggleSwitch-circleIcon",
|
|
49
|
+
"ToggleSwitch-icons",
|
|
50
|
+
"ToggleSwitch-status",
|
|
51
|
+
"ToggleSwitch-statusIcon",
|
|
52
|
+
"ToggleSwitch--small",
|
|
53
|
+
"ToggleSwitch--disabled",
|
|
54
|
+
"ToggleSwitch--statusAtEnd"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
@@ -81,9 +81,13 @@ let ToggleSwitchElement = class ToggleSwitchElement extends HTMLElement {
|
|
|
81
81
|
this.loadingSpinner.removeAttribute('hidden');
|
|
82
82
|
}
|
|
83
83
|
setSuccessState() {
|
|
84
|
+
const event = new CustomEvent('toggleSwitchSuccess', { bubbles: true });
|
|
85
|
+
this.dispatchEvent(event);
|
|
84
86
|
this.setFinishedState(false);
|
|
85
87
|
}
|
|
86
|
-
setErrorState() {
|
|
88
|
+
setErrorState(message) {
|
|
89
|
+
const event = new CustomEvent('toggleSwitchError', { bubbles: true, detail: message });
|
|
90
|
+
this.dispatchEvent(event);
|
|
87
91
|
this.setFinishedState(true);
|
|
88
92
|
}
|
|
89
93
|
setFinishedState(error) {
|
|
@@ -102,24 +106,32 @@ let ToggleSwitchElement = class ToggleSwitchElement extends HTMLElement {
|
|
|
102
106
|
try {
|
|
103
107
|
if (!this.src)
|
|
104
108
|
throw new Error('invalid src');
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
let response;
|
|
110
|
+
try {
|
|
111
|
+
response = await fetch(this.src, {
|
|
112
|
+
credentials: 'same-origin',
|
|
113
|
+
method: 'POST',
|
|
114
|
+
headers: {
|
|
115
|
+
'Requested-With': 'XMLHttpRequest'
|
|
116
|
+
},
|
|
117
|
+
body
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
throw new Error('A network error occurred, please try again.');
|
|
122
|
+
}
|
|
113
123
|
if (response.ok) {
|
|
114
124
|
this.setSuccessState();
|
|
115
125
|
this.performToggle();
|
|
116
126
|
}
|
|
117
127
|
else {
|
|
118
|
-
|
|
128
|
+
throw new Error(await response.text());
|
|
119
129
|
}
|
|
120
130
|
}
|
|
121
131
|
catch (error) {
|
|
122
|
-
|
|
132
|
+
if (error instanceof Error) {
|
|
133
|
+
this.setErrorState(error.message || 'An error occurred, please try again.');
|
|
134
|
+
}
|
|
123
135
|
}
|
|
124
136
|
}
|
|
125
137
|
};
|
|
@@ -197,9 +197,6 @@ class ToolTipElement extends HTMLElement {
|
|
|
197
197
|
}
|
|
198
198
|
this.hiddenFromView = true;
|
|
199
199
|
__classPrivateFieldSet(this, _ToolTipElement_allowUpdatePosition, true, "f");
|
|
200
|
-
if (!this.id) {
|
|
201
|
-
this.id = `tooltip-${Date.now()}-${(Math.random() * 10000).toFixed(0)}`;
|
|
202
|
-
}
|
|
203
200
|
if (!this.control)
|
|
204
201
|
return;
|
|
205
202
|
this.setAttribute('role', 'tooltip');
|
|
@@ -1 +1,41 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "alpha/underline_nav",
|
|
3
|
+
"selectors": [
|
|
4
|
+
".UnderlineNav",
|
|
5
|
+
".UnderlineNav .Counter",
|
|
6
|
+
".UnderlineNav .Counter--primary",
|
|
7
|
+
".UnderlineNav-body",
|
|
8
|
+
".UnderlineNav-item",
|
|
9
|
+
".UnderlineNav-item:focus",
|
|
10
|
+
".UnderlineNav-item:focus-visible",
|
|
11
|
+
".UnderlineNav-item:hover",
|
|
12
|
+
".UnderlineNav-item [data-content]:before",
|
|
13
|
+
".UnderlineNav-item:before",
|
|
14
|
+
".UnderlineNav-item.selected",
|
|
15
|
+
".UnderlineNav-item[aria-current]:not([aria-current=false])",
|
|
16
|
+
".UnderlineNav-item[role=tab][aria-selected=true]",
|
|
17
|
+
".UnderlineNav-item.selected:after",
|
|
18
|
+
".UnderlineNav-item[aria-current]:not([aria-current=false]):after",
|
|
19
|
+
".UnderlineNav-item[role=tab][aria-selected=true]:after",
|
|
20
|
+
".UnderlineNav--right",
|
|
21
|
+
".UnderlineNav--right .UnderlineNav-actions",
|
|
22
|
+
".UnderlineNav-actions",
|
|
23
|
+
".UnderlineNav--full",
|
|
24
|
+
".UnderlineNav--full .UnderlineNav-body",
|
|
25
|
+
".UnderlineNav-octicon",
|
|
26
|
+
".UnderlineNav-container"
|
|
27
|
+
],
|
|
28
|
+
"classes": [
|
|
29
|
+
"UnderlineNav",
|
|
30
|
+
"Counter",
|
|
31
|
+
"Counter--primary",
|
|
32
|
+
"UnderlineNav-body",
|
|
33
|
+
"UnderlineNav-item",
|
|
34
|
+
"selected",
|
|
35
|
+
"UnderlineNav--right",
|
|
36
|
+
"UnderlineNav-actions",
|
|
37
|
+
"UnderlineNav--full",
|
|
38
|
+
"UnderlineNav-octicon",
|
|
39
|
+
"UnderlineNav-container"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AnchorAlignment, AnchorSide, PositionSettings } from '@primer/behaviors';
|
|
2
|
+
export default class AnchoredPositionElement extends HTMLElement implements PositionSettings {
|
|
3
|
+
#private;
|
|
4
|
+
get align(): AnchorAlignment;
|
|
5
|
+
set align(value: AnchorAlignment);
|
|
6
|
+
get side(): AnchorSide;
|
|
7
|
+
set side(value: AnchorSide);
|
|
8
|
+
get anchorOffset(): number;
|
|
9
|
+
set anchorOffset(value: number | 'normal' | 'spacious');
|
|
10
|
+
get anchor(): string;
|
|
11
|
+
set anchor(value: string);
|
|
12
|
+
get anchorElement(): HTMLElement | null;
|
|
13
|
+
set anchorElement(value: HTMLElement | null);
|
|
14
|
+
get alignmentOffset(): number;
|
|
15
|
+
set alignmentOffset(value: number);
|
|
16
|
+
get allowOutOfBounds(): boolean;
|
|
17
|
+
set allowOutOfBounds(value: boolean);
|
|
18
|
+
connectedCallback(): void;
|
|
19
|
+
static observedAttributes: string[];
|
|
20
|
+
attributeChangedCallback(): void;
|
|
21
|
+
update(): void;
|
|
22
|
+
}
|
|
23
|
+
declare global {
|
|
24
|
+
interface Window {
|
|
25
|
+
AnchoredPositionElement: typeof AnchoredPositionElement;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
+
};
|
|
12
|
+
var _AnchoredPositionElement_anchorElement, _AnchoredPositionElement_animationFrame;
|
|
13
|
+
import { getAnchoredPosition } from '@primer/behaviors';
|
|
14
|
+
const updateWhenVisible = (() => {
|
|
15
|
+
const anchors = new Set();
|
|
16
|
+
let intersectionObserver = null;
|
|
17
|
+
let resizeObserver = null;
|
|
18
|
+
function updateVisibleAnchors() {
|
|
19
|
+
for (const anchor of anchors) {
|
|
20
|
+
anchor.update();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return (el) => {
|
|
24
|
+
// eslint-disable-next-line github/prefer-observers
|
|
25
|
+
window.addEventListener('resize', updateVisibleAnchors);
|
|
26
|
+
intersectionObserver || (intersectionObserver = new IntersectionObserver(entries => {
|
|
27
|
+
for (const entry of entries) {
|
|
28
|
+
const target = entry.target;
|
|
29
|
+
if (entry.isIntersecting) {
|
|
30
|
+
target.update();
|
|
31
|
+
anchors.add(target);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
anchors.delete(target);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
resizeObserver || (resizeObserver = new ResizeObserver(() => {
|
|
39
|
+
for (const anchor of anchors) {
|
|
40
|
+
anchor.update();
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
resizeObserver.observe(el.ownerDocument.documentElement);
|
|
44
|
+
intersectionObserver.observe(el);
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
export default class AnchoredPositionElement extends HTMLElement {
|
|
48
|
+
constructor() {
|
|
49
|
+
super(...arguments);
|
|
50
|
+
_AnchoredPositionElement_anchorElement.set(this, null);
|
|
51
|
+
_AnchoredPositionElement_animationFrame.set(this, void 0);
|
|
52
|
+
}
|
|
53
|
+
get align() {
|
|
54
|
+
const value = this.getAttribute('align');
|
|
55
|
+
if (value === 'center' || value === 'end')
|
|
56
|
+
return value;
|
|
57
|
+
return 'start';
|
|
58
|
+
}
|
|
59
|
+
set align(value) {
|
|
60
|
+
this.setAttribute('align', `${value}`);
|
|
61
|
+
}
|
|
62
|
+
get side() {
|
|
63
|
+
const value = this.getAttribute('side');
|
|
64
|
+
if (value === 'inside-top' ||
|
|
65
|
+
value === 'inside-bottom' ||
|
|
66
|
+
value === 'inside-left' ||
|
|
67
|
+
value === 'inside-right' ||
|
|
68
|
+
value === 'inside-center' ||
|
|
69
|
+
value === 'outside-top' ||
|
|
70
|
+
value === 'outside-left' ||
|
|
71
|
+
value === 'outside-right') {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
return 'outside-bottom';
|
|
75
|
+
}
|
|
76
|
+
set side(value) {
|
|
77
|
+
this.setAttribute('side', `${value}`);
|
|
78
|
+
}
|
|
79
|
+
get anchorOffset() {
|
|
80
|
+
const alias = this.getAttribute('anchor-offset');
|
|
81
|
+
if (alias === 'spacious' || alias === '8')
|
|
82
|
+
return 8;
|
|
83
|
+
return 4;
|
|
84
|
+
}
|
|
85
|
+
set anchorOffset(value) {
|
|
86
|
+
this.setAttribute('anchor-offset', `${value}`);
|
|
87
|
+
}
|
|
88
|
+
get anchor() {
|
|
89
|
+
return this.getAttribute('anchor') || '';
|
|
90
|
+
}
|
|
91
|
+
set anchor(value) {
|
|
92
|
+
this.setAttribute('anchor', `${value}`);
|
|
93
|
+
}
|
|
94
|
+
get anchorElement() {
|
|
95
|
+
if (__classPrivateFieldGet(this, _AnchoredPositionElement_anchorElement, "f"))
|
|
96
|
+
return __classPrivateFieldGet(this, _AnchoredPositionElement_anchorElement, "f");
|
|
97
|
+
const idRef = this.anchor;
|
|
98
|
+
if (!idRef)
|
|
99
|
+
return null;
|
|
100
|
+
return this.ownerDocument.getElementById(idRef);
|
|
101
|
+
}
|
|
102
|
+
set anchorElement(value) {
|
|
103
|
+
__classPrivateFieldSet(this, _AnchoredPositionElement_anchorElement, value, "f");
|
|
104
|
+
if (!__classPrivateFieldGet(this, _AnchoredPositionElement_anchorElement, "f")) {
|
|
105
|
+
this.removeAttribute('anchor');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
get alignmentOffset() {
|
|
109
|
+
return Number(this.getAttribute('alignment-offset'));
|
|
110
|
+
}
|
|
111
|
+
set alignmentOffset(value) {
|
|
112
|
+
this.setAttribute('alignment-offset', `${value}`);
|
|
113
|
+
}
|
|
114
|
+
get allowOutOfBounds() {
|
|
115
|
+
return this.hasAttribute('allow-out-of-bounds');
|
|
116
|
+
}
|
|
117
|
+
set allowOutOfBounds(value) {
|
|
118
|
+
this.toggleAttribute('allow-out-of-bounds', value);
|
|
119
|
+
}
|
|
120
|
+
connectedCallback() {
|
|
121
|
+
this.update();
|
|
122
|
+
this.addEventListener('beforetoggle', () => this.update());
|
|
123
|
+
updateWhenVisible(this);
|
|
124
|
+
}
|
|
125
|
+
attributeChangedCallback() {
|
|
126
|
+
this.update();
|
|
127
|
+
}
|
|
128
|
+
update() {
|
|
129
|
+
if (!this.isConnected)
|
|
130
|
+
return;
|
|
131
|
+
cancelAnimationFrame(__classPrivateFieldGet(this, _AnchoredPositionElement_animationFrame, "f"));
|
|
132
|
+
__classPrivateFieldSet(this, _AnchoredPositionElement_animationFrame, requestAnimationFrame(() => {
|
|
133
|
+
const anchor = this.anchorElement;
|
|
134
|
+
if (!anchor)
|
|
135
|
+
return;
|
|
136
|
+
const { left, top, anchorSide, anchorAlign } = getAnchoredPosition(this, anchor, this);
|
|
137
|
+
this.style.top = `${top}px`;
|
|
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
|
+
}), "f");
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
_AnchoredPositionElement_anchorElement = new WeakMap(), _AnchoredPositionElement_animationFrame = new WeakMap();
|
|
145
|
+
AnchoredPositionElement.observedAttributes = ['align', 'side', 'anchor', 'alignment-offset', 'allow-out-of-bounds'];
|
|
146
|
+
if (!customElements.get('anchored-position')) {
|
|
147
|
+
window.AnchoredPositionElement = AnchoredPositionElement;
|
|
148
|
+
customElements.define('anchored-position', AnchoredPositionElement);
|
|
149
|
+
}
|
|
@@ -1 +1,31 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "beta/avatar",
|
|
3
|
+
"selectors": [
|
|
4
|
+
".avatar",
|
|
5
|
+
".avatar-link",
|
|
6
|
+
".avatar-group-item",
|
|
7
|
+
".avatar-1",
|
|
8
|
+
".avatar-2",
|
|
9
|
+
".avatar-small",
|
|
10
|
+
".avatar-3",
|
|
11
|
+
".avatar-4",
|
|
12
|
+
".avatar-5",
|
|
13
|
+
".avatar-6",
|
|
14
|
+
".avatar-7",
|
|
15
|
+
".avatar-8"
|
|
16
|
+
],
|
|
17
|
+
"classes": [
|
|
18
|
+
"avatar",
|
|
19
|
+
"avatar-link",
|
|
20
|
+
"avatar-group-item",
|
|
21
|
+
"avatar-1",
|
|
22
|
+
"avatar-2",
|
|
23
|
+
"avatar-small",
|
|
24
|
+
"avatar-3",
|
|
25
|
+
"avatar-4",
|
|
26
|
+
"avatar-5",
|
|
27
|
+
"avatar-6",
|
|
28
|
+
"avatar-7",
|
|
29
|
+
"avatar-8"
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "beta/avatar_stack",
|
|
3
|
+
"selectors": [
|
|
4
|
+
".AvatarStack",
|
|
5
|
+
".AvatarStack .AvatarStack-body",
|
|
6
|
+
".AvatarStack.AvatarStack--two",
|
|
7
|
+
".AvatarStack.AvatarStack--three-plus",
|
|
8
|
+
".AvatarStack-body",
|
|
9
|
+
".AvatarStack-body .avatar",
|
|
10
|
+
".AvatarStack-body .avatar:first-child",
|
|
11
|
+
".AvatarStack-body .avatar:last-child",
|
|
12
|
+
".AvatarStack-body .avatar img",
|
|
13
|
+
".AvatarStack-body .avatar:nth-child(n+4)",
|
|
14
|
+
".AvatarStack-body:hover .avatar",
|
|
15
|
+
".AvatarStack-body:hover .avatar:nth-child(n+4)",
|
|
16
|
+
".AvatarStack-body:hover .avatar-more",
|
|
17
|
+
".avatar.avatar-more",
|
|
18
|
+
".avatar.avatar-more:after",
|
|
19
|
+
".avatar.avatar-more:before",
|
|
20
|
+
".AvatarStack--right .AvatarStack-body",
|
|
21
|
+
".AvatarStack--right .AvatarStack-body:hover .avatar",
|
|
22
|
+
".AvatarStack--right .AvatarStack-body .avatar:not(:last-child)",
|
|
23
|
+
".AvatarStack--right .avatar.avatar-more",
|
|
24
|
+
".AvatarStack--right .avatar.avatar-more:before",
|
|
25
|
+
".AvatarStack--right .avatar.avatar-more:after",
|
|
26
|
+
".AvatarStack--right .avatar"
|
|
27
|
+
],
|
|
28
|
+
"classes": [
|
|
29
|
+
"AvatarStack",
|
|
30
|
+
"AvatarStack-body",
|
|
31
|
+
"AvatarStack--two",
|
|
32
|
+
"AvatarStack--three-plus",
|
|
33
|
+
"avatar",
|
|
34
|
+
"avatar-more",
|
|
35
|
+
"AvatarStack--right"
|
|
36
|
+
]
|
|
37
|
+
}
|