@primer/view-components 0.35.0-rc.cdb3a4d9 → 0.35.0-rc.e4cf5dc2
Sign up to get free protection for your applications and to get access to all the features.
- package/app/assets/javascripts/{app/components → components}/primer/primer.d.ts +3 -3
- 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_element.js +0 -3
- package/app/components/primer/alpha/action_list.css +1 -1
- package/app/components/primer/alpha/auto_complete.css +1 -1
- package/app/components/primer/alpha/banner.css +1 -1
- package/app/components/primer/alpha/dropdown.css +1 -1
- package/app/components/primer/alpha/select_panel_element.js +7 -1
- package/app/components/primer/alpha/tab_nav.css +1 -1
- package/app/components/primer/alpha/text_field.css +1 -1
- package/app/components/primer/alpha/toggle_switch.css +1 -1
- package/app/components/primer/alpha/underline_nav.css +1 -1
- package/app/components/primer/beta/avatar.css +1 -1
- package/app/components/primer/beta/avatar_stack.css +1 -1
- package/app/components/primer/beta/blankslate.css +1 -1
- package/app/components/primer/beta/border_box.css +1 -1
- package/app/components/primer/beta/button.css +1 -1
- package/app/components/primer/beta/counter.css +1 -1
- package/app/components/primer/beta/popover.css +1 -1
- package/app/components/primer/beta/progress_bar.css +1 -1
- package/app/components/primer/beta/state.css +1 -1
- package/app/components/primer/primer.js +3 -3
- package/package.json +4 -5
- package/static/arguments.json +20 -2
- package/static/constants.json +5 -0
- package/static/info_arch.json +57 -3
- package/static/previews.json +26 -0
- package/app/components/primer/alpha/action_bar_element.d.ts +0 -17
- package/app/components/primer/alpha/action_list.d.ts +0 -16
- package/app/components/primer/alpha/action_menu/action_menu_element.d.ts +0 -42
- package/app/components/primer/alpha/dropdown/menu.d.ts +0 -1
- package/app/components/primer/alpha/dropdown.d.ts +0 -1
- package/app/components/primer/alpha/image_crop.d.ts +0 -1
- package/app/components/primer/alpha/modal_dialog.d.ts +0 -18
- package/app/components/primer/alpha/segmented_control.d.ts +0 -12
- package/app/components/primer/alpha/select_panel_element.d.ts +0 -63
- package/app/components/primer/alpha/tab_container.d.ts +0 -1
- package/app/components/primer/alpha/toggle_switch.d.ts +0 -34
- package/app/components/primer/alpha/tool_tip.d.ts +0 -27
- package/app/components/primer/alpha/x_banner.d.ts +0 -18
- package/app/components/primer/anchored_position.d.ts +0 -27
- package/app/components/primer/aria_live.d.ts +0 -8
- package/app/components/primer/beta/auto_complete/auto_complete.d.ts +0 -1
- package/app/components/primer/beta/clipboard_copy.d.ts +0 -1
- package/app/components/primer/beta/nav_list.d.ts +0 -20
- package/app/components/primer/beta/nav_list_group_element.d.ts +0 -19
- package/app/components/primer/beta/relative_time.d.ts +0 -1
- package/app/components/primer/dialog_helper.d.ts +0 -15
- package/app/components/primer/focus_group.d.ts +0 -19
- package/app/components/primer/primer.d.ts +0 -28
- package/app/components/primer/scrollable_region.d.ts +0 -13
- package/app/components/primer/shared_events.d.ts +0 -11
- package/lib/primer/forms/primer_multi_input.js +0 -44
- package/lib/primer/forms/primer_text_field.js +0 -119
- package/lib/primer/forms/toggle_switch_input.js +0 -34
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/action_bar_element.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/action_list.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/action_menu/action_menu_element.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/dropdown/menu.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/dropdown.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/image_crop.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/modal_dialog.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/segmented_control.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/select_panel_element.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/tab_container.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/toggle_switch.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/tool_tip.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/alpha/x_banner.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/anchored_position.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/aria_live.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/beta/auto_complete/auto_complete.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/beta/clipboard_copy.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/beta/nav_list.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/beta/nav_list_group_element.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/beta/relative_time.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/dialog_helper.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/focus_group.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/scrollable_region.d.ts +0 -0
- /package/app/assets/javascripts/{app/components → components}/primer/shared_events.d.ts +0 -0
@@ -1,44 +0,0 @@
|
|
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
|
-
/* eslint-disable custom-elements/expose-class-on-global */
|
8
|
-
import { controller, targets } from '@github/catalyst';
|
9
|
-
let PrimerMultiInputElement = class PrimerMultiInputElement extends HTMLElement {
|
10
|
-
activateField(name) {
|
11
|
-
const fieldWithName = this.findField(name);
|
12
|
-
if (!fieldWithName)
|
13
|
-
return;
|
14
|
-
for (const field of this.fields) {
|
15
|
-
if (field === fieldWithName)
|
16
|
-
continue;
|
17
|
-
field.setAttribute('disabled', 'disabled');
|
18
|
-
field.setAttribute('hidden', 'hidden');
|
19
|
-
field.parentElement?.setAttribute('hidden', 'hidden');
|
20
|
-
}
|
21
|
-
fieldWithName.removeAttribute('disabled');
|
22
|
-
fieldWithName.removeAttribute('hidden');
|
23
|
-
fieldWithName.parentElement?.removeAttribute('hidden');
|
24
|
-
}
|
25
|
-
findField(name) {
|
26
|
-
for (const field of this.fields) {
|
27
|
-
if (field.getAttribute('data-name') === name) {
|
28
|
-
return field;
|
29
|
-
}
|
30
|
-
}
|
31
|
-
return null;
|
32
|
-
}
|
33
|
-
};
|
34
|
-
__decorate([
|
35
|
-
targets
|
36
|
-
], PrimerMultiInputElement.prototype, "fields", void 0);
|
37
|
-
PrimerMultiInputElement = __decorate([
|
38
|
-
controller
|
39
|
-
], PrimerMultiInputElement);
|
40
|
-
export { PrimerMultiInputElement };
|
41
|
-
if (!window.customElements.get('primer-multi-input')) {
|
42
|
-
Object.assign(window, { PrimerMultiInputElement });
|
43
|
-
window.customElements.define('primer-multi-input', PrimerMultiInputElement);
|
44
|
-
}
|
@@ -1,119 +0,0 @@
|
|
1
|
-
/* eslint-disable custom-elements/expose-class-on-global */
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
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;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
10
|
-
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");
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
12
|
-
};
|
13
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
14
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
15
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
16
|
-
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");
|
17
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
18
|
-
};
|
19
|
-
var _PrimerTextFieldElement_abortController;
|
20
|
-
import '@github/auto-check-element';
|
21
|
-
import { controller, target } from '@github/catalyst';
|
22
|
-
let PrimerTextFieldElement = class PrimerTextFieldElement extends HTMLElement {
|
23
|
-
constructor() {
|
24
|
-
super(...arguments);
|
25
|
-
_PrimerTextFieldElement_abortController.set(this, void 0);
|
26
|
-
}
|
27
|
-
connectedCallback() {
|
28
|
-
__classPrivateFieldGet(this, _PrimerTextFieldElement_abortController, "f")?.abort();
|
29
|
-
const { signal } = (__classPrivateFieldSet(this, _PrimerTextFieldElement_abortController, new AbortController(), "f"));
|
30
|
-
this.addEventListener('auto-check-success', async (event) => {
|
31
|
-
const message = await event.detail.response.text();
|
32
|
-
if (message && message.length > 0) {
|
33
|
-
this.setSuccess(message);
|
34
|
-
}
|
35
|
-
else {
|
36
|
-
this.clearError();
|
37
|
-
}
|
38
|
-
}, { signal });
|
39
|
-
this.addEventListener('auto-check-error', async (event) => {
|
40
|
-
const errorMessage = await event.detail.response.text();
|
41
|
-
this.setError(errorMessage);
|
42
|
-
}, { signal });
|
43
|
-
}
|
44
|
-
disconnectedCallback() {
|
45
|
-
__classPrivateFieldGet(this, _PrimerTextFieldElement_abortController, "f")?.abort();
|
46
|
-
}
|
47
|
-
clearContents() {
|
48
|
-
this.inputElement.value = '';
|
49
|
-
this.inputElement.focus();
|
50
|
-
this.inputElement.dispatchEvent(new Event('input', { bubbles: true, cancelable: false }));
|
51
|
-
}
|
52
|
-
clearError() {
|
53
|
-
this.inputElement.removeAttribute('invalid');
|
54
|
-
this.validationElement.hidden = true;
|
55
|
-
this.validationMessageElement.replaceChildren();
|
56
|
-
}
|
57
|
-
setValidationMessage(message) {
|
58
|
-
const template = document.createElement('template');
|
59
|
-
// eslint-disable-next-line github/no-inner-html
|
60
|
-
template.innerHTML = message;
|
61
|
-
const fragment = document.importNode(template.content, true);
|
62
|
-
this.validationMessageElement.replaceChildren(fragment);
|
63
|
-
}
|
64
|
-
toggleValidationStyling(isError) {
|
65
|
-
if (isError) {
|
66
|
-
this.validationElement.classList.remove('FormControl-inlineValidation--success');
|
67
|
-
}
|
68
|
-
else {
|
69
|
-
this.validationElement.classList.add('FormControl-inlineValidation--success');
|
70
|
-
}
|
71
|
-
this.validationSuccessIcon.hidden = isError;
|
72
|
-
this.validationErrorIcon.hidden = !isError;
|
73
|
-
this.inputElement.setAttribute('invalid', isError ? 'true' : 'false');
|
74
|
-
}
|
75
|
-
setSuccess(message) {
|
76
|
-
this.toggleValidationStyling(false);
|
77
|
-
this.setValidationMessage(message);
|
78
|
-
this.validationElement.hidden = false;
|
79
|
-
}
|
80
|
-
setError(message) {
|
81
|
-
this.toggleValidationStyling(true);
|
82
|
-
this.setValidationMessage(message);
|
83
|
-
this.validationElement.hidden = false;
|
84
|
-
}
|
85
|
-
showLeadingSpinner() {
|
86
|
-
this.leadingSpinner?.removeAttribute('hidden');
|
87
|
-
this.leadingVisual?.setAttribute('hidden', '');
|
88
|
-
}
|
89
|
-
hideLeadingSpinner() {
|
90
|
-
this.leadingSpinner?.setAttribute('hidden', '');
|
91
|
-
this.leadingVisual?.removeAttribute('hidden');
|
92
|
-
}
|
93
|
-
};
|
94
|
-
_PrimerTextFieldElement_abortController = new WeakMap();
|
95
|
-
__decorate([
|
96
|
-
target
|
97
|
-
], PrimerTextFieldElement.prototype, "inputElement", void 0);
|
98
|
-
__decorate([
|
99
|
-
target
|
100
|
-
], PrimerTextFieldElement.prototype, "validationElement", void 0);
|
101
|
-
__decorate([
|
102
|
-
target
|
103
|
-
], PrimerTextFieldElement.prototype, "validationMessageElement", void 0);
|
104
|
-
__decorate([
|
105
|
-
target
|
106
|
-
], PrimerTextFieldElement.prototype, "validationSuccessIcon", void 0);
|
107
|
-
__decorate([
|
108
|
-
target
|
109
|
-
], PrimerTextFieldElement.prototype, "validationErrorIcon", void 0);
|
110
|
-
__decorate([
|
111
|
-
target
|
112
|
-
], PrimerTextFieldElement.prototype, "leadingVisual", void 0);
|
113
|
-
__decorate([
|
114
|
-
target
|
115
|
-
], PrimerTextFieldElement.prototype, "leadingSpinner", void 0);
|
116
|
-
PrimerTextFieldElement = __decorate([
|
117
|
-
controller
|
118
|
-
], PrimerTextFieldElement);
|
119
|
-
export { PrimerTextFieldElement };
|
@@ -1,34 +0,0 @@
|
|
1
|
-
/* eslint-disable custom-elements/expose-class-on-global */
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
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;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
import { controller, target } from '@github/catalyst';
|
9
|
-
let ToggleSwitchInputElement = class ToggleSwitchInputElement extends HTMLElement {
|
10
|
-
connectedCallback() {
|
11
|
-
this.addEventListener('toggleSwitchError', (event) => {
|
12
|
-
this.validationMessageElement.textContent = event.detail;
|
13
|
-
this.validationElement.removeAttribute('hidden');
|
14
|
-
});
|
15
|
-
this.addEventListener('toggleSwitchSuccess', () => {
|
16
|
-
this.validationMessageElement.textContent = '';
|
17
|
-
this.validationElement.setAttribute('hidden', 'hidden');
|
18
|
-
});
|
19
|
-
this.addEventListener('toggleSwitchLoading', () => {
|
20
|
-
this.validationMessageElement.textContent = '';
|
21
|
-
this.validationElement.setAttribute('hidden', 'hidden');
|
22
|
-
});
|
23
|
-
}
|
24
|
-
};
|
25
|
-
__decorate([
|
26
|
-
target
|
27
|
-
], ToggleSwitchInputElement.prototype, "validationElement", void 0);
|
28
|
-
__decorate([
|
29
|
-
target
|
30
|
-
], ToggleSwitchInputElement.prototype, "validationMessageElement", void 0);
|
31
|
-
ToggleSwitchInputElement = __decorate([
|
32
|
-
controller
|
33
|
-
], ToggleSwitchInputElement);
|
34
|
-
export { ToggleSwitchInputElement };
|
/package/app/assets/javascripts/{app/components → components}/primer/alpha/action_bar_element.d.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
/package/app/assets/javascripts/{app/components → components}/primer/alpha/dropdown/menu.d.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
/package/app/assets/javascripts/{app/components → components}/primer/alpha/modal_dialog.d.ts
RENAMED
File without changes
|
/package/app/assets/javascripts/{app/components → components}/primer/alpha/segmented_control.d.ts
RENAMED
File without changes
|
/package/app/assets/javascripts/{app/components → components}/primer/alpha/select_panel_element.d.ts
RENAMED
File without changes
|
/package/app/assets/javascripts/{app/components → components}/primer/alpha/tab_container.d.ts
RENAMED
File without changes
|
/package/app/assets/javascripts/{app/components → components}/primer/alpha/toggle_switch.d.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/app/assets/javascripts/{app/components → components}/primer/beta/clipboard_copy.d.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
/package/app/assets/javascripts/{app/components → components}/primer/beta/relative_time.d.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|