@primer/view-components 0.1.0-rc.d6eb7cd7 → 0.1.0-rc.dfa70354

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.
Files changed (62) hide show
  1. package/app/assets/javascripts/primer_view_components.js +1 -1
  2. package/app/assets/javascripts/primer_view_components.js.map +1 -1
  3. package/app/assets/styles/primer_view_components.css +2 -2
  4. package/app/assets/styles/primer_view_components.css.map +1 -1
  5. package/app/components/primer/alpha/action_list.css.json +164 -1
  6. package/app/components/primer/alpha/auto_complete.css.json +34 -1
  7. package/app/components/primer/alpha/banner.css.json +38 -1
  8. package/app/components/primer/alpha/button_marketing.css.json +43 -1
  9. package/app/components/primer/alpha/dialog.css.json +145 -1
  10. package/app/components/primer/alpha/dropdown.css.json +61 -1
  11. package/app/components/primer/alpha/layout.css.json +107 -1
  12. package/app/components/primer/alpha/menu.css.json +39 -1
  13. package/app/components/primer/alpha/modal_dialog.js +2 -0
  14. package/app/components/primer/alpha/nav_list.d.ts +6 -3
  15. package/app/components/primer/alpha/nav_list.js +98 -6
  16. package/app/components/primer/alpha/overlay.css +1 -0
  17. package/app/components/primer/alpha/overlay.css.json +11 -0
  18. package/app/components/primer/alpha/segmented_control.css +1 -1
  19. package/app/components/primer/alpha/segmented_control.css.json +46 -1
  20. package/app/components/primer/alpha/tab_nav.css.json +34 -1
  21. package/app/components/primer/alpha/text_field.css +2 -2
  22. package/app/components/primer/alpha/text_field.css.json +172 -1
  23. package/app/components/primer/alpha/toggle_switch.css +1 -1
  24. package/app/components/primer/alpha/toggle_switch.css.json +56 -1
  25. package/app/components/primer/alpha/toggle_switch.js +23 -11
  26. package/app/components/primer/alpha/tool_tip.js +0 -3
  27. package/app/components/primer/alpha/underline_nav.css.json +41 -1
  28. package/app/components/primer/anchored_position.d.ts +27 -0
  29. package/app/components/primer/anchored_position.js +149 -0
  30. package/app/components/primer/beta/avatar.css.json +31 -1
  31. package/app/components/primer/beta/avatar_stack.css.json +37 -1
  32. package/app/components/primer/beta/blankslate.css.json +34 -1
  33. package/app/components/primer/beta/border_box.css.json +86 -1
  34. package/app/components/primer/beta/breadcrumbs.css.json +15 -1
  35. package/app/components/primer/beta/button.css +1 -1
  36. package/app/components/primer/beta/button.css.json +93 -1
  37. package/app/components/primer/beta/counter.css.json +16 -1
  38. package/app/components/primer/beta/flash.css.json +42 -1
  39. package/app/components/primer/beta/label.css.json +45 -1
  40. package/app/components/primer/beta/link.css.json +27 -1
  41. package/app/components/primer/beta/popover.css.json +57 -1
  42. package/app/components/primer/beta/progress_bar.css.json +16 -1
  43. package/app/components/primer/beta/state.css.json +23 -1
  44. package/app/components/primer/beta/subhead.css.json +20 -1
  45. package/app/components/primer/beta/timeline_item.css.json +25 -1
  46. package/app/components/primer/beta/truncate.css.json +18 -1
  47. package/app/components/primer/primer.d.ts +4 -2
  48. package/app/components/primer/primer.js +4 -2
  49. package/app/components/primer/truncate.css.json +20 -1
  50. package/lib/primer/forms/toggle_switch_input.d.ts +5 -0
  51. package/lib/primer/forms/toggle_switch_input.js +29 -0
  52. package/package.json +4 -2
  53. package/static/arguments.json +1344 -1428
  54. package/static/audited_at.json +12 -24
  55. package/static/classes.json +311 -0
  56. package/static/constants.json +27 -71
  57. package/static/previews.json +1812 -0
  58. package/static/statuses.json +10 -22
  59. package/app/components/primer/time_ago_component.d.ts +0 -1
  60. package/app/components/primer/time_ago_component.js +0 -1
  61. /package/app/components/primer/{local_time.d.ts → beta/relative_time.d.ts} +0 -0
  62. /package/app/components/primer/{local_time.js → beta/relative_time.js} +0 -0
