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.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/app/assets/javascripts/app/components/primer/alpha/action_bar_element.d.ts +16 -0
  4. data/app/assets/javascripts/app/components/primer/alpha/action_menu/action_menu_element.d.ts +30 -0
  5. data/app/assets/javascripts/app/components/primer/alpha/dropdown/menu.d.ts +1 -0
  6. data/app/assets/javascripts/app/components/primer/alpha/dropdown.d.ts +1 -0
  7. data/app/assets/javascripts/app/components/primer/alpha/image_crop.d.ts +1 -0
  8. data/app/assets/javascripts/app/components/primer/alpha/modal_dialog.d.ts +18 -0
  9. data/app/assets/javascripts/app/components/primer/alpha/nav_list.d.ts +28 -0
  10. data/app/assets/javascripts/app/components/primer/alpha/segmented_control.d.ts +12 -0
  11. data/app/assets/javascripts/app/components/primer/alpha/tab_container.d.ts +1 -0
  12. data/app/assets/javascripts/app/components/primer/alpha/toggle_switch.d.ts +30 -0
  13. data/app/assets/javascripts/app/components/primer/alpha/tool_tip.d.ts +26 -0
  14. data/app/assets/javascripts/app/components/primer/alpha/x_banner.d.ts +11 -0
  15. data/app/assets/javascripts/app/components/primer/anchored_position.d.ts +27 -0
  16. data/app/assets/javascripts/app/components/primer/beta/auto_complete/auto_complete.d.ts +1 -0
  17. data/app/assets/javascripts/app/components/primer/beta/clipboard_copy.d.ts +1 -0
  18. data/app/assets/javascripts/app/components/primer/beta/relative_time.d.ts +1 -0
  19. data/app/assets/javascripts/app/components/primer/focus_group.d.ts +19 -0
  20. data/app/assets/javascripts/app/components/primer/primer.d.ts +21 -0
  21. data/app/assets/javascripts/lib/primer/forms/primer_multi_input.d.ts +10 -0
  22. data/app/assets/javascripts/lib/primer/forms/primer_text_field.d.ts +1 -0
  23. data/app/assets/javascripts/lib/primer/forms/toggle_switch_input.d.ts +5 -0
  24. data/app/assets/javascripts/primer_view_components.js +1 -1
  25. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  26. data/app/assets/styles/primer_view_components.css +1 -1
  27. data/app/assets/styles/primer_view_components.css.map +1 -1
  28. data/app/components/primer/alpha/action_bar/divider.rb +30 -0
  29. data/app/components/primer/alpha/action_bar/item.rb +26 -0
  30. data/app/components/primer/alpha/action_bar.css +1 -0
  31. data/app/components/primer/alpha/action_bar.css.json +17 -0
  32. data/app/components/primer/alpha/action_bar.css.map +1 -0
  33. data/app/components/primer/alpha/action_bar.html.erb +12 -0
  34. data/app/components/primer/alpha/action_bar.pcss +69 -0
  35. data/app/components/primer/alpha/action_bar.rb +110 -0
  36. data/app/components/primer/alpha/action_bar_element.d.ts +16 -0
  37. data/app/components/primer/alpha/action_bar_element.js +172 -0
  38. data/app/components/primer/alpha/action_bar_element.ts +175 -0
  39. data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +2 -2
  40. data/app/components/primer/alpha/tool_tip.d.ts +3 -2
  41. data/app/components/primer/alpha/tool_tip.js +89 -44
  42. data/app/components/primer/alpha/tool_tip.ts +88 -41
  43. data/app/components/primer/alpha/tooltip.rb +1 -0
  44. data/app/components/primer/beta/link.css +1 -1
  45. data/app/components/primer/beta/link.css.map +1 -1
  46. data/app/components/primer/beta/link.pcss +4 -0
  47. data/app/components/primer/beta/link.rb +6 -10
  48. data/app/components/primer/primer.d.ts +1 -0
  49. data/app/components/primer/primer.js +1 -0
  50. data/app/components/primer/primer.pcss +1 -0
  51. data/app/components/primer/primer.ts +1 -0
  52. data/lib/primer/static/generate_previews.rb +9 -0
  53. data/lib/primer/view_components/linters/tooltipped_migration.rb +1 -3
  54. data/lib/primer/view_components/version.rb +2 -2
  55. data/lib/primer/yard.rb +5 -0
  56. data/previews/primer/alpha/action_bar_preview/inline.html.erb +16 -0
  57. data/previews/primer/alpha/action_bar_preview.rb +77 -0
  58. data/previews/primer/alpha/action_list_preview.rb +10 -0
  59. data/previews/primer/alpha/action_menu_preview.rb +5 -0
  60. data/previews/primer/alpha/auto_complete_preview.rb +1 -0
  61. data/previews/primer/alpha/banner_preview.rb +9 -1
  62. data/previews/primer/alpha/button_marketing_preview.rb +2 -0
  63. data/previews/primer/alpha/check_box_group_preview.rb +1 -0
  64. data/previews/primer/alpha/check_box_preview.rb +6 -0
  65. data/previews/primer/alpha/dialog_preview.rb +1 -0
  66. data/previews/primer/alpha/dropdown_preview.rb +1 -0
  67. data/previews/primer/alpha/hellip_button_preview.rb +1 -0
  68. data/previews/primer/alpha/hidden_text_expander_preview.rb +1 -0
  69. data/previews/primer/alpha/layout_preview.rb +4 -0
  70. data/previews/primer/alpha/menu_preview.rb +1 -0
  71. data/previews/primer/alpha/multi_input_preview.rb +4 -0
  72. data/previews/primer/alpha/nav_list_preview.rb +3 -0
  73. data/previews/primer/alpha/radio_button_group_preview.rb +2 -0
  74. data/previews/primer/alpha/radio_button_preview.rb +10 -0
  75. data/previews/primer/alpha/segmented_control_preview.rb +13 -0
  76. data/previews/primer/alpha/select_preview.rb +6 -0
  77. data/previews/primer/alpha/tab_nav_preview.rb +3 -0
  78. data/previews/primer/alpha/tab_panels_preview.rb +1 -0
  79. data/previews/primer/alpha/text_area_preview.rb +7 -0
  80. data/previews/primer/alpha/text_field_preview.rb +15 -0
  81. data/previews/primer/alpha/toggle_switch_preview.rb +7 -0
  82. data/previews/primer/alpha/tooltip_preview/tooltip_inside_primer_overlay.html.erb +20 -0
  83. data/previews/primer/alpha/tooltip_preview.rb +7 -0
  84. data/previews/primer/alpha/underline_nav_preview.rb +2 -0
  85. data/previews/primer/beta/auto_complete_item_preview.rb +2 -0
  86. data/previews/primer/beta/auto_complete_preview.rb +7 -0
  87. data/previews/primer/beta/avatar_preview.rb +10 -0
  88. data/previews/primer/beta/avatar_stack_preview.rb +3 -0
  89. data/previews/primer/beta/blankslate_preview.rb +9 -0
  90. data/previews/primer/beta/border_box_preview.rb +4 -0
  91. data/previews/primer/beta/breadcrumbs_preview.rb +1 -0
  92. data/previews/primer/beta/button_group_preview.rb +4 -0
  93. data/previews/primer/beta/button_preview.rb +10 -0
  94. data/previews/primer/beta/clipboard_copy_preview.rb +2 -0
  95. data/previews/primer/beta/close_button_preview.rb +1 -0
  96. data/previews/primer/beta/counter_preview.rb +11 -0
  97. data/previews/primer/beta/flash_preview.rb +8 -0
  98. data/previews/primer/beta/heading_preview.rb +1 -0
  99. data/previews/primer/beta/icon_button_preview.rb +3 -0
  100. data/previews/primer/beta/label_preview.rb +13 -0
  101. data/previews/primer/beta/link_preview.rb +11 -9
  102. data/previews/primer/beta/markdown_preview.rb +1 -0
  103. data/previews/primer/beta/octicon_preview.rb +1 -0
  104. data/previews/primer/beta/popover_preview.rb +6 -0
  105. data/previews/primer/beta/progress_bar_preview.rb +4 -0
  106. data/previews/primer/beta/spinner_preview.rb +1 -0
  107. data/previews/primer/beta/state_preview.rb +6 -0
  108. data/previews/primer/beta/subhead_preview.rb +4 -0
  109. data/previews/primer/beta/text_preview.rb +1 -0
  110. data/previews/primer/beta/timeline_item_preview.rb +1 -0
  111. data/previews/primer/beta/truncate_preview.rb +1 -0
  112. data/previews/primer/box_preview.rb +2 -0
  113. data/static/arguments.json +51 -7
  114. data/static/audited_at.json +3 -0
  115. data/static/classes.json +21 -0
  116. data/static/constants.json +20 -6
  117. data/static/info_arch.json +669 -7
  118. data/static/previews.json +571 -0
  119. data/static/statuses.json +3 -0
  120. metadata +43 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 920b620267fc4a60da9ccb72d52b22b8dcc81710639caf050de3103922bd3bbe
