openproject-primer_view_components 0.28.1 → 0.29.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_bar.css +1 -1
- data/app/components/primer/alpha/action_bar.css.map +1 -1
- data/app/components/primer/alpha/action_list/item.html.erb +1 -1
- 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/auto_complete.css +1 -1
- data/app/components/primer/alpha/auto_complete.css.map +1 -1
- data/app/components/primer/alpha/banner.css +1 -1
- data/app/components/primer/alpha/banner.css.map +1 -1
- data/app/components/primer/alpha/button_marketing.css +1 -1
- data/app/components/primer/alpha/button_marketing.css.map +1 -1
- data/app/components/primer/alpha/dialog.css +1 -1
- data/app/components/primer/alpha/dialog.css.map +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/layout.css +1 -1
- data/app/components/primer/alpha/layout.css.map +1 -1
- data/app/components/primer/alpha/menu.css +1 -1
- data/app/components/primer/alpha/menu.css.map +1 -1
- data/app/components/primer/alpha/segmented_control.css +1 -1
- data/app/components/primer/alpha/segmented_control.css.json +2 -0
- data/app/components/primer/alpha/segmented_control.css.map +1 -1
- data/app/components/primer/alpha/segmented_control.pcss +13 -0
- 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/text_field.css +1 -1
- data/app/components/primer/alpha/text_field.css.map +1 -1
- 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/underline_nav.css +1 -1
- data/app/components/primer/alpha/underline_nav.css.map +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_stack.css +1 -1
- data/app/components/primer/beta/avatar_stack.css.map +1 -1
- data/app/components/primer/beta/blankslate.css +1 -1
- data/app/components/primer/beta/blankslate.css.map +1 -1
- 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/breadcrumbs.css +1 -1
- data/app/components/primer/beta/breadcrumbs.css.map +1 -1
- data/app/components/primer/beta/button.css +1 -1
- data/app/components/primer/beta/button.css.json +8 -0
- data/app/components/primer/beta/button.css.map +1 -1
- data/app/components/primer/beta/button.pcss +42 -0
- data/app/components/primer/beta/button.rb +5 -1
- data/app/components/primer/beta/button_group.css +1 -1
- data/app/components/primer/beta/button_group.css.map +1 -1
- data/app/components/primer/beta/counter.css +1 -1
- data/app/components/primer/beta/counter.css.map +1 -1
- data/app/components/primer/beta/flash.css +1 -1
- data/app/components/primer/beta/flash.css.map +1 -1
- data/app/components/primer/beta/label.css +1 -1
- data/app/components/primer/beta/label.css.map +1 -1
- data/app/components/primer/beta/link.css +1 -1
- data/app/components/primer/beta/link.css.map +1 -1
- data/app/components/primer/beta/popover.css +1 -1
- data/app/components/primer/beta/popover.css.map +1 -1
- data/app/components/primer/beta/progress_bar.css +1 -1
- data/app/components/primer/beta/progress_bar.css.map +1 -1
- data/app/components/primer/beta/state.css +1 -1
- data/app/components/primer/beta/state.css.map +1 -1
- data/app/components/primer/beta/subhead.css +1 -1
- data/app/components/primer/beta/subhead.css.map +1 -1
- 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/truncate.css +1 -1
- data/app/components/primer/beta/truncate.css.map +1 -1
- data/app/components/primer/open_project/border_grid.css +1 -1
- data/app/components/primer/open_project/border_grid.css.map +1 -1
- data/app/components/primer/open_project/drag_handle.css +1 -1
- data/app/components/primer/open_project/drag_handle.css.map +1 -1
- data/app/components/primer/open_project/page_header.css +1 -1
- data/app/components/primer/open_project/page_header.css.json +0 -1
- data/app/components/primer/open_project/page_header.css.map +1 -1
- data/app/components/primer/open_project/page_header.html.erb +3 -1
- data/app/components/primer/open_project/page_header.pcss +1 -12
- data/app/components/primer/open_project/page_header.rb +65 -33
- data/app/components/primer/open_project/zen_mode_button.html.erb +1 -0
- data/app/components/primer/open_project/zen_mode_button.rb +2 -0
- data/lib/primer/view_components/version.rb +1 -1
- data/previews/primer/alpha/action_list_preview.rb +1 -1
- data/previews/primer/alpha/select_preview.rb +3 -0
- data/previews/primer/beta/button_preview/label_wrap.html.erb +9 -0
- data/previews/primer/beta/button_preview/link_scheme_label_wrap.html.erb +8 -0
- data/previews/primer/beta/button_preview.rb +31 -2
- data/previews/primer/beta/nav_list_preview.rb +15 -1
- data/previews/primer/open_project/page_header_preview.rb +20 -5
- data/static/arguments.json +6 -0
- data/static/classes.json +3 -3
- data/static/constants.json +1 -1
- data/static/info_arch.json +60 -2
- data/static/previews.json +54 -2
- metadata +4 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["popover.pcss"],"names":[],"mappings":"AAEA,SACE,iBAAkB,CAClB,WACF,CAEA,iBAKE,
|
1
|
+
{"version":3,"sources":["popover.pcss"],"names":[],"mappings":"AAEA,SACE,iBAAkB,CAClB,WACF,CAEA,iBAKE,uCAAwC,CACxC,+DAAgE,CAChE,wCAAyC,CAGzC,4EAA+E,CAN/E,gBAAiB,CADjB,iBAAkB,CAFlB,iBAAkB,CAClB,WAgCF,CArBE,+CAKE,UAAW,CADX,oBAAqB,CADrB,QAAS,CADT,iBAIF,CAEA,wBAIE,sBAA+C,CAA/C,kDAA+C,CAF/C,gBAAiB,CADjB,SAIF,CAEA,uBAIE,sBAA2C,CAA3C,8CAA2C,CAF3C,gBAAiB,CADjB,SAIF,CAKA,mEAEE,YACF,CAOA,mNAGE,yBAAgC,CADhC,QAEF,CAEA,2GAEE,2CAA4C,CAD5C,YAEF,CAEA,wGAEE,uCAAwC,CADxC,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,4CAA6C,CAD7C,WAEF,CAEA,qGAEE,wCAAyC,CADzC,WAEF,CAOA,qGAEE,6CAA8C,CAD9C,UAEF,CAEA,kGAEE,yCAA0C,CAD1C,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,iCAAkC,CAJlC,UAAW,CADX,QAAS,CAIT,oBAEF,CAGA,8BACE,4DACF,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(--overlay-bgColor);\n border: var(--borderWidth-thin) solid var(--borderColor-default);\n border-radius: var(--borderRadius-medium);\n\n /* adding !important to override utility classes used in dotcom */\n box-shadow: var(--shadow-floating-legacy, var(--color-shadow-large)) !important;\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(--borderColor-default);\n }\n\n &::after {\n top: -14px;\n margin-left: -8px;\n border: 7px solid transparent;\n border-bottom-color: var(--overlay-bgColor);\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(--borderColor-default);\n }\n\n &::after {\n bottom: -14px;\n border-top-color: var(--overlay-bgColor);\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(--borderColor-default);\n }\n\n &::after {\n right: -14px;\n border-left-color: var(--overlay-bgColor);\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(--borderColor-default);\n }\n\n &::after {\n left: -14px;\n border-right-color: var(--overlay-bgColor);\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);\n }\n\n /* Increase tap area for touch input */\n .Popover-message > .btn-octicon {\n padding: var(--control-medium-paddingInline-normal) !important;\n }\n\n /* Remove caret */\n .Popover-message::after,\n .Popover-message::before {\n display: none;\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
.Progress{background-color:var(--bgColor-neutral-muted
|
1
|
+
.Progress{background-color:var(--bgColor-neutral-muted);border-radius:6px;display:flex;height:8px;outline:1px solid #0000;overflow:hidden}.Progress--large{height:10px}.Progress--small{height:5px}.Progress-item{outline:2px solid #0000}.Progress-item+.Progress-item{margin-left:2px}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["progress_bar.pcss"],"names":[],"mappings":"AAEA,UAIE,
|
1
|
+
{"version":3,"sources":["progress_bar.pcss"],"names":[],"mappings":"AAEA,UAIE,6CAA8C,CAC9C,iBAAkB,CAJlB,YAAa,CACb,UAAW,CAIX,uBAA8B,CAH9B,eAIF,CAEA,iBACE,WACF,CAEA,iBACE,UACF,CAEA,eACE,uBACF,CAEA,8BACE,eACF","file":"progress_bar.css","sourcesContent":["/* Progress */\n\n.Progress {\n display: flex;\n height: 8px;\n overflow: hidden;\n background-color: var(--bgColor-neutral-muted);\n border-radius: 6px;\n outline: 1px solid transparent; /* Support Firefox custom colors */\n}\n\n.Progress--large {\n height: 10px;\n}\n\n.Progress--small {\n height: 5px;\n}\n\n.Progress-item {\n outline: 2px solid transparent; /* Support Firefox custom colors */\n}\n\n.Progress-item + .Progress-item {\n margin-left: 2px;\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
.State,.state{border-radius:2em;display:inline-block;font-size:var(--text-body-size-medium
|
1
|
+
.State,.state{border-radius:2em;display:inline-block;font-size:var(--text-body-size-medium);font-weight:var(--base-text-weight-medium);line-height:var(--control-medium-lineBoxHeight);padding:5px var(--control-medium-paddingInline-normal);text-align:center;white-space:nowrap}.State,.State--draft,.state{background-color:var(--bgColor-neutral-emphasis);border:var(--borderWidth-thin) solid #0000;color:var(--fgColor-onEmphasis)}.State--open{background-color:var(--bgColor-open-emphasis,var(--color-open-emphasis))}.State--merged,.State--open{color:var(--fgColor-onEmphasis)}.State--merged{background-color:var(--bgColor-done-emphasis,var(--color-done-emphasis))}.State--closed{background-color:var(--bgColor-closed-emphasis,var(--color-closed-emphasis));color:var(--fgColor-onEmphasis)}.State--small{font-size:var(--text-body-size-small);line-height:var(--base-size-24);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,sCAAuC,CACvC,0CAA2C,CAC3C,+CAAgD,CAHhD,sDAAuD,CAIvD,iBAAkB,CAClB,kBAEF,CAEA,4BAIE,gDAAiD,CACjD,0CAAiD,CAFjD,+BAGF,CAEA,aAEE,wEACF,CAEA,4BAJE,+BAOF,CAHA,eAEE,wEACF,CAEA,eAEE,4EAA8E,CAD9E,+BAEF,CAIA,cAEE,qCAAsC,CACtC,+BAAgC,CAFhC,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);\n font-size: var(--text-body-size-medium);\n font-weight: var(--base-text-weight-medium);\n line-height: var(--control-medium-lineBoxHeight);\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(--fgColor-onEmphasis);\n background-color: var(--bgColor-neutral-emphasis);\n border: var(--borderWidth-thin) solid transparent;\n}\n\n.State--open {\n color: var(--fgColor-onEmphasis);\n background-color: var(--bgColor-open-emphasis, var(--color-open-emphasis));\n}\n\n.State--merged {\n color: var(--fgColor-onEmphasis);\n background-color: var(--bgColor-done-emphasis, var(--color-done-emphasis));\n}\n\n.State--closed {\n color: var(--fgColor-onEmphasis);\n background-color: var(--bgColor-closed-emphasis, 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);\n line-height: var(--base-size-24);\n\n & .octicon {\n width: 1em; /* Ensures different icons don't change State indicator width */\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
.Subhead{border-bottom:var(--borderWidth-thin
|
1
|
+
.Subhead{border-bottom:var(--borderWidth-thin) solid var(--borderColor-muted);display:flex;flex-flow:row wrap;justify-content:flex-end;margin-bottom:var(--stack-gap-normal);padding-bottom:var(--stack-padding-condensed)}.Subhead--spacious{margin-top:var(--base-size-40)}.Subhead-heading{flex:1 1 auto;font-weight:var(--base-text-weight-normal);order:0}.Subhead-heading--large{font-size:var(--base-size-24)}.Subhead-heading--medium{font-size:var(--text-title-size-medium)}.Subhead-heading--danger{color:var(--fgColor-danger);font-weight:var(--base-text-weight-semibold)}.Subhead-description{color:var(--fgColor-muted);flex:1 100%;font-size:var(--text-body-size-medium);order:2}.Subhead-actions{align-self:center;justify-content:flex-end;margin:var(--base-size-4) 0 var(--base-size-4) var(--base-size-4);order:1}.Subhead-actions+.Subhead-description{margin-top:var(--base-size-4)}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["subhead.pcss"],"names":[],"mappings":"AAEA,SAIE,
|
1
|
+
{"version":3,"sources":["subhead.pcss"],"names":[],"mappings":"AAEA,SAIE,oEAAqE,CAHrE,YAAa,CAIb,kBAAmB,CACnB,wBAAyB,CAHzB,qCAAsC,CADtC,6CAKF,CAGA,mBACE,8BACF,CAGA,iBAEE,aAAc,CADd,0CAA2C,CAE3C,OACF,CAEA,wBACE,6BACF,CAEA,yBACE,uCACF,CAGA,yBAEE,2BAA4B,CAD5B,4CAEF,CAGA,qBAEE,0BAA2B,CAC3B,WAAY,CAFZ,sCAAuC,CAGvC,OACF,CAGA,iBAEE,iBAAkB,CAClB,wBAAyB,CAFzB,iEAAkE,CAGlE,OAKF,CAHE,sCACE,6BACF","file":"subhead.css","sourcesContent":["/* Subhead */\n\n.Subhead {\n display: flex;\n padding-bottom: var(--stack-padding-condensed);\n margin-bottom: var(--stack-gap-normal);\n border-bottom: var(--borderWidth-thin) solid var(--borderColor-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);\n}\n\n/* <h2> sized heading with normal font weight */\n.Subhead-heading {\n font-weight: var(--base-text-weight-normal);\n flex: 1 1 auto;\n order: 0;\n}\n\n.Subhead-heading--large {\n font-size: var(--base-size-24);\n}\n\n.Subhead-heading--medium {\n font-size: var(--text-title-size-medium);\n}\n\n/* Make the text bold and red for dangerous content */\n.Subhead-heading--danger {\n font-weight: var(--base-text-weight-semibold);\n color: var(--fgColor-danger);\n}\n\n/* One-liner of supporting text */\n.Subhead-description {\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-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) 0 var(--base-size-4) var(--base-size-4);\n align-self: center;\n justify-content: flex-end;\n order: 1;\n\n & + .Subhead-description {\n margin-top: var(--base-size-4);\n }\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
.TimelineItem{display:flex;margin-left:var(--stack-gap-normal
|
1
|
+
.TimelineItem{display:flex;margin-left:var(--stack-gap-normal);padding:var(--stack-padding-normal) 0;position:relative}.TimelineItem:before{background-color:var(--borderColor-muted);bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:var(--borderWidth-thick)}.TimelineItem:target .TimelineItem-badge{border-color:var(--borderColor-accent-emphasis);box-shadow:0 0 .2em var(--borderColor-accent-muted)}.TimelineItem-badge{align-items:center;background-color:var(--timelineBadge-bgColor);border:var(--borderWidth-thick) solid var(--bgColor-default);border-radius:50%;color:var(--fgColor-muted);display:flex;flex-shrink:0;height:var(--control-medium-size);justify-content:center;margin-left:calc(var(--control-medium-size)/-2 + 1px);margin-right:var(--controlStack-medium-gap-condensed);position:relative;width:var(--control-medium-size);z-index:1}.TimelineItem-badge--success{background-color:var(--bgColor-success-emphasis);border:var(--borderWidth-thin) solid #0000;color:var(--fgColor-onEmphasis)}.TimelineItem-body{color:var(--fgColor-muted);flex:auto;margin-top:var(--base-size-4);max-width:100%;min-width:0}.TimelineItem-avatar{left:-72px;position:absolute;z-index:1}.TimelineItem-break{background-color:var(--bgColor-default);border:0;border-top:var(--borderWidth-thicker) solid var(--borderColor-default);height:var(--stack-gap-spacious);margin:0;margin-bottom:calc(var(--stack-gap-normal)*-1);margin-left:-56px;position:relative;z-index:1}.TimelineItem--condensed{padding-bottom:0;padding-top:var(--base-size-4)}.TimelineItem--condensed:last-child{padding-bottom:var(--stack-gap-normal)}.TimelineItem--condensed .TimelineItem-badge{background-color:var(--bgColor-default);border:0;color:var(--fgColor-muted);height:var(--base-size-16);margin-bottom:var(--base-size-8);margin-top:var(--base-size-8)}
|
@@ -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,mCAAoC,CADpC,qCAAsC,CAFtC,iBAqBF,CAfE,qBAQE,yCAA0C,CAL1C,QAAS,CAIT,UAAW,CAFX,aAAc,CADd,MAAO,CAHP,iBAAkB,CAClB,KAAM,CAIN,8BAGF,CAEA,yCACE,+CAAgD,CAChD,mDACF,CAGF,oBASE,kBAAmB,CACnB,6CAA8C,CAC9C,4DAA6D,CAC7D,iBAAkB,CAJlB,0BAA2B,CAL3B,YAAa,CAWb,aAAc,CATd,iCAAkC,CAQlC,sBAAuB,CANvB,qDAAwD,CADxD,qDAAsD,CALtD,iBAAkB,CAGlB,gCAAiC,CAFjC,SAaF,CAEA,6BAEE,gDAAiD,CACjD,0CAAiD,CAFjD,+BAGF,CAEA,mBAIE,0BAA2B,CAC3B,SAAU,CAFV,6BAA8B,CAD9B,cAAe,CADf,WAKF,CAEA,qBAEE,UAAW,CADX,iBAAkB,CAElB,SACF,CAEA,oBAOE,uCAAwC,CACxC,QAAS,CACT,sEAAuE,CANvE,gCAAiC,CACjC,QAAS,CACT,8CAAiD,CACjD,iBAAkB,CALlB,iBAAkB,CAClB,SAQF,CAEA,yBAEE,gBAAiB,CADjB,8BAgBF,CAZE,oCACE,sCACF,CAEA,6CAKE,uCAAwC,CACxC,QAAS,CAFT,0BAA2B,CAH3B,0BAA2B,CAE3B,gCAAiC,CADjC,6BAKF","file":"timeline_item.css","sourcesContent":["/* TimelineItem */\n\n.TimelineItem {\n position: relative;\n display: flex;\n padding: var(--stack-padding-normal) 0;\n margin-left: var(--stack-gap-normal);\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);\n content: '';\n background-color: var(--borderColor-muted);\n }\n\n &:target .TimelineItem-badge {\n border-color: var(--borderColor-accent-emphasis);\n box-shadow: 0 0 0.2em var(--borderColor-accent-muted);\n }\n}\n\n.TimelineItem-badge {\n position: relative;\n z-index: 1;\n display: flex;\n width: var(--control-medium-size);\n height: var(--control-medium-size);\n margin-right: var(--controlStack-medium-gap-condensed);\n margin-left: calc(var(--control-medium-size) / -2 + 1px);\n color: var(--fgColor-muted);\n align-items: center;\n background-color: var(--timelineBadge-bgColor);\n border: var(--borderWidth-thick) solid var(--bgColor-default);\n border-radius: 50%;\n justify-content: center;\n flex-shrink: 0;\n}\n\n.TimelineItem-badge--success {\n color: var(--fgColor-onEmphasis);\n background-color: var(--bgColor-success-emphasis);\n border: var(--borderWidth-thin) solid transparent;\n}\n\n.TimelineItem-body {\n min-width: 0;\n max-width: 100%;\n margin-top: var(--base-size-4);\n color: var(--fgColor-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);\n margin: 0;\n margin-bottom: calc(var(--stack-gap-normal) * -1);\n margin-left: -56px;\n background-color: var(--bgColor-default);\n border: 0;\n border-top: var(--borderWidth-thicker) solid var(--borderColor-default);\n}\n\n.TimelineItem--condensed {\n padding-top: var(--base-size-4);\n padding-bottom: 0;\n\n /* TimelineItem--condensed is often grouped. (commits) */\n &:last-child {\n padding-bottom: var(--stack-gap-normal);\n }\n\n & .TimelineItem-badge {\n height: var(--base-size-16);\n margin-top: var(--base-size-8);\n margin-bottom: var(--base-size-8);\n color: var(--fgColor-muted);\n background-color: var(--bgColor-default);\n border: 0;\n }\n}\n"]}
|
@@ -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(--control-small-gap
|
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)}.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,oCACF,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);\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"]}
|
@@ -1 +1 @@
|
|
1
|
-
.BorderGrid{border-collapse:collapse;border-style:hidden;display:table;margin-bottom:-16px;margin-top:-16px;table-layout:fixed;width:100%}.BorderGrid .BorderGrid-cell{padding-bottom:16px;padding-top:16px}.BorderGrid--spacious{margin-bottom:-24px;margin-top:-24px}.BorderGrid--spacious .BorderGrid-cell{padding-bottom:24px;padding-top:24px}.BorderGrid-row{display:table-row}.BorderGrid-cell{border:1px solid var(--borderColor-muted
|
1
|
+
.BorderGrid{border-collapse:collapse;border-style:hidden;display:table;margin-bottom:-16px;margin-top:-16px;table-layout:fixed;width:100%}.BorderGrid .BorderGrid-cell{padding-bottom:16px;padding-top:16px}.BorderGrid--spacious{margin-bottom:-24px;margin-top:-24px}.BorderGrid--spacious .BorderGrid-cell{padding-bottom:24px;padding-top:24px}.BorderGrid-row{display:table-row}.BorderGrid-cell{border:1px solid var(--borderColor-muted);display:table-cell}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["border_grid.pcss"],"names":[],"mappings":"AAEA,YAMI,wBAAyB,CACzB,mBAAmB,CANnB,aAAc,CAGd,mBAAoB,CADpB,gBAAiB,CAEjB,kBAAmB,CAHnB,UAMJ,CAEA,6BAEI,mBAAmB,CADnB,gBAEJ,CAEA,sBAEI,mBAAmB,CADnB,gBAEJ,CAEA,uCAEI,mBAAmB,CADnB,gBAEJ,CAEA,gBACI,iBACJ,CAEA,iBAEI,
|
1
|
+
{"version":3,"sources":["border_grid.pcss"],"names":[],"mappings":"AAEA,YAMI,wBAAyB,CACzB,mBAAmB,CANnB,aAAc,CAGd,mBAAoB,CADpB,gBAAiB,CAEjB,kBAAmB,CAHnB,UAMJ,CAEA,6BAEI,mBAAmB,CADnB,gBAEJ,CAEA,sBAEI,mBAAmB,CADnB,gBAEJ,CAEA,uCAEI,mBAAmB,CADnB,gBAEJ,CAEA,gBACI,iBACJ,CAEA,iBAEI,yCAAyC,CADzC,kBAEJ","file":"border_grid.css","sourcesContent":["/* CSS for BorderGrid */\n\n.BorderGrid {\n display: table;\n width: 100%;\n margin-top: -16px;\n margin-bottom: -16px;\n table-layout: fixed;\n border-collapse: collapse;\n border-style: hidden\n}\n\n.BorderGrid .BorderGrid-cell {\n padding-top: 16px;\n padding-bottom: 16px\n}\n\n.BorderGrid--spacious {\n margin-top: -24px;\n margin-bottom: -24px\n}\n\n.BorderGrid--spacious .BorderGrid-cell {\n padding-top: 24px;\n padding-bottom: 24px\n}\n\n.BorderGrid-row {\n display: table-row\n}\n\n.BorderGrid-cell {\n display: table-cell;\n border: 1px solid var(--borderColor-muted)\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
.DragHandle{color:var(--fgColor-muted
|
1
|
+
.DragHandle{color:var(--fgColor-muted);cursor:move}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["drag_handle.pcss"],"names":[],"mappings":"AAEA,YAEI,
|
1
|
+
{"version":3,"sources":["drag_handle.pcss"],"names":[],"mappings":"AAEA,YAEI,0BAA2B,CAD3B,WAEJ","file":"drag_handle.css","sourcesContent":["/* CSS for DragHandle */\n\n.DragHandle {\n cursor: move;\n color: var(--fgColor-muted);\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
.PageHeader{border-bottom:var(--borderWidth-thin
|
1
|
+
.PageHeader{border-bottom:var(--borderWidth-thin) solid var(--borderColor-muted);display:flex;flex-flow:column;margin-bottom:var(--stack-gap-normal);padding-bottom:var(--stack-padding-condensed)}.PageHeader-contextBar{margin-bottom:var(--base-size-8)}.PageHeader-contextBar,.PageHeader-titleBar{align-items:center;display:flex;flex-flow:row;justify-content:flex-end}.PageHeader-titleBar{margin-bottom:var(--space-xsmall)}.PageHeader-title{flex:1 1 auto;font-size:var(--text-title-size-medium);font-weight:var(--base-text-weight-normal)}.PageHeader-title--large{font-size:var(--text-title-size-large)}.PageHeader-description{color:var(--fgColor-muted);flex:1 100%;font-size:var(--text-body-size-medium)}.PageHeader-actions{align-items:center;display:flex;justify-content:flex-end}.PageHeader-breadcrumbs{display:block;width:100%}.PageHeader-leadingAction{margin-right:var(--base-size-4);margin-top:2px}.PageHeader-parentLink{flex:1 1 auto}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["page_header.pcss"],"names":[],"mappings":"AAEA,YAIE,
|
1
|
+
{"version":3,"sources":["page_header.pcss"],"names":[],"mappings":"AAEA,YAIE,oEAAqE,CAHrE,YAAa,CAIb,gBAAiB,CAFjB,qCAAsC,CADtC,6CAIF,CAEA,uBAKE,gCACF,CAEA,4CAJE,kBAAmB,CAHnB,YAAa,CACb,aAAc,CACd,wBAWF,CANA,qBAKE,iCACF,CAEA,kBAGE,aAAc,CAFd,uCAAwC,CACxC,0CAEF,CAEA,yBACE,sCACF,CAGA,wBAEE,0BAA2B,CAC3B,WAAY,CAFZ,sCAGF,CAEA,oBAGE,kBAAmB,CADnB,YAAa,CADb,wBAGF,CAEA,wBACE,aAAc,CACd,UACF,CAEA,0BAEE,+BAAgC,CADhC,cAEF,CAEA,uBACE,aACF","file":"page_header.css","sourcesContent":["/* OP PageHeader */\n\n.PageHeader {\n display: flex;\n padding-bottom: var(--stack-padding-condensed);\n margin-bottom: var(--stack-gap-normal);\n border-bottom: var(--borderWidth-thin) solid var(--borderColor-muted);\n flex-flow: column;\n}\n\n.PageHeader-contextBar {\n display: flex;\n flex-flow: row;\n justify-content: flex-end;\n align-items: center;\n margin-bottom: var(--base-size-8);\n}\n\n.PageHeader-titleBar {\n display: flex;\n flex-flow: row;\n justify-content: flex-end;\n align-items: center; /* Keep back button vertically aligned. */\n margin-bottom: var(--space-xsmall);\n}\n\n.PageHeader-title {\n font-size: var(--text-title-size-medium);\n font-weight: var(--base-text-weight-normal);\n flex: 1 1 auto;\n}\n\n.PageHeader-title--large {\n font-size: var(--text-title-size-large);\n}\n\n/* One-liner of supporting text */\n.PageHeader-description {\n font-size: var(--text-body-size-medium);\n color: var(--fgColor-muted);\n flex: 1 100%;\n}\n\n.PageHeader-actions {\n justify-content: flex-end;\n display: flex;\n align-items: center;\n}\n\n.PageHeader-breadcrumbs {\n display: block;\n width: 100%;\n}\n\n.PageHeader-leadingAction {\n margin-top: 2px; /* to center align with label */\n margin-right: var(--base-size-4);\n}\n\n.PageHeader-parentLink {\n flex: 1 1 auto;\n}\n"]}
|
@@ -5,9 +5,11 @@
|
|
5
5
|
<%= breadcrumbs %>
|
6
6
|
<% if render_mobile_menu? %>
|
7
7
|
<%= render(@mobile_action_menu) do |menu| %>
|
8
|
-
<% menu.with_show_button(icon: :"kebab-horizontal", "aria-label": @mobile_menu_label) %>
|
8
|
+
<% menu.with_show_button(icon: :"kebab-horizontal", size: :small, "aria-label": @mobile_menu_label) %>
|
9
9
|
<% @desktop_menu_block.call(menu) unless @desktop_menu_block.nil? %>
|
10
10
|
<% end %>
|
11
|
+
<% elsif actions.length == 1 && @mobile_action.present? %>
|
12
|
+
<%= render(@mobile_action) { |el| @mobile_action_block.call(el) unless @mobile_action_block.nil?} %>
|
11
13
|
<% end %>
|
12
14
|
</div>
|
13
15
|
<% end %>
|
@@ -13,6 +13,7 @@
|
|
13
13
|
flex-flow: row;
|
14
14
|
justify-content: flex-end;
|
15
15
|
align-items: center;
|
16
|
+
margin-bottom: var(--base-size-8);
|
16
17
|
}
|
17
18
|
|
18
19
|
.PageHeader-titleBar {
|
@@ -46,21 +47,9 @@
|
|
46
47
|
align-items: center;
|
47
48
|
}
|
48
49
|
|
49
|
-
.PageHeader--singleAction .PageHeader-action {
|
50
|
-
@media (max-width: 543.98px) {
|
51
|
-
position: absolute;
|
52
|
-
top: 10px;
|
53
|
-
|
54
|
-
/* Normally, the actions are hidden on mobile, except for this special case of a single action */
|
55
|
-
display: flex !important;
|
56
|
-
}
|
57
|
-
}
|
58
|
-
|
59
50
|
.PageHeader-breadcrumbs {
|
60
51
|
display: block;
|
61
52
|
width: 100%;
|
62
|
-
margin-bottom: var(--base-size-8);
|
63
|
-
padding-bottom: var(--base-size-4);
|
64
53
|
}
|
65
54
|
|
66
55
|
.PageHeader-leadingAction {
|
@@ -21,7 +21,7 @@ module Primer
|
|
21
21
|
].freeze
|
22
22
|
|
23
23
|
DEFAULT_ACTION_SCHEME = :default
|
24
|
-
|
24
|
+
MOBILE_ACTIONS_DISPLAY = [:flex, :none].freeze
|
25
25
|
|
26
26
|
DEFAULT_LEADING_ACTION_DISPLAY = [:none, :flex].freeze
|
27
27
|
DEFAULT_BREADCRUMBS_DISPLAY = [:none, :flex].freeze
|
@@ -47,6 +47,7 @@ module Primer
|
|
47
47
|
# Optional description below the title row
|
48
48
|
renders_one :description, lambda { |**system_arguments|
|
49
49
|
deny_tag_argument(**system_arguments)
|
50
|
+
|
50
51
|
system_arguments[:tag] = :div
|
51
52
|
system_arguments[:classes] = class_names(system_arguments[:classes], "PageHeader-description")
|
52
53
|
|
@@ -57,33 +58,45 @@ module Primer
|
|
57
58
|
#
|
58
59
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
59
60
|
renders_many :actions, types: {
|
60
|
-
icon_button: lambda { |icon:, mobile_icon:, label:, scheme: DEFAULT_ACTION_SCHEME, **system_arguments|
|
61
|
+
icon_button: lambda { |icon:, mobile_icon:, label:, scheme: DEFAULT_ACTION_SCHEME, **system_arguments, &block|
|
61
62
|
deny_tag_argument(**system_arguments)
|
63
|
+
|
64
|
+
system_arguments[:icon] = icon
|
65
|
+
system_arguments[:"aria-label"] ||= label
|
62
66
|
system_arguments = set_action_arguments(system_arguments, scheme: scheme)
|
63
|
-
add_option_to_mobile_menu(system_arguments, mobile_icon, label, scheme)
|
64
67
|
|
65
|
-
Primer::Beta::IconButton
|
68
|
+
component = Primer::Beta::IconButton
|
69
|
+
create_mobile_alternatives(component, mobile_icon, label, scheme, **system_arguments, &block)
|
70
|
+
|
71
|
+
component.new(**system_arguments)
|
66
72
|
},
|
67
|
-
button: lambda { |mobile_icon:, mobile_label:, scheme: DEFAULT_ACTION_SCHEME, **system_arguments|
|
73
|
+
button: lambda { |mobile_icon:, mobile_label:, scheme: DEFAULT_ACTION_SCHEME, **system_arguments, &block|
|
68
74
|
deny_tag_argument(**system_arguments)
|
75
|
+
|
69
76
|
system_arguments = set_action_arguments(system_arguments, scheme: scheme)
|
70
|
-
add_option_to_mobile_menu(system_arguments, mobile_icon, mobile_label, scheme)
|
71
77
|
|
72
|
-
Primer::Beta::Button
|
78
|
+
component = Primer::Beta::Button
|
79
|
+
create_mobile_alternatives(component, mobile_icon, mobile_label, scheme, **system_arguments, &block)
|
80
|
+
|
81
|
+
component.new(**system_arguments)
|
73
82
|
},
|
74
|
-
zen_mode_button: lambda { |mobile_icon: Primer::OpenProject::ZenModeButton::ZEN_MODE_BUTTON_ICON, mobile_label: Primer::OpenProject::ZenModeButton::ZEN_MODE_BUTTON_LABEL, **system_arguments|
|
83
|
+
zen_mode_button: lambda { |mobile_icon: Primer::OpenProject::ZenModeButton::ZEN_MODE_BUTTON_ICON, mobile_label: Primer::OpenProject::ZenModeButton::ZEN_MODE_BUTTON_LABEL, **system_arguments, &block|
|
75
84
|
deny_tag_argument(**system_arguments)
|
85
|
+
|
76
86
|
system_arguments = set_action_arguments(system_arguments, scheme: DEFAULT_ACTION_SCHEME)
|
77
|
-
add_option_to_mobile_menu(system_arguments, mobile_icon, mobile_label, DEFAULT_ACTION_SCHEME)
|
78
87
|
|
79
|
-
Primer::OpenProject::ZenModeButton
|
88
|
+
component = Primer::OpenProject::ZenModeButton
|
89
|
+
create_mobile_alternatives(component, mobile_icon, mobile_label, DEFAULT_ACTION_SCHEME, **system_arguments, &block)
|
90
|
+
|
91
|
+
component.new(**system_arguments)
|
80
92
|
},
|
81
93
|
|
82
94
|
link: lambda { |mobile_icon:, mobile_label:, scheme: DEFAULT_ACTION_SCHEME, **system_arguments|
|
83
95
|
deny_tag_argument(**system_arguments)
|
84
|
-
system_arguments[:target] ||= "_top"
|
85
96
|
|
97
|
+
system_arguments[:target] ||= "_top"
|
86
98
|
system_arguments = set_action_arguments(system_arguments, scheme: scheme)
|
99
|
+
|
87
100
|
add_option_to_mobile_menu(system_arguments, mobile_icon, mobile_label, scheme)
|
88
101
|
|
89
102
|
Primer::Beta::Link.new(**system_arguments)
|
@@ -91,9 +104,7 @@ module Primer
|
|
91
104
|
# Should only be used rarely on a per-need basis
|
92
105
|
text: lambda { |**system_arguments|
|
93
106
|
system_arguments = set_action_arguments(system_arguments)
|
94
|
-
|
95
107
|
system_arguments[:color] ||= :muted
|
96
|
-
|
97
108
|
# Enforce that texts are hidden on mobile
|
98
109
|
system_arguments[:display] = [:none, :flex]
|
99
110
|
|
@@ -102,25 +113,32 @@ module Primer
|
|
102
113
|
menu: {
|
103
114
|
renders: lambda { |**system_arguments, &block|
|
104
115
|
deny_tag_argument(**system_arguments)
|
105
|
-
|
116
|
+
|
117
|
+
system_arguments[:button_arguments] ||= {}
|
118
|
+
system_arguments[:button_arguments] = set_action_arguments(system_arguments[:button_arguments])
|
106
119
|
|
107
120
|
# Add the options individually to the mobile menu in the template
|
108
121
|
@desktop_menu_block = block
|
109
122
|
|
110
|
-
Primer::OpenProject::PageHeader::Menu
|
123
|
+
component = Primer::OpenProject::PageHeader::Menu
|
124
|
+
create_mobile_single_action(component, **system_arguments, &block)
|
125
|
+
|
126
|
+
component.new(**system_arguments)
|
111
127
|
},
|
112
128
|
},
|
113
129
|
dialog: {
|
114
|
-
renders: lambda { |mobile_icon:, mobile_label:, **system_arguments|
|
130
|
+
renders: lambda { |mobile_icon:, mobile_label:, **system_arguments, &block|
|
115
131
|
deny_tag_argument(**system_arguments)
|
116
132
|
|
117
133
|
# The id will be automatically calculated for the trigger button, so we have to behave the same, for the mobile click to work
|
134
|
+
system_arguments[:button_arguments] ||= {}
|
118
135
|
system_arguments[:button_arguments][:id] = "dialog-show-#{system_arguments[:dialog_arguments][:id]}"
|
119
|
-
|
120
136
|
system_arguments[:button_arguments] = set_action_arguments(system_arguments[:button_arguments])
|
121
|
-
add_option_to_mobile_menu(system_arguments[:button_arguments], mobile_icon, mobile_label, :default)
|
122
137
|
|
123
|
-
Primer::OpenProject::PageHeader::Dialog
|
138
|
+
component = Primer::OpenProject::PageHeader::Dialog
|
139
|
+
create_mobile_alternatives(component, mobile_icon, mobile_label, :default, **system_arguments, &block)
|
140
|
+
|
141
|
+
component.new(**system_arguments)
|
124
142
|
},
|
125
143
|
},
|
126
144
|
}
|
@@ -149,7 +167,7 @@ module Primer
|
|
149
167
|
#
|
150
168
|
# @param items [Array<String, Hash>] Items is an array of strings, hash {href, text} or an anchor tag string
|
151
169
|
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
152
|
-
renders_one :breadcrumbs, lambda { |items, **system_arguments|
|
170
|
+
renders_one :breadcrumbs, lambda { |items, selected_item_font_weight: :bold, **system_arguments|
|
153
171
|
system_arguments[:classes] = class_names(system_arguments[:classes], "PageHeader-breadcrumbs")
|
154
172
|
system_arguments[:display] ||= DEFAULT_BREADCRUMBS_DISPLAY
|
155
173
|
|
@@ -179,7 +197,7 @@ module Primer
|
|
179
197
|
item = anchor_string_to_object(item) if anchor_tag_string?(item)
|
180
198
|
|
181
199
|
if item.is_a?(String)
|
182
|
-
breadcrumbs.with_item(href: "#") { item }
|
200
|
+
breadcrumbs.with_item(href: "#", font_weight: selected_item_font_weight) { item }
|
183
201
|
else
|
184
202
|
breadcrumbs.with_item(href: item[:href], target: "_top") { item[:text] }
|
185
203
|
end
|
@@ -201,7 +219,7 @@ module Primer
|
|
201
219
|
)
|
202
220
|
|
203
221
|
@mobile_action_menu = Primer::Alpha::ActionMenu.new(
|
204
|
-
display:
|
222
|
+
display: MOBILE_ACTIONS_DISPLAY,
|
205
223
|
anchor_align: :end
|
206
224
|
)
|
207
225
|
end
|
@@ -213,24 +231,16 @@ module Primer
|
|
213
231
|
title? && breadcrumbs?
|
214
232
|
end
|
215
233
|
|
216
|
-
def before_render
|
217
|
-
@system_arguments[:classes] = class_names(
|
218
|
-
@system_arguments[:classes],
|
219
|
-
"PageHeader--singleAction": !render_mobile_menu?
|
220
|
-
)
|
221
|
-
|
222
|
-
content
|
223
|
-
end
|
224
|
-
|
225
234
|
def render_mobile_menu?
|
226
235
|
actions.count > 1
|
227
236
|
end
|
228
237
|
|
229
238
|
private
|
230
239
|
|
231
|
-
def set_action_arguments(system_arguments, scheme: nil)
|
240
|
+
def set_action_arguments(system_arguments, scheme: nil, button_action: false)
|
232
241
|
system_arguments[:ml] ||= 2
|
233
242
|
system_arguments[:display] = [:none, :flex]
|
243
|
+
system_arguments[:size] = :medium
|
234
244
|
system_arguments[:scheme] = scheme unless scheme.nil?
|
235
245
|
system_arguments[:classes] = class_names(
|
236
246
|
system_arguments[:classes],
|
@@ -241,12 +251,21 @@ module Primer
|
|
241
251
|
system_arguments
|
242
252
|
end
|
243
253
|
|
254
|
+
def create_mobile_alternatives(component, mobile_icon, mobile_label, scheme, **system_arguments, &block)
|
255
|
+
# All actions should collapse into a single actionMenu on mobile
|
256
|
+
add_option_to_mobile_menu(system_arguments, mobile_icon, mobile_label, scheme)
|
257
|
+
|
258
|
+
# Except for single actions, which remain as they are, just smaller.
|
259
|
+
create_mobile_single_action(component, **system_arguments, &block)
|
260
|
+
end
|
261
|
+
|
244
262
|
def add_option_to_mobile_menu(system_arguments, mobile_icon, mobile_label, scheme)
|
245
263
|
unless mobile_icon.nil? || mobile_label.nil?
|
246
264
|
# In action menus, only :default and :danger are allowed
|
247
265
|
scheme = DEFAULT_ACTION_SCHEME unless scheme == :danger
|
248
266
|
|
249
|
-
|
267
|
+
id = system_arguments[:button_arguments].present? ? system_arguments[:button_arguments][:id] : system_arguments[:id]
|
268
|
+
with_menu_item(id: id, label: mobile_label, scheme: scheme) do |c|
|
250
269
|
c.with_leading_visual_icon(icon: mobile_icon)
|
251
270
|
end
|
252
271
|
end
|
@@ -266,6 +285,19 @@ module Primer
|
|
266
285
|
)
|
267
286
|
end
|
268
287
|
|
288
|
+
def create_mobile_single_action(component, **system_arguments, &block)
|
289
|
+
# Single actions shall not collapse into an action menu on mobile, but keep their state.
|
290
|
+
# However the position and size will change
|
291
|
+
unless render_mobile_menu?
|
292
|
+
mobile_options = system_arguments[:button_arguments].present? ?
|
293
|
+
{ button_arguments: { display: MOBILE_ACTIONS_DISPLAY, size: :small } } :
|
294
|
+
{ display: MOBILE_ACTIONS_DISPLAY, size: :small }
|
295
|
+
|
296
|
+
@mobile_action = component.new(**system_arguments.deep_merge(mobile_options))
|
297
|
+
@mobile_action_block = block
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
269
301
|
# transform anchor tag strings to {href, text} objects
|
270
302
|
# e.g "\u003ca href=\"/admin\"\u003eAdministration\u003c/a\u003e"
|
271
303
|
def anchor_string_to_object(html_string)
|
@@ -11,6 +11,7 @@ module Primer
|
|
11
11
|
# @param label text
|
12
12
|
# @param caption text
|
13
13
|
# @param required toggle
|
14
|
+
# @param multiple toggle
|
14
15
|
# @param visually_hide_label toggle
|
15
16
|
# @param size [Symbol] select [small, medium, large]
|
16
17
|
# @param full_width toggle
|
@@ -24,6 +25,7 @@ module Primer
|
|
24
25
|
label: "Favorite place to visit",
|
25
26
|
caption: "They're all good",
|
26
27
|
required: false,
|
28
|
+
multiple: false,
|
27
29
|
visually_hide_label: false,
|
28
30
|
size: Primer::Forms::Dsl::Input::DEFAULT_SIZE.to_s,
|
29
31
|
full_width: true,
|
@@ -38,6 +40,7 @@ module Primer
|
|
38
40
|
label: label,
|
39
41
|
caption: caption,
|
40
42
|
required: required,
|
43
|
+
multiple: multiple,
|
41
44
|
visually_hide_label: visually_hide_label,
|
42
45
|
size: size,
|
43
46
|
full_width: full_width,
|
@@ -21,6 +21,7 @@ module Primer
|
|
21
21
|
# @param inactive toggle
|
22
22
|
# @param align_content select [center, start]
|
23
23
|
# @param tag select [a, summary, button]
|
24
|
+
# @param label_wrap toggle
|
24
25
|
def playground(
|
25
26
|
scheme: :default,
|
26
27
|
size: :medium,
|
@@ -29,7 +30,8 @@ module Primer
|
|
29
30
|
align_content: :center,
|
30
31
|
tag: :button,
|
31
32
|
disabled: false,
|
32
|
-
inactive: false
|
33
|
+
inactive: false,
|
34
|
+
label_wrap: false
|
33
35
|
)
|
34
36
|
render(Primer::Beta::Button.new(
|
35
37
|
scheme: scheme,
|
@@ -39,7 +41,8 @@ module Primer
|
|
39
41
|
align_content: align_content,
|
40
42
|
tag: tag,
|
41
43
|
disabled: disabled,
|
42
|
-
inactive: inactive
|
44
|
+
inactive: inactive,
|
45
|
+
label_wrap: label_wrap
|
43
46
|
)) do |_c|
|
44
47
|
"Button"
|
45
48
|
end
|
@@ -194,6 +197,26 @@ module Primer
|
|
194
197
|
end
|
195
198
|
end
|
196
199
|
|
200
|
+
# @label Label wrap
|
201
|
+
# @param scheme select [default, primary, danger, invisible, link]
|
202
|
+
# @param size select [small, medium]
|
203
|
+
# @param block toggle
|
204
|
+
# @param label_wrap toggle
|
205
|
+
# @snapshot
|
206
|
+
def label_wrap(
|
207
|
+
scheme: :default,
|
208
|
+
size: :medium,
|
209
|
+
block: false,
|
210
|
+
label_wrap: true
|
211
|
+
)
|
212
|
+
render_with_template(locals: {
|
213
|
+
scheme: scheme,
|
214
|
+
size: size,
|
215
|
+
block: block,
|
216
|
+
label_wrap: label_wrap
|
217
|
+
})
|
218
|
+
end
|
219
|
+
|
197
220
|
# @label Link as button
|
198
221
|
# @param scheme select [default, primary, danger, invisible, link]
|
199
222
|
# @param size select [small, medium]
|
@@ -361,6 +384,12 @@ module Primer
|
|
361
384
|
"Button"
|
362
385
|
end
|
363
386
|
end
|
387
|
+
|
388
|
+
# @label Link scheme with long label
|
389
|
+
# @snapshot
|
390
|
+
def link_scheme_label_wrap
|
391
|
+
render_with_template(locals: {})
|
392
|
+
end
|
364
393
|
end
|
365
394
|
end
|
366
395
|
end
|
@@ -139,7 +139,7 @@ module Primer
|
|
139
139
|
component.with_item(
|
140
140
|
label: "Really really long label that may wrap, truncate, or appear as a tooltip",
|
141
141
|
truncate_label: truncate_label
|
142
|
-
)
|
142
|
+
)
|
143
143
|
component.with_item(
|
144
144
|
label: "Really really long label that may wrap, truncate, or appear as a tooltip",
|
145
145
|
truncate_label: truncate_label
|
@@ -178,6 +178,20 @@ module Primer
|
|
178
178
|
end
|
179
179
|
end
|
180
180
|
end
|
181
|
+
|
182
|
+
def group_long_label_with_tooltip
|
183
|
+
render(Primer::Beta::NavList.new) do |list|
|
184
|
+
list.with_heading(title: "Repository settings")
|
185
|
+
|
186
|
+
list.with_item(label: "Really really long label that may wrap, truncate, or appear as a tooltip", truncate_label: :show_tooltip) do |item|
|
187
|
+
item.with_leading_visual_icon(icon: :"comment-discussion")
|
188
|
+
|
189
|
+
item.with_item(label: "Interaction limits", href: "/interaction-limits", selected_by_ids: :interaction_limits)
|
190
|
+
item.with_item(label: "Code review limits", href: "/review-limits", selected_by_ids: :code_review_limits)
|
191
|
+
item.with_item(label: "Reported content", href: "/reported-content", selected_by_ids: :reported_content)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|
181
195
|
end
|
182
196
|
end
|
183
197
|
end
|