@@ -1 +1,172 @@
1
- {"name":"alpha/text_field","selectors":[".FormControl",".FormControl--fullWidth",".FormControl-label",".FormControl-caption",".FormControl-inlineValidation",".FormControl-inlineValidation p",".FormControl-input",".FormControl-select",".FormControl-textarea",".FormControl-input[disabled]",".FormControl-select[disabled]",".FormControl-textarea[disabled]",".FormControl-input[invalid]:not(:focus)",".FormControl-select[invalid]:not(:focus)",".FormControl-textarea[invalid]:not(:focus)",".FormControl-input:not([type=checkbox]","[type=radio]):focus",".FormControl-select:not([type=checkbox]",".FormControl-textarea:not([type=checkbox]","[type=radio]):focus:not(:focus-visible)","[type=radio]):focus-visible",".FormControl-input[disabled]::placeholder",".FormControl-select[disabled]::placeholder",".FormControl-textarea[disabled]::placeholder",".FormControl-input[readonly]",".FormControl-select[readonly]",".FormControl-textarea[readonly]",".FormControl-input::placeholder",".FormControl-select::placeholder",".FormControl-textarea::placeholder",".FormControl-input.FormControl-small",".FormControl-select.FormControl-small",".FormControl-textarea.FormControl-small",".FormControl-input.FormControl-medium",".FormControl-select.FormControl-medium",".FormControl-textarea.FormControl-medium",".FormControl-input.FormControl-large",".FormControl-select.FormControl-large",".FormControl-textarea.FormControl-large",".FormControl-input.FormControl-inset",".FormControl-select.FormControl-inset",".FormControl-textarea.FormControl-inset",".FormControl-input.FormControl-inset:focus",".FormControl-input.FormControl-inset:focus-visible",".FormControl-select.FormControl-inset:focus",".FormControl-select.FormControl-inset:focus-visible",".FormControl-textarea.FormControl-inset:focus",".FormControl-textarea.FormControl-inset:focus-visible",".FormControl-input.FormControl-monospace",".FormControl-select.FormControl-monospace",".FormControl-textarea.FormControl-monospace",".FormControl-input.FormControl-error",".FormControl-select.FormControl-error",".FormControl-textarea.FormControl-error",".FormControl-input.FormControl-success",".FormControl-select.FormControl-success",".FormControl-textarea.FormControl-success",".FormControl-input.FormControl-warning",".FormControl-select.FormControl-warning",".FormControl-textarea.FormControl-warning",".FormControl-input-wrap",".FormControl-input-wrap .FormControl-input-leadingVisualWrap",".FormControl-input-wrap .FormControl-input-leadingVisualWrap .FormControl-input-leadingVisual",".FormControl-input-wrap .FormControl-input-trailingAction",".FormControl-input-wrap .FormControl-input-trailingAction svg",".FormControl-input-wrap .FormControl-input-trailingAction[disabled]",".FormControl-input-wrap .FormControl-input-trailingAction:hover",".FormControl-input-wrap .FormControl-input-trailingAction:active",".FormControl-input-wrap .FormControl-input-trailingAction.FormControl-input-trailingAction--divider:before",".FormControl-input-wrap .FormControl-input-trailingAction:after",".FormControl-input-wrap.FormControl-input-wrap--leadingVisual .FormControl-input",".FormControl-input-wrap.FormControl-input-wrap--trailingAction .FormControl-input",".FormControl-input-wrap.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input",".FormControl-input-wrap.FormControl-small .FormControl-input-leadingVisualWrap",".FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-small",".FormControl-input-wrap.FormControl-small.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-small",".FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction",".FormControl-input-wrap.FormControl-small .FormControl-input-trailingAction:before",".FormControl-input-wrap.FormControl-large .FormControl-input-leadingVisualWrap",".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--leadingVisual .FormControl-input.FormControl-large",".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction .FormControl-input.FormControl-large",".FormControl-input-wrap.FormControl-large.FormControl-input-wrap--trailingAction.FormControl-input-wrap-trailingAction--divider .FormControl-input.FormControl-large",".FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction",".FormControl-input-wrap.FormControl-large .FormControl-input-trailingAction:before",".FormControl-select-wrap",".FormControl-select-wrap:after",".FormControl-select-wrap .FormControl-select",".FormControl-checkbox-wrap",".FormControl-radio-wrap",".FormControl-checkbox-wrap .FormControl-checkbox-labelWrap",".FormControl-checkbox-wrap .FormControl-radio-labelWrap",".FormControl-radio-wrap .FormControl-checkbox-labelWrap",".FormControl-radio-wrap .FormControl-radio-labelWrap",".FormControl-checkbox-wrap .FormControl-label",".FormControl-radio-wrap .FormControl-label","input[type=checkbox].FormControl-checkbox","input.FormControl-checkbox[type=checkbox][disabled]","input.FormControl-checkbox[type=checkbox][invalid]:not(:focus)","input.FormControl-checkbox[type=checkbox]:not([type=checkbox]","input.FormControl-checkbox[type=checkbox]:before","input.FormControl-checkbox[type=checkbox]:after","input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-checkbox-labelWrap .FormControl-label","input.FormControl-checkbox[type=checkbox][disabled]~.FormControl-radio-labelWrap .FormControl-label","input.FormControl-checkbox[type=checkbox]:checked","input.FormControl-checkbox[type=checkbox]:checked:before","input.FormControl-checkbox[type=checkbox]:checked:disabled","input.FormControl-checkbox[type=checkbox]:checked:disabled:before","input.FormControl-checkbox[type=checkbox]:focus-visible","input.FormControl-checkbox[type=checkbox]:indeterminate:before","input[type=radio].FormControl-radio","input.FormControl-radio[type=radio][disabled]","input.FormControl-radio[type=radio][invalid]:not(:focus)","input.FormControl-radio[type=radio]:not([type=checkbox]","input.FormControl-radio[type=radio]:after","input.FormControl-radio[type=radio]:checked","input.FormControl-radio[type=radio]:checked:disabled","input.FormControl-radio[type=radio]:focus-visible","0%","to"]}
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:hover .ToggleSwitch-knob{background-color:var(--color-btn-hover-bg)}.ToggleSwitch:active .ToggleSwitch-knob{background-color:var(--color-btn-active-bg)}.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:0}@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-canvas-subtle);border-color:var(--color-border-subtle)}.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active,.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover{background-color:var(--color-canvas-subtle)}.ToggleSwitch-track[aria-checked=true][aria-disabled=true] .ToggleSwitch-knob,.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active .ToggleSwitch-knob,.ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover .ToggleSwitch-knob{background-color:var(--color-switch-knob-checked-disabled-bg)}.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]:hover{background-color:var(--color-switch-track-checked-hover-bg)}.ToggleSwitch-track[aria-checked=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:0;transform:translateX(calc(100% + 1px))}.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-canvas-subtle);border-color:var(--color-border-subtle);cursor:not-allowed;transition-property:none}.ToggleSwitch-track[aria-disabled=true]:active .ToggleSwitch-knob,.ToggleSwitch-track[aria-disabled=true]:hover .ToggleSwitch-knob{background-color:var(--color-btn-bg)}.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob{border-color:var(--color-border-default);box-shadow:none}.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:active,.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:hover{background-color:var(--color-btn-bg)}.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-circleIcon,.ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-lineIcon{color:var(--color-fg-subtle)}.ToggleSwitch-icons{align-items:center;display:flex;height:100%;overflow:hidden;width:100%}.ToggleSwitch-lineIcon{color:var(--color-accent-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-fg-default);transform:translateX(0)}.ToggleSwitch-knob{background-color:var(--color-btn-bg);border:var(--primer-borderWidth-thin,1px) solid var(--color-switch-track-border);border-radius:var(--primer-borderRadius-medium,6px);bottom:-1px;box-shadow:var(--color-shadow-medium),var(--color-btn-inset-shadow);position:absolute;top:-1px;transform:translateX(-1px);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--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
+ .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
- {"name":"alpha/toggle_switch","selectors":[".ToggleSwitch",".ToggleSwitch.ToggleSwitch",".ToggleSwitch:hover .ToggleSwitch-knob",".ToggleSwitch:active .ToggleSwitch-knob",".ToggleSwitch--checked .ToggleSwitch-statusOn",".ToggleSwitch--checked .ToggleSwitch-statusOff",".ToggleSwitch-track",".ToggleSwitch-track:focus",".ToggleSwitch-track:focus-visible",".ToggleSwitch-track:before",".ToggleSwitch-track *",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover",".ToggleSwitch-track[aria-checked=true][aria-disabled=true] .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:active .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true][aria-disabled=true]:hover .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true]",".ToggleSwitch-track[aria-checked=true]:hover",".ToggleSwitch-track[aria-checked=true]:active",".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-knob",".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-lineIcon",".ToggleSwitch-track[aria-checked=true] .ToggleSwitch-circleIcon",".ToggleSwitch-track[aria-disabled=true]",".ToggleSwitch-track[aria-disabled=true]:active .ToggleSwitch-knob",".ToggleSwitch-track[aria-disabled=true]:hover .ToggleSwitch-knob",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:active",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-knob:hover",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-circleIcon",".ToggleSwitch-track[aria-disabled=true] .ToggleSwitch-lineIcon",".ToggleSwitch-icons",".ToggleSwitch-lineIcon",".ToggleSwitch-circleIcon",".ToggleSwitch-knob",".ToggleSwitch-status",".ToggleSwitch--small .ToggleSwitch-status",".ToggleSwitch--small .ToggleSwitch-track",".ToggleSwitch--disabled .ToggleSwitch-status",".ToggleSwitch-statusOn",".ToggleSwitch-statusOff",".ToggleSwitch--statusAtEnd",".ToggleSwitch--statusAtEnd .ToggleSwitch-status"]}
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
- const response = await fetch(this.src, {
106
- credentials: 'same-origin',
107
- method: 'POST',
108
- headers: {
109
- 'Requested-With': 'XMLHttpRequest'
110
- },
111
- body
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
- this.setErrorState();
128
+ throw new Error(await response.text());
119
129
  }
120
130
  }
