primer_view_components 0.1.5 → 0.1.7
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/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 +3 -3
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list/form_wrapper.html.erb +10 -0
- data/app/components/primer/alpha/action_list/form_wrapper.rb +61 -0
- data/app/components/primer/alpha/action_list/item.html.erb +41 -36
- data/app/components/primer/alpha/action_list/item.rb +18 -4
- 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.html.erb +5 -0
- data/app/components/primer/alpha/action_list.pcss +37 -37
- data/app/components/primer/alpha/action_list.rb +18 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +8 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.js +100 -22
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +119 -20
- data/app/components/primer/alpha/action_menu/list.rb +27 -19
- data/app/components/primer/alpha/action_menu.rb +106 -29
- data/app/components/primer/alpha/auto_complete.css +1 -1
- data/app/components/primer/alpha/auto_complete.css.map +1 -1
- data/app/components/primer/alpha/auto_complete.pcss +2 -2
- data/app/components/primer/alpha/banner.css +1 -1
- data/app/components/primer/alpha/banner.css.map +1 -1
- data/app/components/primer/alpha/banner.pcss +7 -7
- data/app/components/primer/alpha/dialog.css +1 -1
- data/app/components/primer/alpha/dialog.css.json +0 -2
- data/app/components/primer/alpha/dialog.css.map +1 -1
- data/app/components/primer/alpha/dialog.pcss +33 -36
- data/app/components/primer/alpha/dropdown/menu.rb +1 -1
- data/app/components/primer/alpha/dropdown.css +1 -1
- data/app/components/primer/alpha/dropdown.css.map +1 -1
- data/app/components/primer/alpha/dropdown.pcss +12 -11
- data/app/components/primer/alpha/layout.css +1 -1
- data/app/components/primer/alpha/layout.css.map +1 -1
- data/app/components/primer/alpha/layout.pcss +4 -4
- data/app/components/primer/alpha/menu.css +1 -1
- data/app/components/primer/alpha/menu.css.map +1 -1
- data/app/components/primer/alpha/menu.pcss +20 -20
- data/app/components/primer/alpha/modal_dialog.js +12 -0
- data/app/components/primer/alpha/modal_dialog.ts +17 -0
- data/app/components/primer/alpha/overlay.css +1 -1
- data/app/components/primer/alpha/overlay.css.map +1 -1
- data/app/components/primer/alpha/overlay.pcss +1 -1
- data/app/components/primer/alpha/overlay.rb +9 -5
- data/app/components/primer/alpha/segmented_control.css +1 -1
- data/app/components/primer/alpha/segmented_control.css.map +1 -1
- data/app/components/primer/alpha/segmented_control.pcss +27 -38
- data/app/components/primer/alpha/tab_nav.css +1 -1
- data/app/components/primer/alpha/tab_nav.css.map +1 -1
- data/app/components/primer/alpha/tab_nav.pcss +12 -12
- data/app/components/primer/alpha/text_field.css +3 -3
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/alpha/text_field.pcss +74 -88
- data/app/components/primer/alpha/toggle_switch.css +1 -1
- data/app/components/primer/alpha/toggle_switch.css.map +1 -1
- data/app/components/primer/alpha/toggle_switch.pcss +9 -9
- data/app/components/primer/alpha/underline_nav.css +1 -1
- data/app/components/primer/alpha/underline_nav.css.map +1 -1
- data/app/components/primer/alpha/underline_nav.pcss +7 -7
- data/app/components/primer/beta/auto_complete/auto_complete.html.erb +1 -1
- data/app/components/primer/beta/auto_complete/item.html.erb +9 -9
- data/app/components/primer/beta/auto_complete/item.rb +17 -13
- data/app/components/primer/beta/auto_complete.rb +20 -2
- data/app/components/primer/beta/avatar.css +1 -1
- data/app/components/primer/beta/avatar.css.map +1 -1
- data/app/components/primer/beta/avatar.pcss +2 -2
- data/app/components/primer/beta/avatar_stack.css +1 -1
- data/app/components/primer/beta/avatar_stack.css.map +1 -1
- data/app/components/primer/beta/avatar_stack.pcss +5 -5
- data/app/components/primer/beta/blankslate.css +1 -1
- data/app/components/primer/beta/blankslate.css.map +1 -1
- data/app/components/primer/beta/blankslate.pcss +13 -13
- data/app/components/primer/beta/border_box.css +1 -1
- data/app/components/primer/beta/border_box.css.json +1 -1
- data/app/components/primer/beta/border_box.css.map +1 -1
- data/app/components/primer/beta/border_box.pcss +41 -39
- data/app/components/primer/beta/button.css +1 -1
- data/app/components/primer/beta/button.css.json +0 -2
- data/app/components/primer/beta/button.css.map +1 -1
- data/app/components/primer/beta/button.pcss +27 -29
- data/app/components/primer/beta/counter.css +1 -1
- data/app/components/primer/beta/counter.css.map +1 -1
- data/app/components/primer/beta/counter.pcss +3 -3
- data/app/components/primer/beta/flash.css +1 -1
- data/app/components/primer/beta/flash.css.map +1 -1
- data/app/components/primer/beta/flash.pcss +10 -11
- data/app/components/primer/beta/label.css +1 -1
- data/app/components/primer/beta/label.css.map +1 -1
- data/app/components/primer/beta/label.pcss +2 -2
- data/app/components/primer/beta/popover.css +1 -1
- data/app/components/primer/beta/popover.css.map +1 -1
- data/app/components/primer/beta/popover.pcss +4 -4
- data/app/components/primer/beta/state.css +1 -1
- data/app/components/primer/beta/state.css.map +1 -1
- data/app/components/primer/beta/state.pcss +5 -5
- data/app/components/primer/beta/subhead.css +1 -1
- data/app/components/primer/beta/subhead.css.map +1 -1
- data/app/components/primer/beta/subhead.pcss +4 -4
- data/app/components/primer/beta/timeline_item.css +1 -1
- data/app/components/primer/beta/timeline_item.css.map +1 -1
- data/app/components/primer/beta/timeline_item.pcss +13 -13
- data/app/components/primer/beta/truncate.css +1 -1
- data/app/components/primer/beta/truncate.css.map +1 -1
- data/app/components/primer/beta/truncate.pcss +1 -1
- data/lib/postcss_mixins/activeIndicatorLine.pcss +1 -1
- data/lib/primer/view_components/linters/disallow_component_css_counter.rb +1 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/primer/yard/component_manifest.rb +1 -0
- data/previews/primer/alpha/action_menu_preview/content_labels.html.erb +9 -0
- data/previews/primer/alpha/action_menu_preview/multiple_select_form.html.erb +13 -0
- data/previews/primer/alpha/action_menu_preview/single_select_form.html.erb +13 -0
- data/previews/primer/alpha/action_menu_preview/submitting_forms.html.erb +15 -0
- data/previews/primer/alpha/action_menu_preview.rb +89 -38
- data/previews/primer/beta/auto_complete_preview.rb +36 -23
- data/static/arguments.json +43 -2
- data/static/audited_at.json +1 -0
- data/static/constants.json +37 -9
- data/static/info_arch.json +137 -23
- data/static/previews.json +25 -0
- data/static/statuses.json +1 -0
- metadata +12 -6
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["popover.pcss"],"names":[],"mappings":"AAEA,SACE,iBAAkB,CAClB,WACF,CAEA,iBAKE,4CAA6C,CAC7C,
|
1
|
+
{"version":3,"sources":["popover.pcss"],"names":[],"mappings":"AAEA,SACE,iBAAkB,CAClB,WACF,CAEA,iBAKE,4CAA6C,CAC7C,oEAAsE,CACtE,4CAA8C,CAH9C,gBAAiB,CADjB,iBAAkB,CAFlB,iBAAkB,CAClB,WA6BF,CArBE,+CAKE,UAAW,CADX,oBAAqB,CADrB,QAAS,CADT,iBAIF,CAEA,wBAIE,sBAAgD,CAAhD,mDAAgD,CAFhD,gBAAiB,CADjB,SAIF,CAEA,uBAIE,sBAAgD,CAAhD,mDAAgD,CAFhD,gBAAiB,CADjB,SAIF,CAKA,mEAEE,YACF,CAOA,mNAGE,yBAAgC,CADhC,QAEF,CAEA,2GAEE,4CAA6C,CAD7C,YAEF,CAEA,wGAEE,4CAA6C,CAD7C,YAEF,CAIF,2DAGE,cAAe,CADf,UAgBF,CAbE,gJAEE,SAAU,CACV,aACF,CAEA,yEACE,UACF,CAEA,uEACE,UACF,CAIF,yDAEE,SAAU,CACV,aAWF,CATE,4IAEE,SAAU,CACV,aACF,CAEA,qEACE,SACF,CAUA,oZAKE,yBAAgC,CAFhC,SAAU,CACV,aAAc,CAFd,OAIF,CAEA,6MACE,eACF,CAEA,uMACE,eACF,CAOA,wGAEE,6CAA8C,CAD9C,WAEF,CAEA,qGAEE,6CAA8C,CAD9C,WAEF,CAOA,qGAEE,8CAA+C,CAD/C,UAEF,CAEA,kGAEE,8CAA+C,CAD/C,UAEF,CAMA,wIAEE,QACF,CAMA,oJAEE,QACF,CAEA,2EACE,WACF,CAEA,yEACE,WACF,CAGF,yBACE,wBACE,eACF,CACF,CAKA,4BACE,SAIE,kBAAoB,CACpB,gBAAkB,CAJlB,cAAe,CAEf,iBAAmB,CADnB,kBAIF,CAEA,iBAGE,WAAY,CACZ,SAAU,CAEV,qCAAuC,CAJvC,UAAW,CADX,QAAS,CAIT,oBAEF,CAGA,8BACE,iEACF,CAGA,+CAEE,YACF,CACF","file":"popover.css","sourcesContent":["/* Popover */\n\n.Popover {\n position: absolute;\n z-index: 100;\n}\n\n.Popover-message {\n position: relative;\n width: 232px;\n margin-right: auto;\n margin-left: auto;\n background-color: var(--color-canvas-overlay);\n border: var(--borderWidth-thin, 1px) solid var(--color-border-default);\n border-radius: var(--borderRadius-medium, 6px);\n\n /* Carets */\n &::before,\n &::after {\n position: absolute;\n left: 50%;\n display: inline-block;\n content: '';\n }\n\n &::before {\n top: -16px;\n margin-left: -9px;\n border: 8px solid transparent;\n border-bottom-color: var(--color-border-default);\n }\n\n &::after {\n top: -14px;\n margin-left: -8px;\n border: 7px solid transparent;\n border-bottom-color: var(--color-canvas-overlay);\n }\n}\n\n/* No caret */\n.Popover-message--no-caret {\n &::before,\n &::after {\n display: none;\n }\n}\n\n/* Bottom-oriented carets */\n.Popover-message--bottom,\n.Popover-message--bottom-right,\n.Popover-message--bottom-left {\n &::before,\n &::after {\n top: auto;\n border-bottom-color: transparent;\n }\n\n &::before {\n bottom: -16px;\n border-top-color: var(--color-border-default);\n }\n\n &::after {\n bottom: -14px;\n border-top-color: var(--color-canvas-overlay);\n }\n}\n\n/* Top and Bottom: Right-oriented carets */\n.Popover-message--top-right,\n.Popover-message--bottom-right {\n right: -9px;\n margin-right: 0;\n\n &::before,\n &::after {\n left: auto;\n margin-left: 0;\n }\n\n &::before {\n right: 20px;\n }\n\n &::after {\n right: 21px;\n }\n}\n\n/* Top and Bottom: Left-oriented carets */\n.Popover-message--top-left,\n.Popover-message--bottom-left {\n left: -9px;\n margin-left: 0;\n\n &::before,\n &::after {\n left: 24px;\n margin-left: 0;\n }\n\n &::after {\n left: 25px;\n }\n}\n\n/* Right- and Left-oriented carets */\n.Popover-message--right,\n.Popover-message--right-top,\n.Popover-message--right-bottom,\n.Popover-message--left,\n.Popover-message--left-top,\n.Popover-message--left-bottom {\n &::before,\n &::after {\n top: 50%;\n left: auto;\n margin-left: 0;\n border-bottom-color: transparent;\n }\n\n &::before {\n margin-top: -9px;\n }\n\n &::after {\n margin-top: -8px;\n }\n}\n\n/* Right-oriented carets */\n.Popover-message--right,\n.Popover-message--right-top,\n.Popover-message--right-bottom {\n &::before {\n right: -16px;\n border-left-color: var(--color-border-default);\n }\n\n &::after {\n right: -14px;\n border-left-color: var(--color-canvas-overlay);\n }\n}\n\n/* Left-oriented carets */\n.Popover-message--left,\n.Popover-message--left-top,\n.Popover-message--left-bottom {\n &::before {\n left: -16px;\n border-right-color: var(--color-border-default);\n }\n\n &::after {\n left: -14px;\n border-right-color: var(--color-canvas-overlay);\n }\n}\n\n/* Right and Left: Top-oriented carets */\n.Popover-message--right-top,\n.Popover-message--left-top {\n &::before,\n &::after {\n top: 24px;\n }\n}\n\n/* Right and Left: Bottom-oriented carets */\n.Popover-message--right-bottom,\n.Popover-message--left-bottom {\n &::before,\n &::after {\n top: auto;\n }\n\n &::before {\n bottom: 16px;\n }\n\n &::after {\n bottom: 17px;\n }\n}\n\n@media (min-width: 544px) {\n .Popover-message--large {\n min-width: 320px;\n }\n}\n\n/* Responsive Popover\n** For < md it will show full-width anchored to the bottom */\n\n@media (max-width: 767.98px) {\n .Popover {\n position: fixed;\n top: auto !important;\n right: 0 !important;\n bottom: 0 !important;\n left: 0 !important;\n }\n\n .Popover-message {\n top: auto;\n right: auto;\n bottom: auto;\n left: auto;\n width: auto !important;\n margin: var(--stack-gap-condensed, 8px);\n }\n\n /* Increase tap area for touch input */\n .Popover-message > .btn-octicon {\n padding: var(--control-medium-paddingInline-normal, 12px) !important;\n }\n\n /* Remove caret */\n .Popover-message::after,\n .Popover-message::before {\n display: none;\n }\n}\n"]}
|
@@ -11,8 +11,8 @@
|
|
11
11
|
margin-right: auto;
|
12
12
|
margin-left: auto;
|
13
13
|
background-color: var(--color-canvas-overlay);
|
14
|
-
border: var(--
|
15
|
-
border-radius: var(--
|
14
|
+
border: var(--borderWidth-thin, 1px) solid var(--color-border-default);
|
15
|
+
border-radius: var(--borderRadius-medium, 6px);
|
16
16
|
|
17
17
|
/* Carets */
|
18
18
|
&::before,
|
@@ -209,12 +209,12 @@
|
|
209
209
|
bottom: auto;
|
210
210
|
left: auto;
|
211
211
|
width: auto !important;
|
212
|
-
margin: var(--
|
212
|
+
margin: var(--stack-gap-condensed, 8px);
|
213
213
|
}
|
214
214
|
|
215
215
|
/* Increase tap area for touch input */
|
216
216
|
.Popover-message > .btn-octicon {
|
217
|
-
padding: var(--
|
217
|
+
padding: var(--control-medium-paddingInline-normal, 12px) !important;
|
218
218
|
}
|
219
219
|
|
220
220
|
/* Remove caret */
|
@@ -1 +1 @@
|
|
1
|
-
.State,.state{border-radius:2em;display:inline-block;font-size:var(--
|
1
|
+
.State,.state{border-radius:2em;display:inline-block;font-size:var(--text-body-size-medium,14px);font-weight:var(--base-text-weight-medium,500);line-height:var(--control-medium-lineBoxHeight,20px);padding:5px var(--control-medium-paddingInline-normal,12px);text-align:center;white-space:nowrap}.State,.State--draft,.state{background-color:var(--color-neutral-emphasis);border:var(--borderWidth-thin,1px) solid #0000;color:var(--color-fg-on-emphasis)}.State--open{background-color:var(--color-open-emphasis)}.State--merged,.State--open{color:var(--color-fg-on-emphasis)}.State--merged{background-color:var(--color-done-emphasis)}.State--closed{background-color:var(--color-closed-emphasis);color:var(--color-fg-on-emphasis)}.State--small{font-size:var(--text-body-size-small,12px);line-height:var(--base-size-24,24px);padding:0 10px}.State--small .octicon{width:1em}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["state.pcss"],"names":[],"mappings":"AAIA,cASE,iBAAkB,CAPlB,oBAAqB,CAErB,
|
1
|
+
{"version":3,"sources":["state.pcss"],"names":[],"mappings":"AAIA,cASE,iBAAkB,CAPlB,oBAAqB,CAErB,2CAA6C,CAC7C,8CAAgD,CAChD,oDAAsD,CAHtD,2DAA6D,CAI7D,iBAAkB,CAClB,kBAEF,CAEA,4BAIE,8CAA+C,CAC/C,8CAAsD,CAFtD,iCAGF,CAEA,aAEE,2CACF,CAEA,4BAJE,iCAOF,CAHA,eAEE,2CACF,CAEA,eAEE,6CAA8C,CAD9C,iCAEF,CAIA,cAEE,0CAA4C,CAC5C,oCAAsC,CAFtC,cAOF,CAHE,uBACE,SACF","file":"state.css","sourcesContent":["/* State */\n\n/* Default 32px */\n\n.state, /* TODO: Deprecate */\n.State {\n display: inline-block;\n padding: 5px var(--control-medium-paddingInline-normal, 12px);\n font-size: var(--text-body-size-medium, 14px);\n font-weight: var(--base-text-weight-medium, 500);\n line-height: var(--control-medium-lineBoxHeight, 20px);\n text-align: center;\n white-space: nowrap;\n border-radius: 2em;\n}\n\n.state, /* TODO: Deprecate */\n.State,\n.State--draft {\n color: var(--color-fg-on-emphasis);\n background-color: var(--color-neutral-emphasis);\n border: var(--borderWidth-thin, 1px) solid transparent;\n}\n\n.State--open {\n color: var(--color-fg-on-emphasis);\n background-color: var(--color-open-emphasis);\n}\n\n.State--merged {\n color: var(--color-fg-on-emphasis);\n background-color: var(--color-done-emphasis);\n}\n\n.State--closed {\n color: var(--color-fg-on-emphasis);\n background-color: var(--color-closed-emphasis);\n}\n\n/* Small 24px */\n\n.State--small {\n padding: 0 10px;\n font-size: var(--text-body-size-small, 12px);\n line-height: var(--base-size-24, 24px);\n\n & .octicon {\n width: 1em; /* Ensures different icons don't change State indicator width */\n }\n}\n"]}
|
@@ -5,10 +5,10 @@
|
|
5
5
|
.state, /* TODO: Deprecate */
|
6
6
|
.State {
|
7
7
|
display: inline-block;
|
8
|
-
padding: 5px var(--
|
9
|
-
font-size: var(--
|
8
|
+
padding: 5px var(--control-medium-paddingInline-normal, 12px);
|
9
|
+
font-size: var(--text-body-size-medium, 14px);
|
10
10
|
font-weight: var(--base-text-weight-medium, 500);
|
11
|
-
line-height: var(--
|
11
|
+
line-height: var(--control-medium-lineBoxHeight, 20px);
|
12
12
|
text-align: center;
|
13
13
|
white-space: nowrap;
|
14
14
|
border-radius: 2em;
|
@@ -19,7 +19,7 @@
|
|
19
19
|
.State--draft {
|
20
20
|
color: var(--color-fg-on-emphasis);
|
21
21
|
background-color: var(--color-neutral-emphasis);
|
22
|
-
border: var(--
|
22
|
+
border: var(--borderWidth-thin, 1px) solid transparent;
|
23
23
|
}
|
24
24
|
|
25
25
|
.State--open {
|
@@ -41,7 +41,7 @@
|
|
41
41
|
|
42
42
|
.State--small {
|
43
43
|
padding: 0 10px;
|
44
|
-
font-size: var(--
|
44
|
+
font-size: var(--text-body-size-small, 12px);
|
45
45
|
line-height: var(--base-size-24, 24px);
|
46
46
|
|
47
47
|
& .octicon {
|
@@ -1 +1 @@
|
|
1
|
-
.Subhead{border-bottom:var(--
|
1
|
+
.Subhead{border-bottom:var(--borderWidth-thin,1px) solid var(--color-border-muted);display:flex;flex-flow:row wrap;justify-content:flex-end;margin-bottom:var(--stack-gap-normal,16px);padding-bottom:var(--stack-padding-condensed,8px)}.Subhead--spacious{margin-top:var(--base-size-40,40px)}.Subhead-heading{flex:1 1 auto;font-size:24px;font-weight:var(--base-text-weight-normal,400);order:0}.Subhead-heading--danger{color:var(--color-danger-fg);font-weight:var(--base-text-weight-semibold,600)}.Subhead-description{color:var(--color-fg-muted);flex:1 100%;font-size:var(--text-body-size-medium,14px);order:2}.Subhead-actions{align-self:center;justify-content:flex-end;margin:var(--base-size-4,4px) 0 var(--base-size-4,4px) var(--base-size-4,4px);order:1}.Subhead-actions+.Subhead-description{margin-top:var(--base-size-4,4px)}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["subhead.pcss"],"names":[],"mappings":"AAEA,SAIE,
|
1
|
+
{"version":3,"sources":["subhead.pcss"],"names":[],"mappings":"AAEA,SAIE,yEAA2E,CAH3E,YAAa,CAIb,kBAAmB,CACnB,wBAAyB,CAHzB,0CAA4C,CAD5C,iDAKF,CAGA,mBACE,mCACF,CAGA,iBAGE,aAAc,CAFd,cAAe,CACf,8CAAgD,CAEhD,OACF,CAGA,yBAEE,4BAA6B,CAD7B,gDAEF,CAGA,qBAEE,2BAA4B,CAC5B,WAAY,CAFZ,2CAA6C,CAG7C,OACF,CAGA,iBAEE,iBAAkB,CAClB,wBAAyB,CAFzB,6EAAiF,CAGjF,OAKF,CAHE,sCACE,iCACF","file":"subhead.css","sourcesContent":["/* Subhead */\n\n.Subhead {\n display: flex;\n padding-bottom: var(--stack-padding-condensed, 8px);\n margin-bottom: var(--stack-gap-normal, 16px);\n border-bottom: var(--borderWidth-thin, 1px) solid var(--color-border-muted);\n flex-flow: row wrap;\n justify-content: flex-end; /* Keep actions right aligned. */\n}\n\n/* Modifier class to give a lot of breathing room between sections of content. */\n.Subhead--spacious {\n margin-top: var(--base-size-40, 40px);\n}\n\n/* <h2> sized heading with normal font weight */\n.Subhead-heading {\n font-size: 24px;\n font-weight: var(--base-text-weight-normal, 400);\n flex: 1 1 auto;\n order: 0;\n}\n\n/* Make the text bold and red for dangerous content */\n.Subhead-heading--danger {\n font-weight: var(--base-text-weight-semibold, 600);\n color: var(--color-danger-fg);\n}\n\n/* One-liner of supporting text */\n.Subhead-description {\n font-size: var(--text-body-size-medium, 14px);\n color: var(--color-fg-muted);\n flex: 1 100%;\n order: 2;\n}\n\n/* Add 1 or 2 buttons to the right of the heading */\n.Subhead-actions {\n margin: var(--base-size-4, 4px) 0 var(--base-size-4, 4px) var(--base-size-4, 4px);\n align-self: center;\n justify-content: flex-end;\n order: 1;\n\n & + .Subhead-description {\n margin-top: var(--base-size-4, 4px);\n }\n}\n"]}
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
.Subhead {
|
4
4
|
display: flex;
|
5
|
-
padding-bottom: var(--
|
6
|
-
margin-bottom: var(--
|
7
|
-
border-bottom: var(--
|
5
|
+
padding-bottom: var(--stack-padding-condensed, 8px);
|
6
|
+
margin-bottom: var(--stack-gap-normal, 16px);
|
7
|
+
border-bottom: var(--borderWidth-thin, 1px) solid var(--color-border-muted);
|
8
8
|
flex-flow: row wrap;
|
9
9
|
justify-content: flex-end; /* Keep actions right aligned. */
|
10
10
|
}
|
@@ -30,7 +30,7 @@
|
|
30
30
|
|
31
31
|
/* One-liner of supporting text */
|
32
32
|
.Subhead-description {
|
33
|
-
font-size: var(--
|
33
|
+
font-size: var(--text-body-size-medium, 14px);
|
34
34
|
color: var(--color-fg-muted);
|
35
35
|
flex: 1 100%;
|
36
36
|
order: 2;
|
@@ -1 +1 @@
|
|
1
|
-
.TimelineItem{display:flex;margin-left:var(--
|
1
|
+
.TimelineItem{display:flex;margin-left:var(--stack-gap-normal,16px);padding:var(--stack-padding-normal,16px) 0;position:relative}.TimelineItem:before{background-color:var(--color-border-muted);bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:var(--borderWidth-thick,2px)}.TimelineItem:target .TimelineItem-badge{border-color:var(--color-accent-emphasis);box-shadow:0 0 .2em var(--color-accent-muted)}.TimelineItem-badge{align-items:center;background-color:var(--color-timeline-badge-bg);border:var(--borderWidth-thick,2px) solid var(--color-canvas-default);border-radius:50%;color:var(--color-fg-muted);display:flex;flex-shrink:0;height:var(--control-medium-size,32px);justify-content:center;margin-left:calc(var(--control-medium-size, 32px)/-2 + 1px);margin-right:var(--controlStack-medium-gap-condensed,8px);position:relative;width:var(--control-medium-size,32px);z-index:1}.TimelineItem-badge--success{background-color:var(--color-success-emphasis);border:var(--borderWidth-thin,1px) solid #0000;color:var(--color-fg-on-emphasis)}.TimelineItem-body{color:var(--color-fg-muted);flex:auto;margin-top:var(--base-size-4,4px);max-width:100%;min-width:0}.TimelineItem-avatar{left:-72px;position:absolute;z-index:1}.TimelineItem-break{background-color:var(--color-canvas-default);border:0;border-top:var(--borderWidth-thicker,4px) solid var(--color-border-default);height:var(--stack-gap-spacious,24px);margin:0;margin-bottom:calc(var(--stack-gap-normal, 16px)*-1);margin-left:-56px;position:relative;z-index:1}.TimelineItem--condensed{padding-bottom:0;padding-top:var(--base-size-4,4px)}.TimelineItem--condensed:last-child{padding-bottom:var(--stack-gap-normal,16px)}.TimelineItem--condensed .TimelineItem-badge{background-color:var(--color-canvas-default);border:0;color:var(--color-fg-muted);height:var(--base-size-16,16px);margin-bottom:var(--base-size-8,8px);margin-top:var(--base-size-8,8px)}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["timeline_item.pcss"],"names":[],"mappings":"AAEA,cAEE,YAAa,CAEb
|
1
|
+
{"version":3,"sources":["timeline_item.pcss"],"names":[],"mappings":"AAEA,cAEE,YAAa,CAEb,wCAA0C,CAD1C,0CAA4C,CAF5C,iBAqBF,CAfE,qBAQE,0CAA2C,CAL3C,QAAS,CAIT,UAAW,CAFX,aAAc,CADd,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAIN,kCAGF,CAEA,yCACE,yCAA0C,CAC1C,6CACF,CAGF,oBASE,kBAAmB,CACnB,+CAAgD,CAChD,qEAAuE,CACvE,iBAAkB,CAJlB,2BAA4B,CAL5B,YAAa,CAWb,aAAc,CATd,sCAAwC,CAQxC,sBAAuB,CANvB,2DAA8D,CAD9D,yDAA2D,CAL3D,iBAAkB,CAGlB,qCAAuC,CAFvC,SAaF,CAEA,6BAEE,8CAA+C,CAC/C,8CAAsD,CAFtD,iCAGF,CAEA,mBAIE,2BAA4B,CAC5B,SAAU,CAFV,iCAAmC,CADnC,cAAe,CADf,WAKF,CAEA,qBAEE,UAAW,CADX,iBAAkB,CAElB,SACF,CAEA,oBAOE,4CAA6C,CAC7C,QAAS,CACT,2EAA6E,CAN7E,qCAAuC,CACvC,QAAS,CACT,oDAAuD,CACvD,iBAAkB,CALlB,iBAAkB,CAClB,SAQF,CAEA,yBAEE,gBAAiB,CADjB,kCAgBF,CAZE,oCACE,2CACF,CAEA,6CAKE,4CAA6C,CAC7C,QAAS,CAFT,2BAA4B,CAH5B,+BAAiC,CAEjC,oCAAsC,CADtC,iCAKF","file":"timeline_item.css","sourcesContent":["/* TimelineItem */\n\n.TimelineItem {\n position: relative;\n display: flex;\n padding: var(--stack-padding-normal, 16px) 0;\n margin-left: var(--stack-gap-normal, 16px);\n\n /* The Timeline */\n &::before {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n display: block;\n width: var(--borderWidth-thick, 2px);\n content: '';\n background-color: var(--color-border-muted);\n }\n\n &:target .TimelineItem-badge {\n border-color: var(--color-accent-emphasis);\n box-shadow: 0 0 0.2em var(--color-accent-muted);\n }\n}\n\n.TimelineItem-badge {\n position: relative;\n z-index: 1;\n display: flex;\n width: var(--control-medium-size, 32px);\n height: var(--control-medium-size, 32px);\n margin-right: var(--controlStack-medium-gap-condensed, 8px);\n margin-left: calc(var(--control-medium-size, 32px) / -2 + 1px);\n color: var(--color-fg-muted);\n align-items: center;\n background-color: var(--color-timeline-badge-bg);\n border: var(--borderWidth-thick, 2px) solid var(--color-canvas-default);\n border-radius: 50%;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.TimelineItem-badge--success {\n color: var(--color-fg-on-emphasis);\n background-color: var(--color-success-emphasis);\n border: var(--borderWidth-thin, 1px) solid transparent;\n}\n\n.TimelineItem-body {\n min-width: 0;\n max-width: 100%;\n margin-top: var(--base-size-4, 4px);\n color: var(--color-fg-muted);\n flex: auto;\n}\n\n.TimelineItem-avatar {\n position: absolute;\n left: -72px;\n z-index: 1;\n}\n\n.TimelineItem-break {\n position: relative;\n z-index: 1;\n height: var(--stack-gap-spacious, 24px);\n margin: 0;\n margin-bottom: calc(var(--stack-gap-normal, 16px) * -1);\n margin-left: -56px;\n background-color: var(--color-canvas-default);\n border: 0;\n border-top: var(--borderWidth-thicker, 4px) solid var(--color-border-default);\n}\n\n.TimelineItem--condensed {\n padding-top: var(--base-size-4, 4px);\n padding-bottom: 0;\n\n /* TimelineItem--condensed is often grouped. (commits) */\n &:last-child {\n padding-bottom: var(--stack-gap-normal, 16px);\n }\n\n & .TimelineItem-badge {\n height: var(--base-size-16, 16px);\n margin-top: var(--base-size-8, 8px);\n margin-bottom: var(--base-size-8, 8px);\n color: var(--color-fg-muted);\n background-color: var(--color-canvas-default);\n border: 0;\n }\n}\n"]}
|
@@ -3,8 +3,8 @@
|
|
3
3
|
.TimelineItem {
|
4
4
|
position: relative;
|
5
5
|
display: flex;
|
6
|
-
padding: var(--
|
7
|
-
margin-left: var(--
|
6
|
+
padding: var(--stack-padding-normal, 16px) 0;
|
7
|
+
margin-left: var(--stack-gap-normal, 16px);
|
8
8
|
|
9
9
|
/* The Timeline */
|
10
10
|
&::before {
|
@@ -13,7 +13,7 @@
|
|
13
13
|
bottom: 0;
|
14
14
|
left: 0;
|
15
15
|
display: block;
|
16
|
-
width: var(--
|
16
|
+
width: var(--borderWidth-thick, 2px);
|
17
17
|
content: '';
|
18
18
|
background-color: var(--color-border-muted);
|
19
19
|
}
|
@@ -28,14 +28,14 @@
|
|
28
28
|
position: relative;
|
29
29
|
z-index: 1;
|
30
30
|
display: flex;
|
31
|
-
width: var(--
|
32
|
-
height: var(--
|
33
|
-
margin-right: var(--
|
34
|
-
margin-left: calc(var(--
|
31
|
+
width: var(--control-medium-size, 32px);
|
32
|
+
height: var(--control-medium-size, 32px);
|
33
|
+
margin-right: var(--controlStack-medium-gap-condensed, 8px);
|
34
|
+
margin-left: calc(var(--control-medium-size, 32px) / -2 + 1px);
|
35
35
|
color: var(--color-fg-muted);
|
36
36
|
align-items: center;
|
37
37
|
background-color: var(--color-timeline-badge-bg);
|
38
|
-
border: var(--
|
38
|
+
border: var(--borderWidth-thick, 2px) solid var(--color-canvas-default);
|
39
39
|
border-radius: 50%;
|
40
40
|
justify-content: center;
|
41
41
|
flex-shrink: 0;
|
@@ -44,7 +44,7 @@
|
|
44
44
|
.TimelineItem-badge--success {
|
45
45
|
color: var(--color-fg-on-emphasis);
|
46
46
|
background-color: var(--color-success-emphasis);
|
47
|
-
border: var(--
|
47
|
+
border: var(--borderWidth-thin, 1px) solid transparent;
|
48
48
|
}
|
49
49
|
|
50
50
|
.TimelineItem-body {
|
@@ -64,13 +64,13 @@
|
|
64
64
|
.TimelineItem-break {
|
65
65
|
position: relative;
|
66
66
|
z-index: 1;
|
67
|
-
height: var(--
|
67
|
+
height: var(--stack-gap-spacious, 24px);
|
68
68
|
margin: 0;
|
69
|
-
margin-bottom: calc(var(--
|
69
|
+
margin-bottom: calc(var(--stack-gap-normal, 16px) * -1);
|
70
70
|
margin-left: -56px;
|
71
71
|
background-color: var(--color-canvas-default);
|
72
72
|
border: 0;
|
73
|
-
border-top: var(--
|
73
|
+
border-top: var(--borderWidth-thicker, 4px) solid var(--color-border-default);
|
74
74
|
}
|
75
75
|
|
76
76
|
.TimelineItem--condensed {
|
@@ -79,7 +79,7 @@
|
|
79
79
|
|
80
80
|
/* TimelineItem--condensed is often grouped. (commits) */
|
81
81
|
&:last-child {
|
82
|
-
padding-bottom: var(--
|
82
|
+
padding-bottom: var(--stack-gap-normal, 16px);
|
83
83
|
}
|
84
84
|
|
85
85
|
& .TimelineItem-badge {
|
@@ -1 +1 @@
|
|
1
|
-
.Truncate{display:inline-flex;max-width:100%;min-width:0}.Truncate>.Truncate-text{max-width:-moz-fit-content;max-width:fit-content;min-width:1ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Truncate>.Truncate-text+.Truncate-text{margin-left:var(--
|
1
|
+
.Truncate{display:inline-flex;max-width:100%;min-width:0}.Truncate>.Truncate-text{max-width:-moz-fit-content;max-width:fit-content;min-width:1ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.Truncate>.Truncate-text+.Truncate-text{margin-left:var(--control-small-gap,4px)}.Truncate>.Truncate-text.Truncate-text--primary{flex-basis:200%}.Truncate>.Truncate-text.Truncate-text--expandable:active,.Truncate>.Truncate-text.Truncate-text--expandable:focus,.Truncate>.Truncate-text.Truncate-text--expandable:hover{cursor:pointer;flex-shrink:0;max-width:100%!important}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["truncate.pcss"],"names":[],"mappings":"AAEA,UACE,mBAAoB,CAEpB,cAAe,CADf,WA0BF,CAvBE,yBAEE,0BAAsB,CAAtB,qBAAsB,CADtB,aAAc,CAEd,eAAgB,CAChB,sBAAuB,CACvB,kBAiBF,CAfE,wCACE
|
1
|
+
{"version":3,"sources":["truncate.pcss"],"names":[],"mappings":"AAEA,UACE,mBAAoB,CAEpB,cAAe,CADf,WA0BF,CAvBE,yBAEE,0BAAsB,CAAtB,qBAAsB,CADtB,aAAc,CAEd,eAAgB,CAChB,sBAAuB,CACvB,kBAiBF,CAfE,wCACE,wCACF,CAEA,gDACE,eACF,CAEA,4KAKE,cAAe,CADf,aAAc,CADd,wBAGF","file":"truncate.css","sourcesContent":["/* Truncate */\n\n.Truncate {\n display: inline-flex;\n min-width: 0;\n max-width: 100%;\n\n & > .Truncate-text {\n min-width: 1ch;\n max-width: fit-content;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n & + .Truncate-text {\n margin-left: var(--control-small-gap, 4px);\n }\n\n &.Truncate-text--primary {\n flex-basis: 200%;\n }\n\n &.Truncate-text--expandable:hover,\n &.Truncate-text--expandable:focus,\n &.Truncate-text--expandable:active {\n max-width: 100% !important;\n flex-shrink: 0;\n cursor: pointer;\n }\n }\n}\n"]}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<%= render(Primer::Alpha::ActionMenu.new) do |menu| %>
|
2
|
+
<% menu.with_show_button { "Menu" } %>
|
3
|
+
<% menu.with_item(value: "") do %>
|
4
|
+
<span class="copy-link">Copy link</span>
|
5
|
+
<% end %>
|
6
|
+
<% menu.with_item(value: "") do %>
|
7
|
+
<span class="quote-reply">Quote reply</span>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= form_with(url: action_menu_form_action_path(format: route_format)) do |f| %>
|
2
|
+
<%= render(Primer::Alpha::ActionMenu.new(select_variant: :multiple, dynamic_label: true, dynamic_label_prefix: "Strategy", form_arguments: { builder: f, name: "foo" })) do |menu| %>
|
3
|
+
<% menu.with_show_button { "Strategy" } %>
|
4
|
+
<% menu.with_item(label: "Fast forward", data: { value: "fast_forward" }) %>
|
5
|
+
<% menu.with_item(label: "Recursive", data: { value: "recursive" }) %>
|
6
|
+
<% menu.with_item(label: "Ours", data: { value: "ours" }) %>
|
7
|
+
<% menu.with_item(label: "Resolve") %>
|
8
|
+
<% end %>
|
9
|
+
<hr>
|
10
|
+
<div>
|
11
|
+
<%= f.submit(class: "Button--secondary Button--medium Button") %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= form_with(url: action_menu_form_action_path(format: route_format)) do |f| %>
|
2
|
+
<%= render(Primer::Alpha::ActionMenu.new(select_variant: :single, dynamic_label: true, dynamic_label_prefix: "Strategy", form_arguments: { builder: f, name: "foo" })) do |menu| %>
|
3
|
+
<% menu.with_show_button { "Strategy" } %>
|
4
|
+
<% menu.with_item(label: "Fast forward", data: { value: "fast_forward" }) %>
|
5
|
+
<% menu.with_item(label: "Recursive", data: { value: "recursive" }) %>
|
6
|
+
<% menu.with_item(label: "Ours", data: { value: "ours" }) %>
|
7
|
+
<% menu.with_item(label: "Resolve") %>
|
8
|
+
<% end %>
|
9
|
+
<hr>
|
10
|
+
<div>
|
11
|
+
<%= f.submit(class: "Button--secondary Button--medium Button") %>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<form method="get" action="?" id="my-form">
|
2
|
+
<input type="hidden" name="time" value="<%= Time.now.iso8601 %>">
|
3
|
+
</form>
|
4
|
+
<%= render(Primer::Alpha::ActionMenu.new(menu_id: "menu-1")) do |menu| %>
|
5
|
+
<% menu.with_show_button { params["label"] || "Menu" } %>
|
6
|
+
<% menu.with_item(label: "Submit form", tag: "button", content_arguments: {
|
7
|
+
form: "my-form", type: "submit", name: "label", value: "Submitted!"
|
8
|
+
}) do |item| %>
|
9
|
+
<% if params["time"] %>
|
10
|
+
<% item.with_description.with_content("Last submitted at #{params["time"]}") %>
|
11
|
+
<% elsif %>
|
12
|
+
<% item.with_description.with_content("Not yet submitted") %>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
@@ -9,44 +9,68 @@ module Primer
|
|
9
9
|
# @param select_variant [Symbol] select [single, multiple, none]
|
10
10
|
# @param anchor_align [Symbol] select [start, center, end]
|
11
11
|
# @param anchor_side [Symbol] select [outside_bottom, outside_top, outside_left, outside_right]
|
12
|
+
# @param size [Symbol] select [auto, small, medium, large, xlarge]
|
12
13
|
def playground(
|
13
|
-
select_variant: Primer::Alpha::ActionMenu::DEFAULT_SELECT_VARIANT, anchor_align: Primer::Alpha::Overlay::DEFAULT_ANCHOR_ALIGN, anchor_side: Primer::Alpha::Overlay::DEFAULT_ANCHOR_SIDE
|
14
|
+
select_variant: Primer::Alpha::ActionMenu::DEFAULT_SELECT_VARIANT, anchor_align: Primer::Alpha::Overlay::DEFAULT_ANCHOR_ALIGN, anchor_side: Primer::Alpha::Overlay::DEFAULT_ANCHOR_SIDE,
|
15
|
+
size: Primer::Alpha::Overlay::DEFAULT_SIZE
|
14
16
|
)
|
15
|
-
render(Primer::Alpha::ActionMenu.new(select_variant: select_variant, anchor_align: anchor_align, anchor_side: anchor_side)) do |menu|
|
17
|
+
render(Primer::Alpha::ActionMenu.new(select_variant: select_variant, anchor_align: anchor_align, anchor_side: anchor_side, size: size)) do |menu|
|
16
18
|
menu.with_show_button { "Menu" }
|
17
|
-
menu.with_item(label: "Copy link"
|
18
|
-
menu.with_item(label: "Quote reply"
|
19
|
-
menu.with_item(label: "Reference in new issue"
|
19
|
+
menu.with_item(label: "Copy link")
|
20
|
+
menu.with_item(label: "Quote reply")
|
21
|
+
menu.with_item(label: "Reference in new issue")
|
20
22
|
menu.with_divider
|
21
|
-
menu.with_item(label: "Edit"
|
22
|
-
menu.with_item(label: "Delete", scheme: :danger
|
23
|
+
menu.with_item(label: "Edit")
|
24
|
+
menu.with_item(label: "Delete", scheme: :danger)
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
28
|
+
# @label Content labels
|
29
|
+
#
|
30
|
+
def content_labels
|
31
|
+
end
|
32
|
+
|
26
33
|
# @label Default
|
27
34
|
#
|
28
35
|
def default
|
29
36
|
render(Primer::Alpha::ActionMenu.new(menu_id: "menu-1")) do |menu|
|
30
37
|
menu.with_show_button { |button| button.with_trailing_action_icon(icon: :"triangle-down"); "Menu" }
|
31
|
-
menu.with_item(label: "Copy link"
|
32
|
-
menu.with_item(label: "Quote reply"
|
33
|
-
menu.with_item(label: "Reference in new issue"
|
38
|
+
menu.with_item(label: "Copy link")
|
39
|
+
menu.with_item(label: "Quote reply")
|
40
|
+
menu.with_item(label: "Reference in new issue")
|
34
41
|
menu.with_divider
|
35
|
-
menu.with_item(label: "Edit"
|
42
|
+
menu.with_item(label: "Edit") do |item|
|
36
43
|
item.with_description.with_content("Change settings")
|
37
44
|
end
|
38
|
-
menu.with_item(label: "Delete", scheme: :danger
|
45
|
+
menu.with_item(label: "Delete", scheme: :danger) do |item|
|
39
46
|
item.with_description.with_content("Sayonara")
|
40
47
|
end
|
41
48
|
end
|
42
49
|
end
|
43
50
|
|
51
|
+
# @label Wide
|
52
|
+
#
|
53
|
+
def wide
|
54
|
+
render(Primer::Alpha::ActionMenu.new(select_variant: :single, size: :medium)) do |menu|
|
55
|
+
menu.with_show_button { |button| button.with_trailing_action_icon(icon: :"triangle-down"); "A wider menu" }
|
56
|
+
|
57
|
+
menu.with_item(label: "Default", active: true, value: "default") do |item|
|
58
|
+
item.with_trailing_visual_label(scheme: :accent, inline: true).with_content("Recommended")
|
59
|
+
item.with_description { "This is an example for wide ActionMenus" }
|
60
|
+
end
|
61
|
+
|
62
|
+
menu.with_item(label: "Extended", active: false, value: "extended") do |item|
|
63
|
+
item.with_description { "It allows for extended descriptions with extra afforance for additional visuals" }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
44
68
|
# @label With icon button
|
45
69
|
#
|
46
70
|
def with_icon_button
|
47
71
|
render(Primer::Alpha::ActionMenu.new) do |menu|
|
48
72
|
menu.with_show_button(icon: :star, "aria-label": "Menu")
|
49
|
-
menu.with_item(label: "Does something"
|
73
|
+
menu.with_item(label: "Does something")
|
50
74
|
end
|
51
75
|
end
|
52
76
|
|
@@ -55,10 +79,10 @@ module Primer
|
|
55
79
|
def single_select
|
56
80
|
render(Primer::Alpha::ActionMenu.new(select_variant: :single)) do |menu|
|
57
81
|
menu.with_show_button { "Menu" }
|
58
|
-
menu.with_item(label: "Fast forward"
|
59
|
-
menu.with_item(label: "Recursive"
|
60
|
-
menu.with_item(label: "Ours"
|
61
|
-
menu.with_item(label: "Resolve"
|
82
|
+
menu.with_item(label: "Fast forward")
|
83
|
+
menu.with_item(label: "Recursive")
|
84
|
+
menu.with_item(label: "Ours")
|
85
|
+
menu.with_item(label: "Resolve")
|
62
86
|
end
|
63
87
|
end
|
64
88
|
|
@@ -67,15 +91,15 @@ module Primer
|
|
67
91
|
def multiple_select
|
68
92
|
render(Primer::Alpha::ActionMenu.new(select_variant: :multiple)) do |menu|
|
69
93
|
menu.with_show_button { "Menu" }
|
70
|
-
menu.with_item(label: "langermank", description_scheme: :inline
|
94
|
+
menu.with_item(label: "langermank", description_scheme: :inline) do |item|
|
71
95
|
item.with_leading_visual_avatar(src: "https://avatars.githubusercontent.com/u/18661030?v=4", alt: "Katie Langerman")
|
72
96
|
item.with_description.with_content("Katie Langerman")
|
73
97
|
end
|
74
|
-
menu.with_item(label: "jonrohan", description_scheme: :inline
|
98
|
+
menu.with_item(label: "jonrohan", description_scheme: :inline) do |item|
|
75
99
|
item.with_leading_visual_avatar(src: "https://avatars.githubusercontent.com/u/54012?s=96&v=4", alt: "Jon Rohan")
|
76
100
|
item.with_description.with_content("Jon Rohan")
|
77
101
|
end
|
78
|
-
menu.with_item(label: "broccolinisoup", description_scheme: :inline
|
102
|
+
menu.with_item(label: "broccolinisoup", description_scheme: :inline) do |item|
|
79
103
|
item.with_leading_visual_avatar(src: "https://avatars.githubusercontent.com/u/1446503?v=4", alt: "Armağan Ersöz")
|
80
104
|
item.with_description.with_content("Armağan Ersöz")
|
81
105
|
end
|
@@ -98,9 +122,9 @@ module Primer
|
|
98
122
|
def single_selected_item
|
99
123
|
render(Primer::Alpha::ActionMenu.new(select_variant: :single)) do |menu|
|
100
124
|
menu.with_show_button { "Menu" }
|
101
|
-
menu.with_item(label: "Copy link"
|
102
|
-
menu.with_item(label: "Quote reply", active: true
|
103
|
-
menu.with_item(label: "Reference in new issue"
|
125
|
+
menu.with_item(label: "Copy link")
|
126
|
+
menu.with_item(label: "Quote reply", active: true)
|
127
|
+
menu.with_item(label: "Reference in new issue")
|
104
128
|
end
|
105
129
|
end
|
106
130
|
|
@@ -108,10 +132,12 @@ module Primer
|
|
108
132
|
#
|
109
133
|
def single_select_with_internal_label
|
110
134
|
render(Primer::Alpha::ActionMenu.new(select_variant: :single, dynamic_label: true, dynamic_label_prefix: "Menu")) do |menu|
|
111
|
-
menu.with_show_button { "Menu" }
|
112
|
-
menu.with_item(label: "Copy link"
|
113
|
-
|
114
|
-
|
135
|
+
menu.with_show_button { |button| button.with_trailing_action_icon(icon: :"triangle-down"); "Menu" }
|
136
|
+
menu.with_item(label: "Copy link") do |item|
|
137
|
+
item.with_trailing_visual_label(scheme: :accent, inline: true).with_content("Recommended")
|
138
|
+
end
|
139
|
+
menu.with_item(label: "Quote reply", active: true)
|
140
|
+
menu.with_item(label: "Reference in new issue")
|
115
141
|
end
|
116
142
|
end
|
117
143
|
|
@@ -120,15 +146,15 @@ module Primer
|
|
120
146
|
def multiple_selected_items
|
121
147
|
render(Primer::Alpha::ActionMenu.new(select_variant: :multiple)) do |menu|
|
122
148
|
menu.with_show_button { "Menu" }
|
123
|
-
menu.with_item(label: "langermank", description_scheme: :inline,
|
149
|
+
menu.with_item(label: "langermank", description_scheme: :inline, active: true) do |item|
|
124
150
|
item.with_leading_visual_avatar(src: "https://avatars.githubusercontent.com/u/18661030?v=4", alt: "Katie Langerman")
|
125
151
|
item.with_description.with_content("Katie Langerman")
|
126
152
|
end
|
127
|
-
menu.with_item(label: "jonrohan", description_scheme: :inline
|
153
|
+
menu.with_item(label: "jonrohan", description_scheme: :inline) do |item|
|
128
154
|
item.with_leading_visual_avatar(src: "https://avatars.githubusercontent.com/u/54012?s=96&v=4", alt: "Jon Rohan")
|
129
155
|
item.with_description.with_content("Jon Rohan")
|
130
156
|
end
|
131
|
-
menu.with_item(label: "broccolinisoup", description_scheme: :inline,
|
157
|
+
menu.with_item(label: "broccolinisoup", description_scheme: :inline, active: true) do |item|
|
132
158
|
item.with_leading_visual_avatar(src: "https://avatars.githubusercontent.com/u/1446503?v=4", alt: "Armağan Ersöz")
|
133
159
|
item.with_description.with_content("Armağan Ersöz")
|
134
160
|
end
|
@@ -156,18 +182,37 @@ module Primer
|
|
156
182
|
def with_actions
|
157
183
|
render(Primer::Alpha::ActionMenu.new) do |component|
|
158
184
|
component.with_show_button { "Trigger" }
|
159
|
-
component.with_item(label: "
|
160
|
-
component.with_item(label: "
|
161
|
-
component.with_item(label: "Copy text", tag: :"clipboard-copy", value: "Text to copy")
|
185
|
+
component.with_item(label: "Alert", tag: :button, content_arguments: { onclick: "alert('Foo')", onkeydown: "if (event.key === 'Enter') { alert(event.key) }" })
|
186
|
+
component.with_item(label: "Navigate", tag: :a, content_arguments: { href: UrlHelpers.action_menu_landing_path })
|
187
|
+
component.with_item(label: "Copy text", tag: :"clipboard-copy", content_arguments: { value: "Text to copy" })
|
188
|
+
component.with_item(
|
189
|
+
label: "Submit form",
|
190
|
+
href: UrlHelpers.action_menu_form_action_path,
|
191
|
+
form_arguments: {
|
192
|
+
name: "foo", value: "bar", method: :post
|
193
|
+
}
|
194
|
+
)
|
162
195
|
end
|
163
196
|
end
|
164
197
|
|
198
|
+
# @label Single select form
|
199
|
+
#
|
200
|
+
def single_select_form(route_format: :html)
|
201
|
+
render_with_template(locals: { route_format: route_format })
|
202
|
+
end
|
203
|
+
|
204
|
+
# @label Multiple select form
|
205
|
+
#
|
206
|
+
def multiple_select_form(route_format: :html)
|
207
|
+
render_with_template(locals: { route_format: route_format })
|
208
|
+
end
|
209
|
+
|
165
210
|
# @label With disabled items
|
166
211
|
#
|
167
212
|
def with_disabled_items
|
168
213
|
render(Primer::Alpha::ActionMenu.new) do |component|
|
169
214
|
component.with_show_button { "Trigger" }
|
170
|
-
component.with_item(label: "Does something", tag: :button,
|
215
|
+
component.with_item(label: "Does something", tag: :button, disabled: true)
|
171
216
|
component.with_item(label: "Site", tag: :a, href: "/", disabled: true)
|
172
217
|
end
|
173
218
|
end
|
@@ -193,18 +238,24 @@ module Primer
|
|
193
238
|
def block_description
|
194
239
|
render(Primer::Alpha::ActionMenu.new(menu_id: "menu-1")) do |menu|
|
195
240
|
menu.with_show_button { |button| button.with_trailing_action_icon(icon: :"triangle-down"); "Menu" }
|
196
|
-
menu.with_item(label: "Item label"
|
241
|
+
menu.with_item(label: "Item label") do |item|
|
197
242
|
item.with_description.with_content("Block description")
|
198
243
|
end
|
199
244
|
end
|
200
245
|
end
|
201
246
|
|
247
|
+
# @label [Item] Submitting Forms
|
248
|
+
#
|
249
|
+
def submitting_forms
|
250
|
+
render_with_template(locals: {})
|
251
|
+
end
|
252
|
+
|
202
253
|
# @label [Item] Inline description
|
203
254
|
#
|
204
255
|
def inline_description
|
205
256
|
render(Primer::Alpha::ActionMenu.new(menu_id: "menu-1")) do |menu|
|
206
257
|
menu.with_show_button { |button| button.with_trailing_action_icon(icon: :"triangle-down"); "Menu" }
|
207
|
-
menu.with_item(label: "Item label",
|
258
|
+
menu.with_item(label: "Item label", description_scheme: :inline) do |item|
|
208
259
|
item.with_description.with_content("Inline description")
|
209
260
|
end
|
210
261
|
end
|
@@ -215,7 +266,7 @@ module Primer
|
|
215
266
|
def leading_visual
|
216
267
|
render(Primer::Alpha::ActionMenu.new(menu_id: "menu-1")) do |menu|
|
217
268
|
menu.with_show_button { |button| button.with_trailing_action_icon(icon: :"triangle-down"); "Menu" }
|
218
|
-
menu.with_item(label: "Item label",
|
269
|
+
menu.with_item(label: "Item label", description_scheme: :inline) do |item|
|
219
270
|
item.with_leading_visual_icon(icon: :gear)
|
220
271
|
item.with_description.with_content("Inline description")
|
221
272
|
end
|
@@ -227,7 +278,7 @@ module Primer
|
|
227
278
|
def leading_visual_single_select
|
228
279
|
render(Primer::Alpha::ActionMenu.new(menu_id: "menu-1", select_variant: :single)) do |menu|
|
229
280
|
menu.with_show_button { |button| button.with_trailing_action_icon(icon: :"triangle-down"); "Menu" }
|
230
|
-
menu.with_item(label: "Item label",
|
281
|
+
menu.with_item(label: "Item label", description_scheme: :inline) do |item|
|
231
282
|
item.with_leading_visual_icon(icon: :gear)
|
232
283
|
item.with_description.with_content("Inline description")
|
233
284
|
end
|