@primer/view-components 0.1.10-rc.a7c97c4e → 0.1.10-rc.b33f9989
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/javascripts/primer_view_components.js +1 -1
- package/app/assets/javascripts/primer_view_components.js.map +1 -1
- package/app/assets/styles/primer_view_components.css +1 -1
- package/app/assets/styles/primer_view_components.css.map +1 -1
- package/app/components/primer/alpha/action_menu/action_menu_element.js +5 -5
- package/app/components/primer/beta/button_group.css +1 -0
- package/app/components/primer/beta/button_group.css.json +14 -0
- package/package.json +1 -1
- package/static/arguments.json +4 -4
- package/static/classes.json +3 -0
- package/static/info_arch.json +29 -5
- package/static/previews.json +24 -0
|
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
9
9
|
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");
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
|
-
var _ActionMenuElement_instances, _ActionMenuElement_abortController, _ActionMenuElement_originalLabel, _ActionMenuElement_inputName, _ActionMenuElement_setDynamicLabel, _ActionMenuElement_updateInput,
|
|
12
|
+
var _ActionMenuElement_instances, _ActionMenuElement_abortController, _ActionMenuElement_originalLabel, _ActionMenuElement_inputName, _ActionMenuElement_setDynamicLabel, _ActionMenuElement_updateInput, _ActionMenuElement_isActivationKeydown, _ActionMenuElement_firstItem_get;
|
|
13
13
|
import '@github/include-fragment-element';
|
|
14
14
|
const menuItemSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]'];
|
|
15
15
|
export class ActionMenuElement extends HTMLElement {
|
|
@@ -92,7 +92,7 @@ export class ActionMenuElement extends HTMLElement {
|
|
|
92
92
|
}
|
|
93
93
|
handleEvent(event) {
|
|
94
94
|
var _a, _b, _c, _d;
|
|
95
|
-
if (event.target === this.invokerElement && __classPrivateFieldGet(this, _ActionMenuElement_instances, "m",
|
|
95
|
+
if (event.target === this.invokerElement && __classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_isActivationKeydown).call(this, event)) {
|
|
96
96
|
if (__classPrivateFieldGet(this, _ActionMenuElement_instances, "a", _ActionMenuElement_firstItem_get)) {
|
|
97
97
|
event.preventDefault();
|
|
98
98
|
(_a = this.popoverElement) === null || _a === void 0 ? void 0 : _a.showPopover();
|
|
@@ -105,7 +105,7 @@ export class ActionMenuElement extends HTMLElement {
|
|
|
105
105
|
if (event.type === 'focusout' && !this.contains(event.relatedTarget)) {
|
|
106
106
|
(_c = this.popoverElement) === null || _c === void 0 ? void 0 : _c.hidePopover();
|
|
107
107
|
}
|
|
108
|
-
else if (__classPrivateFieldGet(this, _ActionMenuElement_instances, "m",
|
|
108
|
+
else if (__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_isActivationKeydown).call(this, event) || (event instanceof MouseEvent && event.type === 'click')) {
|
|
109
109
|
const item = (_d = event.target.closest(menuItemSelectors.join(','))) === null || _d === void 0 ? void 0 : _d.closest('li');
|
|
110
110
|
if (!item)
|
|
111
111
|
return;
|
|
@@ -194,11 +194,11 @@ _ActionMenuElement_abortController = new WeakMap(), _ActionMenuElement_originalL
|
|
|
194
194
|
input.remove();
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
},
|
|
197
|
+
}, _ActionMenuElement_isActivationKeydown = function _ActionMenuElement_isActivationKeydown(event) {
|
|
198
198
|
return (event instanceof KeyboardEvent &&
|
|
199
199
|
event.type === 'keydown' &&
|
|
200
200
|
!(event.ctrlKey || event.altKey || event.metaKey || event.shiftKey) &&
|
|
201
|
-
event.key === 'Enter');
|
|
201
|
+
(event.key === 'Enter' || event.key === ' '));
|
|
202
202
|
}, _ActionMenuElement_firstItem_get = function _ActionMenuElement_firstItem_get() {
|
|
203
203
|
return this.querySelector(menuItemSelectors.join(','));
|
|
204
204
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ButtonGroup{display:inline-flex}.ButtonGroup button{border-radius:0;margin-inline-end:-1px;position:relative}.ButtonGroup button:active,.ButtonGroup button:focus,.ButtonGroup button:hover{z-index:1}.ButtonGroup>.Button-withTooltip:first-child button,.ButtonGroup>:first-child{border-bottom-left-radius:var(--borderRadius-medium,6px);border-top-left-radius:var(--borderRadius-medium,6px)}.ButtonGroup>.Button-withTooltip:last-child button,.ButtonGroup>:last-child{border-bottom-right-radius:var(--borderRadius-medium,6px);border-top-right-radius:var(--borderRadius-medium,6px)}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "beta/button_group",
|
|
3
|
+
"selectors": [
|
|
4
|
+
".ButtonGroup",
|
|
5
|
+
".ButtonGroup button",
|
|
6
|
+
".ButtonGroup button:active",
|
|
7
|
+
".ButtonGroup button:focus",
|
|
8
|
+
".ButtonGroup button:hover",
|
|
9
|
+
".ButtonGroup>.Button-withTooltip:first-child button",
|
|
10
|
+
".ButtonGroup>:first-child",
|
|
11
|
+
".ButtonGroup>.Button-withTooltip:last-child button",
|
|
12
|
+
".ButtonGroup>:last-child"
|
|
13
|
+
]
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primer/view-components",
|
|
3
|
-
"version": "0.1.10-rc.
|
|
3
|
+
"version": "0.1.10-rc.b33f9989",
|
|
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
|
@@ -3153,16 +3153,16 @@
|
|
|
3153
3153
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/button_group/default/",
|
|
3154
3154
|
"parameters": [
|
|
3155
3155
|
{
|
|
3156
|
-
"name": "
|
|
3156
|
+
"name": "scheme",
|
|
3157
3157
|
"type": "Symbol",
|
|
3158
|
-
"default": "`
|
|
3159
|
-
"description": "DEPRECATED. One of `:
|
|
3158
|
+
"default": "`:default`",
|
|
3159
|
+
"description": "DEPRECATED. One of `:danger`, `:default`, `:invisible`, `:link`, `:primary`, or `:secondary`."
|
|
3160
3160
|
},
|
|
3161
3161
|
{
|
|
3162
3162
|
"name": "size",
|
|
3163
3163
|
"type": "Symbol",
|
|
3164
3164
|
"default": "`:medium`",
|
|
3165
|
-
"description": "One of `:medium
|
|
3165
|
+
"description": "One of `:large`, `:medium`, or `:small`."
|
|
3166
3166
|
},
|
|
3167
3167
|
{
|
|
3168
3168
|
"name": "system_arguments",
|
package/static/classes.json
CHANGED
package/static/info_arch.json
CHANGED
|
@@ -9652,16 +9652,16 @@
|
|
|
9652
9652
|
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/beta/button_group/default/",
|
|
9653
9653
|
"parameters": [
|
|
9654
9654
|
{
|
|
9655
|
-
"name": "
|
|
9655
|
+
"name": "scheme",
|
|
9656
9656
|
"type": "Symbol",
|
|
9657
|
-
"default": "`
|
|
9658
|
-
"description": "DEPRECATED. One of `:
|
|
9657
|
+
"default": "`:default`",
|
|
9658
|
+
"description": "DEPRECATED. One of `:danger`, `:default`, `:invisible`, `:link`, `:primary`, or `:secondary`."
|
|
9659
9659
|
},
|
|
9660
9660
|
{
|
|
9661
9661
|
"name": "size",
|
|
9662
9662
|
"type": "Symbol",
|
|
9663
9663
|
"default": "`:medium`",
|
|
9664
|
-
"description": "One of `:medium
|
|
9664
|
+
"description": "One of `:large`, `:medium`, or `:small`."
|
|
9665
9665
|
},
|
|
9666
9666
|
{
|
|
9667
9667
|
"name": "system_arguments",
|
|
@@ -9679,7 +9679,7 @@
|
|
|
9679
9679
|
"name": "kwargs",
|
|
9680
9680
|
"type": "Hash",
|
|
9681
9681
|
"default": "N/A",
|
|
9682
|
-
"description": "The same arguments as {{#link_to_component}}Primer::
|
|
9682
|
+
"description": "The same arguments as {{#link_to_component}}Primer::Beta::Button{{/link_to_component}}"
|
|
9683
9683
|
}
|
|
9684
9684
|
]
|
|
9685
9685
|
}
|
|
@@ -9711,6 +9711,30 @@
|
|
|
9711
9711
|
"color-contrast"
|
|
9712
9712
|
]
|
|
9713
9713
|
}
|
|
9714
|
+
},
|
|
9715
|
+
{
|
|
9716
|
+
"preview_path": "primer/beta/button_group/split_button",
|
|
9717
|
+
"name": "split_button",
|
|
9718
|
+
"skip_rules": {
|
|
9719
|
+
"wont_fix": [
|
|
9720
|
+
"region"
|
|
9721
|
+
],
|
|
9722
|
+
"will_fix": [
|
|
9723
|
+
"color-contrast"
|
|
9724
|
+
]
|
|
9725
|
+
}
|
|
9726
|
+
},
|
|
9727
|
+
{
|
|
9728
|
+
"preview_path": "primer/beta/button_group/icon_buttons",
|
|
9729
|
+
"name": "icon_buttons",
|
|
9730
|
+
"skip_rules": {
|
|
9731
|
+
"wont_fix": [
|
|
9732
|
+
"region"
|
|
9733
|
+
],
|
|
9734
|
+
"will_fix": [
|
|
9735
|
+
"color-contrast"
|
|
9736
|
+
]
|
|
9737
|
+
}
|
|
9714
9738
|
}
|
|
9715
9739
|
],
|
|
9716
9740
|
"subcomponents": [
|
package/static/previews.json
CHANGED
|
@@ -1848,6 +1848,30 @@
|
|
|
1848
1848
|
"color-contrast"
|
|
1849
1849
|
]
|
|
1850
1850
|
}
|
|
1851
|
+
},
|
|
1852
|
+
{
|
|
1853
|
+
"preview_path": "primer/beta/button_group/split_button",
|
|
1854
|
+
"name": "split_button",
|
|
1855
|
+
"skip_rules": {
|
|
1856
|
+
"wont_fix": [
|
|
1857
|
+
"region"
|
|
1858
|
+
],
|
|
1859
|
+
"will_fix": [
|
|
1860
|
+
"color-contrast"
|
|
1861
|
+
]
|
|
1862
|
+
}
|
|
1863
|
+
},
|
|
1864
|
+
{
|
|
1865
|
+
"preview_path": "primer/beta/button_group/icon_buttons",
|
|
1866
|
+
"name": "icon_buttons",
|
|
1867
|
+
"skip_rules": {
|
|
1868
|
+
"wont_fix": [
|
|
1869
|
+
"region"
|
|
1870
|
+
],
|
|
1871
|
+
"will_fix": [
|
|
1872
|
+
"color-contrast"
|
|
1873
|
+
]
|
|
1874
|
+
}
|
|
1851
1875
|
}
|
|
1852
1876
|
]
|
|
1853
1877
|
},
|