@primer/view-components 0.4.0-rc.1aadd47d → 0.4.0-rc.54a333a8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/javascripts/app/components/primer/alpha/action_bar_element.d.ts +16 -0
- package/app/assets/javascripts/app/components/primer/primer.d.ts +1 -0
- package/app/assets/javascripts/primer_view_components.js +1 -1
- package/app/assets/javascripts/primer_view_components.js.map +1 -1
- package/app/assets/styles/primer_view_components.css +1 -1
- package/app/assets/styles/primer_view_components.css.map +1 -1
- package/app/components/primer/alpha/action_bar.css +1 -0
- package/app/components/primer/alpha/action_bar.css.json +17 -0
- package/app/components/primer/alpha/action_bar_element.d.ts +16 -0
- package/app/components/primer/alpha/action_bar_element.js +172 -0
- package/app/components/primer/alpha/tool_tip.js +15 -8
- package/app/components/primer/primer.d.ts +1 -0
- package/app/components/primer/primer.js +1 -0
- package/package.json +1 -1
- package/static/arguments.json +50 -0
- package/static/audited_at.json +3 -0
- package/static/classes.json +21 -0
- package/static/constants.json +19 -0
- package/static/info_arch.json +183 -0
- package/static/previews.json +86 -0
- package/static/statuses.json +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ActionBar{display:flex!important;flex-grow:1;flex-shrink:1;justify-content:flex-end;min-width:calc(var(--control-medium-size,2rem)*3);overflow:hidden;position:relative}.ActionBar,.ActionBar-item-container{align-items:center;box-sizing:initial}.ActionBar-item-container{display:flex;flex-grow:0;flex-shrink:0}.ActionBar-item{flex-shrink:0;position:relative}.ActionBar-more-menu{flex-shrink:0}.ActionBar--small{min-width:calc(var(--control-small-size,1.75rem)*3)}.ActionBar--large{min-width:calc(var(--control-large-size,2.5rem)*3)}.ActionBar-divider{border-left:var(--borderWidth-thin,max(1px,.0625rem)) solid var(--color-border-subtle);height:calc(var(--control-medium-size,2rem)/2);margin:0 var(--controlStack-medium-gap-condensed,.5rem)}.ActionBar--small .ActionBar-divider{margin:0 var(--controlStack-small-gap-condensed,.5rem)}.ActionBar--large .ActionBar-divider{margin:0 var(--controlStack-large-gap-condensed,.5rem)}@media (pointer:coarse){.ActionBar .ActionBar-item-container{gap:calc(var(--control-minTarget-coarse,2.75rem) - var(--control-medium-size,2rem))}.ActionBar--small .ActionBar-item-container{gap:calc(var(--control-minTarget-coarse,2.75rem) - var(--control-small-size,1.75rem))}.ActionBar--large .ActionBar-item-container{gap:calc(var(--control-minTarget-coarse,2.75rem) - var(--control-large-size,2.5rem))}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "alpha/action_bar",
|
|
3
|
+
"selectors": [
|
|
4
|
+
".ActionBar",
|
|
5
|
+
".ActionBar-item-container",
|
|
6
|
+
".ActionBar-item",
|
|
7
|
+
".ActionBar-more-menu",
|
|
8
|
+
".ActionBar--small",
|
|
9
|
+
".ActionBar--large",
|
|
10
|
+
".ActionBar-divider",
|
|
11
|
+
".ActionBar--small .ActionBar-divider",
|
|
12
|
+
".ActionBar--large .ActionBar-divider",
|
|
13
|
+
".ActionBar .ActionBar-item-container",
|
|
14
|
+
".ActionBar--small .ActionBar-item-container",
|
|
15
|
+
".ActionBar--large .ActionBar-item-container"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare class ActionBarElement extends HTMLElement {
|
|
2
|
+
#private;
|
|
3
|
+
items: HTMLElement[];
|
|
4
|
+
itemContainer: HTMLElement;
|
|
5
|
+
moreMenu: HTMLElement;
|
|
6
|
+
connectedCallback(): void;
|
|
7
|
+
disconnectedCallback(): void;
|
|
8
|
+
menuItemClick(event: Event): void;
|
|
9
|
+
update(rect?: DOMRect): void;
|
|
10
|
+
}
|
|
11
|
+
declare global {
|
|
12
|
+
interface Window {
|
|
13
|
+
ActionBarElement: typeof ActionBarElement;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -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;
|
|
@@ -25,11 +25,21 @@ const DIRECTION_CLASSES = [
|
|
|
25
25
|
'tooltip-nw',
|
|
26
26
|
'tooltip-sw'
|
|
27
27
|
];
|
|
28
|
-
function
|
|
28
|
+
function closeOpenTooltips(except) {
|
|
29
29
|
for (const tooltip of openTooltips) {
|
|
30
|
-
tooltip
|
|
30
|
+
if (tooltip === except)
|
|
31
|
+
continue;
|
|
32
|
+
if (tooltip.matches(':popover-open')) {
|
|
33
|
+
tooltip.hidePopover();
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
openTooltips.delete(tooltip);
|
|
37
|
+
}
|
|
31
38
|
}
|
|
32
39
|
}
|
|
40
|
+
function focusOutListener() {
|
|
41
|
+
closeOpenTooltips();
|
|
42
|
+
}
|
|
33
43
|
const tooltips = new Set();
|
|
34
44
|
const openTooltips = new Set();
|
|
35
45
|
class ToolTipElement extends HTMLElement {
|
|
@@ -197,10 +207,10 @@ class ToolTipElement extends HTMLElement {
|
|
|
197
207
|
}
|
|
198
208
|
/* @deprecated */
|
|
199
209
|
set hiddenFromView(value) {
|
|
200
|
-
if (value) {
|
|
210
|
+
if (value && this.matches(':popover-open')) {
|
|
201
211
|
this.hidePopover();
|
|
202
212
|
}
|
|
203
|
-
else {
|
|
213
|
+
else if (!value && !this.matches(':popover-open')) {
|
|
204
214
|
this.showPopover();
|
|
205
215
|
}
|
|
206
216
|
}
|
|
@@ -287,10 +297,7 @@ _ToolTipElement_abortController = new WeakMap(), _ToolTipElement_align = new Wea
|
|
|
287
297
|
if (isOpen) {
|
|
288
298
|
openTooltips.add(this);
|
|
289
299
|
this.classList.remove(TOOLTIP_SR_ONLY_CLASS);
|
|
290
|
-
|
|
291
|
-
if (tooltip !== this)
|
|
292
|
-
tooltip.hidePopover();
|
|
293
|
-
}
|
|
300
|
+
closeOpenTooltips(this);
|
|
294
301
|
__classPrivateFieldGet(this, _ToolTipElement_instances, "m", _ToolTipElement_updatePosition).call(this);
|
|
295
302
|
}
|
|
296
303
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/view-components",
|
|
3
|
-
"version": "0.4.0-rc.
|
|
3
|
+
"version": "0.4.0-rc.54a333a8",
|
|
4
4
|
"description": "ViewComponents for the Primer Design System",
|
|
5
5
|
"main": "app/assets/javascripts/primer_view_components.js",
|
|
6
6
|
"module": "app/components/primer/primer.js",
|
package/static/arguments.json
CHANGED
|
@@ -1,4 +1,54 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"component": "ActionBar",
|
|
4
|
+
"status": "alpha",
|
|
5
|
+
"a11y_reviewed": false,
|
|
6
|
+
"short_name": "ActionBar",
|
|
7
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_bar.rb",
|
|
8
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_bar/default/",
|
|
9
|
+
"parameters": [
|
|
10
|
+
{
|
|
11
|
+
"name": "size",
|
|
12
|
+
"type": "Symbol",
|
|
13
|
+
"default": "`:medium`",
|
|
14
|
+
"description": "One of `:large`, `:medium`, or `:small`."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "overflow_menu",
|
|
18
|
+
"type": "Boolean",
|
|
19
|
+
"default": "`true`",
|
|
20
|
+
"description": "Whether to render the overflow menu."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "system_arguments",
|
|
24
|
+
"type": "Hash",
|
|
25
|
+
"default": "N/A",
|
|
26
|
+
"description": "[System arguments](/system-arguments)"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"component": "ActionBar::Divider",
|
|
32
|
+
"status": "alpha",
|
|
33
|
+
"a11y_reviewed": false,
|
|
34
|
+
"short_name": "ActionBarDivider",
|
|
35
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_bar/divider.rb",
|
|
36
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_bar/divider/default/",
|
|
37
|
+
"parameters": [
|
|
38
|
+
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"component": "ActionBar::Item",
|
|
43
|
+
"status": "alpha",
|
|
44
|
+
"a11y_reviewed": false,
|
|
45
|
+
"short_name": "ActionBarItem",
|
|
46
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_bar/item.rb",
|
|
47
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_bar/item/default/",
|
|
48
|
+
"parameters": [
|
|
49
|
+
|
|
50
|
+
]
|
|
51
|
+
},
|
|
2
52
|
{
|
|
3
53
|
"component": "ActionList",
|
|
4
54
|
"status": "alpha",
|
package/static/audited_at.json
CHANGED
package/static/classes.json
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
+
"ActionBar": [
|
|
3
|
+
"Primer::Alpha::ActionBar"
|
|
4
|
+
],
|
|
5
|
+
"ActionBar--large": [
|
|
6
|
+
"Primer::Alpha::ActionBar"
|
|
7
|
+
],
|
|
8
|
+
"ActionBar--small": [
|
|
9
|
+
"Primer::Alpha::ActionBar"
|
|
10
|
+
],
|
|
11
|
+
"ActionBar-divider": [
|
|
12
|
+
"Primer::Alpha::ActionBar"
|
|
13
|
+
],
|
|
14
|
+
"ActionBar-item": [
|
|
15
|
+
"Primer::Alpha::ActionBar"
|
|
16
|
+
],
|
|
17
|
+
"ActionBar-item-container": [
|
|
18
|
+
"Primer::Alpha::ActionBar"
|
|
19
|
+
],
|
|
20
|
+
"ActionBar-more-menu": [
|
|
21
|
+
"Primer::Alpha::ActionBar"
|
|
22
|
+
],
|
|
2
23
|
"ActionList-sectionDivider": [
|
|
3
24
|
"Primer::Alpha::ActionList"
|
|
4
25
|
],
|
package/static/constants.json
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
{
|
|
2
|
+
"Primer::Alpha::ActionBar": {
|
|
3
|
+
"DEFAULT_SIZE": "medium",
|
|
4
|
+
"Divider": "Primer::Alpha::ActionBar::Divider",
|
|
5
|
+
"Item": "Primer::Alpha::ActionBar::Item",
|
|
6
|
+
"SIZE_MAPPINGS": {
|
|
7
|
+
"medium": null,
|
|
8
|
+
"small": "ActionBar--small",
|
|
9
|
+
"large": "ActionBar--large"
|
|
10
|
+
},
|
|
11
|
+
"SIZE_OPTIONS": [
|
|
12
|
+
"medium",
|
|
13
|
+
"small",
|
|
14
|
+
"large"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"Primer::Alpha::ActionBar::Divider": {
|
|
18
|
+
},
|
|
19
|
+
"Primer::Alpha::ActionBar::Item": {
|
|
20
|
+
},
|
|
2
21
|
"Primer::Alpha::ActionList": {
|
|
3
22
|
"DEFAULT_MENU_ITEM_ROLE": "menuitem",
|
|
4
23
|
"DEFAULT_ROLE": "list",
|
package/static/info_arch.json
CHANGED
|
@@ -1,4 +1,187 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"fully_qualified_name": "Primer::Alpha::ActionBar",
|
|
4
|
+
"description": "Add a general description of component here\nAdd additional usage considerations or best practices that may aid the user to use the component correctly.",
|
|
5
|
+
"is_form_component": false,
|
|
6
|
+
"is_published": true,
|
|
7
|
+
"requires_js": false,
|
|
8
|
+
"component": "ActionBar",
|
|
9
|
+
"status": "alpha",
|
|
10
|
+
"a11y_reviewed": false,
|
|
11
|
+
"short_name": "ActionBar",
|
|
12
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_bar.rb",
|
|
13
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_bar/default/",
|
|
14
|
+
"parameters": [
|
|
15
|
+
{
|
|
16
|
+
"name": "size",
|
|
17
|
+
"type": "Symbol",
|
|
18
|
+
"default": "`:medium`",
|
|
19
|
+
"description": "One of `:large`, `:medium`, or `:small`."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "overflow_menu",
|
|
23
|
+
"type": "Boolean",
|
|
24
|
+
"default": "`true`",
|
|
25
|
+
"description": "Whether to render the overflow menu."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "system_arguments",
|
|
29
|
+
"type": "Hash",
|
|
30
|
+
"default": "N/A",
|
|
31
|
+
"description": "{{link_to_system_arguments_docs}}"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"slots": [
|
|
35
|
+
{
|
|
36
|
+
"name": "items",
|
|
37
|
+
"description": null,
|
|
38
|
+
"parameters": [
|
|
39
|
+
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"methods": [
|
|
44
|
+
|
|
45
|
+
],
|
|
46
|
+
"previews": [
|
|
47
|
+
{
|
|
48
|
+
"preview_path": "primer/alpha/action_bar/default",
|
|
49
|
+
"name": "default",
|
|
50
|
+
"snapshot": "true",
|
|
51
|
+
"skip_rules": {
|
|
52
|
+
"wont_fix": [
|
|
53
|
+
"region"
|
|
54
|
+
],
|
|
55
|
+
"will_fix": [
|
|
56
|
+
"color-contrast"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"preview_path": "primer/alpha/action_bar/inline",
|
|
62
|
+
"name": "inline",
|
|
63
|
+
"snapshot": "false",
|
|
64
|
+
"skip_rules": {
|
|
65
|
+
"wont_fix": [
|
|
66
|
+
"region"
|
|
67
|
+
],
|
|
68
|
+
"will_fix": [
|
|
69
|
+
"color-contrast"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"preview_path": "primer/alpha/action_bar/playground",
|
|
75
|
+
"name": "playground",
|
|
76
|
+
"snapshot": "false",
|
|
77
|
+
"skip_rules": {
|
|
78
|
+
"wont_fix": [
|
|
79
|
+
"region"
|
|
80
|
+
],
|
|
81
|
+
"will_fix": [
|
|
82
|
+
"color-contrast"
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"preview_path": "primer/alpha/action_bar/small",
|
|
88
|
+
"name": "small",
|
|
89
|
+
"snapshot": "false",
|
|
90
|
+
"skip_rules": {
|
|
91
|
+
"wont_fix": [
|
|
92
|
+
"region"
|
|
93
|
+
],
|
|
94
|
+
"will_fix": [
|
|
95
|
+
"color-contrast"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"preview_path": "primer/alpha/action_bar/medium",
|
|
101
|
+
"name": "medium",
|
|
102
|
+
"snapshot": "false",
|
|
103
|
+
"skip_rules": {
|
|
104
|
+
"wont_fix": [
|
|
105
|
+
"region"
|
|
106
|
+
],
|
|
107
|
+
"will_fix": [
|
|
108
|
+
"color-contrast"
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"preview_path": "primer/alpha/action_bar/large",
|
|
114
|
+
"name": "large",
|
|
115
|
+
"snapshot": "false",
|
|
116
|
+
"skip_rules": {
|
|
117
|
+
"wont_fix": [
|
|
118
|
+
"region"
|
|
119
|
+
],
|
|
120
|
+
"will_fix": [
|
|
121
|
+
"color-contrast"
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"subcomponents": [
|
|
127
|
+
{
|
|
128
|
+
"fully_qualified_name": "Primer::Alpha::ActionBar::Item",
|
|
129
|
+
"description": "ActionBar::Item is an internal component that wraps the items in a div with the `ActionBar-item` class.",
|
|
130
|
+
"is_form_component": false,
|
|
131
|
+
"is_published": true,
|
|
132
|
+
"requires_js": false,
|
|
133
|
+
"component": "ActionBar::Item",
|
|
134
|
+
"status": "alpha",
|
|
135
|
+
"a11y_reviewed": false,
|
|
136
|
+
"short_name": "ActionBarItem",
|
|
137
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_bar/item.rb",
|
|
138
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_bar/item/default/",
|
|
139
|
+
"parameters": [
|
|
140
|
+
|
|
141
|
+
],
|
|
142
|
+
"slots": [
|
|
143
|
+
|
|
144
|
+
],
|
|
145
|
+
"methods": [
|
|
146
|
+
|
|
147
|
+
],
|
|
148
|
+
"previews": [
|
|
149
|
+
|
|
150
|
+
],
|
|
151
|
+
"subcomponents": [
|
|
152
|
+
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"fully_qualified_name": "Primer::Alpha::ActionBar::Divider",
|
|
157
|
+
"description": "ActionBar::Item is an internal component that wraps the items in a div with the `ActionBar-item` class.",
|
|
158
|
+
"is_form_component": false,
|
|
159
|
+
"is_published": true,
|
|
160
|
+
"requires_js": false,
|
|
161
|
+
"component": "ActionBar::Divider",
|
|
162
|
+
"status": "alpha",
|
|
163
|
+
"a11y_reviewed": false,
|
|
164
|
+
"short_name": "ActionBarDivider",
|
|
165
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_bar/divider.rb",
|
|
166
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_bar/divider/default/",
|
|
167
|
+
"parameters": [
|
|
168
|
+
|
|
169
|
+
],
|
|
170
|
+
"slots": [
|
|
171
|
+
|
|
172
|
+
],
|
|
173
|
+
"methods": [
|
|
174
|
+
|
|
175
|
+
],
|
|
176
|
+
"previews": [
|
|
177
|
+
|
|
178
|
+
],
|
|
179
|
+
"subcomponents": [
|
|
180
|
+
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
},
|
|
2
185
|
{
|
|
3
186
|
"fully_qualified_name": "Primer::Alpha::ActionList",
|
|
4
187
|
"description": "An ActionList is a styled list of links. It acts as the base component for many\nother menu-type components, including `ActionMenu` and `SelectPanel`, as well as\nthe navigational component `NavList`.\n\nEach item in an action list can be augmented by specifying corresponding leading\nand/or trailing visuals.",
|