@mixtint/primer-view-components 0.72.0
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/LICENSE.txt +21 -0
- package/README.md +30 -0
- package/app/assets/images/loading_indicator.svg +1 -0
- package/app/assets/javascripts/components/primer/alpha/action_bar_element.d.ts +17 -0
- package/app/assets/javascripts/components/primer/alpha/action_list.d.ts +16 -0
- package/app/assets/javascripts/components/primer/alpha/action_menu/action_menu_element.d.ts +49 -0
- package/app/assets/javascripts/components/primer/alpha/action_menu/action_menu_focus_zone_stack.d.ts +17 -0
- package/app/assets/javascripts/components/primer/alpha/dropdown/menu.d.ts +1 -0
- package/app/assets/javascripts/components/primer/alpha/dropdown.d.ts +1 -0
- package/app/assets/javascripts/components/primer/alpha/modal_dialog.d.ts +18 -0
- package/app/assets/javascripts/components/primer/alpha/segmented_control.d.ts +12 -0
- package/app/assets/javascripts/components/primer/alpha/select_panel_element.d.ts +65 -0
- package/app/assets/javascripts/components/primer/alpha/tab_container.d.ts +1 -0
- package/app/assets/javascripts/components/primer/alpha/toggle_switch.d.ts +34 -0
- package/app/assets/javascripts/components/primer/alpha/tool_tip.d.ts +27 -0
- package/app/assets/javascripts/components/primer/alpha/tree_view/tree_view.d.ts +42 -0
- package/app/assets/javascripts/components/primer/alpha/tree_view/tree_view_icon_pair_element.d.ts +15 -0
- package/app/assets/javascripts/components/primer/alpha/tree_view/tree_view_include_fragment_element.d.ts +9 -0
- package/app/assets/javascripts/components/primer/alpha/tree_view/tree_view_roving_tab_index.d.ts +3 -0
- package/app/assets/javascripts/components/primer/alpha/tree_view/tree_view_sub_tree_node_element.d.ts +45 -0
- package/app/assets/javascripts/components/primer/alpha/x_banner.d.ts +18 -0
- package/app/assets/javascripts/components/primer/anchored_position.d.ts +27 -0
- package/app/assets/javascripts/components/primer/beta/auto_complete/auto_complete.d.ts +1 -0
- package/app/assets/javascripts/components/primer/beta/clipboard_copy.d.ts +1 -0
- package/app/assets/javascripts/components/primer/beta/details_toggle_element.d.ts +40 -0
- package/app/assets/javascripts/components/primer/beta/nav_list.d.ts +20 -0
- package/app/assets/javascripts/components/primer/beta/nav_list_group_element.d.ts +19 -0
- package/app/assets/javascripts/components/primer/beta/relative_time.d.ts +1 -0
- package/app/assets/javascripts/components/primer/dialog_helper.d.ts +15 -0
- package/app/assets/javascripts/components/primer/focus_group.d.ts +19 -0
- package/app/assets/javascripts/components/primer/open_project/border_box/collapsible_header.d.ts +11 -0
- package/app/assets/javascripts/components/primer/open_project/collapsible.d.ts +13 -0
- package/app/assets/javascripts/components/primer/open_project/collapsible_section.d.ts +10 -0
- package/app/assets/javascripts/components/primer/open_project/danger_dialog_form_helper.d.ts +14 -0
- package/app/assets/javascripts/components/primer/open_project/filterable_tree_view.d.ts +29 -0
- package/app/assets/javascripts/components/primer/open_project/page_header_element.d.ts +9 -0
- package/app/assets/javascripts/components/primer/open_project/sub_header_element.d.ts +17 -0
- package/app/assets/javascripts/components/primer/open_project/zen_mode_button.d.ts +18 -0
- package/app/assets/javascripts/components/primer/primer.d.ts +40 -0
- package/app/assets/javascripts/components/primer/scrollable_region.d.ts +13 -0
- package/app/assets/javascripts/components/primer/shared_events.d.ts +26 -0
- package/app/assets/javascripts/components/primer/utils.d.ts +1 -0
- package/app/assets/javascripts/lib/primer/forms/primer_multi_input.d.ts +10 -0
- package/app/assets/javascripts/lib/primer/forms/primer_text_field.d.ts +28 -0
- package/app/assets/javascripts/lib/primer/forms/toggle_switch_input.d.ts +5 -0
- package/app/assets/javascripts/primer_view_components.js +2 -0
- package/app/assets/javascripts/primer_view_components.js.map +1 -0
- package/app/assets/styles/primer_view_components.css +7336 -0
- package/app/assets/styles/primer_view_components.css.map +1 -0
- package/app/components/primer/alpha/action_bar.css +49 -0
- package/app/components/primer/alpha/action_bar.css.json +14 -0
- package/app/components/primer/alpha/action_bar_element.d.ts +17 -0
- package/app/components/primer/alpha/action_bar_element.js +170 -0
- package/app/components/primer/alpha/action_list.css +526 -0
- package/app/components/primer/alpha/action_list.css.json +117 -0
- package/app/components/primer/alpha/action_list.d.ts +16 -0
- package/app/components/primer/alpha/action_list.js +70 -0
- package/app/components/primer/alpha/action_menu/action_menu_element.d.ts +49 -0
- package/app/components/primer/alpha/action_menu/action_menu_element.js +591 -0
- package/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.d.ts +17 -0
- package/app/components/primer/alpha/action_menu/action_menu_focus_zone_stack.js +62 -0
- package/app/components/primer/alpha/auto_complete.css +131 -0
- package/app/components/primer/alpha/auto_complete.css.json +21 -0
- package/app/components/primer/alpha/banner.css +146 -0
- package/app/components/primer/alpha/banner.css.json +26 -0
- package/app/components/primer/alpha/button_marketing.css +183 -0
- package/app/components/primer/alpha/button_marketing.css.json +30 -0
- package/app/components/primer/alpha/dialog.css +377 -0
- package/app/components/primer/alpha/dialog.css.json +66 -0
- package/app/components/primer/alpha/dropdown/menu.d.ts +1 -0
- package/app/components/primer/alpha/dropdown/menu.js +1 -0
- package/app/components/primer/alpha/dropdown.css +296 -0
- package/app/components/primer/alpha/dropdown.css.json +40 -0
- package/app/components/primer/alpha/dropdown.d.ts +1 -0
- package/app/components/primer/alpha/dropdown.js +1 -0
- package/app/components/primer/alpha/layout.css +374 -0
- package/app/components/primer/alpha/layout.css.json +74 -0
- package/app/components/primer/alpha/menu.css +124 -0
- package/app/components/primer/alpha/menu.css.json +26 -0
- package/app/components/primer/alpha/modal_dialog.d.ts +18 -0
- package/app/components/primer/alpha/modal_dialog.js +187 -0
- package/app/components/primer/alpha/overlay.css +25 -0
- package/app/components/primer/alpha/overlay.css.json +12 -0
- package/app/components/primer/alpha/segmented_control.css +161 -0
- package/app/components/primer/alpha/segmented_control.css.json +31 -0
- package/app/components/primer/alpha/segmented_control.d.ts +12 -0
- package/app/components/primer/alpha/segmented_control.js +59 -0
- package/app/components/primer/alpha/select_panel.css +10 -0
- package/app/components/primer/alpha/select_panel.css.json +7 -0
- package/app/components/primer/alpha/select_panel_element.d.ts +65 -0
- package/app/components/primer/alpha/select_panel_element.js +988 -0
- package/app/components/primer/alpha/skeleton_box.css +36 -0
- package/app/components/primer/alpha/skeleton_box.css.json +6 -0
- package/app/components/primer/alpha/stack.css +266 -0
- package/app/components/primer/alpha/stack.css.json +94 -0
- package/app/components/primer/alpha/stack_item.css +27 -0
- package/app/components/primer/alpha/stack_item.css.json +12 -0
- package/app/components/primer/alpha/tab_container.d.ts +1 -0
- package/app/components/primer/alpha/tab_container.js +1 -0
- package/app/components/primer/alpha/tab_nav.css +112 -0
- package/app/components/primer/alpha/tab_nav.css.json +22 -0
- package/app/components/primer/alpha/text_field.css +838 -0
- package/app/components/primer/alpha/text_field.css.json +134 -0
- package/app/components/primer/alpha/toggle_switch.css +230 -0
- package/app/components/primer/alpha/toggle_switch.css.json +40 -0
- package/app/components/primer/alpha/toggle_switch.d.ts +34 -0
- package/app/components/primer/alpha/toggle_switch.js +179 -0
- package/app/components/primer/alpha/tool_tip.d.ts +27 -0
- package/app/components/primer/alpha/tool_tip.js +443 -0
- package/app/components/primer/alpha/tree_view/tree_view.d.ts +42 -0
- package/app/components/primer/alpha/tree_view/tree_view.js +391 -0
- package/app/components/primer/alpha/tree_view/tree_view_icon_pair_element.d.ts +15 -0
- package/app/components/primer/alpha/tree_view/tree_view_icon_pair_element.js +62 -0
- package/app/components/primer/alpha/tree_view/tree_view_include_fragment_element.d.ts +9 -0
- package/app/components/primer/alpha/tree_view/tree_view_include_fragment_element.js +28 -0
- package/app/components/primer/alpha/tree_view/tree_view_roving_tab_index.d.ts +3 -0
- package/app/components/primer/alpha/tree_view/tree_view_roving_tab_index.js +130 -0
- package/app/components/primer/alpha/tree_view/tree_view_sub_tree_node_element.d.ts +45 -0
- package/app/components/primer/alpha/tree_view/tree_view_sub_tree_node_element.js +429 -0
- package/app/components/primer/alpha/tree_view.css +396 -0
- package/app/components/primer/alpha/tree_view.css.json +52 -0
- package/app/components/primer/alpha/underline_nav.css +150 -0
- package/app/components/primer/alpha/underline_nav.css.json +26 -0
- package/app/components/primer/alpha/x_banner.d.ts +18 -0
- package/app/components/primer/alpha/x_banner.js +51 -0
- package/app/components/primer/anchored_position.d.ts +27 -0
- package/app/components/primer/anchored_position.js +159 -0
- package/app/components/primer/beta/auto_complete/auto_complete.d.ts +1 -0
- package/app/components/primer/beta/auto_complete/auto_complete.js +1 -0
- package/app/components/primer/beta/avatar.css +77 -0
- package/app/components/primer/beta/avatar.css.json +17 -0
- package/app/components/primer/beta/avatar_stack.css +145 -0
- package/app/components/primer/beta/avatar_stack.css.json +28 -0
- package/app/components/primer/beta/blankslate.css +168 -0
- package/app/components/primer/beta/blankslate.css.json +23 -0
- package/app/components/primer/beta/border_box.css +218 -0
- package/app/components/primer/beta/border_box.css.json +54 -0
- package/app/components/primer/beta/breadcrumbs.css +29 -0
- package/app/components/primer/beta/breadcrumbs.css.json +9 -0
- package/app/components/primer/beta/button.css +359 -0
- package/app/components/primer/beta/button.css.json +86 -0
- package/app/components/primer/beta/button_group.css +20 -0
- package/app/components/primer/beta/button_group.css.json +12 -0
- package/app/components/primer/beta/clipboard_copy.d.ts +1 -0
- package/app/components/primer/beta/clipboard_copy.js +58 -0
- package/app/components/primer/beta/counter.css +38 -0
- package/app/components/primer/beta/counter.css.json +10 -0
- package/app/components/primer/beta/details_toggle_element.d.ts +40 -0
- package/app/components/primer/beta/details_toggle_element.js +65 -0
- package/app/components/primer/beta/flash.css +152 -0
- package/app/components/primer/beta/flash.css.json +27 -0
- package/app/components/primer/beta/label.css +109 -0
- package/app/components/primer/beta/label.css.json +24 -0
- package/app/components/primer/beta/link.css +79 -0
- package/app/components/primer/beta/link.css.json +19 -0
- package/app/components/primer/beta/nav_list.d.ts +20 -0
- package/app/components/primer/beta/nav_list.js +192 -0
- package/app/components/primer/beta/nav_list_group_element.d.ts +19 -0
- package/app/components/primer/beta/nav_list_group_element.js +111 -0
- package/app/components/primer/beta/popover.css +215 -0
- package/app/components/primer/beta/popover.css.json +33 -0
- package/app/components/primer/beta/progress_bar.css +27 -0
- package/app/components/primer/beta/progress_bar.css.json +10 -0
- package/app/components/primer/beta/relative_time.d.ts +1 -0
- package/app/components/primer/beta/relative_time.js +1 -0
- package/app/components/primer/beta/state.css +59 -0
- package/app/components/primer/beta/state.css.json +13 -0
- package/app/components/primer/beta/subhead.css +64 -0
- package/app/components/primer/beta/subhead.css.json +14 -0
- package/app/components/primer/beta/timeline_item.css +106 -0
- package/app/components/primer/beta/timeline_item.css.json +16 -0
- package/app/components/primer/beta/truncate.css +30 -0
- package/app/components/primer/beta/truncate.css.json +12 -0
- package/app/components/primer/dialog_helper.d.ts +15 -0
- package/app/components/primer/dialog_helper.js +132 -0
- package/app/components/primer/focus_group.d.ts +19 -0
- package/app/components/primer/focus_group.js +163 -0
- package/app/components/primer/open_project/border_box/collapsible_header.css +21 -0
- package/app/components/primer/open_project/border_box/collapsible_header.css.json +11 -0
- package/app/components/primer/open_project/border_box/collapsible_header.d.ts +11 -0
- package/app/components/primer/open_project/border_box/collapsible_header.js +21 -0
- package/app/components/primer/open_project/border_grid.css +35 -0
- package/app/components/primer/open_project/border_grid.css.json +11 -0
- package/app/components/primer/open_project/collapsible.d.ts +13 -0
- package/app/components/primer/open_project/collapsible.js +67 -0
- package/app/components/primer/open_project/collapsible_section.css +5 -0
- package/app/components/primer/open_project/collapsible_section.css.json +6 -0
- package/app/components/primer/open_project/collapsible_section.d.ts +10 -0
- package/app/components/primer/open_project/collapsible_section.js +16 -0
- package/app/components/primer/open_project/danger_dialog_form_helper.d.ts +14 -0
- package/app/components/primer/open_project/danger_dialog_form_helper.js +54 -0
- package/app/components/primer/open_project/drag_handle.css +6 -0
- package/app/components/primer/open_project/drag_handle.css.json +6 -0
- package/app/components/primer/open_project/filterable_tree_view.d.ts +29 -0
- package/app/components/primer/open_project/filterable_tree_view.js +409 -0
- package/app/components/primer/open_project/input_group.css +22 -0
- package/app/components/primer/open_project/input_group.css.json +12 -0
- package/app/components/primer/open_project/page_header.css +87 -0
- package/app/components/primer/open_project/page_header.css.json +20 -0
- package/app/components/primer/open_project/page_header_element.d.ts +9 -0
- package/app/components/primer/open_project/page_header_element.js +23 -0
- package/app/components/primer/open_project/side_panel/section.css +27 -0
- package/app/components/primer/open_project/side_panel/section.css.json +11 -0
- package/app/components/primer/open_project/sub_header.css +80 -0
- package/app/components/primer/open_project/sub_header.css.json +17 -0
- package/app/components/primer/open_project/sub_header_element.d.ts +17 -0
- package/app/components/primer/open_project/sub_header_element.js +76 -0
- package/app/components/primer/open_project/zen_mode_button.d.ts +18 -0
- package/app/components/primer/open_project/zen_mode_button.js +64 -0
- package/app/components/primer/primer.d.ts +40 -0
- package/app/components/primer/primer.js +40 -0
- package/app/components/primer/scrollable_region.d.ts +13 -0
- package/app/components/primer/scrollable_region.js +52 -0
- package/app/components/primer/shared_events.d.ts +26 -0
- package/app/components/primer/shared_events.js +1 -0
- package/app/components/primer/truncate.css +23 -0
- package/app/components/primer/truncate.css.json +13 -0
- package/app/components/primer/utils.d.ts +1 -0
- package/app/components/primer/utils.js +16 -0
- package/app/lib/primer/forms/primer_multi_input.d.ts +10 -0
- package/app/lib/primer/forms/primer_multi_input.js +44 -0
- package/app/lib/primer/forms/primer_text_field.d.ts +28 -0
- package/app/lib/primer/forms/primer_text_field.js +119 -0
- package/app/lib/primer/forms/toggle_switch_input.d.ts +5 -0
- package/app/lib/primer/forms/toggle_switch_input.js +34 -0
- package/package.json +103 -0
- package/static/arguments.json +6472 -0
- package/static/audited_at.json +173 -0
- package/static/classes.json +781 -0
- package/static/constants.json +1972 -0
- package/static/form_previews.json +118 -0
- package/static/info_arch.json +21331 -0
- package/static/previews.json +9436 -0
- package/static/statuses.json +173 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* Progress */
|
|
2
|
+
|
|
3
|
+
.Progress {
|
|
4
|
+
display: flex;
|
|
5
|
+
height: 8px;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
background-color: var(--progressBar-track-bgColor);
|
|
8
|
+
border-radius: var(--borderRadius-medium);
|
|
9
|
+
outline: solid 1px var(--progressBar-track-borderColor);
|
|
10
|
+
outline-offset: -1px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.Progress--large {
|
|
14
|
+
height: 10px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.Progress--small {
|
|
18
|
+
height: 5px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.Progress-item {
|
|
22
|
+
outline: 2px solid transparent; /* Support Firefox custom colors */
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.Progress-item + .Progress-item {
|
|
26
|
+
margin-left: var(--base-size-2);
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@github/relative-time-element';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@github/relative-time-element';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* State */
|
|
2
|
+
|
|
3
|
+
/* Default 32px */
|
|
4
|
+
|
|
5
|
+
.state, /* TODO: Deprecate */
|
|
6
|
+
.State {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
9
|
+
padding: var(--base-size-4) var(--control-medium-paddingInline-normal);
|
|
10
|
+
font-size: var(--text-body-size-medium);
|
|
11
|
+
font-weight: var(--base-text-weight-medium);
|
|
12
|
+
/* stylelint-disable-next-line primer/typography */
|
|
13
|
+
line-height: var(--control-medium-lineBoxHeight);
|
|
14
|
+
text-align: center;
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
/* stylelint-disable-next-line primer/borders */
|
|
17
|
+
border-radius: 2em;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.state, /* TODO: Deprecate */
|
|
21
|
+
.State,
|
|
22
|
+
.State--draft {
|
|
23
|
+
color: var(--fgColor-onEmphasis);
|
|
24
|
+
background-color: var(--bgColor-neutral-emphasis);
|
|
25
|
+
border: var(--borderWidth-thin) solid transparent;
|
|
26
|
+
box-shadow: var(--boxShadow-thin) var(--borderColor-neutral-emphasis);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.State--open {
|
|
30
|
+
color: var(--fgColor-onEmphasis);
|
|
31
|
+
background-color: var(--bgColor-open-emphasis, var(--color-open-emphasis));
|
|
32
|
+
box-shadow: var(--boxShadow-thin) var(--borderColor-open-emphasis);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.State--merged {
|
|
36
|
+
color: var(--fgColor-onEmphasis);
|
|
37
|
+
background-color: var(--bgColor-done-emphasis, var(--color-done-emphasis));
|
|
38
|
+
box-shadow: var(--boxShadow-thin) var(--borderColor-done-emphasis);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.State--closed {
|
|
42
|
+
color: var(--fgColor-onEmphasis);
|
|
43
|
+
background-color: var(--bgColor-closed-emphasis, var(--color-closed-emphasis));
|
|
44
|
+
box-shadow: var(--boxShadow-thin) var(--borderColor-closed-emphasis);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Small 24px */
|
|
48
|
+
|
|
49
|
+
.State--small {
|
|
50
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
51
|
+
padding: 0 10px;
|
|
52
|
+
font-size: var(--text-body-size-small);
|
|
53
|
+
/* stylelint-disable-next-line primer/typography */
|
|
54
|
+
line-height: var(--base-size-24);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.State--small .octicon {
|
|
58
|
+
width: 1em; /* Ensures different icons don't change State indicator width */
|
|
59
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* Subhead */
|
|
2
|
+
|
|
3
|
+
.Subhead {
|
|
4
|
+
display: flex;
|
|
5
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
6
|
+
padding-bottom: var(--stack-padding-condensed);
|
|
7
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
8
|
+
margin-bottom: var(--stack-gap-normal);
|
|
9
|
+
border-bottom: var(--borderWidth-thin) solid var(--borderColor-muted);
|
|
10
|
+
flex-flow: row wrap;
|
|
11
|
+
justify-content: flex-end; /* Keep actions right aligned. */
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* Modifier class to give a lot of breathing room between sections of content. */
|
|
15
|
+
|
|
16
|
+
.Subhead--spacious {
|
|
17
|
+
margin-top: var(--base-size-40);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* <h2> sized heading with normal font weight */
|
|
21
|
+
|
|
22
|
+
.Subhead-heading {
|
|
23
|
+
font-weight: var(--base-text-weight-normal);
|
|
24
|
+
flex: 1 1 auto;
|
|
25
|
+
order: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.Subhead-heading--large {
|
|
29
|
+
/* stylelint-disable-next-line primer/typography */
|
|
30
|
+
font-size: var(--base-size-24);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.Subhead-heading--medium {
|
|
34
|
+
font-size: var(--text-title-size-medium);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Make the text bold and red for dangerous content */
|
|
38
|
+
|
|
39
|
+
.Subhead-heading--danger {
|
|
40
|
+
font-weight: var(--base-text-weight-semibold);
|
|
41
|
+
color: var(--fgColor-danger);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* One-liner of supporting text */
|
|
45
|
+
|
|
46
|
+
.Subhead-description {
|
|
47
|
+
font-size: var(--text-body-size-medium);
|
|
48
|
+
color: var(--fgColor-muted);
|
|
49
|
+
flex: 1 100%;
|
|
50
|
+
order: 2;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Add 1 or 2 buttons to the right of the heading */
|
|
54
|
+
|
|
55
|
+
.Subhead-actions {
|
|
56
|
+
margin: var(--base-size-4) 0 var(--base-size-4) var(--base-size-4);
|
|
57
|
+
align-self: center;
|
|
58
|
+
justify-content: flex-end;
|
|
59
|
+
order: 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.Subhead-actions + .Subhead-description {
|
|
63
|
+
margin-top: var(--base-size-4);
|
|
64
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "beta/subhead",
|
|
3
|
+
"selectors": [
|
|
4
|
+
".Subhead",
|
|
5
|
+
".Subhead--spacious",
|
|
6
|
+
".Subhead-heading",
|
|
7
|
+
".Subhead-heading--large",
|
|
8
|
+
".Subhead-heading--medium",
|
|
9
|
+
".Subhead-heading--danger",
|
|
10
|
+
".Subhead-description",
|
|
11
|
+
".Subhead-actions",
|
|
12
|
+
".Subhead-actions + .Subhead-description"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/* TimelineItem */
|
|
2
|
+
|
|
3
|
+
.TimelineItem {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: flex;
|
|
6
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
7
|
+
padding: var(--stack-padding-normal) 0;
|
|
8
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
9
|
+
margin-left: var(--stack-gap-normal);
|
|
10
|
+
|
|
11
|
+
/* The Timeline */
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.TimelineItem::before {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
display: block;
|
|
20
|
+
width: var(--borderWidth-thick);
|
|
21
|
+
content: '';
|
|
22
|
+
/* stylelint-disable-next-line primer/colors */
|
|
23
|
+
background-color: var(--borderColor-muted);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.TimelineItem:target .TimelineItem-badge {
|
|
27
|
+
border-color: var(--borderColor-accent-emphasis);
|
|
28
|
+
/* stylelint-disable-next-line primer/box-shadow */
|
|
29
|
+
box-shadow: 0 0 0.2em var(--borderColor-accent-muted);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.TimelineItem-badge {
|
|
33
|
+
position: relative;
|
|
34
|
+
z-index: 1;
|
|
35
|
+
display: flex;
|
|
36
|
+
width: var(--control-medium-size);
|
|
37
|
+
height: var(--control-medium-size);
|
|
38
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
39
|
+
margin-right: var(--controlStack-medium-gap-condensed);
|
|
40
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
41
|
+
margin-left: calc(var(--control-medium-size) / -2 + 1px);
|
|
42
|
+
color: var(--fgColor-muted);
|
|
43
|
+
align-items: center;
|
|
44
|
+
background-color: var(--timelineBadge-bgColor);
|
|
45
|
+
/* stylelint-disable-next-line primer/colors */
|
|
46
|
+
border: var(--borderWidth-thick) solid var(--bgColor-default);
|
|
47
|
+
border-radius: 50%;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.TimelineItem-badge--success {
|
|
53
|
+
color: var(--fgColor-onEmphasis);
|
|
54
|
+
background-color: var(--bgColor-success-emphasis);
|
|
55
|
+
border: var(--borderWidth-thin) solid transparent;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.TimelineItem-body {
|
|
59
|
+
min-width: 0;
|
|
60
|
+
max-width: 100%;
|
|
61
|
+
margin-top: var(--base-size-4);
|
|
62
|
+
color: var(--fgColor-muted);
|
|
63
|
+
flex: auto;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.TimelineItem-avatar {
|
|
67
|
+
position: absolute;
|
|
68
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
69
|
+
left: -72px;
|
|
70
|
+
z-index: 1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.TimelineItem-break {
|
|
74
|
+
position: relative;
|
|
75
|
+
z-index: 1;
|
|
76
|
+
height: var(--stack-gap-spacious);
|
|
77
|
+
margin: 0;
|
|
78
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
79
|
+
margin-bottom: calc(var(--stack-gap-normal) * -1);
|
|
80
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
81
|
+
margin-left: -56px;
|
|
82
|
+
background-color: var(--bgColor-default);
|
|
83
|
+
border: 0;
|
|
84
|
+
border-top: var(--borderWidth-thicker) solid var(--borderColor-default);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.TimelineItem--condensed {
|
|
88
|
+
padding-top: var(--base-size-4);
|
|
89
|
+
padding-bottom: 0;
|
|
90
|
+
|
|
91
|
+
/* TimelineItem--condensed is often grouped. (commits) */
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.TimelineItem--condensed:last-child {
|
|
95
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
96
|
+
padding-bottom: var(--stack-gap-normal);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.TimelineItem--condensed .TimelineItem-badge {
|
|
100
|
+
height: var(--base-size-16);
|
|
101
|
+
margin-top: var(--base-size-8);
|
|
102
|
+
margin-bottom: var(--base-size-8);
|
|
103
|
+
color: var(--fgColor-muted);
|
|
104
|
+
background-color: var(--bgColor-default);
|
|
105
|
+
border: 0;
|
|
106
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "beta/timeline_item",
|
|
3
|
+
"selectors": [
|
|
4
|
+
".TimelineItem",
|
|
5
|
+
".TimelineItem::before",
|
|
6
|
+
".TimelineItem:target .TimelineItem-badge",
|
|
7
|
+
".TimelineItem-badge",
|
|
8
|
+
".TimelineItem-badge--success",
|
|
9
|
+
".TimelineItem-body",
|
|
10
|
+
".TimelineItem-avatar",
|
|
11
|
+
".TimelineItem-break",
|
|
12
|
+
".TimelineItem--condensed",
|
|
13
|
+
".TimelineItem--condensed:last-child",
|
|
14
|
+
".TimelineItem--condensed .TimelineItem-badge"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* Truncate */
|
|
2
|
+
|
|
3
|
+
.Truncate {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
min-width: 0;
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.Truncate > .Truncate-text {
|
|
10
|
+
min-width: 1ch;
|
|
11
|
+
max-width: fit-content;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
text-overflow: ellipsis;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:is(.Truncate > .Truncate-text) + .Truncate-text {
|
|
18
|
+
/* stylelint-disable-next-line primer/spacing */
|
|
19
|
+
margin-left: var(--control-small-gap);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.Truncate-text--primary:is(.Truncate > .Truncate-text) {
|
|
23
|
+
flex-basis: 200%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.Truncate-text--expandable:is(.Truncate > .Truncate-text):hover,.Truncate-text--expandable:is(.Truncate > .Truncate-text):focus,.Truncate-text--expandable:is(.Truncate > .Truncate-text):active {
|
|
27
|
+
max-width: 100% !important;
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "beta/truncate",
|
|
3
|
+
"selectors": [
|
|
4
|
+
".Truncate",
|
|
5
|
+
".Truncate > .Truncate-text",
|
|
6
|
+
":is(.Truncate > .Truncate-text) + .Truncate-text",
|
|
7
|
+
".Truncate-text--primary:is(.Truncate > .Truncate-text)",
|
|
8
|
+
".Truncate-text--expandable:is(.Truncate > .Truncate-text):hover",
|
|
9
|
+
".Truncate-text--expandable:is(.Truncate > .Truncate-text):focus",
|
|
10
|
+
".Truncate-text--expandable:is(.Truncate > .Truncate-text):active"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class DialogHelperElement extends HTMLElement {
|
|
2
|
+
#private;
|
|
3
|
+
get dialog(): HTMLDialogElement | null;
|
|
4
|
+
connectedCallback(): void;
|
|
5
|
+
disconnectedCallback(): void;
|
|
6
|
+
handleEvent(event: MouseEvent): void;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface Window {
|
|
10
|
+
DialogHelperElement: typeof DialogHelperElement;
|
|
11
|
+
}
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
'dialog-helper': DialogHelperElement;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
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");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
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
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _DialogHelperElement_instances, _DialogHelperElement_abortController, _DialogHelperElement_handleDialogOpenAttribute;
|
|
13
|
+
function dialogInvokerButtonHandler(event) {
|
|
14
|
+
const target = event.target;
|
|
15
|
+
const button = target?.closest('button');
|
|
16
|
+
if (!button || button.hasAttribute('disabled') || button.getAttribute('aria-disabled') === 'true')
|
|
17
|
+
return;
|
|
18
|
+
// If the user is clicking a valid dialog trigger
|
|
19
|
+
let dialogId = button?.getAttribute('data-show-dialog-id');
|
|
20
|
+
if (dialogId) {
|
|
21
|
+
const dialog = document.getElementById(dialogId);
|
|
22
|
+
if (dialog instanceof HTMLDialogElement) {
|
|
23
|
+
dialog.showModal();
|
|
24
|
+
// A buttons default behaviour in some browsers it to send a pointer event
|
|
25
|
+
// If the behaviour is allowed through the dialog will be shown but then
|
|
26
|
+
// quickly hidden- as if it were never shown. This prevents that.
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
// In some older browsers, such as Chrome 122, when a top layer element (such as a dialog)
|
|
29
|
+
// opens from within a popover, the "hide all popovers" internal algorithm runs, hiding
|
|
30
|
+
// any popover that is currently open, regardless of whether or not another top layer element,
|
|
31
|
+
// such as a <dialog> is nested inside.
|
|
32
|
+
// See https://github.com/whatwg/html/issues/9998.
|
|
33
|
+
// This is fixed by https://github.com/whatwg/html/pull/10116, but while we still support browsers
|
|
34
|
+
// that present this bug, we must undo the work they did to hide ancestral popovers of the dialog:
|
|
35
|
+
let node = button;
|
|
36
|
+
let fixed = false;
|
|
37
|
+
while (node) {
|
|
38
|
+
node = node.parentElement?.closest('[popover]:not(:popover-open)');
|
|
39
|
+
if (node && node.popover === 'auto') {
|
|
40
|
+
node.classList.add('dialog-inside-popover-fix');
|
|
41
|
+
node.popover = 'manual';
|
|
42
|
+
node.showPopover();
|
|
43
|
+
fixed = true;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (fixed) {
|
|
47
|
+
// We need to re-open the dialog as modal, and also ensure no close event listeners
|
|
48
|
+
// are trying to act on the close
|
|
49
|
+
/* eslint-disable-next-line no-restricted-syntax */
|
|
50
|
+
dialog.addEventListener('close', e => e.stopImmediatePropagation(), { once: true });
|
|
51
|
+
dialog.close();
|
|
52
|
+
dialog.showModal();
|
|
53
|
+
dialog.addEventListener('close', () => {
|
|
54
|
+
for (const el of dialog.ownerDocument.querySelectorAll('.dialog-inside-popover-fix')) {
|
|
55
|
+
if (el.contains(dialog)) {
|
|
56
|
+
el.classList.remove('dialog-inside-popover-fix');
|
|
57
|
+
el.popover = 'auto';
|
|
58
|
+
el.showPopover();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, { once: true });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
dialogId = button.getAttribute('data-close-dialog-id') || button.getAttribute('data-submit-dialog-id');
|
|
66
|
+
if (dialogId) {
|
|
67
|
+
const dialog = document.getElementById(dialogId);
|
|
68
|
+
if (dialog instanceof HTMLDialogElement && dialog.open) {
|
|
69
|
+
dialog.close();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export class DialogHelperElement extends HTMLElement {
|
|
74
|
+
constructor() {
|
|
75
|
+
super(...arguments);
|
|
76
|
+
_DialogHelperElement_instances.add(this);
|
|
77
|
+
_DialogHelperElement_abortController.set(this, null);
|
|
78
|
+
}
|
|
79
|
+
get dialog() {
|
|
80
|
+
return this.querySelector('dialog');
|
|
81
|
+
}
|
|
82
|
+
connectedCallback() {
|
|
83
|
+
const { signal } = (__classPrivateFieldSet(this, _DialogHelperElement_abortController, new AbortController(), "f"));
|
|
84
|
+
document.addEventListener('click', dialogInvokerButtonHandler, true);
|
|
85
|
+
document.addEventListener('click', this, { signal });
|
|
86
|
+
this.ownerDocument.body.style.setProperty('--dialog-scrollgutter', `${window.innerWidth - this.ownerDocument.body.clientWidth}px`);
|
|
87
|
+
new MutationObserver(records => {
|
|
88
|
+
for (const record of records) {
|
|
89
|
+
if (record.target === this.dialog) {
|
|
90
|
+
__classPrivateFieldGet(this, _DialogHelperElement_instances, "m", _DialogHelperElement_handleDialogOpenAttribute).call(this);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}).observe(this, { subtree: true, attributeFilter: ['open'] });
|
|
94
|
+
__classPrivateFieldGet(this, _DialogHelperElement_instances, "m", _DialogHelperElement_handleDialogOpenAttribute).call(this);
|
|
95
|
+
}
|
|
96
|
+
disconnectedCallback() {
|
|
97
|
+
__classPrivateFieldGet(this, _DialogHelperElement_abortController, "f")?.abort();
|
|
98
|
+
}
|
|
99
|
+
handleEvent(event) {
|
|
100
|
+
const target = event.target;
|
|
101
|
+
const dialog = this.dialog;
|
|
102
|
+
// The click target _must_ be the dialog element itself, and not elements underneath or inside.
|
|
103
|
+
if (target !== dialog || !dialog?.open)
|
|
104
|
+
return;
|
|
105
|
+
// If the dialog contains a form, do not close the dialog when clicking outside of the dialog
|
|
106
|
+
if (dialog.querySelector('form'))
|
|
107
|
+
return;
|
|
108
|
+
const rect = dialog.getBoundingClientRect();
|
|
109
|
+
const clickWasInsideDialog = rect.top <= event.clientY &&
|
|
110
|
+
event.clientY <= rect.top + rect.height &&
|
|
111
|
+
rect.left <= event.clientX &&
|
|
112
|
+
event.clientX <= rect.left + rect.width;
|
|
113
|
+
if (!clickWasInsideDialog) {
|
|
114
|
+
dialog.close();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
_DialogHelperElement_abortController = new WeakMap(), _DialogHelperElement_instances = new WeakSet(), _DialogHelperElement_handleDialogOpenAttribute = function _DialogHelperElement_handleDialogOpenAttribute() {
|
|
119
|
+
if (!this.dialog)
|
|
120
|
+
return;
|
|
121
|
+
// We don't want to show the Dialog component as non-modal
|
|
122
|
+
if (this.dialog.matches('[open]:not(:modal)')) {
|
|
123
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
124
|
+
this.dialog.addEventListener('close', e => e.stopImmediatePropagation(), { once: true });
|
|
125
|
+
this.dialog.close();
|
|
126
|
+
this.dialog.showModal();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
if (!window.customElements.get('dialog-helper')) {
|
|
130
|
+
window.DialogHelperElement = DialogHelperElement;
|
|
131
|
+
window.customElements.define('dialog-helper', DialogHelperElement);
|
|
132
|
+
}
|
|
@@ -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
|
+
}
|