@openproject/primer-view-components 0.0.0-20230808124600

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 (143) hide show
  1. package/LICENSE.txt +21 -0
  2. package/README.md +21 -0
  3. package/app/assets/javascripts/app/components/primer/alpha/action_bar_element.d.ts +16 -0
  4. package/app/assets/javascripts/app/components/primer/alpha/action_menu/action_menu_element.d.ts +31 -0
  5. package/app/assets/javascripts/app/components/primer/alpha/dropdown/menu.d.ts +1 -0
  6. package/app/assets/javascripts/app/components/primer/alpha/dropdown.d.ts +1 -0
  7. package/app/assets/javascripts/app/components/primer/alpha/image_crop.d.ts +1 -0
  8. package/app/assets/javascripts/app/components/primer/alpha/modal_dialog.d.ts +18 -0
  9. package/app/assets/javascripts/app/components/primer/alpha/nav_list.d.ts +28 -0
  10. package/app/assets/javascripts/app/components/primer/alpha/segmented_control.d.ts +12 -0
  11. package/app/assets/javascripts/app/components/primer/alpha/tab_container.d.ts +1 -0
  12. package/app/assets/javascripts/app/components/primer/alpha/toggle_switch.d.ts +30 -0
  13. package/app/assets/javascripts/app/components/primer/alpha/tool_tip.d.ts +26 -0
  14. package/app/assets/javascripts/app/components/primer/alpha/x_banner.d.ts +13 -0
  15. package/app/assets/javascripts/app/components/primer/anchored_position.d.ts +27 -0
  16. package/app/assets/javascripts/app/components/primer/beta/auto_complete/auto_complete.d.ts +1 -0
  17. package/app/assets/javascripts/app/components/primer/beta/clipboard_copy.d.ts +1 -0
  18. package/app/assets/javascripts/app/components/primer/beta/relative_time.d.ts +1 -0
  19. package/app/assets/javascripts/app/components/primer/focus_group.d.ts +19 -0
  20. package/app/assets/javascripts/app/components/primer/primer.d.ts +21 -0
  21. package/app/assets/javascripts/lib/primer/forms/primer_multi_input.d.ts +10 -0
  22. package/app/assets/javascripts/lib/primer/forms/primer_text_field.d.ts +1 -0
  23. package/app/assets/javascripts/lib/primer/forms/toggle_switch_input.d.ts +5 -0
  24. package/app/assets/javascripts/primer_view_components.js +2 -0
  25. package/app/assets/javascripts/primer_view_components.js.map +1 -0
  26. package/app/assets/styles/primer_view_components.css +1 -0
  27. package/app/assets/styles/primer_view_components.css.map +1 -0
  28. package/app/components/primer/alpha/action_bar.css +1 -0
  29. package/app/components/primer/alpha/action_bar.css.json +17 -0
  30. package/app/components/primer/alpha/action_bar_element.d.ts +16 -0
  31. package/app/components/primer/alpha/action_bar_element.js +172 -0
  32. package/app/components/primer/alpha/action_list.css +1 -0
  33. package/app/components/primer/alpha/action_list.css.json +134 -0
  34. package/app/components/primer/alpha/action_menu/action_menu_element.d.ts +31 -0
  35. package/app/components/primer/alpha/action_menu/action_menu_element.js +241 -0
  36. package/app/components/primer/alpha/auto_complete.css +1 -0
  37. package/app/components/primer/alpha/auto_complete.css.json +23 -0
  38. package/app/components/primer/alpha/banner.css +1 -0
  39. package/app/components/primer/alpha/banner.css.json +24 -0
  40. package/app/components/primer/alpha/button_marketing.css +1 -0
  41. package/app/components/primer/alpha/button_marketing.css.json +33 -0
  42. package/app/components/primer/alpha/dialog.css +1 -0
  43. package/app/components/primer/alpha/dialog.css.json +80 -0
  44. package/app/components/primer/alpha/dropdown/menu.d.ts +1 -0
  45. package/app/components/primer/alpha/dropdown/menu.js +1 -0
  46. package/app/components/primer/alpha/dropdown.css +1 -0
  47. package/app/components/primer/alpha/dropdown.css.json +40 -0
  48. package/app/components/primer/alpha/dropdown.d.ts +1 -0
  49. package/app/components/primer/alpha/dropdown.js +1 -0
  50. package/app/components/primer/alpha/image_crop.d.ts +1 -0
  51. package/app/components/primer/alpha/image_crop.js +1 -0
  52. package/app/components/primer/alpha/layout.css +1 -0
  53. package/app/components/primer/alpha/layout.css.json +80 -0
  54. package/app/components/primer/alpha/menu.css +1 -0
  55. package/app/components/primer/alpha/menu.css.json +28 -0
  56. package/app/components/primer/alpha/modal_dialog.d.ts +18 -0
  57. package/app/components/primer/alpha/modal_dialog.js +189 -0
  58. package/app/components/primer/alpha/nav_list.d.ts +28 -0
  59. package/app/components/primer/alpha/nav_list.js +248 -0
  60. package/app/components/primer/alpha/overlay.css +1 -0
  61. package/app/components/primer/alpha/overlay.css.json +8 -0
  62. package/app/components/primer/alpha/segmented_control.css +1 -0
  63. package/app/components/primer/alpha/segmented_control.css.json +33 -0
  64. package/app/components/primer/alpha/segmented_control.d.ts +12 -0
  65. package/app/components/primer/alpha/segmented_control.js +47 -0
  66. package/app/components/primer/alpha/tab_container.d.ts +1 -0
  67. package/app/components/primer/alpha/tab_container.js +1 -0
  68. package/app/components/primer/alpha/tab_nav.css +1 -0
  69. package/app/components/primer/alpha/tab_nav.css.json +24 -0
  70. package/app/components/primer/alpha/text_field.css +1 -0
  71. package/app/components/primer/alpha/text_field.css.json +135 -0
  72. package/app/components/primer/alpha/toggle_switch.css +1 -0
  73. package/app/components/primer/alpha/toggle_switch.css.json +40 -0
  74. package/app/components/primer/alpha/toggle_switch.d.ts +30 -0
  75. package/app/components/primer/alpha/toggle_switch.js +165 -0
  76. package/app/components/primer/alpha/tool_tip.d.ts +26 -0
  77. package/app/components/primer/alpha/tool_tip.js +427 -0
  78. package/app/components/primer/alpha/underline_nav.css +1 -0
  79. package/app/components/primer/alpha/underline_nav.css.json +28 -0
  80. package/app/components/primer/alpha/x_banner.d.ts +13 -0
  81. package/app/components/primer/alpha/x_banner.js +49 -0
  82. package/app/components/primer/anchored_position.d.ts +27 -0
  83. package/app/components/primer/anchored_position.js +147 -0
  84. package/app/components/primer/beta/auto_complete/auto_complete.d.ts +1 -0
  85. package/app/components/primer/beta/auto_complete/auto_complete.js +1 -0
  86. package/app/components/primer/beta/avatar.css +1 -0
  87. package/app/components/primer/beta/avatar.css.json +17 -0
  88. package/app/components/primer/beta/avatar_stack.css +1 -0
  89. package/app/components/primer/beta/avatar_stack.css.json +28 -0
  90. package/app/components/primer/beta/blankslate.css +1 -0
  91. package/app/components/primer/beta/blankslate.css.json +22 -0
  92. package/app/components/primer/beta/border_box.css +1 -0
  93. package/app/components/primer/beta/border_box.css.json +54 -0
  94. package/app/components/primer/beta/breadcrumbs.css +1 -0
  95. package/app/components/primer/beta/breadcrumbs.css.json +11 -0
  96. package/app/components/primer/beta/button.css +1 -0
  97. package/app/components/primer/beta/button.css.json +75 -0
  98. package/app/components/primer/beta/button_group.css +1 -0
  99. package/app/components/primer/beta/button_group.css.json +14 -0
  100. package/app/components/primer/beta/clipboard_copy.d.ts +1 -0
  101. package/app/components/primer/beta/clipboard_copy.js +43 -0
  102. package/app/components/primer/beta/counter.css +1 -0
  103. package/app/components/primer/beta/counter.css.json +10 -0
  104. package/app/components/primer/beta/flash.css +1 -0
  105. package/app/components/primer/beta/flash.css.json +27 -0
  106. package/app/components/primer/beta/label.css +1 -0
  107. package/app/components/primer/beta/label.css.json +25 -0
  108. package/app/components/primer/beta/link.css +1 -0
  109. package/app/components/primer/beta/link.css.json +19 -0
  110. package/app/components/primer/beta/popover.css +1 -0
  111. package/app/components/primer/beta/popover.css.json +39 -0
  112. package/app/components/primer/beta/progress_bar.css +1 -0
  113. package/app/components/primer/beta/progress_bar.css.json +10 -0
  114. package/app/components/primer/beta/relative_time.d.ts +1 -0
  115. package/app/components/primer/beta/relative_time.js +1 -0
  116. package/app/components/primer/beta/state.css +1 -0
  117. package/app/components/primer/beta/state.css.json +13 -0
  118. package/app/components/primer/beta/subhead.css +1 -0
  119. package/app/components/primer/beta/subhead.css.json +12 -0
  120. package/app/components/primer/beta/timeline_item.css +1 -0
  121. package/app/components/primer/beta/timeline_item.css.json +16 -0
  122. package/app/components/primer/beta/truncate.css +1 -0
  123. package/app/components/primer/beta/truncate.css.json +12 -0
  124. package/app/components/primer/focus_group.d.ts +19 -0
  125. package/app/components/primer/focus_group.js +139 -0
  126. package/app/components/primer/primer.d.ts +21 -0
  127. package/app/components/primer/primer.js +21 -0
  128. package/app/components/primer/truncate.css +1 -0
  129. package/app/components/primer/truncate.css.json +13 -0
  130. package/lib/primer/forms/primer_multi_input.d.ts +10 -0
  131. package/lib/primer/forms/primer_multi_input.js +45 -0
  132. package/lib/primer/forms/primer_text_field.d.ts +1 -0
  133. package/lib/primer/forms/primer_text_field.js +73 -0
  134. package/lib/primer/forms/toggle_switch_input.d.ts +5 -0
  135. package/lib/primer/forms/toggle_switch_input.js +34 -0
  136. package/package.json +101 -0
  137. package/static/arguments.json +4501 -0
  138. package/static/audited_at.json +107 -0
  139. package/static/classes.json +606 -0
  140. package/static/constants.json +1335 -0
  141. package/static/info_arch.json +14465 -0
  142. package/static/previews.json +6408 -0
  143. package/static/statuses.json +107 -0