121
131
  catch (error) {
122
- this.setErrorState();
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
- {"name":"alpha/underline_nav","selectors":[".UnderlineNav",".UnderlineNav .Counter",".UnderlineNav .Counter--primary",".UnderlineNav-body",".UnderlineNav-item",".UnderlineNav-item:focus",".UnderlineNav-item:focus-visible",".UnderlineNav-item:hover",".UnderlineNav-item [data-content]:before",".UnderlineNav-item:before",".UnderlineNav-item.selected",".UnderlineNav-item[aria-current]:not([aria-current=false])",".UnderlineNav-item[role=tab][aria-selected=true]",".UnderlineNav-item.selected:after",".UnderlineNav-item[aria-current]:not([aria-current=false]):after",".UnderlineNav-item[role=tab][aria-selected=true]:after",".UnderlineNav--right",".UnderlineNav--right .UnderlineNav-actions",".UnderlineNav-actions",".UnderlineNav--full",".UnderlineNav--full .UnderlineNav-body",".UnderlineNav-octicon",".UnderlineNav-container"]}
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
- {"name":"beta/avatar","selectors":[".avatar",".avatar-link",".avatar-group-item",".avatar-1",".avatar-2",".avatar-small",".avatar-3",".avatar-4",".avatar-5",".avatar-6",".avatar-7",".avatar-8"]}
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
- {"name":"beta/avatar_stack","selectors":[".AvatarStack",".AvatarStack .AvatarStack-body",".AvatarStack.AvatarStack--two",".AvatarStack.AvatarStack--three-plus",".AvatarStack-body",".AvatarStack-body .avatar",".AvatarStack-body .avatar:first-child",".AvatarStack-body .avatar:last-child",".AvatarStack-body .avatar img",".AvatarStack-body .avatar:nth-child(n+4)",".AvatarStack-body:hover .avatar",".AvatarStack-body:hover .avatar:nth-child(n+4)",".AvatarStack-body:hover .avatar-more",".avatar.avatar-more",".avatar.avatar-more:after",".avatar.avatar-more:before",".AvatarStack--right .AvatarStack-body",".AvatarStack--right .AvatarStack-body:hover .avatar",".AvatarStack--right .AvatarStack-body .avatar:not(:last-child)",".AvatarStack--right .avatar.avatar-more",".AvatarStack--right .avatar.avatar-more:before",".AvatarStack--right .avatar.avatar-more:after",".AvatarStack--right .avatar"]}
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
+ }