primer_view_components 0.1.6 → 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 +12 -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 +16 -2
- 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 +17 -0
- data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +7 -1
- data/app/components/primer/alpha/action_menu/action_menu_element.js +55 -3
- data/app/components/primer/alpha/action_menu/action_menu_element.ts +70 -2
- data/app/components/primer/alpha/action_menu/list.rb +9 -11
- data/app/components/primer/alpha/action_menu.rb +50 -12
- 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.map +1 -1
- data/app/components/primer/alpha/dialog.pcss +33 -32
- 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/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/item.html.erb +9 -9
- data/app/components/primer/beta/auto_complete/item.rb +17 -13
- data/app/components/primer/beta/auto_complete.rb +1 -1
- 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.map +1 -1
- data/app/components/primer/beta/button.pcss +25 -25
- 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/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 +46 -2
- data/static/arguments.json +37 -2
- data/static/audited_at.json +1 -0
- data/static/constants.json +18 -1
- data/static/info_arch.json +102 -17
- data/static/previews.json +20 -0
- data/static/statuses.json +1 -0
- metadata +7 -2
@@ -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,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,10 +9,12 @@ 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
19
|
menu.with_item(label: "Copy link")
|
18
20
|
menu.with_item(label: "Quote reply")
|
@@ -46,6 +48,23 @@ module Primer
|
|
46
48
|
end
|
47
49
|
end
|
48
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
|
+
|
49
68
|
# @label With icon button
|
50
69
|
#
|
51
70
|
def with_icon_button
|
@@ -166,9 +185,28 @@ module Primer
|
|
166
185
|
component.with_item(label: "Alert", tag: :button, content_arguments: { onclick: "alert('Foo')", onkeydown: "if (event.key === 'Enter') { alert(event.key) }" })
|
167
186
|
component.with_item(label: "Navigate", tag: :a, content_arguments: { href: UrlHelpers.action_menu_landing_path })
|
168
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
|
+
)
|
169
195
|
end
|
170
196
|
end
|
171
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
|
+
|
172
210
|
# @label With disabled items
|
173
211
|
#
|
174
212
|
def with_disabled_items
|
@@ -206,6 +244,12 @@ module Primer
|
|
206
244
|
end
|
207
245
|
end
|
208
246
|
|
247
|
+
# @label [Item] Submitting Forms
|
248
|
+
#
|
249
|
+
def submitting_forms
|
250
|
+
render_with_template(locals: {})
|
251
|
+
end
|
252
|
+
|
209
253
|
# @label [Item] Inline description
|
210
254
|
#
|
211
255
|
def inline_description
|
data/static/arguments.json
CHANGED
@@ -43,6 +43,12 @@
|
|
43
43
|
"default": "`:none`",
|
44
44
|
"description": "How items may be selected in the list. One of `:multiple`, `:multiple_checkbox`, `:none`, or `:single`."
|
45
45
|
},
|
46
|
+
{
|
47
|
+
"name": "form_arguments",
|
48
|
+
"type": "Hash",
|
49
|
+
"default": "`{}`",
|
50
|
+
"description": "Allows an `ActionList` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission. *NOTE*: Consider using an [ActionMenu](/components/alpha/actionmenu) instead of using this feature directly."
|
51
|
+
},
|
46
52
|
{
|
47
53
|
"name": "system_arguments",
|
48
54
|
"type": "Hash",
|
@@ -73,6 +79,17 @@
|
|
73
79
|
}
|
74
80
|
]
|
75
81
|
},
|
82
|
+
{
|
83
|
+
"component": "ActionList::FormWrapper",
|
84
|
+
"status": "alpha",
|
85
|
+
"a11y_reviewed": false,
|
86
|
+
"short_name": "ActionListFormWrapper",
|
87
|
+
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/alpha/action_list/form_wrapper.rb",
|
88
|
+
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/alpha/action_list/form_wrapper/default/",
|
89
|
+
"parameters": [
|
90
|
+
|
91
|
+
]
|
92
|
+
},
|
76
93
|
{
|
77
94
|
"component": "ActionList::Heading",
|
78
95
|
"status": "alpha",
|
@@ -169,6 +186,12 @@
|
|
169
186
|
"default": "`{}`",
|
170
187
|
"description": "[System arguments](/system-arguments) used to construct the item's anchor or button tag."
|
171
188
|
},
|
189
|
+
{
|
190
|
+
"name": "form_arguments",
|
191
|
+
"type": "Hash",
|
192
|
+
"default": "`{}`",
|
193
|
+
"description": "Allows the item to submit a form on click. The URL passed in the `href:` option will be used as the form action. Pass the `method:` option to this hash to control what kind of request is made, One of `:delete`, `:get`, `:head`, `:patch`, `:post`, or `:put`. The `name:` option is required and specifies the desired name of the field that will be included in the params sent to the server on form submission. Specify the `value:` option to send a custom value to the server; otherwise the value of `name:` is sent."
|
194
|
+
},
|
172
195
|
{
|
173
196
|
"name": "truncate_label",
|
174
197
|
"type": "Boolean",
|
@@ -263,6 +286,12 @@
|
|
263
286
|
"default": "`:outside_bottom`",
|
264
287
|
"description": "One of `:inside_bottom`, `:inside_center`, `:inside_left`, `:inside_right`, `:inside_top`, `:outside_bottom`, `:outside_left`, `:outside_right`, or `:outside_top`.."
|
265
288
|
},
|
289
|
+
{
|
290
|
+
"name": "size",
|
291
|
+
"type": "Symbol",
|
292
|
+
"default": "`:auto`",
|
293
|
+
"description": "One of `:auto`, `:large`, `:medium`, `:medium_portrait`, `:small`, or `:xlarge`.."
|
294
|
+
},
|
266
295
|
{
|
267
296
|
"name": "src",
|
268
297
|
"type": "String",
|
@@ -291,7 +320,13 @@
|
|
291
320
|
"name": "select_variant",
|
292
321
|
"type": "Symbol",
|
293
322
|
"default": "`:none`",
|
294
|
-
"description": "
|
323
|
+
"description": "One of `:multiple`, `:none`, or `:single`."
|
324
|
+
},
|
325
|
+
{
|
326
|
+
"name": "form_arguments",
|
327
|
+
"type": "Hash",
|
328
|
+
"default": "`{}`",
|
329
|
+
"description": "Allows an `ActionMenu` to act as a select list in multi- and single-select modes. Pass the `builder:` and `name:` options to this hash. `builder:` should be an instance of `ActionView::Helpers::FormBuilder`, which are created by the standard Rails `#form_with` and `#form_for` helpers. The `name:` option is the desired name of the field that will be included in the params sent to the server on form submission."
|
295
330
|
},
|
296
331
|
{
|
297
332
|
"name": "system_arguments",
|
@@ -319,7 +354,7 @@
|
|
319
354
|
"name": "system_arguments",
|
320
355
|
"type": "Hash",
|
321
356
|
"default": "N/A",
|
322
|
-
"description": "
|
357
|
+
"description": "The arguments accepted by [ActionList](/components/alpha/actionlist)"
|
323
358
|
}
|
324
359
|
]
|
325
360
|
},
|
data/static/audited_at.json
CHANGED
data/static/constants.json
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
"DEFAULT_SCHEME": "full",
|
6
6
|
"DEFAULT_SELECT_VARIANT": "none",
|
7
7
|
"Divider": "Primer::Alpha::ActionList::Divider",
|
8
|
+
"FormWrapper": "Primer::Alpha::ActionList::FormWrapper",
|
8
9
|
"Heading": "Primer::Alpha::ActionList::Heading",
|
9
10
|
"Item": "Primer::Alpha::ActionList::Item",
|
10
11
|
"MENU_ROLE": "menu",
|
@@ -39,6 +40,17 @@
|
|
39
40
|
"filled"
|
40
41
|
]
|
41
42
|
},
|
43
|
+
"Primer::Alpha::ActionList::FormWrapper": {
|
44
|
+
"DEFAULT_HTTP_METHOD": "get",
|
45
|
+
"HTTP_METHOD_OPTIONS": [
|
46
|
+
"get",
|
47
|
+
"post",
|
48
|
+
"patch",
|
49
|
+
"put",
|
50
|
+
"delete",
|
51
|
+
"head"
|
52
|
+
]
|
53
|
+
},
|
42
54
|
"Primer::Alpha::ActionList::Heading": {
|
43
55
|
"DEFAULT_SCHEME": "subtle",
|
44
56
|
"HEADING_LEVELS": [
|
@@ -623,7 +635,12 @@
|
|
623
635
|
]
|
624
636
|
},
|
625
637
|
"Primer::Beta::AutoComplete::Item": {
|
626
|
-
"
|
638
|
+
"DEFAULT_DESCRIPTION_VARIANT": "block",
|
639
|
+
"DESCRIPTION_VARIANT_MAPPINGS": {
|
640
|
+
"inline": "ActionListItem-descriptionWrap--inline",
|
641
|
+
"block": "ActionListItem-descriptionWrap"
|
642
|
+
},
|
643
|
+
"DESCRIPTION_VARIANT_OPTIONS": [
|
627
644
|
"inline",
|
628
645
|
"block"
|
629
646
|
]
|