@@ -0,0 +1,172 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8
+ if (kind === "m") throw new TypeError("Private method is not writable");
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10
+ 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");
11
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12
+ };
13
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
15
+ 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");
16
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
17
+ };
18
+ var _ActionBarElement_instances, _ActionBarElement_initialBarWidth, _ActionBarElement_previousBarWidth, _ActionBarElement_focusZoneAbortController, _ActionBarElement_itemGap, _ActionBarElement_availableSpace, _ActionBarElement_menuSpace, _ActionBarElement_shrink, _ActionBarElement_grow, _ActionBarElement_showItem, _ActionBarElement_hideItem, _ActionBarElement_menuItems_get;
19
+ import { controller, targets, target } from '@github/catalyst';
20
+ import { focusZone, FocusKeys } from '@primer/behaviors';
21
+ const instersectionObserver = new IntersectionObserver(entries => {
22
+ for (const entry of entries) {
23
+ const action = entry.target;
24
+ if (entry.isIntersecting && action instanceof ActionBarElement) {
25
+ action.update();
26
+ }
27
+ }
28
+ });
29
+ const resizeObserver = new ResizeObserver(entries => {
30
+ for (const entry of entries) {
31
+ const action = entry.target;
32
+ if (action instanceof ActionBarElement) {
33
+ action.update(entry.contentRect);
34
+ }
35
+ }
36
+ });
37
+ let ActionBarElement = class ActionBarElement extends HTMLElement {
38
+ constructor() {
39
+ super(...arguments);
40
+ _ActionBarElement_instances.add(this);
41
+ _ActionBarElement_initialBarWidth.set(this, void 0);
42
+ _ActionBarElement_previousBarWidth.set(this, void 0);
43
+ _ActionBarElement_focusZoneAbortController.set(this, null);
44
+ }
45
+ connectedCallback() {
46
+ var _a, _b, _c, _d;
47
+ __classPrivateFieldSet(this, _ActionBarElement_previousBarWidth, (_a = this.offsetWidth) !== null && _a !== void 0 ? _a : Infinity, "f");
48
+ __classPrivateFieldSet(this, _ActionBarElement_initialBarWidth, (_b = this.itemContainer.offsetWidth) !== null && _b !== void 0 ? _b : Infinity, "f");
49
+ // Calculate the width of all the items before hiding anything
50
+ for (const item of this.items) {
51
+ const width = item.getBoundingClientRect().width;
52
+ const marginLeft = parseInt((_c = window.getComputedStyle(item)) === null || _c === void 0 ? void 0 : _c.marginLeft, 10);
53
+ const marginRight = parseInt((_d = window.getComputedStyle(item)) === null || _d === void 0 ? void 0 : _d.marginRight, 10);
54
+ item.setAttribute('data-offset-width', `${width + marginLeft + marginRight}`);
55
+ }
56
+ resizeObserver.observe(this);
57
+ instersectionObserver.observe(this);
58
+ setTimeout(() => {
59
+ this.style.overflow = 'visible';
60
+ this.update();
61
+ }, 20); // Wait for the items to be rendered, making this really short to avoid a flash of unstyled content
62
+ }
63
+ disconnectedCallback() {
64
+ resizeObserver.unobserve(this);
65
+ instersectionObserver.unobserve(this);
66
+ }
67
+ menuItemClick(event) {
68
+ var _a;
69
+ const currentTarget = event.currentTarget;
70
+ const id = currentTarget === null || currentTarget === void 0 ? void 0 : currentTarget.getAttribute('data-for');
71
+ if (id) {
72
+ (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.click();
73
+ }
74
+ }
75
+ update(rect = this.getBoundingClientRect()) {
76
+ // Only recalculate if the bar width changed
77
+ if (rect.width <= __classPrivateFieldGet(this, _ActionBarElement_previousBarWidth, "f") || __classPrivateFieldGet(this, _ActionBarElement_previousBarWidth, "f") === 0) {
78
+ __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_shrink).call(this);
79
+ }
80
+ else if (rect.width > __classPrivateFieldGet(this, _ActionBarElement_previousBarWidth, "f")) {
81
+ __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_grow).call(this);
82
+ }
83
+ __classPrivateFieldSet(this, _ActionBarElement_previousBarWidth, rect.width, "f");
84
+ if (rect.width <= __classPrivateFieldGet(this, _ActionBarElement_initialBarWidth, "f")) {
85
+ this.style.justifyContent = 'space-between';
86
+ }
87
+ else {
88
+ this.style.justifyContent = 'flex-end';
89
+ }
90
+ if (__classPrivateFieldGet(this, _ActionBarElement_focusZoneAbortController, "f")) {
91
+ __classPrivateFieldGet(this, _ActionBarElement_focusZoneAbortController, "f").abort();
92
+ }
93
+ __classPrivateFieldSet(this, _ActionBarElement_focusZoneAbortController, focusZone(this.itemContainer, {
94
+ bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.HomeAndEnd,
95
+ focusOutBehavior: 'wrap',
96
+ focusableElementFilter: element => {
97
+ return !element.closest('.ActionBar-item[hidden]');
98
+ }
99
+ }), "f");
100
+ }
101
+ };
102
+ _ActionBarElement_initialBarWidth = new WeakMap(), _ActionBarElement_previousBarWidth = new WeakMap(), _ActionBarElement_focusZoneAbortController = new WeakMap(), _ActionBarElement_instances = new WeakSet(), _ActionBarElement_itemGap = function _ActionBarElement_itemGap() {
103
+ var _a;
104
+ return parseInt((_a = window.getComputedStyle(this.itemContainer)) === null || _a === void 0 ? void 0 : _a.columnGap, 10) || 0;
105
+ }, _ActionBarElement_availableSpace = function _ActionBarElement_availableSpace() {
106
+ // Get the offset of the item container from the container edge
107
+ return this.offsetWidth - this.itemContainer.offsetWidth;
108
+ }, _ActionBarElement_menuSpace = function _ActionBarElement_menuSpace() {
109
+ if (this.moreMenu.hidden) {
110
+ return 0;
111
+ }
112
+ return this.moreMenu.offsetWidth + __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_itemGap).call(this);
113
+ }, _ActionBarElement_shrink = function _ActionBarElement_shrink() {
114
+ if (this.items[0].hidden) {
115
+ return;
116
+ }
117
+ let index = this.items.length - 1;
118
+ for (const item of this.items.reverse()) {
119
+ if (!item.hidden && __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_availableSpace).call(this) < __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_menuSpace).call(this)) {
120
+ __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_hideItem).call(this, index);
121
+ }
122
+ else if (__classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_availableSpace).call(this) >= __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_menuSpace).call(this)) {
123
+ return;
124
+ }
125
+ index--;
126
+ }
127
+ }, _ActionBarElement_grow = function _ActionBarElement_grow() {
128
+ // If last item is visible, there is no need to grow
129
+ if (!this.items[this.items.length - 1].hidden) {
130
+ return;
131
+ }
132
+ let index = 0;
133
+ for (const item of this.items) {
134
+ if (item.hidden) {
135
+ const offsetWidth = Number(item.getAttribute('data-offset-width'));
136
+ if (__classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_availableSpace).call(this) >= __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_menuSpace).call(this) + offsetWidth || index === this.items.length - 1) {
137
+ __classPrivateFieldGet(this, _ActionBarElement_instances, "m", _ActionBarElement_showItem).call(this, index);
138
+ }
139
+ else {
140
+ return;
141
+ }
142
+ }
143
+ index++;
144
+ }
145
+ if (!this.items[this.items.length - 1].hidden) {
146
+ this.moreMenu.hidden = true;
147
+ }
148
+ }, _ActionBarElement_showItem = function _ActionBarElement_showItem(index) {
149
+ this.items[index].hidden = false;
150
+ __classPrivateFieldGet(this, _ActionBarElement_instances, "a", _ActionBarElement_menuItems_get)[index].hidden = true;
151
+ }, _ActionBarElement_hideItem = function _ActionBarElement_hideItem(index) {
152
+ this.items[index].hidden = true;
153
+ __classPrivateFieldGet(this, _ActionBarElement_instances, "a", _ActionBarElement_menuItems_get)[index].hidden = false;
154
+ if (this.moreMenu.hidden) {
155
+ this.moreMenu.hidden = false;
156
+ }
157
+ }, _ActionBarElement_menuItems_get = function _ActionBarElement_menuItems_get() {
158
+ return this.moreMenu.querySelectorAll('[role="menu"] > li');
159
+ };
160
+ __decorate([
161
+ targets
162
+ ], ActionBarElement.prototype, "items", void 0);
163
+ __decorate([
164
+ target
165
+ ], ActionBarElement.prototype, "itemContainer", void 0);
166
+ __decorate([
167
+ target
168
+ ], ActionBarElement.prototype, "moreMenu", void 0);
169
+ ActionBarElement = __decorate([
170
+ controller
171
+ ], ActionBarElement);
172
+ window.ActionBarElement = ActionBarElement;
@@ -0,0 +1 @@
1
+ :root{--actionListContent-paddingBlock:var(--control-medium-paddingBlock,0.375rem)}.ActionListHeader{margin-bottom:var(--base-size-16,1rem);margin-left:var(--base-size-8,.5rem)}.ActionListWrap{list-style:none}.ActionListWrap--inset{padding:var(--base-size-8,.5rem)}.ActionListWrap--divided .ActionListItem-label:before{height:1px}.ActionListWrap--divided .ActionListItem-descriptionWrap--inline:before,.ActionListWrap--divided .ActionListItem-label:before{background:var(--borderColor-muted,var(--color-action-list-item-inline-divider));content:"";display:block;position:absolute;top:calc(var(--actionListContent-paddingBlock)*-1);width:100%}.ActionListWrap--divided .ActionListItem-descriptionWrap--inline:before{height:var(--borderWidth-thin,max(1px,.0625rem))}.ActionListWrap--divided .ActionListItem-descriptionWrap--inline .ActionListItem-label:before{content:unset}.ActionList-sectionDivider+.ActionListItem .ActionListItem-descriptionWrap--inline:before,.ActionList-sectionDivider+.ActionListItem .ActionListItem-label:before,.ActionListItem:first-of-type .ActionListItem-descriptionWrap--inline:before,.ActionListItem:first-of-type .ActionListItem-label:before,.ActionListWrap--divided .ActionListItem--navActive .ActionListItem-label:before,.ActionListWrap--divided .ActionListItem--navActive+.ActionListItem .ActionListItem-label:before{visibility:hidden}.ActionListItem{background-color:var(--control-transparent-bgColor-rest,#0000);border-radius:var(--borderRadius-medium,6px);list-style:none;position:relative}.ActionListItem:active,.ActionListItem:hover{cursor:pointer}@media (hover:hover){.ActionListItem:hover .ActionListItem-descriptionWrap--inline:before,.ActionListItem:hover .ActionListItem-label:before,.ActionListItem:hover+.ActionListItem .ActionListItem-descriptionWrap--inline:before,.ActionListItem:hover+.ActionListItem .ActionListItem-label:before{visibility:hidden}}.ActionListItem[hidden]+.ActionList-sectionDivider{display:none}.ActionListItem.ActionListItem--hasSubItem>.ActionListContent{z-index:1}@media (hover:hover){.ActionListItem.ActionListItem--hasSubItem>.ActionListContent:hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg))}}.ActionListItem.ActionListItem--hasSubItem>.ActionListContent:active{background-color:var(--control-transparent-bgColor-active,var(--color-action-list-item-default-active-bg))}@media (hover:hover){.ActionListItem.ActionListItem--hasSubItem>.ActionListContent:hover,.ActionListItem:not(.ActionListItem--hasSubItem):hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg));cursor:pointer}.ActionListItem.ActionListItem--hasSubItem>.ActionListContent:hover:not(.ActionListItem--navActive,:focus-visible),.ActionListItem:not(.ActionListItem--hasSubItem):hover:not(.ActionListItem--navActive,:focus-visible){box-shadow:var(--boxShadow-thin,inset 0 0 0 max(1px,.0625rem)) var(--control-transparent-borderColor-active,var(--color-action-list-item-default-active-border));outline:solid var(--borderWidth-thin,max(1px,.0625rem)) #0000;outline-offset:calc(var(--borderWidth-thin,max(1px, .0625rem))*-1)}}.ActionListItem.ActionListItem--hasSubItem>.ActionListContent:active,.ActionListItem:not(.ActionListItem--hasSubItem):active{background:var(--control-transparent-bgColor-active,var(--color-action-list-item-default-active-bg))}.ActionListItem.ActionListItem--hasSubItem>.ActionListContent:active:not(.ActionListItem--navActive),.ActionListItem:not(.ActionListItem--hasSubItem):active:not(.ActionListItem--navActive){box-shadow:var(--boxShadow-thin,inset 0 0 0 max(1px,.0625rem)) var(--control-transparent-borderColor-active,var(--color-action-list-item-default-active-border));outline:solid var(--borderWidth-thin,max(1px,.0625rem)) #0000;outline-offset:calc(var(--borderWidth-thin,max(1px, .0625rem))*-1)}.ActionListItem.ActionListItem--hasSubItem>.ActionListContent:active .ActionListItem-label:before,.ActionListItem.ActionListItem--hasSubItem>.ActionListContent:active+.ActionListItem .ActionListItem-label:before,.ActionListItem:not(.ActionListItem--hasSubItem):active .ActionListItem-label:before,.ActionListItem:not(.ActionListItem--hasSubItem):active+.ActionListItem .ActionListItem-label:before{visibility:hidden}.ActionListItem[aria-selected=true]{background:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg));font-weight:var(--base-text-weight-normal,400)}@media (hover:hover){.ActionListItem[aria-selected=true]:hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg))}}.ActionListItem[aria-selected=true]+.ActionListItem:before,.ActionListItem[aria-selected=true]:before{visibility:hidden}.ActionListItem[aria-selected=true]:after{background:var(--borderColor-accent-emphasis,var(--color-accent-fg));border-radius:var(--borderRadius-medium,6px);content:"";height:var(--base-size-24,1.5rem);left:calc(var(--base-size-4,.25rem)*-1);position:absolute;top:calc(50% - 12px);width:var(--base-size-4,.25rem)}.ActionListItem.ActionListItem--navActive{outline:2px solid #0000}.ActionListItem.ActionListItem--navActive:not(.ActionListItem--subItem) .ActionListItem-label{font-weight:var(--base-text-weight-semibold,600)}.ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger){background:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg))}@media (hover:hover){.ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger):hover{background-color:var(--control-transparent-bgColor-hover,var(--color-action-list-item-default-hover-bg))}}.ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger)+.ActionListItem:before,.ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger):before{visibility:hidden}.ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger):after{background:var(--borderColor-accent-emphasis,var(--color-accent-fg));border-radius:var(--borderRadius-medium,6px);content:"";height:var(--base-size-24,1.5rem);left:calc(var(--base-size-8,.5rem)*-1);position:absolute;top:calc(50% - 12px);width:var(--base-size-4,.25rem)}.ActionListItem.ActionListItem--disabled .ActionListContent .ActionListItem-description,.ActionListItem.ActionListItem--disabled .ActionListContent .ActionListItem-label,.ActionListItem[aria-disabled=true] .ActionListContent .ActionListItem-description,.ActionListItem[aria-disabled=true] .ActionListContent .ActionListItem-label{color:var(--control-fgColor-disabled,var(--color-primer-fg-disabled))}.ActionListItem.ActionListItem--disabled .ActionListContent .ActionListItem-visual,.ActionListItem[aria-disabled=true] .ActionListContent .ActionListItem-visual{fill:var(--control-fgColor-disabled,var(--color-primer-fg-disabled))}@media (hover:hover){.ActionListItem.ActionListItem--disabled:hover,.ActionListItem[aria-disabled=true]:hover{background-color:initial;cursor:not-allowed}}.ActionListItem.ActionListItem--danger .ActionListItem-label,.ActionListItem.ActionListItem--danger .ActionListItem-visual{color:var(--control-danger-fgColor-rest,var(--color-danger-fg))}@media (hover:hover){.ActionListItem.ActionListItem--danger:hover{background:var(--control-danger-bgColor-hover,var(--color-action-list-item-danger-hover-bg))}.ActionListItem.ActionListItem--danger:hover .ActionListItem-description,.ActionListItem.ActionListItem--danger:hover .ActionListItem-label,.ActionListItem.ActionListItem--danger:hover .ActionListItem-visual{color:var(--control-danger-fgColor-hover,var(--color-action-list-item-danger-hover-text))}}.ActionListItem.ActionListItem--danger .ActionListContent:active{background:var(--control-danger-bgColor-active,var(--color-action-list-item-danger-active-bg))}.ActionListItem.ActionListItem--danger .ActionListContent:active .ActionListItem-description,.ActionListItem.ActionListItem--danger .ActionListContent:active .ActionListItem-label,.ActionListItem.ActionListItem--danger .ActionListContent:active .ActionListItem-visual{color:var(--control-danger-fgColor-hover,var(--color-action-list-item-danger-hover-text))}.ActionListContent{-webkit-tap-highlight-color:transparent;align-items:start;background-color:initial;border:none;border-radius:var(--borderRadius-medium,6px);color:var(--control-fgColor-rest,var(--color-fg-default));display:grid;grid-template-areas:"leadingAction leadingVisual label trailingVisual trailingAction";grid-template-columns:min-content min-content minmax(0,auto) min-content min-content;grid-template-rows:min-content;padding-block:var(--actionListContent-paddingBlock);padding-inline:var(--control-medium-paddingInline-condensed,.5rem);position:relative;text-align:left;touch-action:manipulation;transition:background 33.333ms linear;-webkit-user-select:none;user-select:none;width:100%}.ActionListContent>:not(:last-child){margin-right:var(--control-medium-gap,.5rem)}.ActionListContent:hover{text-decoration:none}.ActionListContent[aria-disabled=true] .ActionListItem-description,.ActionListContent[aria-disabled=true] .ActionListItem-label{color:var(--control-fgColor-disabled,var(--color-primer-fg-disabled))}.ActionListContent[aria-disabled=true] .ActionListItem-visual{fill:var(--control-fgColor-disabled,var(--color-primer-fg-disabled))}@media (hover:hover){.ActionListContent[aria-disabled=true]:hover{background-color:initial;cursor:not-allowed}}@media screen and (prefers-reduced-motion:no-preference){.ActionListContent[aria-expanded]+.ActionList--subGroup{transition:opacity .16s cubic-bezier(.25,1,.5,1),transform .16s cubic-bezier(.25,1,.5,1)}}.ActionListContent[aria-expanded]+.ActionList--subGroup .ActionListContent{padding-left:var(--base-size-24,1.5rem)}.ActionListContent.ActionListContent--visual16[aria-expanded]+.ActionList--subGroup .ActionListContent{padding-left:var(--base-size-32,2rem)}.ActionListContent.ActionListContent--visual20[aria-expanded]+.ActionList--subGroup .ActionListContent{padding-left:var(--base-size-36,2.25rem)}.ActionListContent.ActionListContent--visual24[aria-expanded]+.ActionList--subGroup .ActionListContent{padding-left:var(--base-size-40,2.5rem)}.ActionListContent[aria-expanded=true] .ActionListItem-collapseIcon{transform:scaleY(-1);transition:transform .12s linear}.ActionListContent[aria-expanded=true]+.ActionList--subGroup{height:auto;opacity:1;overflow:visible;transform:translateY(0);visibility:visible}.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=true]>.ActionListItem-label{font-weight:var(--base-text-weight-semibold,600)}.ActionListContent[aria-expanded=false] .ActionListItem-collapseIcon{transform:scaleY(1);transition:transform .12s linear}.ActionListContent[aria-expanded=false]+.ActionList--subGroup{height:0;opacity:0;overflow:hidden;transform:translateY(calc(var(--base-size-16,1rem)*-1));visibility:hidden}.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]{background:var(--control-transparent-bgColor-selected,var(--color-action-list-item-default-selected-bg))}.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false] .ActionListItem-label{font-weight:var(--base-text-weight-semibold,600)}.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]+.ActionListItem:before,.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]:before{visibility:hidden}.ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]:after{background:var(--borderColor-accent-emphasis,var(--color-accent-fg));border-radius:var(--borderRadius-medium,6px);content:"";height:var(--base-size-24,1.5rem);left:calc(var(--base-size-8,.5rem)*-1);position:absolute;top:calc(50% - 12px);width:var(--base-size-4,.25rem)}.ActionListContent[aria-checked=true] .ActionListItem-multiSelectCheckmark,.ActionListContent[aria-selected=true] .ActionListItem-multiSelectCheckmark{opacity:1;transition:visibility 0 linear 0,opacity 50ms;visibility:visible}.ActionListContent[aria-checked=true] .ActionListItem-singleSelectCheckmark,.ActionListContent[aria-selected=true] .ActionListItem-singleSelectCheckmark{visibility:visible}@media screen and (prefers-reduced-motion:no-preference){.ActionListContent[aria-checked=true] .ActionListItem-singleSelectCheckmark,.ActionListContent[aria-selected=true] .ActionListItem-singleSelectCheckmark{animation:checkmarkIn .2s cubic-bezier(.11,0,.5,0) forwards;@keyframes checkmarkIn{0%{clip-path:inset(16px 0 0 0)}to{clip-path:inset(0 0 0 0)}}}}.ActionListContent[aria-checked=true] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectIconRect,.ActionListContent[aria-selected=true] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectIconRect{fill:var(--control-checked-bgColor-rest,var(--color-switch-track-checked-bg));stroke:var(--control-checked-bgColor-rest,var(--color-switch-track-checked-bg));stroke-width:var(--borderWidth-thin,1px)}.ActionListContent[aria-checked=true] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectCheckmark,.ActionListContent[aria-selected=true] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectCheckmark{fill:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis))}.ActionListContent[aria-checked=false] .ActionListItem-multiSelectCheckmark,.ActionListContent[aria-selected=false] .ActionListItem-multiSelectCheckmark{opacity:0;transition:visibility 0 linear 50ms,opacity 50ms;visibility:hidden}.ActionListContent[aria-checked=false] .ActionListItem-singleSelectCheckmark,.ActionListContent[aria-selected=false] .ActionListItem-singleSelectCheckmark{clip-path:inset(16px 0 0 0);transition:visibility 0s linear .2s;visibility:hidden}@media screen and (prefers-reduced-motion:no-preference){.ActionListContent[aria-checked=false] .ActionListItem-singleSelectCheckmark,.ActionListContent[aria-selected=false] .ActionListItem-singleSelectCheckmark{animation:checkmarkOut .2s cubic-bezier(.11,0,.5,0) forwards;@keyframes checkmarkOut{0%{clip-path:inset(0 0 0 0)}to{clip-path:inset(16px 0 0 0)}}}}.ActionListContent[aria-checked=false] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectIconRect,.ActionListContent[aria-selected=false] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectIconRect{fill:var(--bgColor-default,var(--color-canvas-default));stroke:var(--control-borderColor-rest,var(--color-btn-border));stroke-width:var(--borderWidth-thin,1px)}.ActionListContent[aria-checked=false] .ActionListItem-multiSelectIconRect,.ActionListContent[aria-selected=false] .ActionListItem-multiSelectIconRect{fill:var(--bgColor-default,var(--color-canvas-default));border:var(--borderWidth-thin,1px) solid var(--control-borderColor-rest,var(--color-btn-border))}.ActionListContent.ActionListContent--sizeLarge{--actionListContent-paddingBlock:var(--control-large-paddingBlock,0.625rem)}.ActionListContent.ActionListContent--sizeXLarge{--actionListContent-paddingBlock:var(--control-xlarge-paddingBlock,0.875rem)}@media (pointer:coarse){.ActionListContent{--actionListContent-paddingBlock:var(--control-large-paddingBlock,0.625rem)}}.ActionListContent.ActionListContent--blockDescription .ActionListItem-visual{place-self:start}.ActionListItem-action--leading{grid-area:leadingAction}.ActionListItem-visual--leading{grid-area:leadingVisual}.ActionListItem-visual--trailing{grid-area:trailingVisual}.ActionListItem-action--trailing{grid-area:trailingAction}.ActionListItem-descriptionWrap{display:flex;flex-direction:column;gap:var(--base-size-4,.25rem);grid-area:label}.ActionListItem-descriptionWrap .ActionListItem-label{font-weight:var(--base-text-weight-semibold,600)}.ActionListItem-descriptionWrap--inline{align-items:baseline;flex-direction:row;gap:var(--base-size-8,.5rem);position:relative}.ActionListItem-description{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-normal,400);line-height:var(--text-body-lineHeight-small,1.66667)}.ActionListItem-action,.ActionListItem-visual{fill:var(--fgColor-muted,var(--color-fg-muted));align-items:center;color:var(--fgColor-muted,var(--color-fg-muted));display:flex;min-height:var(--control-medium-lineBoxHeight,1.25rem);pointer-events:none}.ActionListItem-label{color:var(--fgColor-default,var(--color-fg-default));font-size:var(--text-body-size-medium,.875rem);font-weight:var(--base-text-weight-normal,400);grid-area:label;line-height:var(--text-body-lineHeight-medium,1.42857);position:relative}.ActionListItem-label--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ActionListItem--subItem>.ActionListContent>.ActionListItem-label{font-size:var(--text-body-size-small,.75rem);line-height:var(--text-body-lineHeight-small,1.66667)}.ActionListItem--withActions{align-items:center;display:flex;flex-wrap:nowrap}.ActionListItem-trailingAction{border-bottom-left-radius:0;border-top-left-radius:0}.ActionListItem--trailingActionHover .ActionListItem-trailingAction{visibility:hidden}.ActionListItem--trailingActionHover:focus-within .ActionListItem-trailingAction,.ActionListItem--trailingActionHover:hover .ActionListItem-trailingAction{visibility:visible}.ActionList-sectionDivider:not(:empty){color:var(--fgColor-muted,var(--color-fg-muted));display:flex;flex-direction:column;font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-semibold,600);line-height:var(--text-body-lineHeight-small,1.66667);padding-block:var(--base-size-8,.5rem);padding-inline:var(--actionListContent-paddingBlock)}.ActionList-sectionDivider:empty{background:var(--borderColor-muted,var(--color-action-list-item-inline-divider));border:0;display:block;height:var(--borderWidth-thin,max(1px,.0625rem));list-style:none;margin-block-end:var(--base-size-8,.5rem);margin-block-start:calc(var(--base-size-8,.5rem) - var(--borderWidth-thin,max(1px, .0625rem)));margin-inline:calc(var(--base-size-8,.5rem)*-1);padding:0}.ActionList-sectionDivider .ActionList-sectionDivider-title{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--base-text-weight-semibold,600)}.ActionList-sectionDivider--filled{background:var(--bgColor-muted,var(--color-canvas-subtle));border-bottom:solid var(--borderWidth-thin,max(1px,.0625rem)) var(--borderColor-muted,var(--color-action-list-item-inline-divider));border-top:solid var(--borderWidth-thin,max(1px,.0625rem)) var(--borderColor-muted,var(--color-action-list-item-inline-divider));margin-block-end:var(--base-size-8,.5rem);margin-block-start:calc(var(--base-size-8,.5rem) - var(--borderWidth-thin,max(1px, .0625rem)));margin-inline:calc(var(--base-size-8,.5rem)*-1)}.ActionList-sectionDivider--filled:empty{box-sizing:border-box;height:var(--base-size-8,.5rem)}.ActionList-sectionDivider--filled:first-child{margin-block-start:0}
@@ -0,0 +1,134 @@
1
+ {
2
+ "name": "alpha/action_list",
3
+ "selectors": [
4
+ ":root",
5
+ ".ActionListHeader",
6
+ ".ActionListWrap",
7
+ ".ActionListWrap--inset",
8
+ ".ActionListWrap--divided .ActionListItem-label:before",
9
+ ".ActionListWrap--divided .ActionListItem-descriptionWrap--inline:before",
10
+ ".ActionListWrap--divided .ActionListItem-descriptionWrap--inline .ActionListItem-label:before",
11
+ ".ActionList-sectionDivider+.ActionListItem .ActionListItem-descriptionWrap--inline:before",
12
+ ".ActionList-sectionDivider+.ActionListItem .ActionListItem-label:before",
13
+ ".ActionListItem:first-of-type .ActionListItem-descriptionWrap--inline:before",
14
+ ".ActionListItem:first-of-type .ActionListItem-label:before",
15
+ ".ActionListWrap--divided .ActionListItem--navActive .ActionListItem-label:before",
16
+ ".ActionListWrap--divided .ActionListItem--navActive+.ActionListItem .ActionListItem-label:before",
17
+ ".ActionListItem",
18
+ ".ActionListItem:active",
19
+ ".ActionListItem:hover",
20
+ ".ActionListItem:hover .ActionListItem-descriptionWrap--inline:before",
21
+ ".ActionListItem:hover .ActionListItem-label:before",
22
+ ".ActionListItem:hover+.ActionListItem .ActionListItem-descriptionWrap--inline:before",
23
+ ".ActionListItem:hover+.ActionListItem .ActionListItem-label:before",
24
+ ".ActionListItem[hidden]+.ActionList-sectionDivider",
25
+ ".ActionListItem.ActionListItem--hasSubItem>.ActionListContent",
26
+ ".ActionListItem.ActionListItem--hasSubItem>.ActionListContent:hover",
27
+ ".ActionListItem.ActionListItem--hasSubItem>.ActionListContent:active",
28
+ ".ActionListItem:not(.ActionListItem--hasSubItem):hover",
29
+ ".ActionListItem.ActionListItem--hasSubItem>.ActionListContent:hover:not(.ActionListItem--navActive,:focus-visible)",
30
+ ".ActionListItem:not(.ActionListItem--hasSubItem):hover:not(.ActionListItem--navActive,:focus-visible)",
31
+ ".ActionListItem:not(.ActionListItem--hasSubItem):active",
32
+ ".ActionListItem.ActionListItem--hasSubItem>.ActionListContent:active:not(.ActionListItem--navActive)",
33
+ ".ActionListItem:not(.ActionListItem--hasSubItem):active:not(.ActionListItem--navActive)",
34
+ ".ActionListItem.ActionListItem--hasSubItem>.ActionListContent:active .ActionListItem-label:before",
35
+ ".ActionListItem.ActionListItem--hasSubItem>.ActionListContent:active+.ActionListItem .ActionListItem-label:before",
36
+ ".ActionListItem:not(.ActionListItem--hasSubItem):active .ActionListItem-label:before",
37
+ ".ActionListItem:not(.ActionListItem--hasSubItem):active+.ActionListItem .ActionListItem-label:before",
38
+ ".ActionListItem[aria-selected=true]",
39
+ ".ActionListItem[aria-selected=true]:hover",
40
+ ".ActionListItem[aria-selected=true]+.ActionListItem:before",
41
+ ".ActionListItem[aria-selected=true]:before",
42
+ ".ActionListItem[aria-selected=true]:after",
43
+ ".ActionListItem.ActionListItem--navActive",
44
+ ".ActionListItem.ActionListItem--navActive:not(.ActionListItem--subItem) .ActionListItem-label",
45
+ ".ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger)",
46
+ ".ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger):hover",
47
+ ".ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger)+.ActionListItem:before",
48
+ ".ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger):before",
49
+ ".ActionListItem.ActionListItem--navActive:not(.ActionListItem--danger):after",
50
+ ".ActionListItem.ActionListItem--disabled .ActionListContent .ActionListItem-description",
51
+ ".ActionListItem.ActionListItem--disabled .ActionListContent .ActionListItem-label",
52
+ ".ActionListItem[aria-disabled=true] .ActionListContent .ActionListItem-description",
53
+ ".ActionListItem[aria-disabled=true] .ActionListContent .ActionListItem-label",
54
+ ".ActionListItem.ActionListItem--disabled .ActionListContent .ActionListItem-visual",
55
+ ".ActionListItem[aria-disabled=true] .ActionListContent .ActionListItem-visual",
56
+ ".ActionListItem.ActionListItem--disabled:hover",
57
+ ".ActionListItem[aria-disabled=true]:hover",
58
+ ".ActionListItem.ActionListItem--danger .ActionListItem-label",
59
+ ".ActionListItem.ActionListItem--danger .ActionListItem-visual",
60
+ ".ActionListItem.ActionListItem--danger:hover",
61
+ ".ActionListItem.ActionListItem--danger:hover .ActionListItem-description",
62
+ ".ActionListItem.ActionListItem--danger:hover .ActionListItem-label",
63
+ ".ActionListItem.ActionListItem--danger:hover .ActionListItem-visual",
64
+ ".ActionListItem.ActionListItem--danger .ActionListContent:active",
65
+ ".ActionListItem.ActionListItem--danger .ActionListContent:active .ActionListItem-description",
66
+ ".ActionListItem.ActionListItem--danger .ActionListContent:active .ActionListItem-label",
67
+ ".ActionListItem.ActionListItem--danger .ActionListContent:active .ActionListItem-visual",
68
+ ".ActionListContent",
69
+ ".ActionListContent>:not(:last-child)",
70
+ ".ActionListContent:hover",
71
+ ".ActionListContent[aria-disabled=true] .ActionListItem-description",
72
+ ".ActionListContent[aria-disabled=true] .ActionListItem-label",
73
+ ".ActionListContent[aria-disabled=true] .ActionListItem-visual",
74
+ ".ActionListContent[aria-disabled=true]:hover",
75
+ ".ActionListContent[aria-expanded]+.ActionList--subGroup",
76
+ ".ActionListContent[aria-expanded]+.ActionList--subGroup .ActionListContent",
77
+ ".ActionListContent.ActionListContent--visual16[aria-expanded]+.ActionList--subGroup .ActionListContent",
78
+ ".ActionListContent.ActionListContent--visual20[aria-expanded]+.ActionList--subGroup .ActionListContent",
79
+ ".ActionListContent.ActionListContent--visual24[aria-expanded]+.ActionList--subGroup .ActionListContent",
80
+ ".ActionListContent[aria-expanded=true] .ActionListItem-collapseIcon",
81
+ ".ActionListContent[aria-expanded=true]+.ActionList--subGroup",
82
+ ".ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=true]>.ActionListItem-label",
83
+ ".ActionListContent[aria-expanded=false] .ActionListItem-collapseIcon",
84
+ ".ActionListContent[aria-expanded=false]+.ActionList--subGroup",
85
+ ".ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]",
86
+ ".ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false] .ActionListItem-label",
87
+ ".ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]+.ActionListItem:before",
88
+ ".ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]:before",
89
+ ".ActionListContent.ActionListContent--hasActiveSubItem[aria-expanded=false]:after",
90
+ ".ActionListContent[aria-checked=true] .ActionListItem-multiSelectCheckmark",
91
+ ".ActionListContent[aria-selected=true] .ActionListItem-multiSelectCheckmark",
92
+ ".ActionListContent[aria-checked=true] .ActionListItem-singleSelectCheckmark",
93
+ ".ActionListContent[aria-selected=true] .ActionListItem-singleSelectCheckmark",
94
+ ".ActionListContent[aria-checked=true] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectIconRect",
95
+ ".ActionListContent[aria-selected=true] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectIconRect",
96
+ ".ActionListContent[aria-checked=true] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectCheckmark",
97
+ ".ActionListContent[aria-selected=true] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectCheckmark",
98
+ ".ActionListContent[aria-checked=false] .ActionListItem-multiSelectCheckmark",
99
+ ".ActionListContent[aria-selected=false] .ActionListItem-multiSelectCheckmark",
100
+ ".ActionListContent[aria-checked=false] .ActionListItem-singleSelectCheckmark",
101
+ ".ActionListContent[aria-selected=false] .ActionListItem-singleSelectCheckmark",
102
+ ".ActionListContent[aria-checked=false] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectIconRect",
103
+ ".ActionListContent[aria-selected=false] .ActionListItem-multiSelectIcon .ActionListItem-multiSelectIconRect",
104
+ ".ActionListContent[aria-checked=false] .ActionListItem-multiSelectIconRect",
105
+ ".ActionListContent[aria-selected=false] .ActionListItem-multiSelectIconRect",
106
+ ".ActionListContent.ActionListContent--sizeLarge",
107
+ ".ActionListContent.ActionListContent--sizeXLarge",
108
+ ".ActionListContent.ActionListContent--blockDescription .ActionListItem-visual",
109
+ ".ActionListItem-action--leading",
110
+ ".ActionListItem-visual--leading",
111
+ ".ActionListItem-visual--trailing",
112
+ ".ActionListItem-action--trailing",
113
+ ".ActionListItem-descriptionWrap",
114
+ ".ActionListItem-descriptionWrap .ActionListItem-label",
115
+ ".ActionListItem-descriptionWrap--inline",
116
+ ".ActionListItem-description",
117
+ ".ActionListItem-action",
118
+ ".ActionListItem-visual",
119
+ ".ActionListItem-label",
120
+ ".ActionListItem-label--truncate",
121
+ ".ActionListItem--subItem>.ActionListContent>.ActionListItem-label",
122
+ ".ActionListItem--withActions",
123
+ ".ActionListItem-trailingAction",
124
+ ".ActionListItem--trailingActionHover .ActionListItem-trailingAction",
125
+ ".ActionListItem--trailingActionHover:focus-within .ActionListItem-trailingAction",
126
+ ".ActionListItem--trailingActionHover:hover .ActionListItem-trailingAction",
127
+ ".ActionList-sectionDivider:not(:empty)",
128
+ ".ActionList-sectionDivider:empty",
129
+ ".ActionList-sectionDivider .ActionList-sectionDivider-title",
130
+ ".ActionList-sectionDivider--filled",
131
+ ".ActionList-sectionDivider--filled:empty",
132
+ ".ActionList-sectionDivider--filled:first-child"
133
+ ]
134
+ }
@@ -0,0 +1,31 @@
1
+ import '@oddbird/popover-polyfill';
2
+ import type { IncludeFragmentElement } from '@github/include-fragment-element';
3
+ type SelectVariant = 'none' | 'single' | 'multiple' | null;
4
+ type SelectedItem = {
5
+ label: string | null | undefined;
6
+ value: string | null | undefined;
7
+ element: Element;
8
+ };
9
+ export declare class ActionMenuElement extends HTMLElement {
10
+ #private;
11
+ includeFragment: IncludeFragmentElement;
12
+ get selectVariant(): SelectVariant;
13
+ set selectVariant(variant: SelectVariant);
14
+ get dynamicLabelPrefix(): string;
15
+ set dynamicLabelPrefix(value: string);
16
+ get dynamicLabel(): boolean;
17
+ set dynamicLabel(value: boolean);
18
+ get popoverElement(): HTMLElement | null;
19
+ get invokerElement(): HTMLButtonElement | null;
20
+ get invokerLabel(): HTMLElement | null;
21
+ get selectedItems(): SelectedItem[];
22
+ connectedCallback(): void;
23
+ disconnectedCallback(): void;
24
+ handleEvent(event: Event): void;
25
+ }
26
+ declare global {
27
+ interface Window {
28
+ ActionMenuElement: typeof ActionMenuElement;
29
+ }
30
+ }
31
+ export {};
@@ -0,0 +1,241 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8
+ if (kind === "m") throw new TypeError("Private method is not writable");
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10
+ 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");
11
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12
+ };
13
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
15
+ 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");
16
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
17
+ };
18
+ var _ActionMenuElement_instances, _ActionMenuElement_abortController, _ActionMenuElement_originalLabel, _ActionMenuElement_inputName, _ActionMenuElement_setDynamicLabel, _ActionMenuElement_updateInput, _ActionMenuElement_isActivationKeydown, _ActionMenuElement_firstItem_get;
19
+ import { controller, target } from '@github/catalyst';
20
+ import '@oddbird/popover-polyfill';
21
+ const menuItemSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]'];
22
+ let ActionMenuElement = class ActionMenuElement extends HTMLElement {
23
+ constructor() {
24
+ super(...arguments);
25
+ _ActionMenuElement_instances.add(this);
26
+ _ActionMenuElement_abortController.set(this, void 0);
27
+ _ActionMenuElement_originalLabel.set(this, '');
28
+ _ActionMenuElement_inputName.set(this, '');
29
+ }
30
+ get selectVariant() {
31
+ return this.getAttribute('data-select-variant');
32
+ }
33
+ set selectVariant(variant) {
34
+ if (variant) {
35
+ this.setAttribute('data-select-variant', variant);
36
+ }
37
+ else {
38
+ this.removeAttribute('variant');
39
+ }
40
+ }
41
+ get dynamicLabelPrefix() {
42
+ const prefix = this.getAttribute('data-dynamic-label-prefix');
43
+ if (!prefix)
44
+ return '';
45
+ return `${prefix}:`;
46
+ }
47
+ set dynamicLabelPrefix(value) {
48
+ this.setAttribute('data-dynamic-label', value);
49
+ }
50
+ get dynamicLabel() {
51
+ return this.hasAttribute('data-dynamic-label');
52
+ }
53
+ set dynamicLabel(value) {
54
+ this.toggleAttribute('data-dynamic-label', value);
55
+ }
56
+ get popoverElement() {
57
+ var _a;
58
+ return ((_a = this.invokerElement) === null || _a === void 0 ? void 0 : _a.popoverTargetElement) || null;
59
+ }
60
+ get invokerElement() {
61
+ var _a;
62
+ const id = (_a = this.querySelector('[role=menu]')) === null || _a === void 0 ? void 0 : _a.id;
63
+ if (!id)
64
+ return null;
65
+ for (const el of this.querySelectorAll(`[aria-controls]`)) {
66
+ if (el.getAttribute('aria-controls') === id)
67
+ return el;
68
+ }
69
+ return null;
70
+ }
71
+ get invokerLabel() {
72
+ if (!this.invokerElement)
73
+ return null;
74
+ return this.invokerElement.querySelector('.Button-label');
75
+ }
76
+ get selectedItems() {
77
+ const selectedItems = this.querySelectorAll('[aria-checked=true]');
78
+ const results = [];
79
+ for (const selectedItem of selectedItems) {
80
+ const labelEl = selectedItem.querySelector('.ActionListItem-label');
81
+ results.push({
82
+ label: labelEl === null || labelEl === void 0 ? void 0 : labelEl.textContent,
83
+ value: selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.getAttribute('data-value'),
84
+ element: selectedItem
85
+ });
86
+ }
87
+ return results;
88
+ }
89
+ connectedCallback() {
90
+ const { signal } = (__classPrivateFieldSet(this, _ActionMenuElement_abortController, new AbortController(), "f"));
91
+ this.addEventListener('keydown', this, { signal });
92
+ this.addEventListener('click', this, { signal });
93
+ this.addEventListener('mouseover', this, { signal });
94
+ this.addEventListener('focusout', this, { signal });
95
+ __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_setDynamicLabel).call(this);
96
+ __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_updateInput).call(this);
97
+ if (this.includeFragment) {
98
+ this.includeFragment.addEventListener('include-fragment-replaced', this, { signal });
99
+ }
100
+ }
101
+ disconnectedCallback() {
102
+ __classPrivateFieldGet(this, _ActionMenuElement_abortController, "f").abort();
103
+ }
104
+ handleEvent(event) {
105
+ var _a, _b;
106
+ if (event.target === this.invokerElement && __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_isActivationKeydown).call(this, event)) {
107
+ if (__classPrivateFieldGet(this, _ActionMenuElement_instances, "a", _ActionMenuElement_firstItem_get)) {
108
+ event.preventDefault();
109
+ (_a = this.popoverElement) === null || _a === void 0 ? void 0 : _a.showPopover();
110
+ __classPrivateFieldGet(this, _ActionMenuElement_instances, "a", _ActionMenuElement_firstItem_get).focus();
111
+ return;
112
+ }
113
+ }
114
+ if (!((_b = this.popoverElement) === null || _b === void 0 ? void 0 : _b.matches(':popover-open')))
115
+ return;
116
+ if (event.type === 'include-fragment-replaced') {
117
+ if (__classPrivateFieldGet(this, _ActionMenuElement_instances, "a", _ActionMenuElement_firstItem_get))
118
+ __classPrivateFieldGet(this, _ActionMenuElement_instances, "a", _ActionMenuElement_firstItem_get).focus();
119
+ }
120
+ else if (__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_isActivationKeydown).call(this, event) || (event instanceof MouseEvent && event.type === 'click')) {
121
+ // Hide popover after current event loop to prevent changes in focus from
122
+ // altering the target of the event. Not doing this specifically affects
123
+ // <a> tags. It causes the event to be sent to the currently focused element
124
+ // instead of the anchor, which effectively prevents navigation, i.e. it
125
+ // appears as if hitting enter does nothing. Curiously, clicking instead
126
+ // works fine.
127
+ if (this.selectVariant !== 'multiple') {
128
+ setTimeout(() => {
129
+ var _a, _b;
130
+ if ((_a = this.popoverElement) === null || _a === void 0 ? void 0 : _a.matches(':popover-open')) {
131
+ (_b = this.popoverElement) === null || _b === void 0 ? void 0 : _b.hidePopover();
132
+ }
133
+ });
134
+ }
135
+ // The rest of the code below deals with single/multiple selection behavior, and should not
136
+ // interfere with events fired by menu items whose behavior is specified outside the library.
137
+ if (this.selectVariant !== 'multiple' && this.selectVariant !== 'single')
138
+ return;
139
+ const item = event.target.closest(menuItemSelectors.join(','));
140
+ if (!item)
141
+ return;
142
+ const ariaChecked = item.getAttribute('aria-checked');
143
+ const checked = ariaChecked !== 'true';
144
+ if (this.selectVariant === 'single') {
145
+ // Only check, never uncheck here. Single-select mode does not allow unchecking a checked item.
146
+ if (checked) {
147
+ item.setAttribute('aria-checked', 'true');
148
+ }
149
+ for (const checkedItem of this.querySelectorAll('[aria-checked]')) {
150
+ if (checkedItem !== item) {
151
+ checkedItem.setAttribute('aria-checked', 'false');
152
+ }
153
+ }
154
+ __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_setDynamicLabel).call(this);
155
+ }
156
+ else {
157
+ // multi-select mode allows unchecking a checked item
158
+ item.setAttribute('aria-checked', `${checked}`);
159
+ }
160
+ __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_updateInput).call(this);
161
+ if (event instanceof KeyboardEvent && event.target instanceof HTMLButtonElement) {
162
+ // prevent buttons from being clicked twice
163
+ event.preventDefault();
164
+ }
165
+ }
166
+ }
167
+ };
168
+ _ActionMenuElement_abortController = new WeakMap(), _ActionMenuElement_originalLabel = new WeakMap(), _ActionMenuElement_inputName = new WeakMap(), _ActionMenuElement_instances = new WeakSet(), _ActionMenuElement_setDynamicLabel = function _ActionMenuElement_setDynamicLabel() {
169
+ if (!this.dynamicLabel)
170
+ return;
171
+ const invokerLabel = this.invokerLabel;
172
+ if (!invokerLabel)
173
+ return;
174
+ __classPrivateFieldSet(this, _ActionMenuElement_originalLabel, __classPrivateFieldGet(this, _ActionMenuElement_originalLabel, "f") || (invokerLabel.textContent || ''), "f");
175
+ const itemLabel = this.querySelector('[aria-checked=true] .ActionListItem-label');
176
+ if (itemLabel && this.dynamicLabel) {
177
+ const prefixSpan = document.createElement('span');
178
+ prefixSpan.classList.add('color-fg-muted');
179
+ const contentSpan = document.createElement('span');
180
+ prefixSpan.textContent = this.dynamicLabelPrefix;
181
+ contentSpan.textContent = itemLabel.textContent || '';
182
+ invokerLabel.replaceChildren(prefixSpan, contentSpan);
183
+ }
184
+ else {
185
+ invokerLabel.textContent = __classPrivateFieldGet(this, _ActionMenuElement_originalLabel, "f");
186
+ }
187
+ }, _ActionMenuElement_updateInput = function _ActionMenuElement_updateInput() {
188
+ if (this.selectVariant === 'single') {
189
+ const input = this.querySelector(`[data-list-inputs=true] input`);
190
+ if (!input)
191
+ return;
192
+ const selectedItem = this.selectedItems[0];
193
+ if (selectedItem) {
194
+ input.value = (selectedItem.value || selectedItem.label || '').trim();
195
+ input.removeAttribute('disabled');
196
+ }
197
+ else {
198
+ input.setAttribute('disabled', 'disabled');
199
+ }
200
+ }
201
+ else if (this.selectVariant !== 'none') {
202
+ // multiple select variant
203
+ const inputList = this.querySelector('[data-list-inputs=true]');
204
+ if (!inputList)
205
+ return;
206
+ const inputs = inputList.querySelectorAll('input');
207
+ if (inputs.length > 0) {
208
+ __classPrivateFieldSet(this, _ActionMenuElement_inputName, __classPrivateFieldGet(this, _ActionMenuElement_inputName, "f") || inputs[0].name, "f");
209
+ }
210
+ for (const selectedItem of this.selectedItems) {
211
+ const newInput = document.createElement('input');
212
+ newInput.setAttribute('data-list-input', 'true');
213
+ newInput.type = 'hidden';
214
+ newInput.autocomplete = 'off';
215
+ newInput.name = __classPrivateFieldGet(this, _ActionMenuElement_inputName, "f");
216
+ newInput.value = (selectedItem.value || selectedItem.label || '').trim();
217
+ inputList.append(newInput);
218
+ }
219
+ for (const input of inputs) {
220
+ input.remove();
221
+ }
222
+ }
223
+ }, _ActionMenuElement_isActivationKeydown = function _ActionMenuElement_isActivationKeydown(event) {
224
+ return (event instanceof KeyboardEvent &&
225
+ event.type === 'keydown' &&
226
+ !(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&
227
+ (event.key === 'Enter' || event.key === ' '));
228
+ }, _ActionMenuElement_firstItem_get = function _ActionMenuElement_firstItem_get() {
229
+ return this.querySelector(menuItemSelectors.join(','));
230
+ };
231
+ __decorate([
232
+ target
233
+ ], ActionMenuElement.prototype, "includeFragment", void 0);
234
+ ActionMenuElement = __decorate([
235
+ controller
236
+ ], ActionMenuElement);
237
+ export { ActionMenuElement };
238
+ if (!window.customElements.get('action-menu')) {
239
+ window.ActionMenuElement = ActionMenuElement;
240
+ window.customElements.define('action-menu', ActionMenuElement);
241
+ }
@@ -0,0 +1 @@
1
+ .autocomplete-label-stacked{display:block;margin-bottom:6px}.autocomplete-label-inline{display:inline;margin-right:6px}@media (max-width:543.98px){.autocomplete-label-inline{display:block;margin-bottom:6px}}.autocomplete-body{display:inline;position:relative}.autocomplete-embedded-icon-wrap{align-items:center;display:inline-flex;padding:4px 8px}.autocomplete-embedded-icon-wrap:focus-within{border-color:var(--focus-outlineColor,var(--color-accent-fg));box-shadow:inset 0 0 0 1px var(--focus-outlineColor,var(--color-accent-fg));outline:none}.autocomplete-embedded-icon-wrap .form-control{border:none;box-shadow:none;margin-left:8px;padding:0}.autocomplete-embedded-icon-wrap .form-control:focus{box-shadow:none}.autocomplete-embedded-icon-wrap .form-control:focus-visible{box-shadow:none}.autocomplete-results{background:var(--overlay-bgColor,var(--color-canvas-overlay));border:var(--borderWidth-thin,max(1px,.0625rem)) solid var(--borderColor-default,var(--color-border-default));border-radius:var(--borderRadius-medium,6px);box-shadow:var(--shadow-resting-medium,var(--color-shadow-medium));font-size:13px;left:0;list-style:none;max-height:20em;min-width:100%;overflow-y:auto;position:absolute;width:max-content;z-index:99}.autocomplete-item{background-color:var(--overlay-bgColor,var(--color-canvas-overlay));border:0;color:var(--fgColor-default,var(--color-fg-default));cursor:pointer;display:block;font-weight:var(--base-text-weight-semibold,600);overflow:hidden;padding:4px 8px;text-align:left;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;width:100%}.autocomplete-item:hover{background-color:var(--bgColor-accent-emphasis,var(--color-accent-fg));color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis));text-decoration:none}.autocomplete-item:hover *{color:inherit!important}.autocomplete-item.navigation-focus,.autocomplete-item.selected,.autocomplete-item[aria-selected=true]{background-color:var(--bgColor-accent-emphasis,var(--color-accent-fg));color:var(--fgColor-onEmphasis,var(--color-fg-on-emphasis));text-decoration:none}.autocomplete-item.navigation-focus *,.autocomplete-item.selected *,.autocomplete-item[aria-selected=true] *{color:inherit!important}