UNPKG

@procore/core-react

Version:

JSX implementations for core-css

13 lines • 13.2 kB
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var n="object"==typeof exports?t(require("react")):t(e.react);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(window,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=156)}({0:function(t,n){t.exports=e},1:function(e,t,n){var r; /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var a=typeof r;if("string"===a||"number"===a)e.push(this&&this[r]||r);else if(Array.isArray(r))e.push(o.apply(this,r));else if("object"===a)for(var i in r)n.call(r,i)&&r[i]&&e.push(this&&this[i]||i)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(r=function(){return o}.apply(t,[]))||(e.exports=r)}()},156:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n};Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),i=n(1),s=n(157),l=n(9),c=i.bind(s);!function(e){e.alignRight="align-right",e.block="block",e.search="search"}(t.ControlVariantNS||(t.ControlVariantNS={})),t.ListPage=a.forwardRef(function(e,t){var n=e.children,i=e.className,s=o(e,["children","className"]);return a.createElement("div",r({ref:t,className:c("core-l-list-page",i)},s),n)}),t.Main=a.forwardRef(function(e,t){var n=e.children,i=e.className,s=o(e,["children","className"]);return a.createElement("div",r({ref:t,className:c("core-l-list-page__main",i)},s),n)}),t.Banner=a.forwardRef(function(e,t){var n=e.children,i=e.className,s=o(e,["children","className"]);return a.createElement("div",r({ref:t,className:c("core-l-list-page__banner",i)},s),n)}),t.ToolHeader=a.forwardRef(function(e,t){var n=e.children,i=e.className,s=o(e,["children","className"]);return a.createElement("div",r({ref:t,className:c("core-l-list-page__tool-header",i)},s),n)}),t.ContentControls=a.forwardRef(function(e,t){var n=e.children,i=e.className,s=o(e,["children","className"]);return a.createElement("div",r({ref:t,className:c("core-l-list-page__content-controls",i)},s),n)}),t.Body=a.forwardRef(function(e,t){var n=e.children,i=e.className,s=o(e,["children","className"]);return a.createElement("div",r({ref:t,className:c("core-l-list-page__body",i)},s),a.createElement("div",{className:c("core-l-list-page__body__content")},n))}),t.Control=a.forwardRef(function(e,t){var n,i=e.alignRight,s=void 0!==i&&i,l=e.block,f=void 0!==l&&l,u=e.children,d=e.className,p=e.search,_=void 0!==p&&p,h=e.variant,v=o(e,["alignRight","block","children","className","search","variant"]);return a.createElement("div",r({ref:t,className:c("core-l-list-page__content-controls__control",(n={},n["core-l-list-page__content-controls__control--"+h]=h,n["core-l-list-page__content-controls__control--align-right"]=s,n["core-l-list-page__content-controls__control--block"]=f,n["core-l-list-page__content-controls__control--search"]=_,n),d)},v),u)}),t.Banner.displayName="ListPage.Banner",t.Body.displayName="ListPage.Body",t.ContentControls.displayName="ListPage.ContentControls",t.Control.displayName="ListPage.Control",t.Main.displayName="ListPage.Main",t.ToolHeader.displayName="ListPage.ToolHeader",t.default=l.default({Banner:t.Banner,Body:t.Body,ContentControls:t.ContentControls,Control:t.Control,Main:t.Main,ToolHeader:t.ToolHeader},t.ListPage)},157:function(e,t,n){var r=n(158);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(3)(r,o);r.locals&&(e.exports=r.locals)},158:function(e,t,n){(t=e.exports=n(2)(!1)).push([e.i,"._1npcp-7_3_0 {\n display: flex;\n flex-direction: row;\n height: 100%;\n width: 100%;\n /* if banner comes before tool-header, we need some additional space */\n /* always put lines between content-controls */\n /* always put lines between tool-header content-controls or body */\n /* body shouldn't have padding if coming after content-controls */ }\n .tuHQH-7_3_0 {\n display: flex;\n flex: 1 0 auto;\n flex-direction: column;\n min-width: 0;\n padding: 16px 24px; }\n ._9gXNN-7_3_0 {\n flex: 0 0 auto; }\n ._2IY_X-7_3_0 {\n flex: 0 0 auto;\n padding-bottom: 16px; }\n ._3xxOq-7_3_0 {\n align-items: center;\n display: flex;\n flex: 0 0 auto;\n padding: 12px 0; }\n .eC-Xg-7_3_0 {\n flex: 0 0 auto; }\n .UfQ8x-7_3_0 {\n width: 240px; }\n ._5jBis-7_3_0 {\n flex: 1 0 auto; }\n ._3T2Rz-7_3_0 {\n margin-left: auto; }\n .eC-Xg-7_3_0 + .eC-Xg-7_3_0 {\n margin-left: 16px; }\n .eC-Xg-7_3_0 + ._3T2Rz-7_3_0 {\n margin-left: auto; }\n ._1SzJ5-7_3_0 {\n display: flex;\n flex: 1 0 auto;\n padding: 12px 0 0; }\n .M7W0C-7_3_0 {\n flex: 1 1 auto; }\n ._9gXNN-7_3_0 + ._2IY_X-7_3_0 {\n padding-top: 16px; }\n ._3xxOq-7_3_0 + ._3xxOq-7_3_0 {\n border-top: 1px solid #d9d9d9; }\n ._2IY_X-7_3_0 + ._3xxOq-7_3_0,\n ._2IY_X-7_3_0 + ._1SzJ5-7_3_0 {\n border-top: 1px solid #d9d9d9; }\n ._3xxOq-7_3_0 + ._1SzJ5-7_3_0 {\n padding: 0; }\n",""]),t.locals={"core-l-list-page":"_1npcp-7_3_0","core-l-list-page__main":"tuHQH-7_3_0","core-l-list-page__banner":"_9gXNN-7_3_0","core-l-list-page__tool-header":"_2IY_X-7_3_0","core-l-list-page__content-controls":"_3xxOq-7_3_0","core-l-list-page__content-controls__control":"eC-Xg-7_3_0","core-l-list-page__content-controls__control--search":"UfQ8x-7_3_0","core-l-list-page__content-controls__control--block":"_5jBis-7_3_0","core-l-list-page__content-controls__control--align-right":"_3T2Rz-7_3_0","core-l-list-page__body":"_1SzJ5-7_3_0","core-l-list-page__body__content":"M7W0C-7_3_0"}},2:function(e,t,n){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=function(e,t){var n=e[1]||"",r=e[3];if(!r)return n;if(t&&"function"==typeof btoa){var o=(i=r,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),a=r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"});return[n].concat(a).concat([o]).join("\n")}var i;return[n].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},o=0;o<this.length;o++){var a=this[o][0];null!=a&&(r[a]=!0)}for(o=0;o<e.length;o++){var i=e[o];null!=i[0]&&r[i[0]]||(n&&!i[2]?i[2]=n:n&&(i[2]="("+i[2]+") and ("+n+")"),t.push(i))}},t}},3:function(e,t,n){var r,o,a={},i=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),s=function(e){var t={};return function(e,n){if("function"==typeof e)return e();if(void 0===t[e]){var r=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,n);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),l=null,c=0,f=[],u=n(6);function d(e,t){for(var n=0;n<e.length;n++){var r=e[n],o=a[r.id];if(o){o.refs++;for(var i=0;i<o.parts.length;i++)o.parts[i](r.parts[i]);for(;i<r.parts.length;i++)o.parts.push(m(r.parts[i],t))}else{var s=[];for(i=0;i<r.parts.length;i++)s.push(m(r.parts[i],t));a[r.id]={id:r.id,refs:1,parts:s}}}}function p(e,t){for(var n=[],r={},o=0;o<e.length;o++){var a=e[o],i=t.base?a[0]+t.base:a[0],s={css:a[1],media:a[2],sourceMap:a[3]};r[i]?r[i].parts.push(s):n.push(r[i]={id:i,parts:[s]})}return n}function _(e,t){var n=s(e.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=f[f.length-1];if("top"===e.insertAt)r?r.nextSibling?n.insertBefore(t,r.nextSibling):n.appendChild(t):n.insertBefore(t,n.firstChild),f.push(t);else if("bottom"===e.insertAt)n.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var o=s(e.insertAt.before,n);n.insertBefore(t,o)}}function h(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=f.indexOf(e);t>=0&&f.splice(t,1)}function v(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var r=function(){0;return n.nc}();r&&(e.attrs.nonce=r)}return g(t,e.attrs),_(e,t),t}function g(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function m(e,t){var n,r,o,a;if(t.transform&&e.css){if(!(a="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=a}if(t.singleton){var i=c++;n=l||(l=v(t)),r=x.bind(null,n,i,!1),o=x.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",g(t,e.attrs),_(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||a)&&(r=u(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([r],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(i),s&&URL.revokeObjectURL(s)}.bind(null,n,t),o=function(){h(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute("media",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){h(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=i()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=p(e,t);return d(n,t),function(e){for(var r=[],o=0;o<n.length;o++){var i=n[o];(s=a[i.id]).refs--,r.push(s)}e&&d(p(e,t),t);for(o=0;o<r.length;o++){var s;if(0===(s=r[o]).refs){for(var l=0;l<s.parts.length;l++)s.parts[l]();delete a[s.id]}}}};var y,b=(y=[],function(e,t){return y[e]=t,y.filter(Boolean).join("\n")});function x(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=b(t,o);else{var a=document.createTextNode(o),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}},6:function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var o,a=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?e:(o=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:r+a.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},9:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e,t){var n=t;return Object.keys(e).forEach(function(t){n[t]=e[t]}),n}}})}); //# sourceMappingURL=ListPage.js.map