primer_view_components 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/app/assets/javascripts/app/components/primer/alpha/action_bar_element.d.ts +16 -0
- data/app/assets/javascripts/app/components/primer/alpha/action_menu/action_menu_element.d.ts +30 -0
- data/app/assets/javascripts/app/components/primer/alpha/dropdown/menu.d.ts +1 -0
- data/app/assets/javascripts/app/components/primer/alpha/dropdown.d.ts +1 -0
- data/app/assets/javascripts/app/components/primer/alpha/image_crop.d.ts +1 -0
- data/app/assets/javascripts/app/components/primer/alpha/modal_dialog.d.ts +18 -0
- data/app/assets/javascripts/app/components/primer/alpha/nav_list.d.ts +28 -0
- data/app/assets/javascripts/app/components/primer/alpha/segmented_control.d.ts +12 -0
- data/app/assets/javascripts/app/components/primer/alpha/tab_container.d.ts +1 -0
- data/app/assets/javascripts/app/components/primer/alpha/toggle_switch.d.ts +30 -0
- data/app/assets/javascripts/app/components/primer/alpha/tool_tip.d.ts +26 -0
- data/app/assets/javascripts/app/components/primer/alpha/x_banner.d.ts +11 -0
- data/app/assets/javascripts/app/components/primer/anchored_position.d.ts +27 -0
- data/app/assets/javascripts/app/components/primer/beta/auto_complete/auto_complete.d.ts +1 -0
- data/app/assets/javascripts/app/components/primer/beta/clipboard_copy.d.ts +1 -0
- data/app/assets/javascripts/app/components/primer/beta/relative_time.d.ts +1 -0
- data/app/assets/javascripts/app/components/primer/focus_group.d.ts +19 -0
- data/app/assets/javascripts/app/components/primer/primer.d.ts +21 -0
- data/app/assets/javascripts/lib/primer/forms/primer_multi_input.d.ts +10 -0
- data/app/assets/javascripts/lib/primer/forms/primer_text_field.d.ts +1 -0
- data/app/assets/javascripts/lib/primer/forms/toggle_switch_input.d.ts +5 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_bar/divider.rb +30 -0
- data/app/components/primer/alpha/action_bar/item.rb +26 -0
- data/app/components/primer/alpha/action_bar.css +1 -0
- data/app/components/primer/alpha/action_bar.css.json +17 -0
- data/app/components/primer/alpha/action_bar.css.map +1 -0
- data/app/components/primer/alpha/action_bar.html.erb +12 -0
- data/app/components/primer/alpha/action_bar.pcss +69 -0
- data/app/components/primer/alpha/action_bar.rb +110 -0
- data/app/components/primer/alpha/action_bar_element.d.ts +16 -0
- data/app/components/primer/alpha/action_bar_element.js +172 -0
- data/app/components/primer/alpha/action_bar_element.ts +175 -0
- data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +2 -2
- data/app/components/primer/alpha/tool_tip.d.ts +3 -2
- data/app/components/primer/alpha/tool_tip.js +89 -44
- data/app/components/primer/alpha/tool_tip.ts +88 -41
- data/app/components/primer/alpha/tooltip.rb +1 -0
- data/app/components/primer/beta/link.css +1 -1
- data/app/components/primer/beta/link.css.map +1 -1
- data/app/components/primer/beta/link.pcss +4 -0
- data/app/components/primer/beta/link.rb +6 -10
- data/app/components/primer/primer.d.ts +1 -0
- data/app/components/primer/primer.js +1 -0
- data/app/components/primer/primer.pcss +1 -0
- data/app/components/primer/primer.ts +1 -0
- data/lib/primer/static/generate_previews.rb +9 -0
- data/lib/primer/view_components/linters/tooltipped_migration.rb +1 -3
- data/lib/primer/view_components/version.rb +2 -2
- data/lib/primer/yard.rb +5 -0
- data/previews/primer/alpha/action_bar_preview/inline.html.erb +16 -0
- data/previews/primer/alpha/action_bar_preview.rb +77 -0
- data/previews/primer/alpha/action_list_preview.rb +10 -0
- data/previews/primer/alpha/action_menu_preview.rb +5 -0
- data/previews/primer/alpha/auto_complete_preview.rb +1 -0
- data/previews/primer/alpha/banner_preview.rb +9 -1
- data/previews/primer/alpha/button_marketing_preview.rb +2 -0
- data/previews/primer/alpha/check_box_group_preview.rb +1 -0
- data/previews/primer/alpha/check_box_preview.rb +6 -0
- data/previews/primer/alpha/dialog_preview.rb +1 -0
- data/previews/primer/alpha/dropdown_preview.rb +1 -0
- data/previews/primer/alpha/hellip_button_preview.rb +1 -0
- data/previews/primer/alpha/hidden_text_expander_preview.rb +1 -0
- data/previews/primer/alpha/layout_preview.rb +4 -0
- data/previews/primer/alpha/menu_preview.rb +1 -0
- data/previews/primer/alpha/multi_input_preview.rb +4 -0
- data/previews/primer/alpha/nav_list_preview.rb +3 -0
- data/previews/primer/alpha/radio_button_group_preview.rb +2 -0
- data/previews/primer/alpha/radio_button_preview.rb +10 -0
- data/previews/primer/alpha/segmented_control_preview.rb +13 -0
- data/previews/primer/alpha/select_preview.rb +6 -0
- data/previews/primer/alpha/tab_nav_preview.rb +3 -0
- data/previews/primer/alpha/tab_panels_preview.rb +1 -0
- data/previews/primer/alpha/text_area_preview.rb +7 -0
- data/previews/primer/alpha/text_field_preview.rb +15 -0
- data/previews/primer/alpha/toggle_switch_preview.rb +7 -0
- data/previews/primer/alpha/tooltip_preview/tooltip_inside_primer_overlay.html.erb +20 -0
- data/previews/primer/alpha/tooltip_preview.rb +7 -0
- data/previews/primer/alpha/underline_nav_preview.rb +2 -0
- data/previews/primer/beta/auto_complete_item_preview.rb +2 -0
- data/previews/primer/beta/auto_complete_preview.rb +7 -0
- data/previews/primer/beta/avatar_preview.rb +10 -0
- data/previews/primer/beta/avatar_stack_preview.rb +3 -0
- data/previews/primer/beta/blankslate_preview.rb +9 -0
- data/previews/primer/beta/border_box_preview.rb +4 -0
- data/previews/primer/beta/breadcrumbs_preview.rb +1 -0
- data/previews/primer/beta/button_group_preview.rb +4 -0
- data/previews/primer/beta/button_preview.rb +10 -0
- data/previews/primer/beta/clipboard_copy_preview.rb +2 -0
- data/previews/primer/beta/close_button_preview.rb +1 -0
- data/previews/primer/beta/counter_preview.rb +11 -0
- data/previews/primer/beta/flash_preview.rb +8 -0
- data/previews/primer/beta/heading_preview.rb +1 -0
- data/previews/primer/beta/icon_button_preview.rb +3 -0
- data/previews/primer/beta/label_preview.rb +13 -0
- data/previews/primer/beta/link_preview.rb +11 -9
- data/previews/primer/beta/markdown_preview.rb +1 -0
- data/previews/primer/beta/octicon_preview.rb +1 -0
- data/previews/primer/beta/popover_preview.rb +6 -0
- data/previews/primer/beta/progress_bar_preview.rb +4 -0
- data/previews/primer/beta/spinner_preview.rb +1 -0
- data/previews/primer/beta/state_preview.rb +6 -0
- data/previews/primer/beta/subhead_preview.rb +4 -0
- data/previews/primer/beta/text_preview.rb +1 -0
- data/previews/primer/beta/timeline_item_preview.rb +1 -0
- data/previews/primer/beta/truncate_preview.rb +1 -0
- data/previews/primer/box_preview.rb +2 -0
- data/static/arguments.json +51 -7
- data/static/audited_at.json +3 -0
- data/static/classes.json +21 -0
- data/static/constants.json +20 -6
- data/static/info_arch.json +669 -7
- data/static/previews.json +571 -0
- data/static/statuses.json +3 -0
- metadata +43 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6efd473bb25628d5714fbb19659dc8b9f7dfc4278f2a19f149979d19abba17f6
|
4
|
+
data.tar.gz: 7737271c70bf2ab758f77d23fdb5aaaf4b8a2c9f57efe9968f12dc85f54a3214
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a11563f087fd14efa64c7d5a1f87cc0f308fea1c9ce05b7477e32a8c1836fe6e4a60d896d17f0c71a1b697eb13b5020d5ea755a9ccc29d986d7fb1bdaf6c1c61
|
7
|
+
data.tar.gz: e0befd04591d1d23aea3a368ec6d4517548e0348666d442e0dd38210b1890833e1fe882066af05e8f9ca5598a40f1a6c0bedd5ba04a3bd586979e2c7694459ea
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.4.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- [#2111](https://github.com/primer/view_components/pull/2111) [`6ee6d774`](https://github.com/primer/view_components/commit/6ee6d774b463753c7b2b944dcf57dd4ff40c9589) Thanks [@keithamus](https://github.com/keithamus)! - refactor Primer::Alpha::Tooltip to use popover
|
8
|
+
|
9
|
+
Changed components: Primer::Alpha::Tooltip
|
10
|
+
|
11
|
+
- [#2034](https://github.com/primer/view_components/pull/2034) [`707a1fa3`](https://github.com/primer/view_components/commit/707a1fa31dd23cae8316fa9d8a6c122bc4edc354) Thanks [@radglob](https://github.com/radglob)! - Partially address a11y issues in Link component.
|
12
|
+
|
13
|
+
Links can no longer be rendered as `<span>`s.
|
14
|
+
|
15
|
+
- [#1941](https://github.com/primer/view_components/pull/1941) [`a8cc5ba2`](https://github.com/primer/view_components/commit/a8cc5ba2061207d9ca65c42f3d355eb8b7f03bb8) Thanks [@jonrohan](https://github.com/jonrohan)! - 🆕 New component!
|
16
|
+
|
17
|
+
The `Primer::Alpha::ActionBar` component is used to create a toolbar of buttons that will fold into an ActionMenu when the space is smaller. [Design details](https://primer.style/design/components/action-bar/)
|
18
|
+
|
3
19
|
## 0.3.1
|
4
20
|
|
5
21
|
### Patch Changes
|
@@ -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,30 @@
|
|
1
|
+
import IncludeFragmentElement from '@github/include-fragment-element';
|
2
|
+
type SelectVariant = 'none' | 'single' | 'multiple' | null;
|
3
|
+
type SelectedItem = {
|
4
|
+
label: string | null | undefined;
|
5
|
+
value: string | null | undefined;
|
6
|
+
element: Element;
|
7
|
+
};
|
8
|
+
export declare class ActionMenuElement extends HTMLElement {
|
9
|
+
#private;
|
10
|
+
includeFragment: IncludeFragmentElement;
|
11
|
+
get selectVariant(): SelectVariant;
|
12
|
+
set selectVariant(variant: SelectVariant);
|
13
|
+
get dynamicLabelPrefix(): string;
|
14
|
+
set dynamicLabelPrefix(value: string);
|
15
|
+
get dynamicLabel(): boolean;
|
16
|
+
set dynamicLabel(value: boolean);
|
17
|
+
get popoverElement(): HTMLElement | null;
|
18
|
+
get invokerElement(): HTMLElement | null;
|
19
|
+
get invokerLabel(): HTMLElement | null;
|
20
|
+
get selectedItems(): SelectedItem[];
|
21
|
+
connectedCallback(): void;
|
22
|
+
disconnectedCallback(): void;
|
23
|
+
handleEvent(event: Event): void;
|
24
|
+
}
|
25
|
+
declare global {
|
26
|
+
interface Window {
|
27
|
+
ActionMenuElement: typeof ActionMenuElement;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
import '@github/details-menu-element';
|
@@ -0,0 +1 @@
|
|
1
|
+
import './dropdown/menu';
|
@@ -0,0 +1 @@
|
|
1
|
+
import '@github/image-crop-element';
|
@@ -0,0 +1,18 @@
|
|
1
|
+
export declare class ModalDialogElement extends HTMLElement {
|
2
|
+
#private;
|
3
|
+
openButton: HTMLButtonElement | null;
|
4
|
+
get open(): boolean;
|
5
|
+
set open(value: boolean);
|
6
|
+
get showButtons(): NodeList;
|
7
|
+
connectedCallback(): void;
|
8
|
+
show(): void;
|
9
|
+
close(closedNotCancelled?: boolean): void;
|
10
|
+
}
|
11
|
+
declare global {
|
12
|
+
interface Window {
|
13
|
+
ModalDialogElement: typeof ModalDialogElement;
|
14
|
+
}
|
15
|
+
interface HTMLElementTagNameMap {
|
16
|
+
'modal-dialog': ModalDialogElement;
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
export declare class NavListElement extends HTMLElement {
|
2
|
+
#private;
|
3
|
+
items: HTMLElement[];
|
4
|
+
showMoreItem: HTMLElement;
|
5
|
+
focusMarkers: HTMLElement[];
|
6
|
+
connectedCallback(): void;
|
7
|
+
get showMoreDisabled(): boolean;
|
8
|
+
set showMoreDisabled(value: boolean);
|
9
|
+
set currentPage(value: number);
|
10
|
+
get currentPage(): number;
|
11
|
+
get totalPages(): number;
|
12
|
+
get paginationSrc(): string;
|
13
|
+
selectItemById(itemId: string | null): boolean;
|
14
|
+
selectItemByHref(href: string | null): boolean;
|
15
|
+
selectItemByCurrentLocation(): boolean;
|
16
|
+
expandItem(item: HTMLElement): void;
|
17
|
+
collapseItem(item: HTMLElement): void;
|
18
|
+
itemIsExpanded(item: HTMLElement | null): boolean;
|
19
|
+
handleItemWithSubItemClick(e: Event): void;
|
20
|
+
handleItemWithSubItemKeydown(e: KeyboardEvent): void;
|
21
|
+
private showMore;
|
22
|
+
private setShowMoreItemState;
|
23
|
+
}
|
24
|
+
declare global {
|
25
|
+
interface Window {
|
26
|
+
NavListElement: typeof NavListElement;
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
declare class SegmentedControlElement extends HTMLElement {
|
2
|
+
#private;
|
3
|
+
items: HTMLElement[];
|
4
|
+
connectedCallback(): void;
|
5
|
+
select(event: Event): void;
|
6
|
+
}
|
7
|
+
declare global {
|
8
|
+
interface Window {
|
9
|
+
SegmentedControlElement: typeof SegmentedControlElement;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
import '@github/tab-container-element';
|
@@ -0,0 +1,30 @@
|
|
1
|
+
declare class ToggleSwitchElement extends HTMLElement {
|
2
|
+
switch: HTMLElement;
|
3
|
+
loadingSpinner: HTMLElement;
|
4
|
+
errorIcon: HTMLElement;
|
5
|
+
private toggling;
|
6
|
+
get src(): string | null;
|
7
|
+
get csrf(): string | null;
|
8
|
+
get csrfField(): string;
|
9
|
+
isRemote(): boolean;
|
10
|
+
toggle(): Promise<void>;
|
11
|
+
turnOn(): void;
|
12
|
+
turnOff(): void;
|
13
|
+
isOn(): boolean;
|
14
|
+
isOff(): boolean;
|
15
|
+
isDisabled(): boolean;
|
16
|
+
disable(): void;
|
17
|
+
enable(): void;
|
18
|
+
private performToggle;
|
19
|
+
private setLoadingState;
|
20
|
+
private setSuccessState;
|
21
|
+
private setErrorState;
|
22
|
+
private setFinishedState;
|
23
|
+
private submitForm;
|
24
|
+
}
|
25
|
+
declare global {
|
26
|
+
interface Window {
|
27
|
+
ToggleSwitchElement: typeof ToggleSwitchElement;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
export {};
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import '@oddbird/popover-polyfill';
|
2
|
+
type Direction = 'n' | 's' | 'e' | 'w' | 'ne' | 'se' | 'nw' | 'sw';
|
3
|
+
declare class ToolTipElement extends HTMLElement {
|
4
|
+
#private;
|
5
|
+
styles(): string;
|
6
|
+
get htmlFor(): string;
|
7
|
+
set htmlFor(value: string);
|
8
|
+
get type(): 'description' | 'label';
|
9
|
+
set type(value: 'description' | 'label');
|
10
|
+
get direction(): Direction;
|
11
|
+
set direction(value: Direction);
|
12
|
+
get control(): HTMLElement | null;
|
13
|
+
set hiddenFromView(value: true | false);
|
14
|
+
get hiddenFromView(): true | false;
|
15
|
+
connectedCallback(): void;
|
16
|
+
disconnectedCallback(): void;
|
17
|
+
handleEvent(event: Event): Promise<void>;
|
18
|
+
static observedAttributes: string[];
|
19
|
+
attributeChangedCallback(name: string): void;
|
20
|
+
}
|
21
|
+
declare global {
|
22
|
+
interface Window {
|
23
|
+
ToolTipElement: typeof ToolTipElement;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
export {};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import type { AnchorAlignment, AnchorSide, PositionSettings } from '@primer/behaviors';
|
2
|
+
export default class AnchoredPositionElement extends HTMLElement implements PositionSettings {
|
3
|
+
#private;
|
4
|
+
get align(): AnchorAlignment;
|
5
|
+
set align(value: AnchorAlignment);
|
6
|
+
get side(): AnchorSide;
|
7
|
+
set side(value: AnchorSide);
|
8
|
+
get anchorOffset(): number;
|
9
|
+
set anchorOffset(value: number | 'normal' | 'spacious');
|
10
|
+
get anchor(): string;
|
11
|
+
set anchor(value: string);
|
12
|
+
get anchorElement(): HTMLElement | null;
|
13
|
+
set anchorElement(value: HTMLElement | null);
|
14
|
+
get alignmentOffset(): number;
|
15
|
+
set alignmentOffset(value: number);
|
16
|
+
get allowOutOfBounds(): boolean;
|
17
|
+
set allowOutOfBounds(value: boolean);
|
18
|
+
connectedCallback(): void;
|
19
|
+
static observedAttributes: string[];
|
20
|
+
attributeChangedCallback(): void;
|
21
|
+
update(): void;
|
22
|
+
}
|
23
|
+
declare global {
|
24
|
+
interface Window {
|
25
|
+
AnchoredPositionElement: typeof AnchoredPositionElement;
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
import '@github/auto-complete-element';
|
@@ -0,0 +1 @@
|
|
1
|
+
import '@github/clipboard-copy-element';
|
@@ -0,0 +1 @@
|
|
1
|
+
import '@github/relative-time-element';
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import '@oddbird/popover-polyfill';
|
2
|
+
export default class FocusGroupElement extends HTMLElement {
|
3
|
+
#private;
|
4
|
+
get nowrap(): boolean;
|
5
|
+
set nowrap(value: boolean);
|
6
|
+
get direction(): 'horizontal' | 'vertical' | 'both';
|
7
|
+
set direction(value: 'horizontal' | 'vertical' | 'both');
|
8
|
+
get retain(): boolean;
|
9
|
+
set retain(value: boolean);
|
10
|
+
get mnemonics(): boolean;
|
11
|
+
connectedCallback(): void;
|
12
|
+
disconnectedCallback(): void;
|
13
|
+
handleEvent(event: Event): void;
|
14
|
+
}
|
15
|
+
declare global {
|
16
|
+
interface Window {
|
17
|
+
FocusGroupElement: typeof FocusGroupElement;
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import '@github/include-fragment-element';
|
2
|
+
import '@oddbird/popover-polyfill';
|
3
|
+
import './alpha/action_bar_element';
|
4
|
+
import './alpha/dropdown';
|
5
|
+
import './anchored_position';
|
6
|
+
import './focus_group';
|
7
|
+
import './alpha/image_crop';
|
8
|
+
import './alpha/modal_dialog';
|
9
|
+
import './alpha/nav_list';
|
10
|
+
import './alpha/segmented_control';
|
11
|
+
import './alpha/toggle_switch';
|
12
|
+
import './alpha/tool_tip';
|
13
|
+
import './alpha/x_banner';
|
14
|
+
import './beta/auto_complete/auto_complete';
|
15
|
+
import './beta/clipboard_copy';
|
16
|
+
import './beta/relative_time';
|
17
|
+
import './alpha/tab_container';
|
18
|
+
import '../../../lib/primer/forms/primer_multi_input';
|
19
|
+
import '../../../lib/primer/forms/primer_text_field';
|
20
|
+
import '../../../lib/primer/forms/toggle_switch_input';
|
21
|
+
import './alpha/action_menu/action_menu_element';
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export declare class PrimerMultiInputElement extends HTMLElement {
|
2
|
+
fields: HTMLInputElement[];
|
3
|
+
activateField(name: string): void;
|
4
|
+
private findField;
|
5
|
+
}
|
6
|
+
declare global {
|
7
|
+
interface Window {
|
8
|
+
PrimerMultiInputElement: typeof PrimerMultiInputElement;
|
9
|
+
}
|
10
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
import '@github/auto-check-element';
|