@procore/core-react
Version:
JSX implementations for core-css
13 lines • 12.7 kB
JavaScript
!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 r="object"==typeof exports?t(require("react")):t(e.react);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=159)}({0:function(t,r){t.exports=e},1:function(e,t,r){var n;
/*!
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 r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(this&&this[n]||n);else if(Array.isArray(n))e.push(o.apply(this,n));else if("object"===i)for(var a in n)r.call(n,a)&&n[a]&&e.push(this&&this[a]||a)}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},159:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(r[n[o]]=e[n[o]])}return r};Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),a=r(1),s=r(160),c=r(9),l=a.bind(s);t.Sidebar=i.forwardRef(function(e,t){var r=e.children,a=e.className,s=o(e,["children","className"]);return i.createElement("div",n({ref:t,className:l("core-l-sidebar",a)},s),r)}),t.Divider=i.forwardRef(function(e,t){e.children;var r=e.className,a=o(e,["children","className"]);return i.createElement("div",n({ref:t,className:l("core-l-sidebar__divider",r)},a))}),t.Button=i.forwardRef(function(e,t){var r=e.children,a=e.className,s=o(e,["children","className"]);return i.createElement("div",n({ref:t,className:l("core-l-sidebar__button",a)},s),r)}),t.Header=i.forwardRef(function(e,t){var r=e.children,a=e.className,s=o(e,["children","className"]);return i.createElement("div",n({ref:t,className:l("core-l-sidebar__header",a)},s),r)}),t.HeaderLabel=i.forwardRef(function(e,t){var r=e.children,a=e.className,s=o(e,["children","className"]);return i.createElement("h2",n({ref:t,className:l("core-l-sidebar__header__label",a)},s),r)}),t.HeaderAction=i.forwardRef(function(e,t){var r=e.children,a=e.className,s=o(e,["children","className"]);return i.createElement("a",n({ref:t,className:l("core-l-sidebar__header__action",a)},s),r)}),t.Menu=i.forwardRef(function(e,t){var r=e.children,a=e.className,s=o(e,["children","className"]);return i.createElement("ol",n({ref:t,className:l("core-l-sidebar__menu",a)},s),r)}),t.MenuItem=i.forwardRef(function(e,t){var r,a=e.active,s=void 0!==a&&a,c=e.children,f=e.className,u=o(e,["active","children","className"]);return i.createElement("li",n({ref:t,className:l("core-l-sidebar__menu__item",(r={},r["core-l-sidebar__menu__item--active"]=s,r),f)},u),c)}),t.Sidebar.displayName="Sidebar",t.Divider.displayName="Sidebar.Divider",t.Button.displayName="Sidebar.Button",t.Header.displayName="Sidebar.Header",t.HeaderLabel.displayName="Sidebar.HeaderLabel",t.HeaderAction.displayName="Sidebar.HeaderAction",t.Menu.displayName="Sidebar.",t.MenuItem.displayName="Sidebar.",t.default=c.default({Divider:t.Divider,Button:t.Button,Header:t.Header,HeaderLabel:t.HeaderLabel,HeaderAction:t.HeaderAction,Menu:t.Menu,MenuItem:t.MenuItem},t.Sidebar)},160:function(e,t,r){var n=r(161);"string"==typeof n&&(n=[[e.i,n,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};r(3)(n,o);n.locals&&(e.exports=n.locals)},161:function(e,t,r){(t=e.exports=r(2)(!1)).push([e.i,'._2Vxq4-7_3_0 {\n background-color: #f5f5f5;\n padding: 16px 0;\n position: relative; }\n ._15EMP-7_3_0 {\n padding: 0 16px; }\n ._15EMP-7_3_0 + ._15EMP-7_3_0 {\n padding-top: 8px; }\n ._-1sWN-7_3_0 {\n margin: 24px;\n border-bottom: 1px solid #e6e6e6;\n height: 1px; }\n ._2C7jT-7_3_0 {\n align-items: center;\n display: flex;\n justify-content: space-between;\n padding: 0 24px 12px; }\n ._125gK-7_3_0 {\n color: #4d4d4d;\n font-size: 16px; }\n ._2dUk0-7_3_0 {\n color: #f47e42;\n cursor: pointer;\n font-size: 13px;\n line-height: 15px; }\n .Shso3-7_3_0 {\n list-style: none; }\n ._2nx2P-7_3_0 {\n align-items: center;\n color: #808080;\n cursor: pointer;\n display: flex;\n font-size: 13px;\n line-height: 16px;\n position: relative;\n padding: 8px 24px;\n transition: all 0.2s ease-in-out; }\n ._2nx2P-7_3_0::after {\n background-color: transparent;\n content: "";\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n transition: all 0.2s ease-in-out;\n width: 5px; }\n .iVrw7-7_3_0::after, ._2nx2P-7_3_0:active::after, ._3s6xi-7_3_0::after, ._2nx2P-7_3_0:hover::after {\n background-color: #f47e42; }\n ._3s6xi-7_3_0, ._2nx2P-7_3_0:hover {\n background-color: #e6e6e6;\n color: #333333; }\n',""]),t.locals={"core-l-sidebar":"_2Vxq4-7_3_0","core-l-sidebar__button":"_15EMP-7_3_0","core-l-sidebar__divider":"_-1sWN-7_3_0","core-l-sidebar__header":"_2C7jT-7_3_0","core-l-sidebar__header__label":"_125gK-7_3_0","core-l-sidebar__header__action":"_2dUk0-7_3_0","core-l-sidebar__menu":"Shso3-7_3_0","core-l-sidebar__menu__item":"_2nx2P-7_3_0","core-l-sidebar__menu__item--active":"iVrw7-7_3_0","core-l-sidebar__menu__item--hover":"_3s6xi-7_3_0"}},2:function(e,t,r){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=function(e,t){var r=e[1]||"",n=e[3];if(!n)return r;if(t&&"function"==typeof btoa){var o=(a=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(a))))+" */"),i=n.sources.map(function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"});return[r].concat(i).concat([o]).join("\n")}var a;return[r].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,r){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},o=0;o<this.length;o++){var i=this[o][0];null!=i&&(n[i]=!0)}for(o=0;o<e.length;o++){var a=e[o];null!=a[0]&&n[a[0]]||(r&&!a[2]?a[2]=r:r&&(a[2]="("+a[2]+") and ("+r+")"),t.push(a))}},t}},3:function(e,t,r){var n,o,i={},a=(n=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=n.apply(this,arguments)),o}),s=function(e){var t={};return function(e,r){if("function"==typeof e)return e();if(void 0===t[e]){var n=function(e,t){return t?t.querySelector(e):document.querySelector(e)}.call(this,e,r);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),c=null,l=0,f=[],u=r(6);function d(e,t){for(var r=0;r<e.length;r++){var n=e[r],o=i[n.id];if(o){o.refs++;for(var a=0;a<o.parts.length;a++)o.parts[a](n.parts[a]);for(;a<n.parts.length;a++)o.parts.push(m(n.parts[a],t))}else{var s=[];for(a=0;a<n.parts.length;a++)s.push(m(n.parts[a],t));i[n.id]={id:n.id,refs:1,parts:s}}}}function p(e,t){for(var r=[],n={},o=0;o<e.length;o++){var i=e[o],a=t.base?i[0]+t.base:i[0],s={css:i[1],media:i[2],sourceMap:i[3]};n[a]?n[a].parts.push(s):r.push(n[a]={id:a,parts:[s]})}return r}function _(e,t){var r=s(e.insertInto);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=f[f.length-1];if("top"===e.insertAt)n?n.nextSibling?r.insertBefore(t,n.nextSibling):r.appendChild(t):r.insertBefore(t,r.firstChild),f.push(t);else if("bottom"===e.insertAt)r.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,r);r.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 b(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var n=function(){0;return r.nc}();n&&(e.attrs.nonce=n)}return v(t,e.attrs),_(e,t),t}function v(e,t){Object.keys(t).forEach(function(r){e.setAttribute(r,t[r])})}function m(e,t){var r,n,o,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var a=l++;r=c||(c=b(t)),n=g.bind(null,r,a,!1),o=g.bind(null,r,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),_(e,t),t}(t),n=function(e,t,r){var n=r.css,o=r.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(n=u(n));o&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([n],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,r,t),o=function(){h(r),r.href&&URL.revokeObjectURL(r.href)}):(r=b(t),n=function(e,t){var r=t.css,n=t.media;n&&e.setAttribute("media",n);if(e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}.bind(null,r),o=function(){h(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(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=a()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var r=p(e,t);return d(r,t),function(e){for(var n=[],o=0;o<r.length;o++){var a=r[o];(s=i[a.id]).refs--,n.push(s)}e&&d(p(e,t),t);for(o=0;o<n.length;o++){var s;if(0===(s=n[o]).refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete i[s.id]}}}};var y,x=(y=[],function(e,t){return y[e]=t,y.filter(Boolean).join("\n")});function g(e,t,r,n){var o=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=x(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}},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 r=t.protocol+"//"+t.host,n=r+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var o,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?r+i:n+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},9:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=function(e,t){var r=t;return Object.keys(e).forEach(function(t){r[t]=e[t]}),r}}})});
//# sourceMappingURL=Sidebar.js.map