primer_view_components 0.26.1 → 0.28.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 +28 -0
- data/app/assets/javascripts/app/components/primer/alpha/action_menu/action_menu_element.d.ts +0 -9
- data/app/assets/javascripts/app/components/primer/alpha/select_panel_element.d.ts +64 -0
- data/app/assets/javascripts/app/components/primer/aria_live.d.ts +8 -0
- data/app/assets/javascripts/app/components/primer/primer.d.ts +4 -0
- data/app/assets/javascripts/app/components/primer/shared_events.d.ts +9 -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_list/item.rb +5 -3
- data/app/components/primer/alpha/action_list.css +1 -1
- data/app/components/primer/alpha/action_list.css.map +1 -1
- data/app/components/primer/alpha/action_list.pcss +1 -0
- data/app/components/primer/alpha/action_list.rb +14 -2
- data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +0 -9
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +0 -11
- data/app/components/primer/alpha/action_menu.rb +17 -7
- data/app/components/primer/alpha/select_panel.html.erb +100 -0
- data/app/components/primer/alpha/select_panel.rb +473 -0
- data/app/components/primer/alpha/select_panel_element.d.ts +64 -0
- data/app/components/primer/alpha/select_panel_element.js +924 -0
- data/app/components/primer/alpha/select_panel_element.ts +1045 -0
- data/app/components/primer/alpha/text_field.css +1 -1
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/aria_live.d.ts +8 -0
- data/app/components/primer/aria_live.js +38 -0
- data/app/components/primer/aria_live.ts +41 -0
- data/app/components/primer/base_component.rb +1 -1
- data/app/components/primer/focus_group.js +1 -1
- data/app/components/primer/focus_group.ts +1 -1
- data/app/components/primer/primer.d.ts +4 -0
- data/app/components/primer/primer.js +4 -0
- data/app/components/primer/primer.ts +4 -0
- data/app/components/primer/shared_events.d.ts +9 -0
- data/app/components/primer/shared_events.js +1 -0
- data/app/components/primer/shared_events.ts +10 -0
- data/app/forms/example_toggle_switch_form/example_field_caption.html.erb +1 -1
- data/lib/primer/classify/utilities.rb +13 -13
- data/lib/primer/forms/toggle_switch.html.erb +1 -2
- data/lib/primer/static/generate_info_arch.rb +3 -2
- data/lib/primer/view_components/version.rb +2 -2
- data/lib/primer/yard/component_manifest.rb +2 -0
- data/previews/primer/alpha/action_list_preview.rb +19 -0
- data/previews/primer/alpha/action_menu_preview.rb +1 -1
- data/previews/primer/alpha/select_panel_preview/_interaction_subject_js.html.erb +25 -0
- data/previews/primer/alpha/select_panel_preview/eventually_local_fetch.html.erb +16 -0
- data/previews/primer/alpha/select_panel_preview/eventually_local_fetch_initial_failure.html.erb +12 -0
- data/previews/primer/alpha/select_panel_preview/eventually_local_fetch_no_results.html.erb +16 -0
- data/previews/primer/alpha/select_panel_preview/footer_buttons.html.erb +23 -0
- data/previews/primer/alpha/select_panel_preview/local_fetch.html.erb +19 -0
- data/previews/primer/alpha/select_panel_preview/local_fetch_no_results.html.erb +15 -0
- data/previews/primer/alpha/select_panel_preview/multiselect.html.erb +17 -0
- data/previews/primer/alpha/select_panel_preview/multiselect_form.html.erb +31 -0
- data/previews/primer/alpha/select_panel_preview/playground.html.erb +19 -0
- data/previews/primer/alpha/select_panel_preview/remote_fetch.html.erb +16 -0
- data/previews/primer/alpha/select_panel_preview/remote_fetch_filter_failure.html.erb +13 -0
- data/previews/primer/alpha/select_panel_preview/remote_fetch_initial_failure.html.erb +12 -0
- data/previews/primer/alpha/select_panel_preview/remote_fetch_no_results.html.erb +16 -0
- data/previews/primer/alpha/select_panel_preview/single_select.html.erb +20 -0
- data/previews/primer/alpha/select_panel_preview/single_select_form.html.erb +33 -0
- data/previews/primer/alpha/select_panel_preview/with_avatar_items.html.erb +19 -0
- data/previews/primer/alpha/select_panel_preview/with_dynamic_label.html.erb +23 -0
- data/previews/primer/alpha/select_panel_preview/with_dynamic_label_and_aria_prefix.html.erb +24 -0
- data/previews/primer/alpha/select_panel_preview/with_leading_icons.html.erb +31 -0
- data/previews/primer/alpha/select_panel_preview/with_subtitle.html.erb +25 -0
- data/previews/primer/alpha/select_panel_preview/with_trailing_icons.html.erb +19 -0
- data/previews/primer/alpha/select_panel_preview.rb +239 -0
- data/static/arguments.json +136 -0
- data/static/audited_at.json +1 -0
- data/static/constants.json +22 -0
- data/static/info_arch.json +936 -117
- data/static/previews.json +307 -0
- data/static/statuses.json +1 -0
- metadata +39 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47a02470c4fe098b7baa2f71f3f8fc598893619c0d56956eb3dadf1f91e3a2ea
|
4
|
+
data.tar.gz: c2ae88ba493e0338ba35cf7a7b6b8649a6bf75d9d43ba93367616d45bfd6fed7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27f39a2d347dc2fe6014c3f0009a48576751731fb9e31d7f4bd63b61add42b8bad10905ef1d4bc251607fe545f89db817cdb9352ce73a335319064c842f1854d
|
7
|
+
data.tar.gz: db1c076f178206af17404ca90e8e3b02fcc2fb87619742ebe0c927cfd52e24f732cf340716e45084857ecab3e93261f553b4252d88c8f5c201d80f38f268b20e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,33 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.28.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- [#2941](https://github.com/primer/view_components/pull/2941) [`f3b640e`](https://github.com/primer/view_components/commit/f3b640e3ce13979aa187c4fa6ff4e31f5717d720) Thanks [@camertron](https://github.com/camertron)! - Upstream the SelectPanel component from dotcom
|
8
|
+
|
9
|
+
### Patch Changes
|
10
|
+
|
11
|
+
- [#2954](https://github.com/primer/view_components/pull/2954) [`15fb8c4`](https://github.com/primer/view_components/commit/15fb8c4e214142a6bc09a98b7fc70a5f917e68f9) Thanks [@camertron](https://github.com/camertron)! - Small SelectPanel fixes; lots of SelectPanel tests.
|
12
|
+
|
13
|
+
- [#2951](https://github.com/primer/view_components/pull/2951) [`ac15e65`](https://github.com/primer/view_components/commit/ac15e654ae185541ab7924c98bef67c6917f4d21) Thanks [@HDinger](https://github.com/HDinger)! - Always align group headers of a `Primer::Alpha::ActionMenu` at the beginning of the line
|
14
|
+
|
15
|
+
- [#2952](https://github.com/primer/view_components/pull/2952) [`98900f3`](https://github.com/primer/view_components/commit/98900f3a8afb9fe45cfb4a850c7be13d1061feba) Thanks [@camertron](https://github.com/camertron)! - Fix wrapping behavior of toggle switch label
|
16
|
+
|
17
|
+
- [#2961](https://github.com/primer/view_components/pull/2961) [`b662625`](https://github.com/primer/view_components/commit/b662625bab5e48102c0fad8fff4e2eb0523c1fad) Thanks [@camertron](https://github.com/camertron)! - Ensure condition is checked when mutations occur in SelectPanelElement.
|
18
|
+
|
19
|
+
## 0.27.0
|
20
|
+
|
21
|
+
### Minor Changes
|
22
|
+
|
23
|
+
- [#2922](https://github.com/primer/view_components/pull/2922) [`fb5917d`](https://github.com/primer/view_components/commit/fb5917dc9e6246af85a8199e6e47f73e2db3ba70) Thanks [@camertron](https://github.com/camertron)! - Change ActionMenu to accept and forward overlay arguments
|
24
|
+
|
25
|
+
### Patch Changes
|
26
|
+
|
27
|
+
- [#2925](https://github.com/primer/view_components/pull/2925) [`6c730c4`](https://github.com/primer/view_components/commit/6c730c4b8eeb050cf706d4843a87f2740e379a49) Thanks [@kendallgassner](https://github.com/kendallgassner)! - Update ActionList such that if role='listbox' is passed in the items render as options
|
28
|
+
|
29
|
+
- [#2924](https://github.com/primer/view_components/pull/2924) [`235544d`](https://github.com/primer/view_components/commit/235544d3f0770717c16532e6f0801d6249f6a884) Thanks [@kendallgassner](https://github.com/kendallgassner)! - Add a valid selector to focus-group
|
30
|
+
|
3
31
|
## 0.26.1
|
4
32
|
|
5
33
|
### Patch Changes
|
data/app/assets/javascripts/app/components/primer/alpha/action_menu/action_menu_element.d.ts
CHANGED
@@ -6,15 +6,6 @@ type SelectedItem = {
|
|
6
6
|
value: string | null | undefined;
|
7
7
|
element: Element;
|
8
8
|
};
|
9
|
-
export type ItemActivatedEvent = {
|
10
|
-
item: Element;
|
11
|
-
checked: boolean;
|
12
|
-
};
|
13
|
-
declare global {
|
14
|
-
interface HTMLElementEventMap {
|
15
|
-
itemActivated: CustomEvent<ItemActivatedEvent>;
|
16
|
-
}
|
17
|
-
}
|
18
9
|
export declare class ActionMenuElement extends HTMLElement {
|
19
10
|
#private;
|
20
11
|
includeFragment: IncludeFragmentElement;
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import { IncludeFragmentElement } from '@github/include-fragment-element';
|
2
|
+
import type { AnchorAlignment, AnchorSide } from '@primer/behaviors';
|
3
|
+
import '@oddbird/popover-polyfill';
|
4
|
+
type SelectVariant = 'none' | 'single' | 'multiple' | null;
|
5
|
+
type SelectedItem = {
|
6
|
+
label: string | null | undefined;
|
7
|
+
value: string | null | undefined;
|
8
|
+
inputName: string | null | undefined;
|
9
|
+
element: SelectPanelItem;
|
10
|
+
};
|
11
|
+
export type SelectPanelItem = HTMLLIElement;
|
12
|
+
export type FilterFn = (item: SelectPanelItem, query: string) => boolean;
|
13
|
+
export declare class SelectPanelElement extends HTMLElement {
|
14
|
+
#private;
|
15
|
+
includeFragment: IncludeFragmentElement;
|
16
|
+
dialog: HTMLDialogElement;
|
17
|
+
filterInputTextField: HTMLInputElement;
|
18
|
+
remoteInput: HTMLElement;
|
19
|
+
list: HTMLElement;
|
20
|
+
ariaLiveContainer: HTMLElement;
|
21
|
+
noResults: HTMLElement;
|
22
|
+
fragmentErrorElement: HTMLElement;
|
23
|
+
bannerErrorElement: HTMLElement;
|
24
|
+
bodySpinner: HTMLElement;
|
25
|
+
filterFn?: FilterFn;
|
26
|
+
get open(): boolean;
|
27
|
+
get selectVariant(): SelectVariant;
|
28
|
+
get ariaSelectionType(): string;
|
29
|
+
set selectVariant(variant: SelectVariant);
|
30
|
+
get dynamicLabelPrefix(): string;
|
31
|
+
get dynamicAriaLabelPrefix(): string;
|
32
|
+
set dynamicLabelPrefix(value: string);
|
33
|
+
get dynamicLabel(): boolean;
|
34
|
+
set dynamicLabel(value: boolean);
|
35
|
+
get invokerElement(): HTMLButtonElement | null;
|
36
|
+
get closeButton(): HTMLButtonElement | null;
|
37
|
+
get invokerLabel(): HTMLElement | null;
|
38
|
+
get selectedItems(): SelectedItem[];
|
39
|
+
get align(): AnchorAlignment;
|
40
|
+
get side(): AnchorSide;
|
41
|
+
updateAnchorPosition(): void;
|
42
|
+
connectedCallback(): void;
|
43
|
+
disconnectedCallback(): void;
|
44
|
+
handleEvent(event: Event): void;
|
45
|
+
show(): void;
|
46
|
+
hide(): void;
|
47
|
+
get visibleItems(): SelectPanelItem[];
|
48
|
+
get items(): SelectPanelItem[];
|
49
|
+
get focusableItem(): HTMLElement | undefined;
|
50
|
+
getItemById(itemId: string): SelectPanelItem | null;
|
51
|
+
isItemDisabled(item: SelectPanelItem | null): boolean;
|
52
|
+
disableItem(item: SelectPanelItem | null): void;
|
53
|
+
enableItem(item: SelectPanelItem | null): void;
|
54
|
+
isItemHidden(item: SelectPanelItem | null): boolean;
|
55
|
+
isItemChecked(item: SelectPanelItem | null): boolean;
|
56
|
+
checkItem(item: SelectPanelItem | null): void;
|
57
|
+
uncheckItem(item: SelectPanelItem | null): void;
|
58
|
+
}
|
59
|
+
declare global {
|
60
|
+
interface Window {
|
61
|
+
SelectPanelElement: typeof SelectPanelElement;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
export {};
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import '@github/include-fragment-element';
|
2
|
+
import '@github/remote-input-element';
|
2
3
|
import './alpha/action_list';
|
3
4
|
import './alpha/action_bar_element';
|
4
5
|
import './alpha/dropdown';
|
@@ -6,6 +7,8 @@ import './anchored_position';
|
|
6
7
|
import './dialog_helper';
|
7
8
|
import './focus_group';
|
8
9
|
import './scrollable_region';
|
10
|
+
import './aria_live';
|
11
|
+
import './shared_events';
|
9
12
|
import './alpha/image_crop';
|
10
13
|
import './alpha/modal_dialog';
|
11
14
|
import './beta/nav_list';
|
@@ -22,3 +25,4 @@ import '../../../lib/primer/forms/primer_multi_input';
|
|
22
25
|
import '../../../lib/primer/forms/primer_text_field';
|
23
26
|
import '../../../lib/primer/forms/toggle_switch_input';
|
24
27
|
import './alpha/action_menu/action_menu_element';
|
28
|
+
import './alpha/select_panel_element';
|