4
- data.tar.gz: 4c425b24ed7b1ee22514c085e5c541742e95c03f43385a34d26ac4abf839e72e
3
+ metadata.gz: 6efd473bb25628d5714fbb19659dc8b9f7dfc4278f2a19f149979d19abba17f6
4
+ data.tar.gz: 7737271c70bf2ab758f77d23fdb5aaaf4b8a2c9f57efe9968f12dc85f54a3214
5
5
  SHA512:
6
- metadata.gz: 8f6707e8593d1df4403d7cb8ddc3dfb26e2243e85d0fdbe7aa16f5489eac6543b654a1a6975bf55ab1298908ff69d067f1da59cfea84b01736e11b81c172e31d
7
- data.tar.gz: e2ab65ebe43f59e8f20e0e0ff9e9af6ef37a9010dd7bb05ba8da2dd4e0bee6a6f09e723f6f4635c7b8b325d08d42eaf2ceccb9f2a525e4882dd92a26b6a220c9
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,11 @@
1
+ declare class XBannerElement extends HTMLElement {
2
+ titleText: HTMLElement;
3
+ dismiss(): void;
4
+ private shouldReappear;
5
+ }
6
+ declare global {
7
+ interface Window {
8
+ XBannerElement: typeof XBannerElement;
9
+ }
10
+ }
11
+ 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';
@@ -0,0 +1,5 @@
1
+ export declare class ToggleSwitchInputElement extends HTMLElement {
2
+ validationElement: HTMLElement;
3
+ validationMessageElement: HTMLElement;
4
+ connectedCallback(): void;
5
+ }